Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Schemas that reference another schemas are generated with wrong export/import types #3045

Open
pdandradeb opened this issue Nov 19, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@pdandradeb
Copy link

Describe the bug

I have a schema named opinion referencing another called topic. The generated code is referencing a Main type that isn't exported which is causing tsc to fail:

Screenshot 2024-11-19 at 15 53 06

Screenshot 2024-11-19 at 16 00 52

To Reproduce

Steps to reproduce the behavior:

  1. git clone [email protected]:pdandradeb/atproto-lex-test.git
  2. cd ./atproto-lex-test && npm install
  3. npm run typecheck

Expected behavior

API files generated without type errors.

Details

  • Operating system: macos 14.4.1
  • Node version: 20.15.0

Additional context

Before reaching this stage, I learned a lot examining the source of linkat (many thanks to @mkizka). From there I copied postinstall.sh that handles downloading and generating com.atproto.repo schemas that are required by the generated api and the app/global.d.ts file declaring multiformats/cid to "fix" Could not find a declaration file for module 'multiformats/cid' errors.

Is there a better way to handle all that or any other guidance that someone could point me towards?
I've also looked into statusphere-example-app but it looks like it faces the same problem:

Screenshot 2024-11-19 at 16 32 56

Screenshot 2024-11-19 at 16 33 20

Thanks in advance!

@pdandradeb pdandradeb added the bug Something isn't working label Nov 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant