Coder Social home page Coder Social logo

absolute-version / commit-and-tag-version Goto Github PK

View Code? Open in Web Editor NEW

This project forked from conventional-changelog/standard-version

273.0 3.0 29.0 927 KB

Fork of the excellent standard-version. Automate versioning and CHANGELOG generation, with semver.org and conventionalcommits.org :trophy:

License: ISC License

JavaScript 99.53% Elixir 0.47%
changelog cli git history release semantic standard tag tags version versioning

commit-and-tag-version's Introduction

Commit and Tag Version

commit-and-tag-version is a fork of standard-version. Because of maintainer availability, standard-version was deprecated on 15th May 2022. The previous maintainer recommends release-please as an alternative for those who are using GitHub actions. This fork exists for those who can't switch to release-please, or who would like to continue using standard-version.

Can I simply swap the library to migrate? To migrate, you can drop in commit-and-tag-version in place of standard-version. There are no changes in 9.5.0, other than to add the package.json config key commit-and-tag-version (the previous configuration key standard-version will still work). 10.x drops support for deprecated node versions, 11.x is a formatting change if you're relying on the exact markdown format in the changelog, and 12.x drops support for node 14/16.

Why was it renamed commit-and-tag-version?. I didn't want to scope the package or name it standard-version-fork, and it was a good opportunity to make the purpose of the tool clearer. I also wanted to distinguish it from the other tool in this organisation, absolute-version, which just prints version information for pre-releases.

A utility for versioning using semver and CHANGELOG generation powered by Conventional Commits.

ci NPM version codecov Conventional Commits Community slack

Having problems? Want to contribute? Join us on the node-tooling community Slack.

How It Works

  1. Follow the Conventional Commits Specification in your repository.
  2. When you're ready to release, run commit-and-tag-version.

commit-and-tag-version will then do the following:

  1. Retrieve the current version of your repository by looking at packageFiles[1], falling back to the last git tag.
  2. bump the version in bumpFiles[1] based on your commits.
  3. Generates a changelog based on your commits (uses conventional-changelog under the hood).
  4. Creates a new commit including your bumpFiles[1] and updated CHANGELOG.
  5. Creates a new tag with the new version number.

bumpFiles, packageFiles and updaters

commit-and-tag-version uses a few key concepts for handling version bumping in your project.

  • packageFiles – User-defined files where versions can be read from and be "bumped".
    • Examples: package.json, manifest.json
    • In most cases (including the default), packageFiles are a subset of bumpFiles.
  • bumpFiles – User-defined files where versions should be "bumped", but not explicitly read from.
    • Examples: package-lock.json, npm-shrinkwrap.json
  • updaters – Simple modules used for reading packageFiles and writing to bumpFiles.

By default, commit-and-tag-version assumes you're working in a NodeJS based project... because of this, for the majority of projects you might never need to interact with these options.

That said, if you find your self asking How can I use commit-and-tag-version for additional metadata files, languages or version files? – these configuration options will help!

Maven Support (Java/Kotlin)

If you are using Maven, then just point to your pom.xml file.

commit-and-tag-version --packageFiles pom.xml --bumpFiles pom.xml

Gradle Support (Java/Kotlin)

If you are using Gradle, then just point to your build.gradle file (or build.gradle.kts if using Kotlin DSL).

commit-and-tag-version --packageFiles build.gradle --bumpFiles build.gradle

.NET Support

If you are using .NET with .csproj files. This is going to read and update only the <Version> tag in the file.

commit-and-tag-version --packageFiles <YOUR-PROJECT-NAME>.csproj --bumpFiles <YOUR-PROJECT-NAME>.csproj

Installing commit-and-tag-version

As a local npm run script

Install and add to devDependencies:

npm i --save-dev commit-and-tag-version

Add an npm run script to your package.json:

{
  "scripts": {
    "release": "commit-and-tag-version"
  }
}

Now you can use npm run release in place of npm version.

This has the benefit of making your repo/package more portable, so that other developers can cut releases without having to globally install commit-and-tag-version on their machine.

As global bin

Install globally (add to your PATH):

npm i -g commit-and-tag-version

Now you can use commit-and-tag-version in place of npm version.

This has the benefit of allowing you to use commit-and-tag-version on any repo/package without adding a dev dependency to each one.

Using npx

As of [email protected], npx is installed alongside npm. Using npx you can use commit-and-tag-version without having to keep a package.json file by running: npx commit-and-tag-version.

This method is especially useful when using commit-and-tag-version in non-JavaScript projects.

Configuration

You can configure commit-and-tag-version either by:

  1. Placing a commit-and-tag-version stanza in your package.json (assuming your project is JavaScript).

    Note for users who have migrated to commit-and-tag-version from standard-version: the previous package.json configuration key of standard-version will still work.

  2. Creating a .versionrc, .versionrc.json or .versionrc.js.

  • If you are using a .versionrc.js your default export must be a configuration object, or a function returning a configuration object.

Any of the command line parameters accepted by commit-and-tag-version can instead be provided via configuration. Please refer to the conventional-changelog-config-spec for details on available configuration options.

Customizing CHANGELOG Generation

By default, commit-and-tag-version uses the conventionalcommits preset.

This preset adheres closely to the conventionalcommits.org specification.

Suppose you're using GitLab, rather than GitHub, you might modify the following variables:

  • commitUrlFormat: the URL format of commit SHAs detected in commit messages.
  • compareUrlFormat: the URL format used to compare two tags.
  • issueUrlFormat: the URL format used to link to issues.

Making these URLs match GitLab's format, rather than GitHub's.

Deeper customization

You can override both parser and writer options (they will be merged into the preset we just mentioned). As an example, to list commits in the order that they were committed:

{
  "commit-and-tag-version": {
    "writerOpts": {
      "commitsSort": false
    }
  }
}

CLI Usage

NOTE: To pass nested configurations to the CLI without defining them in the package.json use dot notation as the parameters e.g. --skip.changelog.

First Release

To generate your changelog for your first release, simply do:

# npm run script
npm run release -- --first-release
# global bin
commit-and-tag-version --first-release
# npx
npx commit-and-tag-version --first-release

This will tag a release without bumping the version bumpFiles1.

When you are ready, push the git tag and npm publish your first release. \o/

Cutting Releases

If you typically use npm version to cut a new release, do this instead:

# npm run script
npm run release
# or global bin
commit-and-tag-version

As long as your git commit messages are conventional and accurate, you no longer need to specify the semver type - and you get CHANGELOG generation for free! \o/

After you cut a release, you can push the new git tag and npm publish (or npm publish --tag next) when you're ready.

Release as a Pre-Release

