-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
ci(): migrate scripts to es6 modules #8266
Conversation
package.json
Outdated
@@ -51,17 +51,17 @@ | |||
}, | |||
"license": "MIT", | |||
"scripts": { | |||
"fabric": "node ./scripts/index.mjs", |
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.
can we call this CLI or something else that is not fabric? sounds confusing to me.
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.
done
import process from 'node:process'; | ||
import { fileURLToPath } from 'node:url'; | ||
import os from 'os'; | ||
import { listFiles, transform as transformFiles } from './transform_files.mjs'; |
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.
can MJS import normal commonJS modules if needed?
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.
seems possible
there's also an option to import require and use that, see https://nodejs.org/api/module.html#modulecreaterequirefilename
https://nodejs.org/api/esm.html#differences-between-es-modules-and-commonjs
* convert to modules * rename cmd
https://nodejs.org/api/esm.html#enabling
migrate scripts to es6