fix(cli): bundle @parallax/slack in published package#34
Merged
Conversation
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>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The Release parallax-cli workflow (run) failed at publish with:
v0.1.0was not published (npm latest is still0.0.9), so this is safe to retry once merged.Root cause
@parallax/slackwas added to the cli'sdependencies+bundleDependencies(in #22), butprepare-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-symlinkednode_modulesinto.pnpm/..., producing../path-traversal entries (rejected by the registry) and bloating the tarball to 6.3 MB / 9577 files.Fix
@parallax/slackto a dist-only bundled package inprepare-package.mjs, and hoist its runtime deps (@slack/bolt,@slack/web-api) into the cli'sdependenciesso consumers get them installed (same pattern already used for the orchestrator's deps).package.jsoninstead of a hardcoded0.0.4, so published internal versions stay consistent with the release.@parallax/*deps to concrete versions instead ofworkspace:*, withlink-workspace-packages=trueso they still link locally. This keeps theworkspace:protocol out of the source entirely (it previously only stayed out of the tarball via the prepack rewrite).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 packtarball: 265 kB / 249 files, publishedpackage.jsonpins@parallax/*to0.1.0, zeroworkspace:refs, zero../traversal paths.Release
After merge, re-run the Release parallax-cli workflow to publish
0.1.0.🤖 Generated with Claude Code