Use the flag --prerelease to generate pre-releases:

Suppose the last version of your code is 1.0.0, and your code to be committed has patched changes. Run:

# npm run script
npm run release -- --prerelease

This will tag your version as: 1.0.1-0.

If you want to name the pre-release, you specify the name via --prerelease <name>.

For example, suppose your pre-release should contain the alpha prefix:

# npm run script
npm run release -- --prerelease alpha

This will tag the version as: 1.0.1-alpha.0

Release as a Target Type Imperatively (npm version-like)

To forgo the automated version bump use --release-as with the argument major, minor or patch.

Suppose the last version of your code is 1.0.0, you've only landed fix: commits, but you would like your next release to be a minor. Simply run the following:

# npm run script
npm run release -- --release-as minor
# Or
npm run release -- --release-as 1.1.0

You will get version 1.1.0 rather than what would be the auto-generated version 1.0.1.

NOTE: you can combine --release-as and --prerelease to generate a release. This is useful when publishing experimental feature(s).

Prevent Git Hooks

If you use git hooks, like pre-commit, to test your code before committing, you can prevent hooks from being verified during the commit step by passing the --no-verify option:

# npm run script
npm run release -- --no-verify
# or global bin
commit-and-tag-version --no-verify

Signing Commits and Tags

If you have your GPG key set up, add the --sign or -s flag to your commit-and-tag-version command.

Signed-off-by trailer

To add the "Signed-off-by" trailer to the commit message add the --signoff flag to your commit-and-tag-version command.

Lifecycle Scripts

commit-and-tag-version supports lifecycle scripts. These allow you to execute your own supplementary commands during the release. The following hooks are available and execute in the order documented:

  • prerelease: executed before anything happens. If the prerelease script returns a non-zero exit code, versioning will be aborted, but it has no other effect on the process.
  • prebump/postbump: executed before and after the version is bumped. If the prebump script returns a version #, it will be used rather than the version calculated by commit-and-tag-version.
  • prechangelog/postchangelog: executes before and after the CHANGELOG is generated.
  • precommit/postcommit: called before and after the commit step.
  • pretag/posttag: called before and after the tagging step.

Simply add the following to your package.json to configure lifecycle scripts:

{
  "commit-and-tag-version": {
    "scripts": {
      "prebump": "echo 9.9.9"
    }
  }
}

As an example to change from using GitHub to track your items to using your projects Jira use a postchangelog script to replace the url fragment containing 'https://github.com/`myproject`/issues/' with a link to your Jira - assuming you have already installed replace

{
  "commit-and-tag-version": {
    "scripts": {
      "postchangelog": "replace 'https://github.com/myproject/issues/' 'https://myjira/browse/' CHANGELOG.md"
    }
  }
}

Skipping Lifecycle Steps

You can skip any of the lifecycle steps (bump, changelog, commit, tag), by adding the following to your package.json:

{
  "commit-and-tag-version": {
    "skip": {
      "changelog": true
    }
  }
}

Committing Generated Artifacts in the Release Commit

If you want to commit generated artifacts in the release commit, you can use the --commit-all or -a flag. You will need to stage the artifacts you want to commit, so your release command could look like this:

{
  "commit-and-tag-version": {
    "scripts": {
      "prerelease": "webpack -p --bail && git add <file(s) to commit>"
    }
  }
}
{
  "scripts": {
    "release": "commit-and-tag-version -a"
  }
}

Dry Run Mode

running commit-and-tag-version with the flag --dry-run allows you to see what commands would be run, without committing to git or updating files.

# npm run script
npm run release -- --dry-run
# or global bin
commit-and-tag-version --dry-run

Prefix Tags

Tags are prefixed with v by default. If you would like to prefix your tags with something else, you can do so with the -t flag.

commit-and-tag-version -t @scope/package\@

This will prefix your tags to look something like @scope/[email protected]

If you do not want to have any tag prefix you can use the -t flag and provide it with an empty string as value.

Note: simply -t or --tag-prefix without any value will fallback to the default 'v'

Tag replacement

If you've already run commit-and-tag-version when creating your release, you may want to alter the release content and changelog without bumping the version, by using commit-and-tag-version --skip.bump. By default, tagging with an already existing tag make git fails. You can add the --tag-force flag to make use of -f option when calling git tag, then the existing version tag will be replaced.

Generate changelogs for old releases

Normally only the changelog for the last release will be generated and prepended to the changelog.md. If you want to generate changelogs for previous releases you can do so by setting the releaseCount option like described here.

When setting releaseCount=0 the whole changelog gets regenerated and replaced.

You can set the option either in the.versionrc file or inside package.json like below

//.versionrc
{
  "releaseCount": 0
}

//package.json

"commit-and-tag-version": {
  "releaseCount": 0
}

CLI Help

# npm run script
npm run release -- --help
# or global bin
commit-and-tag-version --help

Code Usage

const commitAndTagVersion = require("commit-and-tag-version");

// Options are the same as command line, except camelCase
// commitAndTagVersion returns a Promise
commitAndTagVersion({
  noVerify: true,
  infile: "docs/CHANGELOG.md",
  silent: true,
})
  .then(() => {
    // commit-and-tag-version is done
  })
  .catch((err) => {
    console.error(`commit-and-tag-version failed with message: ${err.message}`);
  });

TIP: Use the silent option to prevent commit-and-tag-version from printing to the console.

FAQ

How is commit-and-tag-version different from semantic-release?

semantic-release is described as:

semantic-release automates the whole package release workflow including: determining the next version number, generating the release notes and publishing the package.

While both are based on the same foundation of structured commit messages, commit-and-tag-version takes a different approach by handling versioning, changelog generation, and git tagging for you without automatic pushing (to GitHub) or publishing (to an npm registry). Use of commit-and-tag-version only affects your local git repo - it doesn't affect remote resources at all. After you run commit-and-tag-version, you can review your release state, correct mistakes and follow the release strategy that makes the most sense for your codebase.

We think they are both fantastic tools, and we encourage folks to use semantic-release instead of commit-and-tag-version if it makes sense for their use-case.

Should I always squash commits when merging PRs?

The instructions to squash commits when merging pull requests assumes that one PR equals, at most, one feature or fix.

If you have multiple features or fixes landing in a single PR and each commit uses a structured message, then you can do a standard merge when accepting the PR. This will preserve the commit history from your branch after the merge.

Although this will allow each commit to be included as separate entries in your CHANGELOG, the entries will not be able to reference the PR that pulled the changes in because the preserved commit messages do not include the PR number.

For this reason, we recommend keeping the scope of each PR to one general feature or fix. In practice, this allows you to use unstructured commit messages when committing each little change and then squash them into a single commit with a structured message (referencing the PR number) once they have been reviewed and accepted.

