-
Notifications
You must be signed in to change notification settings - Fork 2
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: export commonjs and esm from package #59
Conversation
✅ Deploy Preview for blobs-js ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
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 approach looks good. These ESM migrations typically break something, so i'd encourage you to publish this as a prerelease first (or yolo it, as you prefer).
Just calling out that this change starts bundling in all dependencies. Shouldn't be a problem as long as the dependencies aren't big, but this will probably break for more involved dependencies, like when there's native code. (but I think esbuild was already doing that before? plus this needs to work in edge functions as well.)
On the bundling part you are completely right. Next goal is to get rid of https://publint.dev/@netlify/[email protected] and types as well: https://arethetypeswrong.github.io/?p=%40netlify%2Fblobs%402.1.0-rc.2 |
import { rm } from 'node:fs/promises' | ||
import { argv } from 'process' | ||
|
||
// eslint-disable-next-line import/no-extraneous-dependencies |
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.
Why is this an extraneous dependency?
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.
because it's a dev dependency 🤷 the lint rule is crazy.
Eslint does not know that we don't need it as dependency:
'tsup' should be listed in the project's dependencies. Run 'npm i -S tsup' to add iteslintimport/no-extraneous-dependencies
🎉 Thanks for sending this pull request! 🎉
To support our old CommonJS packages like the next-runtime export both commonjs and ESM.
Full discussion is here: https://netlify.slack.com/archives/C05DNT7CLFK/p1696930990204579
cc @ascorbic @orinokai @pieh