From 1941101d82958bdff1ead1dd42b375409c978ada Mon Sep 17 00:00:00 2001 From: Ma Date: Thu, 13 Aug 2026 10:29:08 +0800 Subject: [PATCH] fix(packages): link internal workspace dependencies --- package.json | 6 ------ packages/cli/package.json | 4 ++-- packages/studio/package.json | 2 +- pnpm-lock.yaml | 6 +++--- pnpm-workspace.yaml | 4 ++++ scripts/verify-no-workspace-protocol.mjs | 18 ++++++++++-------- 6 files changed, 20 insertions(+), 20 deletions(-) diff --git a/package.json b/package.json index 4a567a6e..ec5a701e 100644 --- a/package.json +++ b/package.json @@ -37,11 +37,5 @@ "engines": { "node": ">=20.0.0", "pnpm": ">=9.0.0" - }, - "pnpm": { - "overrides": { - "@mariozechner/pi-ai": "0.67.1", - "@mariozechner/pi-agent-core": "0.67.1" - } } } diff --git a/packages/cli/package.json b/packages/cli/package.json index 2716032f..5b311355 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -49,8 +49,8 @@ "typecheck": "tsc --noEmit" }, "dependencies": { - "@actalk/inkos-core": "1.7.2", - "@actalk/inkos-studio": "1.7.2", + "@actalk/inkos-core": "workspace:*", + "@actalk/inkos-studio": "workspace:*", "commander": "^13.0.0", "dotenv": "^16.4.0", "epub-gen-memory": "^1.0.10", diff --git a/packages/studio/package.json b/packages/studio/package.json index 4c43cac3..311fd453 100644 --- a/packages/studio/package.json +++ b/packages/studio/package.json @@ -31,7 +31,7 @@ "typecheck": "tsc --noEmit && tsc -p tsconfig.server.json --noEmit" }, "dependencies": { - "@actalk/inkos-core": "1.7.2", + "@actalk/inkos-core": "workspace:*", "@base-ui/react": "^1.3.0", "@fontsource-variable/geist": "^5.2.8", "@hono/node-server": "^1.13.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 72114bdc..39c4d581 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -15,10 +15,10 @@ importers: packages/cli: dependencies: '@actalk/inkos-core': - specifier: 1.7.2 + specifier: workspace:* version: link:../core '@actalk/inkos-studio': - specifier: 1.7.2 + specifier: workspace:* version: link:../studio commander: specifier: ^13.0.0 @@ -110,7 +110,7 @@ importers: packages/studio: dependencies: '@actalk/inkos-core': - specifier: 1.7.2 + specifier: workspace:* version: link:../core '@base-ui/react': specifier: ^1.3.0 diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index dee51e92..eb092865 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -1,2 +1,6 @@ packages: - "packages/*" + +overrides: + "@mariozechner/pi-ai": "0.67.1" + "@mariozechner/pi-agent-core": "0.67.1" diff --git a/scripts/verify-no-workspace-protocol.mjs b/scripts/verify-no-workspace-protocol.mjs index 38097397..330fd051 100644 --- a/scripts/verify-no-workspace-protocol.mjs +++ b/scripts/verify-no-workspace-protocol.mjs @@ -1,13 +1,13 @@ /** - * Verify that source manifests are publishable as registry manifests. + * Verify that internal dependencies resolve to the current workspace version. * * Usage: * node scripts/verify-no-workspace-protocol.mjs packages/cli packages/core * node ../../scripts/verify-no-workspace-protocol.mjs . * * Checks two invariants before publish: - * 1. dependencies / optionalDependencies / peerDependencies contain no workspace: specifiers - * 2. internal workspace dependencies point at the current workspace version + * Source manifests may use workspace:* so local builds cannot silently resolve an + * older registry package. The prepack hook replaces it before prepublishOnly runs. */ import { access, readdir, readFile } from "node:fs/promises"; @@ -83,11 +83,13 @@ for (const dirArg of dirs) { } if (specifier.startsWith("workspace:")) { - process.stderr.write( - `FAIL: ${dir} — ${field}.${name}: ${specifier} (workspace protocol is not allowed in publish manifests)\n`, - ); - dirFailed = true; - failed = true; + if (!workspaceVersion || !["workspace:*", "workspace:^", "workspace:~"].includes(specifier)) { + process.stderr.write( + `FAIL: ${dir} — ${field}.${name}: invalid workspace dependency ${specifier}\n`, + ); + dirFailed = true; + failed = true; + } continue; }