Skip to content

fix(ui): declare cn 0.2.6 and verify the bump #34 shipped - #35

Merged
suiramdev merged 2 commits into
devfrom
fix/cn-0.2.6
Sep 19, 2026
Merged

suiramdev merged 2 commits into
devfrom
fix/cn-0.2.6

Conversation

@suiramdev

Copy link
Copy Markdown
Owner

Summary

Declares cn 0.2.6 in the two packages that depend on it, and verifies the bump that #34 already shipped by accident: @shadcn/lint depends on cn@0.2.6 exactly, the caret ranges admitted it, and Bun deduped the workspace onto one copy — so node_modules ran 0.2.6 while both manifests still said 0.2.5. Look at packages/ui/src/lib/utils.test.ts first: it caught the change, and it was pinning a merge that cannot happen at runtime.

Motivation

  • The declared range and the resolved version disagreed, which makes a lockfile refresh look like a version change.
  • 0.2.6 is not CLI-only: dist/index.js and dist/engine.js are byte-identical to 0.2.5, dist/tables.js is not, and GROUP_COUNT goes 379 → 384.
  • The golden-corpus test caught it locally, and CI has no test job, so nothing else would have.
  • Six where: paths in that corpus went stale in the Feature-Sliced Design move and now point at the real files again.

Drawbacks

  • The commit verifies a bump that is already in dev; the evidence arrives after the fact, not before.
  • One row of the corpus becomes two, which is slightly more to maintain — the alternative is a row that pins an impossible call.
  • The lefthook change relaxes a failure mode. A commit that stages no lintable file now passes the hook silently.

Prior art

  • The repository already treats a class-merge change as a restyle: this corpus exists because cn replaced clsx + tailwind-merge, and it records the previous output verbatim.
  • tailwind-merge 3 is no longer the arbiter for theme utilities: its animate validator accepts only built-in names, so it cannot group animate-fd-*. Grouping them is the 0.2.6 fix, since both set animation in Tailwind v4.
  • --no-error-on-unmatched-pattern is oxlint's own flag for the empty-input case, not a wrapper script.

Notes

  • No visual change. The AI panel of the documentation site was opened in a browser and renders one animation class per state: animate-fd-fade-infd-fade-in, and the dialog → ask-ai-open.
  • Evidence, measured rather than argued: 307 real cn() call sites replayed through 0.2.5 and 0.2.6 report 0 differences; all 1 989 510 ordered pairs of the 1 411 recognized class tokens report 28, every one of them two animation classes collapsing; recognition gains 6 tokens and loses 0.
  • Unreachable: three source lines carry two animation classes — two ternaries in ai-search.tsx, where only one branch reaches cn, and the data-open/data-closed pairs in alert-dialog.tsx and popover.tsx, which sit under different variants.
  • Tests: no new test. The existing corpus row is corrected, and both branches now agree across 0.2.5, 0.2.6 and tailwind-merge 3.
  • apps/fumadocs pages: none. A dependency bump that changes no documented behavior needs no docs page; packages/ui/AGENTS.md gains the rule that a cn upgrade is a restyle until the corpus says otherwise.
  • Gates: bun run check, bun run check-types, bun run check:fsd, bun run docs:check (38 pages, 0 errors, 0 warnings), bun run build, and all three suites — 16 + 294 + 134 pass.
  • The lefthook fix was needed to commit this at all: every source file here is under packages/ui, which oxlint.config.ts ignores. Verified it still fails on a real violation.

The @shadcn/lint install moved the resolved cn from 0.2.5 to 0.2.6
through the lockfile: the plugin depends on cn@0.2.6 exactly, the caret
ranges here admitted it, and bun deduped the workspace onto one copy.
The declared ranges said 0.2.5 while node_modules ran 0.2.6. This makes
the declaration match, and verifies the bump that already shipped.

0.2.6 is not a CLI-only release. dist/index.js and dist/engine.js are
byte-identical to 0.2.5, dist/tables.js is not, and GROUP_COUNT goes
379 to 384: five new groups for custom animations, containment, legacy
gradients and missing Tailwind v4 utilities.

Replaying the 307 real cn() call sites of the repository reports no
difference. Every ordered pair of the 1411 class tokens it recognizes
reports 28, all of them one shape: two animation classes that 0.2.5
kept and 0.2.6 collapses. Recognition gains 6 tokens and loses none.
The grouping is the fix, not a regression, because both classes set
animation in Tailwind v4 and keeping both let stylesheet order decide.

None of it is reachable. Three source lines carry two animation
classes: two ternaries in ai-search.tsx, where only one branch ever
reaches cn, and the data-open/data-closed pairs in alert-dialog and
popover, which sit under different variants and do not conflict.

utils.test.ts flattened one of those ternaries into a single call, so
it pinned a merge that cannot happen and failed on the correct fix. It
now carries one row per branch, and both branches agree across 0.2.5,
0.2.6 and tailwind-merge 3. Its six stale where: paths, left behind by
the Feature-Sliced Design move, point at the real files again.
The glob already skipped the hook for a documentation-only commit. A
commit whose only source file sits under an ignored path — packages/ui
is ignored by oxlint.config.ts — still matched the glob, handed oxlint
a file it refuses to lint, and got exit 1 with "No files found to
lint". --no-error-on-unmatched-pattern is the flag for that case; a
real violation in a lintable file still fails, verified with a
debugger statement.
@coderabbitai

coderabbitai Bot commented Sep 19, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 15f404cc-020b-4e51-927a-bee8c00f4756

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

@suiramdev
suiramdev merged commit 2cb14ef into dev Sep 19, 2026
3 checks passed
@suiramdev
suiramdev deleted the fix/cn-0.2.6 branch September 19, 2026 13:14
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.

1 participant