Skip to content

Commit 5c97290

Browse files
authored
fix(test): add @standard-schema/spec to EXTERNAL_BLOCKLIST (#498)
@vitest/expect imports StandardSchemaV1 from @standard-schema/spec in its type definitions only (not in JS files). Since collectLeafDependencies() only scans .js files, this package was not detected and bundled. Fix by adding @standard-schema/spec to EXTERNAL_BLOCKLIST and as a runtime dependency, allowing TypeScript to resolve types through normal node_modules resolution. > TypeCheckError: Cannot find module '@standard-schema/spec' or its corresponding type declarations. ❯ ../../node_modules/.pnpm/@voidzero-dev+vite-plus-test@0.0.0-4d2367587d11c412d283847253d95e4e36ace419_@types+node_b06a8e0da48f743d40c7a7d8079f73e5/node_modules/@voidzero-dev/vite-plus-test/dist/@vitest/expect/index.d.ts:6:34 <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Ensures @standard-schema/spec (types used by `@vitest/expect`) is installed and not bundled so TypeScript can resolve it while Rolldown keeps it external. > > - Add `@standard-schema/spec` to `EXTERNAL_BLOCKLIST` in `build.ts` and document it in `BUNDLING.md` > - Declare `@standard-schema/spec@^1.1.0` in `packages/test/package.json`; update lockfile and align `@vitest/expect` to use 1.1.0 > > This fixes missing-type errors without changing runtime code paths. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 2c3a2d6. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
1 parent 34a2960 commit 5c97290

4 files changed

Lines changed: 20 additions & 13 deletions

File tree

packages/test/BUNDLING.md

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -72,15 +72,16 @@ These remain in `dependencies` and are installed with the package:
7272

7373
These packages are explicitly kept external in `EXTERNAL_BLOCKLIST` during the Rolldown build:
7474

75-
| Package | Reason |
76-
| ------------------ | ----------------------------------------- |
77-
| `playwright` | Native bindings, user must install |
78-
| `webdriverio` | Native bindings, user must install |
79-
| `debug` | Environment detection breaks when bundled |
80-
| `happy-dom` | Optional peer dependency |
81-
| `jsdom` | Optional peer dependency |
82-
| `@edge-runtime/vm` | Optional peer dependency |
83-
| `msw`, `msw/*` | Optional peer dependency for mocking |
75+
| Package | Reason |
76+
| ----------------------- | ----------------------------------------- |
77+
| `playwright` | Native bindings, user must install |
78+
| `webdriverio` | Native bindings, user must install |
79+
| `debug` | Environment detection breaks when bundled |
80+
| `happy-dom` | Optional peer dependency |
81+
| `jsdom` | Optional peer dependency |
82+
| `@edge-runtime/vm` | Optional peer dependency |
83+
| `@standard-schema/spec` | Types-only import from @vitest/expect |
84+
| `msw`, `msw/*` | Optional peer dependency for mocking |
8485

8586
### Browser Plugin Exclude List
8687

@@ -398,6 +399,7 @@ const EXTERNAL_BLOCKLIST = new Set([
398399
// Peer dependencies - consumers must provide these
399400
'@edge-runtime/vm',
400401
'@opentelemetry/api',
402+
'@standard-schema/spec', // Types-only import from @vitest/expect
401403
'happy-dom',
402404
'jsdom',
403405

packages/test/build.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ const EXTERNAL_BLOCKLIST = new Set([
145145
// Peer dependencies - consumers must provide these
146146
'@edge-runtime/vm',
147147
'@opentelemetry/api',
148+
'@standard-schema/spec', // Types-only import from @vitest/expect
148149
'happy-dom',
149150
'jsdom',
150151

packages/test/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,7 @@
256256
"build": "oxnode -C dev ./build.ts"
257257
},
258258
"dependencies": {
259+
"@standard-schema/spec": "^1.1.0",
259260
"@types/chai": "^5.2.2",
260261
"@voidzero-dev/vite-plus-core": "workspace:*",
261262
"es-module-lexer": "^1.7.0",

pnpm-lock.yaml

Lines changed: 7 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)