Giter Site home page Giter Site logo

Comments (7)

cookpete avatar cookpete commented on June 25, 2024

Hey @ahmadawais,

You are using "package": true which is only intended to be used when you generate a changelog during npm version, which you are not using. This setting gets the version from your package.json and uses that as the next incoming version, but in your case it is just the current version of your library, which is messing stuff up.

This is why you have a compare link at the top of your log that is comparing a version to itself:

### [1.34.0](https://github.com/ahmadawais/shades-of-purple-vscode/compare/1.34.0...1.34.0) RELEASE

from auto-changelog.

cookpete avatar cookpete commented on June 25, 2024

Ah I see now that release-it will bump the version in package.json and do a bunch of stuff before auto-changelog runs. Try running it without "package": true in the config and see if that helps.

from auto-changelog.

ahmadawais avatar ahmadawais commented on June 25, 2024

@cookpete thanks for the response.

Yes, using release-it and it should handle the package.json update and as soon as it does, I want the auto-changelog to report the release. Without package: true it listed the changes under unreleased.

from auto-changelog.

cookpete avatar cookpete commented on June 25, 2024

In the next example, beforeChangelogCommand is also used, to update the CHANGELOG.md file. This change will also be included in the release commit.

{
 "increment": "conventional:angular",
 "beforeChangelogCommand": "conventional-changelog -p angular -i CHANGELOG.md -s",
 "changelogCommand": "conventional-changelog -p angular | tail -n +3",
 "safeBump": false
}

For this use case, the safeBump option was introduced. Set this to false to bump package.json#version before the beforeChangelogCommand is executed, as the conventional-changelog tool needs to run from the current version.

From https://www.npmjs.com/package/release-it#generate-custom-changelog

Try removing the auto-changelog steps from your release script and instead add to your release-it config:

{
 "beforeChangelogCommand": "auto-changelog",
 "safeBump": false
}

from auto-changelog.

ahmadawais avatar ahmadawais commented on June 25, 2024

@cookpete thanks for helping me out on this one.

I tried what you asked.

I released a new version 1.35.0 https://github.com/ahmadawais/shades-of-purple-vscode/releases

But the changelog is till 1.34.0 :( https://github.com/ahmadawais/shades-of-purple-vscode/blob/master/CHANGELOG.md

Here's the output

> release-it && npx vsce publish

✔ Bump version
⠦ Command (auto-changelog)23650 bytes written to CHANGELOG.md
✔ Command (auto-changelog)
✔ Init (release 1.35.0 for shades-of-purple)
✔ Git commit
✔ Git tag
✔ Git push
✔ GitHub release
✔ GitHub upload assets
✔ npm publish
✔ Done (in 46s.)
npx: installed 63 in 11.213s
Publishing [email protected]...
Successfully published [email protected]!

As you can see the bump of version was before auto-changelog was run.

I have also removed package = true as you suggested.

from auto-changelog.

cookpete avatar cookpete commented on June 25, 2024

Haha sorry @ahmadawais.. Now you're doing it this way you actually need package: true after all to use the bumped version.

from auto-changelog.

ahmadawais avatar ahmadawais commented on June 25, 2024

Hahah!

I think I finally figured it out. The unreleased thingy has conflict with package option. They don't play well together. I had to remove it.

Now I have this

"auto-changelog": {
		"output": "CHANGELOG.md",
		"template": "clTemplate.hbs",
		"commitLimit": false,
		"package": true,
		"replaceText": {
			"FIX: ": "",
			"NEW: ": "",
			"IMPROVE: ": "",
			"DOC: ": ""
		}
	}

And it works! Voila!

Look at these sexy changelogs

https://github.com/ahmadawais/shades-of-purple-vscode/blob/master/CHANGELOG.md

and

https://marketplace.visualstudio.com/items/ahmadawais.shades-of-purple/changelog

Thanks for all the help man. You're very kind.

from auto-changelog.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.