Skip to content

eglavin/fork-version

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

563 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fork-Version

NPM Version JSR Version Package Publish Package

Fork Version Icon

Fork-Version automates version control tasks such as determining, updating, and committing versions, files, and changelogs, simplifying the versioning process when adhering to the conventional commit standard.

This project is essentially a complete re-write of standard-version following on from its deprecation in May 2022. Although there are many alternatives such as release-please. This project aims to continue focusing on just the versioning and changelog generation aspect of the process for use in other Git hosts outside of Github.

What Does Fork-Version Do?

By following the conventional commit standard Fork-Version can automate the following tasks for you:

  1. Determine the current and next version
  2. Update the version in the selected files (View the supported files)
  3. Update your changelog
  4. Commit the changed files
  5. 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-version

npx 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 npx will use a cached version if available on your system or the latest version otherwise. You can use the latest tag 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 fork-version@5.1
    • Use the latest version of fork-version in the 5.1.x range
  • npx fork-version@5.1.0
    • 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.

About

fork-version automates version control tasks: determining, updating, and committing versions, files, and changelogs, simplifying the process when using conventional commits.

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Contributors