Giter VIP home page Giter VIP logo

semantic-release-lerna's Introduction

semantic-release-lerna

semantic-release plugin to publish lerna managed npm packages to npm.

This is WORK-IN-PROGRESS so there will most likely be bugs and it as only really been tested under the narrow use-cases I myself need it for.

It is intended to be a drop-in replacement of the @semantic-release/npm plugin.

The plugin works in the following way:

  • You manage a monorepo using lerna.
  • You use semantic-release to automate release handling.
  • The plugin will use lerna to check which packages has been updated.
  • Package versions are latched (default latching minor and greater), i.e. patches are only published for changed packages but minor and major bumps for all packages. Use latch option to configure this.
  • Changelog is generated in the project root by semantic-release.

As of now the following features from @semantic-release/npm is not supported/implemented:

  • addChannel.
  • tarball.
  • Only rudimentary support for configuration options.
  • Only rudimentary support for authentication verification.
  • Only rudimentary support for private packages.
Step Description
generateNotes If the plugin option generateNotes is true this plugin generate release notes with the commit scope set to a list of affected packages (unless otherwise specificed by the commit message). This option replaces @semantic-release/release-notes-generator, do not use both at the same time.
prepare Update the package.json version and create the npm package tarball.
publish Publish the npm package to the registry.

Dependencies

If a package version is bumped all the packages depending (dependencies, devDependencies and peerDependencies) on it will also have the range updated if the range has one of the following formats:

  • 1.2.3
  • ^1.2.3
  • ^1.2
  • ^1

Install

$ npm install semantic-release-lerna -D

Usage

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

{
  "plugins": [
    "@semantic-release/commit-analyzer",
    ["semantic-release-lerna", { "generateNotes": true }],
    "@semantic-release/changelog",
    [
      "@semantic-release/git",
      {
        "assets": [
          "CHANGELOG.md",
          "lerna.json",
          "package.json",
          "package-lock.json",
          "packages/*/package.json",
          "packages/*/package-lock.json"
        ]
      }
    ]
  ]
}

To use legacy auth set NPM_USERNAME, NPM_PASSWORD and NPM_EMAIL.

Options

Option Description Default
npmVerifyAuth Set to false to disable verifying NPM registry credentials. true
latch Latches package versions together. If the version bump is at least the given version all packages will be bumped regardless if the package has been touched or not. "major", "minor", "patch", "none" "minor"
rootVersion Allow to update version on root package.json. true

Troubleshooting

Working tree has uncommitted changes

lerna ERR! EUNCOMMIT Working tree has uncommitted changes, please commit or remove the following changes before continuing:

Configure @semantic-release/git to commit lerna.json and package.json from the package folders. See example configuration above.

semantic-release-lerna's People

Contributors

borisdamevin avatar ext avatar renovate-bot avatar renovate[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.