File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -14,22 +14,14 @@ describe('cli/index', () => {
1414 } ) ;
1515
1616 test ( 'works' , async ( ) => {
17- const wait = new Promise < void > ( ( resolve ) =>
18- mocks . main . mockImplementationOnce ( ( ) => resolve ( ) ) ,
19- ) ;
2017 await import ( './index.ts' ) ;
21- await wait ;
2218 expect ( mocks . main ) . toHaveBeenCalledTimes ( 1 ) ;
2319 expect ( globalThis ) . not . toHaveProperty ( '__bundlerPathsOverrides' ) ;
2420 } ) ;
2521
2622 test ( 'uses sea' , async ( ) => {
2723 mocks . isSea . mockReturnValue ( true ) ;
28- const wait = new Promise < void > ( ( resolve ) =>
29- mocks . main . mockImplementationOnce ( ( ) => resolve ( ) ) ,
30- ) ;
3124 await import ( './index.ts' ) ;
32- await wait ;
3325 expect ( mocks . main ) . toHaveBeenCalledTimes ( 1 ) ;
3426 expect ( globalThis ) . toHaveProperty ( '__bundlerPathsOverrides' , {
3527 'pino-pretty' : './pino-pretty.js' ,
Original file line number Diff line number Diff line change @@ -16,7 +16,5 @@ if (isSea()) {
1616 } ) ;
1717}
1818
19- void ( async ( ) => {
20- const m = await import ( './main.ts' ) ;
21- await m . main ( ) ;
22- } ) ( ) ;
19+ const m = await import ( './main.ts' ) ;
20+ await m . main ( ) ;
Original file line number Diff line number Diff line change @@ -57,7 +57,7 @@ const bundle = await rolldown({
5757} ) ;
5858
5959shell . echo ( 'Writing containerbase-cli bundle ...' ) ;
60- await bundle . write ( { dir : 'dist/app' , format : 'commonjs ' , cleanDir : true } ) ;
60+ await bundle . write ( { dir : 'dist/app' , format : 'esm ' , cleanDir : true } ) ;
6161
6262await fs . writeFile (
6363 './dist/package.json' ,
@@ -66,7 +66,7 @@ await fs.writeFile(
6666 name : 'containerbase-cli' ,
6767 version,
6868 private : true ,
69- type : 'commonjs ' ,
69+ type : 'module ' ,
7070 bin : {
7171 'containerbase-cli' : './app/containerbase-cli.js' ,
7272 } ,
You can’t perform that action at this time.
0 commit comments