fix: ship dist in the published package (broken brace glob in files)#5
Merged
Conversation
The `files` field used the `"{dist,src}"` brace-expansion pattern. pnpm 9
(used to publish 1.x) expanded it, but pnpm 10/11 no longer does, so the
pattern matched nothing and the published 2.x tarballs shipped only
LICENSE/package.json/README.md — no dist or src. The 2.0 rewrite bumped
pnpm to 11.3.0, which is what surfaced the latent bug.
Split the brace pattern into explicit "dist" and "src" entries, which
pack correctly on every pnpm version. Verified `pnpm pack --dry-run`
now includes dist/src/** and still excludes dist/test.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
What
Split the
filesfield's"{dist,src}"brace pattern into explicit"dist"and"src"entries.Why
Published 2.x tarballs on npm contained only
LICENSE,package.json, andREADME.md— nodistorsrc— so the package was effectively unusable when installed.Root cause: the
filesfield has always used the"{dist,src}"brace-expansion glob (since 1.x). pnpm 9 (which published the working 1.x releases) expanded the brace; pnpm 10/11 no longer does, so the pattern matched nothing and both directories were silently dropped from the tarball.The latent bug surfaced in the 2.0 rewrite (e88441c), which bumped
packageManagertopnpm@11.3.0andpnpm/action-setupto v6. Thefilesfield itself was not changed — only the pnpm version.Verification
pnpm pack --dry-runnow includes alldist/src/**files and still correctly excludesdist/test.Reviewer notes
chore/fix-level change; merging tomainwill publish a fixedrcprerelease. Recommend confirming therctarball containsdistbefore cuttinglatestvia the Cut Release workflow.🤖 Generated with Claude Code