Repository navigation
fix: make alpha publishing fail closed - #23
Conversation
📝 WalkthroughWalkthroughThe release process replaces direct Changesets publishing with a guarded alpha-package publisher. It validates synchronized prerelease packages, publishes missing tarballs in order, protects the ChangesAlpha publishing
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant Publisher as publishAlphaPackages
participant Packages as Package manifests and tarballs
participant Registry as npm registry
Publisher->>Packages: Read alpha configuration and synchronized versions
Publisher->>Registry: Query existing versions and dist-tags
Publisher->>Registry: Publish missing tarballs with --tag alpha
Publisher->>Registry: Verify latest is unchanged and alpha points to the release
Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
scripts/publish-alpha-packages.d.mts (1)
1-4: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winDuplicated package list between declaration and implementation.
The
PublicPackage["name"]/"directory"unions duplicate thepublicPackagesarray defined inscripts/publish-alpha-packages.mjs. Adding a fifth public package requires updating both files. TypeScript will not catch a missed update to this file at compile time in the.mjssource itself, only in TypeScript consumers.Consider deriving these types from the runtime array with
typeofin a.tscompanion, or add a comment in both files pointing to each other so future authors remember to update both.🤖 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 `@scripts/publish-alpha-packages.d.mts` around lines 1 - 4, Eliminate the duplicated package unions in PublicPackage by deriving the name and directory types from the runtime publicPackages array, or otherwise establish an explicit cross-reference between this declaration and scripts/publish-alpha-packages.mjs. Ensure adding a package requires updating both definitions consistently.
🤖 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/publish-alpha-packages.mjs`:
- Around line 40-54: Update the pre-check flow in publishAlphaPackages around
registry.distTags and registry.versions so missing brand-new packages are
treated as having no published versions and no dist-tags, allowing the initial
alpha publication to proceed. Preserve existing registry data for packages that
already exist and continue using tagsBefore for later tag handling.
---
Nitpick comments:
In `@scripts/publish-alpha-packages.d.mts`:
- Around line 1-4: Eliminate the duplicated package unions in PublicPackage by
deriving the name and directory types from the runtime publicPackages array, or
otherwise establish an explicit cross-reference between this declaration and
scripts/publish-alpha-packages.mjs. Ensure adding a package requires updating
both definitions consistently.
🪄 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: fa88bf51-9e37-4963-b974-6e06ea6dabdd
📒 Files selected for processing (9)
.github/workflows/release.ymlRELEASING.mdpackage.jsonscripts/publish-alpha-packages.d.mtsscripts/publish-alpha-packages.mjstests/release/changesets.test.tstests/release/ci.test.tstests/release/package-manifests.test.tstests/release/publish-packages.test.ts
What changed
alphadist-taglatestnever movesRoot cause
Changesets treats a prerelease with no prior stable version differently from the repository's documented assumption and would target
latest. The old tests asserted command text instead of exercising tag behavior.Verification
bun run test— 252 tests passedbun run typecheckbun run buildbun run docs:checkbun run release:packbun run release:inspectbun run release:packagesagainst npm — all packages skipped at0.1.0-alpha.8;alphaverified andlatestunchangedscribeandscbbinaries intactSummary by CodeRabbit
Release Process
alphatagging.latestrelease channel.Documentation
Tests