Skip to content

Commit dfec9ca

Browse files
fix(release): keep rewritten workspace deps in registry metadata
Background ---------- Installing @razroo/parallel-mcp-postgres@0.1.0-beta.0 from npm could hang npm's dependency resolver. The registry's package-metadata document listed "@razroo/parallel-mcp": "file:../.." as the runtime dependency, even though the published tarball had the correct "^0.4.0" range. When combined with `pg`'s own transitive deps, npm's `placeDep` loop never terminated (repeating `silly timing Tried to end timer that doesn't exist: idealTree:#root` forever). @razroo/parallel-mcp-memory had the same bug in its metadata but installed fine in isolation (single dep, no cycle to confuse the resolver); it was still broken as a user-facing signal. Root cause ---------- The adapter, testkit, and server publish lifecycle used `prepack` + `postpack`: prepack rewrite "@razroo/parallel-mcp": "file:.." -> "^0.4.x" pack create tarball with the rewritten package.json postpack restore the workspace-path version on disk publish upload the tarball AND read the on-disk package.json for the registry metadata document The tarball was correct (verified: `tar -xOf … package/package.json`), but `postpack` ran BEFORE the metadata-upload step, so npm sent the restored `file:..` entry to the registry. Most consumers never noticed because npm 10 falls back to the tarball for install resolution — but that fallback couldn't save postgres once `pg`'s transitive graph was in the mix. Fix --- Move the restore from `postpack` to `postpublish` across all four workspace packages (memory, postgres, testkit, server). `prepack` still rewrites, the tarball is still correct, and now the on-disk package.json stays rewritten through the full `npm publish` call — including the registry-metadata upload. `postpublish` restores the workspace-path version immediately after publish for local dev. `pack:check` now manually invokes the postpack script at the end because `npm pack --dry-run` alone does not trigger `postpublish`. Version bumps ------------- - @razroo/parallel-mcp-memory 0.1.0 -> 0.1.1 - @razroo/parallel-mcp-postgres 0.1.0-beta.0 -> 0.1.0-beta.1 npm does not allow republishing over an existing version, even to fix a corrupt registry document, so these are fresh patch/beta bumps. No behavior or API changes inside the adapters. The same fix is applied to @razroo/parallel-mcp-testkit and @razroo/parallel-mcp-server; their 0.4.0 documents still carry the stale `file:..` but are not user-visibly broken (install works via tarball fallback). They will pick up the corrected metadata on the next release that bumps their versions. release.yml ----------- - Publish steps for core, server, and testkit now also skip if the version is already on npm, matching the adapter publish steps. Needed because this commit re-runs the v0.4.0 release with the same core/server/testkit versions but new adapter versions. - The GitHub-release step now upserts (`gh release upload --clobber` when the release already exists, `gh release create` otherwise) so re-tagging v0.4.0 does not fail with "release already exists". CHANGELOG --------- New "Adapter patch releases" section at the top of CHANGELOG.md documents the fix, the user-visible symptom, and the two version bumps. Made-with: Cursor
1 parent e3631e2 commit dfec9ca

7 files changed

Lines changed: 83 additions & 26 deletions

File tree

.github/workflows/release.yml

