Skip to content

deps: bump shadcn to 4.15.0 and single-source the CLI pin - #401

Merged
Ducksss merged 1 commit into
devfrom
chore/shadcn-4.15.0-single-source
Jul 29, 2026
Merged

Ducksss merged 1 commit into
devfrom
chore/shadcn-4.15.0-single-source

Conversation

@Ducksss

@Ducksss Ducksss commented Jul 28, 2026 •

Copy link
Copy Markdown
Owner

Supersedes #368. Closes #368.

Why the Dependabot PR could never pass

The shadcn version was written in four places, and Dependabot can only touch one:

Site Was
package.json devDependency 4.7.0 ← the only thing Dependabot bumps
tools/payload-components/utils.ts → shadcnCliPackage [email protected] (compiled into the published CLI)
tests/int/payload-components-registry.int.spec.ts [email protected] ×4 (mocked arg strings)
tests/int/public-registry.int.spec.ts expect(...).toBe('4.7.0')

So every bump tripped the gate on the last row. That's why #259, #300 and #368 each failed identically — and why "re-attempt when a later version passes the gate" could never happen. The gate asserted a literal.

What this does

Makes the shadcn devDependency the single source of truth.

  • tsup.config.ts reads the pin at build time and inlines it via define, so the published CLI never needs the repo's package.json at runtime.
  • utils.ts uses that build-time constant, falling back to reading the pin off package.json on the source path (vitest, tsx), where the bundler doesn't run.
  • Both specs now reference the real shadcnCliPackage instead of hardcoding a version.
  • The gate still asserts what it actually cared about: the pin is an exact version, not a range (ranges would make registry artifacts non-deterministic), and the CLI spec tracks it.

Future Dependabot bumps become a genuine one-line change.

Verification

shadcn add output is byte-identical between 4.7.0 and 4.15.0 — both for a built registry item and for our complete public-UI dependency surface (accordion, badge, button, card, input, textarea, extracted from all 68 registry items):

diff -rq t-4.7.0 t-4.15.0    → IDENTICAL
diff -rq ui-4.7.0 ui-4.15.0  → IDENTICAL across all six

This also settles the concern that closed #259 — that 4.13+ switches the default component backend to Base UI. It doesn't, on the default new-york style we use:

accordion.tsx @4.15.0:  import { Accordion as AccordionPrimitive } from "radix-ui"
grep base-ui:           none
deps added:             { "radix-ui": "^1.6.7" }
Check Result
test:int 379 passed, 1 skipped, 0 failed
lint clean
test:registry clean
test:pack clean
registry:build 0 artifact churn vs committed public/r
bundle embeds 4.15.0 (__SHADCN_CLI_VERSION__ fully replaced)
simulated bump to 4.16.0 passes with zero test or source edits

Lockfile churn is entirely shadcn's own transitive dev tree; shadcn is the only top-level specifier that moved.

Note