Can I use commit-and-tag-version for additional metadata files, languages or version files?

You can configure multiple bumpFiles and packageFiles:

  1. Specify a custom bumpFile "filename", this is the path to the file you want to "bump"
  2. Specify the bumpFile "updater", this is how the file will be bumped. a. If you're using a common type, you can use one of commit-and-tag-version's built-in updaters by specifying a type. b. If your using an less-common version file, you can create your own updater.
// .versionrc
{
  "bumpFiles": [
    {
      "filename": "MY_VERSION_TRACKER.txt",
      // The `plain-text` updater assumes the file contents represents the version.
      "type": "plain-text"
    },
    {
      "filename": "a/deep/package/dot/json/file/package.json",
      // The `json` updater assumes the version is available under a `version` key in the provided JSON document.
      "type": "json"
    },
    {
      "filename": "VERSION_TRACKER.json",
      //  See "Custom `updater`s" for more details.
      "updater": "commit-and-tag-version-updater.js"
    }
  ]
}

If using .versionrc.js as your configuration file, the updater may also be set as an object, rather than a path:

// .versionrc.js
const tracker = {
  filename: "VERSION_TRACKER.json",
  updater: require("./path/to/custom-version-updater"),
};

module.exports = {
  bumpFiles: [tracker],
  packageFiles: [tracker],
};

Custom updaters

An updater is expected to be a Javascript module with atleast two methods exposed: readVersion and writeVersion.

readVersion(contents = string): string

This method is used to read the version from the provided file contents.

The return value is expected to be a semantic version string.

writeVersion(contents = string, version: string): string

This method is used to write the version to the provided contents.

The return value will be written directly (overwrite) to the provided file.


Let's assume our VERSION_TRACKER.json has the following contents:

{
  "tracker": {
    "package": {
      "version": "1.0.0"
    }
  }
}

An acceptable commit-and-tag-version-updater.js would be:

// commit-and-tag-version-updater.js
const stringifyPackage = require("stringify-package");
const detectIndent = require("detect-indent");
const detectNewline = require("detect-newline");

module.exports.readVersion = function (contents) {
  return JSON.parse(contents).tracker.package.version;
};

module.exports.writeVersion = function (contents, version) {
  const json = JSON.parse(contents);
  let indent = detectIndent(contents).indent;
  let newline = detectNewline(contents);
  json.tracker.package.version = version;
  return stringifyPackage(json, indent, newline);
};

Why do breaking changes before 1.0.0 not trigger a 1.0.0 release?

Below 1.0.0, the semver specification doesn't give any guarantees about the meaning of version numbers. However, with npm there is a community convention, and implementation-defined behaviour: If your version is between 0.1.0 and 1.0.0, npm treats an update to the minor version as a breaking change - that is ^0.1.0 will match 0.1.2 but not 0.2.0. Rust's cargo package manager also behaves the same way.

This tool (via conventional-commits) also follows that convention - breaking changes below v1.0.0 are treated as a minor version bump. Here's an example series of commits with tagged versions:

1017b00 chore: initial commit
9e2ba95 (tag: v0.0.2) chore(release): 0.0.2
3598012 fix!: Example breaking change
1a4994a (tag: v0.1.0) chore(release): 0.1.0

Semver's only guarantee is "all bets are off", but npm has made a choice about what bets to make. commit-and-tag-version follows the same convention (along with other package managers for other ecosystems).

When you are ready to release v1.0.0, add --release-as 1.0.0 to the options.

License

ISC

commit-and-tag-version's People

Contributors

bcoe avatar bytemain avatar djaler avatar dsole avatar e-cloud avatar eemeli avatar github-actions[bot] avatar greenkeeperio-bot avatar jakxz avatar jbottigliero avatar kf6kjg avatar merfoo avatar minigod avatar nexdrew avatar noreiller avatar pioluk avatar release-please[bot] avatar renovate-bot avatar renovate[bot] avatar revelt avatar rjmohammad avatar roschaefer avatar s-h-a-d-o-w avatar stevemao avatar tapppi avatar taylorho avatar timknight-dwp avatar timothyjones avatar tomchentw avatar tommywo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

commit-and-tag-version's Issues

Unable to use '--bumpFiles' command line arg the same way as the '.versionrc' file

Describe the bug
It seems so that I'm not able to hand the same structure into the command line arg --bumpFiles as by using the .versionrc file.

Current behavior
running commit-and-tag-version --bumpFiles "[{\"filename\":\"custom-bump-file.md\",\"updater\":\"custom-updater.js\"}]"

succeeds but without updating the custom-bump-file.md and with instead saying:

Unable to obtain updater for: "[{\"filename\":\"custom-bump-file.md\",\"updater\":\"custom-updater.js\"}]"
 - Error: Unsupported file ([{"filename":"custom-bump-file.md","updater":"custom-updater.js"}]) provided for bumping.

Expected behavior
I would like the command line arg to be able to work with the same input as the .versionrc file

Environment

  • commit-and-tag-version version(s): 10.1.0
  • Node/npm version: Node v18.7.0 / npm 8.15.0
  • OS: macOS Monterey 12.5

Possible Solution

I'm guessing the command line arg is not parsed/interpreted as a json object?

Additional context
Why am I not just use the .versionrc file: I would like to call the commit-and-tag-version tool multiple times with different configuration for which additional files (besides the CHANGELOG.md) to update. For that I would like to just hand over the different configuration using the --bumpFiles command line arg.

Cannot run tests using Node 20

Describe the bug
When using Node 20.9.0 the unit tests do not run successfully
When using Node 18.16.0, the unit tests complete fine

Current behavior
When running the tests in CLI or through an IDE with Node 20.9.0 as the runtime, it deletes the contents of package.json and CHANGELOG.md and therefore halfway through the test there is no package.json so the runtime immediately falls over

Expected behavior
Tests should pass and the unit tests should be usiing the mocked CHANGELOGs etc rather than the real ones sat in the Repo

Environment

  • commit-and-tag-version version(s): Latest
  • Node/npm version: Node 20.9.0
  • OS: OSX Sonoma

Possible Solution

I suspect it will be related to the test-runner and Fs changes in node20: https://nodejs.org/en/blog/announcements/v20-release-announce#stable-test-runner

Commit-and-tag-version itself runs fine and as expected using Node 20, but we cannot maintain/run tests when using Node 20 as the runtime (at least locally)

Additional context
Add any other context about the problem here. Or a screenshot if applicable

How can I have this package run `pnpm i` before committing?

