Skip to content

Commit

Permalink
build(types): --clean option for package isolation
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
turadg committed Oct 2, 2023
1 parent 7864b57 commit dbb6522
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/ERTP/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion packages/governance/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion packages/notifier/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion packages/zoe/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit dbb6522

Please sign in to comment.