@lerna/publish

Publish packages in the current project

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
Last updated 6 years ago by evocateur .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install @lerna/publish 
SYNC missed versions from official npm registry.

@lerna/publish

Publish packages in the current project

Usage

lerna publish              # publish packages that have changed since the last release
lerna publish from-git     # explicitly publish packages tagged in the current commit
lerna publish from-package # explicitly publish packages where the latest version is not present in the registry

When run, this command does one of the following things:

  • Publish packages updated since the last release (calling lerna version behind the scenes).
    • This is the legacy behavior of lerna 2.x
  • Publish packages tagged in the current commit (from-git).
  • Publish packages in the latest commit where the version is not present in the registry (from-package).
  • Publish an unversioned "canary" release of packages (and their dependents) updated in the previous commit.

Lerna will never publish packages which are marked as private ("private": true in the package.json).

Check out Per-Package Configuration for more details about publishing scoped packages, custom registries, and custom dist-tags.

Positionals

bump from-git

In addition to the semver keywords supported by lerna version, lerna publish also supports the from-git keyword. This will identify packages tagged by lerna version and publish them to npm. This is useful in CI scenarios where you wish to manually increment versions, but have the package contents themselves consistently published by an automated process.

bump from-package

Similar to the from-git keyword except the list of packages to publish is determined by inspecting each package.json and determining if any package version is not present in the registry. Any versions not present in the registry will be published. This is useful when a previous lerna publish failed to publish all packages to the registry.

Options

lerna publish supports all of the options provided by lerna version in addition to the following:

--canary

lerna publish --canary
# 1.0.0 => 1.0.1-alpha.0+${SHA} of packages changed since the previous commit
# a subsequent canary publish will yield 1.0.1-alpha.1+${SHA}, etc

lerna publish --canary --preid beta
# 1.0.0 => 1.0.1-beta.0+${SHA}

# The following are equivalent:
lerna publish --canary minor
lerna publish --canary preminor
# 1.0.0 => 1.1.0-alpha.0+${SHA}

When run with this flag, lerna publish publishes packages in a more granular way (per commit). Before publishing to npm, it creates the new version tag by taking the current version, bumping it to the next minor version, adding the provided meta suffix (defaults to alpha) and appending the current git sha (ex: 1.0.0 becomes 1.1.0-alpha.81e3b443).

The intended use case for this flag is a per commit level release or nightly release.

--contents <dir>

Subdirectory to publish. Must apply to ALL packages, and MUST contain a package.json file. Package lifecycles will still be run in the original leaf directory. You should probably use one of those lifecycles (prepare, prepublishOnly, or prepack) to create the subdirectory and whatnot.

If you're into unnecessarily complicated publishing, this will give you joy.

lerna publish --contents dist
# publish the "dist" subfolder of every Lerna-managed leaf package

--dist-tag <tag>

lerna publish --dist-tag next

When run with this flag, lerna publish will publish to npm with the given npm dist-tag (defaults to latest).

This option can be used to publish a prerelease or beta version under a non-latest dist-tag, helping consumers avoid automatically upgrading to prerelease-quality code.

Note: the latest tag is the one that is used when a user runs npm install my-package. To install a different tag, a user can run npm install my-package@prerelease.

--no-git-reset

By default, lerna publish ensures any changes to the working tree have been reset.

To avoid this, pass --no-git-reset. This can be especially useful when used as part of a CI pipeline in conjunction with the --canary flag. For instance, the package.json version numbers which have been bumped may need to be used in subsequent CI pipeline steps (such as Docker builds).

lerna publish --no-git-reset

--no-verify-access

By default, lerna will verify the logged-in npm user's access to the packages about to be published. Passing this flag will disable that check.

If you are using a third-party registry that does not support npm access ls-packages, you will need to pass this flag (or set command.publish.verifyAccess to false in lerna.json).

Please use with caution

--registry <url>

When run with this flag, forwarded npm commands will use the specified registry for your package(s).

