semantic-release-npm-deprecate
TypeScript icon, indicating that this package has built-in type declarations

1.0.34 • Public • Published

Semantic Release NPM Deprecate Plugin

npm Build Release codecov GitHub contributors semantic-release

The semantic-release-npm-deprecate plugin provides functionality to mark NPM releases as deprecated.

Read more about Semantic Release.

Install

$ npm install -D semantic-release-npm-deprecate

Basic Usage

The following example will mark all previous major versions as deprecated. That is, if the next release is 2.3.4, all versions < 2 will be marked as deprecated.

{
  "plugins": [
    "@semantic-release/commit-analyzer",
    "@semantic-release/npm",
    [
      "semantic-release-npm-deprecate",
      {
        "deprecations": [
          {
            "version": "< ${nextRelease.version.split('.')[0]}",
            "message": "Please use ^${nextRelease.version.split('.')[0]}.0.0."
          }
        ]
      }
    ]
  ]
}

This plugin runs in the publish lifecycle.

Configuration Options

  • deprecations: An array containing objects with the following properties:
    • version: A version range that will be deprecated.
    • message: A message that will be added to the release notes.

This plugin will also check for configuration in the package.json file under the deprecations field. This is experimental and the field name may change in the future.

NPM

Configuration for NPM registry, token, etc matches that of @semantic-release/npm.

Templates

The version and message fields support Lodash templates and are passed the Context object. The following example uses the nextRelease object to get the next release version and split off the major version.

{
  version: "< ${nextRelease.version.split('.')[0]}";
}

See https://semver.npmjs.com/ for all supported version ranges.

Package Sidebar

Install

npm i semantic-release-npm-deprecate

Weekly Downloads

8

Version

1.0.34

License

Apache-2.0

Unpacked Size

37.2 kB

Total Files

7

Last publish

Collaborators

  • google-wombot