Repository navigation
fix: codemod publish and docs 5x - #2759
Conversation
The codemod publish CLI rejects slash-namespaced names (cornerstone3d/5, cornerstone3d/5/generic-viewport); names must match ^(@scope/)?name$. Rename the published packages under the @cornerstonejs scope so 'codemod publish' passes name validation: @cornerstonejs/cornerstone3d-5 and @cornerstonejs/cornerstone3d-5-generic-viewport. Update the aggregate workflow source ref, the publish workflow verify step, and the READMEs to match. Directory paths and git tags (resolved by path) are unchanged. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The published docs header still read 4.0 (Latest) and linked the 4.x migration guides. Bump to 5.0 to match the current release line. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Since #2612 (2026-02-11) the publish pipeline runs 'lerna version' with --no-push so the version bump and generated files land as one amended commit (replacing the previous two-commit flow). But lerna only creates a GitHub release when it pushes the tag itself, so --no-push silently disabled release creation. npm kept publishing (separate 'lerna publish from-package' step), so npm latest advanced to 5.0.1 while GitHub Releases froze at v4.16.0. Drop the now-inert --create-release github from the lerna call and instead create the release explicitly via the GitHub API after the tag is pushed. TOKEN: reuses the same GH_TOKEN that lerna --create-release used previously (falls back to GITHUB_TOKEN). It is read from the environment in the CircleCI NPM_PUBLISH job and must be set as a CircleCI project/context environment variable (Project Settings > Environment Variables, or the shared context the workflow uses) - it is not defined in .circleci/config.yml. The token needs 'repo'/'contents: write' scope to create releases. If the token is absent or the API call fails, the step logs a warning and the build/release continues (npm publish is unaffected). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
📝 WalkthroughWalkthroughScoped codemod package names replaced across registry entries, READMEs, and workflows; publish-version now creates GitHub releases post-tag; package manifests set public publish access and generate-version gates writing to public packages; docs config updated to surface v5 migration guides and current version label. ChangesCornerstone v5 Release and Documentation Updates
sequenceDiagram
participant PublishScript as publish-version.mjs
participant Git as git
participant GH_CLI as gh CLI
PublishScript->>Git: lerna version (no --create-release)
PublishScript->>Git: git push --tags
PublishScript->>PublishScript: createGithubRelease(tagName, version)
PublishScript->>GH_CLI: gh release create <tag> --generate-notes [--prerelease]
GH_CLI-->>PublishScript: success / error (logged)
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 3❌ Failed checks (2 warnings, 1 inconclusive)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
gh release create reads the same GH_TOKEN/GITHUB_TOKEN and infers owner/repo from the origin remote, so it replaces the hand-rolled fetch + remote-URL parsing. --verify-tag confirms the just-pushed tag exists; --generate-notes mirrors lerna's old auto-notes; --prerelease is added for prerelease versions. gh ships in CircleCI's cimg base image. Still best-effort: any failure logs a warning and does not fail the build/release. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
sedghi
left a comment
There was a problem hiding this comment.
we should put the public : true in package json for codemod
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@publish-version.mjs`:
- Around line 207-228: The CI is invoking publish-version.mjs which calls
execa('gh', ...) using tagName and version and requires GH_TOKEN/GITHUB_TOKEN,
but CircleCI doesn't install the gh CLI or set the token; update the CircleCI
job that runs node ./publish-version.mjs to install the GitHub CLI (gh) in the
cimg/node:24.0.0-browsers image and ensure GH_TOKEN (or GITHUB_TOKEN) is
provided via project or context environment variables, and optionally add a
pre-check in publish-version.mjs to verify gh is on PATH and the token exists
before calling execa('gh', ...) so failures are explicit.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/codemods/package.json`:
- Around line 10-12: The README currently states this package is intentionally
private but package.json now sets "publishConfig": {"access":"public"}, so
update the codemods README text that mentions npm visibility to reflect the
package is published publicly; locate the README section that says the package
is intentionally private and change the wording to indicate it is published to
the public npm registry (or remove the private reference), and ensure the
messaging aligns with the "publishConfig" entry in package.json so release docs
are consistent.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 5353493c-7ca0-497e-9d94-b63537d7a564
📒 Files selected for processing (1)
packages/codemods/package.json
| "publishConfig": { | ||
| "access": "public" | ||
| }, |
There was a problem hiding this comment.
Align npm visibility docs with the new public publish config.
Line 10 switches this package to public publish behavior, but the registry publishing docs currently state the package is intentionally private to npm (packages/codemods/README.md, Lines 68-69). Please update that text to avoid release-process confusion.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@packages/codemods/package.json` around lines 10 - 12, The README currently
states this package is intentionally private but package.json now sets
"publishConfig": {"access":"public"}, so update the codemods README text that
mentions npm visibility to reflect the package is published publicly; locate the
README section that says the package is intentionally private and change the
wording to indicate it is published to the public npm registry (or remove the
private reference), and ensure the messaging aligns with the "publishConfig"
entry in package.json so release docs are consistent.
generate-version.js skipped packages without a src directory as a proxy for 'not published'. Gate on the real signal instead: publishConfig.access === 'public'. Private packages (e.g. the docs site) are skipped. A defensive no-src skip remains so a published-but-srcless package (the codemods registry package) does not fail the release. core and tools were published but lacked publishConfig.access, so add it to keep the convention true for everything published (and so their version.ts keeps regenerating under the new gate). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@scripts/generate-version.js`:
- Around line 20-25: The catch block around JSON.parse currently treats any
error reading packageJsonPath as a harmless skip by logging and exiting 0;
change it to surface failures by logging the error and exiting non-zero (or
rethrowing) so CI fails on malformed/unreadable package.json. Update the catch
to include the caught error (error) in the log message referencing
packagePath/packageJsonPath and call process.exit(1) (or throw) instead of
process.exit(0) so version generation does not silently succeed when
package.json is bad.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: fe71ac62-c6fa-40a6-933d-c9baa8d53164
📒 Files selected for processing (3)
packages/core/package.jsonpackages/tools/package.jsonscripts/generate-version.js
✅ Files skipped from review due to trivial changes (1)
- packages/tools/package.json
No functitonal change, just publish codemod and versions to github.
Update the docs to 5.x
Context
Changes & Results
Testing
Checklist
PR
semantic-release format and guidelines.
Code
etc.)
Public Documentation Updates
additions or removals.
Tested Environment
Summary by CodeRabbit
Documentation
Chores