dhoulb / multi-semantic-release

Proof of concept that wraps semantic-release to work with monorepos.
BSD Zero Clause License
203 stars 36 forks source link

support esm #141

Open its-dibo opened 1 year ago

its-dibo commented 1 year ago

the official semantic-release now supporting esm, but it seems that this package doesn't work with esm projects.

I got this error

[12:14:08 AM] › 🎉  Started multirelease! Loading 26 packages...
[multi-semantic-release]: Error [ERR_REQUIRE_ESM]: require() of ES Module /workspace/dibo/release.config.js from /home/gitpod/.npm/_npx/fc5f6a55a6a495a8/node_modules/cosmiconfig/dist/loaders.js not supported.
Instead change the require of release.config.js in /home/gitpod/.npm/_npx/fc5f6a55a6a495a8/node_modules/cosmiconfig/dist/loaders.js to a dynamic import() which is available in all CommonJS modules.
    at module.exports (/home/gitpod/.npm/_npx/fc5f6a55a6a495a8/node_modules/import-fresh/index.js:32:59)
    at loadJs (/home/gitpod/.npm/_npx/fc5f6a55a6a495a8/node_modules/cosmiconfig/dist/loaders.js:16:18)
    at Explorer.loadFileContent (/home/gitpod/.npm/_npx/fc5f6a55a6a495a8/node_modules/cosmiconfig/dist/Explorer.js:84:32)
    at Explorer.createCosmiconfigResult (/home/gitpod/.npm/_npx/fc5f6a55a6a495a8/node_modules/cosmiconfig/dist/Explorer.js:89:36)
    at Explorer.loadSearchPlace (/home/gitpod/.npm/_npx/fc5f6a55a6a495a8/node_modules/cosmiconfig/dist/Explorer.js:70:31)
    at async Explorer.searchDirectory (/home/gitpod/.npm/_npx/fc5f6a55a6a495a8/node_modules/cosmiconfig/dist/Explorer.js:55:27)
    at async run (/home/gitpod/.npm/_npx/fc5f6a55a6a495a8/node_modules/cosmiconfig/dist/Explorer.js:35:22)
    at async cacheWrapper (/home/gitpod/.npm/_npx/fc5f6a55a6a495a8/node_modules/cosmiconfig/dist/cacheWrapper.js:16:18)
    at async Explorer.search (/home/gitpod/.npm/_npx/fc5f6a55a6a495a8/node_modules/cosmiconfig/dist/Explorer.js:27:20)
    at async getConfig (/home/gitpod/.npm/_npx/fc5f6a55a6a495a8/node_modules/multi-semantic-release/lib/getConfig.js:28:17)
    at async multiSemanticRelease (/home/gitpod/.npm/_npx/fc5f6a55a6a495a8/node_modules/multi-semantic-release/lib/multiSemanticRelease.js:66:24) {
  code: 'ERR_REQUIRE_ESM'
}
ysitbon commented 1 year ago

I confirm the issue. We tried to upgrade to latest semantic release packages and we were forced to downgrade because of this.

antongolub commented 1 year ago

As a workaround, you can try temporary using https://github.com/qiwi/multi-semantic-release. This fork should be compatible with semrel >=19 and its esm plugins, but, I'm afraid, nobody checked this.

ysitbon commented 1 year ago

Thank you! I'll try.

andorfermichael commented 1 year ago

an update would be really great

Wxh16144 commented 1 year ago

Any update?

antongolub commented 1 year ago

I'm afraid, not yet.

tholu commented 8 months ago

@antongolub Any plans on supporting ESM in this repo or will the fork https://github.com/qiwi/multi-semantic-release be the one that is maintained in the future?

prisis commented 5 months ago

@tholu if you like you could use my fork https://github.com/anolilab/semantic-release/tree/main/packages/multi-semantic-release it supports cjs and esm