Socket
Socket
Sign inDemoInstall

lerna

Package Overview
Dependencies
462
Maintainers
4
Versions
272
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    lerna

Lerna is a fast, modern build system for managing and publishing multiple JavaScript/TypeScript packages from the same repository


Version published
Weekly downloads
1.2M
decreased by-0.63%
Maintainers
4
Install size
120 MB
Created
Weekly downloads
 

Package description

What is lerna?

Lerna is a tool that optimizes the workflow around managing multi-package repositories with git and npm. It allows you to manage your project's dependencies, versioning, and publishing in a more organized manner, especially when dealing with a monorepo containing multiple packages.

What are lerna's main functionalities?

Bootstrap

Installs all of the dependencies for each package, links any cross-dependencies, and ensures that each package can find and use the correct versions of each other.

lerna bootstrap

Publish

Helps with versioning of the changes and publishing packages that have been updated to npm. It can automatically determine version bumps based on conventional commits, create git tags, and push releases to the repository.

lerna publish

Run

Runs an npm script in each package that contains that script. The '--scope' flag can be used to run the script only in specified packages.

lerna run --scope my-package test

Exec

Executes an arbitrary command in each of your packages. In this example, it removes the 'node_modules' directory from each package.

lerna exec -- rm -rf ./node_modules

List

Lists all of the public packages in the current Lerna repo.

lerna list

Changed

Lists public packages that have changed since the last tagged release.

lerna changed

Diff

Shows the diff since the last release for a single package or all packages.

lerna diff

Import

Imports an external repository into the 'packages' folder of your Lerna monorepo, preserving the commit history.

lerna import <path-to-external-repository>

Other packages similar to lerna

Changelog

Source

8.0.1 (2023-12-15)

Bug Fixes

  • update node-gyp usage to v10 to resolve npm warning (#3919) (f5fdcba)
  • version: create correct independent tags when using --sign-git-tag (#3917) (8f7a32b)

BREAKING CHANGES

After updating we strongly recommend running lerna repair in your project. This will migrate your lerna.json to the latest and greatest and remove any outdated options.

As this is a major release there are a few breaking changes to be aware of, which may or may not affect your lerna repos, depending on how you are using the tool.

  • node v16 support is dropped because it is end of life

When a node version becomes end of life (EOL) it means that it does not receive any updates or maintenance whatsoever, even if critical security vulnerabilities have been uncovered.

We strongly encourage all folks here to keep up with the maintenance LTS version of Node at an absolute minimum:

https://github.com/nodejs/release#release-schedule

  • lerna's task runner for lerna run now depends on nx v17 instead of v16

lerna run gets to benefit from all of the further performance improvements in the nx v17 task runner behind scenes.

  • @lerna/child-process is no longer a separately published package

Lerna is a monorepo management tool with versioning and publishing capabilities, it is not a child process manager. There are lots of good options out there in the ecosystem to help you with managing child processes in nodejs, and it does not really make sense to treat some of lerna's implementation details around child processes as if they were a public API. The package will be officially deprecated on npm in the future. You can of course take the code and fork it and adapt it for your own purposes if you wish!

  • Older packages under @lerna/ on npm have been officially marked as deprecated

Under prior stewardship the lerna repo used to publish a very large (>65) number of packages. The vast majority of these should not form part of the public API of lerna and so they have no longer been published as packages since v6. We have now officially marked them as deprecated packages on the npm registry so that users get clear feedback that they are using packages which are no longer maintained (which they can of course fork and do whatever they want with). NOTE: We have not yet marked @lerna/child-process as deprecated so as not to create noise for lerna v7 users until they have had chance to migrate to v8.

Features

  • version: add --premajor-version-bump option to force patch bumps for non-breaking changes in premajor packages (#3876) (3b05947)
  • version: use corepack for install when enabled (#3877) (a3cb7ca)

Readme

Source

Lerna

Lerna is a fast, modern build system for managing and publishing multiple JavaScript/TypeScript packages from the same repository.

NPM Status CI Status

Usage

Check out our docs site here.

Keywords

FAQs

Last updated on 23 Nov 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc