@@ -6,29 +6,42 @@ import path from 'node:path';
66const runTypeCheck = ( source : string ) : void => {
77 const dir = mkdtempSync ( path . join ( process . cwd ( ) , '.tmp-treeshakable-types-' ) ) ;
88 const file = path . join ( dir , 'fixture.ts' ) ;
9+ const tsconfig = path . join ( dir , 'tsconfig.json' ) ;
910
1011 try {
1112 writeFileSync ( file , source ) ;
12- execFileSync (
13- process . execPath ,
14- [
15- 'node_modules/typescript/bin/tsc' ,
16- '--ignoreConfig' ,
17- '--noEmit' ,
18- '--module' ,
19- 'esnext' ,
20- '--target' ,
21- 'es2023' ,
22- '--moduleResolution' ,
23- 'bundler' ,
24- '--strict' ,
25- '--skipLibCheck' ,
26- '--lib' ,
27- 'esnext,dom' ,
28- file ,
29- ] ,
30- { cwd : process . cwd ( ) , stdio : 'inherit' } ,
13+ writeFileSync (
14+ tsconfig ,
15+ JSON . stringify (
16+ {
17+ compilerOptions : {
18+ noEmit : true ,
19+ module : 'esnext' ,
20+ target : 'es2023' ,
21+ moduleResolution : 'bundler' ,
22+ strict : true ,
23+ skipLibCheck : true ,
24+ lib : [ 'esnext' , 'dom' ] ,
25+ paths : {
26+ '@sqlite.org/sqlite-wasm' : [ '../src/index.d.ts' ] ,
27+ '@sqlite.org/sqlite-wasm/core' : [ '../src/core.d.ts' ] ,
28+ '@sqlite.org/sqlite-wasm/vtab' : [ '../src/vtab.d.ts' ] ,
29+ '@sqlite.org/sqlite-wasm/vfs/kvvfs' : [ '../src/vfs/kvvfs.d.ts' ] ,
30+ '@sqlite.org/sqlite-wasm/vfs/opfs' : [ '../src/vfs/opfs.d.ts' ] ,
31+ '@sqlite.org/sqlite-wasm/vfs/opfs-sahpool' : [ '../src/vfs/opfs-sahpool.d.ts' ] ,
32+ '@sqlite.org/sqlite-wasm/vfs/opfs-wl' : [ '../src/vfs/opfs-wl.d.ts' ] ,
33+ } ,
34+ } ,
35+ include : [ file ] ,
36+ } ,
37+ null ,
38+ 2 ,
39+ ) ,
3140 ) ;
41+ execFileSync ( process . execPath , [ 'node_modules/typescript/bin/tsc' , '--project' , tsconfig ] , {
42+ cwd : process . cwd ( ) ,
43+ stdio : 'inherit' ,
44+ } ) ;
3245 } finally {
3346 rmSync ( dir , { recursive : true , force : true } ) ;
3447 }
0 commit comments