Repository navigation
Gate the shadcn registry and the workspace-sibling rule - #291
Conversation
The registry builder copied package.json specifiers verbatim into the install specs the upstream shadcn CLI runs, so a `workspace:*` sibling emitted `@octanejs/radix@workspace:*`, which no consumer can install. Resolve the protocol to the sibling's current version, the substitution `pnpm pack` already makes for the published manifest. Those pins go stale on every sibling bump, so `changeset:version` regenerates the registry alongside the other generated artifacts, and CI now gates `registry:check`, which nothing checked before. validateWorkspacePackages rejects any sibling edge that is not `workspace:*`. That is the defect that broke the release job, and `packages:inventory:check` already gates it in CI.
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
registry.test.ts asserted the literal `@octanejs/[email protected]` the frozen pins happened to emit, so resolving the workspace protocol failed it. Derive the expected version from the sibling manifest instead: a literal goes stale on every sibling release, which is the drift the emit exists to avoid. Adds the case that actually guards the generator, that no item emits a local protocol. The shadcn vitest project's radix note described the pinned published copy; `workspace:*` makes that resolution the sibling source.
Two independent drifts left manifest.jsonl stale, and the evals suite failed on both. `overlayLockfileHash` pins pnpm-lock.yaml, which #289 changed when it moved @octanejs/shadcn onto workspace siblings without rerunning the generator. That one was already stale on main; this branch just inherited it. `graderDigest` pins vitest.config.js, because the grading harness runs the submission under that exact config. The previous commit reworded the shadcn project's radix note, so every task's digest moved with it. Nothing else changed: same 19 tasks, same ids, same template and reference digests.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: Unused registry version helpers
- Removed the unused resolveSiblingVersions(), siblingVersions, and depSpec() since DEP_SPECS already uses installableDependencySpec() which performs the same workspace version resolution.
Or push these changes by commenting:
@cursor push 3eea1af0bc
Preview (3eea1af0bc)
diff --git a/packages/shadcn/scripts/build-registry.mjs b/packages/shadcn/scripts/build-registry.mjs
--- a/packages/shadcn/scripts/build-registry.mjs
+++ b/packages/shadcn/scripts/build-registry.mjs
@@ -19,31 +19,6 @@
const pkg = JSON.parse(await readFile(join(PKG_ROOT, 'package.json'), 'utf8'));
-// Siblings are declared as `workspace:*`, a protocol that means nothing to a
-// consumer installing from npm, so resolve it to the sibling's current version:
-// the same substitution `pnpm pack` makes in the published manifest.
-async function resolveSiblingVersions() {
- const versions = new Map();
- for (const entry of await readdir(join(PKG_ROOT, '..'), { withFileTypes: true })) {
- if (!entry.isDirectory()) continue;
- const manifestPath = join(PKG_ROOT, '..', entry.name, 'package.json');
- if (!existsSync(manifestPath)) continue;
- const manifest = JSON.parse(await readFile(manifestPath, 'utf8'));
- if (manifest.name) versions.set(manifest.name, manifest.version);
- }
- return versions;
-}
-
-const siblingVersions = await resolveSiblingVersions();
-
-function depSpec(name, range) {
- if (!name.startsWith('@octanejs/')) return name;
- if (!range.startsWith('workspace:')) return `${name}@${range}`;
- const version = siblingVersions.get(name);
- if (!version) throw new Error(`registry: cannot resolve the workspace version of "${name}"`);
- return `${name}@${version}`;
-}
-
// Installable dependency spec per import, derived from package.json so a new
// import can never silently ship without its dependency: @octanejs/* siblings
// pinned to the exact tested version (maintainer pinning policy), public npmYou can send follow-ups to the cloud agent here.
Reviewed by Cursor Bugbot for commit 5fd1aec. Configure here.
#283 landed the same fix on main as `installableDependencySpec`, and the merge took both implementations because they sit in different regions of the file. Only main's is wired into DEP_SPECS, so `resolveSiblingVersions`, `siblingVersions` and `depSpec` were dead code describing a path that never ran. Keep main's. The emitted registry is byte-identical either way: all three shadcn siblings (lucide, radix, sonner) live in a directory named after the unscoped package, which is the only case where the two resolvers differ.
`graderDigest` pins vitest.config.js. The merge kept main's manifest lines, which were generated before this branch's radix note reword, so all 19 digests were stale again. Only that field moves; the lockfile hash main regenerated is already correct.
|
M4 pre-merge qualification scaffold and raw diagnostics are now in draft benchmark PR Huxpro/lynx-js-framework-benchmark#66. Current evidence (diagnostic only, not acceptance):
The PR intentionally stays draft and explicitly records that |


