fork-version
v5.1.7
Published
Fork-Version automates version control tasks such as determining, updating, and committing versions, files, and changelogs, simplifying the process when adhering to the conventional commit standard.
Maintainers
Readme
Fork-Version
What Does Fork-Version Do?
By following the conventional commit standard Fork-Version can automate the following tasks for you:
- Determine the current and next version
- Update the version in the selected files (View the supported files)
- Update your changelog
- Commit the changed files
- Create a tag for the new version
Fork-Version won't attempt to push changes to git or to a package manager, this allows you to decide how you publish your changes.
Using Fork-Version
Primarily designed to be used with npx, Fork-Version can also be installed globally or directly to the node package you're working on. The only software prerequisites you need are git and node or a node compatible runtime.
Fork-Version can be configured either through a config file or by passing options to the tool when ran. To see command line options you can run fork-version --help or view the Configuration documentation for details on the supported options and how to use them.
Using npx
To use Fork-Version without installation you can use npx:
npx fork-versionnpx is a package runner which allows you to execute npm packages without installation, this can be useful when working on projects outside of the Node ecosystem.
[!NOTE] By default
npxwill use a cached version if available on your system or the latest version otherwise. You can use thelatesttag to force npx to use the latest version. Alternatively if you want to use a specific version or pin to a range you can add a version tag to the end of the package name:
npx fork-version@5(Recommended)
- Use the latest version of fork-version in the 5.x range
npx [email protected]
- Use the latest version of fork-version in the 5.1.x range
npx [email protected]
- Use the specific version 5.1.0 of fork-version
The version tag needs to match against one of the published versions on npm.
Alternatively you can use other npm compatible javascript runtime's:
| Runner | Command |
| ------ | -------------------------- |
| bun | bunx fork-version |
| deno | deno -A npm:fork-version |
Install Locally
To install the package locally to your project you can use one of the following commands:
| Package Manager | Install Command |
| --------------- | ------------------------------------- |
| npm | npm install fork-version --save-dev |
| pnpm | pnpm add fork-version --save-dev |
| yarn | yarn add fork-version --dev |
| bun | bun install fork-version --dev |
You can then add the following entry to your package.json scripts section and use it like any other script you already use in your project.
// package.json
{
"scripts": {
"release": "fork-version -G \"{*/*.csproj,*/package.json}\""
}
}For example if you use npm you can now use npm run release to run Fork-Version.
Commands
Fork-Version has a number of command modes which will make the program behave differently. The default "command" is the main mode, this mode will be used when no other command is defined.
| Command | Description |
| ------------------- | ---------------------------------------------------------------------- |
| main | Bumps the version, update files, generate changelog, commits, and tag. |
| inspect | Print the current version and git tag, then exit. |
| inspect-version | Print the current version then exit. |
| inspect-tag | Print the current git tag then exit. |
| validate-config | Validates the configuration and exit. |
Exit Codes
When ran as a cli tool Fork-Version will exit with one of the following exit codes:
| Exit Code | Description | | --------- | ---------------------------- | | 0 | Success | | 1 | General Error | | 2 | Unknown Command | | 3 | Config File Validation Error |
Supported File Managers
Fork-Version supports a number of built in file managers for popular file types, the following file types are supported out of the box:
Read more about the supported file managers and how to create your own custom file managers.
Code Usage
[!WARNING] Code usage is not recommended as the public api is not stable and may change between versions.
In the future the api may be stabilized and documented but this is not a focus at this time.
