Skip to content

fix(fs-packlist): let the files allowlist override workspace-inherited ignores - #13231

Merged
zkochan merged 6 commits into
mainfrom
fix-13164
Jul 23, 2026
Merged

zkochan merged 6 commits into
mainfrom
fix-13164

Conversation

@zkochan

@zkochan zkochan commented Jul 23, 2026 •

Copy link
Copy Markdown
Member

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 packageManager pin moved from [email protected] to alpha.13 between the last good and first broken release). Alpha.13 picked up #12878, which taught fs-packlist to honor workspace-root ignore files when packing — but it fed them to the walker unconditionally, even when the manifest declares a files allowlist.

The repo root .gitignore contains lib, so when packing any workspace package with files: ["lib", "!*.map"], the walker dropped all of lib/** before the files allowlist was ever consulted. The only survivor was lib/index.js, force-included as the main path — 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.packlist built on it) lets the files field 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 no files allowlist.

Temporary release-workflow guard

The fix itself only takes effect once packageManager pins 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 .npmignore carrying only the junk rules of the root .gitignore (*.tsbuildinfo, *.log — crucially not lib/dist). The packlist prefers a root .npmignore over the root .gitignore, so the broken workspace-ignore chain no longer sees the lib rule 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 pnpm CLI (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

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.

Because the TypeScript release publishes with the packageManager-pinned
pacquet and no pacquet-only release can be cut first, also add a
TEMPORARY release-workflow step that shadows the root .gitignore with a
junk-only root .npmignore before packing, so the next release ships
complete tarballs even with a broken pinned pacquet. Remove it once the
pin carries this fix.

Broken tarballs on npm are immutable, so a changeset patch-bumps every
published lib package plus the pnpm CLI to force a full republish on
the next release.

Fixes pnpm/pnpm#13164
Related to pnpm/pnpm#13179

Checklist

  • The change is implemented in both the TypeScript CLI and the Rust
    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.)
  • Added a changeset (pnpm changeset) if this PR changes any published
    package. Keep it short and written for pnpm users — it becomes a release note.
  • Added or updated tests.

Written by an agent (Claude Code, claude-fable-5).

Summary by CodeRabbit

  • Bug Fixes
    • Fixed packing and publishing so a package’s files allowlist takes precedence over workspace-root .gitignore / .npmignore, preventing allowlisted build outputs from being incorrectly excluded.
  • Maintenance
    • Republished affected library packages to restore missing compiled artifacts from prior release tarballs.
  • Tests
    • Added regression tests covering workspace-root ignore-file and files field precedence.
  • Chores
    • Updated the TypeScript pnpm release workflow to apply a temporary root .npmignore during packaging for correct release artifact filtering.

…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
Copilot AI review requested due to automatic review settings July 23, 2026 11:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Jul 23, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It 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 reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: a76360d4-c27b-46d9-8eff-1bad912f2f3b

📥 Commits

Reviewing files that changed from the base of the PR and between 0a83425 and 009a1c8.

📒 Files selected for processing (2)
  • pnpm/crates/fs-packlist/src/lib.rs
  • pnpm/crates/fs-packlist/src/tests.rs
🚧 Files skipped from review as they are similar to previous changes (2)
  • pnpm/crates/fs-packlist/src/lib.rs
  • pnpm/crates/fs-packlist/src/tests.rs

📝 Walkthrough

Walkthrough

The packlist walker no longer applies inherited workspace ignore files when a package manifest has a usable files allowlist. Regression tests, release workflow steps, and changesets cover packaging and republishing affected packages.

Changes

Packlist ignore precedence

Layer / File(s) Summary
Gate inherited workspace ignores
pnpm/crates/fs-packlist/src/lib.rs
Packlist walking prunes excluded directories and skips inherited workspace ignore files when a usable files allowlist exists.
Validate and record releases
pnpm/crates/fs-packlist/src/tests.rs, .changeset/*.md
Tests cover workspace .gitignore and .npmignore precedence and empty files behavior; changesets document the fix and republish affected packages.
Release packaging workflow
.github/workflows/release.yml
TypeScript verification and release jobs write minimal root .npmignore files before packaging phases.

Estimated code review effort: 2 (Simple) | ~15 minutes

Assessment against linked issues

Objective Addressed Explanation
Include the missing type definitions in @pnpm/hooks.pnpmfile packages [#13164] ❓ The packlist fix and republish changeset target the reported missing-file failure, but no package-specific fixture or assertion verifies that @pnpm/hooks.pnpmfile types are present.

Out-of-scope changes

Code Change Explanation
Add temporary root .npmignore overrides to TypeScript release jobs (.github/workflows/release.yml:209-219,376-386) These modify TypeScript CLI release packaging and are not specific to republishing @pnpm/hooks.pnpmfile with its missing type definitions.

Possibly related PRs

Suggested labels: product: pacquet

Suggested reviewers: copilot

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-13164

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Fix fs-packlist: files allowlist overrides workspace ignore inheritance

🐞 Bug fix 🧪 Tests 📝 Documentation 🕐 40+ Minutes

Grey Divider

AI Description

• Stop workspace-root ignore rules from filtering pack walks when files is set.
• Preserve npm-packlist precedence: files disables .gitignore/.npmignore (including
 inherited).
• Add regression coverage for allowlisted lib/ being gitignored at workspace root.
Diagram

graph TD
  A["packlist_with_options"] --> B["collect_own_files"] --> C{"manifest has `files`?"}
  C -- "yes" --> D["Walk (no inherited ignores)"] --> E["Apply `files` allowlist"] --> F["Published file set"]
  C -- "no" --> G["Walk (workspace ignores enabled)"] --> F
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Two-phase walk seeded by `files` globs
  • ➕ Could allow some inherited ignore behavior while still ensuring allowlisted paths are discovered
  • ➖ More complex (need glob expansion + directory discovery)
  • ➖ Harder to keep aligned with npm-packlist semantics
  • ➖ More I/O and more edge cases around negations (!)
2. Implement directory-level `.npmignore` precedence like npm-packlist
  • ➕ Closer behavioral parity with upstream npm-packlist rules in all cases
  • ➖ Blocked/awkward with ignore::WalkBuilder global toggles (as noted in crate docs)
  • ➖ Larger refactor with higher regression risk

Recommendation: Current approach (skip workspace-inherited ignores when files is present) is the best fit: it matches npm-packlist’s root-priority rule, fixes the concrete publication breakage, and keeps the change localized to walk configuration with a clear regression test.

Files changed (3) +68 / -13

Bug fix (1) +21 / -13
lib.rsGate workspace-inherited ignore loading on absence of 'files' allowlist +21/-13

Gate workspace-inherited ignore loading on absence of 'files' allowlist

• Updates the documented precedence rules to clarify that 'files' disables both package-level and workspace-inherited ignore files. Changes 'collect_own_files' so 'add_workspace_ignore_files' is only applied in tiers (b)/(c), preventing ancestor ignore rules from pruning allowlisted directories before the 'files' filter runs.

pnpm/crates/fs-packlist/src/lib.rs

Tests (1) +42 / -0
tests.rsAdd regression test: 'files' overrides workspace-root '.gitignore' +42/-0

Add regression test: 'files' overrides workspace-root '.gitignore'

• Introduces a new test covering the reported failure mode where workspace-root '.gitignore' ignores an allowlisted 'lib/' directory. Asserts the packlist includes all allowlisted 'lib/*' outputs (plus 'package.json') rather than only the force-included 'main' file.

pnpm/crates/fs-packlist/src/tests.rs

Documentation (1) +5 / -0
packlist-files-field-workspace-ignores.mdAdd changeset documenting the workspace-ignore precedence fix +5/-0

Add changeset documenting the workspace-ignore precedence fix

• Adds a pacquet patch changeset describing the corrected behavior for 'pnpm pack'/'pnpm publish' when 'files' is present. References the regression and links to the originating issue.

.changeset/packlist-files-field-workspace-ignores.md

@greptile-apps

greptile-apps Bot commented Jul 23, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5

The 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

Comment thread pnpm/crates/fs-packlist/src/lib.rs Resolved
@github-actions

github-actions Bot commented Jul 23, 2026 •

Copy link
Copy Markdown
Contributor

Micro-Benchmark Results

Linux

group                          main                                   pr
-----                          ----                                   --
lockfile/parse_pnpm_lock       1.04     12.2±0.79ms    30.7 MB/sec    1.00     11.8±0.95ms    31.9 MB/sec
packument/parse                1.12     42.1±2.49µs  1576.2 MB/sec    1.00     37.6±0.40µs  1766.1 MB/sec
tarball/download_dependency    1.66      3.9±0.86ms  1114.1 KB/sec    1.00      2.3±0.16ms  1851.2 KB/sec

@qodo-code-review

qodo-code-review Bot commented Jul 23, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (1) 📘 Rule violations (1) 📜 Skill insights (0)

Context used
✅ Compliance rules (platform): 24 rules

Grey Divider


Action required

1. Logger bump is ignored ✓ Resolved 🐞 Bug ≡ Correctness
Description
The republish changeset includes a patch bump for @pnpm/logger, but the release engine excludes
@pnpm/logger via versioning.ignore, so this intent will be skipped and @pnpm/logger will not
be republished by pnpm version -r.
This undermines the intent of the “republish all lib packages” changeset because one listed package
is silently non-participating under current versioning rules.
Code

.changeset/republish-all-lib-packages.md[121]

+"@pnpm/logger": patch
Relevance

⭐⭐⭐ High

Team often aligns changeset package list with actual release behavior; stray/ineffective bumps are
corrected.

PR-#13090
PR-#11481

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The changeset explicitly requests a release for @pnpm/logger, but the workspace configuration and
release-planner code show that ignored packages are excluded from release participants, so their
intents cannot be consumed/applied by the automated release flow.

.changeset/republish-all-lib-packages.md[118-122]
pnpm-workspace.yaml[60-71]
pnpm/crates/versioning/src/plan.rs[521-545]
AGENTS.md[193-197]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The changeset `.changeset/republish-all-lib-packages.md` declares a patch bump for `@pnpm/logger`, but the workspace release engine is configured to *exclude* `@pnpm/logger` from automated releases (`versioning.ignore`). As a result, the change intent won’t be applied during `pnpm version -r`, so `@pnpm/logger` won’t be republished despite being listed.

## Issue Context
- The repo’s native release flow consumes `.changeset/*` intents via `pnpm version -r`.
- `pnpm-workspace.yaml` explicitly freezes `@pnpm/logger` from automated release, and the versioning planner skips ignored projects entirely.

## Fix Focus Areas
- .changeset/republish-all-lib-packages.md[118-123]
- pnpm-workspace.yaml[60-71]
- pnpm/crates/versioning/src/plan.rs[521-545]

## What to change
Choose one:
1) If `@pnpm/logger` is intentionally excluded from the mass republish: remove the `"@pnpm/logger": patch` line and adjust the prose to not imply it will be republished.
2) If `@pnpm/logger` must be republished as part of this effort: handle it via the documented out-of-band path (or temporarily remove it from `versioning.ignore` and ensure the release engine can proceed with its dependency/versioning constraints).

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. node_modules walk perf regression ✓ Resolved 🐞 Bug ➹ Performance
Description
In collect_own_files, when manifest.files is present the code no longer applies
workspace-inherited ignore files, so the walker can enumerate large directories (notably
**/node_modules/** ignored at the workspace root) even though node_modules entries are only
discarded after the walk. This can add substantial extra filesystem I/O on pacquet pack/publish
for workspace packages, increasing pack time and creating a practical DoS vector via huge
node_modules/.pnpm trees.
Code

pnpm/crates/fs-packlist/src/lib.rs[R327-342]

    if files_field.is_some() {
        builder.git_ignore(false);
-    } else if has_root_npmignore {
-        builder.git_ignore(false);
-        builder.add_custom_ignore_filename(".npmignore");
    } else {
-        builder.git_ignore(true);
+        if has_root_npmignore {
+            builder.git_ignore(false);
+        } else {
+            builder.git_ignore(true);
+        }
        builder.add_custom_ignore_filename(".npmignore");
+        // Workspace-inherited ignore files apply only in tiers (b)/(c):
+        // with a `files` allowlist an ancestor rule must not filter the
+        // walk, or an allowlisted directory the workspace root happens
+        // to `.gitignore` (a compiled `lib/`) never reaches pass 2 and
+        // silently vanishes from the tarball.
+        add_workspace_ignore_files(&mut builder, pkg_dir, workspace_dir)?;
    }
-    add_workspace_ignore_files(&mut builder, pkg_dir, workspace_dir)?;
Relevance

⭐⭐ Medium

Potential perf issue but conflicts with PR’s intended behavior change; no clear historical
accept/reject precedent.

PR-#12878

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The PR change stops adding workspace ignore files when files is present, and the code only drops
node_modules after builder.build() yields file entries, so it cannot prevent traversal. The
workspace root .gitignore explicitly ignores **/node_modules/**, meaning this pruning was
previously provided by workspace-inherited ignore files for workspace pack operations.

pnpm/crates/fs-packlist/src/lib.rs[317-368]
.gitignore[6-9]
pnpm/crates/pack/src/lib.rs[316-325]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
When `manifest.files` is set, workspace-root ignore files are no longer added to the `ignore::WalkBuilder`, so common workspace-root rules like `**/node_modules/**` stop pruning traversal. Because `node_modules` is filtered only *after* entries are yielded, the walker may still enumerate huge trees (especially `node_modules/.pnpm`), causing significant pack/publish slowdowns.

## Issue Context
This regression is introduced by moving `add_workspace_ignore_files(...)` into the `else` branch (only when `files` is absent). In this repo, the workspace root `.gitignore` ignores `**/node_modules/**`, which previously prevented walking installed dependency trees in workspace packages.

## Fix Focus Areas
- pnpm/crates/fs-packlist/src/lib.rs[317-368]

### Concrete fix approach
- Add a `builder.filter_entry(...)` (or equivalent pre-walk pruning) to skip descending into directories that are *always excluded from pack output*, at minimum `node_modules`.
- Consider also pruning `ALWAYS_EXCLUDED_DIR_SEGMENTS` (e.g. `.git`, `.hg`, etc.) at directory level to avoid wasted traversal.
- Keep the semantic change intact: do **not** re-enable workspace-root ignore patterns in the `files`-allowlist case; just avoid walking subtrees that can never be emitted.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

3. Hardcoded root ignore subset 🐞 Bug ☼ Reliability
Description
The workflow writes a repo-root .npmignore containing only *.tsbuildinfo and *.log, which
makes pack/publish prefer it over the repo-root .gitignore for the rest of the job. This means
other existing root ignore rules (e.g. caches/fixtures) stop applying during packing/publishing of
workspace packages without a files allowlist, so published tarballs can unexpectedly start
including repository “junk” as .gitignore evolves or as such artifacts appear under package dirs.
Code

.github/workflows/release.yml[R209-219]

+      - name: Shadow the root .gitignore for packing (TEMPORARY)
+        # The pinned pacquet (12.0.0-alpha.13 and later, until the fix from
+        # https://github.com/pnpm/pnpm/pull/13231 ships) lets workspace-root
+        # ignore rules exclude files matched by a package's `files` allowlist,
+        # so every lib package published with it shipped nearly empty:
+        # https://github.com/pnpm/pnpm/issues/13164. The packlist prefers a
+        # root .npmignore over the root .gitignore, so shadow the .gitignore
+        # with only its junk rules (crucially not `lib`/`dist`, the compiled
+        # payload of every lib package). Remove this step once
+        # `packageManager` pins a pacquet release that carries the fix.
+        run: printf '*.tsbuildinfo\n*.log\n' > .npmignore
Relevance

⭐⭐ Medium

Release workflow is sensitive; they may refine this temporary workaround, but current intent is
deliberate and justified.

PR-#13045
PR-#13064

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The workflow now creates a repo-root .npmignore (twice) before running pn pack/pn publish, so
the packlist will prefer it over the existing root .gitignore. The root .gitignore currently
contains many ignore rules beyond logs/tsbuildinfo; dropping them at the workspace root can change
what gets included for packages that don’t have a files allowlist (some workspace packages indeed
omit files).

.github/workflows/release.yml[206-238]
.github/workflows/release.yml[373-416]
.gitignore[1-84]
pnpm11/utils/prepare/package.json[1-30]
pnpm11/utils/prepare-temp-dir/package.json[1-22]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
The release workflow creates a repo-root `.npmignore` with only two patterns. Because packlists prefer `.npmignore` over `.gitignore` at the workspace root, this can unintentionally widen what is eligible for packing/publishing for workspace packages that rely on ignore files (not a `files` allowlist).

### Issue Context
This step is meant to avoid the workspace-root `.gitignore` excluding payload directories like `lib/` and `dist/`, but the current hardcoded `.npmignore` also drops many other root ignore rules.

### Fix Focus Areas
- .github/workflows/release.yml[209-219]
- .github/workflows/release.yml[376-386]

### Recommended fix
- Generate the temporary root `.npmignore` by *filtering* the existing root `.gitignore` (preserve all current “junk” rules) while removing only the payload-blocking entries (`lib`, `dist`, and any other known payload dirs).
- Make the step safe for future changes by backing up/restoring an existing root `.npmignore` if one is later added to the repo (e.g., `mv .npmignore .npmignore.bak` + `trap` restore).
- Keep the step clearly temporary, but make its behavior match the repo’s actual ignore policy to avoid accidental publish-content drift.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


4. Historical comment in regression test ✓ Resolved 📘 Rule violation ⚙ Maintainability
Description
The newly added regression-test comment describes past behavior (what the walker "applied" and what
tarballs "kept") rather than the current contract the test asserts, which is disallowed by the
checklist.
Code

pnpm/crates/fs-packlist/src/tests.rs[R460-463]

+// Regression test for <https://github.com/pnpm/pnpm/issues/13164>: the
+// workspace-root `.gitignore` ignores compiled `lib/` output, and the
+// walker applied it even when the manifest declared `files: ["lib"]`,
+// so published tarballs kept only the force-included `main` file.
Relevance

⭐⭐ Medium

Team sometimes rewords historical regression comments, but outcomes are mixed across similar
findings.

PR-#12829
PR-#12954

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
PR Compliance ID 772199 forbids comments that describe past behavior instead of the current
contract. The added comment explains what the walker used to do and what tarballs previously
contained, rather than documenting the current expected behavior asserted by the test.

Rule 772199: Comments must describe current behavior, not historical implementations
pnpm/crates/fs-packlist/src/tests.rs[460-463]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
A new comment uses historical phrasing to describe previous behavior rather than documenting the current behavior/contract.

## Issue Context
The repository compliance rule requires comments to describe current behavior, not historical implementations.

## Fix Focus Areas
- pnpm/crates/fs-packlist/src/tests.rs[460-463]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Informational

5. Extra filename string conversion ✓ Resolved 🐞 Bug ➹ Performance ⭐ New
Description
In collect_own_files(), the new WalkBuilder::filter_entry closure calls to_string_lossy() for
each non-root entry just to compare against a small set of ASCII directory names. This usually
doesn’t allocate (it returns a borrowed Cow for UTF-8 names) but still performs UTF-8
conversion/validation work in a hot traversal path and can be avoided with OsStr comparisons.
Code

pnpm/crates/fs-packlist/src/lib.rs[R334-343]

+    builder.filter_entry(|entry| {
+        if entry.depth() == 0 {
+            return true;
+        }
+        let name = entry.file_name().to_string_lossy();
+        if entry.depth() == 1 && name == "node_modules" {
+            return false;
+        }
+        !ALWAYS_EXCLUDED_DIR_SEGMENTS.contains(&name.as_ref())
+    });
Relevance

⭐⭐⭐ High

Team often accepts removing per-iteration allocations/conversions in hot paths; no close matching
rejection for this pattern.

PR-#12102
PR-#13160

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The new filter_entry closure runs during the walk for each visited entry (except depth 0) and
performs entry.file_name().to_string_lossy() before doing simple equality/contains checks, making
the conversion unnecessary for the intended comparisons.

pnpm/crates/fs-packlist/src/lib.rs[329-343]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
`filter_entry` currently converts each entry’s filename to a lossy UTF-8 string (`to_string_lossy()`) to compare against `"node_modules"` and `ALWAYS_EXCLUDED_DIR_SEGMENTS`. This adds avoidable work in a filesystem-walk hot path.

### Issue Context
The filter only needs to check exact segment equality against a few ASCII literals.

### Fix Focus Areas
- pnpm/crates/fs-packlist/src/lib.rs[334-343]

### Suggested fix
- Compare using `std::ffi::OsStr`:
 - `if entry.depth() == 1 && entry.file_name() == OsStr::new("node_modules") { ... }`
 - For VCS dirs, either:
   - define a small `matches!(entry.file_name(), ...)` chain with `OsStr::new(".git")`, etc., or
   - store the excluded names as `&'static OsStr` (or precomputed `OsString`) and compare without string conversion.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


6. pnpm missing in changeset 📘 Rule violation § Compliance
Description
The new changeset describes a pnpm pack/pnpm publish user-visible change but its front-matter
only bumps pacquet, so the pnpm release may not get the required version bump/changelog entry
for this fix.
Code

.changeset/packlist-files-field-workspace-ignores.md[R1-5]

+---
+"pacquet": patch
+---
+
+`pnpm pack` and `pnpm publish` no longer let workspace-root `.gitignore` / `.npmignore` rules exclude files matched by the package manifest's `files` allowlist. Workspace packages whose build output is gitignored at the workspace root (for example a compiled `lib/` directory listed in `files`) were published with almost all payload files missing [#13164](https://github.com/pnpm/pnpm/issues/13164).
Relevance

⭐ Low

Multiple close precedents reject adding pnpm to pacquet-only changesets; team treats pnpm entry
as unnecessary.

PR-#13117
PR-#12981
PR-#12991

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
PR Compliance ID 713436 requires changesets to declare the pnpm package with a valid bump type.
The added changeset omits pnpm in front-matter while stating pnpm pack/pnpm publish behavior
changed, indicating the changeset metadata is incomplete for the described impact.

Rule 713436: Explicitly declare pnpm package and correct bump type in changesets
.changeset/packlist-files-field-workspace-ignores.md[1-5]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The new changeset text claims a `pnpm pack` / `pnpm publish` behavior change, but the changeset front-matter does not include a `pnpm` bump.

## Issue Context
Per the compliance rule, changesets should explicitly declare `pnpm` with a valid bump type when pnpm user-visible behavior is affected.

## Fix Focus Areas
- .changeset/packlist-files-field-workspace-ignores.md[1-5]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Previous review results

Review updated until commit 009a1c8

Results up to commit 35cd95f ⚖️ Balanced


🐞 Bugs (0) 📘 Rule violations (1) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)


Action required
1. node_modules walk perf regression ✓ Resolved 🐞 Bug ➹ Performance
Description
In collect_own_files, when manifest.files is present the code no longer applies
workspace-inherited ignore files, so the walker can enumerate large directories (notably
**/node_modules/** ignored at the workspace root) even though node_modules entries are only
discarded after the walk. This can add substantial extra filesystem I/O on pacquet pack/publish
for workspace packages, increasing pack time and creating a practical DoS vector via huge
node_modules/.pnpm trees.
Code

pnpm/crates/fs-packlist/src/lib.rs[R327-342]

    if files_field.is_some() {
        builder.git_ignore(false);
-    } else if has_root_npmignore {
-        builder.git_ignore(false);
-        builder.add_custom_ignore_filename(".npmignore");
    } else {
-        builder.git_ignore(true);
+        if has_root_npmignore {
+            builder.git_ignore(false);
+        } else {
+            builder.git_ignore(true);
+        }
        builder.add_custom_ignore_filename(".npmignore");
+        // Workspace-inherited ignore files apply only in tiers (b)/(c):
+        // with a `files` allowlist an ancestor rule must not filter the
+        // walk, or an allowlisted directory the workspace root happens
+        // to `.gitignore` (a compiled `lib/`) never reaches pass 2 and
+        // silently vanishes from the tarball.
+        add_workspace_ignore_files(&mut builder, pkg_dir, workspace_dir)?;
    }
-    add_workspace_ignore_files(&mut builder, pkg_dir, workspace_dir)?;
Relevance

⭐⭐ Medium

Potential perf issue but conflicts with PR’s intended behavior change; no clear historical
accept/reject precedent.

PR-#12878

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The PR change stops adding workspace ignore files when files is present, and the code only drops
node_modules after builder.build() yields file entries, so it cannot prevent traversal. The
workspace root .gitignore explicitly ignores **/node_modules/**, meaning this pruning was
previously provided by workspace-inherited ignore files for workspace pack operations.

pnpm/crates/fs-packlist/src/lib.rs[317-368]
.gitignore[6-9]
pnpm/crates/pack/src/lib.rs[316-325]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
When `manifest.files` is set, workspace-root ignore files are no longer added to the `ignore::WalkBuilder`, so common workspace-root rules like `**/node_modules/**` stop pruning traversal. Because `node_modules` is filtered only *after* entries are yielded, the walker may still enumerate huge trees (especially `node_modules/.pnpm`), causing significant pack/publish slowdowns.

## Issue Context
This regression is introduced by moving `add_workspace_ignore_files(...)` into the `else` branch (only when `files` is absent). In this repo, the workspace root `.gitignore` ignores `**/node_modules/**`, which previously prevented walking installed dependency trees in workspace packages.

## Fix Focus Areas
- pnpm/crates/fs-packlist/src/lib.rs[317-368]

### Concrete fix approach
- Add a `builder.filter_entry(...)` (or equivalent pre-walk pruning) to skip descending into directories that are *always excluded from pack output*, at minimum `node_modules`.
- Consider also pruning `ALWAYS_EXCLUDED_DIR_SEGMENTS` (e.g. `.git`, `.hg`, etc.) at directory level to avoid wasted traversal.
- Keep the semantic change intact: do **not** re-enable workspace-root ignore patterns in the `files`-allowlist case; just avoid walking subtrees that can never be emitted.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended
2. Historical comment in regression test ✓ Resolved 📘 Rule violation ⚙ Maintainability
Description
The newly added regression-test comment describes past behavior (what the walker "applied" and what
tarballs "kept") rather than the current contract the test asserts, which is disallowed by the
checklist.
Code

pnpm/crates/fs-packlist/src/tests.rs[R460-463]

+// Regression test for <https://github.com/pnpm/pnpm/issues/13164>: the
+// workspace-root `.gitignore` ignores compiled `lib/` output, and the
+// walker applied it even when the manifest declared `files: ["lib"]`,
+// so published tarballs kept only the force-included `main` file.
Relevance

⭐⭐ Medium

Team sometimes rewords historical regression comments, but outcomes are mixed across similar
findings.

PR-#12829
PR-#12954

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
PR Compliance ID 772199 forbids comments that describe past behavior instead of the current
contract. The added comment explains what the walker used to do and what tarballs previously
contained, rather than documenting the current expected behavior asserted by the test.

Rule 772199: Comments must describe current behavior, not historical implementations
pnpm/crates/fs-packlist/src/tests.rs[460-463]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
A new comment uses historical phrasing to describe previous behavior rather than documenting the current behavior/contract.

## Issue Context
The repository compliance rule requires comments to describe current behavior, not historical implementations.

## Fix Focus Areas
- pnpm/crates/fs-packlist/src/tests.rs[460-463]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Informational
3. pnpm missing in changeset 📘 Rule violation § Compliance
Description
The new changeset describes a pnpm pack/pnpm publish user-visible change but its front-matter
only bumps pacquet, so the pnpm release may not get the required version bump/changelog entry
for this fix.
Code

.changeset/packlist-files-field-workspace-ignores.md[R1-5]

+---
+"pacquet": patch
+---
+
+`pnpm pack` and `pnpm publish` no longer let workspace-root `.gitignore` / `.npmignore` rules exclude files matched by the package manifest's `files` allowlist. Workspace packages whose build output is gitignored at the workspace root (for example a compiled `lib/` directory listed in `files`) were published with almost all payload files missing [#13164](https://github.com/pnpm/pnpm/issues/13164).
Relevance

⭐ Low

Multiple close precedents reject adding pnpm to pacquet-only changesets; team treats pnpm entry
as unnecessary.

PR-#13117
PR-#12981
PR-#12991

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
PR Compliance ID 713436 requires changesets to declare the pnpm package with a valid bump type.
The added changeset omits pnpm in front-matter while stating pnpm pack/pnpm publish behavior
changed, indicating the changeset metadata is incomplete for the described impact.

Rule 713436: Explicitly declare pnpm package and correct bump type in changesets
.changeset/packlist-files-field-workspace-ignores.md[1-5]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The new changeset text claims a `pnpm pack` / `pnpm publish` behavior change, but the changeset front-matter does not include a `pnpm` bump.

## Issue Context
Per the compliance rule, changesets should explicitly declare `pnpm` with a valid bump type when pnpm user-visible behavior is affected.

## Fix Focus Areas
- .changeset/packlist-files-field-workspace-ignores.md[1-5]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Results up to commit dda65d7 ⚖️ Balanced


🐞 Bugs (1) 📘 Rule violations (0) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)


Remediation recommended
1. Hardcoded root ignore subset 🐞 Bug ☼ Reliability
Description
The workflow writes a repo-root .npmignore containing only *.tsbuildinfo and *.log, which
makes pack/publish prefer it over the repo-root .gitignore for the rest of the job. This means
other existing root ignore rules (e.g. caches/fixtures) stop applying during packing/publishing of
workspace packages without a files allowlist, so published tarballs can unexpectedly start
including repository “junk” as .gitignore evolves or as such artifacts appear under package dirs.
Code

.github/workflows/release.yml[R209-219]

+      - name: Shadow the root .gitignore for packing (TEMPORARY)
+        # The pinned pacquet (12.0.0-alpha.13 and later, until the fix from
+        # https://github.com/pnpm/pnpm/pull/13231 ships) lets workspace-root
+        # ignore rules exclude files matched by a package's `files` allowlist,
+        # so every lib package published with it shipped nearly empty:
+        # https://github.com/pnpm/pnpm/issues/13164. The packlist prefers a
+        # root .npmignore over the root .gitignore, so shadow the .gitignore
+        # with only its junk rules (crucially not `lib`/`dist`, the compiled
+        # payload of every lib package). Remove this step once
+        # `packageManager` pins a pacquet release that carries the fix.
+        run: printf '*.tsbuildinfo\n*.log\n' > .npmignore
Relevance

⭐⭐ Medium

Release workflow is sensitive; they may refine this temporary workaround, but current intent is
deliberate and justified.

PR-#13045
PR-#13064

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The workflow now creates a repo-root .npmignore (twice) before running pn pack/pn publish, so
the packlist will prefer it over the existing root .gitignore. The root .gitignore currently
contains many ignore rules beyond logs/tsbuildinfo; dropping them at the workspace root can change
what gets included for packages that don’t have a files allowlist (some workspace packages indeed
omit files).

.github/workflows/release.yml[206-238]
.github/workflows/release.yml[373-416]
.gitignore[1-84]
pnpm11/utils/prepare/package.json[1-30]
pnpm11/utils/prepare-temp-dir/package.json[1-22]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
The release workflow creates a repo-root `.npmignore` with only two patterns. Because packlists prefer `.npmignore` over `.gitignore` at the workspace root, this can unintentionally widen what is eligible for packing/publishing for workspace packages that rely on ignore files (not a `files` allowlist).

### Issue Context
This step is meant to avoid the workspace-root `.gitignore` excluding payload directories like `lib/` and `dist/`, but the current hardcoded `.npmignore` also drops many other root ignore rules.

### Fix Focus Areas
- .github/workflows/release.yml[209-219]
- .github/workflows/release.yml[376-386]

### Recommended fix
- Generate the temporary root `.npmignore` by *filtering* the existing root `.gitignore` (preserve all current “junk” rules) while removing only the payload-blocking entries (`lib`, `dist`, and any other known payload dirs).
- Make the step safe for future changes by backing up/restoring an existing root `.npmignore` if one is later added to the repo (e.g., `mv .npmignore .npmignore.bak` + `trap` restore).
- Keep the step clearly temporary, but make its behavior match the repo’s actual ignore policy to avoid accidental publish-content drift.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Results up to commit 939d4d8 ⚖️ Balanced


🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)


Action required
1. Logger bump is ignored ✓ Resolved 🐞 Bug ≡ Correctness
Description
The republish changeset includes a patch bump for @pnpm/logger, but the release engine excludes
@pnpm/logger via versioning.ignore, so this intent will be skipped and @pnpm/logger will not
be republished by pnpm version -r.
This undermines the intent of the “republish all lib packages” changeset because one listed package
is silently non-participating under current versioning rules.
Code

.changeset/republish-all-lib-packages.md[121]

+"@pnpm/logger": patch
Relevance

⭐⭐⭐ High

Team often aligns changeset package list with actual release behavior; stray/ineffective bumps are
corrected.

PR-#13090
PR-#11481

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The changeset explicitly requests a release for @pnpm/logger, but the workspace configuration and
release-planner code show that ignored packages are excluded from release participants, so their
intents cannot be consumed/applied by the automated release flow.

.changeset/republish-all-lib-packages.md[118-122]
pnpm-workspace.yaml[60-71]
pnpm/crates/versioning/src/plan.rs[521-545]
AGENTS.md[193-197]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The changeset `.changeset/republish-all-lib-packages.md` declares a patch bump for `@pnpm/logger`, but the workspace release engine is configured to *exclude* `@pnpm/logger` from automated releases (`versioning.ignore`). As a result, the change intent won’t be applied during `pnpm version -r`, so `@pnpm/logger` won’t be republished despite being listed.

## Issue Context
- The repo’s native release flow consumes `.changeset/*` intents via `pnpm version -r`.
- `pnpm-workspace.yaml` explicitly freezes `@pnpm/logger` from automated release, and the versioning planner skips ignored projects entirely.

## Fix Focus Areas
- .changeset/republish-all-lib-packages.md[118-123]
- pnpm-workspace.yaml[60-71]
- pnpm/crates/versioning/src/plan.rs[521-545]

## What to change
Choose one:
1) If `@pnpm/logger` is intentionally excluded from the mass republish: remove the `"@pnpm/logger": patch` line and adjust the prose to not imply it will be republished.
2) If `@pnpm/logger` must be republished as part of this effort: handle it via the documented out-of-band path (or temporarily remove it from `versioning.ignore` and ensure the release engine can proceed with its dependency/versioning constraints).

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Qodo Logo

Comment thread pnpm/crates/fs-packlist/src/lib.rs Resolved

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between a4f25f2 and 35cd95f.

📒 Files selected for processing (3)
  • .changeset/packlist-files-field-workspace-ignores.md
  • pnpm/crates/fs-packlist/src/lib.rs
  • pnpm/crates/fs-packlist/src/tests.rs

Comment thread pnpm/crates/fs-packlist/src/lib.rs Resolved
Comment thread pnpm/crates/fs-packlist/src/tests.rs Resolved
@qodo-code-review

Copy link
Copy Markdown

PR Code Suggestions ✨

Warning

/improve is deprecated. Use /agentic_review instead (removal date not yet scheduled).

No code suggestions found for the PR.

@codecov-commenter

codecov-commenter commented Jul 23, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.11765% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 86.94%. Comparing base (aacdcee) to head (009a1c8).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
pnpm/crates/fs-packlist/src/lib.rs 94.11% 1 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

…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.
Copilot AI review requested due to automatic review settings July 23, 2026 11:36

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@qodo-code-review

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit dda65d7

@qodo-code-review

Copy link
Copy Markdown

PR Code Suggestions ✨

Warning

/improve is deprecated. Use /agentic_review instead (removal date not yet scheduled).

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.
Copilot AI review requested due to automatic review settings July 23, 2026 11:50

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Comment thread pnpm/crates/fs-packlist/src/lib.rs Resolved
@qodo-code-review

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 939d4d8

@qodo-code-review

Copy link
Copy Markdown

PR Code Suggestions ✨

Warning

/improve is deprecated. Use /agentic_review instead (removal date not yet scheduled).

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.
@github-actions github-actions Bot added the reviewed: coderabbit CodeRabbit submitted an approving review label Jul 23, 2026
@qodo-code-review

Copy link
Copy Markdown

PR Code Suggestions ✨

Warning

/improve is deprecated. Use /agentic_review instead (removal date not yet scheduled).

No code suggestions found for the PR.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 939d4d8 and 0a83425.

📒 Files selected for processing (3)
  • .changeset/republish-all-lib-packages.md
  • pnpm/crates/fs-packlist/src/lib.rs
  • pnpm/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

Comment thread pnpm/crates/fs-packlist/src/tests.rs Resolved
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.
@zkochan

zkochan commented Jul 23, 2026

Copy link
Copy Markdown
Member Author

Re the remaining Qodo findings on commit 0a83425:

  • Historical comment in regression test — fixed in 009a1c8: the comment now states the current contract instead of past behavior.
  • Extra filename string conversion — fixed in 009a1c8: filter_entry compares entry names as OsStr with no per-entry UTF-8 conversion.
  • Hardcoded root ignore subset — intentionally kept as-is. The shadow .npmignore only needs to cover junk that can exist under a package directory during the release job, and that job creates nothing there beyond tsgo outputs: lib/ (the payload we must ship) and *.tsbuildinfo (covered). *.log is covered, and the packlist itself hardcodes the rest of npm's cruft set (node_modules, VCS dirs, lockfiles, .DS_Store, debug logs). Caches like .turbo/.jest-cache/coverage require test or lint runs that the release job never performs. Only three published packages lack a files allowlist, and the step is temporary — it is deleted once packageManager pins a pacquet release carrying the fs-packlist fix, restoring the real .gitignore semantics.

Written by an agent (Claude Code, claude-fable-5).

Copilot AI review requested due to automatic review settings July 23, 2026 12:33

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@qodo-code-review

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 009a1c8

@qodo-code-review

Copy link
Copy Markdown

PR Code Suggestions ✨

Warning

/improve is deprecated. Use /agentic_review instead (removal date not yet scheduled).

No code suggestions found for the PR.

@zkochan
zkochan merged commit 77cd515 into main Jul 23, 2026
32 checks passed
@zkochan
zkochan deleted the fix-13164 branch July 23, 2026 12:50
zkochan added a commit to xianjianlf2/pnpm that referenced this pull request Jul 23, 2026
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.
zkochan added a commit that referenced this pull request Jul 23, 2026
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

product: pacquet reviewed: coderabbit CodeRabbit submitted an approving review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

@pnpm/hooks.pnpmfile missing types since v1100.0.20

3 participants