Lines changed: 47 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -105,22 +105,43 @@ jobs:
105105
PACKAGE_TGZ="$(npm pack --silent | tail -n 1)"
106106
echo "package_tgz=adapters/memory/${PACKAGE_TGZ}" >> "${GITHUB_OUTPUT}"
107107
108-
- name: Publish core to npm
108+
- name: Publish core to npm (skip if version already published)
109109
env:
110110
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
111-
run: npm publish --access public --provenance
111+
PACKAGE_VERSION: ${{ steps.version.outputs.package_version }}
112+
shell: bash
113+
run: |
114+
if [[ -n "$(npm view @razroo/parallel-mcp@${PACKAGE_VERSION} version 2>/dev/null)" ]]; then
115+
echo "@razroo/parallel-mcp@${PACKAGE_VERSION} already on npm — skipping"
116+
exit 0
117+
fi
118+
npm publish --access public --provenance
112119
113-
- name: Publish server to npm
120+
- name: Publish server to npm (skip if version already published)
114121
env:
115122
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
123+
PACKAGE_VERSION: ${{ steps.version.outputs.package_version }}
116124
working-directory: server
117-
run: npm publish --access public --provenance
125+
shell: bash
126+
run: |
127+
if [[ -n "$(npm view @razroo/parallel-mcp-server@${PACKAGE_VERSION} version 2>/dev/null)" ]]; then
128+
echo "@razroo/parallel-mcp-server@${PACKAGE_VERSION} already on npm — skipping"
129+
exit 0
130+
fi
131+
npm publish --access public --provenance
118132
119-
- name: Publish testkit to npm
133+
- name: Publish testkit to npm (skip if version already published)
120134
env:
121135
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
136+
PACKAGE_VERSION: ${{ steps.version.outputs.package_version }}
122137
working-directory: testkit
123-
run: npm publish --access public --provenance
138+
shell: bash
139+
run: |
140+
if [[ -n "$(npm view @razroo/parallel-mcp-testkit@${PACKAGE_VERSION} version 2>/dev/null)" ]]; then
141+
echo "@razroo/parallel-mcp-testkit@${PACKAGE_VERSION} already on npm — skipping"
142+
exit 0
143+
fi
144+
npm publish --access public --provenance
124145
125146
- name: Publish postgres adapter to npm (skip if version already published)
126147
env:
@@ -148,14 +169,26 @@ jobs:
148169
fi
149170
npm publish --access public --provenance
150171
151-
- name: Create GitHub release
172+
- name: Create or update GitHub release
152173
env:
153174
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
175+
shell: bash
154176
run: |
155-
gh release create "${GITHUB_REF_NAME}" \
156-
"${{ steps.pack_core.outputs.package_tgz }}" \
157-
"${{ steps.pack_server.outputs.package_tgz }}" \
158-
"${{ steps.pack_testkit.outputs.package_tgz }}" \
159-
"${{ steps.pack_postgres.outputs.package_tgz }}" \
160-
"${{ steps.pack_memory.outputs.package_tgz }}" \
161-
--generate-notes
177+
if gh release view "${GITHUB_REF_NAME}" >/dev/null 2>&1; then
178+
echo "Release ${GITHUB_REF_NAME} exists — uploading assets with --clobber"
179+
gh release upload "${GITHUB_REF_NAME}" \
180+
"${{ steps.pack_core.outputs.package_tgz }}" \
181+
"${{ steps.pack_server.outputs.package_tgz }}" \
182+
"${{ steps.pack_testkit.outputs.package_tgz }}" \
183+
"${{ steps.pack_postgres.outputs.package_tgz }}" \
184+
"${{ steps.pack_memory.outputs.package_tgz }}" \
185+
--clobber
186+
else
187+
gh release create "${GITHUB_REF_NAME}" \
188+
"${{ steps.pack_core.outputs.package_tgz }}" \
189+
"${{ steps.pack_server.outputs.package_tgz }}" \
190+
"${{ steps.pack_testkit.outputs.package_tgz }}" \
191+
"${{ steps.pack_postgres.outputs.package_tgz }}" \
192+
"${{ steps.pack_memory.outputs.package_tgz }}" \
193+
--generate-notes
194+
fi

