Skip to content

chore(publish): Remove lerna#1739

Merged
Tobbe merged 2 commits into
mainfrom
tobbe-chore-publish-remove-lerna
May 10, 2026
Merged

chore(publish): Remove lerna#1739
Tobbe merged 2 commits into
mainfrom
tobbe-chore-publish-remove-lerna

Conversation

@Tobbe

@Tobbe Tobbe commented May 10, 2026

Copy link
Copy Markdown
Member

lerna is only used for publishing Canarys and RCs. It's a heavy dependency that pulls in a bunch of deprecated deps. Getting rid of it to clean things up.

@netlify

netlify Bot commented May 10, 2026

Copy link
Copy Markdown

Deploy Preview for cedarjs canceled.

Name Link
🔨 Latest commit 6446004
🔍 Latest deploy log https://app.netlify.com/projects/cedarjs/deploys/6a00946d0a7fe90008f89ad7

@github-actions github-actions Bot added this to the chore milestone May 10, 2026
@greptile-apps

greptile-apps Bot commented May 10, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR removes lerna from the repository, replacing its canary and RC publishing workflows with direct npm publish calls and manual version calculation via git describe --abbrev=0 --tags + commit count.

  • Canary publishing (publish_canary.sh) is fully rewritten in bash using yarn workspaces list, jq, and npm publish directly — no lerna involved.
  • RC publishing (publish-release-candidate.mts) drops the lerna dry-run trick for version calculation in favour of explicit semver arithmetic from the latest git tag; publishPackages now re-throws on failure.
  • Supporting cleanup: lerna.json is deleted, lerna is removed from devDependencies, the findUp('lerna.json') test anchor is updated to nx.json, and a new tasks/update-package-versions.cjs helper is added for stable-release version bumps.

The project overview doc (docs/implementation-docs/2026-03-26-cedarjs-project-overview.md) contains no references to lerna and accurately describes Nx as the build orchestration tool — no update needed there.

Confidence Score: 5/5

Safe to merge — the change is a clean dependency removal with equivalent functionality implemented directly in bash and TypeScript.

All publishing logic is a straightforward replacement of lerna commands with direct npm calls. The version calculation is deterministic using the existing git-tag strategy. The only finding is a minor argument-guard ordering issue in the new utility script.

No files require special attention; tasks/update-package-versions.cjs has a minor guard ordering nit but is otherwise correct.

Important Files Changed

Filename Overview
.github/scripts/publish-release-candidate.mts Replaced lerna-based version calculation and publish with direct git describe + commit count + npm publish. Errors in publishPackages now correctly re-throw.
.github/scripts/publish_canary.sh Full rewrite from lerna-based canary publish to direct npm publish with manual version calculation via git tags.
tasks/update-package-versions.cjs New utility script for updating workspace package versions. The argument-missing guard is unreachable because .replace() would throw a TypeError first.
packages/cli/src/commands/setup/graphql/features/fragments/codemod_tests/appGqlConfigTransform.test.ts Updated findUp anchor from deleted lerna.json to nx.json — correct fix.
package.json Removed lerna from devDependencies and dropped related minimatch overrides.
lerna.json File deleted as part of the lerna removal.

Reviews (2): Last reviewed commit: "fix review comments" | Re-trigger Greptile

Comment thread .github/scripts/publish-release-candidate.mts Outdated
Comment thread .github/scripts/publish_canary.sh
@nx-cloud

nx-cloud Bot commented May 10, 2026

Copy link
Copy Markdown

🤖 Nx Cloud AI Fix

Ensure the fix-ci command is configured to always run in your CI pipeline to get automatic fixes in future runs. For more information, please see https://nx.dev/ci/features/self-healing-ci


View your CI Pipeline Execution ↗ for commit c480128

Command Status Duration Result
nx run-many -t build:pack --exclude create-ceda... ✅ Succeeded 2s View ↗
nx run-many -t test --minWorkers=1 --maxWorkers=4 ✅ Succeeded 3m 11s View ↗
nx run-many -t test:types ✅ Succeeded 7s View ↗
nx run-many -t build ✅ Succeeded 1s View ↗

☁️ Nx Cloud last updated this comment at 2026-05-10 14:35:43 UTC

@Tobbe Tobbe merged commit c5c6270 into main May 10, 2026
42 checks passed
@Tobbe Tobbe deleted the tobbe-chore-publish-remove-lerna branch May 10, 2026 16:33
Tobbe added a commit that referenced this pull request May 12, 2026
@Tobbe Tobbe modified the milestones: chore, v4.2.0 May 13, 2026
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