From 04a45451076f1dc37ab6992f66fcb627e3d04163 Mon Sep 17 00:00:00 2001 From: dongmucat <1127093059@qq.com> Date: Sat, 9 May 2026 11:10:53 +0800 Subject: [PATCH] refactor(ci): inline pnpm build-script approval into package.json Addresses review feedback on #413: for a single-package project, pnpm-workspace.yaml is unnecessary and its 'packages: [.]' declaration turns the web/ directory into a pnpm workspace root, which is a semantic side effect we don't want. Move onlyBuiltDependencies under the 'pnpm' field in package.json (pnpm 10 still reads it there) and drop the workspace file from the Dockerfile COPY list. Verified locally with docker buildx: pnpm 10.33 runs esbuild postinstall and the build succeeds. --- web/Dockerfile | 2 +- web/package.json | 5 +++++ web/pnpm-workspace.yaml | 5 ----- 3 files changed, 6 insertions(+), 6 deletions(-) delete mode 100644 web/pnpm-workspace.yaml diff --git a/web/Dockerfile b/web/Dockerfile index d3dd090b..e301f7c8 100644 --- a/web/Dockerfile +++ b/web/Dockerfile @@ -1,7 +1,7 @@ FROM node:22-alpine AS build RUN corepack enable WORKDIR /app -COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./ +COPY package.json pnpm-lock.yaml ./ RUN pnpm install --frozen-lockfile COPY . . RUN pnpm build diff --git a/web/package.json b/web/package.json index b8083426..26833b9c 100644 --- a/web/package.json +++ b/web/package.json @@ -4,6 +4,11 @@ "version": "0.1.0", "type": "module", "packageManager": "pnpm@10.33.0", + "pnpm": { + "onlyBuiltDependencies": [ + "esbuild" + ] + }, "scripts": { "install:ci": "pnpm install --frozen-lockfile", "dev": "vite", diff --git a/web/pnpm-workspace.yaml b/web/pnpm-workspace.yaml deleted file mode 100644 index 8ddd474f..00000000 --- a/web/pnpm-workspace.yaml +++ /dev/null @@ -1,5 +0,0 @@ -packages: - - '.' - -onlyBuiltDependencies: - - esbuild