Repository navigation
fix: normalize empty bundledDependencies array in lockfile - #13154
Ayush442842q wants to merge 2 commits into
Conversation
Normalize empty bundledDependencies and bundleDependencies arrays to prevent them from being serialized in the lockfile. This prevents non-deterministic lockfile churn when different metadata sources are used. Related to pnpm#13123
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
|
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 (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe lockfile dependency serializer now omits empty ChangesBundled dependency lockfile normalization
Estimated code review effort: 2 (Simple) | ~10 minutes Assessment against linked issues
Possibly related PRs
Suggested labels: Suggested reviewers: ✨ Finishing Touches🧪 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 |
Confidence Score: 5/5Safe to merge — the change is a targeted two-line guard that only removes empty arrays from lockfile serialization, with no risk of dropping real bundled-dependency information. The fix is minimal and correct: an empty No files require special attention beyond the optional test gap noted in Reviews (2): Last reviewed commit: "test: add unit test for boolean true bun..." | Re-trigger Greptile |
|
Closing as a duplicate of #13148, which fixes the same issue (#13123) with the identical guard in Written by an agent (Claude Code, claude-fable-5) on behalf of zkochan. |
Summary
Resolves non-deterministic addition/removal of
bundledDependencies: []inpnpm-lock.yaml(the empty-array variant of #7576).Some packages (e.g.
[email protected]) publish a tarballpackage.jsoncontaining
"bundledDependencies": [], while the registry version metadatafor the same version omits the field entirely. Depending on which manifest
source pnpm resolves from (store-derived vs. registry metadata), the
lockfile serializer would write the empty array in one case and omit it in
the other — causing lockfile churn with no actual dependency changes.
This PR normalizes empty
bundledDependencies/bundleDependenciesarraysso they are never serialized, since an empty array carries no information
(equivalent to the field being absent).
Fixes #13123
Squash Commit Body
Checklist
pnpm/port, or the description notes what still needs porting.(Rust port already immune — see commit body.)
pnpm changeset) if this PR changes any publishedpackage. Keep it short and written for pnpm users — it becomes a release note.
Need help on this PR? Tag
/codesmithwith what you need. Autofix is disabled.Summary by CodeRabbit
bundledDependencies/bundleDependenciesfrom being written to lockfiles, reducing non-deterministic lockfile diffs.true) are present during lockfile updates.truebundled dependency settings.