From e4b36f3e56da1952de30cc0050088f8e56457105 Mon Sep 17 00:00:00 2001 From: Ricky Schema Cascade Date: Thu, 4 Jun 2026 13:43:47 +0200 Subject: [PATCH] fix(publish): drop npm workspaces field that broke npm version with EUNSUPPORTEDPROTOCOL #191 added "workspaces": ["packages/*"] to the root package.json. This is a pnpm workspace (pnpm-workspace.yaml is the manifest); the npm-style field makes every npm command in the repo treat it as an npm workspace and try to reify the root lockfile, which dies on pnpm's workspace:* protocol: npm error code EUNSUPPORTEDPROTOCOL npm error Unsupported URL Type "workspace:": workspace:* That killed the 3.0.45 publish run (26949232814) at the Bump versions step (npm version's workspaces-update defaults to true). Plain npm install at the root fails identically, so the field could not have served the local-tooling purpose #191 cited. - remove the workspaces field from root package.json - harden all npm version calls in publish.yml / publish-persona.yml / publish-internal-personas.yml with --workspaces-update=false so a future reintroduction of npm workspaces config can't break publishing again Verified locally: npm version patch in packages/runtime reproduced the failure before the fix and succeeds after, with and without the flag. Co-Authored-By: Claude Opus 4.8 (1M context) --- .github/workflows/publish-internal-personas.yml | 7 +++++-- .github/workflows/publish-persona.yml | 9 ++++++--- .github/workflows/publish.yml | 14 ++++++++++---- package.json | 3 --- 4 files changed, 21 insertions(+), 12 deletions(-) diff --git a/.github/workflows/publish-internal-personas.yml b/.github/workflows/publish-internal-personas.yml index 33b7d028..8b007c9b 100644 --- a/.github/workflows/publish-internal-personas.yml +++ b/.github/workflows/publish-internal-personas.yml @@ -164,12 +164,15 @@ jobs: echo "::group::Preparing $NAME ($DIR)" pushd "$DIR" >/dev/null + # --workspaces-update=false keeps `npm version` from reifying the root + # lockfile, which fails on pnpm's workspace:* protocol if an npm + # `workspaces` field ever appears in the root package.json. if [ "$INPUT_VERSION" = "none" ]; then : elif [[ "$INPUT_VERSION" == pre* ]]; then - npm version "$INPUT_VERSION" --no-git-tag-version --preid="$INPUT_PREID" + npm version "$INPUT_VERSION" --no-git-tag-version --preid="$INPUT_PREID" --workspaces-update=false else - npm version "$INPUT_VERSION" --no-git-tag-version --allow-same-version + npm version "$INPUT_VERSION" --no-git-tag-version --allow-same-version --workspaces-update=false fi VERSION=$(node -p 'require("./package.json").version') popd >/dev/null diff --git a/.github/workflows/publish-persona.yml b/.github/workflows/publish-persona.yml index 3c1c4d7e..643d5e98 100644 --- a/.github/workflows/publish-persona.yml +++ b/.github/workflows/publish-persona.yml @@ -98,14 +98,17 @@ jobs: BUMP='${{ github.event.inputs.version }}' PREID='${{ github.event.inputs.prerelease_id }}' + # --workspaces-update=false keeps `npm version` from reifying the root + # lockfile, which fails on pnpm's workspace:* protocol if an npm + # `workspaces` field ever appears in the root package.json. if [ -n "$CUSTOM" ]; then - npm version "$CUSTOM" --no-git-tag-version --allow-same-version + npm version "$CUSTOM" --no-git-tag-version --allow-same-version --workspaces-update=false elif [ "$BUMP" = "none" ]; then : # keep existing version elif [[ "$BUMP" == pre* ]]; then - npm version "$BUMP" --no-git-tag-version --preid="$PREID" + npm version "$BUMP" --no-git-tag-version --preid="$PREID" --workspaces-update=false else - npm version "$BUMP" --no-git-tag-version + npm version "$BUMP" --no-git-tag-version --workspaces-update=false fi VERSION=$(node -p 'require("./package.json").version') diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index c7d3521e..0dfe3367 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -171,7 +171,10 @@ jobs: } for (const e of heals) { - execSync(`npm version ${baseline} --no-git-tag-version --allow-same-version`, { + // --workspaces-update=false: with any npm `workspaces` config in scope, + // `npm version` otherwise tries to reify the root lockfile and dies on + // pnpm's workspace:* protocol (EUNSUPPORTEDPROTOCOL). + execSync(`npm version ${baseline} --no-git-tag-version --allow-same-version --workspaces-update=false`, { cwd: `packages/${e.pkg}`, stdio: 'inherit', }); @@ -196,14 +199,17 @@ jobs: PREID='${{ github.event.inputs.prerelease_id }}' for pkg in ${{ steps.targets.outputs.packages }}; do pushd "packages/$pkg" > /dev/null + # --workspaces-update=false keeps `npm version` from reifying the root + # lockfile, which fails on pnpm's workspace:* protocol if an npm + # `workspaces` field ever appears in the root package.json. if [ -n "$CUSTOM" ]; then - npm version "$CUSTOM" --no-git-tag-version --allow-same-version + npm version "$CUSTOM" --no-git-tag-version --allow-same-version --workspaces-update=false elif [ "$BUMP" = "none" ]; then : # keep existing version (useful for first publish or re-publish) elif [[ "$BUMP" == pre* ]]; then - npm version "$BUMP" --no-git-tag-version --preid="$PREID" + npm version "$BUMP" --no-git-tag-version --preid="$PREID" --workspaces-update=false else - npm version "$BUMP" --no-git-tag-version + npm version "$BUMP" --no-git-tag-version --workspaces-update=false fi NEW=$(node -p "require('./package.json').version") VERSIONS+=" $pkg:$NEW" diff --git a/package.json b/package.json index e5ad6c85..7d087d61 100644 --- a/package.json +++ b/package.json @@ -4,9 +4,6 @@ "private": true, "version": "0.1.0", "packageManager": "pnpm@10.17.1", - "workspaces": [ - "packages/*" - ], "devDependencies": { "@types/node": "^22.18.0", "agent-trajectories": "^0.5.3",