CodeVetter
← All unpacks
CodeVetter · Repo Unpack evidence

lerna/lerna

Scanned commit ce3e38f288 dated 2026-10-02 — last upstream commit. Generated by codevetter 1.15.0 on 2026-10-02.

github.com/lerna/lerna ↗ · 1479 files · 3.7 MB

Important note: this project changed stewardship to Nx!

Deep analysis by cli:codex via the codex CLI on 2026-10-02 (417s) — every claim below links to its cited source files. Source inspection; upstream code and tests were not executed.

Overview

Lerna is a Node.js CLI for teams managing and publishing multiple JavaScript or TypeScript packages in one repository. It combines Nx project discovery and task execution with package-aware change detection, coordinated versioning, npm publishing, and GitHub/GitLab releases. This pinned revision publishes an ESM package while preserving selected CommonJS entrypoint contracts; its React website is a separate Docusaurus documentation surface.

System map

The product runtime is a Node CLI assembled from command libraries and shared core utilities. Nx supplies project graphs and the default task runner, while Lerna owns package metadata and release coordination. Persistent state consists primarily of workspace files, Git state, and registry artifacts. The npm package and documentation website have separate build and deployment paths.

Feature catalog

The registered CLI covers workspace setup, package inspection, task execution, cleanup, importing history, and releases. Shared filtering supports package scopes, exclusions, changed-package selection, and dependency expansion where commands expose those options. Versioning and publishing have distinct modes and side effects. Legacy package-management names remain registered only to explain their removal.

Data flow

Inputs enter through yargs, workspace configuration, package manifests, Git history, and registry responses. Project and Command establish effective options before Nx graph nodes acquire Package objects and dependency metadata. Task flows produce process output and exit codes; release flows mutate workspace files and transmit packed artifacts. Authentication state is passed through in-memory publish options and configuration.

Behavior traces

Source inspection followed startup, task execution, and version persistence through their concrete functions and branches. Publishing was also traced from selection through archive upload and cleanup. These are execution-order descriptions inferred directly from source, not observed runtime traces. Early returns and configuration switches materially change the work performed.

Testing signals

Tests and CI were inspected, not executed; no passing result or coverage percentage is established. Vitest supplies shared Node-environment configuration for unit, integration, and e2e projects. Inspected suites mix mocked command boundaries with actual CLI and local-registry scenarios. The inventory is bounded, and mock coverage does not establish live service correctness.

Risk map

These are source observations and explicitly labeled hypotheses, not confirmed vulnerabilities. Lerna intentionally executes workspace-controlled commands and writes release artifacts, so trust boundaries include configuration, scripts, Git, and registries. Release operations span several independent systems and are not presented as one atomic transaction. Inspection also found narrow authentication tests and strong coupling to Nx internals.

Extension points

Extension mechanisms are explicit command registration, shared command hooks, configuration, Nx task definitions, and migration metadata. Publishing accepts configurable artifact directories and assets, while conventional-commit processing loads presets. Hosted release providers share an adapter-shaped API. Public package entrypoints and build lists must stay aligned with implementation changes.

Contributor handoff

Tests and CI were inspected, not executed, and this brief provides bounded onboarding evidence rather than exhaustive coverage. Begin with contributor guidance, but resolve drift against manifests and executable source. Keep implementation, argument builders, public wrappers, and build entrypoints consistent. Release and e2e commands have material filesystem, process, Git, and registry side effects.

Languages

LanguageFilesShare of source
JSON652docs/config
TypeScript59192%
Markdown73docs/config
JavaScript325%
YAML16docs/config
Shell152%
CSS12docs/config
TOML10%

Start reading here

Probable source entrypoint: packages/ — inferred from the directory tree and manifest, not the upstream docs.

Source roots

packages/ (87 files)

Repository structure

Top-level pathFiles
libs/868
e2e/164
__fixtures__/164
packages/87
integration/74
website/70
.github/16
tools/10

Docs found: AGENTS.mdCLAUDE.mdCONTRIBUTING.mdREADME.md

Package

package.json — lerna-monorepo, 36 declared dependencies.

@nx/devkit@nx/esbuild@nx/js@nx/oxlint@nx/plugin@nx/vite@nx/vitest@nx/web@types/columnify@types/envinfo@types/fs-extra@types/libnpmpublish

CI & config entrypoints

Structural health signals

Average score 8.5/10 across 96 analyzed source files; 4 hotspots surfaced.

These are deterministic review leads — size, churn, and structural signals — not proof of a bug in this project.

Recent history