Affected Packages
@changesets/cli
The Problem
Context
I'm trying to create a script that runs on commit. Following the documentation, I have added this to my changesets config.json:
{
"commit": ["../scripts/commit.js", { "customOption": true }]
}
When using es6 syntax inside commit.js, pnpm changeset fails because it is run in a .cjs file. Relevant output:
❯ pnpm changeset
🦋 What kind of change is this for rh-admin-utils? (current version is 2.3.5) · patch
🦋 Please enter a summary for this change (this will be in the changelogs).
🦋 (submit empty line to open external editor)
🦋 Summary · goo bar baz
🦋
🦋 === Summary of changesets ===
🦋 patch: rh-admin-utils
🦋
🦋 Is this your desired changeset? (Y/n) · true
🦋 error Error [ERR_REQUIRE_ESM]: require() of ES Module /Users/[...]/scripts/commit.js from /Users/[...]/node_modules/.pnpm/@[email protected]/node_modules/@changesets/cli/dist/changesets-cli.cjs.js not supported.
I've seen that there exists an esm version just besides the changesets-cli.cjs.js version. My package has {"type": "module"}.
Proposed solution
I don't know really :)
Affected Packages
@changesets/cli
The Problem
Context
I'm trying to create a script that runs on
commit. Following the documentation, I have added this to my changesets config.json:{
"commit": ["../scripts/commit.js", { "customOption": true }]
}
When using es6 syntax inside
commit.js,pnpm changesetfails because it is run in a.cjsfile. Relevant output:I've seen that there exists an esm version just besides the
changesets-cli.cjs.jsversion. My package has{"type": "module"}.Proposed solution
I don't know really :)