CodeVetter · Repo Unpack · Data flow
lerna/lerna
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.
- Run's argument builder converts comma-separated script input into an array and preserves -- arguments; Command merges CLI values before command-specific config, global lerna config, and environment defaults.
- Project searches lerna.json/package.json, applies extends, and derives its root from the resolved configuration; package globs come from explicit config, pnpm-workspace.yaml, or root workspaces.
- detectProjects obtains the Nx graph and file map, then createProjectGraphWithPackages matches configured roots, reads manifests, attaches Package instances, and sorts nodes by root.
- Graph enrichment resolves manifest dependency specs, records collection and resolution metadata, and includes local dependencies only when workspace protocol, directory location, or version requirements match.
- filterProjects applies private/scope/ignore selection, optionally intersects Git-derived updates, then expands dependents and dependencies; update detection uses git diff paths and ignoreChanges predicates.
- Run maps selected project names and targets into runOne/runMany, forwarding output style, concurrency, cache/bail/cycle options, argument overrides, and loadDotEnvFiles, which defaults to true.
- Version refreshes manifests after preversion hooks, mutates versions/dependencies, serializes packages and lockfiles, and writes fixed-mode lerna.json; writePackage sorts dependency keys and preserves detected indentation.
- Packing converts Arborist/npm-packlist output into a temporary tarball; npmPublish reads that archive and prepared manifest, merges publishConfig, attempts OIDC authentication, and submits through libnpmpublish with OTP handling.