From a4b02a5a411817a31097d3b3890c4500f1e64239 Mon Sep 17 00:00:00 2001 From: Kris Kowal Date: Tue, 21 Nov 2023 17:01:56 -0800 Subject: [PATCH] fix: Adjust type generation in release process and CI --- .github/workflows/ci.yml | 10 +++++++++- CONTRIBUTING.md | 16 ++++++++++++++++ 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/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 | 5 ++--- 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/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 | 5 ++--- 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 ++-- 33 files changed, 87 insertions(+), 65 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8e0ea27636..9ead09aab3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -397,6 +397,14 @@ jobs: - name: build run: yarn run build + - name: build:types + # Concurrency is 1 to avoid bizarre cross-package contamination. + run: yarn lerna run generate:types + - name: pack # Concurrency is 1 to avoid bizarre cross-package contamination. - run: yarn run lerna exec --concurrency=1 yarn pack + run: yarn lerna run pack + + - name: clean:types + # Concurrency is 1 to avoid bizarre cross-package contamination. + run: yarn lerna run clean:types diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b353f62e78..bdf9ef0f94 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -34,6 +34,16 @@ https://github.com/endojs/endo/labels/next-release git checkout -b release-$now ``` +* 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. + * Create the release CHANGELOGs. ```sh @@ -156,6 +166,12 @@ https://github.com/endojs/endo/labels/next-release git tag -l | egrep -e '@[0-9]+\.[0-9]+\.[0-9]+$' | xargs git push origin ``` +* Clean up generated types. + + ```sh + yarn lerna run glean:types + ``` + ## More information To get help for the command-line options that will affect these commands, use: diff --git a/packages/base64/package.json b/packages/base64/package.json index 954d143902..bb24f8d6cb 100644 --- a/packages/base64/package.json +++ b/packages/base64/package.json @@ -31,8 +31,8 @@ }, "scripts": { "build": "exit 0", - "prepack": "tsc --build tsconfig.build.json", - "postpack": "git clean -f '*.d.ts*'", + "build:types": "tsc --build tsconfig.build.json", + "clean:types": "git clean -f '*.d.ts*'", "cover": "c8 ava", "lint": "yarn lint:types && yarn lint:js", "lint-fix": "eslint --fix .", diff --git a/packages/bundle-source/package.json b/packages/bundle-source/package.json index c5a433a8ea..3a1f569ac7 100644 --- a/packages/bundle-source/package.json +++ b/packages/bundle-source/package.json @@ -15,8 +15,8 @@ }, "scripts": { "build": "exit 0", - "prepack": "tsc --build tsconfig.build.json", - "postpack": "git clean -f '*.d.ts*'", + "build:types": "tsc --build tsconfig.build.json", + "clean:types": "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 a44ebed040..3e85c618fb 100644 --- a/packages/captp/package.json +++ b/packages/captp/package.json @@ -30,8 +30,8 @@ }, "scripts": { "build": "exit 0", - "prepack": "tsc --build tsconfig.build.json", - "postpack": "git clean -f '*.d.ts*'", + "build:types": "tsc --build tsconfig.build.json", + "clean:types": "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 bb8d66aa39..a9278b58b0 100644 --- a/packages/check-bundle/package.json +++ b/packages/check-bundle/package.json @@ -29,8 +29,8 @@ }, "scripts": { "build": "exit 0", - "prepack": "tsc --build tsconfig.build.json", - "postpack": "git clean -f '*.d.ts*'", + "build:types": "tsc --build tsconfig.build.json", + "clean:types": "git clean -f '*.d.ts*'", "lint": "yarn lint:types && yarn lint:js", "lint-fix": "eslint --fix .", "lint:js": "eslint .", diff --git a/packages/cjs-module-analyzer/package.json b/packages/cjs-module-analyzer/package.json index 3888107483..75d4c0e2d5 100644 --- a/packages/cjs-module-analyzer/package.json +++ b/packages/cjs-module-analyzer/package.json @@ -21,8 +21,8 @@ }, "scripts": { "build": "exit 0", - "prepack": "tsc --build tsconfig.build.json", - "postpack": "git clean -f '*.d.ts*'", + "build:types": "tsc --build tsconfig.build.json", + "clean:types": "git clean -f '*.d.ts*'", "cover": "c8 ava", "lint": "yarn lint:types && yarn lint:js", "lint-fix": "eslint --fix .", diff --git a/packages/cli/package.json b/packages/cli/package.json index b8a299c122..2941cef173 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -17,8 +17,8 @@ "exports": {}, "scripts": { "build": "exit 0", - "prepack": "tsc --build tsconfig.build.json", - "postpack": "git clean -f '*.d.ts*'", + "build:types": "tsc --build tsconfig.build.json", + "clean:types": "git clean -f '*.d.ts*'", "lint": "yarn lint:types && yarn lint:js", "lint-fix": "eslint --fix .", "lint:js": "eslint .", diff --git a/packages/compartment-mapper/package.json b/packages/compartment-mapper/package.json index 4cfe7aabb9..19d5a7324a 100644 --- a/packages/compartment-mapper/package.json +++ b/packages/compartment-mapper/package.json @@ -32,8 +32,8 @@ }, "scripts": { "build": "exit 0", - "prepack": "tsc --build tsconfig.build.json", - "postpack": "git clean -f '*.d.ts*'", + "build:types": "tsc --build tsconfig.build.json", + "clean:types": "git clean -f '*.d.ts*'", "cover": "c8 ava", "lint": "yarn lint:types && yarn lint:js", "lint-fix": "eslint --fix .", diff --git a/packages/daemon/package.json b/packages/daemon/package.json index 1411e54691..15f93a03f1 100644 --- a/packages/daemon/package.json +++ b/packages/daemon/package.json @@ -26,8 +26,8 @@ }, "scripts": { "build": "exit 0", - "prepack": "tsc --build tsconfig.build.json", - "postpack": "git clean -f '*.d.ts*'", + "build:types": "tsc --build tsconfig.build.json", + "clean:types": "git clean -f '*.d.ts*'", "cover": "c8 ava", "lint": "yarn lint:types && yarn lint:js", "lint-fix": "eslint --fix .", diff --git a/packages/env-options/package.json b/packages/env-options/package.json index c80124750d..532e51f161 100644 --- a/packages/env-options/package.json +++ b/packages/env-options/package.json @@ -30,8 +30,8 @@ "lint-fix": "eslint --fix .", "lint:js": "eslint .", "lint:types": "tsc", - "postpack": "git clean -f '*.d.ts*'", - "prepack": "tsc --build tsconfig.build.json", + "build:types": "tsc --build tsconfig.build.json", + "clean:types": "git clean -f '*.d.ts*'", "test": "ava" }, "devDependencies": { diff --git a/packages/errors/package.json b/packages/errors/package.json index 8175d13c38..96507220e5 100644 --- a/packages/errors/package.json +++ b/packages/errors/package.json @@ -28,8 +28,8 @@ "lint-fix": "yarn lint:eslint --fix && yarn lint:types", "lint:eslint": "eslint '**/*.js'", "lint:types": "tsc", - "postpack": "yarn clean", - "prepack": "tsc --build tsconfig.build.json", + "build:types": "tsc --build tsconfig.build.json", + "clean:types": "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 ee1201e572..4df1acdba9 100644 --- a/packages/evasive-transform/package.json +++ b/packages/evasive-transform/package.json @@ -25,9 +25,8 @@ "test:c8": "c8 $C8_OPTIONS ava --config=ava-nesm.config.js", "test:xs": "exit 0", "build": "exit 0", - "clean": "git clean -f '*.d.ts*'", - "prepack": "tsc --build tsconfig.build.json", - "postpack": "yarn clean", + "build:types": "tsc --build tsconfig.build.json", + "clean:types": "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 388018c587..1c2bad5dd0 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*'", - "prepack": "tsc --build tsconfig.build.json", - "postpack": "yarn clean", + "build:types": "tsc --build tsconfig.build.json", + "clean:types": "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 6ab75bb960..c7843bddb4 100644 --- a/packages/exo/package.json +++ b/packages/exo/package.json @@ -23,8 +23,8 @@ }, "scripts": { "build": "exit 0", - "prepack": "tsc --build tsconfig.build.json", - "postpack": "git clean -f '*.d.ts*'", + "build:types": "tsc --build tsconfig.build.json", + "clean:types": "git clean -f '*.d.ts*'", "lint": "yarn lint:types && yarn lint:js", "lint-fix": "eslint --fix .", "lint:js": "eslint .", diff --git a/packages/far/package.json b/packages/far/package.json index 43ae0f79fb..e7bc984b21 100644 --- a/packages/far/package.json +++ b/packages/far/package.json @@ -9,8 +9,8 @@ "test:c8": "c8 $C8_OPTIONS ava --config=ava-nesm.config.js", "test:xs": "exit 0", "build": "exit 0", - "prepack": "tsc --build tsconfig.build.json", - "postpack": "git clean -f '*.d.ts*'", + "build:types": "tsc --build tsconfig.build.json", + "clean:types": "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 e677c1ced0..d99acb2a8a 100644 --- a/packages/import-bundle/package.json +++ b/packages/import-bundle/package.json @@ -19,8 +19,8 @@ "test:c8": "c8 $C8_OPTIONS ava --config=ava-nesm.config.js", "test:xs": "exit 0", "build": "exit 0", - "prepack": "tsc --build tsconfig.build.json", - "postpack": "git clean -f '*.d.ts*'", + "build:types": "tsc --build tsconfig.build.json", + "clean:types": "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 e59a6ab67e..8a146c5e2a 100644 --- a/packages/init/package.json +++ b/packages/init/package.json @@ -19,8 +19,8 @@ }, "scripts": { "build": "exit 0", - "prepack": "tsc --build tsconfig.build.json", - "postpack": "git clean -f '*.d.ts*'", + "build:types": "tsc --build tsconfig.build.json", + "clean:types": "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 ca1cedf43f..034fb5dbe8 100644 --- a/packages/lp32/package.json +++ b/packages/lp32/package.json @@ -36,8 +36,8 @@ }, "scripts": { "build": "exit 0", - "prepack": "tsc --build tsconfig.build.json", - "postpack": "git clean -f '*.d.ts*'", + "build:types": "tsc --build tsconfig.build.json", + "clean:types": "git clean -f '*.d.ts*'", "cover": "c8 ava", "lint": "yarn lint:types && yarn lint:js", "lint-fix": "eslint --fix .", diff --git a/packages/marshal/package.json b/packages/marshal/package.json index ddf2c5334f..027daf760d 100644 --- a/packages/marshal/package.json +++ b/packages/marshal/package.json @@ -9,8 +9,8 @@ }, "scripts": { "build": "exit 0", - "prepack": "tsc --build tsconfig.build.json", - "postpack": "git clean -f '*.d.ts*'", + "build:types": "tsc --build tsconfig.build.json", + "clean:types": "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 6ef09fa0df..320768e093 100644 --- a/packages/memoize/package.json +++ b/packages/memoize/package.json @@ -30,8 +30,8 @@ "lint-fix": "eslint --fix .", "lint:js": "eslint .", "lint:types": "tsc", - "postpack": "git clean -f '*.d.ts*'", - "prepack": "tsc --build tsconfig.build.json", + "build:types": "tsc --build tsconfig.build.json", + "clean:types": "git clean -f '*.d.ts*'", "test": "ava" }, "dependencies": { diff --git a/packages/netstring/package.json b/packages/netstring/package.json index b100974c23..81aa8ca4af 100644 --- a/packages/netstring/package.json +++ b/packages/netstring/package.json @@ -24,8 +24,8 @@ }, "scripts": { "build": "exit 0", - "prepack": "tsc --build tsconfig.build.json", - "postpack": "git clean -f '*.d.ts*'", + "build:types": "tsc --build tsconfig.build.json", + "clean:types": "git clean -f '*.d.ts*'", "cover": "c8 ava", "lint": "yarn lint:types && yarn lint:js", "lint-fix": "eslint --fix .", diff --git a/packages/pass-style/package.json b/packages/pass-style/package.json index 45bf1234db..17b82bb667 100644 --- a/packages/pass-style/package.json +++ b/packages/pass-style/package.json @@ -24,8 +24,8 @@ }, "scripts": { "build": "exit 0", - "prepack": "tsc --build tsconfig.build.json", - "postpack": "git clean -f '*.d.ts*'", + "build:types": "tsc --build tsconfig.build.json", + "clean:types": "git clean -f '*.d.ts*'", "lint": "yarn lint:types && yarn lint:js", "lint-fix": "eslint --fix .", "lint:js": "eslint .", diff --git a/packages/patterns/package.json b/packages/patterns/package.json index 247d73edb3..b6fdf85d53 100644 --- a/packages/patterns/package.json +++ b/packages/patterns/package.json @@ -22,8 +22,8 @@ }, "scripts": { "build": "exit 0", - "prepack": "tsc --build tsconfig.build.json", - "postpack": "git clean -f '*.d.ts*'", + "build:types": "tsc --build tsconfig.build.json", + "clean:types": "git clean -f '*.d.ts*'", "lint": "yarn lint:types && yarn lint:js", "lint-fix": "eslint --fix .", "lint:js": "eslint .", diff --git a/packages/promise-kit/package.json b/packages/promise-kit/package.json index 37daf28bed..de2cce56f1 100644 --- a/packages/promise-kit/package.json +++ b/packages/promise-kit/package.json @@ -25,8 +25,8 @@ }, "scripts": { "build": "exit 0", - "prepack": "tsc --build tsconfig.build.json", - "postpack": "git clean -f '*.d.ts*'", + "build:types": "tsc --build tsconfig.build.json", + "clean:types": "git clean -f '*.d.ts*'", "cover": "c8 ava", "lint": "yarn lint:types && yarn lint:js", "lint-check": "yarn lint", diff --git a/packages/ses-ava/package.json b/packages/ses-ava/package.json index e4a28838c3..4d1794f29f 100644 --- a/packages/ses-ava/package.json +++ b/packages/ses-ava/package.json @@ -25,8 +25,8 @@ }, "scripts": { "build": "exit 0", - "prepack": "tsc --build tsconfig.build.json", - "postpack": "git clean -f '*.d.ts*'", + "build:types": "tsc --build tsconfig.build.json", + "clean:types": "git clean -f '*.d.ts*'", "cover": "c8 ava", "lint": "yarn lint:types && yarn lint:js", "lint-fix": "eslint --fix .", diff --git a/packages/skel/package.json b/packages/skel/package.json index acbc55571c..7cf308a384 100644 --- a/packages/skel/package.json +++ b/packages/skel/package.json @@ -26,9 +26,8 @@ "test:c8": "c8 $C8_OPTIONS ava --config=ava-nesm.config.js", "test:xs": "exit 0", "build": "exit 0", - "clean": "git clean -f '*.d.ts*'", - "prepack": "tsc --build tsconfig.build.json", - "postpack": "yarn clean", + "build:types": "tsc --build tsconfig.build.json", + "clean:types": "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 dcff365b1d..1823fa3dbf 100644 --- a/packages/static-module-record/package.json +++ b/packages/static-module-record/package.json @@ -26,8 +26,8 @@ }, "scripts": { "build": "exit 0", - "prepack": "tsc --build tsconfig.build.json", - "postpack": "git clean -f '*.d.ts*'", + "build:types": "tsc --build tsconfig.build.json", + "clean:types": "git clean -f '*.d.ts*'", "cover": "c8 ava", "lint": "yarn lint:types && yarn lint:js", "lint:types": "tsc", diff --git a/packages/stream-node/package.json b/packages/stream-node/package.json index b567d4e5b4..7ac1f54f2e 100644 --- a/packages/stream-node/package.json +++ b/packages/stream-node/package.json @@ -30,8 +30,8 @@ }, "scripts": { "build": "exit 0", - "prepack": "tsc --build tsconfig.build.json", - "postpack": "git clean -f '*.d.ts*'", + "build:types": "tsc --build tsconfig.build.json", + "clean:types": "git clean -f '*.d.ts*'", "cover": "c8 ava", "lint": "yarn lint:types && yarn lint:js", "lint-fix": "eslint --fix .", diff --git a/packages/stream/package.json b/packages/stream/package.json index 59254c20e2..1a705eadf0 100644 --- a/packages/stream/package.json +++ b/packages/stream/package.json @@ -30,8 +30,8 @@ }, "scripts": { "build": "exit 0", - "prepack": "tsc --build tsconfig.build.json", - "postpack": "git clean -f '*.d.ts*'", + "build:types": "tsc --build tsconfig.build.json", + "clean:types": "git clean -f '*.d.ts*'", "cover": "c8 ava", "lint": "yarn lint:types && yarn lint:js", "lint-fix": "eslint --fix .", diff --git a/packages/syrup/package.json b/packages/syrup/package.json index 10dbf99d8f..48d52e90bb 100644 --- a/packages/syrup/package.json +++ b/packages/syrup/package.json @@ -28,8 +28,8 @@ }, "scripts": { "build": "exit 0", - "prepack": "tsc --build tsconfig.build.json", - "postpack": "git clean -f '*.d.ts*'", + "build:types": "tsc --build tsconfig.build.json", + "clean:types": "git clean -f '*.d.ts*'", "cover": "c8 ava", "lint": "yarn lint:types && yarn lint:js", "lint-fix": "eslint --fix .", diff --git a/packages/where/package.json b/packages/where/package.json index d1f963d47b..3f19fd8f1c 100644 --- a/packages/where/package.json +++ b/packages/where/package.json @@ -23,8 +23,8 @@ }, "scripts": { "build": "exit 0", - "prepack": "tsc --build tsconfig.build.json", - "postpack": "git clean -f '*.d.ts*'", + "build:types": "tsc --build tsconfig.build.json", + "clean:types": "git clean -f '*.d.ts*'", "cover": "c8 ava", "lint": "yarn lint:types && yarn lint:js", "lint-fix": "eslint --fix .", diff --git a/packages/zip/package.json b/packages/zip/package.json index 3746c55668..0ad2183705 100644 --- a/packages/zip/package.json +++ b/packages/zip/package.json @@ -27,8 +27,8 @@ }, "scripts": { "build": "exit 0", - "prepack": "tsc --build tsconfig.build.json", - "postpack": "git clean -f '*.d.ts*'", + "build:types": "tsc --build tsconfig.build.json", + "clean:types": "git clean -f '*.d.ts*'", "cover": "c8 ava", "lint": "yarn lint:types && yarn lint:js", "lint-fix": "eslint --fix .",