Describe the bug
I am using commit-and-tag-version in my project Terra Draw. The project is a monorepo, and has packages in the packages folder. I filter the CHANGELOG based on scopes that are the package names (terra-draw, terra-draw-leaflet-adapter etc). All seemed to be working okay, until I went to release a new version of terra-draw and I am being bumped from version 1.0.0 to what I would assume would be 1.1.0 but it is creating a change log for 2.0.0. In the CHANGELOG there are no breaking changes, and 2 feat changes (hence expecting a minor bump rather than major). I am running it like so for the dry run:
commit-and-tag-version .versionrc.cjs -t terra-draw@ --dry-run
The (condensed) version of the .versionrc.cjs file looks like this:
const path = require("path");
const packageJsonPath = path.resolve(__dirname, `package.json`);
const packageName = require(packageJsonPath).name
console.log(`✔ Package: ${packageName}`)
const changelogPath = path.resolve(__dirname, "/CHANGELOG.md")
module.exports = {
bumpFiles: [
{
filename: packageJsonPath,
type: "json",
},
],
packageFiles: [packageJsonPath],
writerOpts: {
transform: (commit, context) => {
// Only include commits scoped to the package
if (!commit.scope || commit.scope !== packageName) {
return null;
}
return commit;
},
},
changelogFile: changelogPath,
releaseCommitMessageFormat: `chore(${packageName}): release version {{currentTag}}`,
}
Current behavior
The packages attempts to bump to version 2.0.0 even though there are no breaking changes
Expected behavior
It bumps to version 1.1.0 as there are no breaking changes, and only feat entries
Environment
commit-and-tag-version version(s): 12.5.0
- Node/npm version: Node 20.12.1, npm 10.5.0
- OS: Mac OS v14
Possible Solution
Is there some possibility because this is a monorepo it is picking up previous historical commits somehow that don't relate to the package? Hard to say
Additional context
Here is a GitHub Action with the dry run and created CHANGELOG: https://github.com/JamesLMilner/terra-draw/actions/runs/13041702361/job/36384792942
Describe the bug
I am using
commit-and-tag-versionin my project Terra Draw. The project is a monorepo, and has packages in thepackagesfolder. I filter the CHANGELOG based on scopes that are the package names (terra-draw,terra-draw-leaflet-adapteretc). All seemed to be working okay, until I went to release a new version ofterra-drawand I am being bumped from version1.0.0to what I would assume would be1.1.0but it is creating a change log for2.0.0. In the CHANGELOG there are no breaking changes, and 2featchanges (hence expecting a minor bump rather than major). I am running it like so for the dry run:The (condensed) version of the
.versionrc.cjsfile looks like this:Current behavior
The packages attempts to bump to version 2.0.0 even though there are no breaking changes
Expected behavior
It bumps to version 1.1.0 as there are no breaking changes, and only
featentriesEnvironment
commit-and-tag-versionversion(s): 12.5.0Possible Solution
Is there some possibility because this is a monorepo it is picking up previous historical commits somehow that don't relate to the package? Hard to say
Additional context
Here is a GitHub Action with the dry run and created CHANGELOG: https://github.com/JamesLMilner/terra-draw/actions/runs/13041702361/job/36384792942