From dbb6522191e76daa7210fc705be262cbffdebd91 Mon Sep 17 00:00:00 2001 From: Turadg Aleahmad Date: Mon, 2 Oct 2023 14:50:55 -0700 Subject: [PATCH] build(types): --clean option for package isolation The postpack of a previous package only cleans up files in that package. Its prepack may build files in other packages that it doesn't clean up. The remants were causing errors like: ``` > @agoric/governance@0.10.4-dev-5988fad.0 prepack /home/runner/work/agoric-sdk/agoric-sdk/packages/governance > echo "export {}; " | cat - src/types-ambient.js > src/types.js && tsc --build tsconfig.build.json error TS5055: Cannot write file '/home/runner/work/agoric-sdk/agoric-sdk/packages/ERTP/exported.d.ts' because it would overwrite input file. ``` (in 'https://github.com/Agoric/agoric-sdk/actions/runs/6346051963/job/17239010386?pr=8410'\) This makes the build clean up files in the way. --- packages/ERTP/package.json | 2 +- packages/governance/package.json | 2 +- packages/notifier/package.json | 2 +- packages/zoe/package.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/ERTP/package.json b/packages/ERTP/package.json index 219d17fa4fe..0fb9f53e104 100644 --- a/packages/ERTP/package.json +++ b/packages/ERTP/package.json @@ -9,7 +9,7 @@ }, "scripts": { "build": "exit 0", - "prepack": "echo \"export {}; \" | cat - src/types-ambient.js > src/types.js && tsc --build tsconfig.build.json", + "prepack": "echo \"export {}; \" | cat - src/types-ambient.js > src/types.js && tsc --build --clean tsconfig.build.json", "postpack": "git clean -f '*.d.ts*' src/types.js", "test": "ava", "test:c8": "c8 $C8_OPTIONS ava", diff --git a/packages/governance/package.json b/packages/governance/package.json index 9e84a05e88b..0da53fc5ab0 100644 --- a/packages/governance/package.json +++ b/packages/governance/package.json @@ -10,7 +10,7 @@ "scripts": { "build": "yarn build:bundles", "build:bundles": "node ./scripts/build-bundles.js", - "prepack": "echo \"export {}; \" | cat - src/types-ambient.js > src/types.js && tsc --build tsconfig.build.json", + "prepack": "echo \"export {}; \" | cat - src/types-ambient.js > src/types.js && tsc --build --clean tsconfig.build.json", "postpack": "git clean -f '*.d.ts*' src/types.js", "test": "ava", "test:c8": "c8 $C8_OPTIONS ava --config=ava-nesm.config.js", diff --git a/packages/notifier/package.json b/packages/notifier/package.json index f332a09cf49..6fa33635fd7 100644 --- a/packages/notifier/package.json +++ b/packages/notifier/package.json @@ -9,7 +9,7 @@ }, "scripts": { "build": "exit 0", - "prepack": "echo \"export {}; \" | cat - src/types-ambient.js > src/types.js && tsc --build tsconfig.build.json", + "prepack": "echo \"export {}; \" | cat - src/types-ambient.js > src/types.js && tsc --build --clean tsconfig.build.json", "postpack": "git clean -f '*.d.ts*' src/types.js", "test": "ava", "test:c8": "c8 $C8_OPTIONS ava --config=ava-nesm.config.js", diff --git a/packages/zoe/package.json b/packages/zoe/package.json index 3d411694af8..db86ba96d19 100644 --- a/packages/zoe/package.json +++ b/packages/zoe/package.json @@ -10,7 +10,7 @@ "scripts": { "build": "yarn build:bundles", "build:bundles": "node scripts/build-bundles.js", - "prepack": "echo \"export {}; \" | cat - tools/types-ambient.js > tools/types.js && tsc --build tsconfig.build.json", + "prepack": "echo \"export {}; \" | cat - tools/types-ambient.js > tools/types.js && tsc --build --clean tsconfig.build.json", "postpack": "git clean -f '*.d.ts*' tools/types.js", "test": "ava --verbose", "test:c8": "c8 $C8_OPTIONS ava --config=ava-nesm.config.js",