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

WIP: ESM + CJS dual support #552

Closed

Conversation

julrich
Copy link

@julrich julrich commented Sep 10, 2023

Some initial work to enable ESM usage of the package. Also keeps CJS for backwards compatibility.
The changes are in part based on this article by Anthony Fu: https://antfu.me/posts/publish-esm-and-cjs

Additionally, tsup is used to dual-bundle: https://github.com/egoist/tsup

Test suite still runs, and is all green.

Still though, more testing is needed for:

  • CJS usage... ESM works, which is what we're using, but CJS is kind of untested (though I think the test suite should access the CJS version, and all the tests still pass)
  • Browser usage. I think this would be best tested through https://github.com/bcherny/json-schema-to-typescript-browser? Haven't dove in there yet, though

@bcherny
Copy link
Owner

bcherny commented Sep 23, 2023

Thanks for the contribution, but I'm a little confused what's going on in this PR. Why are we relying on your @kickstartds/json-schema-to-typescript fork?

Let's continue the discussion in #551.

@bcherny bcherny closed this Sep 23, 2023
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

Successfully merging this pull request may close these issues.

None yet

2 participants