Describe the bug
The global snapshot test harness currently cannot verify generated projects with the default Vite+ lint config intact.
create-framework-shim-astro and create-framework-shim-vue currently need to delete the generated lint config before running vp check --fix:
sed -i.bak -e '/jsPlugins/d' -e '/rules:/d' -e '/options:/d' vite.config.ts
Without this workaround, the global snapshot test cannot run vp check --fix with the default generated lint config because oxlint cannot load the built-in Vite+ plugin from:
jsPlugins: [{ name: "vite-plus", specifier: "vite-plus/oxlint-plugin" }]
This looks like a snapshot harness/environment issue rather than an Astro/Vue product behavior issue. The global snap tests run with --bin-dir ~/.vite-plus/bin, while the snap runner also creates temporary node_modules symlinks for local package resolution. That means the test environment mixes several module resolution roots:
- the test case temp cwd
- the snap runner temp
node_modules
- the generated project
node_modules
- the global CLI layout under
~/.vite-plus
As a result, vite-plus/oxlint-plugin may fail to resolve in vp check even though the generated config is valid and should be tested as-is.
I intend to submit a PR for this issue.
Reproduction
https://github.com/voidzero-dev/vite-plus
Steps to reproduce
-
Remove the sed workaround from packages/cli/snap-tests-global/create-framework-shim-astro/steps.json.
-
Optionally remove the same workaround from packages/cli/snap-tests-global/create-framework-shim-vue/steps.json.
-
Run the global snap test:
pnpm -F vite-plus snap-test-global -- --filter=create-framework-shim-astro
-
Observe that vp check --fix fails when the generated vite.config.ts keeps the default lint.jsPlugins entry for vite-plus/oxlint-plugin.
System Info
N/A for now. This issue tracks the repository's own `snap-test-global` harness behavior.
Used Package Manager
pnpm
Logs
he current workaround is visible in:
- `packages/cli/snap-tests-global/create-framework-shim-astro/steps.json`
- `packages/cli/snap-tests-global/create-framework-shim-vue/steps.json`
Both remove these generated config fields before `vp check --fix`:
- `jsPlugins`
- `rules`
- `options`
Suggested fix direction:
The `snap-test-global` harness should create an isolated global Vite+ installation layout that more closely matches the real global CLI layout, instead of relying on the developer/user `~/.vite-plus` state.
In particular:
- isolate `VP_HOME` under the snap test temp directory
- ensure the test global CLI root has a consistent `bin` and `node_modules/vite-plus` layout
- ensure `vite-plus/oxlint-plugin` resolves from the global CLI package when running `vp check`
- remove the `sed` workaround from the framework shim snap tests so the generated default lint config is covered by the snapshot
This would make the product more robust by testing the intended global CLI behavior directly, rather than weakening the generated config during tests.
Validations
Describe the bug
The global snapshot test harness currently cannot verify generated projects with the default Vite+ lint config intact.
create-framework-shim-astroandcreate-framework-shim-vuecurrently need to delete the generatedlintconfig before runningvp check --fix:Without this workaround, the global snapshot test cannot run
vp check --fixwith the default generated lint config because oxlint cannot load the built-in Vite+ plugin from:This looks like a snapshot harness/environment issue rather than an Astro/Vue product behavior issue. The global snap tests run with
--bin-dir ~/.vite-plus/bin, while the snap runner also creates temporarynode_modulessymlinks for local package resolution. That means the test environment mixes several module resolution roots:node_modulesnode_modules~/.vite-plusAs a result,
vite-plus/oxlint-pluginmay fail to resolve invp checkeven though the generated config is valid and should be tested as-is.I intend to submit a PR for this issue.
Reproduction
https://github.com/voidzero-dev/vite-plus
Steps to reproduce
Remove the
sedworkaround frompackages/cli/snap-tests-global/create-framework-shim-astro/steps.json.Optionally remove the same workaround from
packages/cli/snap-tests-global/create-framework-shim-vue/steps.json.Run the global snap test:
Observe that
vp check --fixfails when the generatedvite.config.tskeeps the defaultlint.jsPluginsentry forvite-plus/oxlint-plugin.System Info
Used Package Manager
pnpm
Logs
Validations