@@ -7,42 +7,42 @@ import process from 'node:process';
77import childProcess from 'node:child_process' ;
88
99const projectPath = path . dirname (
10- path . dirname ( url . fileURLToPath ( import . meta. url ) ) ,
10+ path . dirname ( url . fileURLToPath ( import . meta. url ) ) ,
1111) ;
1212
1313const platform = os . platform ( ) ;
1414
1515/* eslint-disable no-console */
1616async function main ( argv = process . argv ) {
17- argv = argv . slice ( 2 ) ;
18- const tscArgs = [ `-p` , path . join ( projectPath , 'tsconfig.build.json' ) ] ;
19- console . error ( 'Running tsc:' ) ;
20- console . error ( [ 'tsc' , ...tscArgs ] . join ( ' ' ) ) ;
21- childProcess . execFileSync ( 'tsc' , tscArgs , {
22- stdio : [ 'inherit' , 'inherit' , 'inherit' ] ,
23- windowsHide : true ,
24- encoding : 'utf-8' ,
25- shell : platform === 'win32' ? true : false ,
26- } ) ;
27- const jestArgs = [ ...argv ] ;
28- console . error ( 'Running jest:' ) ;
29- console . error ( [ 'jest' , ...jestArgs ] . join ( ' ' ) ) ;
30- childProcess . execFileSync ( 'jest' , jestArgs , {
31- env : {
32- ...process . env ,
33- NODE_OPTIONS : '--experimental-vm-modules' ,
34- } ,
35- stdio : [ 'inherit' , 'inherit' , 'inherit' ] ,
36- windowsHide : true ,
37- encoding : 'utf-8' ,
38- shell : platform === 'win32' ? true : false ,
39- } ) ;
17+ argv = argv . slice ( 2 ) ;
18+ const tscArgs = [ `-p` , path . join ( projectPath , 'tsconfig.build.json' ) ] ;
19+ console . error ( 'Running tsc:' ) ;
20+ console . error ( [ 'tsc' , ...tscArgs ] . join ( ' ' ) ) ;
21+ childProcess . execFileSync ( 'tsc' , tscArgs , {
22+ stdio : [ 'inherit' , 'inherit' , 'inherit' ] ,
23+ windowsHide : true ,
24+ encoding : 'utf-8' ,
25+ shell : platform === 'win32' ? true : false ,
26+ } ) ;
27+ const jestArgs = [ ...argv ] ;
28+ console . error ( 'Running jest:' ) ;
29+ console . error ( [ 'jest' , ...jestArgs ] . join ( ' ' ) ) ;
30+ childProcess . execFileSync ( 'jest' , jestArgs , {
31+ env : {
32+ ...process . env ,
33+ NODE_OPTIONS : '--experimental-vm-modules' ,
34+ } ,
35+ stdio : [ 'inherit' , 'inherit' , 'inherit' ] ,
36+ windowsHide : true ,
37+ encoding : 'utf-8' ,
38+ shell : platform === 'win32' ? true : false ,
39+ } ) ;
4040}
4141/* eslint-enable no-console */
4242
4343if ( import . meta. url . startsWith ( 'file:' ) ) {
44- const modulePath = url . fileURLToPath ( import . meta. url ) ;
45- if ( process . argv [ 1 ] === modulePath ) {
46- void main ( ) ;
47- }
44+ const modulePath = url . fileURLToPath ( import . meta. url ) ;
45+ if ( process . argv [ 1 ] === modulePath ) {
46+ void main ( ) ;
47+ }
4848}
0 commit comments