Skip to content

fix(cli): bundle @parallax/slack in published package#34

Merged
maxigimenez merged 1 commit into
mainfrom
fix/npm-publish-bundle-slack
Jul 2, 2026
Merged

fix(cli): bundle @parallax/slack in published package#34
maxigimenez merged 1 commit into
mainfrom
fix/npm-publish-bundle-slack

Conversation

@maxigimenez

Copy link
Copy Markdown
Owner

Problem

The Release parallax-cli workflow (run) failed at publish with:

npm error 415 Unsupported Media Type - PUT https://registry.npmjs.org/parallax-cli
invalid path: package/../../node_modules/.pnpm/body-parser@2.2.2/node_modules/qs/.editorconfig

v0.1.0 was not published (npm latest is still 0.0.9), so this is safe to retry once merged.

Root cause

@parallax/slack was added to the cli's dependencies + bundleDependencies (in #22), but prepare-package.mjs — which flattens each internal package to a clean dist-only dir before packing — was never updated to include it. So at pack time npm followed slack's pnpm-symlinked node_modules into .pnpm/..., producing ../ path-traversal entries (rejected by the registry) and bloating the tarball to 6.3 MB / 9577 files.

Fix

  • Flatten @parallax/slack to a dist-only bundled package in prepare-package.mjs, and hoist its runtime deps (@slack/bolt, @slack/web-api) into the cli's dependencies so consumers get them installed (same pattern already used for the orchestrator's deps).
  • Derive bundled versions from each package's package.json instead of a hardcoded 0.0.4, so published internal versions stay consistent with the release.
  • Pin the cli's internal @parallax/* deps to concrete versions instead of workspace:*, with link-workspace-packages=true so they still link locally. This keeps the workspace: protocol out of the source entirely (it previously only stayed out of the tarball via the prepack rewrite).
  • Add scripts/set-version.mjs (pnpm version:set <version>) to bump every package version and the cli's internal pins together — required because the pins must match the workspace version to link.

Verification

  • pnpm install --frozen-lockfile
  • pnpm lint ✅ · pnpm test ✅ (orchestrator 126, cli 25, slack 17)
  • npm pack tarball: 265 kB / 249 files, published package.json pins @parallax/* to 0.1.0, zero workspace: refs, zero ../ traversal paths.

Release

After merge, re-run the Release parallax-cli workflow to publish 0.1.0.

🤖 Generated with Claude Code

The npm release failed with a 415 "invalid path" error because
@parallax/slack was listed in bundleDependencies but was not flattened
by prepare-package.mjs, so npm packed its pnpm-symlinked node_modules
tree (producing package/../../node_modules/.pnpm/... traversal paths and
bloating the tarball to 39 MB / 9577 files).

- Flatten @parallax/slack to a dist-only bundled package, like the other
  internal packages, and hoist its runtime deps (@slack/bolt,
  @slack/web-api) into the cli so consumers get them installed.
- Derive bundled package versions from each package.json instead of a
  hardcoded 0.0.4, keeping published versions consistent per release.
- Pin the cli's internal @parallax/* deps to concrete versions instead of
  workspace:* (link-workspace-packages=true links them locally); this
  keeps the workspace protocol out of the source entirely.
- Add scripts/set-version.mjs (pnpm version:set) to bump all package
  versions and the cli's internal pins in lockstep, since the pins must
  match the workspace version to link.

Tarball is now 265 kB / 249 files with zero workspace: refs and no
traversal paths.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@vercel

vercel Bot commented Jul 2, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
parallax Ready Ready Preview, Comment Jul 2, 2026 9:08am

@maxigimenez
maxigimenez merged commit 393b630 into main Jul 2, 2026
3 checks passed
@maxigimenez
maxigimenez deleted the fix/npm-publish-bundle-slack branch July 2, 2026 09:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant