Skip to content

feat(ui): add shared package foundation - #616

Merged
zacjones93 merged 54 commits into
codex/ui-library-foundationfrom
codex/ui-package-foundation
Jul 15, 2026
Merged

feat(ui): add shared package foundation#616
zacjones93 merged 54 commits into
codex/ui-library-foundationfrom
codex/ui-package-foundation

Conversation

@zacjones93

@zacjones93 zacjones93 commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Stack

  • Base: codex/ui-library-foundation at ae63ca98f
  • Head: codex/ui-package-foundation at a0b1e2518
  • This is PR 2 of the UI-library migration and is intentionally stacked on the foundation branch rather than main.

What changed

  • Added the private workspace package @repo/ui with direct subpath exports for cn, badge, button, card, input, label, separator, skeleton, spinner, table, and textarea.
  • Moved the shared semantic Tailwind v4 theme/token/base-style contract into @repo/ui/styles.css, including package source scanning. Start and Crew import that contract once and retain app-specific keyframes/range styles.
  • Replaced the corresponding Start and Crew app-local implementations with thin compatibility re-exports, preserving all route and feature import paths.
  • Updated the existing Storybook stories to import direct @repo/ui/* entry points.
  • Added focused compatibility/style tests, package build/type-check configuration, and package-aware inventory output.
  • Updated lat.md/ui-library.md for the package, adapter, styling, Storybook, and test contracts.

Scope

The extracted primitive sources are byte-identical between Start and Crew and remain byte-identical to the prior canonical source except for the required package-relative cn imports. No route files changed. Stateful, overlay, form, and domain components remain app-owned; use-mobile remains app-local because this slice does not require it.

Validation

Run with Node v24.15.0 and Corepack pnpm 9.12.1:

  • pnpm --filter @repo/ui build
  • pnpm --filter @repo/ui type-check
  • pnpm --filter @repo/ui test — 12/12 compatibility and style-contract cases passed
  • pnpm --filter wodsmith-start type-check
  • pnpm --filter crew type-check
  • pnpm --filter wodsmith-start build-storybook
  • Storybook static smoke at foundations-button--default — loaded shared component, meaningful content rendered, no error overlay
  • pnpm --filter wodsmith-start check:ui-inventory
  • pnpm --filter @repo/ui lint — clean
  • Full pre-push pnpm lint — 9/9 tasks passed (existing repository warnings remain)
  • Full pre-push pnpm type-check — 12/12 tasks passed
  • lat check
  • git diff --check
  • Explicit no-route-churn and normalized byte-identity checks

Blockers / limitations

  • pnpm --filter wodsmith-start build and pnpm --filter crew build stop while loading Vite config because this clean worktree does not have generated .alchemy/local/wrangler.jsonc files. The base worktree lacks them as well; compilation is not reached.
  • Exact-worktree GitNexus re-indexing exceeded the useful window and was stopped. Its stale staged-diff query reported no changes, so scope was verified from direct import counts, adapter identity tests, route-diff checks, and the reviewed git diff instead.

Summary by cubic

Introduce @repo/ui, a shared UI package that hosts base primitives and a Tailwind v4 style contract. Start and Crew now use thin re-exports to keep all existing route imports working.

  • New Features

    • Added @repo/ui with subpath exports: cn, badge, button, card, input, label, separator, skeleton, spinner, table, textarea.
    • Moved shared theme/tokens/base styles to @repo/ui/styles.css with package source scanning.
    • Added package build/type-check config and compatibility tests.
  • Refactors

    • Start and Crew re-export primitives and cn from @repo/ui/*; Storybook imports updated to package entry points.
    • App styles import @repo/ui/styles.css; removed duplicated theme config in apps.
    • Updated docs and the UI inventory script to reflect package ownership.

Written for commit a0b1e25. Summary will update on new commits.

Review in cubic

@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@zacjones93, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 3 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: aaed3234-717b-40dc-b242-55eaa73d1a5d

📥 Commits

Reviewing files that changed from the base of the PR and between ae63ca9 and a0b1e25.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (52)
  • apps/crew/package.json
  • apps/crew/src/components/ui/badge.tsx
  • apps/crew/src/components/ui/button.tsx
  • apps/crew/src/components/ui/card.tsx
  • apps/crew/src/components/ui/input.tsx
  • apps/crew/src/components/ui/label.tsx
  • apps/crew/src/components/ui/separator.tsx
  • apps/crew/src/components/ui/skeleton.tsx
  • apps/crew/src/components/ui/spinner.tsx
  • apps/crew/src/components/ui/table.tsx
  • apps/crew/src/components/ui/textarea.tsx
  • apps/crew/src/styles.css
  • apps/crew/src/utils/cn.ts
  • apps/wodsmith-start/docs/ui-library-inventory.md
  • apps/wodsmith-start/package.json
  • apps/wodsmith-start/scripts/generate-ui-library-inventory.mjs
  • apps/wodsmith-start/src/components/ui/badge.stories.tsx
  • apps/wodsmith-start/src/components/ui/badge.tsx
  • apps/wodsmith-start/src/components/ui/button.stories.tsx
  • apps/wodsmith-start/src/components/ui/button.tsx
  • apps/wodsmith-start/src/components/ui/card.stories.tsx
  • apps/wodsmith-start/src/components/ui/card.tsx
  • apps/wodsmith-start/src/components/ui/input.stories.tsx
  • apps/wodsmith-start/src/components/ui/input.tsx
  • apps/wodsmith-start/src/components/ui/label.tsx
  • apps/wodsmith-start/src/components/ui/separator.tsx
  • apps/wodsmith-start/src/components/ui/skeleton.tsx
  • apps/wodsmith-start/src/components/ui/spinner.tsx
  • apps/wodsmith-start/src/components/ui/table.tsx
  • apps/wodsmith-start/src/components/ui/textarea.tsx
  • apps/wodsmith-start/src/styles.css
  • apps/wodsmith-start/src/utils/cn.ts
  • biome.json
  • lat.md/ui-library.md
  • packages/ui/biome.json
  • packages/ui/package.json
  • packages/ui/src/components/badge.tsx
  • packages/ui/src/components/button.tsx
  • packages/ui/src/components/card.tsx
  • packages/ui/src/components/input.tsx
  • packages/ui/src/components/label.tsx
  • packages/ui/src/components/separator.tsx
  • packages/ui/src/components/skeleton.tsx
  • packages/ui/src/components/spinner.tsx
  • packages/ui/src/components/table.tsx
  • packages/ui/src/components/textarea.tsx
  • packages/ui/src/styles.css
  • packages/ui/src/utils/cn.ts
  • packages/ui/test/compatibility.test.ts
  • packages/ui/tsconfig.build.json
  • packages/ui/tsconfig.json
  • packages/ui/vitest.config.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/ui-package-foundation

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.

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Copy Markdown
Contributor Author

LGTM — no blocking findings in the stacked diff ae63ca98f..a0b1e2518.

Independent review covered the @repo/ui production boundary and direct subpath exports, normalized source identity for the ten primitives plus cn, Start/Crew compatibility re-exports with zero route-file churn, Tailwind v4 source scanning and single global token/body ownership per app, Storybook direct package imports, compatibility/style tests, inventory accuracy, Biome scope, lockfile/runtime resolution, and tree-shaking evidence.

Validation repeated on Node 24.15.0 / Corepack pnpm 9.12.1:

  • frozen install; @repo/ui build, type-check, 12/12 tests, and lint
  • Start and Crew type-checks
  • Storybook static build plus light/dark Canvas and Docs browser smoke with no page errors
  • UI inventory, lat check, and stacked git diff --check
  • Start/Crew production builds were attempted and stopped before compilation only because their generated .alchemy/local/wrangler.jsonc files are absent

Two reviewed non-blockers:

  • packages/ui resolves React 19.2.4 for its dev/peer graph while Start/Crew resolve 19.2.3, but the production-like Storybook output contains only React 19.2.3 and all browser smokes pass.
  • @repo/ui build emits JS but no declarations; this is consistent with the current private, typed-source export map. It would need declaration output before any future switch to dist/publishable exports.

Live state at review time: CI and Git Town succeeded; E2E Tests are still in progress. CodeRabbit was rate-limited and produced no findings or review threads, so it was not treated as approval.

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@zacjones93
zacjones93 merged commit d6316c1 into codex/ui-library-foundation Jul 15, 2026
53 of 264 checks passed
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