Targets 4.15.0 (what #368 proposed and what I verified end to end), not the current @latest 4.16.0.

Worth a separate look: every docs page ships pnpm dlx shadcn@latest, while the CLI pins exact — so the documented path and the CLI have been on different shadcn majors for weeks. This PR doesn't change that; it just makes the pin cheap to move.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Updated the Shadcn CLI integration to use the version configured by the project, preventing version mismatches during component installation and registry publishing.
    • Added validation to ensure the configured Shadcn version is available and follows the expected semantic version format.

Copilot AI review requested due to automatic review settings July 28, 2026 10:43
@vercel

vercel Bot commented Jul 28, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
payload-components Ready Ready Preview, Comment Jul 29, 2026 10:08am
payload-components-97bf Ready Ready Preview, Comment Jul 29, 2026 10:08am

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Jul 28, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 5b2f10d3-2c21-4cee-a409-4553443927fe

📥 Commits

Reviewing files that changed from the base of the PR and between 566d4cd and c7d0b15.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (5)
  • package.json
  • tests/int/payload-components-registry.int.spec.ts
  • tests/int/public-registry.int.spec.ts
  • tools/payload-components/utils.ts
  • tsup.config.ts

📝 Walkthrough

Walkthrough

The shadcn dependency is upgraded to 4.15.0. Build-time injection and runtime fallback resolution now derive the CLI package from package.json, while integration tests use and validate the resolved package value.

Changes

Shadcn version synchronization

Layer / File(s) Summary
Build and runtime version resolution
package.json, tsup.config.ts, tools/payload-components/utils.ts
The shadcn version is updated to 4.15.0, injected into builds, and resolved at runtime from the injected value or package.json.
Integration test version alignment
tests/int/payload-components-registry.int.spec.ts, tests/int/public-registry.int.spec.ts
Registry command assertions use the resolved CLI package, and public registry tests validate its semantic version against the dependency pin.

Estimated code review effort: 3 (Moderate) | ~20 minutes

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is detailed, but it doesn't follow the required template and omits the Summary and Registry Checklist sections. Reformat it to the repo template and add the missing Summary, Verification, Registry Checklist, and Notes sections.
Linked Issues check ⚠️ Warning FAIL: [#368] requires shadcn 4.16.0 and related upstream changes, but this PR targets 4.15.0; pnpm-lock.yaml was also excluded so lockfile updates can't be verified. Bump to 4.16.0, include the required upstream shadcn changes, and verify the lockfile update in an unfiltered diff.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately summarizes the shadcn bump and shared CLI pin.
Out of Scope Changes check ✅ Passed The changes are focused on the shadcn version bump, shared version sourcing, and test/build alignment.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/shadcn-4.15.0-single-source

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install failed: dependency version conflict. Check your lock file or package.json.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Supersedes the Dependabot bump in #368, which could only ever touch the
`shadcn` devDependency and so always failed the release gate.

The version was previously written in four places — the devDependency,
`shadcnCliPackage` in tools/payload-components/utils.ts (compiled into the
published CLI), the mocked argument strings in the registry install spec, and
a literal `toBe('4.7.0')` assertion. Any bump that moved only one of them
tripped the gate, which is why #259, #300 and #368 each failed identically.

Now the `shadcn` devDependency is the single source. tsup inlines it into the
bundle via `define`, so the published CLI keeps working without reading the
repo's package.json at runtime; the source path (vitest, tsx) falls back to
reading the pin off package.json. The gate still asserts what it cared about —
that the pin is an exact version, not a range, and that the CLI spec tracks it.

Verified against 4.15.0:
- `shadcn add` output is byte-identical to 4.7.0 for our full public-UI
  surface (accordion, badge, button, card, input, textarea) and for a built
  registry item; still Radix-backed, no Base UI switch on the default style
- `registry:build` produces zero artifact churn
- test:int 379 passed, lint / test:registry / test:pack all clean
- a simulated future bump to 4.16.0 passes with no test or source edits

Co-Authored-By: Claude Opus 5 <[email protected]>
@Ducksss
Ducksss force-pushed the chore/shadcn-4.15.0-single-source branch from 99fb2d6 to c7d0b15 Compare July 29, 2026 10:02
@Ducksss
Ducksss merged commit aa3b6a9 into dev Jul 29, 2026
12 checks passed
@Ducksss
Ducksss deleted the chore/shadcn-4.15.0-single-source branch July 29, 2026 16:53
Ducksss added a commit that referenced this pull request Jul 30, 2026
…dening, dependency refresh (#416)

Brings main level with dev ahead of publishing 1.2.1.

- wall fit guard tightened from 60px to 50px, and the fumadocs int spec no longer
  pins prettier's line breaks (#413)
- CodeRabbit findings from the last five days closed (#411)
- tsconfig drops the redundant react types path that blocked every vite 8 bump
  (#412), unblocking vite 8.1.5; dependency refresh for lucide-react, fumadocs and
  the test tooling (#365, #366, #367)
- shadcn bumped to 4.15.0 with the CLI pin single-sourced, so a version bump no
  longer has to be written in four places (#401)

Tree is identical to dev by construction: branched from dev, reparented onto main,
so the diff is exactly the main..dev delta with no squash-divergence conflicts.

This branch was successfully deployed

2 active deployments
Preview – payload-components — c7d0b151 Deployed Jul 29, 2026 by vercel[bot]
Preview – payload-components-97bf — c7d0b151 Deployed Jul 29, 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.

2 participants