File tree Expand file tree Collapse file tree
packages/contract/scripts Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,13 +4,20 @@ const path = require("node:path");
44
55const root = path . resolve ( __dirname , ".." ) ;
66const distIndex = path . join ( root , "dist" , "index.d.ts" ) ;
7- const managedDts = "./managed/midnight-setup/contract/index.d.ts" ;
7+ const managedDts = path . join (
8+ root ,
9+ "dist" ,
10+ "managed" ,
11+ "midnight-setup" ,
12+ "contract" ,
13+ "index.d.ts"
14+ ) ;
815
9- const content = [
10- `export * from "${ managedDts } ";` ,
11- `export type * from "${ managedDts } ";` ,
12- ""
13- ] . join ( "\n" ) ;
16+ if ( ! fs . existsSync ( managedDts ) ) {
17+ console . error ( `[patch-types] Missing generated types: ${ managedDts } ` ) ;
18+ process . exit ( 1 ) ;
19+ }
1420
21+ const content = fs . readFileSync ( managedDts , "utf8" ) ;
1522fs . mkdirSync ( path . dirname ( distIndex ) , { recursive : true } ) ;
1623fs . writeFileSync ( distIndex , content , "utf8" ) ;
You can’t perform that action at this time.
0 commit comments