Follow-up to #289.
Summary
shadcn:registry:check, andchangeset:versionregenerates the registry, so the committed output cannot drift from the versions a release ships.validateWorkspacePackagesrejects any dependency on a workspace package that is notworkspace:*.registry.test.tsstops asserting hard-coded sibling versions and gains the case that guards the generator.Why
#283 fixed the emitted specs but nothing checks that the committed registry stays
current. The pins go stale on every sibling bump, and
registry:checkhad nocaller, so the drift that motivated #289 can reappear silently. The gate plus the
release-time regen closes that.
The sibling-edge guard covers the defect that broke the release job in the first
place: an exact pin on a sibling resolves it from npm rather than the checkout,
and
changeset versionrewrites the pin on release, desyncingpnpm-lock.yaml.The corpus manifest pins
vitest.config.jsintograderDigestandpnpm-lock.yamlinto
overlayLockfileHash, so it went stale twice: once from #289's lockfilechange, which was already red on main, and once from the radix note reword here.
Changes
.github/workflows/ci.yml: gatesshadcn:registry:check, and the release-merge classifier acceptspackages/shadcn/registry/so a release PR keeps its fast path.package.json:shadcn:registryandshadcn:registry:checkroot scripts;changeset:versionruns the former.scripts/workspace-packages.mjs: sibling-edge check overdependencies,devDependenciesandpeerDependencies.packages/shadcn/tests/registry.test.ts: the exact-pin assertion reads the version from the sibling manifest rather than a literal, and a new case asserts no item emits aworkspace:/catalog:protocol.packages/octane-evals/datasets/train/user-apps-v1/manifest.jsonl: regenerated. OnlygraderDigestandoverlayLockfileHashmove; same 19 tasks, same template and reference digests.vitest.config.js: comment only. The shadcn project's note said@octanejs/radixresolves to the pinned published copy; since Depend on workspace siblings in @octanejs/shadcn #289 it resolves topackages/radix..changeset/shadcn-registry-resolves-workspace-specs.md: kept deliberately. feat: retarget @octanejs/tanstack-table to TanStack Table v9 #283 shipped the resolution with no changeset, so this is the only changelog entry a consumer gets for it. Drop it if you would rather the entry sit with feat: retarget @octanejs/tanstack-table to TanStack Table v9 #283.Validation
pnpm format:checkpnpm typecheck(not run: no TypeScript in the diff outside the test file)pnpm testin full (not run: no runtime, compiler or SSR code in the diff)vitest --project shadcn --project octane-evals, 156 pass across 21 filespnpm shadcn:registry:check,corpus:generate --check,pnpm packages:inventory:check,pnpm changeset:check,pnpm packages:pack:test(5 pass)pnpm changeset:versionregenerating the registry to the bumped versions withregistry:checkcurrent afterwards, and both guards proven by breaking the thing they guard (reintroducing the pin fails withpackages/shadcn dependencies.@octanejs/radix must be "workspace:*" (received "0.1.12"), reverting the generator's protocol resolution fails the new registry case)Risk / follow-ups
pnpm-lock.yaml, because the generator only runs automatically atchangeset:version. Depend on workspace siblings in @octanejs/shadcn #289 and feat: retarget @octanejs/tanstack-table to TanStack Table v9 #283 both did it. The evals test catches it, but only after the fact. A lockfile-triggered regen, or movingoverlayLockfileHashout of the pinned set, would close it properly; out of scope here.@octanejs/radixis unaliased in the shadcn vitest project, so it used to resolve to the published 0.1.12 tarball and now resolves topackages/radix. Tests pass either way, but if the intent was specifically to test what the CLI installs, that wants an explicit test-time alias, not a manifest pin. Maintainer call.@octanejs/shadcnis at 0.0.1 while the other bindings are on 0.1.x, and 0.0.1 is already published.