Gathering detailed insights and metrics for @lerna-lite/filter-packages
Gathering detailed insights and metrics for @lerna-lite/filter-packages
Gathering detailed insights and metrics for @lerna-lite/filter-packages
Gathering detailed insights and metrics for @lerna-lite/filter-packages
Subset of Lerna in a smaller & more modular project. Help manage and publish multiple packages in a monorepo/workspace structure
npm install @lerna-lite/filter-packages
Typescript
Module System
Min. Node Version
Node Version
NPM Version
TypeScript (99.67%)
JavaScript (0.33%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
528 Stars
2,011 Commits
39 Forks
7 Watchers
4 Branches
29 Contributors
Updated on Jul 11, 2025
Latest Version
3.9.3
Package Id
@lerna-lite/filter-packages@3.9.3
Unpacked Size
14.95 kB
Size
5.20 kB
File Count
15
NPM Version
lerna/3.9.3/node@v20.17.0+x64 (linux)
Node Version
20.17.0
Published on
Oct 08, 2024
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
3
lerna.json
config fileClick on any command below to see documentation of all available options
init
- creates a new Lerna-Lite workspace structure and adds lerna.json
npm i @lerna-lite/changed -D
npm i @lerna-lite/diff -D
npm i @lerna-lite/exec -D
npm i @lerna-lite/list -D
npm i @lerna-lite/publish -D
npm i @lerna-lite/version -D
npm i @lerna-lite/run -D
npm i @lerna-lite/watch -D
Note since the
publish
package depends on theversion
package, you could simply install@lerna-lite/publish
to automatically get access to both commands.
workspace:
protocol and pnpm catalog:
protocolTake 30sec. to complete this 1 question poll survey 🔘 if you are using this feature. It's a simple poll to find out which package manager is the most popular with workspace:
protocol (so far, about 60% pnpm and 40% yarn).
Lerna-Lite itself is also using both pnpm catalogs and pnpm workspaces 🎉
Here are some of the largest projects using Lerna-Lite
Lerna-Lite differs from the original Lerna, the latter now install & require Nx (which is large) and it has 15 buit-in commands. Lerna-Lite, on the other hand doesn't require Nx and only has a limited subset of the original commands (9 out of 15 commands) and they are all optional in Lerna-Lite making its install footprint a lot smaller. Lerna was originally built as an all-in-one tool, however nowadays, Workspaces are available in all package managers and the need for an all-in-one tool, which includes built-in workspaces functionalities (like bootstrap
), is no longer necessary. Lerna-Lite is built around this new reality and is only providing commands that package managers do not yet provide or are less efficient. To summarize, Lerna-Lite is much more modular than the original Lerna and you'll end up installing a lot less dependencies while also making it more versatile to use with other tools like TurboRepo, pnpm and others...
Lerna-Lite assumes, and requires that you pre-setup your Workspace through your favorite package manager (npm, pnpm, yarn) that will take care of the symlinks. Lerna-Lite does not include Lerna's bootstrap
, add
, create
or link
commands hence the need for you to properly set up your workspace prior to installing Lerna-Lite.
According to your needs, choose the best option to set up a workspace: npm 7+ | Yarn classic | Yarn 2+ | pnpm
Below are the main reasons as to why this fork was created:
Nx
specific changes, which are ignored)Nx
then it's probably better to use Lerna, otherwise Lerna-Lite is a better alternativecatalog:
protocol support for both version
and publish
commands (new)workspace:
protocol support
package.json
before publishing)
scripts
or devDependencies
independent
workspace:
protocol)On a final note, I think that the best feature of Lerna-Lite (versus Lerna) must be its modularity. A large portion of the users are only interested in version/publish commands, but on the other hand, a small minority might want other commands like lerna run
/exec
. Lerna-Lite offers this kind of flexibility by allowing the user to choose what to install (see installation below) which help to keep your download to the bare minimum.
Note all commands are optional in Lerna-Lite, refer to the Available Commands table for more info
independent
or fixed
version) of all your workspace packages.
1[](https://github.com/lerna-lite/lerna-lite)
Let's start by installing Lerna-Lite CLI as a dev dependency to your project and then run the init
command to get started (see init#readme for all options). Note that the CLI must be installed at all time, then proceed by installing any other optional commands (the CLI is only including the init
command), refer to the Available Commands table for more info.
1# install Lerna-Lite CLI locally or globally (`init` is the only command installed) 2$ npm install -g @lerna-lite/cli # pnpm add -g @lerna-lite/cli 3 4# create your monorepo and initialize lerna-lite 5$ mkdir lerna-repo 6$ cd lerna-repo 7$ npx lerna init # OR pnpm exec lerna init 8 9# for npm/yarn (only) workspaces add --use-workspaces 10$ npx lerna init --use-workspaces
This will create a lerna.json
configuration file as well as a packages
folder, so your folder should now look like this:
lerna-repo/
packages/
package-a
package.json
lerna.json
Note Lerna-Lite now supports 3 file extension types (.json
, .jsonc
and .json5
), however please note that not all code editors support JSON Schema with .json5
, so lerna.json
might still be the preferred file extension (all formats support inline comments, even .json
).
Note that package-a
show above will not be created, it is only shown here to help clarify the structure. For more info and full details about the lerna.json
file, please read the lerna.json Wiki. Also note that you can optionally add comments to your lerna.json
config file since it is also able to parse JSON5 file format.
The final step will be to install the commands that are of interest to you (publish
, version
, run
, exec
, ...)
1$ npm i @lerna-lite/publish -D
Lerna allows you to manage your project using one of two modes: Fixed or Independent.
Fixed mode Lerna projects operate on a single version line. The version is kept in the lerna.json
file at the root of your project under the version
key. When you run lerna publish
, if a module has been updated since the last time a release was made, it will be updated to the new version you're releasing. This means that you only publish a new version of a package when you need to.
Note: If you have a major version zero, all updates are considered breaking. Because of that, running
lerna publish
with a major version zero and choosing any non-prerelease version number will cause new versions to be published for all packages, even if not all packages have changed since the last release.
This is the mode that Jest) is currently using. Use this if you want to automatically tie all package versions together. One issue with this approach is that a major change in any package will result in all packages having a new major version.
lerna init --independent
Independent mode Lerna projects allows maintainers to increment package versions independently of each other. Each time you publish, you will get a prompt for each package that has changed to specify if it's a patch, minor, major or custom change.
Independent mode allows you to more specifically update versions for each package and makes sense for a group of components. Combining this mode with something like semantic-release would make it less painful. (There is work on this already at atlassian/lerna-semantic-release).
Set the
version
key inlerna.json
toindependent
to run in independent mode.
Lerna-Lite is entirely modular, as opposed to Lerna, and installing the CLI locally or globally will only provide you the
init
command. Please make sure to install other commands that you are interested in (see table below).
If you are new to Lerna-Lite, you could also run the lerna init command, which will create the lerna.json
for you with a minimal structure setup. If you are using a client other than npm, then make sure to update the npmClient
property in lerna.json
(for example: "npmClient": "yarn"
or "pnpm"
).
Note please make sure that you have a
lerna.json
config file in your project root and in it aversion
property defined with either a fixed orindependent
mode. Otherwise, an error will be thrown if you're missing any of them.
The basic usage is to add either custom NPM scripts or simply run the commands in your shell with the Lerna-Lite CLI. See below for basic Lerna npm script samples.
1// package.json / npm scripts 2"scripts": { 3 "new-version": "lerna version", 4 "new-publish": "lerna publish from-package", 5 "preview:new-version": "lerna version --dry-run", 6 "run-tests": "lerna run test", 7}
You can add the $schema
property into your lerna.json
to take advantage of Lerna-Lite JSON Schema (lerna init
can help to set it up for you). This will help with the developer experience, users will be able to see what properties are valid with their types and a brief description of what each option does (descriptions are pulled from their associated lerna command options documentation).
lerna.json
1{ 2 "$schema": "node_modules/@lerna-lite/cli/schemas/lerna-schema.json", 3 // ... 4 5 // or from GitHub CDN 6 "$schema": "https://raw.githubusercontent.com/lerna-lite/lerna-lite/main/packages/cli/schemas/lerna-schema.json", 7}
Note JSON Schema might not be well supported by all code editors with
.json5
, uselerna.json
if that is a problem for you.
Click on any command below to see documentation of all available options
Command | Install | Description |
---|---|---|
☁️ publish | npm i @lerna-lite/publish -D | publish each workspace package |
📑 version | npm i @lerna-lite/version -D | create new version for each workspace package |
🕜 changed | npm i @lerna-lite/changed -D | list local packages changed since last release |
🌓 diff | npm i @lerna-lite/diff -D | git diff all packages since the last release |
👷 exec | npm i @lerna-lite/exec -D | execute an command in each workspace package |
📖 list | npm i @lerna-lite/list -D | list local packages |
🏃 run | npm i @lerna-lite/run -D | run npm script in each workspace package |
👓 watch | npm i @lerna-lite/watch -D | watch for changes & execute commands when fired |
Note since the
publish
package depends on theversion
package, you could simply install@lerna-lite/publish
to automatically gain access to both commands.
Migrating from the original Lerna, should be fairly easy since you simply need to replace your Lerna dependency with Lerna-Lite @lerna-lite/cli
, and also install the command(s) that you are interested in and that's about it. The CLI commands and options are nearly identical. The biggest difference compared to Lerna is that you need to manually choose and install the commands that you are interested in, as shown below:
Note as opposed to Lerna v7 and higher, the
useWorkspace
is not enabled by default in Lerna-Lite and we still recommend to use eitheruseWorkspaces
for Yarn/NPM or use the defaultpackages
inlerna.json
for pnpm users. TheuseWorkspaces
has some drawback since some of the packages could be unrelated to the project releases (ie: website, examples) and for this use case thepackages/*
defined inlerna.json
is a better approach (i.e. Jest uses this approach).
1npm uninstall lerna # OR yarn remove lerna -W 2npm uninstall -g lerna # OR yarn global remove lerna
init
command1# Lerna CLI (only includes `init`) 2npm install @lerna-lite/cli -D
changed
, diff
, exec
, list
, run
, publish
, version
and/or watch
)
refer to Available Commands table above1# for example, let's install publish (note publish will automatically provide you the `version` command since it's a dependency) 2npm install @lerna-lite/publish -D
lerna.json
config file and remove any unrelated old command options, for example bootstrap
does not exist in Lerna-Lite so there's no need to keep that config1{ 2 "npmClient": "yarn", 3 "command": { 4 "version": { 5 "conventionalCommits": true 6 }, 7- "bootstrap": { 8- "npmClientArgs": ["--no-package-lock"] 9- } 10 } 11}
Note after switching to Lerna-Lite and publishing your next release with conventional-changelog, you will probably see a lot of diff changes across your
changelog.md
files, a lot of empty lines will be deleted, and that is totally expected since Lerna-Lite has code in place to remove these unnecessary empty lines.
You want to see a project demo? Sure... you're looking at it 😉
Yes indeed, this project was originally created as an NPM Workspace and later migrated to a pnpm workspaces for the sole purpose of demoing and testing its own code. All changelogs and versions are created and published by the lib itself, how sweet is that? You can also see that this project has its own lerna.json
config file as well to run properly (take a look to see how it works).
You can see a small video of a new version release on this Release Demo - Wiki to demonstrate its usage. Are you confused with all these options? Perhaps taking a look at some of the references shown below might help you get started.
Contributions are very well encouraged. Also please note that the original code was created by much smarter persons than myself and so my knowledge of the project might still lack in some areas of the project. The main goal of this fork was mainly to make it more modular and keep dependencies up to date (Renovate was put in place and is running frequently).
To contribute to the project, please follow the steps shown in the Contributing Guide
If you have problems running the project and your problems are related to Git commands that were executed, we then suggest to first try with the --dry-run
option to see if it helps in finding the error(s) that you may have. Another great, and possibly much more useful suggestion, is to search in the original Lerna issues list and see if any solution could help you (remember that Lerna-Lite is a fork of the original code from Lerna and it works the same way). Lastly, if that is not enough and you wish to troubleshoot yourself, then read this Troubleshooting - Wiki to possibly troubleshoot yourself the execution in your own environment.
Package Name | Version | NPM Downloads | Description | Changes |
---|---|---|---|---|
@lerna-lite/cli | Lerna-Lite CLI | changelog | ||
@lerna-lite/core | Lerna-Lite core functions | changelog | ||
@lerna-lite/init | Lerna-Lite setup | changelog | ||
@lerna-lite/publish | Publish workspace packages | changelog | ||
@lerna-lite/version | Bump Version & Changelogs | changelog | ||
@lerna-lite/exec | Execute shell commands in repo | changelog | ||
@lerna-lite/changed | List changes since last release | changelog | ||
@lerna-lite/diff | Diff changes since last release | changelog | ||
@lerna-lite/list | List local packages | changelog | ||
@lerna-lite/listable | Listable utils for list , changed | changelog | ||
@lerna-lite/npmlog | inline version of npmlog util | changelog | ||
@lerna-lite/profiler | internal profiler | changelog | ||
@lerna-lite/run | Run npm scripts in workspace | changelog | ||
@lerna-lite/watch | Watch changes in workspace | changelog |
Thanks to all my sponsors!
No vulnerabilities found.
No security vulnerabilities found.