After a version bump, all the version specifiers in the pnpm lockfile have to be updated (by running pnpm install). If not, frozen-lockfile installs will fail, which pnpm does automatically when invoked in a ci environment.

      - name: install
        run: pnpm install

image

This results in me having to amend the commit, recreate the version tag, or if I forget it, notice the error way later and push the fix later:

image

How can I tell [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) to run a pnpm i right before committing to always have a fresh lockfile?

Better/more bumping flexibility for initial-development-versions, i.e. < 1.0.0.

It would be great to finally solve conventional-changelog#539

TL;DR

In Standard-Version when you have a version < 1.0.0 it always bumps the patch version, no matter what you do.
It would be great to be able to adjust this behavior.

The SemVer 2.0.0 spec days:
How should I deal with revisions in the 0.y.z initial development phase?

The simplest thing to do is start your initial development release at 0.1.0 and then increment the minor version for each subsequent release.

However, this is only the FAQ part and a suggestion (i.e. "The simplest thing to do").

What the spec really defines is:

  1. Major version zero (0.y.z) is for initial development. Anything MAY change at any time. The public API SHOULD NOT be considered stable.

It explicitly allows y (the minor version) to change.

The thread in semver/semver#333 (comment) tackles this issue and I guess this summarized the current state quite good:

There is nothing explicit about what the rules for initial development should be.

As such, IMHO, there should at least be a flag/configuration option in .versionrc to also bump minor in the initial development stage (<1.0.0) just like you would do when it is stable.
Otherwise the version always stays at 0.0.z until 1.0.0 which feels awkward to me and let me to find this issue as it was clearly unexpected/not what I thought standard-version would behave.

Both variants are clearly in line with the spec, so IMHO, standard-version should support it. You could even, and that may be discussed, doing that new behavior by default. Or better introduce it as optional for now and later make it a default, if you want to go that way.
BTW SemVer 2.0.0 also says:
The simplest thing to do is start your initial development release at 0.1.0 and then increment the minor version for each subsequent release.

That's not the patch version (0.0.z), as Standard-Version currently does! Minor would make more, sense IMHO, but still the usual bumping behavior would be better. (0.y.0)

Idea

  • The default behavior may be changed. Maybe bump the minor version? Or better use the "default behaviour" for bumping as described above.
  • An entry in .versionrc where you can choose what to bump in pre-release versions like minor or patch (you can set it to patch to keep/restore the old behavior of standard-version) or auto (or maybe called default), where it chooses based on whether it's a feat(ure) or (bug) fix.

Easy way to specify multiple files with the same updater

Discussed in #41

Originally posted by wcl-onespan August 13, 2022
First off, great port, works better than the original...

Is there a way to specify multiple files to use the same custom updater, other than specifying each file individually in the versionrc.cjs?

This could be a pattern match like "*.html" or it could be that I need to use an array like ["index.html","login.html"] etc? I have tried both of these options and neither seem to work, so I am not sure if it is possible. If I can extend the filename field, that might be an option too since I am using a custom config, but I'm not sure where to start for that.

Any help or advice would be greatly appreciated.
-Will

Issue with custom updaters

Describe the bug
When creating performing a version bump using NPX. We are seeing an error with our custom updater configuration. Specifically the error has that the file is an unsupported file, but yet it performs the version update anyways.

Current behavior
When running the following command:
npx -p commit-and-tag-version -c "commit-and-tag-version --prerelease build" --yes

with an .versionrc.js file that contains the following configuration:

const dotEnvFileUpdater = {
	filename: ".env",
	updater: {
		readVersion: (contents) => {
			const regex = /GSOL_VERSION=?([a-zA-Z0-9\-_.]*)?/;
			const found = contents.match(regex);
			if (found === null) {
				throw new Error("GSOL_VERSION is not present.");
			}
			if (typeof found[1] === "undefined" || found[1] === "") {
				throw new Error("GSOL_VERSION is empty.");
			}
			return found[1];
		},
		writeVersion: (contents, version) => {
			const regex = /GSOL_VERSION=?([a-zA-Z0-9\-_.]*)?/;
			const newContents = contents.replace(regex, `GSOL_VERSION=${version}`);
			return newContents;
		}
	}
}
module.exports= {
	"header": "# Changelog",
	"types": [
		{"type": "feat", "section": "⚡️ Features", "hidden": false},
		{"type": "fix", "section": "🐛 Bug Fixes", "hidden": false}
	],
	"bumpFiles": [
		{
			"filename": "package.json",
			"type": "json"
		},
		{
			"filename": "package-lock.json",
			"type": "json"
		},
			dotEnvFileUpdater
	]
}

The .env file will correctly get updated, however the following error will be seen while NPM is running:

Unable to obtain updater for: {"filename":".env","updater":{}}
 - Error: Unsupported file (.env) provided for bumping.
 Please specify the updater `type` or use a custom `updater`.

Expected behavior

The expectation is that the error is not thrown. We believe the problem is the fact that we are including a file name and the updater as an object, and the filename check is throwing the error while the updater is correctly running.

Environment

  • commit-and-tag-version version(s): Latest, 10.0.0
  • Node/npm version: Node 16
  • OS: Alpine 3.14 (docker image: timbru31/node-alpine-git)

After yarn release minor version doesn't increase

Hello!

Im trying to increase my changelog with my conventional commits.

Configured from: https://commitlint.js.org/#/guides-local-setup?id=install-commitlint

Always increase last numbers 0.1.XX

I want to get X.X.XX

Environment

  • npx create-next-app@latest --typescript
  • commit-and-tag-version 10.0.1
    @commitlint/cli
    @commitlint/config-conventional
    husky

The commit message after yarn release is always the same: chore release and 0.1.xx... It doesn't matter if you commit a feat or breaking change.

Captura de Pantalla 2022-06-11 a la(s) 16 03 07

Include all commits in CHANGELOG

Something I'm interested in from standard-version: conventional-changelog#870

Hey,

I'm adding standard-version to our pipeline for internal app and I was wondering if there's an option to include every commit in CHANGELOG file for given release?

Like, having a config file:

// .versionrc.json

  "type": [
    {"type": "feat", "section": "Features"},
    {"type": "fix", "section": "Fixes"},
    {"type":  "*", "section":  "Others"}
  ]

would put every commit that is not feat or fix into Others group?

Custom Updater validation errors even when the updater runs correctly

