[
  {
    "path": ".editorconfig",
    "content": "# EditorConfig is awesome: http://EditorConfig.org\n\nroot = true\n\n[*]\ntrim_trailing_whitespace=true\nindent_style = space\nindent_size = 2\ninsert_final_newline = true\n"
  },
  {
    "path": ".eslintrc",
    "content": "{\n  \"extends\": \"standard\",\n  \"rules\": {\n    \"no-var\": \"error\"\n  }\n}"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/ask-a-question.md",
    "content": "---\nname: Ask a Question\nabout: '\"How can I X?\" – ask a question about how to use standard-version.'\ntitle: ''\nlabels: question\nassignees: ''\n\n---\n\n\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/bug-report.md",
    "content": "---\nname: Bug Report\nabout: Use this template if something isn't working as expected.\ntitle: ''\nlabels: bug\nassignees: ''\n\n---\n\n**Describe the bug**\nA clear and concise description of what the bug is.\n\n**Current behavior**\nA clear and concise description of the behavior.\n\n\n**Expected behavior**\nA clear and concise description of what you expected to happen.\n\n\n\n**Environment**\n- `standard-version` version(s): [e.g. v6.0.0, v8.0.0, master]\n- Node/npm version: [e.g. Node 10/npm 6]\n- OS: [e.g. OSX 10.13.4, Windows 10]\n\n**Possible Solution**\n<!--- If you have suggestions on a fix for the bug -->\n\n**Additional context**\nAdd any other context about the problem here. Or a screenshot if applicable\n"
  },
  {
    "path": ".github/workflows/ci.yaml",
    "content": "on:\n  push:\n    branches:\n      - master\n  pull_request:\n    types: [ assigned, opened, synchronize, reopened, labeled ]\nname: ci\njobs:\n  test:\n    runs-on: ${{ matrix.os }}\n    strategy:\n      matrix:\n        node: [10, 12, 14]\n        os: [ubuntu-latest, windows-latest]\n    env:\n        OS: ${{ matrix.os }}\n        NODE_VERSION: ${{ matrix.node }}\n    steps:\n      - uses: actions/checkout@v4\n      - run: git fetch --prune --unshallow\n      - run: git config --global user.name 'Actions'\n      - run: git config --global user.email 'dummy@example.org'\n      - uses: actions/setup-node@v2\n        with:\n          node-version: ${{ matrix.node }}\n      - run: node --version\n      - run: npm install --engine-strict\n      - run: npm test\n      - run: npm run coverage\n      - name: Codecov\n        uses: codecov/codecov-action@v2\n        with:\n          env_vars: OS, NODE_VERSION\n"
  },
  {
    "path": ".github/workflows/release-please.yml",
    "content": "on:\n  push:\n    branches:\n      - master\nname: release-please\njobs:\n  release-please:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: GoogleCloudPlatform/release-please-action@v3\n        id: release\n        with:\n          token: ${{ secrets.GITHUB_TOKEN }}\n          release-type: node\n          package-name: standard-version\n      # The logic below handles the npm publication:\n      - uses: actions/checkout@v4\n        # these if statements ensure that a publication only occurs when\n        # a new release is created:\n        if: ${{ steps.release.outputs.release_created }}\n      - uses: actions/setup-node@v1\n        with:\n          node-version: 12\n          registry-url: 'https://external-dot-oss-automation.appspot.com'\n        if: ${{ steps.release.outputs.release_created }}\n      - run: npm ci\n        if: ${{ steps.release.outputs.release_created }}\n      - run: npm publish\n        env:\n          NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}\n        if: ${{ steps.release.outputs.release_created }}\n"
  },
  {
    "path": ".gitignore",
    "content": "# OS\n.DS_Store\n\n# node.js & npm\nnode_modules\n.nyc_output\nnpm-debug.log\n\n# Editor files\n/.project\n/.settings\n/.idea\n/.vscode\n\n# coverage\ncoverage\npackage-lock.json"
  },
  {
    "path": ".versionrc",
    "content": "{\n  \"types\": [\n    {\"type\":\"feat\",\"section\":\"Features\"},\n    {\"type\":\"fix\",\"section\":\"Bug Fixes\"},\n    {\"type\":\"test\",\"section\":\"Tests\", \"hidden\": true},\n    {\"type\":\"build\",\"section\":\"Build System\", \"hidden\": true},\n    {\"type\":\"ci\",\"hidden\":true}\n  ]\n}\n\n"
  },
  {
    "path": "CHANGELOG.md",
    "content": "# Changelog\n\nAll notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.\n\n## [9.5.0](https://github.com/conventional-changelog/standard-version/compare/v9.4.0...v9.5.0) (2022-05-15)\n\n\n### Features\n\n* **deprecated:** add deprecation message ([#907](https://github.com/conventional-changelog/standard-version/issues/907)) ([61b41fa](https://github.com/conventional-changelog/standard-version/commit/61b41fa47ef690f55b92e2edb82fe554e3c1e13a))\n\n\n### Bug Fixes\n\n* **deps:** update dependency conventional-changelog to v3.1.25 ([#865](https://github.com/conventional-changelog/standard-version/issues/865)) ([4c938a2](https://github.com/conventional-changelog/standard-version/commit/4c938a2baac11385d655144429bc73b2199bb027))\n* **deps:** update dependency conventional-changelog-conventionalcommits to v4.6.3 ([#866](https://github.com/conventional-changelog/standard-version/issues/866)) ([6c75ed0](https://github.com/conventional-changelog/standard-version/commit/6c75ed0b1456913ae7e4d6fe8532fb4106df1bdf))\n\n## [9.4.0](https://github.com/conventional-changelog/standard-version/compare/v9.3.2...v9.4.0) (2021-12-31)\n\n\n### Features\n\n* add .cjs config file ([#717](https://github.com/conventional-changelog/standard-version/issues/717)) ([eceaedf](https://github.com/conventional-changelog/standard-version/commit/eceaedf8b3cdeb282ee06bfa9c65503f42404858))\n\n\n### Bug Fixes\n\n* Ensures provided `packageFiles` arguments are merged with `bumpFiles` when no `bumpFiles` argument is specified (default). ([#534](https://github.com/conventional-changelog/standard-version/issues/534)) ([2785023](https://github.com/conventional-changelog/standard-version/commit/2785023c91668e7300e6a22e55d31b6bd9dae59b)), closes [#533](https://github.com/conventional-changelog/standard-version/issues/533)\n\n### [9.3.2](https://www.github.com/conventional-changelog/standard-version/compare/v9.3.1...v9.3.2) (2021-10-17)\n\n\n### Bug Fixes\n\n* **deps:** update dependency conventional-changelog-conventionalcommits to v4.6.1 ([#752](https://www.github.com/conventional-changelog/standard-version/issues/752)) ([bb8869d](https://www.github.com/conventional-changelog/standard-version/commit/bb8869de7d8bcace1ec92f29e389e7fab506d64e))\n\n### [9.3.1](https://www.github.com/conventional-changelog/standard-version/compare/v9.3.0...v9.3.1) (2021-07-14)\n\n\n### Bug Fixes\n\n* **updater:** npm7 package lock's inner version not being updated ([#713](https://www.github.com/conventional-changelog/standard-version/issues/713)) ([a316dd0](https://www.github.com/conventional-changelog/standard-version/commit/a316dd02f5a7d8dee33d99370afda8738985bc10))\n\n## [9.3.0](https://www.github.com/conventional-changelog/standard-version/compare/v9.2.0...v9.3.0) (2021-05-04)\n\n\n### Features\n\n* add --lerna-package flag used to extract tags in case of lerna repo ([#503](https://www.github.com/conventional-changelog/standard-version/issues/503)) ([f579ff0](https://www.github.com/conventional-changelog/standard-version/commit/f579ff08f386aaae022a395ed0dbec9af77a5d49))\n\n## [9.2.0](https://www.github.com/conventional-changelog/standard-version/compare/v9.1.1...v9.2.0) (2021-04-06)\n\n\n### Features\n\n* allows seperate prefixTag version sequences ([#573](https://www.github.com/conventional-changelog/standard-version/issues/573)) ([3bbba02](https://www.github.com/conventional-changelog/standard-version/commit/3bbba025057ba40c3e15880fede2af851841165b))\n\n### [9.1.1](https://www.github.com/conventional-changelog/standard-version/compare/v9.1.0...v9.1.1) (2021-02-06)\n\n\n### Bug Fixes\n\n* **deps:** update dependency conventional-recommended-bump to v6.1.0 ([#695](https://www.github.com/conventional-changelog/standard-version/issues/695)) ([65dd070](https://www.github.com/conventional-changelog/standard-version/commit/65dd070b9f01ffe1764e64ba739bc064b84f4129))\n* **deps:** update dependency yargs to v16 ([#660](https://www.github.com/conventional-changelog/standard-version/issues/660)) ([f6a7430](https://www.github.com/conventional-changelog/standard-version/commit/f6a7430329919874e1e744ac5dca2f83bba355df))\n\n## [9.1.0](https://www.github.com/conventional-changelog/standard-version/compare/v9.0.0...v9.1.0) (2020-12-01)\n\n\n### Features\n\n* support custom updater as object as well as path ([#630](https://www.github.com/conventional-changelog/standard-version/issues/630)) ([55bbde8](https://www.github.com/conventional-changelog/standard-version/commit/55bbde8476013de7a2f24bf29c7c12cb07f96e3f))\n\n\n### Bug Fixes\n\n* **deps:** update dependency conventional-changelog to v3.1.24 ([#677](https://www.github.com/conventional-changelog/standard-version/issues/677)) ([cc45036](https://www.github.com/conventional-changelog/standard-version/commit/cc45036d9960b6d83e0e850ccbbe8e8098d36ae6))\n* **deps:** update dependency conventional-changelog-conventionalcommits to v4.5.0 ([#678](https://www.github.com/conventional-changelog/standard-version/issues/678)) ([6317d36](https://www.github.com/conventional-changelog/standard-version/commit/6317d36130767cfd85114ab9033a6f1ef110388d))\n* **deps:** update dependency conventional-recommended-bump to v6.0.11 ([#679](https://www.github.com/conventional-changelog/standard-version/issues/679)) ([360789a](https://www.github.com/conventional-changelog/standard-version/commit/360789ab84957a67d3919cb28db1882cb68296fc))\n* **deps:** update dependency find-up to v5 ([#651](https://www.github.com/conventional-changelog/standard-version/issues/651)) ([df8db83](https://www.github.com/conventional-changelog/standard-version/commit/df8db832327a751d5c62fe361b6ac2d2b5f66bf6))\n\n## [9.0.0](https://www.github.com/conventional-changelog/standard-version/compare/v8.0.2...v9.0.0) (2020-08-15)\n\n\n### ⚠ BREAKING CHANGES\n\n* NodeJS@8 is no longer supported. (#612)\n\n### Bug Fixes\n\n* **deps:** update dependency conventional-changelog to v3.1.23 ([#652](https://www.github.com/conventional-changelog/standard-version/issues/652)) ([00dd3c0](https://www.github.com/conventional-changelog/standard-version/commit/00dd3c01aab20d28a8bbd1e174e416d6c2b34d90))\n* **deps:** update dependency conventional-changelog-conventionalcommits to v4.4.0 ([#650](https://www.github.com/conventional-changelog/standard-version/issues/650)) ([9f201a6](https://www.github.com/conventional-changelog/standard-version/commit/9f201a61bb50ec12053a04faccfaea20e44d6ff2))\n* **deps:** update dependency conventional-recommended-bump to v6.0.10 ([#653](https://www.github.com/conventional-changelog/standard-version/issues/653)) ([c360d6a](https://www.github.com/conventional-changelog/standard-version/commit/c360d6a307909c6e571b29d4a329fd786b4d4543))\n\n\n### Build System\n\n* NodeJS@8 is no longer supported. ([#612](https://www.github.com/conventional-changelog/standard-version/issues/612)) ([05edef2](https://www.github.com/conventional-changelog/standard-version/commit/05edef2de79d8d4939a6e699ce0979ff8da12de9))\n\n### [8.0.2](https://www.github.com/conventional-changelog/standard-version/compare/v8.0.1...v8.0.2) (2020-07-14)\n\n\n### Bug Fixes\n\n* Commit message and tag name is no longer enclosed in quotes. ([#619](https://www.github.com/conventional-changelog/standard-version/issues/619)) ([ae032bf](https://www.github.com/conventional-changelog/standard-version/commit/ae032bfa9268a0a14351b0d78b6deedee7891e3a)), closes [#621](https://www.github.com/conventional-changelog/standard-version/issues/621) [#620](https://www.github.com/conventional-changelog/standard-version/issues/620)\n\n### [8.0.1](https://www.github.com/conventional-changelog/standard-version/compare/v8.0.0...v8.0.1) (2020-07-12)\n\n\n### Bug Fixes\n\n* **deps:** update dependency conventional-changelog to v3.1.21 ([#586](https://www.github.com/conventional-changelog/standard-version/issues/586)) ([fd456c9](https://www.github.com/conventional-changelog/standard-version/commit/fd456c995f3f88497fbb912fb8aabb8a42d97dbb))\n* **deps:** update dependency conventional-changelog-conventionalcommits to v4.3.0 ([#587](https://www.github.com/conventional-changelog/standard-version/issues/587)) ([b3b5eed](https://www.github.com/conventional-changelog/standard-version/commit/b3b5eedea3eaf062d74d1004a55a0a6b1e3ca6c6))\n* **deps:** update dependency conventional-recommended-bump to v6.0.9 ([#588](https://www.github.com/conventional-changelog/standard-version/issues/588)) ([d4d2ac2](https://www.github.com/conventional-changelog/standard-version/commit/d4d2ac2a99c095227118da795e1c9e19d06c9a0a))\n* **deps:** update dependency git-semver-tags to v4 ([#589](https://www.github.com/conventional-changelog/standard-version/issues/589)) ([a0f0e81](https://www.github.com/conventional-changelog/standard-version/commit/a0f0e813b2be4a2065600a19075fda4d6f331ef8))\n* Vulnerability Report GHSL-2020-11101 ([9d978ac](https://www.github.com/conventional-changelog/standard-version/commit/9d978ac9d4f64be4c7b9d514712ab3757732d561))\n\n## [8.0.0](https://www.github.com/conventional-changelog/standard-version/compare/v7.1.0...v8.0.0) (2020-05-06)\n\n\n### ⚠ BREAKING CHANGES\n\n* `composer.json` and `composer.lock` will no longer be read from or bumped by default. If you need to obtain a version or write a version to these files, please use `bumpFiles` and/or `packageFiles` options accordingly.\n\n### Bug Fixes\n\n* composer.json and composer.lock have been removed from default package and bump files. ([c934f3a](https://www.github.com/conventional-changelog/standard-version/commit/c934f3a38da4e7234d9dba3b2405f3b7e4dc5aa8)), closes [#495](https://www.github.com/conventional-changelog/standard-version/issues/495) [#394](https://www.github.com/conventional-changelog/standard-version/issues/394)\n* **deps:** update dependency conventional-changelog to v3.1.18 ([#510](https://www.github.com/conventional-changelog/standard-version/issues/510)) ([e6aeb77](https://www.github.com/conventional-changelog/standard-version/commit/e6aeb779fe53ffed2a252e6cfd69cfcb786b9ef9))\n* **deps:** update dependency yargs to v15.1.0 ([#518](https://www.github.com/conventional-changelog/standard-version/issues/518)) ([8f36f9e](https://www.github.com/conventional-changelog/standard-version/commit/8f36f9e073119fcbf5ad843237fb06a4ca42a0f9))\n* **deps:** update dependency yargs to v15.3.1 ([#559](https://www.github.com/conventional-changelog/standard-version/issues/559)) ([d98cd46](https://www.github.com/conventional-changelog/standard-version/commit/d98cd4674b4d074c0b7f4d50d052ae618cf494c6))\n\n## [7.1.0](https://github.com/conventional-changelog/standard-version/compare/v7.0.1...v7.1.0) (2019-12-08)\n\n\n### Features\n\n* Adds support for `header` (--header) configuration based on the spec. ([#364](https://github.com/conventional-changelog/standard-version/issues/364)) ([ba80a0c](https://github.com/conventional-changelog/standard-version/commit/ba80a0c27029f54c751fe845560504925b45eab8))\n* custom 'bumpFiles' and 'packageFiles' support ([#372](https://github.com/conventional-changelog/standard-version/issues/372)) ([564d948](https://github.com/conventional-changelog/standard-version/commit/564d9482a459d5d7a2020c2972b4d39167ded4bf))\n\n\n### Bug Fixes\n\n* **deps:** update dependency conventional-changelog to v3.1.15 ([#479](https://github.com/conventional-changelog/standard-version/issues/479)) ([492e721](https://github.com/conventional-changelog/standard-version/commit/492e72192ebf35d7c58c00526b1e6bd2abac7f13))\n* **deps:** update dependency conventional-changelog-conventionalcommits to v4.2.3 ([#496](https://github.com/conventional-changelog/standard-version/issues/496)) ([bc606f8](https://github.com/conventional-changelog/standard-version/commit/bc606f8e96bcef1d46b28305622fc76dfbf306cf))\n* **deps:** update dependency conventional-recommended-bump to v6.0.5 ([#480](https://github.com/conventional-changelog/standard-version/issues/480)) ([1e1e215](https://github.com/conventional-changelog/standard-version/commit/1e1e215a633963188cdb02be1316b5506e3b99b7))\n* **deps:** update dependency yargs to v15 ([#484](https://github.com/conventional-changelog/standard-version/issues/484)) ([35b90c3](https://github.com/conventional-changelog/standard-version/commit/35b90c3f24cfb8237e94482fd20997900569193e))\n* use require.resolve for the default preset ([#465](https://github.com/conventional-changelog/standard-version/issues/465)) ([d557372](https://github.com/conventional-changelog/standard-version/commit/d55737239530f5eee684e9cbf959f7238d609fd4))\n* **deps:** update dependency detect-newline to v3.1.0 ([#482](https://github.com/conventional-changelog/standard-version/issues/482)) ([04ab36a](https://github.com/conventional-changelog/standard-version/commit/04ab36a12be58915cfa9c60771890e074d1f5685))\n* **deps:** update dependency figures to v3.1.0 ([#468](https://github.com/conventional-changelog/standard-version/issues/468)) ([63300a9](https://github.com/conventional-changelog/standard-version/commit/63300a935c0079fd03e8e1acc55fd5b1dcea677f))\n* **deps:** update dependency git-semver-tags to v3.0.1 ([#485](https://github.com/conventional-changelog/standard-version/issues/485)) ([9cc188c](https://github.com/conventional-changelog/standard-version/commit/9cc188cbb84ee3ae80d5e66f5c54727877313b14))\n* **deps:** update dependency yargs to v14.2.1 ([#483](https://github.com/conventional-changelog/standard-version/issues/483)) ([dc1fa61](https://github.com/conventional-changelog/standard-version/commit/dc1fa6170ffe12d4f8b44b70d23688a64d2ad0fb))\n* **deps:** update dependency yargs to v14.2.2 ([#488](https://github.com/conventional-changelog/standard-version/issues/488)) ([ecf26b6](https://github.com/conventional-changelog/standard-version/commit/ecf26b6fc9421a78fb81793c4a932f579f7e9d4a))\n\n### [7.0.1](https://github.com/conventional-changelog/standard-version/compare/v7.0.0...v7.0.1) (2019-11-07)\n\n\n### Bug Fixes\n\n* **deps:** update dependency conventional-changelog to v3.1.12 ([#463](https://github.com/conventional-changelog/standard-version/issues/463)) ([f04161a](https://github.com/conventional-changelog/standard-version/commit/f04161ae624705e68f9018d563e9f3c09ccf6f30))\n* **deps:** update dependency conventional-changelog-config-spec to v2.1.0 ([#442](https://github.com/conventional-changelog/standard-version/issues/442)) ([a2c5747](https://github.com/conventional-changelog/standard-version/commit/a2c574735ac5a165a190661b7735ea284bdc7dda))\n* **deps:** update dependency conventional-recommended-bump to v6.0.2 ([#462](https://github.com/conventional-changelog/standard-version/issues/462)) ([84bb581](https://github.com/conventional-changelog/standard-version/commit/84bb581209b50357761cbec45bb8253f6a182801))\n* **deps:** update dependency stringify-package to v1.0.1 ([#459](https://github.com/conventional-changelog/standard-version/issues/459)) ([e06a835](https://github.com/conventional-changelog/standard-version/commit/e06a835c8296a92f4fa7c07f98057d765c1a91e5))\n* **deps:** update dependency yargs to v14 ([#440](https://github.com/conventional-changelog/standard-version/issues/440)) ([fe37e73](https://github.com/conventional-changelog/standard-version/commit/fe37e7390760d8d16d1b94ca58d8123e292c46a8))\n* **deps:** update dependency yargs to v14.2.0 ([#461](https://github.com/conventional-changelog/standard-version/issues/461)) ([fb21851](https://github.com/conventional-changelog/standard-version/commit/fb2185107a90ba4b9dc7c9c1d873ed1283706ac1))\n\n## [7.0.0](https://github.com/conventional-changelog/standard-version/compare/v6.0.1...v7.0.0) (2019-07-30)\n\n\n### ⚠ BREAKING CHANGES\n\n* we were accepting .version.json as a config file, rather than .versionrc.json\n\n### Bug Fixes\n\n* **bump:** transmit tag prefix argument to conventionalRecommendedBump ([#393](https://github.com/conventional-changelog/standard-version/issues/393)) ([8205222](https://github.com/conventional-changelog/standard-version/commit/8205222))\n* **cli:** display only one, correct default for --preset flag ([#377](https://github.com/conventional-changelog/standard-version/issues/377)) ([d17fc81](https://github.com/conventional-changelog/standard-version/commit/d17fc81))\n* **commit:** don't try to process and add changelog if skipped ([#318](https://github.com/conventional-changelog/standard-version/issues/318)) ([3e4fdec](https://github.com/conventional-changelog/standard-version/commit/3e4fdec))\n* **deps:** update dependency conventional-changelog-config-spec to v2 ([#352](https://github.com/conventional-changelog/standard-version/issues/352)) ([f586844](https://github.com/conventional-changelog/standard-version/commit/f586844))\n* **deps:** update dependency conventional-recommended-bump to v6 ([#417](https://github.com/conventional-changelog/standard-version/issues/417)) ([4c5cad1](https://github.com/conventional-changelog/standard-version/commit/4c5cad1))\n* **deps:** update dependency find-up to v4 ([#355](https://github.com/conventional-changelog/standard-version/issues/355)) ([73b35f8](https://github.com/conventional-changelog/standard-version/commit/73b35f8))\n* **deps:** update dependency find-up to v4.1.0 ([#383](https://github.com/conventional-changelog/standard-version/issues/383)) ([b621a4a](https://github.com/conventional-changelog/standard-version/commit/b621a4a))\n* **deps:** update dependency git-semver-tags to v3 ([#418](https://github.com/conventional-changelog/standard-version/issues/418)) ([1ce3f4a](https://github.com/conventional-changelog/standard-version/commit/1ce3f4a))\n* **deps:** update dependency semver to v6.3.0 ([#366](https://github.com/conventional-changelog/standard-version/issues/366)) ([cd866c7](https://github.com/conventional-changelog/standard-version/commit/cd866c7))\n* **deps:** update dependency yargs to v13.3.0 ([#401](https://github.com/conventional-changelog/standard-version/issues/401)) ([3d0e8c7](https://github.com/conventional-changelog/standard-version/commit/3d0e8c7))\n* adds support for `releaseCommitMessageFormat` ([#351](https://github.com/conventional-changelog/standard-version/issues/351)) ([a7133cc](https://github.com/conventional-changelog/standard-version/commit/a7133cc))\n* stop suggesting npm publish if package.json was not updated ([#319](https://github.com/conventional-changelog/standard-version/issues/319)) ([a5ac845](https://github.com/conventional-changelog/standard-version/commit/a5ac845))\n* Updates package.json to _actual_ supported (tested) NodeJS versions. ([#379](https://github.com/conventional-changelog/standard-version/issues/379)) ([15eec8a](https://github.com/conventional-changelog/standard-version/commit/15eec8a))\n* **deps:** update dependency yargs to v13.2.4 ([#356](https://github.com/conventional-changelog/standard-version/issues/356)) ([00b2ce6](https://github.com/conventional-changelog/standard-version/commit/00b2ce6))\n* update config file name in command based on README.md ([#357](https://github.com/conventional-changelog/standard-version/issues/357)) ([ce44dd2](https://github.com/conventional-changelog/standard-version/commit/ce44dd2))\n\n### [6.0.1](https://github.com/conventional-changelog/standard-version/compare/v6.0.0...v6.0.1) (2019-05-05)\n\n\n### Bug Fixes\n\n* don't pass args to git rev-parse ([1ac72f7](https://github.com/conventional-changelog/standard-version/commit/1ac72f7))\n\n\n\n## [6.0.0](https://github.com/conventional-changelog/standard-version/compare/v5.0.2...v6.0.0) (2019-05-05)\n\n\n### Bug Fixes\n\n* always pass version to changelog context ([#327](https://github.com/conventional-changelog/standard-version/issues/327)) ([00e3381](https://github.com/conventional-changelog/standard-version/commit/00e3381))\n* **deps:** update dependency detect-indent to v6 ([#341](https://github.com/conventional-changelog/standard-version/issues/341)) ([234d9dd](https://github.com/conventional-changelog/standard-version/commit/234d9dd))\n* **deps:** update dependency detect-newline to v3 ([#342](https://github.com/conventional-changelog/standard-version/issues/342)) ([02a6093](https://github.com/conventional-changelog/standard-version/commit/02a6093))\n* **deps:** update dependency figures to v3 ([#343](https://github.com/conventional-changelog/standard-version/issues/343)) ([7208ded](https://github.com/conventional-changelog/standard-version/commit/7208ded))\n* **deps:** update dependency semver to v6 ([#344](https://github.com/conventional-changelog/standard-version/issues/344)) ([c40487a](https://github.com/conventional-changelog/standard-version/commit/c40487a))\n* **deps:** update dependency yargs to v13 ([#345](https://github.com/conventional-changelog/standard-version/issues/345)) ([b2c8e59](https://github.com/conventional-changelog/standard-version/commit/b2c8e59))\n* prevent duplicate headers from being added ([#305](https://github.com/conventional-changelog/standard-version/issues/305)) ([#307](https://github.com/conventional-changelog/standard-version/issues/307)) ([db2c6e5](https://github.com/conventional-changelog/standard-version/commit/db2c6e5))\n\n\n### Build System\n\n* add renovate.json ([#273](https://github.com/conventional-changelog/standard-version/issues/273)) ([bf41474](https://github.com/conventional-changelog/standard-version/commit/bf41474))\n* drop Node 6 from testing matrix ([#346](https://github.com/conventional-changelog/standard-version/issues/346)) ([6718428](https://github.com/conventional-changelog/standard-version/commit/6718428))\n\n\n### Features\n\n* adds configurable conventionalcommits preset ([#323](https://github.com/conventional-changelog/standard-version/issues/323)) ([4fcd4a7](https://github.com/conventional-changelog/standard-version/commit/4fcd4a7))\n* allow a user to provide a custom changelog header ([#335](https://github.com/conventional-changelog/standard-version/issues/335)) ([1c51064](https://github.com/conventional-changelog/standard-version/commit/1c51064))\n* bump minor rather than major, if release is < 1.0.0 ([#347](https://github.com/conventional-changelog/standard-version/issues/347)) ([5d972cf](https://github.com/conventional-changelog/standard-version/commit/5d972cf))\n* suggest branch name other than master ([#331](https://github.com/conventional-changelog/standard-version/issues/331)) ([304b49a](https://github.com/conventional-changelog/standard-version/commit/304b49a))\n* update commit msg for when using commitAll ([#320](https://github.com/conventional-changelog/standard-version/issues/320)) ([74a040a](https://github.com/conventional-changelog/standard-version/commit/74a040a))\n\n\n### Tests\n\n* disable gpg signing in temporary test repositories. ([#311](https://github.com/conventional-changelog/standard-version/issues/311)) ([bd0fcdf](https://github.com/conventional-changelog/standard-version/commit/bd0fcdf))\n* use const based on new eslint rules ([#329](https://github.com/conventional-changelog/standard-version/issues/329)) ([b6d3d13](https://github.com/conventional-changelog/standard-version/commit/b6d3d13))\n\n\n### BREAKING CHANGES\n\n* we now bump the minor rather than major if version < 1.0.0; --release-as can be used to bump to 1.0.0.\n* tests are no longer run for Node 6\n* we now use the conventionalcommits preset by default, which directly tracks conventionalcommits.org.\n\n\n\n## [5.0.2](https://github.com/conventional-changelog/standard-version/compare/v5.0.1...v5.0.2) (2019-03-16)\n\n\n\n## [5.0.1](https://github.com/conventional-changelog/standard-version/compare/v5.0.0...v5.0.1) (2019-02-28)\n\n\n### Bug Fixes\n\n* make pattern for finding CHANGELOG sections work for non anchors ([#292](https://github.com/conventional-changelog/standard-version/issues/292)) ([b684c78](https://github.com/conventional-changelog/standard-version/commit/b684c78))\n\n\n\n# [5.0.0](https://github.com/conventional-changelog/standard-version/compare/v4.4.0...v5.0.0) (2019-02-14)\n\n\n### Bug Fixes\n\n* bin now enforces Node.js > 4 ([#274](https://github.com/conventional-changelog/standard-version/issues/274)) ([e1b5780](https://github.com/conventional-changelog/standard-version/commit/e1b5780))\n* no --tag prerelease for private module ([#296](https://github.com/conventional-changelog/standard-version/issues/296)) ([27e2ab4](https://github.com/conventional-changelog/standard-version/commit/27e2ab4)), closes [#294](https://github.com/conventional-changelog/standard-version/issues/294)\n* show correct pre-release tag in help output ([#259](https://github.com/conventional-changelog/standard-version/issues/259)) ([d90154a](https://github.com/conventional-changelog/standard-version/commit/d90154a))\n\n\n### chore\n\n* update testing matrix ([1d46627](https://github.com/conventional-changelog/standard-version/commit/1d46627))\n\n\n### Features\n\n* adds support for bumping for composer versions ([#262](https://github.com/conventional-changelog/standard-version/issues/262)) ([fee872f](https://github.com/conventional-changelog/standard-version/commit/fee872f))\n* cli application accept path/preset option ([#279](https://github.com/conventional-changelog/standard-version/issues/279)) ([69c62cf](https://github.com/conventional-changelog/standard-version/commit/69c62cf))\n* fallback to tags if no meta-information file found ([#275](https://github.com/conventional-changelog/standard-version/issues/275)) ([844cde6](https://github.com/conventional-changelog/standard-version/commit/844cde6))\n* preserve formatting when writing to package.json ([#282](https://github.com/conventional-changelog/standard-version/issues/282)) ([96216da](https://github.com/conventional-changelog/standard-version/commit/96216da))\n\n\n### BREAKING CHANGES\n\n* if no package.json, bower.json, etc., is found, we now fallback to git tags\n* removed Node 4/5 from testing matrix\n\n\n\n<a name=\"4.4.0\"></a>\n# [4.4.0](https://github.com/conventional-changelog/standard-version/compare/v4.3.0...v4.4.0) (2018-05-21)\n\n\n### Bug Fixes\n\n* show full tag name in checkpoint ([#241](https://github.com/conventional-changelog/standard-version/issues/241)) ([b4ed4f9](https://github.com/conventional-changelog/standard-version/commit/b4ed4f9))\n* use tagPrefix in CHANGELOG lifecycle step ([#243](https://github.com/conventional-changelog/standard-version/issues/243)) ([a56c7ac](https://github.com/conventional-changelog/standard-version/commit/a56c7ac))\n\n\n### Features\n\n* add prerelease lifecycle script hook (closes [#217](https://github.com/conventional-changelog/standard-version/issues/217)) ([#234](https://github.com/conventional-changelog/standard-version/issues/234)) ([ba4e7f6](https://github.com/conventional-changelog/standard-version/commit/ba4e7f6))\n* manifest.json support ([#236](https://github.com/conventional-changelog/standard-version/issues/236)) ([371d992](https://github.com/conventional-changelog/standard-version/commit/371d992))\n\n\n\n<a name=\"4.3.0\"></a>\n# [4.3.0](https://github.com/conventional-changelog/standard-version/compare/v4.2.0...v4.3.0) (2018-01-03)\n\n\n### Bug Fixes\n\n* recommend `--tag` prerelease for npm publish of prereleases ([#196](https://github.com/conventional-changelog/standard-version/issues/196)) ([709dae1](https://github.com/conventional-changelog/standard-version/commit/709dae1)), closes [#183](https://github.com/conventional-changelog/standard-version/issues/183)\n* use the `skip` default value for skip cli arg ([#211](https://github.com/conventional-changelog/standard-version/issues/211)) ([3fdd7fa](https://github.com/conventional-changelog/standard-version/commit/3fdd7fa))\n\n\n### Features\n\n* **format-commit-message:** support multiple %s in the message ([45fcad5](https://github.com/conventional-changelog/standard-version/commit/45fcad5))\n* do not update/commit files in .gitignore ([#230](https://github.com/conventional-changelog/standard-version/issues/230)) ([4fd3bc2](https://github.com/conventional-changelog/standard-version/commit/4fd3bc2))\n* publish only if commit+push succeed ([#229](https://github.com/conventional-changelog/standard-version/issues/229)) ([c5e1ee2](https://github.com/conventional-changelog/standard-version/commit/c5e1ee2))\n\n\n\n<a name=\"4.2.0\"></a>\n# [4.2.0](https://github.com/conventional-changelog/standard-version/compare/v4.1.0...v4.2.0) (2017-06-12)\n\n\n### Features\n\n* add support for `package-lock.json` ([#190](https://github.com/conventional-changelog/standard-version/issues/190)) ([bc0fc53](https://github.com/conventional-changelog/standard-version/commit/bc0fc53))\n\n\n\n<a name=\"4.1.0\"></a>\n# [4.1.0](https://github.com/conventional-changelog/standard-version/compare/v4.0.0...v4.1.0) (2017-06-06)\n\n\n### Features\n\n* **cli:** print error and don't run with node <4, closes [#124](https://github.com/conventional-changelog/standard-version/issues/124) ([d0d71a5](https://github.com/conventional-changelog/standard-version/commit/d0d71a5))\n* add dry-run mode ([#187](https://github.com/conventional-changelog/standard-version/issues/187)) ([d073353](https://github.com/conventional-changelog/standard-version/commit/d073353))\n* add prebump, postbump, precommit, lifecycle scripts ([#186](https://github.com/conventional-changelog/standard-version/issues/186)) ([dfd1d12](https://github.com/conventional-changelog/standard-version/commit/dfd1d12))\n* add support for `npm-shrinkwrap.json` ([#185](https://github.com/conventional-changelog/standard-version/issues/185)) ([86af7fc](https://github.com/conventional-changelog/standard-version/commit/86af7fc))\n* add support for skipping lifecycle steps, polish lifecycle work ([#188](https://github.com/conventional-changelog/standard-version/issues/188)) ([d31dcdb](https://github.com/conventional-changelog/standard-version/commit/d31dcdb))\n* allow a version # to be provided for release-as, rather than just major, minor, patch. ([13eb9cd](https://github.com/conventional-changelog/standard-version/commit/13eb9cd))\n\n\n\n<a name=\"4.0.0\"></a>\n# [4.0.0](https://github.com/conventional-changelog/standard-version/compare/v4.0.0-1...v4.0.0) (2016-12-02)\n\n\n### Bug Fixes\n\n* include merge commits in the changelog ([#139](https://github.com/conventional-changelog/standard-version/issues/139)) ([b6e1562](https://github.com/conventional-changelog/standard-version/commit/b6e1562))\n* should print message before we bump version ([2894bbc](https://github.com/conventional-changelog/standard-version/commit/2894bbc))\n* support a wording change made to git status in git v2.9.1 ([#140](https://github.com/conventional-changelog/standard-version/issues/140)) ([80004ec](https://github.com/conventional-changelog/standard-version/commit/80004ec))\n\n\n### Features\n\n* add support for bumping version # in bower.json ([#148](https://github.com/conventional-changelog/standard-version/issues/148)) ([b788c5f](https://github.com/conventional-changelog/standard-version/commit/b788c5f))\n* make tag prefix configurable ([#143](https://github.com/conventional-changelog/standard-version/issues/143)) ([70b20c8](https://github.com/conventional-changelog/standard-version/commit/70b20c8))\n* support releasing a custom version, including pre-releases ([#129](https://github.com/conventional-changelog/standard-version/issues/129)) ([068008d](https://github.com/conventional-changelog/standard-version/commit/068008d))\n\n\n### BREAKING CHANGES\n\n* merge commits are now included in the CHANGELOG.\n\n\n<a name=\"3.0.0\"></a>\n# [3.0.0](https://github.com/conventional-changelog/standard-version/compare/v2.3.0...v3.0.0) (2016-10-06)\n\n\n### Bug Fixes\n\n* check the private field in package.json([#102](https://github.com/conventional-changelog/standard-version/issues/102)) ([#103](https://github.com/conventional-changelog/standard-version/issues/103)) ([2ce4160](https://github.com/conventional-changelog/standard-version/commit/2ce4160))\n* **err:** don't fail on stderr output, but print the output to stderr ([#110](https://github.com/conventional-changelog/standard-version/issues/110)) ([f7a4915](https://github.com/conventional-changelog/standard-version/commit/f7a4915)), closes [#91](https://github.com/conventional-changelog/standard-version/issues/91)\n\n\n### Chores\n\n* package.json engines field >=4.0, drop Node 0.10 and 0.12 ([28ff65a](https://github.com/conventional-changelog/standard-version/commit/28ff65a))\n\n\n### Features\n\n* **options:** add --silent flag and option for squelching output ([2a3fa61](https://github.com/conventional-changelog/standard-version/commit/2a3fa61))\n* added support for commitAll option in CLI ([#121](https://github.com/conventional-changelog/standard-version/issues/121)) ([a903f4d](https://github.com/conventional-changelog/standard-version/commit/a903f4d))\n* separate cli and defaults from base functionality ([34a6a4e](https://github.com/conventional-changelog/standard-version/commit/34a6a4e))\n\n\n### BREAKING CHANGES\n\n* drop support for Node < 4.0 to enable usage of\nnew tools and packages.\n\n\n\n<a name=\"2.4.0\"></a>\n# [2.4.0](https://github.com/conventional-changelog/standard-version/compare/v2.3.1...v2.4.0) (2016-07-13)\n\n\n### Bug Fixes\n\n* **index.js:** use blue figures.info for last checkpoint ([#64](https://github.com/conventional-changelog/standard-version/issues/64)) ([e600b42](https://github.com/conventional-changelog/standard-version/commit/e600b42))\n\n\n### Features\n\n* **changelogStream:** use more default opts ([#67](https://github.com/conventional-changelog/standard-version/issues/67)) ([3e0aa84](https://github.com/conventional-changelog/standard-version/commit/3e0aa84))\n\n\n\n<a name=\"2.3.1\"></a>\n## [2.3.1](https://github.com/conventional-changelog/standard-version/compare/v2.3.0...v2.3.1) (2016-06-15)\n\n\n### Bug Fixes\n\n* **commit:** fix windows by separating add and commit exec ([#55](https://github.com/conventional-changelog/standard-version/issues/55)) ([f361c46](https://github.com/conventional-changelog/standard-version/commit/f361c46)), closes [#55](https://github.com/conventional-changelog/standard-version/issues/55) [#49](https://github.com/conventional-changelog/standard-version/issues/49)\n\n\n\n<a name=\"2.3.0\"></a>\n# [2.3.0](https://github.com/conventional-changelog/standard-version/compare/v2.2.1...v2.3.0) (2016-06-02)\n\n\n### Bug Fixes\n\n* append line feed to end of package.json ([#42](https://github.com/conventional-changelog/standard-version/issues/42))([178e001](https://github.com/conventional-changelog/standard-version/commit/178e001))\n\n\n### Features\n\n* **index.js:** add checkpoint for publish script after tag successfully ([#47](https://github.com/conventional-changelog/standard-version/issues/47))([e414ed7](https://github.com/conventional-changelog/standard-version/commit/e414ed7))\n* add a --no-verify option to prevent git hooks from being verified ([#44](https://github.com/conventional-changelog/standard-version/issues/44))([026d844](https://github.com/conventional-changelog/standard-version/commit/026d844))\n\n\n\n<a name=\"2.2.1\"></a>\n## [2.2.1](https://github.com/conventional-changelog/standard-version/compare/v2.2.0...v2.2.1) (2016-05-02)\n\n\n### Bug Fixes\n\n* upgrade to version of nyc that works with new shelljs([c7ac6e2](https://github.com/conventional-changelog/standard-version/commit/c7ac6e2))\n\n\n\n<a name=\"2.2.0\"></a>\n# [2.2.0](https://github.com/conventional-changelog/standard-version/compare/v2.1.2...v2.2.0) (2016-05-01)\n\n\n### Bug Fixes\n\n* format the annotated tag message ([#28](https://github.com/conventional-changelog/standard-version/issues/28))([8f02736](https://github.com/conventional-changelog/standard-version/commit/8f02736))\n* upgraded dependencies, switched back to angular format (fixes [#27](https://github.com/conventional-changelog/standard-version/issues/27)), pinned shelljs to version that works with nyc ([#30](https://github.com/conventional-changelog/standard-version/issues/30))([3f51e94](https://github.com/conventional-changelog/standard-version/commit/3f51e94))\n\n\n### Features\n\n* add --sign flag to sign git commit and tag ([#29](https://github.com/conventional-changelog/standard-version/issues/29))([de758bc](https://github.com/conventional-changelog/standard-version/commit/de758bc))\n\n\n\n<a name=\"2.1.2\"></a>\n## [2.1.2](https://github.com/conventional-changelog/standard-version/compare/v2.1.1...v2.1.2) (2016-04-11)\n\n\n### Bug Fixes\n\n* we had too many \\n characters ([#17](https://github.com/conventional-changelog/standard-version/issues/17)) ([67a01cd](https://github.com/conventional-changelog/standard-version/commit/67a01cd))\n\n\n\n<a name=\"2.1.1\"></a>\n## [2.1.1](https://github.com/conventional-changelog/standard-version/compare/v2.1.0...v2.1.1) (2016-04-10)\n\n\n### Bug Fixes\n\n* **docs:** had a bad URL in package.json, which was breaking all of our links ([caa6359](https://github.com/conventional-changelog/standard-version/commit/caa6359))\n\n\n\n<a name=\"2.1.0\"></a>\n# [2.1.0](https://github.com/conventional-changelog/standard-version/compare/v2.0.0...v2.1.0) (2016-04-10)\n\n\n### Features\n\n* adds support for GitHub links (see [#13](https://github.com/conventional-changelog/standard-version/issues/13)), great idea [@bcoe](https://github.com/bcoe)! ([7bf6597](https://github.com/conventional-changelog/standard-version/commit/7bf6597))\n\n\n\n<a name=\"2.0.0\"></a>\n# [2.0.0](https://github.com/conventional-changelog/standard-version/compare/v1.1.0...v2.0.0) (2016-04-09)\n\n\n* feat(conventional-changelog-standard): Move to conventional-changelog-standard style. This style lifts the character limit on commit messages, and puts us in a position to make more opinionated decisions in the future. ([c7ccadb](https://github.com/conventional-changelog/standard-version/commit/c7ccadb))\n\n\n### BREAKING CHANGES\n\n* we no longer accept the preset configuration option.\n\n\n<a name=\"1.1.0\"></a>\n# [1.1.0](https://github.com/conventional-changelog/standard-version/compare/v1.0.0...v1.1.0) (2016-04-08)\n\n\n### Features\n\n* **cli:** use conventional default commit message with version ([9fadc5f](https://github.com/conventional-changelog/standard-version/commit/9fadc5f))\n* **rebrand:** rebrand recommended-workflow to standard-version (#9) ([1f673c0](https://github.com/conventional-changelog/standard-version/commit/1f673c0))\n* **tests:** adds test suite, fixed several Node 0.10 issues along the way ([03bd86c](https://github.com/conventional-changelog/standard-version/commit/03bd86c))\n\n\n\n<a name=\"1.0.0\"></a>\n# 1.0.0 (2016-04-04)\n\n\n### Features\n\n* **initial-release:** adds flag for generating CHANGELOG.md on the first release. ([b812b44](https://github.com/bcoe/conventional-recommended-workflow/commit/b812b44))\n"
  },
  {
    "path": "LICENSE.txt",
    "content": "ISC License\n\nCopyright (c) 2016, Contributors\n\nPermission to use, copy, modify, and/or distribute this software\nfor any purpose with or without fee is hereby granted, provided\nthat the above copyright notice and this permission notice\nappear in all copies.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\nWITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES\nOF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE\nLIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES\nOR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,\nWHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,\nARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n"
  },
  {
    "path": "README.md",
    "content": "# Standard Version\n\n> **`standard-version` is deprecated**. If you're a GitHub user, I recommend [release-please](https://github.com/googleapis/release-please) as an alternative. If you're unable to use GitHub Actions, or if you need to stick with `standard-version` for some other reason, you can use the [commit-and-tag-version]( https://github.com/absolute-version/commit-and-tag-version) fork of `standard-version`.\n\nA utility for versioning using [semver](https://semver.org/) and CHANGELOG generation powered by [Conventional Commits](https://conventionalcommits.org).\n\n![ci](https://github.com/conventional-changelog/standard-version/workflows/ci/badge.svg)\n[![NPM version](https://img.shields.io/npm/v/standard-version.svg)](https://www.npmjs.com/package/standard-version)\n[![codecov](https://codecov.io/gh/conventional-changelog/standard-version/branch/master/graph/badge.svg?token=J7zMN7vTTd)](https://codecov.io/gh/conventional-changelog/standard-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\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 `standard-version`.\n\n`standard-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.\n4. Generates a `changelog` based on your commits (uses [conventional-changelog](https://github.com/conventional-changelog/conventional-changelog) under the hood).\n5. Creates a new `commit` including your `bumpFiles`[[1]](#bumpfiles-packagefiles-and-updaters) and updated CHANGELOG.\n6. Creates a new `tag` with the new version number.\n\n\n### `bumpFiles`, `packageFiles` and `updaters`\n\n`standard-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, `standard-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 standard-version for additional metadata files, languages or version files?](#can-i-use-standard-version-for-additional-metadata-files-languages-or-version-files) – these configuration options will help!\n\n## Installing `standard-version`\n\n### As a local `npm run` script\n\nInstall and add to `devDependencies`:\n\n```\nnpm i --save-dev standard-version\n```\n\nAdd an [`npm run` script](https://docs.npmjs.com/cli/run-script) to your `package.json`:\n\n```json\n{\n  \"scripts\": {\n    \"release\": \"standard-version\"\n  }\n}\n```\n\nNow you can use `npm run release` in place of `npm version`.\n\nThis has the benefit of making your repo/package more portable, so that other developers can cut releases without having to globally install `standard-version` on their machine.\n\n### As global `bin`\n\nInstall globally (add to your `PATH`):\n\n```\nnpm i -g standard-version\n```\n\nNow you can use `standard-version` in place of `npm version`.\n\nThis has the benefit of allowing you to use `standard-version` on any repo/package without adding a dev dependency to each one.\n\n### Using `npx`\n\nAs of `npm@5.2.0`, `npx` is installed alongside `npm`. Using `npx` you can use `standard-version` without having to keep a `package.json` file by running: `npx standard-version`.\n\nThis method is especially useful when using `standard-version` in non-JavaScript projects.\n\n## Configuration\n\nYou can configure `standard-version` either by:\n\n1. Placing a `standard-version` stanza in your `package.json` (assuming\n   your project is JavaScript).\n2. Creating a `.versionrc`, `.versionrc.json` or `.versionrc.js`.\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 `standard-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\n### Customizing CHANGELOG Generation\n\nBy default (as of `6.0.0`), `standard-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\nstandard-version --first-release\n# npx\nnpx standard-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\nstandard-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.0.0`, and your code to be committed has patched changes. Run:\n\n```bash\n# npm run script\nnpm run release -- --prerelease\n```\nThis will tag your version as: `1.0.1-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.0.1-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`, 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\n```\n\nYou will get version `1.1.0` rather than what would be the auto-generated version `1.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\nstandard-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 `standard-version` command.\n\n### Lifecycle Scripts\n\n`standard-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 `standard-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  \"standard-version\": {\n    \"scripts\": {\n      \"prebump\": \"echo 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```json\n{\n  \"standard-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  \"standard-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  \"standard-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\": \"standard-version -a\"\n  }\n}\n```\n\n### Dry Run Mode\n\nrunning `standard-version` with the flag `--dry-run` allows you to see what\ncommands would be run, without committing to git or updating files.\n\n```sh\n# npm run script\nnpm run release -- --dry-run\n# or global bin\nstandard-version --dry-run\n```\n\n### Prefix Tags\n\nTags 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.\n\n```sh\nstandard-version -t @scope/package\\@\n```\n\nThis will prefix your tags to look something like `@scope/package@2.0.0`\n\nIf you do not want to have any tag prefix you can use the `-t` flag and provide it with an **empty string** as value.\n\n> Note: simply -t or --tag-prefix without any value will fallback to the default 'v'\n\n### CLI Help\n\n```sh\n# npm run script\nnpm run release -- --help\n# or global bin\nstandard-version --help\n```\n\n## Code Usage\n\n```js\nconst standardVersion = require('standard-version')\n\n// Options are the same as command line, except camelCase\n// standardVersion returns a Promise\nstandardVersion({\n  noVerify: true,\n  infile: 'docs/CHANGELOG.md',\n  silent: true\n}).then(() => {\n  // standard-version is done\n}).catch(err => {\n    console.error(`standard-version failed with message: ${err.message}`)\n})\n```\n\n_TIP: Use the `silent` option to prevent `standard-version` from printing to the `console`._\n\n## FAQ\n\n### How is `standard-version` different from `semantic-release`?\n\n[`semantic-release`](https://github.com/semantic-release/semantic-release) is described as:\n\n> semantic-release automates the whole package release workflow including: determining the next version number, generating the release notes and publishing the package.\n\nWhile both are based on the same foundation of structured commit messages, `standard-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 `standard-version` only affects your local git repo - it doesn't affect remote resources at all. After you run `standard-version`, you can review your release state, correct mistakes and follow the release strategy that makes the most sense for your codebase.\n\nWe think they are both fantastic tools, and we encourage folks to use `semantic-release` instead of `standard-version` if it makes sense for their use-case.\n\n### Should I always squash commits when merging PRs?\n\nThe instructions to squash commits when merging pull requests assumes that **one PR equals, at most, one feature or fix**.\n\nIf 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.\n\nAlthough 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.\n\nFor 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.\n\n### Can I use `standard-version` for additional metadata files, languages or version files?\n\nAs of version `7.1.0` you can configure multiple `bumpFiles` and `packageFiles`.\n\n1. Specify a custom `bumpFile` \"`filename`\", this is the path to the file you want to \"bump\"\n2. Specify the `bumpFile` \"`updater`\", this is _how_ the file will be bumped.\n    a. If you're using a common type, you can use one of  `standard-version`'s built-in `updaters` by specifying a `type`.\n    b. If your using an less-common version file, you can create your own `updater`.\n\n```js\n// .versionrc\n{\n  \"bumpFiles\": [\n    {\n      \"filename\": \"MY_VERSION_TRACKER.txt\",\n      // The `plain-text` updater assumes the file contents represents the version.\n      \"type\": \"plain-text\"\n    },\n    {\n      \"filename\": \"a/deep/package/dot/json/file/package.json\",\n      // The `json` updater assumes the version is available under a `version` key in the provided JSON document.\n      \"type\": \"json\"\n    },\n    {\n      \"filename\": \"VERSION_TRACKER.json\",\n      //  See \"Custom `updater`s\" for more details.\n      \"updater\": \"standard-version-updater.js\"\n    }\n  ]\n}\n```\n\nIf using `.versionrc.js` as your configuration file, the `updater` may also be set as an object, rather than a path:\n\n```js\n// .versionrc.js\nconst tracker = {\n  filename: 'VERSION_TRACKER.json',\n  updater: require('./path/to/custom-version-updater')\n}\n\nmodule.exports = {\n  bumpFiles: [tracker],\n  packageFiles: [tracker]\n}\n```\n\n#### Custom `updater`s\n\nAn `updater` is expected to be a Javascript module with _atleast_ two methods exposed: `readVersion` and `writeVersion`.\n\n##### `readVersion(contents = string): string`\n\nThis method is used to read the version from the provided file contents.\n\nThe return value is expected to be a semantic version string.\n\n##### `writeVersion(contents = string, version: string): string`\n\nThis method is used to write the version to the provided contents.\n\nThe return value will be written directly (overwrite) to the provided file.\n\n---\n\nLet's assume our `VERSION_TRACKER.json` has the following contents:\n\n```json\n{\n  \"tracker\": {\n    \"package\": {\n      \"version\": \"1.0.0\"\n    }\n  }\n}\n\n```\n\nAn acceptable `standard-version-updater.js` would be:\n\n```js\n// standard-version-updater.js\nconst stringifyPackage = require('stringify-package')\nconst detectIndent = require('detect-indent')\nconst detectNewline = require('detect-newline')\n\nmodule.exports.readVersion = function (contents) {\n  return JSON.parse(contents).tracker.package.version;\n}\n\nmodule.exports.writeVersion = function (contents, version) {\n  const json = JSON.parse(contents)\n  let indent = detectIndent(contents).indent\n  let newline = detectNewline(contents)\n  json.tracker.package.version = version\n  return stringifyPackage(json, indent, newline)\n}\n```\n\n## License\n\nISC\n"
  },
  {
    "path": "bin/cli.js",
    "content": "#!/usr/bin/env node\n\n/* istanbul ignore if */\nif (process.version.match(/v(\\d+)\\./)[1] < 6) {\n  console.error('standard-version: Node v6 or greater is required. `standard-version` did not run.')\n} else {\n  const standardVersion = require('../index')\n  const cmdParser = require('../command')\n  standardVersion(cmdParser.argv)\n    .catch(() => {\n      process.exit(1)\n    })\n}\n"
  },
  {
    "path": "command.js",
    "content": "const spec = require('conventional-changelog-config-spec')\nconst { getConfiguration } = require('./lib/configuration')\nconst defaults = require('./defaults')\n\nconst yargs = require('yargs')\n  .usage('Usage: $0 [options]')\n  .option('packageFiles', {\n    default: defaults.packageFiles,\n    array: true\n  })\n  .option('bumpFiles', {\n    default: defaults.bumpFiles,\n    array: true\n  })\n  .option('release-as', {\n    alias: 'r',\n    describe: 'Specify the release type manually (like npm version <major|minor|patch>)',\n    requiresArg: true,\n    string: true\n  })\n  .option('prerelease', {\n    alias: 'p',\n    describe: 'make a pre-release with optional option value to specify a tag id',\n    string: true\n  })\n  .option('infile', {\n    alias: 'i',\n    describe: 'Read the CHANGELOG from this file',\n    default: defaults.infile\n  })\n  .option('message', {\n    alias: ['m'],\n    describe: '[DEPRECATED] Commit message, replaces %s with new version.\\nThis option will be removed in the next major version, please use --releaseCommitMessageFormat.',\n    type: 'string'\n  })\n  .option('first-release', {\n    alias: 'f',\n    describe: 'Is this the first release?',\n    type: 'boolean',\n    default: defaults.firstRelease\n  })\n  .option('sign', {\n    alias: 's',\n    describe: 'Should the git commit and tag be signed?',\n    type: 'boolean',\n    default: defaults.sign\n  })\n  .option('no-verify', {\n    alias: 'n',\n    describe: 'Bypass pre-commit or commit-msg git hooks during the commit phase',\n    type: 'boolean',\n    default: defaults.noVerify\n  })\n  .option('commit-all', {\n    alias: 'a',\n    describe: 'Commit all staged changes, not just files affected by standard-version',\n    type: 'boolean',\n    default: defaults.commitAll\n  })\n  .option('silent', {\n    describe: 'Don\\'t print logs and errors',\n    type: 'boolean',\n    default: defaults.silent\n  })\n  .option('tag-prefix', {\n    alias: 't',\n    describe: 'Set a custom prefix for the git tag to be created',\n    type: 'string',\n    default: defaults.tagPrefix\n  })\n  .option('scripts', {\n    describe: 'Provide scripts to execute for lifecycle events (prebump, precommit, etc.,)',\n    default: defaults.scripts\n  })\n  .option('skip', {\n    describe: 'Map of steps in the release process that should be skipped',\n    default: defaults.skip\n  })\n  .option('dry-run', {\n    type: 'boolean',\n    default: defaults.dryRun,\n    describe: 'See the commands that running standard-version would run'\n  })\n  .option('git-tag-fallback', {\n    type: 'boolean',\n    default: defaults.gitTagFallback,\n    describe: 'fallback to git tags for version, if no meta-information file is found (e.g., package.json)'\n  })\n  .option('path', {\n    type: 'string',\n    describe: 'Only populate commits made under this path'\n  })\n  .option('changelogHeader', {\n    type: 'string',\n    describe: '[DEPRECATED] Use a custom header when generating and updating changelog.\\nThis option will be removed in the next major version, please use --header.'\n  })\n  .option('preset', {\n    type: 'string',\n    default: defaults.preset,\n    describe: 'Commit message guideline preset'\n  })\n  .option('lerna-package', {\n    type: 'string',\n    describe: 'Name of the package from which the tags will be extracted'\n  })\n  .check((argv) => {\n    if (typeof argv.scripts !== 'object' || Array.isArray(argv.scripts)) {\n      throw Error('scripts must be an object')\n    } else if (typeof argv.skip !== 'object' || Array.isArray(argv.skip)) {\n      throw Error('skip must be an object')\n    } else {\n      return true\n    }\n  })\n  .alias('version', 'v')\n  .alias('help', 'h')\n  .example('$0', 'Update changelog and tag release')\n  .example('$0 -m \"%s: see changelog for details\"', 'Update changelog and tag release with custom commit message')\n  .pkgConf('standard-version')\n  .config(getConfiguration())\n  .wrap(97)\n\nObject.keys(spec.properties).forEach(propertyKey => {\n  const property = spec.properties[propertyKey]\n  yargs.option(propertyKey, {\n    type: property.type,\n    describe: property.description,\n    default: defaults[propertyKey] ? defaults[propertyKey] : property.default,\n    group: 'Preset Configuration:'\n  })\n})\n\nmodule.exports = yargs\n"
  },
  {
    "path": "defaults.js",
    "content": "const spec = require('conventional-changelog-config-spec')\n\nconst defaults = {\n  infile: 'CHANGELOG.md',\n  firstRelease: false,\n  sign: false,\n  noVerify: false,\n  commitAll: false,\n  silent: false,\n  tagPrefix: 'v',\n  scripts: {},\n  skip: {},\n  dryRun: false,\n  gitTagFallback: true,\n  preset: require.resolve('conventional-changelog-conventionalcommits')\n}\n\n/**\n * Merge in defaults provided by the spec\n */\nObject.keys(spec.properties).forEach(propertyKey => {\n  const property = spec.properties[propertyKey]\n  defaults[propertyKey] = property.default\n})\n\n/**\n * Sets the default for `header` (provided by the spec) for backwards\n * compatibility. This should be removed in the next major version.\n */\ndefaults.header = '# Changelog\\n\\nAll notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.\\n'\n\ndefaults.packageFiles = [\n  'package.json',\n  'bower.json',\n  'manifest.json'\n]\n\ndefaults.bumpFiles = defaults.packageFiles.concat([\n  'package-lock.json',\n  'npm-shrinkwrap.json'\n])\n\nmodule.exports = defaults\n"
  },
  {
    "path": "index.js",
    "content": "const bump = require('./lib/lifecycles/bump')\nconst changelog = require('./lib/lifecycles/changelog')\nconst commit = require('./lib/lifecycles/commit')\nconst fs = require('fs')\nconst latestSemverTag = require('./lib/latest-semver-tag')\nconst path = require('path')\nconst printError = require('./lib/print-error')\nconst tag = require('./lib/lifecycles/tag')\nconst { resolveUpdaterObjectFromArgument } = require('./lib/updaters')\n\nmodule.exports = async function standardVersion (argv) {\n  const defaults = require('./defaults')\n  /**\n   * `--message` (`-m`) support will be removed in the next major version.\n   */\n  const message = argv.m || argv.message\n  if (message) {\n    /**\n     * The `--message` flag uses `%s` for version substitutions, we swap this\n     * for the substitution defined in the config-spec for future-proofing upstream\n     * handling.\n     */\n    argv.releaseCommitMessageFormat = message.replace(/%s/g, '{{currentTag}}')\n    if (!argv.silent) {\n      console.warn('[standard-version]: --message (-m) will be removed in the next major release. Use --releaseCommitMessageFormat.')\n    }\n  }\n\n  if (argv.changelogHeader) {\n    argv.header = argv.changelogHeader\n    if (!argv.silent) {\n      console.warn('[standard-version]: --changelogHeader will be removed in the next major release. Use --header.')\n    }\n  }\n\n  if (argv.header && argv.header.search(changelog.START_OF_LAST_RELEASE_PATTERN) !== -1) {\n    throw Error(`custom changelog header must not match ${changelog.START_OF_LAST_RELEASE_PATTERN}`)\n  }\n\n  /**\n   * If an argument for `packageFiles` provided, we include it as a \"default\" `bumpFile`.\n   */\n  if (argv.packageFiles) {\n    defaults.bumpFiles = defaults.bumpFiles.concat(argv.packageFiles)\n  }\n\n  const args = Object.assign({}, defaults, argv)\n  let pkg\n  for (const packageFile of args.packageFiles) {\n    const updater = resolveUpdaterObjectFromArgument(packageFile)\n    if (!updater) return\n    const pkgPath = path.resolve(process.cwd(), updater.filename)\n    try {\n      const contents = fs.readFileSync(pkgPath, 'utf8')\n      pkg = {\n        version: updater.updater.readVersion(contents),\n        private: typeof updater.updater.isPrivate === 'function' ? updater.updater.isPrivate(contents) : false\n      }\n      break\n    } catch (err) {}\n  }\n  try {\n    let version\n    if (pkg) {\n      version = pkg.version\n    } else if (args.gitTagFallback) {\n      version = await latestSemverTag(args.tagPrefix)\n    } else {\n      throw new Error('no package file found')\n    }\n\n    const newVersion = await bump(args, version)\n    await changelog(args, newVersion)\n    await commit(args, newVersion)\n    await tag(newVersion, pkg ? pkg.private : false, args)\n  } catch (err) {\n    printError(args, err.message)\n    throw err\n  }\n}\n"
  },
  {
    "path": "lib/checkpoint.js",
    "content": "const chalk = require('chalk')\nconst figures = require('figures')\nconst util = require('util')\n\nmodule.exports = function (argv, msg, args, figure) {\n  const defaultFigure = args.dryRun ? chalk.yellow(figures.tick) : chalk.green(figures.tick)\n  if (!argv.silent) {\n    console.info((figure || defaultFigure) + ' ' + util.format.apply(util, [msg].concat(args.map(function (arg) {\n      return chalk.bold(arg)\n    }))))\n  }\n}\n"
  },
  {
    "path": "lib/configuration.js",
    "content": "const path = require('path')\nconst findUp = require('find-up')\nconst { readFileSync } = require('fs')\n\nconst CONFIGURATION_FILES = [\n  '.versionrc',\n  '.versionrc.cjs',\n  '.versionrc.json',\n  '.versionrc.js'\n]\n\nmodule.exports.getConfiguration = function () {\n  let config = {}\n  const configPath = findUp.sync(CONFIGURATION_FILES)\n  if (!configPath) {\n    return config\n  }\n  const ext = path.extname(configPath)\n  if (ext === '.js' || ext === '.cjs') {\n    const jsConfiguration = require(configPath)\n    if (typeof jsConfiguration === 'function') {\n      config = jsConfiguration()\n    } else {\n      config = jsConfiguration\n    }\n  } else {\n    config = JSON.parse(readFileSync(configPath))\n  }\n\n  /**\n   * @todo we could eventually have deeper validation of the configuration (using `ajv`) and\n   * provide a more helpful error.\n   */\n  if (typeof config !== 'object') {\n    throw Error(\n      `[standard-version] Invalid configuration in ${configPath} provided. Expected an object but found ${typeof config}.`\n    )\n  }\n\n  return config\n}\n"
  },
  {
    "path": "lib/format-commit-message.js",
    "content": "module.exports = function (rawMsg, newVersion) {\n  const message = String(rawMsg)\n  return message.replace(/{{currentTag}}/g, newVersion)\n}\n"
  },
  {
    "path": "lib/latest-semver-tag.js",
    "content": "const gitSemverTags = require('git-semver-tags')\nconst semver = require('semver')\n\nmodule.exports = function (tagPrefix = undefined) {\n  return new Promise((resolve, reject) => {\n    gitSemverTags({ tagPrefix }, function (err, tags) {\n      if (err) return reject(err)\n      else if (!tags.length) return resolve('1.0.0')\n      // Respect tagPrefix\n      tags = tags.map(tag => tag.replace(new RegExp('^' + tagPrefix), ''))\n      // ensure that the largest semver tag is at the head.\n      tags = tags.map(tag => { return semver.clean(tag) })\n      tags.sort(semver.rcompare)\n      return resolve(tags[0])\n    })\n  })\n}\n"
  },
  {
    "path": "lib/lifecycles/bump.js",
    "content": "'use strict'\n\nconst chalk = require('chalk')\nconst checkpoint = require('../checkpoint')\nconst conventionalRecommendedBump = require('conventional-recommended-bump')\nconst figures = require('figures')\nconst fs = require('fs')\nconst DotGitignore = require('dotgitignore')\nconst path = require('path')\nconst presetLoader = require('../preset-loader')\nconst runLifecycleScript = require('../run-lifecycle-script')\nconst semver = require('semver')\nconst writeFile = require('../write-file')\nconst { resolveUpdaterObjectFromArgument } = require('../updaters')\nlet configsToUpdate = {}\n\nasync function Bump (args, version) {\n  // reset the cache of updated config files each\n  // time we perform the version bump step.\n  configsToUpdate = {}\n\n  if (args.skip.bump) return version\n  let newVersion = version\n  await runLifecycleScript(args, 'prerelease')\n  const stdout = await runLifecycleScript(args, 'prebump')\n  if (stdout && stdout.trim().length) args.releaseAs = stdout.trim()\n  const release = await bumpVersion(args.releaseAs, version, args)\n  if (!args.firstRelease) {\n    const releaseType = getReleaseType(args.prerelease, release.releaseType, version)\n    newVersion = semver.valid(releaseType) || semver.inc(version, releaseType, args.prerelease)\n    updateConfigs(args, newVersion)\n  } else {\n    checkpoint(args, 'skip version bump on first release', [], chalk.red(figures.cross))\n  }\n  await runLifecycleScript(args, 'postbump')\n  return newVersion\n}\n\nBump.getUpdatedConfigs = function () {\n  return configsToUpdate\n}\n\nfunction getReleaseType (prerelease, expectedReleaseType, currentVersion) {\n  if (isString(prerelease)) {\n    if (isInPrerelease(currentVersion)) {\n      if (shouldContinuePrerelease(currentVersion, expectedReleaseType) ||\n        getTypePriority(getCurrentActiveType(currentVersion)) > getTypePriority(expectedReleaseType)\n      ) {\n        return 'prerelease'\n      }\n    }\n\n    return 'pre' + expectedReleaseType\n  } else {\n    return expectedReleaseType\n  }\n}\n\nfunction isString (val) {\n  return typeof val === 'string'\n}\n\n/**\n * if a version is currently in pre-release state,\n * and if it current in-pre-release type is same as expect type,\n * it should continue the pre-release with the same type\n *\n * @param version\n * @param expectType\n * @return {boolean}\n */\nfunction shouldContinuePrerelease (version, expectType) {\n  return getCurrentActiveType(version) === expectType\n}\n\nfunction isInPrerelease (version) {\n  return Array.isArray(semver.prerelease(version))\n}\n\nconst TypeList = ['major', 'minor', 'patch'].reverse()\n\n/**\n * extract the in-pre-release type in target version\n *\n * @param version\n * @return {string}\n */\nfunction getCurrentActiveType (version) {\n  const typelist = TypeList\n  for (let i = 0; i < typelist.length; i++) {\n    if (semver[typelist[i]](version)) {\n      return typelist[i]\n    }\n  }\n}\n\n/**\n * calculate the priority of release type,\n * major - 2, minor - 1, patch - 0\n *\n * @param type\n * @return {number}\n */\nfunction getTypePriority (type) {\n  return TypeList.indexOf(type)\n}\n\nfunction bumpVersion (releaseAs, currentVersion, args) {\n  return new Promise((resolve, reject) => {\n    if (releaseAs) {\n      return resolve({\n        releaseType: releaseAs\n      })\n    } else {\n      const presetOptions = presetLoader(args)\n      if (typeof presetOptions === 'object') {\n        if (semver.lt(currentVersion, '1.0.0')) presetOptions.preMajor = true\n      }\n      conventionalRecommendedBump({\n        debug: args.verbose && console.info.bind(console, 'conventional-recommended-bump'),\n        preset: presetOptions,\n        path: args.path,\n        tagPrefix: args.tagPrefix,\n        lernaPackage: args.lernaPackage\n      }, function (err, release) {\n        if (err) return reject(err)\n        else return resolve(release)\n      })\n    }\n  })\n}\n\n/**\n * attempt to update the version number in provided `bumpFiles`\n * @param args config object\n * @param newVersion version number to update to.\n * @return void\n */\nfunction updateConfigs (args, newVersion) {\n  const dotgit = DotGitignore()\n  args.bumpFiles.forEach(function (bumpFile) {\n    const updater = resolveUpdaterObjectFromArgument(bumpFile)\n    if (!updater) {\n      return\n    }\n    const configPath = path.resolve(process.cwd(), updater.filename)\n    try {\n      if (dotgit.ignore(configPath)) return\n      const stat = fs.lstatSync(configPath)\n\n      if (!stat.isFile()) return\n      const contents = fs.readFileSync(configPath, 'utf8')\n      checkpoint(\n        args,\n        'bumping version in ' + updater.filename + ' from %s to %s',\n        [updater.updater.readVersion(contents), newVersion]\n      )\n      writeFile(\n        args,\n        configPath,\n        updater.updater.writeVersion(contents, newVersion)\n      )\n      // flag any config files that we modify the version # for\n      // as having been updated.\n      configsToUpdate[updater.filename] = true\n    } catch (err) {\n      if (err.code !== 'ENOENT') console.warn(err.message)\n    }\n  })\n}\n\nmodule.exports = Bump\n"
  },
  {
    "path": "lib/lifecycles/changelog.js",
    "content": "const chalk = require('chalk')\nconst checkpoint = require('../checkpoint')\nconst conventionalChangelog = require('conventional-changelog')\nconst fs = require('fs')\nconst presetLoader = require('../preset-loader')\nconst runLifecycleScript = require('../run-lifecycle-script')\nconst writeFile = require('../write-file')\nconst START_OF_LAST_RELEASE_PATTERN = /(^#+ \\[?[0-9]+\\.[0-9]+\\.[0-9]+|<a name=)/m\n\nasync function Changelog (args, newVersion) {\n  if (args.skip.changelog) return\n  await runLifecycleScript(args, 'prechangelog')\n  await outputChangelog(args, newVersion)\n  await runLifecycleScript(args, 'postchangelog')\n}\n\nChangelog.START_OF_LAST_RELEASE_PATTERN = START_OF_LAST_RELEASE_PATTERN\n\nmodule.exports = Changelog\n\nfunction outputChangelog (args, newVersion) {\n  return new Promise((resolve, reject) => {\n    createIfMissing(args)\n    const header = args.header\n\n    let oldContent = args.dryRun ? '' : fs.readFileSync(args.infile, 'utf-8')\n    const oldContentStart = oldContent.search(START_OF_LAST_RELEASE_PATTERN)\n    // find the position of the last release and remove header:\n    if (oldContentStart !== -1) {\n      oldContent = oldContent.substring(oldContentStart)\n    }\n    let content = ''\n    const context = { version: newVersion }\n    const changelogStream = conventionalChangelog({\n      debug: args.verbose && console.info.bind(console, 'conventional-changelog'),\n      preset: presetLoader(args),\n      tagPrefix: args.tagPrefix\n    }, context, { merges: null, path: args.path })\n      .on('error', function (err) {\n        return reject(err)\n      })\n\n    changelogStream.on('data', function (buffer) {\n      content += buffer.toString()\n    })\n\n    changelogStream.on('end', function () {\n      checkpoint(args, 'outputting changes to %s', [args.infile])\n      if (args.dryRun) console.info(`\\n---\\n${chalk.gray(content.trim())}\\n---\\n`)\n      else writeFile(args, args.infile, header + '\\n' + (content + oldContent).replace(/\\n+$/, '\\n'))\n      return resolve()\n    })\n  })\n}\n\nfunction createIfMissing (args) {\n  try {\n    fs.accessSync(args.infile, fs.F_OK)\n  } catch (err) {\n    if (err.code === 'ENOENT') {\n      checkpoint(args, 'created %s', [args.infile])\n      args.outputUnreleased = true\n      writeFile(args, args.infile, '\\n')\n    }\n  }\n}\n"
  },
  {
    "path": "lib/lifecycles/commit.js",
    "content": "const bump = require('../lifecycles/bump')\nconst checkpoint = require('../checkpoint')\nconst formatCommitMessage = require('../format-commit-message')\nconst path = require('path')\nconst runExecFile = require('../run-execFile')\nconst runLifecycleScript = require('../run-lifecycle-script')\n\nmodule.exports = async function (args, newVersion) {\n  if (args.skip.commit) return\n  const message = await runLifecycleScript(args, 'precommit')\n  if (message && message.length) args.releaseCommitMessageFormat = message\n  await execCommit(args, newVersion)\n  await runLifecycleScript(args, 'postcommit')\n}\n\nasync function execCommit (args, newVersion) {\n  let msg = 'committing %s'\n  let paths = []\n  const verify = args.verify === false || args.n ? ['--no-verify'] : []\n  const sign = args.sign ? ['-S'] : []\n  const toAdd = []\n\n  // only start with a pre-populated paths list when CHANGELOG processing is not skipped\n  if (!args.skip.changelog) {\n    paths = [args.infile]\n    toAdd.push(args.infile)\n  }\n\n  // commit any of the config files that we've updated\n  // the version # for.\n  Object.keys(bump.getUpdatedConfigs()).forEach(function (p) {\n    paths.unshift(p)\n    toAdd.push(path.relative(process.cwd(), p))\n\n    // account for multiple files in the output message\n    if (paths.length > 1) {\n      msg += ' and %s'\n    }\n  })\n\n  if (args.commitAll) {\n    msg += ' and %s'\n    paths.push('all staged files')\n  }\n\n  checkpoint(args, msg, paths)\n\n  // nothing to do, exit without commit anything\n  if (args.skip.changelog && args.skip.bump && toAdd.length === 0) {\n    return\n  }\n\n  await runExecFile(args, 'git', ['add'].concat(toAdd))\n  await runExecFile(\n    args,\n    'git',\n    [\n      'commit'\n    ].concat(\n      verify,\n      sign,\n      args.commitAll ? [] : toAdd,\n      [\n        '-m',\n        `${formatCommitMessage(args.releaseCommitMessageFormat, newVersion)}`\n      ]\n    )\n  )\n}\n"
  },
  {
    "path": "lib/lifecycles/tag.js",
    "content": "const bump = require('../lifecycles/bump')\nconst chalk = require('chalk')\nconst checkpoint = require('../checkpoint')\nconst figures = require('figures')\nconst formatCommitMessage = require('../format-commit-message')\nconst runExecFile = require('../run-execFile')\nconst runLifecycleScript = require('../run-lifecycle-script')\n\nmodule.exports = async function (newVersion, pkgPrivate, args) {\n  if (args.skip.tag) return\n  await runLifecycleScript(args, 'pretag')\n  await execTag(newVersion, pkgPrivate, args)\n  await runLifecycleScript(args, 'posttag')\n}\n\nasync function execTag (newVersion, pkgPrivate, args) {\n  let tagOption\n  if (args.sign) {\n    tagOption = '-s'\n  } else {\n    tagOption = '-a'\n  }\n  checkpoint(args, 'tagging release %s%s', [args.tagPrefix, newVersion])\n  await runExecFile(args, 'git', ['tag', tagOption, args.tagPrefix + newVersion, '-m', `${formatCommitMessage(args.releaseCommitMessageFormat, newVersion)}`])\n  const currentBranch = await runExecFile('', 'git', ['rev-parse', '--abbrev-ref', 'HEAD'])\n  let message = 'git push --follow-tags origin ' + currentBranch.trim()\n  if (pkgPrivate !== true && bump.getUpdatedConfigs()['package.json']) {\n    message += ' && npm publish'\n    if (args.prerelease !== undefined) {\n      if (args.prerelease === '') {\n        message += ' --tag prerelease'\n      } else {\n        message += ' --tag ' + args.prerelease\n      }\n    }\n  }\n\n  checkpoint(args, 'Run `%s` to publish', [message], chalk.blue(figures.info))\n}\n"
  },
  {
    "path": "lib/preset-loader.js",
    "content": "// TODO: this should be replaced with an object we maintain and\n// describe in: https://github.com/conventional-changelog/conventional-changelog-config-spec\nconst spec = require('conventional-changelog-config-spec')\n\nmodule.exports = (args) => {\n  const defaultPreset = require.resolve('conventional-changelog-conventionalcommits')\n  let preset = args.preset || defaultPreset\n  if (preset === defaultPreset) {\n    preset = {\n      name: defaultPreset\n    }\n    Object.keys(spec.properties).forEach(key => {\n      if (args[key] !== undefined) preset[key] = args[key]\n    })\n  }\n  return preset\n}\n"
  },
  {
    "path": "lib/print-error.js",
    "content": "const chalk = require('chalk')\n\nmodule.exports = function (args, msg, opts) {\n  if (!args.silent) {\n    opts = Object.assign({\n      level: 'error',\n      color: 'red'\n    }, opts)\n\n    console[opts.level](chalk[opts.color](msg))\n  }\n}\n"
  },
  {
    "path": "lib/run-exec.js",
    "content": "const { promisify } = require('util')\nconst printError = require('./print-error')\n\nconst exec = promisify(require('child_process').exec)\n\nmodule.exports = async function (args, cmd) {\n  if (args.dryRun) return\n  try {\n    const { stderr, stdout } = await exec(cmd)\n    // If exec returns content in stderr, but no error, print it as a warning\n    if (stderr) printError(args, stderr, { level: 'warn', color: 'yellow' })\n    return stdout\n  } catch (error) {\n    // If exec returns an error, print it and exit with return code 1\n    printError(args, error.stderr || error.message)\n    throw error\n  }\n}\n"
  },
  {
    "path": "lib/run-execFile.js",
    "content": "const { promisify } = require('util')\nconst printError = require('./print-error')\n\nconst execFile = promisify(require('child_process').execFile)\n\nmodule.exports = async function (args, cmd, cmdArgs) {\n  if (args.dryRun) return\n  try {\n    const { stderr, stdout } = await execFile(cmd, cmdArgs)\n    // If execFile returns content in stderr, but no error, print it as a warning\n    if (stderr) printError(args, stderr, { level: 'warn', color: 'yellow' })\n    return stdout\n  } catch (error) {\n    // If execFile returns an error, print it and exit with return code 1\n    printError(args, error.stderr || error.message)\n    throw error\n  }\n}\n"
  },
  {
    "path": "lib/run-lifecycle-script.js",
    "content": "const chalk = require('chalk')\nconst checkpoint = require('./checkpoint')\nconst figures = require('figures')\nconst runExec = require('./run-exec')\n\nmodule.exports = function (args, hookName) {\n  const scripts = args.scripts\n  if (!scripts || !scripts[hookName]) return Promise.resolve()\n  const command = scripts[hookName]\n  checkpoint(args, 'Running lifecycle script \"%s\"', [hookName])\n  checkpoint(args, '- execute command: \"%s\"', [command], chalk.blue(figures.info))\n  return runExec(args, command)\n}\n"
  },
  {
    "path": "lib/updaters/index.js",
    "content": "const path = require('path')\nconst JSON_BUMP_FILES = require('../../defaults').bumpFiles\nconst updatersByType = {\n  json: require('./types/json'),\n  'plain-text': require('./types/plain-text')\n}\nconst PLAIN_TEXT_BUMP_FILES = ['VERSION.txt', 'version.txt']\n\nfunction getUpdaterByType (type) {\n  const updater = updatersByType[type]\n  if (!updater) {\n    throw Error(`Unable to locate updater for provided type (${type}).`)\n  }\n  return updater\n}\n\nfunction getUpdaterByFilename (filename) {\n  if (JSON_BUMP_FILES.includes(path.basename(filename))) {\n    return getUpdaterByType('json')\n  }\n  if (PLAIN_TEXT_BUMP_FILES.includes(filename)) {\n    return getUpdaterByType('plain-text')\n  }\n  throw Error(\n    `Unsupported file (${filename}) provided for bumping.\\n Please specify the updater \\`type\\` or use a custom \\`updater\\`.`\n  )\n}\n\nfunction getCustomUpdaterFromPath (updater) {\n  if (typeof updater === 'string') {\n    return require(path.resolve(process.cwd(), updater))\n  }\n  if (\n    typeof updater.readVersion === 'function' &&\n    typeof updater.writeVersion === 'function'\n  ) {\n    return updater\n  }\n  throw new Error('Updater must be a string path or an object with readVersion and writeVersion methods')\n}\n\n/**\n * Simple check to determine if the object provided is a compatible updater.\n */\nfunction isValidUpdater (obj) {\n  return (\n    typeof obj.readVersion === 'function' &&\n    typeof obj.writeVersion === 'function'\n  )\n}\n\nmodule.exports.resolveUpdaterObjectFromArgument = function (arg) {\n  /**\n   * If an Object was not provided, we assume it's the path/filename\n   * of the updater.\n   */\n  let updater = arg\n  if (isValidUpdater(updater)) {\n    return updater\n  }\n  if (typeof updater !== 'object') {\n    updater = {\n      filename: arg\n    }\n  }\n  try {\n    if (typeof updater.updater === 'string') {\n      updater.updater = getCustomUpdaterFromPath(updater.updater)\n    } else if (updater.type) {\n      updater.updater = getUpdaterByType(updater.type)\n    } else {\n      updater.updater = getUpdaterByFilename(updater.filename)\n    }\n  } catch (err) {\n    if (err.code !== 'ENOENT') console.warn(`Unable to obtain updater for: ${JSON.stringify(arg)}\\n - Error: ${err.message}\\n - Skipping...`)\n  }\n  /**\n   * We weren't able to resolve an updater for the argument.\n   */\n  if (!isValidUpdater(updater.updater)) {\n    return false\n  }\n\n  return updater\n}\n"
  },
  {
    "path": "lib/updaters/types/json.js",
    "content": "const stringifyPackage = require('stringify-package')\nconst detectIndent = require('detect-indent')\nconst detectNewline = require('detect-newline')\n\nmodule.exports.readVersion = function (contents) {\n  return JSON.parse(contents).version\n}\n\nmodule.exports.writeVersion = function (contents, version) {\n  const json = JSON.parse(contents)\n  const indent = detectIndent(contents).indent\n  const newline = detectNewline(contents)\n  json.version = version\n\n  if (json.packages && json.packages['']) {\n    // package-lock v2 stores version there too\n    json.packages[''].version = version\n  }\n\n  return stringifyPackage(json, indent, newline)\n}\n\nmodule.exports.isPrivate = function (contents) {\n  return JSON.parse(contents).private\n}\n"
  },
  {
    "path": "lib/updaters/types/plain-text.js",
    "content": "module.exports.readVersion = function (contents) {\n  return contents\n}\n\nmodule.exports.writeVersion = function (_contents, version) {\n  return version\n}\n"
  },
  {
    "path": "lib/write-file.js",
    "content": "const fs = require('fs')\n\nmodule.exports = function (args, filePath, content) {\n  if (args.dryRun) return\n  fs.writeFileSync(filePath, content, 'utf8')\n}\n"
  },
  {
    "path": "package.json",
    "content": "{\n  \"name\": \"standard-version\",\n  \"version\": \"9.5.0\",\n  \"description\": \"replacement for `npm version` with automatic CHANGELOG generation\",\n  \"bin\": \"bin/cli.js\",\n  \"scripts\": {\n    \"fix\": \"eslint . --fix\",\n    \"posttest\": \"eslint .\",\n    \"test\": \"nyc mocha --timeout=30000\",\n    \"test:unit\": \"mocha --exclude test/git.spec.js\",\n    \"coverage\": \"nyc report --reporter=lcov\",\n    \"release\": \"bin/cli.js\"\n  },\n  \"nyc\": {\n    \"exclude\": [\n      \"tmp/**\"\n    ]\n  },\n  \"repository\": \"conventional-changelog/standard-version\",\n  \"engines\": {\n    \"node\": \">=10\"\n  },\n  \"keywords\": [\n    \"conventional-changelog\",\n    \"recommended\",\n    \"changelog\",\n    \"automatic\",\n    \"workflow\",\n    \"version\",\n    \"angular\",\n    \"standard\"\n  ],\n  \"author\": \"Ben Coe <ben@npmjs.com>\",\n  \"license\": \"ISC\",\n  \"bugs\": {\n    \"url\": \"https://github.com/conventional-changelog/standard-version/issues\"\n  },\n  \"homepage\": \"https://github.com/conventional-changelog/standard-version#readme\",\n  \"dependencies\": {\n    \"chalk\": \"^2.4.2\",\n    \"conventional-changelog\": \"3.1.25\",\n    \"conventional-changelog-config-spec\": \"2.1.0\",\n    \"conventional-changelog-conventionalcommits\": \"4.6.3\",\n    \"conventional-recommended-bump\": \"6.1.0\",\n    \"detect-indent\": \"^6.0.0\",\n    \"detect-newline\": \"^3.1.0\",\n    \"dotgitignore\": \"^2.1.0\",\n    \"figures\": \"^3.1.0\",\n    \"find-up\": \"^5.0.0\",\n    \"git-semver-tags\": \"^4.0.0\",\n    \"semver\": \"^7.1.1\",\n    \"stringify-package\": \"^1.0.1\",\n    \"yargs\": \"^16.0.0\"\n  },\n  \"devDependencies\": {\n    \"chai\": \"^4.2.0\",\n    \"eslint\": \"^7.14.0\",\n    \"eslint-config-standard\": \"^16.0.2\",\n    \"eslint-plugin-import\": \"^2.22.1\",\n    \"eslint-plugin-node\": \"^11.1.0\",\n    \"eslint-plugin-promise\": \"^5.0.0\",\n    \"mocha\": \"^8.2.1\",\n    \"mock-fs\": \"^4.13.0\",\n    \"mockery\": \"^2.1.0\",\n    \"nyc\": \"^15.1.0\",\n    \"shelljs\": \"^0.8.4\",\n    \"std-mocks\": \"^1.0.1\"\n  }\n}\n"
  },
  {
    "path": "renovate.json",
    "content": "{\n  \"extends\": [\n    \"config:base\"\n  ],\n  \"pinVersions\": false,\n  \"rebaseStalePrs\": true,\n  \"gitAuthor\": null,\n  \"ignoreDeps\": [\"decamelize\"]\n}\n"
  },
  {
    "path": "test/config-files.spec.js",
    "content": "/* global describe it beforeEach afterEach */\n\n'use strict'\n\nconst shell = require('shelljs')\nconst fs = require('fs')\nconst { Readable } = require('stream')\nconst mockery = require('mockery')\nconst stdMocks = require('std-mocks')\n\nrequire('chai').should()\n\nfunction exec () {\n  const cli = require('../command')\n  const opt = cli.parse('standard-version')\n  opt.skip = { commit: true, tag: true }\n  return require('../index')(opt)\n}\n\n/**\n * Mock external conventional-changelog modules\n *\n * Mocks should be unregistered in test cleanup by calling unmock()\n *\n * bump?: 'major' | 'minor' | 'patch' | Error | (opt, cb) => { cb(err) | cb(null, { releaseType }) }\n * changelog?: string | Error | Array<string | Error | (opt) => string | null>\n * tags?: string[] | Error\n */\nfunction mock ({ bump, changelog, tags } = {}) {\n  mockery.enable({ warnOnUnregistered: false, useCleanCache: true })\n\n  mockery.registerMock('conventional-recommended-bump', function (opt, cb) {\n    if (typeof bump === 'function') bump(opt, cb)\n    else if (bump instanceof Error) cb(bump)\n    else cb(null, bump ? { releaseType: bump } : {})\n  })\n\n  if (!Array.isArray(changelog)) changelog = [changelog]\n  mockery.registerMock(\n    'conventional-changelog',\n    (opt) =>\n      new Readable({\n        read (_size) {\n          const next = changelog.shift()\n          if (next instanceof Error) {\n            this.destroy(next)\n          } else if (typeof next === 'function') {\n            this.push(next(opt))\n          } else {\n            this.push(next ? Buffer.from(next, 'utf8') : null)\n          }\n        }\n      })\n  )\n\n  mockery.registerMock('git-semver-tags', function (cb) {\n    if (tags instanceof Error) cb(tags)\n    else cb(null, tags | [])\n  })\n\n  stdMocks.use()\n  return () => stdMocks.flush()\n}\n\ndescribe('config files', () => {\n  beforeEach(function () {\n    shell.rm('-rf', 'tmp')\n    shell.config.silent = true\n    shell.mkdir('tmp')\n    shell.cd('tmp')\n    fs.writeFileSync(\n      'package.json',\n      JSON.stringify({ version: '1.0.0' }),\n      'utf-8'\n    )\n  })\n\n  afterEach(function () {\n    shell.cd('../')\n    shell.rm('-rf', 'tmp')\n\n    mockery.deregisterAll()\n    mockery.disable()\n    stdMocks.restore()\n\n    // push out prints from the Mocha reporter\n    const { stdout } = stdMocks.flush()\n    for (const str of stdout) {\n      if (str.startsWith(' ')) process.stdout.write(str)\n    }\n  })\n\n  it('reads config from package.json', async function () {\n    const issueUrlFormat = 'https://standard-version.company.net/browse/{{id}}'\n    mock({\n      bump: 'minor',\n      changelog: ({ preset }) => preset.issueUrlFormat\n    })\n    const pkg = {\n      version: '1.0.0',\n      repository: { url: 'git+https://company@scm.org/office/app.git' },\n      'standard-version': { issueUrlFormat }\n    }\n    fs.writeFileSync('package.json', JSON.stringify(pkg), 'utf-8')\n\n    await exec()\n    const content = fs.readFileSync('CHANGELOG.md', 'utf-8')\n    content.should.include(issueUrlFormat)\n  })\n\n  it('reads config from .versionrc', async function () {\n    const issueUrlFormat = 'http://www.foo.com/{{id}}'\n    const changelog = ({ preset }) => preset.issueUrlFormat\n    mock({ bump: 'minor', changelog })\n    fs.writeFileSync('.versionrc', JSON.stringify({ issueUrlFormat }), 'utf-8')\n\n    await exec()\n    const content = fs.readFileSync('CHANGELOG.md', 'utf-8')\n    content.should.include(issueUrlFormat)\n  })\n\n  it('reads config from .versionrc.json', async function () {\n    const issueUrlFormat = 'http://www.foo.com/{{id}}'\n    const changelog = ({ preset }) => preset.issueUrlFormat\n    mock({ bump: 'minor', changelog })\n    fs.writeFileSync(\n      '.versionrc.json',\n      JSON.stringify({ issueUrlFormat }),\n      'utf-8'\n    )\n\n    await exec()\n    const content = fs.readFileSync('CHANGELOG.md', 'utf-8')\n    content.should.include(issueUrlFormat)\n  })\n\n  it('evaluates a config-function from .versionrc.js', async function () {\n    const issueUrlFormat = 'http://www.foo.com/{{id}}'\n    const src = `module.exports = function() { return ${JSON.stringify({\n      issueUrlFormat\n    })} }`\n    const changelog = ({ preset }) => preset.issueUrlFormat\n    mock({ bump: 'minor', changelog })\n    fs.writeFileSync('.versionrc.js', src, 'utf-8')\n\n    await exec()\n    const content = fs.readFileSync('CHANGELOG.md', 'utf-8')\n    content.should.include(issueUrlFormat)\n  })\n\n  it('evaluates a config-object from .versionrc.js', async function () {\n    const issueUrlFormat = 'http://www.foo.com/{{id}}'\n    const src = `module.exports = ${JSON.stringify({ issueUrlFormat })}`\n    const changelog = ({ preset }) => preset.issueUrlFormat\n    mock({ bump: 'minor', changelog })\n    fs.writeFileSync('.versionrc.js', src, 'utf-8')\n\n    await exec()\n    const content = fs.readFileSync('CHANGELOG.md', 'utf-8')\n    content.should.include(issueUrlFormat)\n  })\n\n  it('throws an error when a non-object is returned from .versionrc.js', async function () {\n    mock({ bump: 'minor' })\n    fs.writeFileSync('.versionrc.js', 'module.exports = 3', 'utf-8')\n    try {\n      await exec()\n      /* istanbul ignore next */\n      throw new Error('Unexpected success')\n    } catch (error) {\n      error.message.should.match(/Invalid configuration/)\n    }\n  })\n})\n"
  },
  {
    "path": "test/core.spec.js",
    "content": "/* global describe it afterEach */\n\n'use strict'\n\nconst shell = require('shelljs')\nconst fs = require('fs')\nconst { resolve } = require('path')\nconst { Readable } = require('stream')\nconst mockFS = require('mock-fs')\nconst mockery = require('mockery')\nconst stdMocks = require('std-mocks')\n\nconst cli = require('../command')\nconst formatCommitMessage = require('../lib/format-commit-message')\n\nrequire('chai').should()\n\n// set by mock()\nlet standardVersion\n\nfunction exec (opt = '', git) {\n  if (typeof opt === 'string') {\n    opt = cli.parse(`standard-version ${opt}`)\n  }\n  if (!git) opt.skip = Object.assign({}, opt.skip, { commit: true, tag: true })\n  return standardVersion(opt)\n}\n\nfunction getPackageVersion () {\n  return JSON.parse(fs.readFileSync('package.json', 'utf-8')).version\n}\n\n/**\n * Mock external conventional-changelog modules\n *\n * Mocks should be unregistered in test cleanup by calling unmock()\n *\n * bump?: 'major' | 'minor' | 'patch' | Error | (opt, cb) => { cb(err) | cb(null, { releaseType }) }\n * changelog?: string | Error | Array<string | Error | (opt) => string | null>\n * execFile?: ({ dryRun, silent }, cmd, cmdArgs) => Promise<string>\n * fs?: { [string]: string | Buffer | any }\n * pkg?: { [string]: any }\n * tags?: string[] | Error\n */\nfunction mock ({ bump, changelog, execFile, fs, pkg, tags } = {}) {\n  mockery.enable({ warnOnUnregistered: false, useCleanCache: true })\n\n  mockery.registerMock('conventional-recommended-bump', function (opt, cb) {\n    if (typeof bump === 'function') bump(opt, cb)\n    else if (bump instanceof Error) cb(bump)\n    else cb(null, bump ? { releaseType: bump } : {})\n  })\n\n  if (!Array.isArray(changelog)) changelog = [changelog]\n  mockery.registerMock(\n    'conventional-changelog',\n    (opt) =>\n      new Readable({\n        read (_size) {\n          const next = changelog.shift()\n          if (next instanceof Error) {\n            this.destroy(next)\n          } else if (typeof next === 'function') {\n            this.push(next(opt))\n          } else {\n            this.push(next ? Buffer.from(next, 'utf8') : null)\n          }\n        }\n      })\n  )\n\n  mockery.registerMock('git-semver-tags', function (cb) {\n    if (tags instanceof Error) cb(tags)\n    else cb(null, tags | [])\n  })\n\n  if (typeof execFile === 'function') {\n    // called from commit & tag lifecycle methods\n    mockery.registerMock('../run-execFile', execFile)\n  }\n\n  // needs to be set after mockery, but before mock-fs\n  standardVersion = require('../index')\n\n  fs = Object.assign({}, fs)\n  if (pkg) {\n    fs['package.json'] = JSON.stringify(pkg)\n  } else if (pkg === undefined && !fs['package.json']) {\n    fs['package.json'] = JSON.stringify({ version: '1.0.0' })\n  }\n  mockFS(fs)\n\n  stdMocks.use()\n  return () => stdMocks.flush()\n}\n\nfunction unmock () {\n  mockery.deregisterAll()\n  mockery.disable()\n  mockFS.restore()\n  stdMocks.restore()\n  standardVersion = null\n\n  // push out prints from the Mocha reporter\n  const { stdout } = stdMocks.flush()\n  for (const str of stdout) {\n    if (str.startsWith(' ')) process.stdout.write(str)\n  }\n}\n\ndescribe('format-commit-message', function () {\n  it('works for no {{currentTag}}', function () {\n    formatCommitMessage('chore(release): 1.0.0', '1.0.0').should.equal(\n      'chore(release): 1.0.0'\n    )\n  })\n  it('works for one {{currentTag}}', function () {\n    formatCommitMessage('chore(release): {{currentTag}}', '1.0.0').should.equal(\n      'chore(release): 1.0.0'\n    )\n  })\n  it('works for two {{currentTag}}', function () {\n    formatCommitMessage(\n      'chore(release): {{currentTag}} \\n\\n* CHANGELOG: https://github.com/conventional-changelog/standard-version/blob/v{{currentTag}}/CHANGELOG.md',\n      '1.0.0'\n    ).should.equal(\n      'chore(release): 1.0.0 \\n\\n* CHANGELOG: https://github.com/conventional-changelog/standard-version/blob/v1.0.0/CHANGELOG.md'\n    )\n  })\n})\n\ndescribe('cli', function () {\n  afterEach(unmock)\n\n  describe('CHANGELOG.md does not exist', function () {\n    it('populates changelog with commits since last tag by default', async function () {\n      mock({ bump: 'patch', changelog: 'patch release\\n', tags: ['v1.0.0'] })\n      await exec()\n      const content = fs.readFileSync('CHANGELOG.md', 'utf-8')\n      content.should.match(/patch release/)\n    })\n\n    it('includes all commits if --first-release is true', async function () {\n      mock({\n        bump: 'minor',\n        changelog: 'first commit\\npatch release\\n',\n        pkg: { version: '1.0.1' }\n      })\n      await exec('--first-release')\n      const content = fs.readFileSync('CHANGELOG.md', 'utf-8')\n      content.should.match(/patch release/)\n      content.should.match(/first commit/)\n    })\n\n    it('skipping changelog will not create a changelog file', async function () {\n      mock({ bump: 'minor', changelog: 'foo\\n' })\n      await exec('--skip.changelog true')\n      getPackageVersion().should.equal('1.1.0')\n      try {\n        fs.readFileSync('CHANGELOG.md', 'utf-8')\n        throw new Error('File should not exist')\n      } catch (err) {\n        err.code.should.equal('ENOENT')\n      }\n    })\n  })\n\n  describe('CHANGELOG.md exists', function () {\n    it('appends the new release above the last release, removing the old header (legacy format)', async function () {\n      mock({\n        bump: 'patch',\n        changelog: 'release 1.0.1\\n',\n        fs: { 'CHANGELOG.md': 'legacy header format<a name=\"1.0.0\">\\n' },\n        tags: ['v1.0.0']\n      })\n      await exec()\n      const content = fs.readFileSync('CHANGELOG.md', 'utf-8')\n      content.should.match(/1\\.0\\.1/)\n      content.should.not.match(/legacy header format/)\n    })\n\n    it('appends the new release above the last release, removing the old header (new format)', async function () {\n      const { header } = require('../defaults')\n      const changelog1 =\n        '### [1.0.1](/compare/v1.0.0...v1.0.1) (YYYY-MM-DD)\\n\\n\\n### Bug Fixes\\n\\n* patch release ABCDEFXY\\n'\n      mock({ bump: 'patch', changelog: changelog1, tags: ['v1.0.0'] })\n      await exec()\n      let content = fs.readFileSync('CHANGELOG.md', 'utf-8')\n      content.should.equal(header + '\\n' + changelog1)\n\n      const changelog2 =\n        '### [1.0.2](/compare/v1.0.1...v1.0.2) (YYYY-MM-DD)\\n\\n\\n### Bug Fixes\\n\\n* another patch release ABCDEFXY\\n'\n      unmock()\n      mock({\n        bump: 'patch',\n        changelog: changelog2,\n        fs: { 'CHANGELOG.md': content },\n        tags: ['v1.0.0', 'v1.0.1']\n      })\n      await exec()\n      content = fs.readFileSync('CHANGELOG.md', 'utf-8')\n      content.should.equal(header + '\\n' + changelog2 + changelog1)\n    })\n\n    it('[DEPRECATED] (--changelogHeader) allows for a custom changelog header', async function () {\n      const header = '# Pork Chop Log'\n      mock({\n        bump: 'minor',\n        changelog: header + '\\n',\n        fs: { 'CHANGELOG.md': '' }\n      })\n      await exec(`--changelogHeader=\"${header}\"`)\n      const content = fs.readFileSync('CHANGELOG.md', 'utf-8')\n      content.should.match(new RegExp(header))\n    })\n\n    it('[DEPRECATED] (--changelogHeader) exits with error if changelog header matches last version search regex', async function () {\n      mock({ bump: 'minor', fs: { 'CHANGELOG.md': '' } })\n      try {\n        await exec('--changelogHeader=\"## 3.0.2\"')\n        throw new Error('That should not have worked')\n      } catch (error) {\n        error.message.should.match(/custom changelog header must not match/)\n      }\n    })\n  })\n\n  describe('lifecycle scripts', () => {\n    describe('prerelease hook', function () {\n      it('should run the prerelease hook when provided', async function () {\n        const flush = mock({\n          bump: 'minor',\n          fs: { 'CHANGELOG.md': 'legacy header format<a name=\"1.0.0\">\\n' }\n        })\n\n        await exec({\n          scripts: { prerelease: 'node -e \"console.error(\\'prerelease\\' + \\' ran\\')\"' }\n        })\n        const { stderr } = flush()\n        stderr.join('\\n').should.match(/prerelease ran/)\n      })\n\n      it('should abort if the hook returns a non-zero exit code', async function () {\n        mock({\n          bump: 'minor',\n          fs: { 'CHANGELOG.md': 'legacy header format<a name=\"1.0.0\">\\n' }\n        })\n\n        try {\n          await exec({\n            scripts: {\n              prerelease: 'node -e \"throw new Error(\\'prerelease\\' + \\' fail\\')\"'\n            }\n          })\n          /* istanbul ignore next */\n          throw new Error('Unexpected success')\n        } catch (error) {\n          error.message.should.match(/prerelease fail/)\n        }\n      })\n    })\n\n    describe('prebump hook', function () {\n      it('should allow prebump hook to return an alternate version #', async function () {\n        const flush = mock({\n          bump: 'minor',\n          fs: { 'CHANGELOG.md': 'legacy header format<a name=\"1.0.0\">\\n' }\n        })\n\n        await exec({ scripts: { prebump: 'node -e \"console.log(Array.of(9, 9, 9).join(\\'.\\'))\"' } })\n        const { stdout } = flush()\n        stdout.join('').should.match(/9\\.9\\.9/)\n      })\n    })\n\n    describe('postbump hook', function () {\n      it('should run the postbump hook when provided', async function () {\n        const flush = mock({\n          bump: 'minor',\n          fs: { 'CHANGELOG.md': 'legacy header format<a name=\"1.0.0\">\\n' }\n        })\n\n        await exec({\n          scripts: { postbump: 'node -e \"console.error(\\'postbump\\' + \\' ran\\')\"' }\n        })\n        const { stderr } = flush()\n        stderr.join('\\n').should.match(/postbump ran/)\n      })\n\n      it('should run the postbump and exit with error when postbump fails', async function () {\n        mock({\n          bump: 'minor',\n          fs: { 'CHANGELOG.md': 'legacy header format<a name=\"1.0.0\">\\n' }\n        })\n\n        try {\n          await exec({\n            scripts: { postbump: 'node -e \"throw new Error(\\'postbump\\' + \\' fail\\')\"' }\n          })\n          await exec('--patch')\n          /* istanbul ignore next */\n          throw new Error('Unexpected success')\n        } catch (error) {\n          error.message.should.match(/postbump fail/)\n        }\n      })\n    })\n  })\n\n  describe('manual-release', function () {\n    describe('release-types', function () {\n      const regularTypes = ['major', 'minor', 'patch']\n      const nextVersion = { major: '2.0.0', minor: '1.1.0', patch: '1.0.1' }\n\n      regularTypes.forEach(function (type) {\n        it('creates a ' + type + ' release', async function () {\n          mock({\n            bump: 'patch',\n            fs: { 'CHANGELOG.md': 'legacy header format<a name=\"1.0.0\">\\n' }\n          })\n          await exec('--release-as ' + type)\n          getPackageVersion().should.equal(nextVersion[type])\n        })\n      })\n\n      // this is for pre-releases\n      regularTypes.forEach(function (type) {\n        it('creates a pre' + type + ' release', async function () {\n          mock({\n            bump: 'patch',\n            fs: { 'CHANGELOG.md': 'legacy header format<a name=\"1.0.0\">\\n' }\n          })\n          await exec('--release-as ' + type + ' --prerelease ' + type)\n          getPackageVersion().should.equal(`${nextVersion[type]}-${type}.0`)\n        })\n      })\n    })\n\n    describe('release-as-exact', function () {\n      it('releases as v100.0.0', async function () {\n        mock({\n          bump: 'patch',\n          fs: { 'CHANGELOG.md': 'legacy header format<a name=\"1.0.0\">\\n' }\n        })\n        await exec('--release-as v100.0.0')\n        getPackageVersion().should.equal('100.0.0')\n      })\n\n      it('releases as 200.0.0-amazing', async function () {\n        mock({\n          bump: 'patch',\n          fs: { 'CHANGELOG.md': 'legacy header format<a name=\"1.0.0\">\\n' }\n        })\n        await exec('--release-as 200.0.0-amazing')\n        getPackageVersion().should.equal('200.0.0-amazing')\n      })\n    })\n\n    it('creates a prerelease with a new minor version after two prerelease patches', async function () {\n      let releaseType = 'patch'\n      const bump = (_, cb) => cb(null, { releaseType })\n      mock({\n        bump,\n        fs: { 'CHANGELOG.md': 'legacy header format<a name=\"1.0.0\">\\n' }\n      })\n\n      await exec('--release-as patch --prerelease dev')\n      getPackageVersion().should.equal('1.0.1-dev.0')\n\n      await exec('--prerelease dev')\n      getPackageVersion().should.equal('1.0.1-dev.1')\n\n      releaseType = 'minor'\n      await exec('--release-as minor --prerelease dev')\n      getPackageVersion().should.equal('1.1.0-dev.0')\n\n      await exec('--release-as minor --prerelease dev')\n      getPackageVersion().should.equal('1.1.0-dev.1')\n\n      await exec('--prerelease dev')\n      getPackageVersion().should.equal('1.1.0-dev.2')\n    })\n  })\n\n  it('appends line feed at end of package.json', async function () {\n    mock({ bump: 'patch' })\n    await exec()\n    const pkgJson = fs.readFileSync('package.json', 'utf-8')\n    pkgJson.should.equal('{\\n  \"version\": \"1.0.1\"\\n}\\n')\n  })\n\n  it('preserves indentation of tabs in package.json', async function () {\n    mock({\n      bump: 'patch',\n      fs: { 'package.json': '{\\n\\t\"version\": \"1.0.0\"\\n}\\n' }\n    })\n    await exec()\n    const pkgJson = fs.readFileSync('package.json', 'utf-8')\n    pkgJson.should.equal('{\\n\\t\"version\": \"1.0.1\"\\n}\\n')\n  })\n\n  it('preserves indentation of spaces in package.json', async function () {\n    mock({\n      bump: 'patch',\n      fs: { 'package.json': '{\\n    \"version\": \"1.0.0\"\\n}\\n' }\n    })\n    await exec()\n    const pkgJson = fs.readFileSync('package.json', 'utf-8')\n    pkgJson.should.equal('{\\n    \"version\": \"1.0.1\"\\n}\\n')\n  })\n\n  it('preserves carriage return + line feed in package.json', async function () {\n    mock({\n      bump: 'patch',\n      fs: { 'package.json': '{\\r\\n  \"version\": \"1.0.0\"\\r\\n}\\r\\n' }\n    })\n    await exec()\n    const pkgJson = fs.readFileSync('package.json', 'utf-8')\n    pkgJson.should.equal('{\\r\\n  \"version\": \"1.0.1\"\\r\\n}\\r\\n')\n  })\n\n  it('does not print output when the --silent flag is passed', async function () {\n    const flush = mock()\n    await exec('--silent')\n    flush().should.eql({ stdout: [], stderr: [] })\n  })\n})\n\ndescribe('standard-version', function () {\n  afterEach(unmock)\n\n  it('should exit on bump error', async function () {\n    mock({ bump: new Error('bump err') })\n    try {\n      await exec()\n      /* istanbul ignore next */\n      throw new Error('Unexpected success')\n    } catch (err) {\n      err.message.should.match(/bump err/)\n    }\n  })\n\n  it('should exit on changelog error', async function () {\n    mock({ bump: 'minor', changelog: new Error('changelog err') })\n    try {\n      await exec()\n      /* istanbul ignore next */\n      throw new Error('Unexpected success')\n    } catch (err) {\n      err.message.should.match(/changelog err/)\n    }\n  })\n\n  it('should exit with error without a package file to bump', async function () {\n    mock({ bump: 'patch', pkg: false })\n    try {\n      await exec({ gitTagFallback: false })\n      /* istanbul ignore next */\n      throw new Error('Unexpected success')\n    } catch (err) {\n      err.message.should.equal('no package file found')\n    }\n  })\n\n  it('bumps version # in bower.json', async function () {\n    mock({\n      bump: 'minor',\n      fs: { 'bower.json': JSON.stringify({ version: '1.0.0' }) },\n      tags: ['v1.0.0']\n    })\n    await exec()\n    JSON.parse(fs.readFileSync('bower.json', 'utf-8')).version.should.equal(\n      '1.1.0'\n    )\n    getPackageVersion().should.equal('1.1.0')\n  })\n\n  it('bumps version # in manifest.json', async function () {\n    mock({\n      bump: 'minor',\n      fs: { 'manifest.json': JSON.stringify({ version: '1.0.0' }) },\n      tags: ['v1.0.0']\n    })\n    await exec()\n    JSON.parse(fs.readFileSync('manifest.json', 'utf-8')).version.should.equal(\n      '1.1.0'\n    )\n    getPackageVersion().should.equal('1.1.0')\n  })\n\n  describe('custom `bumpFiles` support', function () {\n    it('mix.exs + version.txt', async function () {\n      const updater = 'custom-updater.js'\n      const updaterModule = require('./mocks/updater/customer-updater')\n      mock({\n        bump: 'minor',\n        fs: {\n          'mix.exs': fs.readFileSync('./test/mocks/mix.exs'),\n          'version.txt': fs.readFileSync('./test/mocks/version.txt')\n        },\n        tags: ['v1.0.0']\n      })\n      mockery.registerMock(resolve(process.cwd(), updater), updaterModule)\n\n      await exec({\n        bumpFiles: [\n          'version.txt',\n          { filename: 'mix.exs', updater: 'custom-updater.js' }\n        ]\n      })\n      fs.readFileSync('mix.exs', 'utf-8').should.contain('version: \"1.1.0\"')\n      fs.readFileSync('version.txt', 'utf-8').should.equal('1.1.0')\n    })\n\n    it('bumps a custom `plain-text` file', async function () {\n      mock({\n        bump: 'minor',\n        fs: {\n          'VERSION_TRACKER.txt': fs.readFileSync(\n            './test/mocks/VERSION-1.0.0.txt'\n          )\n        }\n      })\n      await exec({\n        bumpFiles: [{ filename: 'VERSION_TRACKER.txt', type: 'plain-text' }]\n      })\n      fs.readFileSync('VERSION_TRACKER.txt', 'utf-8').should.equal('1.1.0')\n    })\n  })\n\n  describe('custom `packageFiles` support', function () {\n    it('reads and writes to a custom `plain-text` file', async function () {\n      mock({\n        bump: 'minor',\n        fs: {\n          'VERSION_TRACKER.txt': fs.readFileSync(\n            './test/mocks/VERSION-6.3.1.txt'\n          )\n        }\n      })\n      await exec({\n        packageFiles: [{ filename: 'VERSION_TRACKER.txt', type: 'plain-text' }],\n        bumpFiles: [{ filename: 'VERSION_TRACKER.txt', type: 'plain-text' }]\n      })\n      fs.readFileSync('VERSION_TRACKER.txt', 'utf-8').should.equal('6.4.0')\n    })\n\n    it('allows same object to be used in packageFiles and bumpFiles', async function () {\n      mock({\n        bump: 'minor',\n        fs: {\n          'VERSION_TRACKER.txt': fs.readFileSync(\n            './test/mocks/VERSION-6.3.1.txt'\n          )\n        }\n      })\n      const origWarn = console.warn\n      console.warn = () => {\n        throw new Error('console.warn should not be called')\n      }\n      const filedesc = { filename: 'VERSION_TRACKER.txt', type: 'plain-text' }\n      try {\n        await exec({ packageFiles: [filedesc], bumpFiles: [filedesc] })\n        fs.readFileSync('VERSION_TRACKER.txt', 'utf-8').should.equal('6.4.0')\n      } finally {\n        console.warn = origWarn\n      }\n    })\n  })\n\n  it('`packageFiles` are bumped along with `bumpFiles` defaults [standard-version#533]', async function () {\n    mock({\n      bump: 'minor',\n      fs: {\n        '.gitignore': '',\n        'package-lock.json': JSON.stringify({ version: '1.0.0' }),\n        'manifest.json': fs.readFileSync('./test/mocks/manifest-6.3.1.json')\n      },\n      tags: ['v1.0.0']\n    })\n\n    await exec({\n      silent: true,\n      packageFiles: [\n        {\n          filename: 'manifest.json',\n          type: 'json'\n        }\n      ]\n    })\n\n    JSON.parse(fs.readFileSync('manifest.json', 'utf-8')).version.should.equal('6.4.0')\n    JSON.parse(fs.readFileSync('package.json', 'utf-8')).version.should.equal('6.4.0')\n    JSON.parse(fs.readFileSync('package-lock.json', 'utf-8')).version.should.equal('6.4.0')\n  })\n\n  it('bumps version # in npm-shrinkwrap.json', async function () {\n    mock({\n      bump: 'minor',\n      fs: {\n        'npm-shrinkwrap.json': JSON.stringify({ version: '1.0.0' })\n      },\n      tags: ['v1.0.0']\n    })\n    await exec()\n    JSON.parse(\n      fs.readFileSync('npm-shrinkwrap.json', 'utf-8')\n    ).version.should.equal('1.1.0')\n    getPackageVersion().should.equal('1.1.0')\n  })\n\n  it('bumps version # in package-lock.json', async function () {\n    mock({\n      bump: 'minor',\n      fs: {\n        '.gitignore': '',\n        'package-lock.json': JSON.stringify({ version: '1.0.0' })\n      },\n      tags: ['v1.0.0']\n    })\n    await exec()\n    JSON.parse(\n      fs.readFileSync('package-lock.json', 'utf-8')\n    ).version.should.equal('1.1.0')\n    getPackageVersion().should.equal('1.1.0')\n  })\n\n  describe('skip', () => {\n    it('allows bump and changelog generation to be skipped', async function () {\n      const changelogContent = 'legacy header format<a name=\"1.0.0\">\\n'\n      mock({\n        bump: 'minor',\n        changelog: 'foo\\n',\n        fs: { 'CHANGELOG.md': changelogContent }\n      })\n\n      await exec('--skip.bump true --skip.changelog true')\n      getPackageVersion().should.equal('1.0.0')\n      const content = fs.readFileSync('CHANGELOG.md', 'utf-8')\n      content.should.equal(changelogContent)\n    })\n  })\n\n  it('does not update files present in .gitignore', async () => {\n    mock({\n      bump: 'minor',\n      fs: {\n        '.gitignore': 'package-lock.json\\nbower.json',\n        // test a defaults.packageFiles\n        'bower.json': JSON.stringify({ version: '1.0.0' }),\n        // test a defaults.bumpFiles\n        'package-lock.json': JSON.stringify({\n          name: '@org/package',\n          version: '1.0.0',\n          lockfileVersion: 1\n        })\n      },\n      tags: ['v1.0.0']\n    })\n    await exec()\n    JSON.parse(fs.readFileSync('package-lock.json', 'utf-8')).version.should.equal(\n      '1.0.0'\n    )\n    JSON.parse(fs.readFileSync('bower.json', 'utf-8')).version.should.equal(\n      '1.0.0'\n    )\n    getPackageVersion().should.equal('1.1.0')\n  })\n\n  describe('configuration', () => {\n    it('--header', async function () {\n      mock({ bump: 'minor', fs: { 'CHANGELOG.md': '' } })\n      await exec('--header=\"# Welcome to our CHANGELOG.md\"')\n      const content = fs.readFileSync('CHANGELOG.md', 'utf-8')\n      content.should.match(/# Welcome to our CHANGELOG.md/)\n    })\n\n    it('--issuePrefixes and --issueUrlFormat', async function () {\n      const format = 'http://www.foo.com/{{prefix}}{{id}}'\n      const prefix = 'ABC-'\n      const changelog = ({ preset }) =>\n        preset.issueUrlFormat + ':' + preset.issuePrefixes\n      mock({ bump: 'minor', changelog })\n      await exec(`--issuePrefixes=\"${prefix}\" --issueUrlFormat=\"${format}\"`)\n      const content = fs.readFileSync('CHANGELOG.md', 'utf-8')\n      content.should.include(`${format}:${prefix}`)\n    })\n  })\n\n  describe('pre-major', () => {\n    it('bumps the minor rather than major, if version < 1.0.0', async function () {\n      mock({\n        bump: 'minor',\n        pkg: {\n          version: '0.5.0',\n          repository: { url: 'https://github.com/yargs/yargs.git' }\n        }\n      })\n      await exec()\n      getPackageVersion().should.equal('0.6.0')\n    })\n\n    it('bumps major if --release-as=major specified, if version < 1.0.0', async function () {\n      mock({\n        bump: 'major',\n        pkg: {\n          version: '0.5.0',\n          repository: { url: 'https://github.com/yargs/yargs.git' }\n        }\n      })\n      await exec('-r major')\n      getPackageVersion().should.equal('1.0.0')\n    })\n  })\n})\n\ndescribe('GHSL-2020-111', function () {\n  afterEach(unmock)\n\n  it('does not allow command injection via basic configuration', async function () {\n    mock({ bump: 'patch' })\n    await exec({\n      noVerify: true,\n      infile: 'foo.txt',\n      releaseCommitMessageFormat: 'bla `touch exploit`'\n    })\n    const stat = shell.test('-f', './exploit')\n    stat.should.equal(false)\n  })\n})\n\ndescribe('with mocked git', function () {\n  afterEach(unmock)\n\n  it('--sign signs the commit and tag', async function () {\n    const gitArgs = [\n      ['add', 'CHANGELOG.md', 'package.json'],\n      ['commit', '-S', 'CHANGELOG.md', 'package.json', '-m', 'chore(release): 1.0.1'],\n      ['tag', '-s', 'v1.0.1', '-m', 'chore(release): 1.0.1'],\n      ['rev-parse', '--abbrev-ref', 'HEAD']\n    ]\n    const execFile = (_args, cmd, cmdArgs) => {\n      cmd.should.equal('git')\n      const expected = gitArgs.shift()\n      cmdArgs.should.deep.equal(expected)\n      if (expected[0] === 'rev-parse') return Promise.resolve('master')\n      return Promise.resolve('')\n    }\n    mock({ bump: 'patch', changelog: 'foo\\n', execFile })\n\n    await exec('--sign', true)\n    gitArgs.should.have.lengthOf(0)\n  })\n\n  it('fails if git add fails', async function () {\n    const gitArgs = [\n      ['add', 'CHANGELOG.md', 'package.json']\n    ]\n    const execFile = (_args, cmd, cmdArgs) => {\n      cmd.should.equal('git')\n      const expected = gitArgs.shift()\n      cmdArgs.should.deep.equal(expected)\n      if (expected[0] === 'add') {\n        return Promise.reject(new Error('Command failed: git\\nfailed add'))\n      }\n      return Promise.resolve('')\n    }\n    mock({ bump: 'patch', changelog: 'foo\\n', execFile })\n\n    try {\n      await exec({}, true)\n      /* istanbul ignore next */\n      throw new Error('Unexpected success')\n    } catch (error) {\n      error.message.should.match(/failed add/)\n    }\n  })\n\n  it('fails if git commit fails', async function () {\n    const gitArgs = [\n      ['add', 'CHANGELOG.md', 'package.json'],\n      ['commit', 'CHANGELOG.md', 'package.json', '-m', 'chore(release): 1.0.1']\n    ]\n    const execFile = (_args, cmd, cmdArgs) => {\n      cmd.should.equal('git')\n      const expected = gitArgs.shift()\n      cmdArgs.should.deep.equal(expected)\n      if (expected[0] === 'commit') {\n        return Promise.reject(new Error('Command failed: git\\nfailed commit'))\n      }\n      return Promise.resolve('')\n    }\n    mock({ bump: 'patch', changelog: 'foo\\n', execFile })\n\n    try {\n      await exec({}, true)\n      /* istanbul ignore next */\n      throw new Error('Unexpected success')\n    } catch (error) {\n      error.message.should.match(/failed commit/)\n    }\n  })\n\n  it('fails if git tag fails', async function () {\n    const gitArgs = [\n      ['add', 'CHANGELOG.md', 'package.json'],\n      ['commit', 'CHANGELOG.md', 'package.json', '-m', 'chore(release): 1.0.1'],\n      ['tag', '-a', 'v1.0.1', '-m', 'chore(release): 1.0.1']\n    ]\n    const execFile = (_args, cmd, cmdArgs) => {\n      cmd.should.equal('git')\n      const expected = gitArgs.shift()\n      cmdArgs.should.deep.equal(expected)\n      if (expected[0] === 'tag') {\n        return Promise.reject(new Error('Command failed: git\\nfailed tag'))\n      }\n      return Promise.resolve('')\n    }\n    mock({ bump: 'patch', changelog: 'foo\\n', execFile })\n\n    try {\n      await exec({}, true)\n      /* istanbul ignore next */\n      throw new Error('Unexpected success')\n    } catch (error) {\n      error.message.should.match(/failed tag/)\n    }\n  })\n})\n"
  },
  {
    "path": "test/git.spec.js",
    "content": "/* global describe it beforeEach afterEach */\n\n'use strict'\n\nconst shell = require('shelljs')\nconst fs = require('fs')\nconst { Readable } = require('stream')\nconst mockery = require('mockery')\nconst stdMocks = require('std-mocks')\n\nrequire('chai').should()\n\nfunction exec (opt = '') {\n  if (typeof opt === 'string') {\n    const cli = require('../command')\n    opt = cli.parse(`standard-version ${opt}`)\n  }\n  return require('../index')(opt)\n}\n\nfunction writePackageJson (version, option) {\n  const pkg = Object.assign({}, option, { version })\n  fs.writeFileSync('package.json', JSON.stringify(pkg), 'utf-8')\n}\n\nfunction writeHook (hookName, causeError, script) {\n  shell.mkdir('-p', 'scripts')\n  let content = script || 'console.error(\"' + hookName + ' ran\")'\n  content += causeError ? '\\nthrow new Error(\"' + hookName + '-failure\")' : ''\n  fs.writeFileSync('scripts/' + hookName + '.js', content, 'utf-8')\n  fs.chmodSync('scripts/' + hookName + '.js', '755')\n}\n\nfunction getPackageVersion () {\n  return JSON.parse(fs.readFileSync('package.json', 'utf-8')).version\n}\n\n/**\n * Mock external conventional-changelog modules\n *\n * bump: 'major' | 'minor' | 'patch' | Error | (opt, cb) => { cb(err) | cb(null, { releaseType }) }\n * changelog?: string | Error | Array<string | Error | (opt) => string | null>\n * tags?: string[] | Error\n */\nfunction mock ({ bump, changelog, tags }) {\n  if (bump === undefined) throw new Error('bump must be defined for mock()')\n  mockery.enable({ warnOnUnregistered: false, useCleanCache: true })\n\n  mockery.registerMock('conventional-recommended-bump', function (opt, cb) {\n    if (typeof bump === 'function') bump(opt, cb)\n    else if (bump instanceof Error) cb(bump)\n    else cb(null, { releaseType: bump })\n  })\n\n  if (!Array.isArray(changelog)) changelog = [changelog]\n  mockery.registerMock('conventional-changelog', (opt) => new Readable({\n    read (_size) {\n      const next = changelog.shift()\n      if (next instanceof Error) {\n        this.destroy(next)\n      } else if (typeof next === 'function') {\n        this.push(next(opt))\n      } else {\n        this.push(next ? Buffer.from(next, 'utf8') : null)\n      }\n    }\n  }))\n\n  mockery.registerMock('git-semver-tags', function (_, cb) {\n    if (tags instanceof Error) cb(tags)\n    else cb(null, tags || [])\n  })\n\n  stdMocks.use()\n  return () => stdMocks.flush()\n}\n\ndescribe('git', function () {\n  beforeEach(function () {\n    shell.rm('-rf', 'tmp')\n    shell.config.silent = true\n    shell.mkdir('tmp')\n    shell.cd('tmp')\n    shell.exec('git init')\n    shell.exec('git config commit.gpgSign false')\n    shell.exec('git config core.autocrlf false')\n    shell.exec('git commit --allow-empty -m\"root-commit\"')\n    writePackageJson('1.0.0')\n  })\n\n  afterEach(function () {\n    shell.cd('../')\n    shell.rm('-rf', 'tmp')\n\n    mockery.deregisterAll()\n    mockery.disable()\n    stdMocks.restore()\n\n    // push out prints from the Mocha reporter\n    const { stdout } = stdMocks.flush()\n    for (const str of stdout) {\n      if (str.startsWith(' ')) process.stdout.write(str)\n    }\n  })\n\n  describe('tagPrefix', () => {\n    // TODO: Use unmocked git-semver-tags and stage a git environment\n    it('will add prefix onto tag based on version from package', async function () {\n      writePackageJson('1.2.0')\n      mock({ bump: 'minor', tags: ['p-v1.2.0'] })\n      await exec('--tag-prefix p-v')\n      shell.exec('git tag').stdout.should.match(/p-v1\\.3\\.0/)\n    })\n\n    it('will add prefix onto tag via when gitTagFallback is true and no package [cli]', async function () {\n      shell.rm('package.json')\n      mock({ bump: 'minor', tags: ['android/production/v1.2.0', 'android/production/v1.0.0'] })\n      await exec('--tag-prefix android/production/v')\n      shell.exec('git tag').stdout.should.match(/android\\/production\\/v1\\.3\\.0/)\n    })\n\n    it('will add prefix onto tag via when gitTagFallback is true and no package [options]', async function () {\n      mock({ bump: 'minor', tags: ['android/production/v1.2.0', 'android/production/v1.0.0'] })\n      await exec({ tagPrefix: 'android/production/v', packageFiles: [] })\n      shell.exec('git tag').stdout.should.match(/android\\/production\\/v1\\.3\\.0/)\n    })\n  })\n\n  it('formats the commit and tag messages appropriately', async function () {\n    mock({ bump: 'minor', tags: ['v1.0.0'] })\n    await exec({})\n    // check last commit message\n    shell.exec('git log --oneline -n1').stdout.should.match(/chore\\(release\\): 1\\.1\\.0/)\n    // check annotated tag message\n    shell.exec('git tag -l -n1 v1.1.0').stdout.should.match(/chore\\(release\\): 1\\.1\\.0/)\n  })\n\n  it('formats the tag if --first-release is true', async function () {\n    writePackageJson('1.0.1')\n    mock({ bump: 'minor' })\n    await exec('--first-release')\n    shell.exec('git tag').stdout.should.match(/1\\.0\\.1/)\n  })\n\n  it('commits all staged files', async function () {\n    fs.writeFileSync('CHANGELOG.md', 'legacy header format<a name=\"1.0.0\">\\n', 'utf-8')\n    fs.writeFileSync('STUFF.md', 'stuff\\n', 'utf-8')\n    shell.exec('git add STUFF.md')\n\n    mock({ bump: 'patch', changelog: 'release 1.0.1\\n', tags: ['v1.0.0'] })\n    await exec('--commit-all')\n    const status = shell.exec('git status --porcelain') // see http://unix.stackexchange.com/questions/155046/determine-if-git-working-directory-is-clean-from-a-script\n    status.should.equal('')\n    status.should.not.match(/STUFF.md/)\n\n    const content = fs.readFileSync('CHANGELOG.md', 'utf-8')\n    content.should.match(/1\\.0\\.1/)\n    content.should.not.match(/legacy header format/)\n  })\n\n  it('does not run git hooks if the --no-verify flag is passed', async function () {\n    fs.writeFileSync('.git/hooks/pre-commit', '#!/bin/sh\\necho \"precommit ran\"\\nexit 1', 'utf-8')\n    fs.chmodSync('.git/hooks/pre-commit', '755')\n\n    mock({ bump: 'minor' })\n    await exec('--no-verify')\n    await exec('-n')\n  })\n\n  it('allows the commit phase to be skipped', async function () {\n    const changelogContent = 'legacy header format<a name=\"1.0.0\">\\n'\n    writePackageJson('1.0.0')\n    fs.writeFileSync('CHANGELOG.md', changelogContent, 'utf-8')\n\n    mock({ bump: 'minor', changelog: 'new feature\\n' })\n    await exec('--skip.commit true')\n    getPackageVersion().should.equal('1.1.0')\n    const content = fs.readFileSync('CHANGELOG.md', 'utf-8')\n    content.should.match(/new feature/)\n    shell.exec('git log --oneline -n1').stdout.should.match(/root-commit/)\n  })\n\n  it('dry-run skips all non-idempotent steps', async function () {\n    shell.exec('git tag -a v1.0.0 -m \"my awesome first release\"')\n    const flush = mock({ bump: 'minor', changelog: '### Features\\n', tags: ['v1.0.0'] })\n    await exec('--dry-run')\n    const { stdout } = flush()\n    stdout.join('').should.match(/### Features/)\n    shell.exec('git log --oneline -n1').stdout.should.match(/root-commit/)\n    shell.exec('git tag').stdout.should.match(/1\\.0\\.0/)\n    getPackageVersion().should.equal('1.0.0')\n  })\n\n  it('works fine without specifying a tag id when prereleasing', async function () {\n    writePackageJson('1.0.0')\n    fs.writeFileSync('CHANGELOG.md', 'legacy header format<a name=\"1.0.0\">\\n', 'utf-8')\n    mock({ bump: 'minor' })\n    await exec('--prerelease')\n    getPackageVersion().should.equal('1.1.0-0')\n  })\n\n  describe('gitTagFallback', () => {\n    it('defaults to 1.0.0 if no tags in git history', async () => {\n      shell.rm('package.json')\n      mock({ bump: 'minor' })\n      await exec({})\n      const output = shell.exec('git tag')\n      output.stdout.should.include('v1.1.0')\n    })\n\n    it('bases version on greatest version tag, if tags are found', async () => {\n      shell.rm('package.json')\n      mock({ bump: 'minor', tags: ['v3.9.0', 'v5.0.0', 'v3.0.0'] })\n      await exec({})\n      const output = shell.exec('git tag')\n      output.stdout.should.include('v5.1.0')\n    })\n  })\n\n  describe('configuration', () => {\n    it('.versionrc : releaseCommitMessageFormat', async function () {\n      fs.writeFileSync('.versionrc', JSON.stringify({\n        releaseCommitMessageFormat: 'This commit represents release: {{currentTag}}'\n      }), 'utf-8')\n      mock({ bump: 'minor' })\n      await exec('')\n      shell.exec('git log --oneline -n1').should.include('This commit represents release: 1.1.0')\n    })\n\n    it('--releaseCommitMessageFormat', async function () {\n      mock({ bump: 'minor' })\n      await exec('--releaseCommitMessageFormat=\"{{currentTag}} is the version.\"')\n      shell.exec('git log --oneline -n1').should.include('1.1.0 is the version.')\n    })\n\n    it('[LEGACY] supports --message (and single %s replacement)', async function () {\n      mock({ bump: 'minor' })\n      await exec('--message=\"V:%s\"')\n      shell.exec('git log --oneline -n1').should.include('V:1.1.0')\n    })\n\n    it('[LEGACY] supports -m (and multiple %s replacements)', async function () {\n      mock({ bump: 'minor' })\n      await exec('--message=\"V:%s is the %s.\"')\n      shell.exec('git log --oneline -n1').should.include('V:1.1.0 is the 1.1.0.')\n    })\n  })\n\n  describe('precommit hook', function () {\n    it('should run the precommit hook when provided via .versionrc.json (#371)', async function () {\n      fs.writeFileSync('.versionrc.json', JSON.stringify({\n        scripts: { precommit: 'node scripts/precommit' }\n      }), 'utf-8')\n\n      writeHook('precommit')\n      fs.writeFileSync('CHANGELOG.md', 'legacy header format<a name=\"1.0.0\">\\n', 'utf-8')\n      const flush = mock({ bump: 'minor' })\n      await exec('')\n      const { stderr } = flush()\n      stderr[0].should.match(/precommit ran/)\n    })\n\n    it('should run the precommit hook when provided', async function () {\n      writePackageJson('1.0.0', {\n        'standard-version': {\n          scripts: { precommit: 'node scripts/precommit' }\n        }\n      })\n      writeHook('precommit')\n      fs.writeFileSync('CHANGELOG.md', 'legacy header format<a name=\"1.0.0\">\\n', 'utf-8')\n\n      const flush = mock({ bump: 'minor' })\n      await exec('--patch')\n      const { stderr } = flush()\n      stderr[0].should.match(/precommit ran/)\n    })\n\n    it('should run the precommit hook and exit with error when precommit fails', async function () {\n      writePackageJson('1.0.0', {\n        'standard-version': {\n          scripts: { precommit: 'node scripts/precommit' }\n        }\n      })\n      writeHook('precommit', true)\n      fs.writeFileSync('CHANGELOG.md', 'legacy header format<a name=\"1.0.0\">\\n', 'utf-8')\n\n      mock({ bump: 'minor' })\n      try {\n        await exec('--patch')\n        /* istanbul ignore next */\n        throw new Error('Unexpected success')\n      } catch (error) {\n        error.message.should.match(/precommit-failure/)\n      }\n    })\n\n    it('should allow an alternate commit message to be provided by precommit script', async function () {\n      writePackageJson('1.0.0', {\n        'standard-version': {\n          scripts: { precommit: 'node scripts/precommit' }\n        }\n      })\n      writeHook('precommit', false, 'console.log(\"releasing %s delivers #222\")')\n      fs.writeFileSync('CHANGELOG.md', 'legacy header format<a name=\"1.0.0\">\\n', 'utf-8')\n\n      mock({ bump: 'minor' })\n      await exec('--patch')\n      shell.exec('git log --oneline -n1').should.match(/delivers #222/)\n    })\n  })\n\n  describe('Run ... to publish', function () {\n    it('does normally display `npm publish`', async function () {\n      const flush = mock({ bump: 'patch' })\n      await exec('')\n      flush().stdout.join('').should.match(/npm publish/)\n    })\n\n    it('does not display `npm publish` if the package is private', async function () {\n      writePackageJson('1.0.0', { private: true })\n      const flush = mock({ bump: 'patch' })\n      await exec('')\n      flush().stdout.join('').should.not.match(/npm publish/)\n    })\n\n    it('does not display `npm publish` if there is no package.json', async function () {\n      shell.rm('package.json')\n      const flush = mock({ bump: 'patch' })\n      await exec('')\n      flush().stdout.join('').should.not.match(/npm publish/)\n    })\n\n    it('does not display `all staged files` without the --commit-all flag', async function () {\n      const flush = mock({ bump: 'patch' })\n      await exec('')\n      flush().stdout.join('').should.not.match(/all staged files/)\n    })\n\n    it('does display `all staged files` if the --commit-all flag is passed', async function () {\n      const flush = mock({ bump: 'patch' })\n      await exec('--commit-all')\n      flush().stdout.join('').should.match(/all staged files/)\n    })\n\n    it('advises use of --tag prerelease for publishing to npm', async function () {\n      writePackageJson('1.0.0')\n      fs.writeFileSync('CHANGELOG.md', 'legacy header format<a name=\"1.0.0\">\\n', 'utf-8')\n\n      const flush = mock({ bump: 'patch' })\n      await exec('--prerelease')\n      const { stdout } = flush()\n      stdout.join('').should.include('--tag prerelease')\n    })\n\n    it('advises use of --tag alpha for publishing to npm when tagging alpha', async function () {\n      writePackageJson('1.0.0')\n      fs.writeFileSync('CHANGELOG.md', 'legacy header format<a name=\"1.0.0\">\\n', 'utf-8')\n\n      const flush = mock({ bump: 'patch' })\n      await exec('--prerelease alpha')\n      const { stdout } = flush()\n      stdout.join('').should.include('--tag alpha')\n    })\n\n    it('does not advise use of --tag prerelease for private modules', async function () {\n      writePackageJson('1.0.0', { private: true })\n      fs.writeFileSync('CHANGELOG.md', 'legacy header format<a name=\"1.0.0\">\\n', 'utf-8')\n\n      const flush = mock({ bump: 'minor' })\n      await exec('--prerelease')\n      const { stdout } = flush()\n      stdout.join('').should.not.include('--tag prerelease')\n    })\n  })\n})\n"
  },
  {
    "path": "test/mocks/VERSION-1.0.0.txt",
    "content": "1.0.0"
  },
  {
    "path": "test/mocks/VERSION-6.3.1.txt",
    "content": "6.3.1"
  },
  {
    "path": "test/mocks/manifest-6.3.1.json",
    "content": "{\n  \"version\": \"6.3.1\"\n}"
  },
  {
    "path": "test/mocks/mix.exs",
    "content": "defmodule StandardVersion.MixProject do\n  use Mix.Project\n\n  def project do\n    [\n      app: :standard_version,\n      version: \"0.1.0\",\n      elixir: \"~> 1.9\",\n      start_permanent: Mix.env() == :prod,\n      deps: deps()\n    ]\n  end\n\n  # Run \"mix help compile.app\" to learn about applications.\n  def application do\n    [\n      extra_applications: [:logger]\n    ]\n  end\n\n  # Run \"mix help deps\" to learn about dependencies.\n  defp deps do\n    [\n      # {:dep_from_hexpm, \"~> 0.3.0\"},\n      # {:dep_from_git, git: \"https://github.com/elixir-lang/my_dep.git\", tag: \"0.1.0\"}\n    ]\n  end\nend\n"
  },
  {
    "path": "test/mocks/updater/customer-updater.js",
    "content": "const REPLACER = /version: \"(.*)\"/\n\nmodule.exports.readVersion = function (contents) {\n  return REPLACER.exec(contents)[1]\n}\n\nmodule.exports.writeVersion = function (contents, version) {\n  return contents.replace(\n    REPLACER.exec(contents)[0],\n    `version: \"${version}\"`\n  )\n}\n"
  },
  {
    "path": "test/mocks/version.txt",
    "content": ""
  },
  {
    "path": "test/preset.spec.js",
    "content": "/* global describe it beforeEach, afterEach */\n\nconst shell = require('shelljs')\nconst fs = require('fs')\n\nrequire('chai').should()\n\nfunction exec (opt) {\n  const cli = require('../command')\n  opt = cli.parse(`standard-version ${opt} --silent`)\n  opt.skip = { commit: true, tag: true }\n  return require('../index')(opt)\n}\n\ndescribe('presets', () => {\n  beforeEach(function () {\n    shell.rm('-rf', 'tmp')\n    shell.config.silent = true\n    shell.mkdir('tmp')\n    shell.cd('tmp')\n    shell.exec('git init')\n    shell.exec('git config commit.gpgSign false')\n    shell.exec('git config core.autocrlf false')\n    shell.exec('git commit --allow-empty -m \"initial commit\"')\n    shell.exec('git commit --allow-empty -m \"feat: A feature commit.\"')\n    shell.exec('git commit --allow-empty -m \"perf: A performance change.\"')\n    shell.exec('git commit --allow-empty -m \"chore: A chore commit.\"')\n    shell.exec('git commit --allow-empty -m \"ci: A ci commit.\"')\n    shell.exec('git commit --allow-empty -m \"custom: A custom commit.\"')\n  })\n\n  afterEach(function () {\n    shell.cd('../')\n    shell.rm('-rf', 'tmp')\n  })\n\n  it('Conventional Commits (default)', async function () {\n    await exec()\n    const content = fs.readFileSync('CHANGELOG.md', 'utf-8')\n    content.should.contain('### Features')\n    content.should.not.contain('### Performance Improvements')\n    content.should.not.contain('### Custom')\n  })\n\n  it('Angular', async function () {\n    await exec('--preset angular')\n    const content = fs.readFileSync('CHANGELOG.md', 'utf-8')\n    content.should.contain('### Features')\n    content.should.contain('### Performance Improvements')\n    content.should.not.contain('### Custom')\n  })\n})\n"
  }
]