Synchronous extends for shareable configuration #1831
Unanswered
isuftin
asked this question in
Configuration
Replies: 2 comments
-
In case more info is needed... debug output...
And the debug log...
|
Beta Was this translation helpful? Give feedback.
0 replies
-
Unless someone provides a better answer, not using let shared_config = require('my-shareable-config')
let config = {...shared_config, ...{
branches: [
'master',
{
name: 'development',
prerelease: true
}
],
// more config stuff here
}}
if (config.branches.some(it => it === branch || (it.name === branch && !it.prerelease))) {
// Do stuff here if it's not a pre-release branch, like create a CHANGELOG
}
module.exports = config |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am hitting up against an issue with how extends works in semantic release. It seems to be a problem (feature?) of when and how semrel combines shareable config with the actual config.
Here's my inital
release.config.js
without using extends...This works as expected.
Shareable config, published as
my-shareable-config
:My
release.config.js
using shared config:The result:
[semantic-release] › ✖ An error occurred while running semantic-release: TypeError: Cannot read property 'some' of undefined
If I remove the javascript, everything works as expected and the branches I define in my shareable config are what are used.
If I add a
console.out(config)
right before the javascript in the scenario where I use the extends, I get...{ extends: [ 'my-shareable-config' ] }
I would expect that by this point my config object would contain the data I have in
my-shareable-config
but it seems to not happen until later in the process.So my question: Is there anything I can do here to include js in my
release.config.js
that works on content coming in from anextends
?I am using semantic-release 17.4.0
Beta Was this translation helpful? Give feedback.
All reactions