CHANGELOG.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,30 @@ and [Semantic Versioning](https://semver.org/spec/v2.0.0.html). All three
88
workspace packages share a single version line: a release tagged `vX.Y.Z`
99
publishes all three at the same version.
1010

11+
## Adapter patch releases — 2026-04-18
12+
13+
### `@razroo/parallel-mcp-memory@0.1.1` + `@razroo/parallel-mcp-postgres@0.1.0-beta.1`
14+
15+
- **Fix**: `npm install @razroo/parallel-mcp-postgres@0.1.0-beta.0` could hang
16+
in npm's dependency resolver because the registry metadata document for that
17+
release still listed `"@razroo/parallel-mcp": "file:../.."` as a runtime
18+
dependency. The published tarball already contained the correct rewritten
19+
`"^0.4.0"` range, but npm resolves from the registry document first when it
20+
has to reconcile other deps (e.g. `pg`), and the workspace-path entry sent
21+
it into an infinite `placeDep` loop. Root cause: the adapter publish
22+
lifecycle ran `postpack` between `pack` and the metadata upload, restoring
23+
the original workspace-path dependency on disk before npm read it for the
24+
registry document. Both adapters now run the restore script from
25+
`postpublish` instead, so the rewritten `package.json` stays in place
26+
through the registry upload. The same fix is mirrored in
27+
`@razroo/parallel-mcp-server` and `@razroo/parallel-mcp-testkit`, which
28+
were unaffected in practice (their consumers fall through to the tarball)
29+
but were carrying the same stale workspace-path in their registry
30+
documents.
31+
- No behavior or API changes inside the adapter code. Republishing under new
32+
patch/beta numbers because npm does not allow re-publishing over an
33+
existing version, even to fix a broken registry document.
34+
1135
## [0.4.0] - 2026-04-18
1236

1337
### Added

adapters/memory/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@razroo/parallel-mcp-memory",
3-
"version": "0.1.0",
3+
"version": "0.1.1",
44
"description": "Minimal in-memory AsyncParallelMcpStore reference adapter for @razroo/parallel-mcp",
55
"license": "MIT",
66
"type": "module",
@@ -37,9 +37,9 @@
3737
"test": "vitest run",
3838
"test:watch": "vitest",
3939
"prepack": "node ./scripts/prepack.mjs",
40-
"postpack": "node ./scripts/postpack.mjs",
40+
"postpublish": "node ./scripts/postpack.mjs",
4141
"prepublishOnly": "npm run check && npm test && npm run build",
42-
"pack:check": "npm run prepublishOnly && npm pack --dry-run"
42+
"pack:check": "npm run prepublishOnly && npm pack --dry-run; node ./scripts/postpack.mjs"
4343
},
4444
"keywords": [
4545
"mcp",

adapters/postgres/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@razroo/parallel-mcp-postgres",
3-
"version": "0.1.0-beta.0",
3+
"version": "0.1.0-beta.1",
44
"description": "Postgres adapter for @razroo/parallel-mcp — full AsyncParallelMcpStore implementation",
55
"license": "MIT",
66
"type": "module",
@@ -41,9 +41,9 @@
4141
"test": "vitest run",
4242
"test:watch": "vitest",
4343
"prepack": "node ./scripts/prepack.mjs",
44-
"postpack": "node ./scripts/postpack.mjs",
44+
"postpublish": "node ./scripts/postpack.mjs",
4545
"prepublishOnly": "npm run check && npm test && npm run build",
46-
"pack:check": "npm run prepublishOnly && npm pack --dry-run"
46+
"pack:check": "npm run prepublishOnly && npm pack --dry-run; node ./scripts/postpack.mjs"
4747
},
4848
"keywords": [
4949
"mcp",

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

server/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@
4545
"test": "vitest run",
4646
"test:watch": "vitest",
4747
"prepack": "node ./scripts/prepack.mjs",
48-
"postpack": "node ./scripts/postpack.mjs",
48+
"postpublish": "node ./scripts/postpack.mjs",
4949
"prepublishOnly": "npm run check && npm test && npm run build",
50-
"pack:check": "npm run prepublishOnly && npm pack --dry-run"
50+
"pack:check": "npm run prepublishOnly && npm pack --dry-run; node ./scripts/postpack.mjs"
5151
},
5252
"keywords": [
5353
"mcp",

testkit/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@
3737
"test": "vitest run",
3838
"test:watch": "vitest",
3939
"prepack": "node ./scripts/prepack.mjs",
40-
"postpack": "node ./scripts/postpack.mjs",
40+
"postpublish": "node ./scripts/postpack.mjs",
4141
"prepublishOnly": "npm run check && npm test && npm run build",
42-
"pack:check": "npm run prepublishOnly && npm pack --dry-run"
42+
"pack:check": "npm run prepublishOnly && npm pack --dry-run; node ./scripts/postpack.mjs"
4343
},
4444
"keywords": [
4545
"mcp",

0 commit comments

Comments
 (0)