Describe the bug
When using custom updaters an error is shown despite logic running correctly

    tag: true
  },
  tagPrefix: '',
  bumpFiles: [{
    filename: 'package.json',
    type: 'json',
  }, {
    filename: 'templates/print-toolbox-version.yml',
    updater: {
      readVersion: (contents) => contents.match(/VERSION:\s*(\d.*)/gm),
      writeVersion: (contents, version) => contents.replace(/VERSION:\s*(\d.*)/gm, `VERSION: ${version}`),
    }
  }]```

**Current behavior**
results in errors like this:

Unable to obtain updater for: {"filename":"templates/print-toolbox-version.yml","updater":{}}

  • Error: Unsupported file (templates/print-toolbox-version.yml) provided for bumping.
    Please specify the updater type or use a custom updater.
  • Skipping...

But the custom updater is actually run and the relevant files get updated correctly

**Expected behavior**
When custom updaters are valid syntax (and therefore run correctly anyway) - No error should be displayed in CLI

**Additional context**
We think it was this commit that broke things which doesn’t seem to take into account the option of specifying an object for updaters when it’s doing its validation checks: https://github.com/conventional-changelog/standard-version/commit/2785023c91668e7300e6a22e55d31b6bd9dae59b

deprecated warning in deps

[email protected]: This module is not used anymore, and has been replaced by @npmcli/package-json

I want to avoid deprecation warning from standard-version to this one, but your package is still showing some warnings, could you use the replaced one?

Changes between tags with no changes

I have a monorepo with several applications in it and I'm trying to implement the separate version bump and changelog for each application.

Each app has a config file in it root folder and I run commit-and-tag-version in each app folder and set the tag with the app prefix.
That is the config:

{
    path: '.',
    'tag-prefix': `${appName}.v`,
    releaseCommitMessageFormat: `chore(release): ${appName}@{{currentTag}} [skip ci]`,
}

But if I run commit-and-tag-version with --dry-run right for the second time with no any changes accept version bump and changelog, then I see in changes a link to the repo with changes set between tags like:

---
## [1.1.1](https://github.com/..../compare/app.tag.v1.1.0...app-tag.v1.1.1) (2023-05-03)
---

Why are changes not empty? I expected to see nothing there and use that to determine if I need to bump version for the app or not.

Introduce typescript types (possibly via conversion to typescript)

The original repository had types through DefinitelyTyped here.

Forking means the types won't have come through. We could:

  1. Copy the definitely-typed types to this repo
  2. Upload a copy to definitely-typed/commit-and-tag-version
  3. Convert this repo to typescript

I think the smallest effort would be option 1. Long term, conversion to typescript would be ideal, because then we'd be able to merge #21, #19, #18 and #16, all of which require ESM.

Error when using custom updater

Describe the bug
I receive an error for each file processed by a custom updater.

Current behavior
The error is Cannot read properties of null (reading '1')

Expected behavior
Work without throwing error messages. It was fine with standard-version 9.5.0

Environment

  • commit-and-tag-version version(s): 10.0.1
  • Node/npm version: node 16.14.0 npm 8.5.4
  • OS: Windows 10

.versionrc.js

const glob = require('glob');
var assemblyInfoFiles = glob.sync('**/AssemblyInfo.cs', { ignore: ['**/*Test*/**', 'DBUpdater/**'] });

module.exports = {
    commitAll: true,
    preset: {
        name: 'lukavalabs'
    },
    tagPrefix: '',
    prerelease: '',
    bumpFiles: [
        ...assemblyInfoFiles.map((filename) => ({ filename, updater: './.standard-version/assembly-info.js' }))
    ],
}

assembly-info.js

const assemblyVersionRegEx = /(\d+\.\d+\.\d+)\.(\d+)/g;

module.exports.readVersion = function (contents) {
    const assemblyVersion = assemblyVersionRegEx.exec(contents);
    const oldVersion = `${assemblyVersion[1]}-${assemblyVersion[2]}`;

    return oldVersion;
}

module.exports.writeVersion = function (contents, version) {
    const newAssemblyVersion = version.split('-').join('.');

    return contents.replace(assemblyVersionRegEx, newAssemblyVersion);
}

Escape characters like < and >

Describe the bug
Characters like < and > are parsed as markdown syntax and won't shown in output.
Something like feat: add <Header> to <App> will shown as: feat: add to

Current behavior
Characters like < and > are parsed as markdown syntax.

Expected behavior
Escape markdown syntax from commit messages.

Environment

  • commit-and-tag-version version(s): 12.1.0
  • Node/npm version: v20.3.1

Major bump doesn’t happen until version 1.0.0

Major bumps don’t seem to happen until version 1.0.0.

Looks like this is an open issue on standard-version.

conventional-changelog#848

Current behavior
If my package version is 1.0.0 and a breaking change commit is made then running commit-and-tag-version returns 2.0.0 as expected.

However, if my package version is 0.0.1 and a breaking change commit is made then running commit-and-tag-version returns 0.1.0.

Is this expected? It surprised me. If it is an issue then it is likely and issue in either dependency conventional-recommended-bump or the way that it is configured in this project.

Expected behavior
I would expect that any commit with “BREAKING CHANGE:” in a commit’s message would always result in a bump to the Major version.

Environment

  • commit-and-tag-version version(s): v10.1.0

  • Node/npm version: Node 14.17.4/npm 6.14.15

  • OS: Windows 10

Possible Solution

Tried to have a look but I’m not familiar with the code see.

How to include dynamic link to unreleased features in CHANGELOG header

First up thanks for forking standard-version and shepherding it on - cheers! 🎉

I have been trying to figure this out but can't.

I would like to include something like the following in my generated CHANGELOG header:

For unreleased features, see: {{host}}/{{owner}}/{{repository}}/compare/{{currentTag}}...main

So for example, in my project integrify, the link would point to: anishkny/integrify@v4.1.1...main . This lets you see a list of commits landed on main but not released yet.

I need the tags interpolated in the changelog header. Is this possible?

Crossposted for visibility from: #45

[RFC] Updaters for non-node files

When reviewing PRs from the upstream repo, I saw several PRs that added extra updaters:

Should this project accept them? They're all in line with this fork's north star, but there are good arguments both ways for adding new updater types (this PR in particular has good discussion)

I think the point that we don't want to maintain hundreds of different file types is strong, but also there are practically only a handful of file types for the popular ecosystems. I think it would be a substantial improvement to support the popular ones out-of-the-box, without need for plugins.

I'd like to bring in support for common languages and ecosystems. Here's a proposal for the guidelines to follow when bringing in a new updater:

We can add an updater to this project provided:

  • It is for a popular ecosystem/language/framework that the average developer is at least aware of
  • It does not add a requirement to have a package.json (npx commit-and-tag-version should work with no package.json or other additional files beyond config)
  • The updater can be expected to work on generally on that particular file type - I don't want to accept "here's a regex that happens to work for my project" if we can't expect it to work for all projects
  • The updater does not add dependencies that might cause problems for users who aren't using that updater. There might be situations where it's appropriate to call out to tools that belong to a particular ecosystem (eg maven) - I think that's ok, as long as:
    • It doesn't require those tools to be present if you're not using that updater
    • When using that updater and the tool isn't present, failure is graceful

Thoughts?

Does this package not support setting --header?

Hello, I started using commit-and-tag-version after reading the README from standard-version.

I've noticed that the --header parameter seems to be ineffective when using the commit-and-tag-version command.

I want to ask, does commit-and-tag-version not support customizing the header of the CHANGELOG?

The command I used while using standard-version

{
  "scripts": {
"cmi": "npx commit-and-tag-version --release-as minor --preset gitmoji-config -i docs/CHANGELOG.md --header '# 更新日志'",
"cpa": "npx commit-and-tag-version --release-as patch --preset gitmoji-config -i docs/CHANGELOG.md --header '# 更新日志'"
  },
}

When starting to use commit-and-tag-version, the --header parameter couldn't properly write into the CHANGELOG, hoping to address this issue, thank you!

Version in use: "commit-and-tag-version": "^12.2.0",

How can I include all types in generated Changelog ?

Hi,

I am kind of blocked here and I switched to your package in hope that it has implemented type configuration.

My package.json config is like this:
"commit-and-tag-version": { "skip": { "commit": true }, "types": [ { "type": "feat", "section": "Features:" }, { "type": "fix", "section": "Bug Fixes" }, { "type": "chore", "section": "Chore: Maintenance", "hidden": false }, { "type": "docs", "section": "Documentation:", "hidden": false }, { "type": "style", "hidden": false }, { "type": "refactor", "hidden": false }, { "type": "perf", "hidden": false }, { "type": "test", "hidden": false } ] }

And it is existing in the official documentation conventional-changelog-config-spec.

Add option to refuse to generate a version if the changelog would be empty

I've got a question about one specific behavior of this utility. During my tests, I noticed that whenever I run the command, a new tag is generated and the changelog is updated. This happens even when there are no new commits since the last tag, or when there are commits whose types are different than "feat" or "fix".

My question is: is this the expected behavior, or a bug? In case this is the expected behavior, is it possible to change it via some configuration option? For my use case, I need that nothing happens when there are no additional commits or there are commits marked as "chore", "style", etc.

I tried using the .versionrc file, but the closer I got to what I want is for certain types of commits to not be added to the changelog. However, the changelog entry itself is still created, even if it's empty.

how to works with multiple commits

I do automated versioning through Jenkins in my build.

We usually always accumulate many commits, for example:
image

What criteria was used to generate a 3.71.0 version.
Since we have 4 feat commits, it should generate version 3.74.0, right? Why doesn't it work like that?

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Ignored or Blocked

These are blocked by an existing closed PR and will not be recreated unless you click a checkbox below.

Detected dependencies

github-actions
.github/workflows/ci.yaml
  • actions/checkout v4@b4ffde65f46336ab88eb53be808477a3936bae11
  • actions/setup-node v3
  • codecov/codecov-action v3
.github/workflows/release-please.yml
  • GoogleCloudPlatform/release-please-action v3
  • actions/checkout v4@b4ffde65f46336ab88eb53be808477a3936bae11
  • actions/setup-node v3
npm
package.json
  • chalk ^2.4.2
  • conventional-changelog 3.1.25
  • conventional-changelog-config-spec 2.1.0
  • conventional-changelog-conventionalcommits 6.1.0
  • conventional-recommended-bump 7.0.1
  • detect-indent ^6.0.0
  • detect-newline ^3.1.0
  • dotgitignore ^2.1.0
  • figures ^3.1.0
  • find-up ^5.0.0
  • git-semver-tags ^5.0.0
  • semver ^7.5.4
  • yargs ^17.7.2
  • chai ^4.3.10
  • chai-as-promised ^7.1.1
  • eslint ^8.52.0
  • eslint-config-standard ^17.1.0
  • eslint-plugin-import ^2.29.0
  • eslint-plugin-n ^15.2.0
  • eslint-plugin-promise ^6.1.1
  • mocha ^10.2.0
  • mock-fs ^5.2.0
  • mockery ^2.1.0
  • nyc ^15.1.0
  • shelljs ^0.8.5
  • std-mocks ^1.0.1
  • strip-ansi ^6.0.0
  • node >=14

  • Check this box to trigger a request for Renovate to run again on this repository

npm run release -- --release-as 1.0.0 as first release ends up with 1.1.0

Describe the bug
npm run release -- --release-as 1.0.0 as first release ends up with 1.1.0. Maybe I'm missing something but I thought I would get 1.0.0 and not 1.1.0.

Current behavior
After running npm run release -- --release-as 1.0.0 as the first ever release, the tag ends up as 1.1.0.

Expected behavior
After running npm run release -- --release-as 1.0.0 as the first ever release, the tag ends up as 1.0.0.

Environment

  • "commit-and-tag-version": "^10.1.
  • Node/npm version: 18.12.1/8.13.2
  • OS: Win10 64bit

Possible Solution

Additional context
Add any other context about the problem here. Or a screenshot if applicable
Code_15_22-49-22JNpFnmtd3j

Maybe this is not how you're supposed to use commit-and-tag-version so I'm open for any solutions. 😄

Ensure all options can be specified via CLI

Some options can only be specified in the config files. Both #28 and conventional-changelog#912 would be solved if the type of the updater could be specifed via CLI.

Since the options for commit-and-tag-version are not complicated, it would totally be possible to extend the CLI options to make sure that everything that can be specified by a config file can also be specified via CLI.

Ideally this would be done without embedding json in the CLI options.

How to retrieve the generated CHANGELOG part (only the latest changes) in lifecycle scripts

I am aware of #38, but I can't see how this can be helpful for my special use case. After the tag is created, I would like to create a release on GitHub via REST API.

The script to clear probable questions:

# create a release on GitHub
GITHUB_REPO=https://github.com/${GITHUB_REPOSLUG}
URL="$GITHUB_REPO"/"releases/edit/v""$VERSION"
curl \
  -X POST \
  -H "Accept: application/vnd.github+json" \
  -H "Authorization: token ${GITHUB_SECRET}" \
  https://api.github.com/repos/"${GITHUB_REPOSLUG}"/releases \
  -d "{\"tag_name\":\"v${VERSION}\",\"name\":\"v${VERSION}\",\"draft\":false,\"prerelease\":false,\"generate_release_notes\":true}"
xdg-open "${URL}" &>>/dev/null

The body value in the payload could contain the list of changes.

Is there an easy way to obtain the changelog changes at some point or do I have to create a post-changelog-creation hook that takes a diff of the changelog into a temporary file to reuse later on? That would be my current idea to implement this.

Thanks for any suggestions.

Feature request: allow manual formatting of CHANGELOG before committing

In our projects we need to do some manual editing of our generated changelog before committing and tagging. We use this tool right now with --skip.tag, then format manually, git commit amend and then perform a manual git tag vx.y.z to achieve this.

Previously we used a tool that just generated the changelog and then paused to allow edits, waiting for an IO prompt to continue committing.

I was wondering if we could add something similar to commit-and-tag-version or if anyone has ideas how we can already achieve this with a postchangelog script for example (I tried but didn't get anything to work).

I would be happy to contribute to the project but just want to know beforehand if this is something that, when done properly, would get merged.

Example of the suggestion:

> npx commit-and-tag-version --manualChangelog
bumping version in package.json from 5.0.0 to 6.0.0
✔ bumping version in package-lock.json from 5.0.0 to 6.0.0
✔ outputting changes to CHANGELOG.md
⌛  Manually edit CHANGELOG.md, press any key to finalize...
✔ committing package-lock.json and package.json and CHANGELOG.md
✔ tagging release v6.0.0

CLI runs successfully even when invalid arguments are passed

Describe the bug
When invalid arguments are passed on the command line the program still runs successfully, ignoring any arguments it doesn't know about. I discovered this by accident when running it for the first time (ever): npx commit-and-tag-version --dr-run (note the misspelled word "dry").

Current behavior
Running npx commit-and-tag-version --dryrun results in the changelog being generated, version bumped, committed, and tagged.

Expected behavior
The program should exit with an error, potentially displaying the help

Environment

  • commit-and-tag-version version(s): 11.2.0
  • Node/npm version: Node 16.19.0, npm 9.3.0
  • OS: PopOS 22.04

Support generating changelog section for Unreleased commits

Found this repo today after spending the weekend looking at standard-version and longing for parserOpts & writerOpts capabilities. There's one more capability i'm looking for that I can't seem to find so far.

conventional-changelog-core supports a configuration option to output unreleased commits to to the changelog. I would love to see this ability added.

See:
https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-core#outputunreleased

"commitsSort": false does not work as documented

I'm probably stupid but I want to have "commitsSort": false for sorting commits by date but I'm not sure how to do it with my global npm install of commit-and-tag-version. How would I accomplish that?

Also, would "commitsSort": false generate a new changelog with all commits sorted by date or would it be a retroactive thing from when I changed the option?

Bug: Frontmatter is duplicated in certain scenarios

Describe the bug
Depending on the format of the frontmatter on the CHANGELOG, commit-and-tag-version does not handle it correctly

Current behavior
Frontmatter is repeatedly duplicated at the top of the CHANGELOG

image

Expected behavior
Frontmatter is retained and not duplicated

Environment

  • commit-and-tag-version version(s): latest

Possible Solution

It'll be within the logic I added to: https://github.com/absolute-version/commit-and-tag-version/blob/master/lib/lifecycles/changelog.js#L25

Additional context
Raising this bug so everyone can have insight on it, I will synch my fork and work on a fix asap

Version bump insisting on versioning to 1.0.1 in azure-pipeline

Describe the bug
I have a gradle project, a build.gradle file, a version.json file, a .versionrc.json file, an azure-pipeline.yml and a commit-and-tag-updater.js file (detailed below). When running the commit-and-tag-version in the azure pipeline it insists on setting the version to 1.0.1 no matter what is in the version.json or tagged on the branch.

Current behavior
Using the --dry-run flag locally works as expected but in the pipeline it insists on setting version to 1.0.1 no matter what it was previously, this causes downstream errors when publishing artifiacts.

azure pipeline task output
{ updated: '1.0.1' } { updated: '1.0.2' } ✔ bumping version in ./lib/version.json from 1.0.2 to 1.0.1 ✔ outputting changes to CHANGELOG.md ✔ committing ./lib/version.json and CHANGELOG.md ✔ tagging release v1.0.1 fatal: tag 'v1.0.1' already exists

Expected behavior
I would expect it to bump the version from 1.0.2 to 1.0.3 if the commit message is prefixed with fix:

Environment

  • commit-and-tag-version version(s): [e.g. v6.0.0, v8.0.0, master]
  • Node/npm version: Node 16
  • OS: local is Windows 11, pipeline is an ubuntu-vm image

Possible Solution

Additional context

build.gradle fragment

import groovy.json.JsonSlurper plugins { id 'java-library' id 'maven-publish' } task readVersionNumber { def json = new JsonSlurper().parseText(file('./version.json').text) project.version = json.version } jar { dependsOn readVersionNumber }
version.json

{ "version": "1.0.2" }

versionrc.json

{ "releaseCommitMessageFormat": "chore(release): {{currentTag}} [skip ci]", "bumpFiles": [ { "filename": "./lib/version.json", "updater": "./commit-and-tag-updater.js" } ] }

azure-pipeline script

- script: | sudo npm install -g commit-and-tag-version git config --global user.email "[email protected]" git config --global user.name "azurebot" if [ "$(Build.SourceBranch)" == "refs/heads/main" ]; then commit-and-tag-version else commit-and-tag-version --prerelease alpha fi git push --follow-tags origin HEAD:$(Build.SourceBranchName) displayName: 'Bump version and commit'

commit-and-tag-updater.js

module.exports.readVersion = (contents) => { const updated = JSON.parse(contents).version; console.log({updated}); return updated; } module.exports.writeVersion = (contents, version) => { const json = JSON.parse(contents); json.version = version; return JSON.stringify(json); }

feat: option to push automatically

In order to integrate with CI environments it would be nice if there is an option to push automatically the tags and changelog generated so we do not have to do extra steps to push the information.

Front-matter is removed from CHANGELOG when running commit-and-tag-version

Describe the bug
When I run npx commit-and-tag-version any front matter on my changelog is removed

My existing changelog has some front matter:

---
status: new
---

# Changelog

All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines.

## [4.13.0](https://gitlab.com/.../compare/4.12.3...4.13.0) (2023-10-18)

### Features

Current behavior

# Changelog

All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines.

## [4.13.2](https://gitlab.com/.../compare/4.13.0...4.13.2) (2023-10-19)

Front matter is removed

Expected behavior
Front matter should be maintained, so that we can attach fuller metadata to our changelogs

Environment

  • commit-and-tag-version version(s): Latest
  • Node/npm version: npm 18
  • OS: Mac OS

Possible Solution

I am unsure where to start looking through the code, I presume it is something in the parse/write process, where the front matter gets stripped off before or after the new commit history is added

Argument `--releaseAs [1.1.0]` is ignored if `--skip.bump` is also used

Describe the bug
Running commit-and-tag-version with the option to skip the bump step uses the current version in package.json instead of using the version specified with the argument releaseAs.

Current behavior
Steps following bump (changelog, commit, tag) run with the current version in package.json.

Expected behavior
Other steps (changelog, commit, tag) should run with the version specified with releaseAs.

Environment

  • commit-and-tag-version version(s): 12.2.0
  • Node/npm version: Node 20.5.0
  • OS: Windows 10

Possible Solution

In bump.js, the logic for determining the newVersion from releaseAs (I think lines 46-62) should be moved up to line 35, and the check for args.skip.bump should be moved to occur right after that, returning the releaseAs version if it exists.

Additional context
Add any other context about the problem here. Or a screenshot if applicable

Why did `npx commit-and-tag-version` miss the most recent commit?

I have the following commits in a git repo

* b834d91 - (HEAD -> main, tag: v1.3.1) chore(release): 1.3.1
* 5edaef6 - refactor(utilities): utility scripts each moved to their seperate scripts inside subfolder
* 6b76a6c - fix(git): app-tag script skips the run when no relevant changes are detected
* 8b21c9d - (tag: v1.3.0) chore(release): 1.3.0
* e27d1d1 - feat(ansible): ansible moved to devops folder
* 8b308bf - (tag: v1.2.3) chore(release): 1.2.3
* 240d0cf - (tag: v1.2.2) chore(release): 1.2.2
* d07d01e - (tag: v1.2.1) chore(release): 1.2.1
* db633c8 - (tag: v1.2.0) chore(release): 1.2.0
* a0bb9b8 - feat(ansible): ansible script moved to devops/ansible
* 8d41f0a - feat: playbook separated into file and converted to a function
* c6096a7 - (tag: v1.1.1) chore(release): 1.1.1
* c26875d - (tag: v1.1.0) chore(release): 1.1.0
* 3737bbf - feat: ansible playbook script converted to a function
* 5639760 - feat: disk_usage command added based on dua-cli

But my changelog does not show the top most commit in the v1.3.1 run.

* 5edaef6 - refactor(utilities): utility scripts each moved to their seperate scripts inside subfolder

I just ran npx commit-and-tag-version
What did I miss?

The CHANGELOG.md file is the following

# Changelog

All notable changes to this project will be documented in this file. See [commit-and-tag-version](...) for commit guidelines.

## [1.3.1](...) (2024-02-28)


### Bug Fixes

* **git:** app-tag script skips the run when no relevant changes are detected ([6b76a6c](...))

## [1.3.0](...) (2024-02-28)


### Features

* **ansible:** ansible moved to devops folder ([e27d1d1](...))

## [1.2.3](...) (2024-02-28)

## [1.2.2](...) (2024-02-28)

## [1.2.1](...) (2024-02-28)

## [1.2.0](...) (2024-02-28)


### Features

* **ansible:** ansible script moved to devops/ansible ([a0bb9b8](...))
* playbook separated into file and converted to a function ([8d41f0a](...))

## [1.1.1](...) (2024-02-28)

## 1.1.0 (2024-02-28)


### Features

* ansible playbook script converted to a function ([3737bbf](...))
* disk_usage command added based on dua-cli ([5639760](...))

Unable to obtain updater for 'manifest-beta.json'

Describe the bug
When I try to use an "uncommon" manifest name, I have an error.
The manifest here is a valid json file, and the "normal" name (aka manifest.json) works. I use -beta for beta release on a specific workflow.

My config is :

"scripts": {
"beta": "commit-and-tag-version --prerelease --tag-build beta",
"community": "commit-and-tag-version --packageFiles package.json --bumpFiles manifest-beta.json"
},
"commit-and-tag-version": {
"t": "",
"bumpFiles": [
	{
	"filename": "manifest-beta.json",
	"type": "json"
	},
        {
	"filename": "package.json",
	"type": "json"
	}]}

Current behavior
Actually, the manifest-beta is not updated and skipped.

Log :

Unable to obtain updater for: "manifest-beta.json"
 - Error: Unsupported file (manifest-beta.json) provided for bumping.
 Please specify the updater `type` or use a custom `updater`.
 - Skipping...

Expected behavior
Should be updated as the manifest.

Environment

  • commit-and-tag-version version(s): [e.g. v6.0.0, v8.0.0, master] : 10.0.1
  • Node/npm version: [e.g. Node 10/npm 6]: v16.13.2 / 8.5.5
  • OS: [e.g. OSX 10.13.4, Windows 10] Windows 11

Possible Solution

  • get type based on .json
  • Possibility to add type directly in CLI
  • regex on "normal" name, and include every file with manifest.json in it. As \S*manifest\S*\.json$

Additional context
My goal is to separate release of manifest-beta and manifest but update manifest-beta when the manifest is updated.

PRs from standard-version that could be brought in

I've already merged and released all the easy PRs from standard-version. This issue is a list of all the PRs that could be accepted under the fork rationale, but that I felt needed a bit of work before merging. Discussion and PRs welcome.

  • conventional-changelog#825 Adds the ability to use lightweight tags - it seems worth accepting, but I felt the documentation didn't describe the feature in a way that I understood.
  • conventional-changelog#561 This improves the information that updaters recieve - I think this is a good idea, but it would be better long term if the third argument was a metadata object with a key of filePath instead of just the filename.
  • conventional-changelog#721 This brings in the ability to have async file updaters. This is definitely a good idea, it just needs tests with both async and non async file updaters.
  • conventional-changelog#649 This adds the ability to have release titles. The changelog is included in the PR (which needs to be removed) and it needs documentation
  • conventional-changelog#448 This adds the ability to source versions from information other than git tags - the name of the parameter needs updating, it needs tests, and it needs documentation

[Request] Use .npmrc message key if available

It would be nice if I can have the message option set on my .npmrc and commit-and-tag-version could use that if no --releaseCommitMessageFormat was passed in the CLI. That way, if someone releases using npm version for any reason, at least the messages will always be consistent.

[feat]: provide intellisense for `package.json` configs

This is more of a nice-to-have since the conversion to TypeScript will allow for using a strongly typed config file. For this, we would need to generate JSON schemas to represent the configuration options.

Within the month I'll be releasing a library, inspired by zod, which has a similar API but can also generate JSON schemas. This would kill two birds: we get strong validation for configuration options at run-time and can use the same validators to generate the JSON schema during CI (for static validation).

Basically, I'm just parking this thought as a reminder to myself 😄

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.