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

feat: drop node < 18, es module, update testing to use vitest #36

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

knownasilya
Copy link
Owner

@knownasilya knownasilya commented Feb 10, 2024

BREAKING CHANGE: drop node < 18, es modules and cjs

Not that big of a change, mostly lockfile bloating the numbers

SBoudrias
SBoudrias previously approved these changes Feb 12, 2024
Copy link
Collaborator

@SBoudrias SBoudrias left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes LGTM

I'll just share Inquirer (the @inquirer/* at least) won't be able to upgrade to this version since I kept the packages dual cjs/esm. Going esm only caused too much pain on the users; and way too many folks didn't know how to handle that (turning into a huge support load on our issue tracker.)

@knownasilya
Copy link
Owner Author

@SBoudrias I was wondering on the dual version and if it was needed, this answers my question. Any suggestions on how to do the dual variant?

@SBoudrias
Copy link
Collaborator

I found it not too complicated to put together with Typescript (if you don't mind using it for cli-width.) Not sure how I'd approach it just with raw JS.

But you can see I generate 2 tsconfig (tsconfig.json/tsconfig.cjs.json.) And then I compile both output at build time. And lastly, there's a "bug" in TS where the output isn't clear... So last step is run a little script to fix the files imports.

The extension issue maybe could be fixed if I didn't use .mts, but that caused some other issues. So that ended up being easier for me (without having to rely on another build-tool middle layer I need to learn, configure and maintain.)

Hope this help - esm/cjs is far from easy today unfortunately 😞

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.

2 participants