Skip to content

fix(ui): expose v2 component css via package exports#30294

Open
jerome-benoit wants to merge 1 commit into
anomalyco:devfrom
jerome-benoit:fix/ui-v2-css-exports
Open

fix(ui): expose v2 component css via package exports#30294
jerome-benoit wants to merge 1 commit into
anomalyco:devfrom
jerome-benoit:fix/ui-v2-css-exports

Conversation

@jerome-benoit
Copy link
Copy Markdown
Contributor

Issue for this PR

Closes #30292

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Adds ./v2/*.css to the @opencode-ai/ui exports map.

The existing ./v2/* entry hardcodes a .tsx target, so CSS imports like @opencode-ai/ui/v2/text-input-v2.css (added in #29689 by packages/app/src/components/settings-v2/settings-v2.css) resolved to non-existent .css.tsx files and vite build failed in @tailwindcss/vite:generate:build.

Node's exports-map specificity rule picks the longer key (./v2/*.css) for .css requests automatically; the existing ./v2/* continues to handle .tsx requests unchanged.

How did you verify your code works?

bun run --cwd packages/app build
  • Without the patch, on dev tip: same Can't resolve '@opencode-ai/ui/v2/text-input-v2.css' error as build-cli run 26783826518 and deploy run 26783826509.
  • With the patch: build succeeds in ~10s, exit 0.

This is the same build path used by the Nix package and CI (packages/opencode/script/build.ts:31 shells out to bun run --cwd packages/app build).

Screenshots / recordings

N/A.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

The "./v2/*" entry hardcodes a .tsx target, so CSS imports like
@opencode-ai/ui/v2/text-input-v2.css resolved to non-existent
.css.tsx files and broke vite build.
jerome-benoit added a commit to jerome-benoit/dotfiles that referenced this pull request Jun 1, 2026
Carry anomalyco/opencode#30294 (state: open)
which fixes vite build break: 'packages/ui/package.json' './v2/*' export
hardcodes a .tsx target, so CSS imports like
@opencode-ai/ui/v2/text-input-v2.css resolved to non-existent
.css.tsx files.

PR base SHA matches our locked rev (a821029258fd) — patch applies with
zero offset/fuzz via pkgs.applyPatches verified.

Drop the patch when the PR merges into anomalyco/opencode upstream and
the lock advances past the merge commit.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Build fails: cannot resolve @opencode-ai/ui/v2/text-input-v2.css

1 participant