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

feature request: change import style based on package.json "type" #40

Open
croconut opened this issue Mar 6, 2024 · 0 comments
Open

Comments

@croconut
Copy link

croconut commented Mar 6, 2024

Library version:

1.7.1

JSON schema version: draft-04

I am willing to contribute to fix the issue 💚

The current behavior

It currently doesn't generate JS at all.

The expected behavior

If it generates JS (e.g. the feature request for JS creation is completed), it would be nice to resolve exported code as either common js or esm based on a combination of the (same directory or flag-argument) package.json's type & the output file's extension. At the moment, I'm have to locally wrap the code generator with some extras:

  • run on directories for input / output - really simple, not sure it requires a feature request, but would be nice QoL
  • convert the generated TS code to generate JSDocs / commonjs (its still miles ahead for integration testing) - im personally not a fan of wrapping codegen, really hard to know when i'll break it if i dont directly extend the library

Basically, I can't get my org to use TS so my workflow is sharing schemas with API consumers and use @typebox's compiler to do the live type checking.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant