Repository navigation
Conversation
…d ignores Since pacquet started honoring workspace-root ignore files when packing, collect_own_files fed them to the walker even when the manifest declares a files allowlist. A workspace package whose compiled lib/ directory is gitignored at the workspace root then published a tarball whose lib/ contained only the force-included main file: the ancestor rule excluded lib/** before the files-field filter ever saw it. npm-packlist (and the TypeScript `@pnpm/fs.packlist` built on it) lets the files field override ancestor ignore rules, so every `@pnpm/*` lib package published by pacquet since 12.0.0-alpha.13 shipped nearly empty. Apply workspace-inherited ignore files only in tiers b/c of the root-priority rule, i.e. when the manifest has no files allowlist. Fixes #13164 Related to #13179
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughThe packlist walker no longer applies inherited workspace ignore files when a package manifest has a usable ChangesPacklist ignore precedence
Estimated code review effort: 2 (Simple) | ~15 minutes Assessment against linked issues
Out-of-scope changes
Possibly related PRs
Suggested labels: Suggested reviewers: ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
PR Summary by QodoFix fs-packlist:
AI Description
Diagram
High-Level Assessment
Files changed (3)
|
Confidence Score: 5/5The PR appears safe to merge. The previous empty-allowlist failure is fully addressed, and no blocking failure remains within the follow-up review scope. Reviews (5): Last reviewed commit: "refactor(fs-packlist): address second-ro..." | Re-trigger Greptile |
Micro-Benchmark ResultsLinux |
Code Review by Qodo
Context used✅ Compliance rules (platform):
24 rules 1.
|
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@pnpm/crates/fs-packlist/src/lib.rs`:
- Around line 12-16: The manifest files handling currently disables ignore
processing globally, preventing nested .gitignore and .npmignore files from
applying. Update the files-based packlist logic to register and honor ignore
files per directory or subtree while retaining the root allowlist as the
inclusion gate; avoid using global git_ignore(false) for this branch so nested
exclusions such as lib/.npmignore remain effective.
In `@pnpm/crates/fs-packlist/src/tests.rs`:
- Around line 460-500: Extend files_field_overrides_workspace_root_gitignore to
also cover a workspace-root .npmignore case, using the same ignored lib pattern
and manifest setup. Preserve the existing exact packlist assertion so the test
validates identical published contents for both inherited ignore-file types.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: e83184b0-1fa1-4c0c-88fe-c99465ce4098
📒 Files selected for processing (3)
.changeset/packlist-files-field-workspace-ignores.mdpnpm/crates/fs-packlist/src/lib.rspnpm/crates/fs-packlist/src/tests.rs
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #13231 +/- ##
==========================================
- Coverage 86.96% 86.94% -0.02%
==========================================
Files 528 528
Lines 90342 90467 +125
==========================================
+ Hits 78567 78658 +91
- Misses 11775 11809 +34 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…acks The TypeScript release publishes with the pacquet version pinned in packageManager, and every pin from 12.0.0-alpha.13 onward carries the packlist bug fixed in this PR: workspace-root ignore rules exclude files matched by a package files allowlist, so the lib packages ship nearly empty (#13164). Until the pin advances to a release containing the fix, write a root .npmignore holding only the junk rules of the root .gitignore (not lib/dist) before packing; the packlist prefers a root .npmignore over the root .gitignore, which restores complete tarballs on the very next release. Temporary: remove once the packageManager pin carries the fixed pacquet.
|
Code review by qodo was updated up to the latest commit dda65d7 |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
…arballs Tarballs published by the v11.13.1 through v11.16.0 releases are missing most of their compiled files (#13164), and npm tarballs are immutable, so a package only heals by publishing a new version. Patch-bump all 186 published lib packages plus the pnpm CLI so the next release republishes everything with complete contents. The executable artifact packages are excluded: they are rebuilt and verified on every release and were never affected.
|
Code review by qodo was updated up to the latest commit 939d4d8 |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
Gate the three-tier ignore decision on the built files matcher instead of field presence, so a files field with no usable entry keeps ignore files active, matching the treated-as-absent contract of build_files_matcher. Prune node_modules and VCS subtrees at walk level now that no workspace ignore rule prunes them as a side effect when a files allowlist is present. Cover workspace-root .npmignore inheritance and the empty files field with tests, and drop `@pnpm/logger` from the republish changeset: versioning.ignore freezes it and its latest version predates the broken window.
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@pnpm/crates/fs-packlist/src/tests.rs`:
- Around line 502-532: Add a lib/index.map fixture in
files_field_overrides_workspace_root_npmignore and update the expected packlist
to explicitly exclude lib/index.map while retaining the existing JavaScript,
declaration, and package.json entries.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 969330ac-cbfe-4608-b662-b2082dc2eb76
📒 Files selected for processing (3)
.changeset/republish-all-lib-packages.mdpnpm/crates/fs-packlist/src/lib.rspnpm/crates/fs-packlist/src/tests.rs
💤 Files with no reviewable changes (1)
- .changeset/republish-all-lib-packages.md
🚧 Files skipped from review as they are similar to previous changes (1)
- pnpm/crates/fs-packlist/src/lib.rs
Exercise the !*.map allowlist exclusion in both workspace-override regression tests, state the regression-test comment as the current contract instead of past behavior, and compare walker entry names as OsStr in filter_entry to skip per-entry UTF-8 conversion on the hot traversal path.
|
Re the remaining Qodo findings on commit 0a83425:
Written by an agent (Claude Code, claude-fable-5). |
|
Code review by qodo was updated up to the latest commit 009a1c8 |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
Replace the per-package pack loop with four concurrent pnpm pack --dry-run --json chunks whose reported file lists the verifier checks directly: no tarballs are written or read, no per-package script spawns, and no per-file tar extractions. The compiled payloads are built once with pn compile-only beforehand, since pack does not run prepublishOnly. Publishable projects are selected by explicit name filters because recursive pack, unlike recursive publish, does not skip private packages, and packing the private workspace root would walk the whole repository. Give `@pnpm/modules-mounter.daemon` the lib/index.js entry its manifest (and the meta-updater exports rule) declares: the verifier caught that the file never existed, in the published tarballs as well. Drop the two-package republish changeset, superseded by the all-packages republish changeset from pnpm#13231.
…lpha.19 (#13241) * chore(release): drop the packing workarounds now that pacquet 12.0.0-alpha.19 is pinned The pinned pacquet now carries the fs-packlist fix from #13231, so a files allowlist wins over workspace-inherited ignore rules and the release workflow no longer needs to neutralize them: remove the empty pnpm11/pnpm/.npmignore override, the temporary root .gitignore shadow, and the pre-publish payload verification step (with its script) that guarded against the now-fixed empty-tarball packing bug. The payload-verify step was also what broke the v11.17.0 release: its filtered pn list fired a verifyDepsBeforeRun auto-install that pruned the excluded pnpm project's node_modules, so the darwin-arm64 artifact's prepublishOnly could no longer resolve symlink-dir. `@pnpm/prepare` and `@pnpm/prepare-temp-dir` were the only publishable packages without a files allowlist; their lib/ payload survived packing only through the .gitignore shadow. Give them files allowlists so their tarballs no longer depend on workspace ignore state. * chore: record the pacquet 12.0.0-alpha.19 pin in the lockfile * chore: drop the changeset - both files-allowlist fixes ship without a new version The pending `@pnpm/prepare` 1100.0.22 is not on npm yet, so the rerun of the v11.17.0 release publishes it with the files allowlist already in place. `@pnpm/prepare-temp-dir` 1100.0.1 is already published with correct tarball content (packed under the .gitignore shadow), so its manifest-only change needs no republish. A changeset would only schedule a patch release whose sole delta is the manifest field.
Summary
Closes pnpm/pnpm#13164. Related to pnpm/pnpm#13179.
Since v11.13.1 the release workflow publishes the TypeScript lib packages with pacquet (the
packageManagerpin moved from[email protected]toalpha.13between the last good and first broken release). Alpha.13 picked up #12878, which taughtfs-packlistto honor workspace-root ignore files when packing — but it fed them to the walker unconditionally, even when the manifest declares afilesallowlist.The repo root
.gitignorecontainslib, so when packing any workspace package withfiles: ["lib", "!*.map"], the walker dropped all oflib/**before thefilesallowlist was ever consulted. The only survivor waslib/index.js, force-included as themainpath — exactly the tarball shape reported in the issue. This hit essentially every@pnpm/*lib package published between v11.13.1 and v11.16.0.npm-packlist (and therefore the TypeScript
@pnpm/fs.packlistbuilt on it) lets thefilesfield override ancestor ignore rules — verified against the real npm-packlist with the same fixture. The fix applies workspace-inherited ignore files only in tiers b/c of the root-priority rule, i.e. when the manifest has nofilesallowlist.Temporary release-workflow guard
The fix itself only takes effect once
packageManagerpins a pacquet release that contains it, and there is currently no way to cut a pacquet-only release — the next release PR would publish the TypeScript packages with the still-broken pinned pacquet. To break that cycle, this PR also adds a clearly-marked TEMPORARY step to the two TypeScript release jobs: before packing, write a root.npmignorecarrying only the junk rules of the root.gitignore(*.tsbuildinfo,*.log— crucially notlib/dist). The packlist prefers a root.npmignoreover the root.gitignore, so the broken workspace-ignore chain no longer sees thelibrule and the very next release publishes complete tarballs. The step must be removed once the pin advances to a fixed pacquet.Republish changeset
Broken tarballs on npm are immutable — a package only heals by publishing a new version. This PR therefore also carries a changeset patch-bumping all 186 published lib packages plus the
pnpmCLI (every workspace-published package except the executable artifact packages, which are rebuilt and verified on every release and were never affected), so the next release republishes everything with complete contents.Squash Commit Body
Checklist
pnpm/port, or the description notes what still needs porting. (Rust-only fix: the TypeScript CLI uses npm-packlist, which already behaves correctly — this restores pacquet parity with it.)pnpm changeset) if this PR changes any publishedpackage. Keep it short and written for pnpm users — it becomes a release note.
Written by an agent (Claude Code, claude-fable-5).
Summary by CodeRabbit
filesallowlist takes precedence over workspace-root.gitignore/.npmignore, preventing allowlisted build outputs from being incorrectly excluded.filesfield precedence..npmignoreduring packaging for correct release artifact filtering.