Skip to content

Commit babb888

Browse files
committed
test: ci usage
1 parent 34952a6 commit babb888

1 file changed

Lines changed: 13 additions & 6 deletions

File tree

packages/contract/scripts/patch-types.cjs

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,20 @@ const path = require("node:path");
44

55
const root = path.resolve(__dirname, "..");
66
const 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");
1522
fs.mkdirSync(path.dirname(distIndex), { recursive: true });
1623
fs.writeFileSync(distIndex, content, "utf8");

0 commit comments

Comments
 (0)