From 17931821dc4f8dc6ea648e33416c224cf8bd351a Mon Sep 17 00:00:00 2001 From: Dinh Le Date: Wed, 30 Sep 2026 09:50:36 +0700 Subject: [PATCH] chore: build packages via prepack instead of a separate build script Every package's `build` script is renamed to `prepack`, so unbuild runs automatically whenever a package is packed or published. The explicit build steps in the CI preview and release workflows are removed, since `pnpm pack` (used by pkg-pr-new) and `pnpm publish` both trigger the hook themselves. --- .github/workflows/ci.yaml | 2 -- .github/workflows/release.yaml | 2 -- packages/aws-lambda/package.json | 2 +- packages/core/package.json | 2 +- packages/fastify/package.json | 2 +- packages/fetch/package.json | 2 +- packages/node/package.json | 2 +- packages/peer/package.json | 2 +- packages/shared/package.json | 2 +- 9 files changed, 7 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 5e5980b5..46d5f96b 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -59,6 +59,4 @@ jobs: - run: pnpm i - - run: pnpm --filter='./packages/*' run -r build - - run: pnpm exec pkg-pr-new publish './packages/*' --pnpm --compact --template './playgrounds/*' diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 142e9379..b79e9b76 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -82,8 +82,6 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - run: pnpm --filter='./packages/*' run -r build - - run: pnpm --filter='./packages/*' publish -r --provenance --access=public --tag="$TAG" $NO_GIT_CHECKS env: TAG: ${{ steps.version.outputs.tag }} diff --git a/packages/aws-lambda/package.json b/packages/aws-lambda/package.json index fbadb9d1..cfd76d23 100644 --- a/packages/aws-lambda/package.json +++ b/packages/aws-lambda/package.json @@ -46,7 +46,7 @@ "dist" ], "scripts": { - "build": "unbuild", + "prepack": "unbuild", "type:check": "tsc -b" }, "dependencies": { diff --git a/packages/core/package.json b/packages/core/package.json index 08299d71..3ebab18e 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -47,7 +47,7 @@ "dist" ], "scripts": { - "build": "unbuild", + "prepack": "unbuild", "type:check": "tsc -b" }, "dependencies": { diff --git a/packages/fastify/package.json b/packages/fastify/package.json index b6375e6d..0f6bb350 100644 --- a/packages/fastify/package.json +++ b/packages/fastify/package.json @@ -44,7 +44,7 @@ "dist" ], "scripts": { - "build": "unbuild", + "prepack": "unbuild", "type:check": "tsc -b" }, "peerDependencies": { diff --git a/packages/fetch/package.json b/packages/fetch/package.json index 221a5b65..e8b8d24d 100644 --- a/packages/fetch/package.json +++ b/packages/fetch/package.json @@ -48,7 +48,7 @@ "dist" ], "scripts": { - "build": "unbuild", + "prepack": "unbuild", "type:check": "tsc -b" }, "dependencies": { diff --git a/packages/node/package.json b/packages/node/package.json index 6df0d5dc..edb70a08 100644 --- a/packages/node/package.json +++ b/packages/node/package.json @@ -46,7 +46,7 @@ "dist" ], "scripts": { - "build": "unbuild", + "prepack": "unbuild", "type:check": "tsc -b" }, "dependencies": { diff --git a/packages/peer/package.json b/packages/peer/package.json index c339e0d9..876a82ae 100644 --- a/packages/peer/package.json +++ b/packages/peer/package.json @@ -45,7 +45,7 @@ "dist" ], "scripts": { - "build": "unbuild", + "prepack": "unbuild", "type:check": "tsc -b" }, "dependencies": { diff --git a/packages/shared/package.json b/packages/shared/package.json index f64cb721..b61abc1a 100644 --- a/packages/shared/package.json +++ b/packages/shared/package.json @@ -39,7 +39,7 @@ "dist" ], "scripts": { - "build": "unbuild", + "prepack": "unbuild", "type:check": "tsc -b" } }