Skip to content

fix: ship dist in the published package (broken brace glob in files)#5

Merged
frozenluo merged 1 commit into
mainfrom
fix/files-glob-dist
Jun 15, 2026
Merged

fix: ship dist in the published package (broken brace glob in files)#5
frozenluo merged 1 commit into
mainfrom
fix/files-glob-dist

Conversation

@frozenluo

Copy link
Copy Markdown
Contributor

What

Split the files field's "{dist,src}" brace pattern into explicit "dist" and "src" entries.

   "files": [
-    "{dist,src}",
+    "dist",
+    "src",
     "!dist/test"
   ],

Why

Published 2.x tarballs on npm contained only LICENSE, package.json, and README.mdno dist or src — so the package was effectively unusable when installed.

Root cause: the files field 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 packageManager to pnpm@11.3.0 and pnpm/action-setup to v6. The files field itself was not changed — only the pnpm version.

Verification

pnpm pack --dry-run now includes all dist/src/** files and still correctly excludes dist/test.

Reviewer notes

  • This is a chore/fix-level change; merging to main will publish a fixed rc prerelease. Recommend confirming the rc tarball contains dist before cutting latest via the Cut Release workflow.
  • All previously published 2.x versions on npm are affected and should be considered broken.

🤖 Generated with Claude Code

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>
@frozenluo frozenluo merged commit f8e3fda into main Jun 15, 2026
1 check passed
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