Skip to content

Gate the shadcn registry and the workspace-sibling rule - #291

Merged
WebEferen merged 6 commits into
mainfrom
fix/shadcn-registry-and-gates
Jul 26, 2026
Merged

WebEferen merged 6 commits into
mainfrom
fix/shadcn-registry-and-gates

Conversation

@WebEferen

@WebEferen WebEferen commented Jul 26, 2026 •

Copy link
Copy Markdown
Contributor

Follow-up to #289.

Rescoped after merging main. #283 landed the registry's workspace:*
resolution independently, as installableDependencySpec. The merge kept both
implementations because they sit in different regions of the file, so this
branch deleted its own (resolveSiblingVersions/depSpec) and keeps main's.
packages/shadcn/scripts/ and packages/shadcn/registry/ are now byte-identical
to main, and what remains here is the gating and the guards.

Summary

  • CI gates shadcn:registry:check, and changeset:version regenerates the registry, so the committed output cannot drift from the versions a release ships.
  • validateWorkspacePackages rejects any dependency on a workspace package that is not workspace:*.
  • registry.test.ts stops asserting hard-coded sibling versions and gains the case that guards the generator.
  • The user-app corpus manifest is regenerated.

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:check had no
caller, 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 version rewrites the pin on release, desyncing pnpm-lock.yaml.

The corpus manifest pins vitest.config.js into graderDigest and pnpm-lock.yaml
into overlayLockfileHash, so it went stale twice: once from #289's lockfile
change, which was already red on main, and once from the radix note reword here.

Changes

  • .github/workflows/ci.yml: gates shadcn:registry:check, and the release-merge classifier accepts packages/shadcn/registry/ so a release PR keeps its fast path.
  • package.json: shadcn:registry and shadcn:registry:check root scripts; changeset:version runs the former.
  • scripts/workspace-packages.mjs: sibling-edge check over dependencies, devDependencies and peerDependencies.
  • 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 a workspace:/catalog: protocol.
  • packages/octane-evals/datasets/train/user-apps-v1/manifest.jsonl: regenerated. Only graderDigest and overlayLockfileHash move; same 19 tasks, same template and reference digests.
  • vitest.config.js: comment only. The shadcn project's note said @octanejs/radix resolves to the pinned published copy; since Depend on workspace siblings in @octanejs/shadcn #289 it resolves to packages/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:check
  • pnpm typecheck (not run: no TypeScript in the diff outside the test file)
  • pnpm test in full (not run: no runtime, compiler or SSR code in the diff)
  • targeted, post-merge: vitest --project shadcn --project octane-evals, 156 pass across 21 files
  • targeted, post-merge: pnpm shadcn:registry:check, corpus:generate --check, pnpm packages:inventory:check, pnpm changeset:check, pnpm packages:pack:test (5 pass)
  • pre-merge, still believed valid but not re-run: release replay via pnpm changeset:version regenerating the registry to the bumped versions with registry:check current afterwards, and both guards proven by breaking the thing they guard (reintroducing the pin fails with packages/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

  • The corpus manifest goes stale on any merged PR that touches pnpm-lock.yaml, because the generator only runs automatically at changeset: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 moving overlayLockfileHash out of the pinned set, would close it properly; out of scope here.
  • Depend on workspace siblings in @octanejs/shadcn #289 changed what the shadcn suite covers. @octanejs/radix is unaliased in the shadcn vitest project, so it used to resolve to the published 0.1.12 tarball and now resolves to packages/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/shadcn is at 0.0.1 while the other bindings are on 0.1.x, and 0.0.1 is already published.

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.
@vercel

vercel Bot commented Jul 26, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

2 Skipped Deployments
Project Deployment Actions Updated (UTC)
octane-website Skipped Skipped Jul 26, 2026 9:00pm
octane-website-mcp Skipped Skipped Jul 26, 2026 9:00pm

Request Review

@vercel
vercel Bot temporarily deployed to Preview – octane-website-mcp July 26, 2026 20:16 Inactive
@vercel
vercel Bot temporarily deployed to Preview – octane-website July 26, 2026 20:16 Inactive
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.
@vercel
vercel Bot temporarily deployed to Preview – octane-website-mcp July 26, 2026 20:23 Inactive
@vercel
vercel Bot temporarily deployed to Preview – octane-website July 26, 2026 20:24 Inactive
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.
@vercel
vercel Bot temporarily deployed to Preview – octane-website-mcp July 26, 2026 20:39 Inactive
@vercel
vercel Bot temporarily deployed to Preview – octane-website July 26, 2026 20:39 Inactive
@vercel
vercel Bot temporarily deployed to Preview – octane-website-mcp July 26, 2026 20:54 Inactive
@vercel
vercel Bot temporarily deployed to Preview – octane-website July 26, 2026 20:54 Inactive

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

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.

Create PR

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 npm

You 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.
@vercel
vercel Bot temporarily deployed to Preview – octane-website-mcp July 26, 2026 21:00 Inactive
@vercel
vercel Bot temporarily deployed to Preview – octane-website July 26, 2026 21:00 Inactive
@WebEferen WebEferen changed the title Resolve workspace specs in the shadcn registry and gate the class Gate the shadcn registry and the workspace-sibling rule Jul 26, 2026
@WebEferen
WebEferen merged commit 6d85dcb into main Jul 26, 2026
28 checks passed
@WebEferen
WebEferen deleted the fix/shadcn-registry-and-gates branch July 26, 2026 21:11
@Huxpro

Huxpro commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

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):

  • source-built cohort: candidate docs: refresh website benchmark results #360 head cf1018a, latest upstream 55a9aa3, ReactLynx 0.126, Vue VDOM/Vapor default + optimized cells; exact source/lock/toolchain/bundle receipts retained
  • Web semantic preflight: 7/7 supported entries passed
  • full exploratory run: 909 source records, 0 DNF
  • ReactLynx FCP@0 follow-up: 10 independent order-balanced pairs (5 AB / 5 BA), 0 DNF; frozen paired bootstrap candidate/ReactLynx = 1.6990, 95% CI [1.6050, 1.8011]
  • production intermediates attribute the startup owner to code/load/init size: Octane ~188kB background + 240kB main-thread JS versus ReactLynx ~52kB + 51kB; this is being treated as a framework/plugin output owner, not patched in the benchmark

The PR intentionally stays draft and explicitly records that cf1018a is pre-merge. Formal M4 runs will be rebuilt from the exact #360 new-lynx merge SHA and refreshed latest upstream after #360 clears its leased-device Native gate. Remaining interaction, startup, tail, memory/lifecycle, list/recycle/fling, Android/iOS, and low-end gates remain open; no completion claim is made.

This branch was previously deployed

2 inactive deployments
Preview – octane-website-mcp — dc7e71c4 Deployed Jul 26, 2026 by vercel[bot]
Preview – octane-website — dc7e71c4 Deployed Jul 26, 2026 by vercel[bot]
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.

3 participants