From 185ca7a832ef7d0f9080967d1f52920407f0bf4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Burzy=C5=84ski?= Date: Thu, 19 Feb 2026 14:41:21 +0000 Subject: [PATCH] Avoid using `--ignore-workspace` (#353) --- .github/workflows/test.yml | 6 +++--- .husky/pre-commit | 4 +++- entry | 16 +++++----------- internal/index.ts | 38 +++++++++++++++++++++++++++++++++++++ package.json | 16 +++++----------- pnpm-lock.yaml | 8 ++++---- pnpm-workspace.yaml | 6 ++++++ post | 16 +++++----------- scripts/generate-proxies.ts | 13 +++++++++++++ 9 files changed, 82 insertions(+), 41 deletions(-) create mode 100644 internal/index.ts create mode 100644 pnpm-workspace.yaml create mode 100644 scripts/generate-proxies.ts diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4e2a4b5..ab01117 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,7 +14,7 @@ jobs: node-version: "24" cache: "pnpm" - - run: pnpm install --frozen-lockfile --ignore-scripts + - run: pnpm install --frozen-lockfile - run: pnpm typecheck - run: pnpm test @@ -47,7 +47,7 @@ jobs: node-version: "24" cache: "pnpm" - - run: pnpm install --frozen-lockfile --ignore-scripts + - run: pnpm install --frozen-lockfile - run: pnpm runtest ${{ matrix.test }} ${{ matrix.agent }} agnostic: @@ -87,5 +87,5 @@ jobs: node-version: "24" cache: "pnpm" - - run: pnpm install --frozen-lockfile --ignore-scripts + - run: pnpm install --frozen-lockfile - run: pnpm runtest ${{ matrix.test }} diff --git a/.husky/pre-commit b/.husky/pre-commit index 0f1f0b9..60ae816 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,6 +1,8 @@ # sync action lockfile when action/package.json changes if git diff --cached --name-only | grep -q "^action/package.json$"; then echo "🔒 syncing action/pnpm-lock.yaml..." - pnpm --ignore-workspace -C action install --no-frozen-lockfile + # note: pnpm -C action install will *not* treat "action" as a monorepo root if run from repo root; + # to install with action/ as the workspace root (and search upwards), cd into action first: + (cd action && pnpm install --no-frozen-lockfile) git add action/pnpm-lock.yaml fi diff --git a/entry b/entry index daaf9e6..2953d85 100755 --- a/entry +++ b/entry @@ -144544,7 +144544,8 @@ var package_default = { runtest: "node test/run.ts", scratch: "node scratch.ts", upDeps: "pnpm up --latest", - lock: "pnpm --ignore-workspace install --no-frozen-lockfile", + lock: "pnpm install --no-frozen-lockfile", + postinstall: "node scripts/generate-proxies.ts", prepare: "cd .. && husky action/.husky" }, dependencies: { @@ -144603,16 +144604,9 @@ var package_default = { types: "./dist/index.d.cts", import: "./dist/index.js", require: "./dist/index.cjs" - } - }, - pnpm: { - packageExtensions: { - "@anthropic-ai/claude-agent-sdk": { - dependencies: { - "@anthropic-ai/sdk": "*" - } - } - } + }, + "./internal": "./dist/internal.js", + "./package.json": "./package.json" }, packageManager: "pnpm@10.27.0+sha512.72d699da16b1179c14ba9e64dc71c9a40988cbdc65c264cb0e489db7de917f20dcf4d64d8723625f2969ba52d4b7e2a1170682d9ac2a5dcaeaab732b7e16f04a" }; diff --git a/internal/index.ts b/internal/index.ts new file mode 100644 index 0000000..6c6d10e --- /dev/null +++ b/internal/index.ts @@ -0,0 +1,38 @@ +/** + * Internal entrypoint for the root app. + * Re-exports shared types, values, and utilities needed by the Next.js app. + */ + +export type { + AgentApiKeyName, + AgentManifest, + AuthorPermission, + BashPermission, + Payload, + PayloadEvent, + PushPermission, + ToolPermission, + WriteablePayload, +} from "../external.ts"; +export { + AgentName, + agentsManifest, + Effort, + ghPullfrogMcpName, +} from "../external.ts"; +export type { + AgentInfo, + BuildPullfrogFooterParams, + WorkflowRunFooterInfo, +} from "../utils/buildPullfrogFooter.ts"; +export { + buildPullfrogFooter, + PULLFROG_DIVIDER, + stripExistingFooter, +} from "../utils/buildPullfrogFooter.ts"; + +export { + isValidTimeString, + parseTimeString, + TIMEOUT_DISABLED, +} from "../utils/time.ts"; diff --git a/package.json b/package.json index 2eb7e73..12ebdc5 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,8 @@ "runtest": "node test/run.ts", "scratch": "node scratch.ts", "upDeps": "pnpm up --latest", - "lock": "pnpm --ignore-workspace install --no-frozen-lockfile", + "lock": "pnpm install --no-frozen-lockfile", + "postinstall": "node scripts/generate-proxies.ts", "prepare": "cd .. && husky action/.husky" }, "dependencies": { @@ -79,16 +80,9 @@ "types": "./dist/index.d.cts", "import": "./dist/index.js", "require": "./dist/index.cjs" - } - }, - "pnpm": { - "packageExtensions": { - "@anthropic-ai/claude-agent-sdk": { - "dependencies": { - "@anthropic-ai/sdk": "*" - } - } - } + }, + "./internal": "./dist/internal.js", + "./package.json": "./package.json" }, "packageManager": "pnpm@10.27.0+sha512.72d699da16b1179c14ba9e64dc71c9a40988cbdc65c264cb0e489db7de917f20dcf4d64d8723625f2969ba52d4b7e2a1170682d9ac2a5dcaeaab732b7e16f04a" } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1b4a76b..702f460 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -122,8 +122,8 @@ packages: peerDependencies: zod: ^4.0.0 - '@anthropic-ai/sdk@0.74.0': - resolution: {integrity: sha512-srbJV7JKsc5cQ6eVuFzjZO7UR3xEPJqPamHFIe29bs38Ij2IripoAhC0S5NslNbaFUYqBKypmmpzMTpqfHEUDw==} + '@anthropic-ai/sdk@0.77.0': + resolution: {integrity: sha512-TivlT6nfidz3sOyMF72T2x5AkmHrpT7JgL2e/0HNdh7b24v7JC8cR+rCY/42jA68xIsjmiGQ5IKMsH9feEKh3A==} hasBin: true peerDependencies: zod: ^3.25.0 || ^4.0.0 @@ -1688,7 +1688,7 @@ snapshots: '@anthropic-ai/claude-agent-sdk@0.2.39(zod@4.3.5)': dependencies: - '@anthropic-ai/sdk': 0.74.0(zod@4.3.5) + '@anthropic-ai/sdk': 0.77.0(zod@4.3.5) zod: 4.3.5 optionalDependencies: '@img/sharp-darwin-arm64': 0.33.5 @@ -1700,7 +1700,7 @@ snapshots: '@img/sharp-linuxmusl-x64': 0.33.5 '@img/sharp-win32-x64': 0.33.5 - '@anthropic-ai/sdk@0.74.0(zod@4.3.5)': + '@anthropic-ai/sdk@0.77.0(zod@4.3.5)': dependencies: json-schema-to-ts: 3.1.1 optionalDependencies: diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml new file mode 100644 index 0000000..0727427 --- /dev/null +++ b/pnpm-workspace.yaml @@ -0,0 +1,6 @@ +packages: [] # prevent looking upwards for the workspace root + +packageExtensions: + "@anthropic-ai/claude-agent-sdk": + dependencies: + "@anthropic-ai/sdk": "*" diff --git a/post b/post index d4febbd..edf4a51 100755 --- a/post +++ b/post @@ -41278,7 +41278,8 @@ var package_default = { runtest: "node test/run.ts", scratch: "node scratch.ts", upDeps: "pnpm up --latest", - lock: "pnpm --ignore-workspace install --no-frozen-lockfile", + lock: "pnpm install --no-frozen-lockfile", + postinstall: "node scripts/generate-proxies.ts", prepare: "cd .. && husky action/.husky" }, dependencies: { @@ -41337,16 +41338,9 @@ var package_default = { types: "./dist/index.d.cts", import: "./dist/index.js", require: "./dist/index.cjs" - } - }, - pnpm: { - packageExtensions: { - "@anthropic-ai/claude-agent-sdk": { - dependencies: { - "@anthropic-ai/sdk": "*" - } - } - } + }, + "./internal": "./dist/internal.js", + "./package.json": "./package.json" }, packageManager: "pnpm@10.27.0+sha512.72d699da16b1179c14ba9e64dc71c9a40988cbdc65c264cb0e489db7de917f20dcf4d64d8723625f2969ba52d4b7e2a1170682d9ac2a5dcaeaab732b7e16f04a" }; diff --git a/scripts/generate-proxies.ts b/scripts/generate-proxies.ts new file mode 100644 index 0000000..390c5cd --- /dev/null +++ b/scripts/generate-proxies.ts @@ -0,0 +1,13 @@ +import { mkdirSync, writeFileSync } from "node:fs"; + +const proxies = [ + { dest: "dist/index.js", source: "../index.ts" }, + { dest: "dist/internal.js", source: "../internal/index.ts" }, +]; + +mkdirSync("dist", { recursive: true }); + +for (const proxy of proxies) { + writeFileSync(proxy.dest, `export * from "${proxy.source}";\n`); + writeFileSync(proxy.dest.replace(/\.js$/, ".d.ts"), `export * from "${proxy.source}";\n`); +}