@lerna/legacy-package-management
This package contains the legacy lerna add
, lerna bootstrap
and lerna link
commands which deal with things better handled by your package manager npm
/yarn
/pnpm
.
This package can be thought of as being in maintenance mode only - no new features will be considered for legacy package management concerns, and we will only look to merge critical patches and security updates.
See below for full context as to why this exists.
Background
Lerna is the original monorepo/workspace tool in the JavaScript ecosystem. When it was created in 2015/2016 the ecosystem looked totally different, and there were no built in capabilities to handle working with multiple packages in a single repository (a "workspace"). Commands like lerna bootstrap
, lerna add
and lerna link
were all a critical part of the lerna project, because there were no other options.
However, now that we find ourselves in 2023, the fact is that - for many years now - the package managers we know and love (npm
, yarn
and pnpm
) all fully support that concept of workspaces as a first-class use-case.
They have battle tested implementations covering adding, removing and linking local packages, and combining them with third party dependencies in a natural way.
This is the reason why, for the past several years of his tenure as lead maintainer of Lerna @evocateur has been encouraging folks to strongly reconsider their use of the legacy package management commands in lerna, and instead leverage their package manager of choice to do what it does best.
We on the Nx Team knew about this context from afar, but as new stewards of the project we did not want to jump straight in and start removing capabilities without first taking the time to get familiar with the reality up close. Now that we have been actively maintaining the project for half a year, we are in full agreement with Daniel and others that the legacy package management commands in lerna need to be retired.
By removing these legacy pieces which have better alternatives natively in package managers, we and the rest of the lerna community will be freed up to concentrate our efforts on things which are uniquely valuable about lerna (such as, but not limited to, versioning and publishing), and making them the best they can be!
We of course want to make sure that folks who are perhaps less aware of the modern capabilities of their package manager are not left confused by this change, so we will be building out comprehensive migration guides on https://lerna.js.org to help them transition their thinking from a legacy lerna command to its equivalent for npm
, yarn
or pnpm
.
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)