Skip to content

build: pin lerna 10 instead of inheriting it transitively - #627

Merged
aversini merged 1 commit into
mainfrom
build/pin-lerna-explicitly
Aug 2, 2026
Merged

aversini merged 1 commit into
mainfrom
build/pin-lerna-explicitly

Conversation

@aversini

@aversini aversini commented Aug 2, 2026 •

Copy link
Copy Markdown
Collaborator

What

Pin lerna explicitly at 10.0.0 instead of inheriting 9.0.7 transitively.

Why

lerna is not declared in this repo. It arrives as a transitive dependency of @versini/dev-dependencies-common and is reachable only because shamefullyHoist lifts it to the root.

So the lerna running lerna run build/lint/test here, and lerna publish from-package in CI, is versioned by a shared config-preset package this repo never asked for a build tool from.

Changes

  • package.json — add "lerna": "10.0.0" to devDependencies
  • pnpm-lock.yaml — regenerated

Why 10 directly, rather than pinning the inherited 9.0.7 first

lerna 10's publish path is already proven in this fleet. The dev-dependencies release job has no install step, so its npx lerna fetches the latest from the registry — which means @versini/dev-dependencies-{common,client} 13.0.2/14.0.2 (Jul 30) and 13.0.3/14.0.3 (Jul 31) were published by lerna 10.0.0 on Node 22.x, using the same publish from-package --no-push --no-private --yes invocation used here.

None of lerna 10's breaking changes apply:

Breaking change Applies here?
EBEHIND now throws in CI No — gated behind requiresGit (false for from-package) and pushToRemote (false under --no-push)
conventional-changelog rewrite No — only affects lerna version, unused
ESM-only No — nothing imports lerna programmatically
Node floor → 22.13 No — every runner is on 22.x (resolves to latest 22) or 24.x

⚠️ There is no engine-strict anywhere, so a local machine on Node 22.0–22.12 would fail at runtime rather than at install.

Lockfile impact

Unlike a 9.0.7 pin, this is not a no-op: roughly 45 packages added, almost all of it nx 22.7.x → 23.1.1 with its platform binaries, plus the new conventional-changelog stack. Nothing is removed — dev-dependencies-common still depends on lerna 9.0.7, so both majors sit in the tree until lerna is dropped from that package.

node_modules/.bin/lerna resolves to 10.0.0, and pnpm links nx 23.1.1 inside the lerna@10 instance regardless of which nx wins the root hoist.

Verification

  • npx --no-install lerna --version → 10.0.0 (--no-install proves local resolution, not a registry fetch)
  • pnpm build — 14 projects ✅
  • pnpm test — 12 projects, 75 tests ✅

lerna run is the surface nx 23 actually changes, so those runs are the check that matters here.

Notes

Part of decoupling lerna from @versini/dev-dependencies-common. Once lerna is dropped there, lerna 9 and nx 22 leave this tree entirely, and stop being installed in clubroad, episodia and auth0-thin, which never run lerna at all.

No published package changes here — the root is private, and build: does not trigger a release.

🤖 Generated with Claude Code

https://claude.ai/code/session_018rggC8Ucw8LWiXkeTjX91R

lerna is not declared in this repo. It arrives as a transitive dependency of
@versini/dev-dependencies-common and is reachable only because shamefullyHoist
lifts it to the root.

So the lerna running `lerna run build/lint/test` here, and `lerna publish
from-package` in CI, is versioned by a shared config-preset package this repo
never asked for a build tool from.

Declare it directly, at 10.0.0.

Going straight to 10 rather than first pinning the inherited 9.0.7: lerna 10's
publish path is already proven in this fleet. The dev-dependencies release job
has no install step, so its `npx lerna` fetches the latest from the registry —
which means @versini/dev-dependencies-{common,client} 13.0.2/14.0.2 (Jul 30)
and 13.0.3/14.0.3 (Jul 31) were published by lerna 10.0.0 on Node 22.x, using
the same `publish from-package --no-push --no-private --yes` invocation used
here.

None of lerna 10's breaking changes apply:

- EBEHIND-in-CI is gated behind `requiresGit` (false for `from-package`) and
  `pushToRemote` (false under `--no-push`), so it cannot fire.
- The conventional-changelog rewrite only affects `lerna version`, unused here.
- ESM-only is irrelevant; nothing imports lerna programmatically.
- The Node floor moves to >=22.13. Every runner is on 22.x (which resolves to
  latest 22) or 24.x. Note there is no engine-strict, so a local machine on
  22.0-22.12 would fail at runtime rather than at install.

Unlike a 9.0.7 pin, this is not a lockfile no-op: it adds ~45 packages, almost
all of it nx 22.7.x -> 23.1.1 with its platform binaries plus the new
conventional-changelog stack. Nothing is removed — dev-dependencies-common
still depends on lerna 9.0.7, so both majors sit in the tree until lerna is
dropped from that package. `node_modules/.bin/lerna` resolves to 10.0.0, and
pnpm links nx 23.1.1 inside the lerna@10 instance regardless of which nx wins
the root hoist.

Verified `npx --no-install lerna --version` resolves 10.0.0 (--no-install
proves local resolution rather than a registry fetch), then `pnpm build` (14
projects) and `pnpm test` (12 projects, 75 tests), both exit 0. `lerna run` is
the surface nx 23 actually changes, so those runs are the check that matters.

Next: drop lerna from dev-dependencies-common, after which lerna 9 and nx 22
leave this tree entirely, and stop being installed in clubroad, episodia and
auth0-thin, which never run lerna at all.

Claude-Session: https://claude.ai/code/session_018rggC8Ucw8LWiXkeTjX91R

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
@aversini
aversini force-pushed the build/pin-lerna-explicitly branch from faa6b5b to 0d3ca87 Compare August 2, 2026 17:19
@aversini aversini changed the title build: pin lerna directly instead of inheriting it from dev-dependencies-common build: pin lerna 10 instead of inheriting it transitively Aug 2, 2026
@aversini
aversini merged commit 5b6e41e into main Aug 2, 2026
5 checks passed
@aversini
aversini deleted the build/pin-lerna-explicitly branch August 2, 2026 17:25
aversini added a commit that referenced this pull request Aug 2, 2026
@versini/dev-dependencies-common 14.0.0 drops lerna from the bundle
(versini-org/dev-dependencies#883). Removing it is the only difference between
13.0.3 and 14.0.0 — confirmed by set-diffing the two published manifests: one
dependency removed, none added, none changed.

lerna is still available here: this repo pins it directly at 10.0.0 (#627).
What leaves the tree is the inherited lerna 9.0.7 and its nx 22 — the lockfile
now carries lerna@10.0.0 and nothing else.

Verified `pnpm build` (14 projects) and `pnpm test` (12 projects) pass, both
driven by `lerna run`.

Claude-Session: https://claude.ai/code/session_018rggC8Ucw8LWiXkeTjX91R

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant