Skip to content

Commit 0ba8129

Browse files
rcurrieclaude
andcommitted
ci: typecheck only what the plugin actually imports
The release workflow failed on `tsc --noEmit`: the plugin's tsconfig globbed `../engine-js/src/**/*.ts`, which sweeps in the engine's *Node* adapters (`src/pdf.ts`, `src/vlm.ts`). Those import `@napi-rs/canvas` and `pdfjs-dist/legacy` — dependencies of the engine-js package, which CI never installs because it runs `npm ci` in plugin/ alone. It passed locally only because engine-js/node_modules happened to be populated from running that package's tests, so the check was quietly machine-dependent. Listing just the plugin's own sources is both the fix and the more accurate description: tsc follows imports, so engine core/ and browser/ are still fully checked — verified by planting a type error in browser/device.ts and watching it fail — while the Node adapters, which the plugin never imports, are left to engine-js's own tsconfig. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent 8549943 commit 0ba8129

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

plugin/tsconfig.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,13 @@
1414
// Bundler-mode resolution; point at it directly.
1515
"paths": { "onnxruntime-web": ["./node_modules/onnxruntime-web/types.d.ts"] }
1616
},
17-
"include": ["*.ts", "../engine-js/src/**/*.ts"]
17+
// Only the plugin's own sources are listed. tsc follows imports from here, so
18+
// the engine's core/ and browser/ modules are still fully checked — while its
19+
// *Node* adapters (src/pdf.ts, src/vlm.ts) are not, which is the point: they
20+
// import @napi-rs/canvas and pdfjs-dist/legacy, dependencies of the engine-js
21+
// package that the plugin does not install. Globbing all of engine-js/src
22+
// typechecked clean on a machine that happened to have engine-js/node_modules
23+
// populated, and failed in CI, which installs only plugin/. engine-js has its
24+
// own tsconfig for its own files.
25+
"include": ["*.ts"]
1826
}

0 commit comments

Comments
 (0)