This is useful if you do not want to explicitly set up your registry configuration in all of your package.json files individually when e.g. using private registries.

--temp-tag

When passed, this flag will alter the default publish process by first publishing all changed packages to a temporary dist-tag (lerna-temp) and then moving the new version(s) to the dist-tag configured by --dist-tag (default latest).

This is not generally necessary, as Lerna will publish packages in topological order (all dependencies before dependents) by default.

--yes

lerna publish --canary --yes
# skips `Are you sure you want to publish the above changes?`

When run with this flag, lerna publish will skip all confirmation prompts. Useful in Continuous integration (CI) to automatically answer the publish confirmation prompt.

Deprecated Options

--skip-npm

Call lerna version directly, instead.

Per-Package Configuration

A leaf package can be configured with special publishConfig that in certain circumstances changes the behavior of lerna publish.

publishConfig.access

To publish packages with a scope (e.g., @mycompany/rocks), you must set access:

  "publishConfig": {
    "access": "public"
  }
  • If this field is set for a package without a scope, it will fail.

  • If you want your scoped package to remain private (i.e., "restricted"), there is no need to set this value.

    Note that this is not the same as setting "private": true in a leaf package; if the private field is set, that package will never be published under any circumstances.

publishConfig.registry

You can customize the registry on a per-package basis by setting registry:

  "publishConfig": {
    "registry": "http://my-awesome-registry.com/"
  }
  • Passing --registry applies globally, and in some cases isn't what you want.

publishConfig.tag

You can customize the dist-tag on a per-package basis by setting tag:

  "publishConfig": {
    "tag": "flippin-sweet"
  }
  • Passing --dist-tag will overwrite this value.
  • This value is always ignored when --canary is passed.

Current Tags

  • 6.6.2                                ...           latest (2 years ago)
  • 6.5.0                                ...           next (2 years ago)

