-
Notifications
You must be signed in to change notification settings - Fork 24
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
Support Node.js ESM #39
base: main
Are you sure you want to change the base?
Conversation
kettanaito
commented
Oct 17, 2024
- Closes Incorrect "exports" in package.json #38
|
Hi, @pimterry 👋 Can you please help me with the module tests for this change? I'm not entire familiar with what you are using for that. Thanks! |
There's no formal framework. There's a single file of Mocha tests in test/, written in TypeScript, and there's scripts and to launch that same test file in various different ways for each env in package.json. We'd need a new script there, which runs those tests in Node via ESM. I'm not sure what the best approach to do that is - the only constraint is sharing the same test code (I'd really like to avoid duplicating this) but if you want to make separate Node vs Node-ESM entrypoints then that would be fine. Changes to the cross-compat code at the start of the test file (or even splitting it from the test implementations) is fine too, up to you. Since this isn't usable in old Node anyway, you could skip these tests in that case, and in that case you could also potentially use |
@@ -21,6 +21,12 @@ shell.exec('wasm-pack build --target nodejs'); | |||
shell.mv('pkg', 'pkg.node'); | |||
shell.rm('pkg.node/{LICENSE,package.json,README.md,.gitignore}'); | |||
|
|||
// Create the esm node output | |||
shell.rm('-rf', 'pkg'); | |||
shell.exec('wasm-pack build --target experemintal-nodejs-module'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Surely experemintal
is a typo for experimental
here