Fix BL-16525 vp test cannot resolve jsdom under vite-plus bundled runner#8049
Fix BL-16525 vp test cannot resolve jsdom under vite-plus bundled runner#8049hatton wants to merge 1 commit into
vp test cannot resolve jsdom under vite-plus bundled runner#8049Conversation
…under vite-plus's bundled runner https://issues.bloomlibrary.org/youtrack/issue/BL-16525 Add vite-plus 0.2.2 as a devDependency in src/BloomBrowserUI. The global `vp` binary prefers a project-local vite-plus install over its own bundled toolchain (per vite-plus's merge-global-and-local-cli RFC). vitest declares jsdom as an optional peer dependency, so pnpm links the project's jsdom@26.1.0 into the local install's vitest, letting `vp test` load the jsdom test environment. vp's bundled vitest in ~/.vite-plus is installed without jsdom and cannot resolve it at all, which caused every forks worker to fail ("Cannot find package 'jsdom'", 47 errors, no tests run). Also document in ReadMe.md that `pnpm test` is the canonical test command and why `vp test` now works. Notes: - vite-plus is pinned at 0.2.2 because the repo's 7-day minimumReleaseAge policy (src/BloomBrowserUI/pnpm-workspace.yaml) blocks 0.2.4, published 2026-07-08. - `vp test` runs vite-plus's vitest (4.1.9) while `pnpm test` runs the project's pinned vitest (4.0.8); both pass. - `pnpm peers check` gains a few version-skew warnings for the optional @vitest/browser-* peers; browser mode is disabled in vite.config.mts. Tests: full front-end suite green under both runners in this worktree — `vp test` 498 passed / 5 skipped (46 files; previously 47 errors, no tests), `pnpm test` 498 passed / 5 skipped. `pnpm install --frozen-lockfile` confirms the lockfile is in sync. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
| Filename | Overview |
|---|---|
| ReadMe.md | Adds a paragraph explaining pnpm test is canonical and why vp test now works as a secondary option |
| src/BloomBrowserUI/package.json | Adds vite-plus@0.2.2 as an exact-pinned devDependency to give the local project a vite-plus install that pnpm will peer-link jsdom into |
| src/BloomBrowserUI/pnpm-lock.yaml | Lockfile updated with vite-plus and transitive pull-ins: lightningcss@1.32.0 introduced into vite's peer chain, @vitest/browser-preview@4.1.9 appears in vitest@4.0.8's resolution (version skew, acknowledged in PR), plus @oxfmt/@oxc-project binaries from vite-plus's formatter toolchain |
Reviews (1): Last reviewed commit: "Fix BL-16525 `vp test` cannot resolve js..." | Re-trigger Greptile
| "vite": "7.1.5", | ||
| "vite-plugin-pug": "0.4.1", | ||
| "vite-plugin-static-copy": "3.1.3", | ||
| "vite-plus": "0.2.2", |
There was a problem hiding this comment.
[Devin] Investigate: Adding vite-plus pulls in lightningcss as a transitive peer dependency of vite
Adding vite-plus@0.2.2 causes lightningcss@1.32.0 to be resolved as a peer dependency of vite@7.1.5. Previously, vite's resolution string was vite@7.1.5(@types/node@22.9.0)(less@3.13.1)(yaml@2.9.0) and it is now vite@7.1.5(@types/node@22.9.0)(less@3.13.1)(lightningcss@1.32.0)(yaml@2.9.0). While lightningcss is an optional peer dep of vite and this is expected, its presence can change CSS minification behavior in production builds (vite uses lightningcss for CSS minification when it's available). This is dev-only and unlikely to cause issues, but worth being aware of if CSS output changes are observed after this merge.
There was a problem hiding this comment.
[Claude Fable 5] Assessment: no behavior change expected. Vite only uses lightningcss when explicitly configured (css.transformer: 'lightningcss' or build.cssMinify: 'lightningcss') — mere presence in node_modules does not switch the CSS pipeline. This repo's vite.config.mts sets build.minify: false and never configures lightningcss, so it stays on the default (postcss/esbuild) path. The lockfile resolution-string change is real but inert.
|
[Claude Fable 5] Consulted Devin on 2026-07-10 ~23:05Z up to commit a45cb79. Result: 0 Bugs, 1 Investigate flag (mirrored as an inline thread), 1 Informational (skipped per convention). |
Fixes BL-16525: bare
vp testinsrc/BloomBrowserUIfailed withCannot find package 'jsdom'(47 errors, no tests run) because vite-plus's bundled vitest in~/.vite-plusis installed without jsdom, and vitest only gets jsdom via an optional peer dependency that pnpm links when vitest lives in the project.Fix
vite-plus: 0.2.2as an exact devDependency insrc/BloomBrowserUI. The globalvpbinary prefers a project-local vite-plus install over its bundled toolchain, and pnpm peer-links ourjsdom@26.1.0into that install's vitest, sovp testnow loads the jsdom environment.pnpm testis the canonical test command and whyvp testworks.Notes
minimumReleaseAgepolicy blocks 0.2.4 (published 2026-07-08).vp testruns vite-plus's vitest 4.1.9 whilepnpm testruns the pinned 4.0.8; both pass the full suite (498 passed / 5 skipped).pnpm peers checkgains a few@vitest/browser-*version-skew warnings; browser mode is disabled in vite.config.mts.🤖 Generated with Claude Code
Devin review
This change is