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
Support *.cjs configs #1814
Support *.cjs configs #1814
Comments
please double check the version of Line 29 in 6013a56
|
My apologies, @travi. I could have sworn that I looked at My config: // release.config.cjs
const releaseRules = [
{ type: 'docs', release: 'patch' }
]
const gitOptions = {
assets: ['CHANGELOG.md', 'dist/**/*', 'package.json']
}
module.exports = {
plugins: [
['@semantic-release/commit-analyzer', { releaseRules }],
'@semantic-release/release-notes-generator',
'@semantic-release/changelog',
'@semantic-release/npm',
['@semantic-release/git', gitOptions]
]
} $ yarn run semantic-release --debug --dry-run
[11:22:25 AM] [semantic-release] › ℹ Running semantic-release version 17.3.9
semantic-release:config load config from: undefined +0ms ^^^ I've omitted the remainder of the output as the $ node --version
v14.15.4
$ echo ${NODE_OPTIONS}
--experimental-modules --experimental-vm-modules --max-old-space-size=4096
$ yarn --version
1.22.10 Using Ubuntu 18.04.5 LTS Let me know if any additional information is needed or if I've misread any documentation about using EDIT: Also tried clearing $ rm -rf node_modules && yarn install |
this seems like a valid request and we want to make sure that if you could help us investigate, it would really help this be resolved more quickly. our usage of semantic-release/lib/get-config.js Line 24 in 21c151f
|
Sure thing! Here's what I've found briefly so far... In semantic-release/lib/get-config.js Line 11 in f25c352
semantic-release/lib/get-config.js Lines 12 to 20 in f25c352
According to the cosmicconfig docs however, the module name, in this case "release" is used to create the default set of search places.
By providing the For reference, the default [
'package.json',
`.${moduleName}rc`,
`.${moduleName}rc.json`,
`.${moduleName}rc.yaml`,
`.${moduleName}rc.yml`,
`.${moduleName}rc.js`,
`.${moduleName}rc.cjs`,
`${moduleName}.config.js`,
`${moduleName}.config.cjs`,
] Based on the current implementation and the defaults generated by I might have time to test this locally and/or submit a PR but thought I'd at least share these findings here in case anyone has time to do so. |
I was able to test this locally in the end and removing the |
This change adds support for `*.cjs` config files by removing the explicit use of `searchPlaces` options and relying and the default search places generated by `cosmicconfig`. As per the docs for [`cosmicconfig`][cc], the defaults include all the extensions/formats previously supported by semantic-release in addition to the new .cjs variants. Resolves [semantic-release#1814][issue]. [issue]: https://gitlab.qualiproto.fr/pyx4/qualipso/-/issues/2172 [cc]: https://github.com/davidtheclark/cosmiconfig#searchplaces
This change adds support for `*.cjs` config files by removing the explicit use of `searchPlaces` options and relying and the default search places generated by `cosmicconfig`. As per the docs for [`cosmicconfig`][cc], the defaults include all the extensions/formats previously supported by semantic-release in addition to the new .cjs variants. Resolves [semantic-release#1814][issue]. [issue]: semantic-release#1814 [cc]: https://github.com/davidtheclark/cosmiconfig#searchplaces
To anyone interested, submitted PR #1815 and it is pending review. |
This change adds support for `*.cjs` config files by removing the explicit use of `searchPlaces` options and relying and the default search places generated by `cosmicconfig`. As per the docs for [`cosmicconfig`][cc], the defaults include all the extensions/formats previously supported by semantic-release in addition to the new .cjs variants. Resolves [semantic-release#1814][issue]. [issue]: semantic-release#1814 [cc]: https://github.com/davidtheclark/cosmiconfig#searchplaces
…1815) This change adds support for `*.cjs` config files by removing the explicit use of `searchPlaces` options and relying and the default search places generated by `cosmicconfig`. As per the docs for [`cosmicconfig`][cc], the defaults include all the extensions/formats previously supported by semantic-release in addition to the new .cjs variants. Resolves [#1814][issue]. [issue]: #1814 [cc]: https://github.com/davidtheclark/cosmiconfig#searchplaces
…#1815) This change adds support for `*.cjs` config files by removing the explicit use of `searchPlaces` options and relying and the default search places generated by `cosmicconfig`. As per the docs for [`cosmicconfig`][cc], the defaults include all the extensions/formats previously supported by semantic-release in addition to the new .cjs variants. Resolves [#1814][issue]. [issue]: semantic-release/semantic-release#1814 [cc]: https://github.com/davidtheclark/cosmiconfig#searchplaces
New feature motivation
When attempting to use
semantic-release
with a ESM-written package ("type": "module"
) and node with ES modules enabled, a plainrelease.config.js
config fails understandably given the tool is written withrequire()
s. Renaming the config torelease.config.cjs
does not work as the version ofcosmicconfig
used bysemantic-release
does not search for.cjs
files. Thus, only thejson
config options are available.Updating the
cosmicconfig
dependency to v7.0.0 would allow one to usesemantic-release
developing a package implicitly in ES modules (--experimental-modules
).New feature description
Supports
*.cjs
file extensions likerelease.config.cjs
for configuringsemantic-release
.New feature implementation
Update
cosmicconfig
dependency to v7.0.0 which adds support for*.cjs
file extensions.The text was updated successfully, but these errors were encountered: