refactor(vite-config): drop the inert duplicate-vite Plugin cast#2156
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Removes the
as UserConfig['plugins']/as PluginOption[]cast from the sharedworkspaceAppConfighelper 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
vitepeer-variant copies (vite@7.3.5+4ece…vs+682e…), whosePlugintypes are nominally unrelated. That state no longer exists.On current
main's isolated install, bun resolves a singlevitepeer-variant (vite@7.3.5+9df36cbd11bbdf29) that every package symlinks to: the apps,@sveltejs/kit,@tailwindcss/vite, and@epicenter/vite-configalike. One physicalvitemeans onePlugintype, so the plugin array already satisfiesUserConfig['plugins']and the cast is dead weight. The two hashes #2151 saw are gone from the lockfile (regenerated since).Proof
svelte-checkpasses with 0 errors across all nine vite-config consumers (fuji, honeycrisp, opensidian, matter, vocab, whispering, todos, skills, api/ui) andtscon 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
viteand bring the clash back. The helper comment now says exactly that and points at the one place to restore the cast ifTwo different types with this name exist, but they are unrelatedreappears in CI.Need help on this PR? Tag
/codesmithwith what you need. Autofix is disabled.