{"_id":"4part-version","_rev":"2-7c79b8b9d93efc28551a748d950d4a7a","name":"4part-version","dist-tags":{"latest":"1.0.2"},"versions":{"1.0.0":{"name":"4part-version","version":"1.0.0","keywords":["conventional-changelog","recommended","changelog","automatic","workflow","version","semver","4-part-version","revision"],"author":{"name":"Clauber Oliveira"},"license":"MIT","_id":"4part-version@1.0.0","maintainers":[{"name":"clauber","email":"cklauber@gmail.com"}],"homepage":"https://github.com/clauber/4part-version#readme","bugs":{"url":"https://github.com/clauber/4part-version/issues"},"bin":{"4part-version":"bin/cli.js"},"nyc":{"exclude":["tmp/**"]},"dist":{"shasum":"d91bf9b390270aa0ab8bab1c8041789d15aa0fe7","tarball":"https://registry.npmjs.org/4part-version/-/4part-version-1.0.0.tgz","fileCount":25,"integrity":"sha512-Wc5v90LLUyhHBvdBEu5PcJgktloDffF3iMmmtWRf4RMArObbqaz4bZsTPnuM0Icv+Nb6ParbMictcgz0GgLuMg==","signatures":[{"sig":"MEUCIB40+sCJRLx4UQlELx4eSnNXQIUw75iyyOrXGVdM9NDQAiEA2G/Cu3LCEHkeOmYioEUg1UlTowoLyda2srVyrcHm8Go=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":49314},"main":"index.js","engines":{"node":">=10"},"gitHead":"3f433983869f47209a60af5d7de5368ecf73ef68","scripts":{"fix":"eslint . --fix","lint":"eslint .","test":"nyc mocha --timeout=30000","release":"bin/cli.js","coverage":"nyc report --reporter=lcov","posttest":"eslint .","test:unit":"mocha --exclude test/git.spec.js"},"_npmUser":{"name":"clauber","email":"cklauber@gmail.com"},"repository":{"url":"git+https://github.com/clauber/4part-version.git","type":"git"},"_npmVersion":"10.9.0","description":"A fork of standard-version that supports 4-part versioning (x.y.z.a) with automatic CHANGELOG generation","directories":{},"_nodeVersion":"22.11.0","dependencies":{"chalk":"^2.4.2","yargs":"^16.0.0","semver":"^7.1.1","figures":"^3.1.0","find-up":"^5.0.0","dotgitignore":"^2.1.0","detect-indent":"^6.0.0","detect-newline":"^3.1.0","git-semver-tags":"^4.0.0","stringify-package":"^1.0.1","conventional-changelog":"3.1.25","conventional-recommended-bump":"6.1.0","conventional-changelog-config-spec":"2.1.0","conventional-changelog-conventionalcommits":"4.6.3"},"_hasShrinkwrap":false,"devDependencies":{"nyc":"^15.1.0","chai":"^4.2.0","mocha":"^8.2.1","eslint":"^7.14.0","mock-fs":"^4.13.0","mockery":"^2.1.0","shelljs":"^0.8.4","std-mocks":"^1.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-import":"^2.22.1","eslint-plugin-promise":"^5.0.0","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/4part-version_1.0.0_1743440617122_0.14809094098117015","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"4part-version","version":"1.0.2","description":"A fork of standard-version that supports 4-part versioning (x.y.z.a) with automatic CHANGELOG generation","bin":{"4part-version":"bin/cli.js"},"main":"index.js","scripts":{"fix":"eslint . --fix","posttest":"eslint .","test":"nyc mocha --timeout=30000","test:unit":"mocha --exclude test/git.spec.js","coverage":"nyc report --reporter=lcov","release":"bin/cli.js","lint":"eslint .","release:major":"npx 4part-version --release-as major","release:minor":"npx 4part-version --release-as minor","release:patch":"npx 4part-version --release-as patch","release:revision":"npx 4part-version --release-as revision","release:match":"npx 4part-version --release-version","release:prerelease":"npx 4part-version --prerelease","release:prerelease-alpha":"npx 4part-version --prerelease alpha","release:prerelease-beta":"npx 4part-version --prerelease beta","release:prerelease-rc":"npx 4part-version --prerelease rc"},"nyc":{"exclude":["tmp/**"]},"repository":{"type":"git","url":"git+https://github.com/clauber/4part-version.git"},"engines":{"node":">=10"},"keywords":["conventional-changelog","recommended","changelog","automatic","workflow","version","semver","4-part-version","revision"],"author":{"name":"Clauber Oliveira"},"license":"MIT","bugs":{"url":"https://github.com/clauber/4part-version/issues"},"homepage":"https://github.com/clauber/4part-version#readme","dependencies":{"chalk":"^2.4.2","conventional-changelog":"3.1.25","conventional-changelog-config-spec":"2.1.0","conventional-changelog-conventionalcommits":"4.6.3","conventional-recommended-bump":"6.1.0","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":"^4.0.0","semver":"^7.1.1","stringify-package":"^1.0.1","yargs":"^16.0.0"},"devDependencies":{"chai":"^4.2.0","eslint":"^7.14.0","eslint-config-standard":"^16.0.2","eslint-plugin-import":"^2.22.1","eslint-plugin-node":"^11.1.0","eslint-plugin-promise":"^5.0.0","mocha":"^8.2.1","mock-fs":"^4.13.0","mockery":"^2.1.0","nyc":"^15.1.0","shelljs":"^0.8.4","std-mocks":"^1.0.1"},"_id":"4part-version@1.0.2","gitHead":"88ac141ec0707053a6d93f0ae46cb0976ade6200","_nodeVersion":"22.11.0","_npmVersion":"10.9.0","dist":{"integrity":"sha512-Ifq5X8syYLss7QWf8iLKYbOwGv8rdyfSosuENgCMV+QGuwnZ3gU1dya+VBzD7MvKDqRLlOB76hIMkpcxRd2rJw==","shasum":"a5f75a204333603f80c01432788d9efaa68b1af7","tarball":"https://registry.npmjs.org/4part-version/-/4part-version-1.0.2.tgz","fileCount":25,"unpackedSize":52323,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQC3OHfITdcD3hj55m93ArOF/RPl7QIDLn7ygSRRvHtEZwIgSux874EKx752pdt25VQvaSXTaDw7ir8LanRuj/U6jTs="}]},"_npmUser":{"name":"clauber","email":"cklauber@gmail.com"},"directories":{},"maintainers":[{"name":"clauber","email":"cklauber@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/4part-version_1.0.2_1746675716718_0.7567149495802592"},"_hasShrinkwrap":false}},"time":{"created":"2025-03-31T17:03:37.122Z","modified":"2025-05-08T03:41:57.332Z","1.0.0":"2025-03-31T17:03:37.361Z","1.0.2":"2025-05-08T03:41:57.164Z"},"bugs":{"url":"https://github.com/clauber/4part-version/issues"},"author":{"name":"Clauber Oliveira"},"license":"MIT","homepage":"https://github.com/clauber/4part-version#readme","keywords":["conventional-changelog","recommended","changelog","automatic","workflow","version","semver","4-part-version","revision"],"repository":{"type":"git","url":"git+https://github.com/clauber/4part-version.git"},"description":"A fork of standard-version that supports 4-part versioning (x.y.z.a) with automatic CHANGELOG generation","maintainers":[{"name":"clauber","email":"cklauber@gmail.com"}],"readme":"# 4part-version\n\n> A fork of [standard-version](https://github.com/clauber/4part-version) that supports 4-part versioning (x.y.z.a) instead of the standard semver 3-part versioning.\n\nA utility for versioning using extended semver (supporting 4-part versions) and CHANGELOG generation powered by [Conventional Commits](https://conventionalcommits.org).\n\n## Key Features\n\n- Supports 4-part versioning (x.y.z.a) where:\n\n  - x: Major version (breaking changes)\n  - y: Minor version (new features)\n  - z: Patch version (bug fixes)\n  - a: Revision/Build number\n\n- All the features of standard-version including:\n  - Automatic CHANGELOG generation\n  - Git tag creation\n  - Commit message convention enforcement\n  - Flexible configuration\n\n## Installation\n\n```bash\nnpm install --save-dev 4part-version\n```\n\n## Usage\n\n### NPM Scripts\n\nAdd these scripts to your package.json for easy version management:\n\n```json\n{\n  \"scripts\": {\n    \"release:major\": \"npx 4part-version --release-as major\",\n    \"release:minor\": \"npx 4part-version --release-as minor\",\n    \"release:patch\": \"npx 4part-version --release-as patch\",\n    \"release:revision\": \"npx 4part-version --release-as revision\",\n    \"release:match\": \"npx 4part-version --release-version\",\n    \"release:prerelease\": \"npx 4part-version --prerelease\",\n    \"release:prerelease-alpha\": \"npx 4part-version --release-as revision --prerelease alpha\",\n    \"release:prerelease-beta\": \"npx 4part-version --release-as revision --prerelease beta\",\n    \"release:prerelease-rc\": \"npx 4part-version --release-as revision --prerelease rc\"\n  }\n}\n```\n\n### Command Line Usage\n\n```bash\n# Bump major version (1.0.0.0 -> 2.0.0.0)\nnpm run release:major\n\n# Bump minor version (1.0.0.0 -> 1.1.0.0)\nnpm run release:minor\n\n# Bump patch version (1.0.0.0 -> 1.0.1.0)\nnpm run release:patch\n\n# Bump revision number (1.0.0.0 -> 1.0.0.1)\nnpm run release:revision\n\n# Set to a specific version\nnpm run release:match -- 2.0.0.0\n\n# Create a prerelease version\nnpm run release:prerelease\n\n# Create an alpha prerelease\nnpm run release:prerelease-alpha\n\n# Create a beta prerelease\nnpm run release:prerelease-beta\n\n# Create an RC prerelease\nnpm run release:prerelease-rc\n```\n\n### Direct Usage\n\nYou can also use the CLI directly:\n\n```bash\n# Using npx\nnpx 4part-version\n\n# Or install globally\nnpm install -g 4part-version\n```\n\n## Version Commands\n\nThe package supports the following version commands:\n\n- `--release-as <major|minor|patch|revision>`: Specify which part of the version to bump\n- `--release-version <version>`: Specify an exact version (e.g., 1.2.3.4)\n- `--prerelease [tag]`: Create a prerelease version (e.g., 1.2.3.4-alpha.0)\n\nExamples:\n\n```bash\n# Bump revision number (1.2.3.4 -> 1.2.3.5)\nnpx 4part-version --release-as revision\n\n# Set specific version\nnpx 4part-version --release-version 1.2.3.4\n\n# Using NPM script to set a specific version\n# Note: the -- is required to pass the version as an argument\nnpm run release:match -- 1.2.3.4\n\n# Create pre-release with revision\nnpx 4part-version --release-as revision --prerelease alpha\n```\n\n![ci](https://github.com/clauber/4part-version/workflows/ci/badge.svg)\n[![NPM version](https://img.shields.io/npm/v/4part-version.svg)](https://www.npmjs.com/package/4part-version)\n[![codecov](https://codecov.io/gh/clauber/4part-version/branch/master/graph/badge.svg?token=J7zMN7vTTd)](https://codecov.io/gh/clauber/4part-version)\n[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg)](https://conventionalcommits.org)\n[![Community slack](http://devtoolscommunity.herokuapp.com/badge.svg)](http://devtoolscommunity.herokuapp.com)\n\n_Having problems? Want to contribute? Join us on the [node-tooling community Slack](http://devtoolscommunity.herokuapp.com)_.\n\n_How It Works:_\n\n1. Follow the [Conventional Commits Specification](https://conventionalcommits.org) in your repository.\n2. When you're ready to release, run `4part-version`.\n\n`4part-version` will then do the following:\n\n1. Retrieve the current version of your repository by looking at `packageFiles`[[1]](#bumpfiles-packagefiles-and-updaters), falling back to the last `git tag`.\n2. `bump` the version in `bumpFiles`[[1]](#bumpfiles-packagefiles-and-updaters) based on your commits.\n3. Generates a `changelog` based on your commits (uses [conventional-changelog](https://github.com/conventional-changelog/conventional-changelog) under the hood).\n4. Creates a new `commit` including your `bumpFiles`[[1]](#bumpfiles-packagefiles-and-updaters) and updated CHANGELOG.\n5. Creates a new `tag` with the new version number.\n\n### `bumpFiles`, `packageFiles` and `updaters`\n\n`4part-version` uses a few key concepts for handling version bumping in your project.\n\n- **`packageFiles`** – User-defined files where versions can be read from _and_ be \"bumped\".\n  - Examples: `package.json`, `manifest.json`\n  - In most cases (including the default), `packageFiles` are a subset of `bumpFiles`.\n- **`bumpFiles`** – User-defined files where versions should be \"bumped\", but not explicitly read from.\n  - Examples: `package-lock.json`, `npm-shrinkwrap.json`\n- **`updaters`** – Simple modules used for reading `packageFiles` and writing to `bumpFiles`.\n\nBy default, `4part-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.\n\nThat said, if you find your self asking [How can I use 4part-version for additional metadata files, languages or version files?](#can-i-use-4part-version-for-additional-metadata-files-languages-or-version-files) – these configuration options will help!\n\n## Configuration\n\nYou can configure `4part-version` either by:\n\n1. Placing a `4part-version` stanza in your `package.json` (assuming\n   your project is JavaScript).\n2. Creating a `.versionrc`, `.versionrc.json` or `.versionrc.js`.\n\n- If you are using a `.versionrc.js` your default export must be a configuration object, or a function returning a configuration object.\n\nAny of the command line parameters accepted by `4part-version` can instead\nbe provided via configuration. Please refer to the [conventional-changelog-config-spec](https://github.com/conventional-changelog/conventional-changelog-config-spec/) for details on available configuration options.\n\n### Customizing CHANGELOG Generation\n\nBy default (as of `6.0.0`), `4part-version` uses the [conventionalcommits preset](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-conventionalcommits).\n\nThis preset:\n\n- Adheres closely to the [conventionalcommits.org](https://www.conventionalcommits.org)\n  specification.\n- Is highly configurable, following the configuration specification\n  [maintained here](https://github.com/conventional-changelog/conventional-changelog-config-spec).\n  - _We've documented these config settings as a recommendation to other tooling makers._\n\nThere are a variety of dials and knobs you can turn related to CHANGELOG generation.\n\nAs an example, suppose you're using GitLab, rather than GitHub, you might modify the following variables:\n\n- `commitUrlFormat`: the URL format of commit SHAs detected in commit messages.\n- `compareUrlFormat`: the URL format used to compare two tags.\n- `issueUrlFormat`: the URL format used to link to issues.\n\nMaking these URLs match GitLab's format, rather than GitHub's.\n\n## CLI Usage\n\n> **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`.\n\n### First Release\n\nTo generate your changelog for your first release, simply do:\n\n```sh\n# npm run script\nnpm run release -- --first-release\n# global bin\n4part-version --first-release\n# npx\nnpx 4part-version --first-release\n```\n\nThis will tag a release **without bumping the version `bumpFiles`[1]()**.\n\nWhen you are ready, push the git tag and `npm publish` your first release. \\o/\n\n### Cutting Releases\n\nIf you typically use `npm version` to cut a new release, do this instead:\n\n```sh\n# npm run script\nnpm run release\n# or global bin\n4part-version\n```\n\nAs 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/\n\nAfter you cut a release, you can push the new git tag and `npm publish` (or `npm publish --tag next`) when you're ready.\n\n### Release as a Pre-Release\n\nUse the flag `--prerelease` to generate pre-releases:\n\nSuppose the last version of your code is `1.2.3.4`, and your code to be committed has patched changes. Run:\n\n```bash\n# npm run script\nnpm run release -- --prerelease\n```\n\nThis will tag your version as: `1.2.3.4-0`.\n\nIf you want to name the pre-release, you specify the name via `--prerelease <name>`.\n\nFor example, suppose your pre-release should contain the `alpha` prefix:\n\n```bash\n# npm run script\nnpm run release -- --prerelease alpha\n```\n\nThis will tag the version as: `1.2.3.4-alpha.0`\n\n### Release as a Target Type Imperatively (`npm version`-like)\n\nTo forgo the automated version bump use `--release-as` with the argument `major`, `minor` or `patch`.\n\nSuppose the last version of your code is `1.0.0.0`, you've only landed `fix:` commits, but\nyou would like your next release to be a `minor`. Simply run the following:\n\n```bash\n# npm run script\nnpm run release -- --release-as minor\n# Or\nnpm run release -- --release-as 1.1.0.0\n```\n\nYou will get version `1.1.0.0` rather than what would be the auto-generated version `1.0.0.1`.\n\n> **NOTE:** you can combine `--release-as` and `--prerelease` to generate a release. This is useful when publishing experimental feature(s).\n\n### Prevent Git Hooks\n\nIf 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:\n\n```sh\n# npm run script\nnpm run release -- --no-verify\n# or global bin\n4part-version --no-verify\n```\n\n### Signing Commits and Tags\n\nIf you have your GPG key set up, add the `--sign` or `-s` flag to your `4part-version` command.\n\n### Lifecycle Scripts\n\n`4part-version` supports lifecycle scripts. These allow you to execute your\nown supplementary commands during the release. The following\nhooks are available and execute in the order documented:\n\n- `prerelease`: executed before anything happens. If the `prerelease` script returns a\n  non-zero exit code, versioning will be aborted, but it has no other effect on the\n  process.\n- `prebump`/`postbump`: executed before and after the version is bumped. If the `prebump`\n  script returns a version #, it will be used rather than\n  the version calculated by `4part-version`.\n- `prechangelog`/`postchangelog`: executes before and after the CHANGELOG is generated.\n- `precommit`/`postcommit`: called before and after the commit step.\n- `pretag`/`posttag`: called before and after the tagging step.\n\nSimply add the following to your package.json to configure lifecycle scripts:\n\n```json\n{\n  \"4part-version\": {\n    \"scripts\": {\n      \"prebump\": \"echo 9.9.9.9\"\n    }\n  }\n}\n```\n\nAs an example to change from using GitHub to track your items to using your projects Jira use a\n`postchangelog` script to replace the url fragment containing 'https://github.com/`myproject`/issues/'\nwith a link to your Jira - assuming you have already installed [replace](https://www.npmjs.com/package/replace)\n\n```json\n{\n  \"4part-version\": {\n    \"scripts\": {\n      \"postchangelog\": \"replace 'https://github.com/myproject/issues/' 'https://myjira/browse/' CHANGELOG.md\"\n    }\n  }\n}\n```\n\n### Skipping Lifecycle Steps\n\nYou can skip any of the lifecycle steps (`bump`, `changelog`, `commit`, `tag`),\nby adding the following to your package.json:\n\n```json\n{\n  \"4part-version\": {\n    \"skip\": {\n      \"changelog\": true\n    }\n  }\n}\n```\n\n### Committing Generated Artifacts in the Release Commit\n\nIf 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:\n\n```json\n{\n  \"4part-version\": {\n    \"scripts\": {\n      \"prerelease\": \"webpack -p --bail && git add <file(s) to commit>\"\n    }\n  }\n}\n```\n\n```json\n{\n  \"scripts\": {\n    \"release\": \"4part-version -a\"\n  }\n}\n```\n\n### Dry Run Mode\n\nrunning `4part-version` with the flag `--dry-run` allows you to see what\ncommands would be run, without committing to git or updating files.\n\n```\n\n```\n","readmeFilename":"README.md"}