@rpidanny/semantic-release-update-package.json
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

semantic-release-update-package.json

codecov

semantic-release plugin that updates package.json with the new release version.

This tool is especially useful when using semantic-release-plus with mono-repo frameworks like nx.

Install

$ npm i --save-dev @rpidanny/semantic-release-update-package.json

Usage

The plugin can be configured in the semantic-release configuration file:

{
  "plugins": [
    "@semantic-release/commit-analyzer",
    "@semantic-release/release-notes-generator",
    [
      "@rpidanny/semantic-release-update-package.json",
      {
        "packageJsonPath": "./packages/core/package.json"
      }
    ]
  ]
}

With this example, for each release, the package.json at ./packages/core/package.json will be updated with the latest release version.

Configuration

Options

Options Description Type Required
packageJsonPath Path where the package.json is stored at. string true

Examples

When used with the @semantic-release/git plugins the @rpidanny/semantic-release-update-package.json plugin must be called first in order to update the package.json file so the @semantic-release/git plugin can include it in the release commit.

{
  "plugins": [
    "@semantic-release/commit-analyzer",
    "@semantic-release/release-notes-generator",
    [
      "@rpidanny/semantic-release-update-package.json",
      {
        "packageJsonPath": "./packages/core/package.json"
      }
    ],
    [
      "@semantic-release/npm",
      {
        "npmPublish": false
      }
    ],
    "@semantic-release/github",
    [
      "@semantic-release/git",
      {
        "assets": [
          "CHANGELOG",
          "package.json",
          "package-lock.json",
          "./packages/core/package.json"
        ],
        "message": "chore(release): ${nextRelease.version} [skip-ci]\n\n${nextRelease.notes}"
      }
    ]
  ]
}

Package Sidebar

Install

npm i @rpidanny/semantic-release-update-package.json

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

11.3 kB

Total Files

14

Last publish

Collaborators

  • mabhishek