From a83af078166b91a74b789c57a7e9d70f549dff68 Mon Sep 17 00:00:00 2001 From: Turadg Aleahmad Date: Wed, 24 Apr 2024 10:16:19 -0700 Subject: [PATCH] build: emit types by pack hooks --- .github/workflows/ci.yml | 6 ----- CONTRIBUTING.md | 29 ---------------------- packages/base64/package.json | 4 +-- packages/bundle-source/package.json | 4 +-- packages/captp/package.json | 4 +-- packages/check-bundle/package.json | 4 +-- packages/cjs-module-analyzer/package.json | 4 +-- packages/cli/package.json | 4 +-- packages/common/package.json | 4 +-- packages/compartment-mapper/package.json | 4 +-- packages/daemon/package.json | 4 +-- packages/env-options/package.json | 4 +-- packages/errors/package.json | 4 +-- packages/evasive-transform/package.json | 4 +-- packages/eventual-send/package.json | 4 +-- packages/exo/package.json | 4 +-- packages/far/package.json | 4 +-- packages/import-bundle/package.json | 4 +-- packages/init/package.json | 4 +-- packages/lp32/package.json | 4 +-- packages/marshal/package.json | 4 +-- packages/memoize/package.json | 4 +-- packages/nat/package.json | 4 +-- packages/netstring/package.json | 4 +-- packages/pass-style/package.json | 4 +-- packages/patterns/package.json | 4 +-- packages/promise-kit/package.json | 4 +-- packages/ses-ava/package.json | 4 +-- packages/skel/package.json | 4 +-- packages/static-module-record/package.json | 4 +-- packages/stream-node/package.json | 4 +-- packages/stream/package.json | 4 +-- packages/syrup/package.json | 4 +-- packages/where/package.json | 4 +-- packages/zip/package.json | 4 +-- 35 files changed, 66 insertions(+), 101 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 81228b3c68..95e52f75b7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -330,12 +330,6 @@ jobs: - name: build run: yarn run build - - name: build:types - run: yarn lerna run build:types - - name: pack # Cannot use yarn lerna run pack run: yarn lerna exec yarn pack - - - name: clean:types - run: yarn lerna run clean:types diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9e2b677468..34804676aa 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -106,23 +106,6 @@ https://github.com/endojs/endo/labels/next-release yarn build ``` -* Generate types. - - ```sh - yarn lerna run build:types - ``` - - We generate types from the bottom up before publishing because this allows - each package to rely on the generated types of its dependencies in the - workspace. - -* Commit the generated types. - - ```sh - git add . - git commit -m 'chore: Add generated types' - ``` - * Recreate the changelogs with the current date *and* generate tags for the new versions. This is the effect of removing the `--no-git-tag-version` flag. @@ -161,18 +144,6 @@ https://github.com/endojs/endo/labels/next-release npm view ses ``` -* Revert the change that added generated types. - - ```sh - git revert HEAD^ - ``` - - This command should then efect no changes. - - ```sh - yarn lerna run clean:types - ``` - * Force push these changes back to the pull request branch. ```sh diff --git a/packages/base64/package.json b/packages/base64/package.json index f2d306cb68..0bca2a9629 100644 --- a/packages/base64/package.json +++ b/packages/base64/package.json @@ -32,8 +32,8 @@ }, "scripts": { "build": "exit 0", - "build:types": "tsc --build tsconfig.build.json", - "clean:types": "git clean -f '*.d.ts*'", + "prepack": "tsc --build tsconfig.build.json", + "postpack": "git clean -f '*.d.ts*'", "cover": "c8 ava", "lint": "yarn lint:types && yarn lint:eslint", "lint-fix": "eslint --fix .", diff --git a/packages/bundle-source/package.json b/packages/bundle-source/package.json index 240be6d5cb..7f9d7d7ccc 100644 --- a/packages/bundle-source/package.json +++ b/packages/bundle-source/package.json @@ -13,8 +13,8 @@ }, "scripts": { "build": "exit 0", - "build:types": "tsc --build tsconfig.build.json", - "clean:types": "git clean -f '*.d.ts*'", + "prepack": "tsc --build tsconfig.build.json", + "postpack": "git clean -f '*.d.ts*'", "test": "ava", "test:c8": "c8 $C8_OPTIONS ava --config=ava-nesm.config.js", "test:xs": "exit 0", diff --git a/packages/captp/package.json b/packages/captp/package.json index dab72490a4..285df8f934 100644 --- a/packages/captp/package.json +++ b/packages/captp/package.json @@ -35,8 +35,8 @@ }, "scripts": { "build": "exit 0", - "build:types": "tsc --build tsconfig.build.json", - "clean:types": "git clean -f '*.d.ts*'", + "prepack": "tsc --build tsconfig.build.json", + "postpack": "git clean -f '*.d.ts*'", "test": "ava", "test:c8": "c8 $C8_OPTIONS ava --config=ava-nesm.config.js", "test:xs": "exit 0", diff --git a/packages/check-bundle/package.json b/packages/check-bundle/package.json index 06919ae8df..006c005ddb 100644 --- a/packages/check-bundle/package.json +++ b/packages/check-bundle/package.json @@ -30,8 +30,8 @@ }, "scripts": { "build": "exit 0", - "build:types": "tsc --build tsconfig.build.json", - "clean:types": "git clean -f '*.d.ts*'", + "prepack": "tsc --build tsconfig.build.json", + "postpack": "git clean -f '*.d.ts*'", "lint": "yarn lint:types && yarn lint:eslint", "lint-fix": "eslint --fix .", "lint:eslint": "eslint .", diff --git a/packages/cjs-module-analyzer/package.json b/packages/cjs-module-analyzer/package.json index 9371088695..0f241b1eed 100644 --- a/packages/cjs-module-analyzer/package.json +++ b/packages/cjs-module-analyzer/package.json @@ -22,8 +22,8 @@ }, "scripts": { "build": "exit 0", - "build:types": "tsc --build tsconfig.build.json", - "clean:types": "git clean -f '*.d.ts*'", + "prepack": "tsc --build tsconfig.build.json", + "postpack": "git clean -f '*.d.ts*'", "cover": "c8 ava", "lint": "yarn lint:types && yarn lint:eslint", "lint-fix": "eslint --fix .", diff --git a/packages/cli/package.json b/packages/cli/package.json index bfb96f013e..8b3a68d0cd 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -22,8 +22,8 @@ "exports": {}, "scripts": { "build": "exit 0", - "build:types": "tsc --build tsconfig.build.json", - "clean:types": "git clean -f '*.d.ts*'", + "prepack": "tsc --build tsconfig.build.json", + "postpack": "git clean -f '*.d.ts*'", "lint": "yarn lint:types && yarn lint:eslint", "lint-fix": "eslint --fix .", "lint:eslint": "eslint .", diff --git a/packages/common/package.json b/packages/common/package.json index d6d6c89396..15abbd3960 100644 --- a/packages/common/package.json +++ b/packages/common/package.json @@ -29,8 +29,8 @@ }, "scripts": { "build": "exit 0", - "build:types": "tsc --build tsconfig.build.json", - "clean:types": "git clean -f '*.d.ts*'", + "prepack": "tsc --build tsconfig.build.json", + "postpack": "git clean -f '*.d.ts*'", "lint": "yarn lint:types && yarn lint:eslint", "lint-check": "yarn lint", "lint-fix": "yarn lint:eslint --fix && yarn lint:types", diff --git a/packages/compartment-mapper/package.json b/packages/compartment-mapper/package.json index 0561a5bdf3..662f8bf7db 100644 --- a/packages/compartment-mapper/package.json +++ b/packages/compartment-mapper/package.json @@ -36,8 +36,8 @@ }, "scripts": { "build": "exit 0", - "build:types": "tsc --build tsconfig.build.json", - "clean:types": "git clean -f '*.d.ts*'", + "prepack": "tsc --build tsconfig.build.json", + "postpack": "git clean -f '*.d.ts*'", "cover": "c8 ava", "lint": "yarn lint:types && yarn lint:eslint", "lint-fix": "eslint --fix .", diff --git a/packages/daemon/package.json b/packages/daemon/package.json index ad05097d0c..d6392ce49d 100644 --- a/packages/daemon/package.json +++ b/packages/daemon/package.json @@ -33,8 +33,8 @@ }, "scripts": { "build": "exit 0", - "build:types": "tsc --build tsconfig.build.json", - "clean:types": "git clean -f '*.d.ts*'", + "prepack": "tsc --build tsconfig.build.json", + "postpack": "git clean -f '*.d.ts*'", "cover": "c8 ava", "lint": "yarn lint:types && yarn lint:eslint", "lint-fix": "eslint --fix .", diff --git a/packages/env-options/package.json b/packages/env-options/package.json index 7ff665e2f4..b50443f60f 100644 --- a/packages/env-options/package.json +++ b/packages/env-options/package.json @@ -29,8 +29,8 @@ "lint-fix": "eslint --fix .", "lint:eslint": "eslint .", "lint:types": "tsc", - "build:types": "tsc --build tsconfig.build.json", - "clean:types": "git clean -f '*.d.ts*'", + "prepack": "tsc --build tsconfig.build.json", + "postpack": "git clean -f '*.d.ts*'", "test": "exit 0" }, "devDependencies": { diff --git a/packages/errors/package.json b/packages/errors/package.json index 677a58f085..7074bdb314 100644 --- a/packages/errors/package.json +++ b/packages/errors/package.json @@ -29,8 +29,8 @@ "lint-fix": "yarn lint:eslint --fix && yarn lint:types", "lint:eslint": "eslint '**/*.js'", "lint:types": "tsc", - "build:types": "tsc --build tsconfig.build.json", - "clean:types": "git clean -f '*.d.ts*'", + "prepack": "tsc --build tsconfig.build.json", + "postpack": "git clean -f '*.d.ts*'", "test": "ava", "test:c8": "c8 $C8_OPTIONS ava --config=ava-nesm.config.js", "test:xs": "exit 0" diff --git a/packages/evasive-transform/package.json b/packages/evasive-transform/package.json index 809a42c527..cbe5f8d032 100644 --- a/packages/evasive-transform/package.json +++ b/packages/evasive-transform/package.json @@ -29,8 +29,8 @@ "test:c8": "c8 $C8_OPTIONS ava --config=ava-nesm.config.js", "test:xs": "exit 0", "build": "exit 0", - "build:types": "tsc --build tsconfig.build.json", - "clean:types": "git clean -f '*.d.ts*'", + "prepack": "tsc --build tsconfig.build.json", + "postpack": "git clean -f '*.d.ts*'", "lint-fix": "yarn lint:eslint --fix && yarn lint:types", "lint-check": "yarn lint", "lint": "yarn lint:types && yarn lint:eslint", diff --git a/packages/eventual-send/package.json b/packages/eventual-send/package.json index c93590c506..5a3c400bf3 100644 --- a/packages/eventual-send/package.json +++ b/packages/eventual-send/package.json @@ -10,8 +10,8 @@ "test:xs": "exit 0", "build": "exit 0", "clean": "git clean -f '*.d.ts*'", - "build:types": "tsc --build tsconfig.build.json", - "clean:types": "git clean -f '*.d.ts*'", + "prepack": "tsc --build tsconfig.build.json", + "postpack": "git clean -f '*.d.ts*'", "lint-fix": "yarn lint:eslint --fix && yarn lint:types", "lint-check": "yarn lint", "lint": "yarn lint:types && yarn lint:eslint", diff --git a/packages/exo/package.json b/packages/exo/package.json index 2329f8a054..a97d9049f1 100644 --- a/packages/exo/package.json +++ b/packages/exo/package.json @@ -24,8 +24,8 @@ }, "scripts": { "build": "exit 0", - "build:types": "tsc --build tsconfig.build.json", - "clean:types": "git clean -f '*.d.ts*'", + "prepack": "tsc --build tsconfig.build.json", + "postpack": "git clean -f '*.d.ts*'", "lint": "yarn lint:types && yarn lint:eslint", "lint-fix": "eslint --fix .", "lint:eslint": "eslint .", diff --git a/packages/far/package.json b/packages/far/package.json index 2695a58875..45ff77d366 100644 --- a/packages/far/package.json +++ b/packages/far/package.json @@ -13,8 +13,8 @@ "test:c8": "c8 $C8_OPTIONS ava --config=ava-nesm.config.js", "test:xs": "exit 0", "build": "exit 0", - "build:types": "tsc --build tsconfig.build.json", - "clean:types": "git clean -f '*.d.ts*'", + "prepack": "tsc --build tsconfig.build.json", + "postpack": "git clean -f '*.d.ts*'", "lint-fix": "yarn lint:eslint --fix && yarn lint:types", "lint-check": "yarn lint", "lint": "yarn lint:types && yarn lint:eslint", diff --git a/packages/import-bundle/package.json b/packages/import-bundle/package.json index 54def29ac1..9b8b10177e 100644 --- a/packages/import-bundle/package.json +++ b/packages/import-bundle/package.json @@ -31,8 +31,8 @@ "test:c8": "c8 $C8_OPTIONS ava --config=ava-nesm.config.js", "test:xs": "exit 0", "build": "exit 0", - "build:types": "tsc --build tsconfig.build.json", - "clean:types": "git clean -f '*.d.ts*'", + "prepack": "tsc --build tsconfig.build.json", + "postpack": "git clean -f '*.d.ts*'", "lint-fix": "eslint --fix '**/*.js'", "lint": "yarn lint:types && yarn lint:eslint", "lint:eslint": "eslint .", diff --git a/packages/init/package.json b/packages/init/package.json index 4060728c82..3634346f30 100644 --- a/packages/init/package.json +++ b/packages/init/package.json @@ -19,8 +19,8 @@ }, "scripts": { "build": "exit 0", - "build:types": "tsc --build tsconfig.build.json", - "clean:types": "git clean -f '*.d.ts*'", + "prepack": "tsc --build tsconfig.build.json", + "postpack": "git clean -f '*.d.ts*'", "test": "ava", "test:xs": "exit 0", "lint-check": "yarn lint", diff --git a/packages/lp32/package.json b/packages/lp32/package.json index 0582152694..e5f5183b45 100644 --- a/packages/lp32/package.json +++ b/packages/lp32/package.json @@ -40,8 +40,8 @@ }, "scripts": { "build": "exit 0", - "build:types": "tsc --build tsconfig.build.json", - "clean:types": "git clean -f '*.d.ts*'", + "prepack": "tsc --build tsconfig.build.json", + "postpack": "git clean -f '*.d.ts*'", "cover": "c8 ava", "lint": "yarn lint:types && yarn lint:eslint", "lint-fix": "eslint --fix .", diff --git a/packages/marshal/package.json b/packages/marshal/package.json index 109e0b42b0..74fbeb7960 100644 --- a/packages/marshal/package.json +++ b/packages/marshal/package.json @@ -13,8 +13,8 @@ }, "scripts": { "build": "exit 0", - "build:types": "tsc --build tsconfig.build.json", - "clean:types": "git clean -f '*.d.ts*'", + "prepack": "tsc --build tsconfig.build.json", + "postpack": "git clean -f '*.d.ts*'", "test": "ava", "test:c8": "c8 $C8_OPTIONS ava --config=ava-nesm.config.js", "test:xs": "exit 0", diff --git a/packages/memoize/package.json b/packages/memoize/package.json index c6fd54e828..6d2a1748a1 100644 --- a/packages/memoize/package.json +++ b/packages/memoize/package.json @@ -29,8 +29,8 @@ "lint-fix": "eslint --fix .", "lint:eslint": "eslint .", "lint:types": "tsc", - "build:types": "tsc --build tsconfig.build.json", - "clean:types": "git clean -f '*.d.ts*'", + "prepack": "tsc --build tsconfig.build.json", + "postpack": "git clean -f '*.d.ts*'", "test": "ava" }, "dependencies": { diff --git a/packages/nat/package.json b/packages/nat/package.json index 7c8df1ccbf..cf718c8d30 100644 --- a/packages/nat/package.json +++ b/packages/nat/package.json @@ -10,8 +10,8 @@ }, "scripts": { "build": "exit 0", - "build:types": "tsc --build tsconfig.build.json", - "clean:types": "git clean -f '*.d.ts*'", + "prepack": "tsc --build tsconfig.build.json", + "postpack": "git clean -f '*.d.ts*'", "lint": "yarn lint:types && yarn lint:eslint", "lint-fix": "eslint --fix .", "lint:eslint": "eslint .", diff --git a/packages/netstring/package.json b/packages/netstring/package.json index f2c53e62fc..ed424a096f 100644 --- a/packages/netstring/package.json +++ b/packages/netstring/package.json @@ -25,8 +25,8 @@ }, "scripts": { "build": "exit 0", - "build:types": "tsc --build tsconfig.build.json", - "clean:types": "git clean -f '*.d.ts*'", + "prepack": "tsc --build tsconfig.build.json", + "postpack": "git clean -f '*.d.ts*'", "cover": "c8 ava", "lint": "yarn lint:types && yarn lint:eslint", "lint-fix": "eslint --fix .", diff --git a/packages/pass-style/package.json b/packages/pass-style/package.json index 589b9351c1..48b28df6c5 100644 --- a/packages/pass-style/package.json +++ b/packages/pass-style/package.json @@ -25,8 +25,8 @@ }, "scripts": { "build": "exit 0", - "build:types": "tsc --build tsconfig.build.json", - "clean:types": "git clean -f '*.d.ts*'", + "prepack": "tsc --build tsconfig.build.json", + "postpack": "git clean -f '*.d.ts*'", "lint": "yarn lint:types && yarn lint:eslint", "lint-fix": "eslint --fix .", "lint:eslint": "eslint .", diff --git a/packages/patterns/package.json b/packages/patterns/package.json index 55ee537597..8dbe17156d 100644 --- a/packages/patterns/package.json +++ b/packages/patterns/package.json @@ -23,8 +23,8 @@ }, "scripts": { "build": "exit 0", - "build:types": "tsc --build tsconfig.build.json", - "clean:types": "git clean -f '*.d.ts*'", + "prepack": "tsc --build tsconfig.build.json", + "postpack": "git clean -f '*.d.ts*'", "lint": "yarn lint:types && yarn lint:eslint", "lint-fix": "eslint --fix .", "lint:eslint": "eslint .", diff --git a/packages/promise-kit/package.json b/packages/promise-kit/package.json index 105cd7a1fb..9947f6f387 100644 --- a/packages/promise-kit/package.json +++ b/packages/promise-kit/package.json @@ -26,8 +26,8 @@ }, "scripts": { "build": "exit 0", - "build:types": "tsc --build tsconfig.build.json", - "clean:types": "git clean -f '*.d.ts*'", + "prepack": "tsc --build tsconfig.build.json", + "postpack": "git clean -f '*.d.ts*'", "cover": "c8 ava", "lint": "yarn lint:types && yarn lint:eslint", "lint-check": "yarn lint", diff --git a/packages/ses-ava/package.json b/packages/ses-ava/package.json index 74d5522ec0..7a0c63edc8 100644 --- a/packages/ses-ava/package.json +++ b/packages/ses-ava/package.json @@ -27,8 +27,8 @@ }, "scripts": { "build": "exit 0", - "build:types": "tsc --build tsconfig.build.json", - "clean:types": "git clean -f '*.d.ts*'", + "prepack": "tsc --build tsconfig.build.json", + "postpack": "git clean -f '*.d.ts*'", "cover": "c8 ava", "lint": "yarn lint:types && yarn lint:eslint", "lint-fix": "eslint --fix .", diff --git a/packages/skel/package.json b/packages/skel/package.json index 04eff85b76..8f9d006445 100644 --- a/packages/skel/package.json +++ b/packages/skel/package.json @@ -27,8 +27,8 @@ "test:c8": "c8 $C8_OPTIONS ava --config=ava-nesm.config.js", "test:xs": "exit 0", "build": "exit 0", - "build:types": "tsc --build tsconfig.build.json", - "clean:types": "git clean -f '*.d.ts*'", + "prepack": "tsc --build tsconfig.build.json", + "postpack": "git clean -f '*.d.ts*'", "lint-fix": "yarn lint:eslint --fix && yarn lint:types", "lint-check": "yarn lint", "lint": "yarn lint:types && yarn lint:eslint", diff --git a/packages/static-module-record/package.json b/packages/static-module-record/package.json index 115358717a..19b10a5065 100644 --- a/packages/static-module-record/package.json +++ b/packages/static-module-record/package.json @@ -27,8 +27,8 @@ }, "scripts": { "build": "exit 0", - "build:types": "tsc --build tsconfig.build.json", - "clean:types": "git clean -f '*.d.ts*'", + "prepack": "tsc --build tsconfig.build.json", + "postpack": "git clean -f '*.d.ts*'", "cover": "c8 ava", "lint": "yarn lint:types && yarn lint:eslint", "lint:types": "tsc", diff --git a/packages/stream-node/package.json b/packages/stream-node/package.json index 4148a9801f..af9fd0a23c 100644 --- a/packages/stream-node/package.json +++ b/packages/stream-node/package.json @@ -31,8 +31,8 @@ }, "scripts": { "build": "exit 0", - "build:types": "tsc --build tsconfig.build.json", - "clean:types": "git clean -f '*.d.ts*'", + "prepack": "tsc --build tsconfig.build.json", + "postpack": "git clean -f '*.d.ts*'", "cover": "c8 ava", "lint": "yarn lint:types && yarn lint:eslint", "lint-fix": "eslint --fix .", diff --git a/packages/stream/package.json b/packages/stream/package.json index 0b48d0c710..781451c1fb 100644 --- a/packages/stream/package.json +++ b/packages/stream/package.json @@ -34,8 +34,8 @@ }, "scripts": { "build": "exit 0", - "build:types": "tsc --build tsconfig.build.json", - "clean:types": "git clean -f '*.d.ts*'", + "prepack": "tsc --build tsconfig.build.json", + "postpack": "git clean -f '*.d.ts*'", "cover": "c8 ava", "lint": "yarn lint:types && yarn lint:eslint", "lint-fix": "eslint --fix .", diff --git a/packages/syrup/package.json b/packages/syrup/package.json index 829d9666e6..f921cb88e7 100644 --- a/packages/syrup/package.json +++ b/packages/syrup/package.json @@ -29,8 +29,8 @@ }, "scripts": { "build": "exit 0", - "build:types": "tsc --build tsconfig.build.json", - "clean:types": "git clean -f '*.d.ts*'", + "prepack": "tsc --build tsconfig.build.json", + "postpack": "git clean -f '*.d.ts*'", "cover": "c8 ava", "lint": "yarn lint:types && yarn lint:eslint", "lint-fix": "eslint --fix .", diff --git a/packages/where/package.json b/packages/where/package.json index 68de26f86f..2f957f094c 100644 --- a/packages/where/package.json +++ b/packages/where/package.json @@ -27,8 +27,8 @@ }, "scripts": { "build": "exit 0", - "build:types": "tsc --build tsconfig.build.json", - "clean:types": "git clean -f '*.d.ts*'", + "prepack": "tsc --build tsconfig.build.json", + "postpack": "git clean -f '*.d.ts*'", "cover": "c8 ava", "lint": "yarn lint:types && yarn lint:eslint", "lint-fix": "eslint --fix .", diff --git a/packages/zip/package.json b/packages/zip/package.json index c93b1c0e7c..b88393bb39 100644 --- a/packages/zip/package.json +++ b/packages/zip/package.json @@ -28,8 +28,8 @@ }, "scripts": { "build": "exit 0", - "build:types": "tsc --build tsconfig.build.json", - "clean:types": "git clean -f '*.d.ts*'", + "prepack": "tsc --build tsconfig.build.json", + "postpack": "git clean -f '*.d.ts*'", "cover": "c8 ava", "lint": "yarn lint:types && yarn lint:eslint", "lint-fix": "eslint --fix .",