Skip to content

refactor(vite-config): drop the inert duplicate-vite Plugin cast#2156

Merged
braden-w merged 1 commit into
mainfrom
refactor/vite-config-unshare-plugins
Jun 21, 2026
Merged

refactor(vite-config): drop the inert duplicate-vite Plugin cast#2156
braden-w merged 1 commit into
mainfrom
refactor/vite-config-unshare-plugins

Conversation

@braden-w

@braden-w braden-w commented Jun 21, 2026

Copy link
Copy Markdown
Member

What

Removes the as UserConfig['plugins'] / as PluginOption[] cast from the shared workspaceAppConfig helper and the three standalone configs (matter, api/ui, skills). Net −7 lines, no behavior change.

Why

#2151 added the cast to bridge two physically distinct vite peer-variant copies (vite@7.3.5+4ece… vs +682e…), whose Plugin types are nominally unrelated. That state no longer exists.

On current main's isolated install, bun resolves a single vite peer-variant (vite@7.3.5+9df36cbd11bbdf29) that every package symlinks to: the apps, @sveltejs/kit, @tailwindcss/vite, and @epicenter/vite-config alike. One physical vite means one Plugin type, so the plugin array already satisfies UserConfig['plugins'] and the cast is dead weight. The two hashes #2151 saw are gone from the lockfile (regenerated since).

Proof

svelte-check passes with 0 errors across all nine vite-config consumers (fuji, honeycrisp, opensidian, matter, vocab, whispering, todos, skills, api/ui) and tsc on the package itself.

Fragility, recorded in the comment

bun computes the peer-variant count at install time (it is not pinned in the lockfile), so a future graph or bun-version change could re-split vite and bring the clash back. The helper comment now says exactly that and points at the one place to restore the cast if Two different types with this name exist, but they are unrelated reappears in CI.


View with Codesmith Autofix with Codesmith
Need help on this PR? Tag /codesmith with what you need. Autofix is disabled.

The isolated install now resolves a single `vite` peer-variant
(`vite@7.3.5+9df36cbd11bbdf29`) that every package symlinks to: the apps,
@sveltejs/kit, @tailwindcss/vite, and @epicenter/vite-config alike. With one
physical `vite`, there is one `Plugin` type, so the plugin array already matches
`UserConfig['plugins']` and the cast added in #2151 is dead weight.

svelte-check passes with 0 errors across all nine vite-config consumers after
removing the cast from the shared helper and the three standalone configs
(matter, api/ui, skills). The bun peer-variant count is computed at install time
rather than pinned in the lockfile, so a future graph or bun-version change could
re-split `vite`; the helper comment now records that and points at the single
place to restore the cast if the clash returns.
@braden-w braden-w merged commit 250db4b into main Jun 21, 2026
2 of 3 checks passed
@braden-w braden-w deleted the refactor/vite-config-unshare-plugins branch June 21, 2026 23:18
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