Skip to content
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

conventionalcommits preset broken #512

Closed
mydea opened this issue Aug 12, 2019 · 9 comments · Fixed by #521
Closed

conventionalcommits preset broken #512

mydea opened this issue Aug 12, 2019 · 9 comments · Fixed by #521

Comments

@mydea
Copy link

mydea commented Aug 12, 2019

Hi,

I have just installed the latest version of this, and the conventionalcommits preset seems to be broken.

I did a bit of digging, and it seems to be breaking here:
https://github.com/conventional-changelog/conventional-changelog/blob/master/packages/conventional-changelog-preset-loader/index.js#L36

But path is always a string for me, so the callback-style here:
https://github.com/conventional-changelog/conventional-changelog/blob/master/packages/conventional-changelog-conventionalcommits/index.js

I looked into other presets, and they either take a callback only, or directly return a promise. However, they do not seem to be taking any config or so, so not sure how to fix this, as the config is used in multiple places here.

So basically, these styles seem to be working:

// Angular
module.exports = Q.all([conventionalChangelog, parserOpts, recommendedBumpOpts, writerOpts])
  .spread((conventionalChangelog, parserOpts, recommendedBumpOpts, writerOpts) => {
    return { conventionalChangelog, parserOpts, recommendedBumpOpts, writerOpts }
  })

// Ember
module.exports = presetOpts

function presetOpts (cb) {
  Q.all([conventionalChangelog, parserOpts, recommendedBumpOpts, writerOpts])
    .spread((conventionalChangelog, parserOpts, recommendedBumpOpts, writerOpts) => {
      cb(null, { gitRawCommitsOpts: { noMerges: null }, conventionalChangelog, parserOpts, recommendedBumpOpts, writerOpts })
    })
}

But this is not working:

module.exports = function (config) {
  return Q.all([
    conventionalChangelog(config),
    parserOpts(config),
    recommendedBumpOpts(config),
    writerOpts(config)
  ]).spread((conventionalChangelog, parserOpts, recommendedBumpOpts, writerOpts) => {
    return { conventionalChangelog, parserOpts, recommendedBumpOpts, writerOpts }
  })
}
mydea pushed a commit to fabscale/ember-cognito-identity that referenced this issue Aug 12, 2019
This is necessary, as conventionalcommits style is broken.
See: conventional-changelog/conventional-changelog#512
@eshepelyuk
Copy link

Any updates on this ?

tommywo added a commit to tommywo/conventional-changelog that referenced this issue Sep 3, 2019
tommywo added a commit to tommywo/conventional-changelog that referenced this issue Sep 4, 2019
@tommywo tommywo closed this as completed in 6425972 Sep 5, 2019
@tommywo tommywo reopened this Sep 7, 2019
@tommywo
Copy link
Member

tommywo commented Sep 7, 2019

I had to revert my fix, because it broke callback style presets.

tommywo added a commit to tommywo/conventional-changelog that referenced this issue Sep 7, 2019
tommywo added a commit to tommywo/conventional-changelog that referenced this issue Sep 7, 2019
tommywo added a commit to tommywo/conventional-changelog that referenced this issue Sep 7, 2019
tommywo added a commit to tommywo/conventional-changelog that referenced this issue Sep 7, 2019
tommywo added a commit that referenced this issue Sep 9, 2019
@thomasbottonari
Copy link

@tommywo thanks for the fix. when can we expect a release?

@thomasbottonari
Copy link

Is there a past release that I can use in the meantime where the conventionalcommits preset was working? I tried a few but can't get it to output anything.

@thomasbottonari
Copy link

@tommywo can we get an update on expected release timing? I'd like to use the conventionalcommits preset with the cli to generate a changelog that has a custom config but I can't find any version where that is working. Hoping this bug fix resolves it.

@eshepelyuk
Copy link

@tommywo yes please

@tommywo
Copy link
Member

tommywo commented Oct 3, 2019

Hi @thomasbottonari, @eshepelyuk, I've just made a release :)
can you try next version npm install -g conventional-changelog-cli@next ?

@thomasbottonari
Copy link

@tommywo that seems to be working for me. One thing I haven't been able to figure out from reading the docs/code is how to pass the conventionalcommits preset a config object to change the types array for example. I'm passing a config file to the cli but can you advise on what to name the config object inside that file?

@tommywo
Copy link
Member

tommywo commented Oct 4, 2019

@thomasbottonari I've answered you here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment