-
Notifications
You must be signed in to change notification settings - Fork 33
Max/esmodules #92
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
Max/esmodules #92
Conversation
package.json
Outdated
| }, | ||
| "devDependencies": { | ||
| "@babel/preset-env": "^7.25.4", | ||
| "@rollup/plugin-commonjs": "^26.0.3", |
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.
Not a huge deal, but there are newer versions of this package available that we should use. The version listed here has a bunch of warnings for the glob versions used. If you update to v28 those warnings go away
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.
Should the other example files also be renamed to .mjs? Or is just one needed to make sure rollup is working correctly?
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.
I don't think it's necessary, as the other examples work fine with CommonJS. However, if you'd like to add new examples using .mjs, I’m not opposed to it.
Makefile
Outdated
| build: | ||
| npm run build | ||
|
|
||
| publish: test version upload unversion |
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.
the build command should be added as part of the publish command. I think
publish: test version build upload unversion should work?
In addition, we should define a .npmignore file with the following lines in order to not publish unecessary files npm (not for privacy reasons, but just for keeping things tidy)
src/
tests/
node_modules/
examples/
.env
.vscode/
.idea/
.DS_Store
.eslintignore
.eslintrc.json
.git/
.github/
.gitignore
.prettierignore
.prettierrc
*.log
You can test out what will be published to npm with npm publish --dry-run
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.
@camiblanch @maxwellpothier I agree with reducing the package size. When I first looked at the project, I wasn't sure why all the code was being exported in the package, so I left it as it was. However, in this case, it would be better to specify which files to include rather than excluding them. In the package.json, you can do something like this:
{
"files": [
"dist",
"README.md",
"LICENSE"
]
}
This way, you’re only including the necessary build folder (dist), which is meant for publishing the package to npm, and other relevant files like the README and license.
|
I've made those changes to update our dependencies and publishing process. I originally upgraded |
camiblanch
left a comment
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.
Looks great!
This is branched off the changes created by @akadoshin here: #90