147 Versions

  • 6.6.2 [deprecated]           ...           2 years ago
  • 6.6.1 [deprecated]           ...           2 years ago
  • 6.6.0 [deprecated]           ...           2 years ago
  • 6.5.1 [deprecated]           ...           2 years ago
  • 6.5.0 [deprecated]           ...           2 years ago
  • 6.5.0-alpha.2 [deprecated]           ...           2 years ago
  • 6.5.0-alpha.1 [deprecated]           ...           2 years ago
  • 6.5.0-alpha.0 [deprecated]           ...           2 years ago
  • 6.4.2-beta.0 [deprecated]           ...           2 years ago
  • 6.4.1 [deprecated]           ...           2 years ago
  • 6.4.0 [deprecated]           ...           2 years ago
  • 6.3.1-beta.8 [deprecated]           ...           2 years ago
  • 6.3.1-beta.6 [deprecated]           ...           2 years ago
  • 6.3.1-beta.5 [deprecated]           ...           2 years ago
  • 6.3.1-beta.4 [deprecated]           ...           2 years ago
  • 6.3.1-beta.3 [deprecated]           ...           2 years ago
  • 6.3.1-beta.2 [deprecated]           ...           2 years ago
  • 6.3.1-beta.1 [deprecated]           ...           2 years ago
  • 6.3.1-beta.0 [deprecated]           ...           2 years ago
  • 6.3.0 [deprecated]           ...           2 years ago
  • 6.2.0 [deprecated]           ...           2 years ago
  • 6.1.0 [deprecated]           ...           2 years ago
  • 6.0.3 [deprecated]           ...           2 years ago
  • 6.0.2 [deprecated]           ...           2 years ago
  • 6.0.1 [deprecated]           ...           2 years ago
  • 6.0.0 [deprecated]           ...           2 years ago
  • 6.0.0-alpha.2 [deprecated]           ...           2 years ago
  • 6.0.0-alpha.1 [deprecated]           ...           2 years ago
  • 5.6.2 [deprecated]           ...           2 years ago
  • 6.0.0-alpha.0 [deprecated]           ...           2 years ago
  • 5.6.1 [deprecated]           ...           2 years ago
  • 5.6.0 [deprecated]           ...           2 years ago
  • 5.5.4 [deprecated]           ...           2 years ago
  • 5.5.3 [deprecated]           ...           2 years ago
  • 5.5.2 [deprecated]           ...           2 years ago
  • 5.5.1 [deprecated]           ...           2 years ago
  • 5.5.0 [deprecated]           ...           2 years ago
  • 5.4.3 [deprecated]           ...           2 years ago
  • 5.4.2 [deprecated]           ...           2 years ago
  • 5.4.1 [deprecated]           ...           2 years ago
  • 5.4.0 [deprecated]           ...           2 years ago
  • 5.3.0 [deprecated]           ...           2 years ago
  • 5.2.0 [deprecated]           ...           2 years ago
  • 5.1.8 [deprecated]           ...           2 years ago
  • 5.1.7 [deprecated]           ...           2 years ago
  • 5.1.6 [deprecated]           ...           3 years ago
  • 5.1.5 [deprecated]           ...           3 years ago
  • 5.1.4 [deprecated]           ...           3 years ago
  • 5.1.3 [deprecated]           ...           3 years ago
  • 5.1.2 [deprecated]           ...           3 years ago
  • 5.1.1 [deprecated]           ...           3 years ago
  • 5.1.0 [deprecated]           ...           3 years ago
  • 5.1.0-alpha.0 [deprecated]           ...           3 years ago
  • 5.0.0 [deprecated]           ...           3 years ago
  • 5.0.0-alpha.2 [deprecated]           ...           3 years ago
  • 5.0.0-alpha.1 [deprecated]           ...           3 years ago
  • 5.0.0-alpha.0 [deprecated]           ...           3 years ago
  • 4.0.0 [deprecated]           ...           4 years ago
  • 3.22.1 [deprecated]           ...           5 years ago
  • 3.22.0 [deprecated]           ...           5 years ago
  • 3.21.0 [deprecated]           ...           5 years ago
  • 3.20.2 [deprecated]           ...           5 years ago
  • 3.20.1 [deprecated]           ...           5 years ago
  • 3.20.0 [deprecated]           ...           5 years ago
  • 3.18.5 [deprecated]           ...           5 years ago
  • 3.18.4 [deprecated]           ...           5 years ago
  • 3.18.3 [deprecated]           ...           5 years ago
  • 3.18.2 [deprecated]           ...           5 years ago
  • 3.18.1 [deprecated]           ...           5 years ago
  • 3.18.0 [deprecated]           ...           5 years ago
  • 3.16.5 [deprecated]           ...           5 years ago
  • 3.16.4 [deprecated]           ...           5 years ago
  • 3.16.3 [deprecated]           ...           5 years ago
  • 3.16.2 [deprecated]           ...           5 years ago
  • 3.16.1 [deprecated]           ...           5 years ago
  • 3.16.0 [deprecated]           ...           5 years ago
  • 3.15.0 [deprecated]           ...           6 years ago
  • 3.14.2 [deprecated]           ...           6 years ago
  • 3.14.1 [deprecated]           ...           6 years ago
  • 3.14.0 [deprecated]           ...           6 years ago
  • 3.13.4 [deprecated]           ...           6 years ago
  • 3.13.3 [deprecated]           ...           6 years ago
  • 3.13.2 [deprecated]           ...           6 years ago
  • 3.13.1 [deprecated]           ...           6 years ago
  • 3.13.0 [deprecated]           ...           6 years ago
  • 3.12.1 [deprecated]           ...           6 years ago
  • 3.12.0 [deprecated]           ...           6 years ago
  • 3.11.1 [deprecated]           ...           6 years ago
  • 3.11.0 [deprecated]           ...           6 years ago
  • 3.10.8 [deprecated]           ...           6 years ago
  • 3.10.7 [deprecated]           ...           6 years ago
  • 3.10.6 [deprecated]           ...           6 years ago
  • 3.10.5 [deprecated]           ...           6 years ago
  • 3.10.3 [deprecated]           ...           6 years ago
  • 3.10.1 [deprecated]           ...           6 years ago
  • 3.10.0 [deprecated]           ...           6 years ago
  • 3.9.0 [deprecated]           ...           6 years ago
  • 3.8.5 [deprecated]           ...           6 years ago
  • 3.8.4 [deprecated]           ...           6 years ago
  • 3.8.2 [deprecated]           ...           6 years ago
  • 3.8.1 [deprecated]           ...           6 years ago
  • 3.8.0 [deprecated]           ...           6 years ago
  • 3.7.2 [deprecated]           ...           6 years ago
  • 3.7.1 [deprecated]           ...           6 years ago
  • 3.7.0 [deprecated]           ...           6 years ago
  • 3.6.0 [deprecated]           ...           6 years ago
  • 3.5.1 [deprecated]           ...           6 years ago
  • 3.5.0 [deprecated]           ...           6 years ago
  • 3.4.3 [deprecated]           ...           6 years ago
  • 3.4.2 [deprecated]           ...           6 years ago
  • 3.4.1 [deprecated]           ...           6 years ago
  • 3.4.0 [deprecated]           ...           6 years ago
  • 3.3.2 [deprecated]           ...           6 years ago
  • 3.3.1 [deprecated]           ...           6 years ago
  • 3.3.0 [deprecated]           ...           6 years ago
  • 3.2.1 [deprecated]           ...           6 years ago
  • 3.2.0 [deprecated]           ...           6 years ago
  • 3.1.3 [deprecated]           ...           6 years ago
  • 3.1.2 [deprecated]           ...           6 years ago
  • 3.1.0 [deprecated]           ...           6 years ago
  • 3.0.6 [deprecated]           ...           6 years ago
  • 3.0.5 [deprecated]           ...           6 years ago
  • 3.0.4 [deprecated]           ...           6 years ago
  • 3.0.3 [deprecated]           ...           6 years ago
  • 3.0.2 [deprecated]           ...           6 years ago
  • 3.0.1 [deprecated]           ...           6 years ago
  • 3.0.0 [deprecated]           ...           6 years ago
  • 3.0.0-rc.0 [deprecated]           ...           6 years ago
  • 3.0.0-beta.21 [deprecated]           ...           7 years ago
  • 3.0.0-beta.20 [deprecated]           ...           7 years ago
  • 3.0.0-beta.19 [deprecated]           ...           7 years ago
  • 3.0.0-beta.18 [deprecated]           ...           7 years ago
  • 3.0.0-beta.17 [deprecated]           ...           7 years ago
  • 3.0.0-beta.15 [deprecated]           ...           7 years ago
  • 3.0.0-beta.14 [deprecated]           ...           7 years ago
  • 3.0.0-beta.13 [deprecated]           ...           7 years ago
  • 3.0.0-beta.12 [deprecated]           ...           7 years ago
  • 3.0.0-beta.11 [deprecated]           ...           7 years ago
  • 3.0.0-beta.10 [deprecated]           ...           7 years ago
  • 3.0.0-beta.9 [deprecated]           ...           7 years ago
  • 3.0.0-beta.8 [deprecated]           ...           7 years ago
  • 3.0.0-beta.7 [deprecated]           ...           7 years ago
  • 3.0.0-beta.4 [deprecated]           ...           7 years ago
  • 3.0.0-beta.3 [deprecated]           ...           7 years ago
  • 3.0.0-beta.2 [deprecated]           ...           7 years ago
  • 3.0.0-beta.1 [deprecated]           ...           7 years ago
  • 3.0.0-beta.0 [deprecated]           ...           7 years ago
Maintainers (2)
Downloads
Total 2
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dev Dependencies (0)
None

© 2010 - cnpmjs.org x YWFE | Home | YWFE