Repository navigation
feat(pacquet-cli): add dedupe command - #12586
Conversation
|
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:
📝 WalkthroughWalkthroughAdds a Changesdedupe CLI subcommand
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Suggested reviewers
Possibly related PRs
Sequence Diagram(s)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 |
PR Summary by Qodofeat(pacquet-cli): add dedupe and metadata cache subcommands Description
Diagram
High-Level Assessment
Files changed (7)
|
Code Review by Qodo
Context used✅ Tickets:
🎫 Rust Roadmap 1. Rollback errors silently ignored
|
9a9565b to
4531b4b
Compare
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 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 `@pacquet/crates/cli/src/cli_args.rs`:
- Around line 490-496: The new CliCommand::Dedupe reporter dispatch logic (which
routes through DefaultReporter, NdjsonReporter, and SilentReporter) lacks
end-to-end test coverage for the dedupe command execution path. Add dedicated
regression tests that exercise the pacquet dedupe and pacquet dedupe --check
commands with different reporter types to ensure parity in dispatch behavior,
output formatting, and lockfile write operations remain consistent across
changes.
In `@pacquet/crates/cli/src/cli_args/cache.rs`:
- Around line 54-58: Remove the `.." rejection check to align with pnpm's
behavior and support valid npm package names. Delete the entire if statement
block that checks `pkg.contains("..")` and returns the miette error (the
reject_path_traversal validation), as the security boundary is already enforced
by the glob pattern and strip_prefix validation that follows. This will allow
package names like "foo..bar" to be processed normally, matching pnpm's approach
of passing filter arguments directly without pre-validation.
- Around line 196-209: The cachedAt field in the meta_files_by_path insertion is
using milliseconds since UNIX_EPOCH as a string format, but pnpm expects
JavaScript Date.toString() format (like "Mon Jan 01 2024 12:00:00 GMT+0000").
Update the mtime mapping to convert the SystemTime to the appropriate JavaScript
date string format instead of milliseconds. Additionally, the registry_name
replacement should use replaceAll instead of replace to handle registry names
with multiple plus characters correctly, ensuring all occurrences of '+' are
replaced with ':' not just the first one. Finally, add test cases for the cache
view command to verify the output JSON schema matches pnpm's expected format.
In `@pacquet/crates/cli/src/cli_args/dedupe.rs`:
- Around line 48-49: In the dedupe command configuration, fix the incorrect flag
assignments for lockfile_only and dry_run. The issue is that both fields are
currently tied to the self.check flag, but they should behave independently.
Change lockfile_only to always be true (since dedupe must always operate on the
lockfile only without installing packages) and change dry_run to self.check (so
changes are only written when not in check mode). This ensures dedupe always
performs lockfile-focused operations while the check flag controls whether
modifications are actually persisted.
🪄 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: 83c560c6-b6d1-42dd-b068-0ce003bd7642
⛔ Files ignored due to path filters (1)
Cargo.lockis excluded by!**/*.lock,!Cargo.lock
📒 Files selected for processing (7)
pacquet/crates/cli/Cargo.tomlpacquet/crates/cli/src/cli_args.rspacquet/crates/cli/src/cli_args/cache.rspacquet/crates/cli/src/cli_args/dedupe.rspacquet/crates/cli/tests/cache.rspacquet/crates/resolving-npm-resolver/src/lib.rspacquet/crates/resolving-npm-resolver/src/mirror.rs
There was a problem hiding this comment.
Caution
Inline review comments failed to post. This is likely due to GitHub's internal server error or limits when posting large numbers of comments. If you are seeing this consistently it is likely a permissions issue. Please check "Moderation" -> "Code review limits" under your organization settings.
Actionable comments posted: 4
🤖 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 `@pacquet/crates/cli/src/cli_args.rs`:
- Around line 490-496: The new CliCommand::Dedupe reporter dispatch logic (which
routes through DefaultReporter, NdjsonReporter, and SilentReporter) lacks
end-to-end test coverage for the dedupe command execution path. Add dedicated
regression tests that exercise the pacquet dedupe and pacquet dedupe --check
commands with different reporter types to ensure parity in dispatch behavior,
output formatting, and lockfile write operations remain consistent across
changes.
In `@pacquet/crates/cli/src/cli_args/cache.rs`:
- Around line 54-58: Remove the `.." rejection check to align with pnpm's
behavior and support valid npm package names. Delete the entire if statement
block that checks `pkg.contains("..")` and returns the miette error (the
reject_path_traversal validation), as the security boundary is already enforced
by the glob pattern and strip_prefix validation that follows. This will allow
package names like "foo..bar" to be processed normally, matching pnpm's approach
of passing filter arguments directly without pre-validation.
- Around line 196-209: The cachedAt field in the meta_files_by_path insertion is
using milliseconds since UNIX_EPOCH as a string format, but pnpm expects
JavaScript Date.toString() format (like "Mon Jan 01 2024 12:00:00 GMT+0000").
Update the mtime mapping to convert the SystemTime to the appropriate JavaScript
date string format instead of milliseconds. Additionally, the registry_name
replacement should use replaceAll instead of replace to handle registry names
with multiple plus characters correctly, ensuring all occurrences of '+' are
replaced with ':' not just the first one. Finally, add test cases for the cache
view command to verify the output JSON schema matches pnpm's expected format.
In `@pacquet/crates/cli/src/cli_args/dedupe.rs`:
- Around line 48-49: In the dedupe command configuration, fix the incorrect flag
assignments for lockfile_only and dry_run. The issue is that both fields are
currently tied to the self.check flag, but they should behave independently.
Change lockfile_only to always be true (since dedupe must always operate on the
lockfile only without installing packages) and change dry_run to self.check (so
changes are only written when not in check mode). This ensures dedupe always
performs lockfile-focused operations while the check flag controls whether
modifications are actually persisted.
🪄 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: 83c560c6-b6d1-42dd-b068-0ce003bd7642
⛔ Files ignored due to path filters (1)
Cargo.lockis excluded by!**/*.lock,!Cargo.lock
📒 Files selected for processing (7)
pacquet/crates/cli/Cargo.tomlpacquet/crates/cli/src/cli_args.rspacquet/crates/cli/src/cli_args/cache.rspacquet/crates/cli/src/cli_args/dedupe.rspacquet/crates/cli/tests/cache.rspacquet/crates/resolving-npm-resolver/src/lib.rspacquet/crates/resolving-npm-resolver/src/mirror.rs
🛑 Comments failed to post (4)
pacquet/crates/cli/src/cli_args.rs (1)
490-496:
⚠️ Potential issue | 🟠 Major | ⚡ Quick winAdd a dedicated dedupe command regression test.
Line 490 introduces a new reporter-dispatched
dedupeexecution path, but this PR context provides no test that exercisespacquet dedupe/pacquet dedupe --checkbehavior end-to-end. That leaves parity regressions (dispatch/output/lockfile write behavior) unguarded.Based on learnings, REVIEW_GUIDE.md requires meaningful regression coverage for dedupe/check behavior at the command level, and pacquet/AGENTS.md requires parity-focused command testing.
🤖 Prompt for 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. In `@pacquet/crates/cli/src/cli_args.rs` around lines 490 - 496, The new CliCommand::Dedupe reporter dispatch logic (which routes through DefaultReporter, NdjsonReporter, and SilentReporter) lacks end-to-end test coverage for the dedupe command execution path. Add dedicated regression tests that exercise the pacquet dedupe and pacquet dedupe --check commands with different reporter types to ensure parity in dispatch behavior, output formatting, and lockfile write operations remain consistent across changes.Source: Coding guidelines
pacquet/crates/cli/src/cli_args/cache.rs (2)
54-58:
⚠️ Potential issue | 🔴 Critical🧩 Analysis chain
🏁 Script executed:
#!/bin/bash # Check pnpm's cache command for path traversal validation rg -n -C5 '\.\.' pnpm11/cache/src --type=ts # Find cache delete/list implementations ast-grep --pattern $'function deleteCache($$$) { $$$ }' # Check how pnpm encodes package names in cache paths rg -n 'encode.*package|package.*encode' pnpm11/cache/src --type=tsRepository: pnpm/pnpm
Length of output: 167
🏁 Script executed:
#!/bin/bash # Find cache-related files in the repository find . -type f -name "*cache*" | head -20 ls -la pnpm/ | head -20Repository: pnpm/pnpm
Length of output: 907
🏁 Script executed:
#!/bin/bash # Search for cache implementation in the correct locations git ls-files | grep -i cache | grep -E '(\.ts|\.js)$' | head -30Repository: pnpm/pnpm
Length of output: 1216
🏁 Script executed:
#!/bin/bash # Look for where cache/delete operations are implemented rg -l 'export.*cache|cache.*command|deleteCache' --type=ts --type=js | head -20Repository: pnpm/pnpm
Length of output: 757
🌐 Web query:
npm package naming rules - are package names allowed to contain ".." (double dot)?💡 Result:
Yes, npm package names are allowed to contain a double dot (".."). According to npm naming conventions, package names must be URL-safe [1][2], must not contain spaces [2], and must not contain certain non-URL-safe characters such as ~)('!* [2]. While the official documentation and the validate-npm-package-name library prohibit names that start with a dot (for unscoped packages) [2][3], they do not explicitly forbid the use of ".." (double dot) within the name string itself. The primary constraints on package names are as follows: - They must be 214 characters or fewer [1][4]. - They must not contain uppercase letters [1][2]. - They cannot contain spaces [2]. - They cannot contain specific non-URL-safe characters: ~)('!* [2]. - They should not start with a dot or underscore (unless scoped) [2][3]. As long as the name complies with these general rules, including URL-safety and the absence of forbidden characters, ".." is permitted within the package name.
Citations:
- 1: https://docs.npmjs.com/cli/v10/configuring-npm/package-json/?v=true
- 2: https://github.com/npm/validate-npm-package-name?tab=readme-ov-file
- 3: https://github.com/npm/cli/blob/latest/docs/lib/content/configuring-npm/package-json.md
- 4: https://docs.npmjs.com/cli/v11/configuring-npm/package-json/
🏁 Script executed:
#!/bin/bash # Read pnpm's cache delete implementation to check for path traversal validation cat pnpm11/cache/api/src/cacheDelete.tsRepository: pnpm/pnpm
Length of output: 472
🏁 Script executed:
#!/bin/bash # Read pnpm's cache view implementation to check output format cat pnpm11/cache/api/src/cacheView.tsRepository: pnpm/pnpm
Length of output: 2493
🏁 Script executed:
#!/bin/bash # Read the pacquet cache.rs file to compare head -100 pacquet/crates/cli/src/cli_args/cache.rsRepository: pnpm/pnpm
Length of output: 3722
🏁 Script executed:
#!/bin/bash # Check if pacquet cache tests verify the ".." behavior cat pacquet/crates/cli/tests/cache.rsRepository: pnpm/pnpm
Length of output: 4358
Remove the
..rejection as it diverges from pnpm and breaks valid npm package names.The code at lines 54–58 rejects any package name containing
.., but:
- pnpm has no equivalent check — it passes filter arguments directly to
globwithout pre-validation (seepnpm11/cache/api/src/cacheDelete.ts).- ".." is valid in npm package names per npm naming rules; the rejection would break legitimate packages like
"foo..bar"if they exist.- Per the cardinal rule, pacquet must match pnpm's behavior exactly; this check diverges unnecessarily.
- The actual security boundary is elsewhere — the glob pattern
{registry_prefix}/{pkg}.jsonlcombined withglob.walk(cache_dir)andstrip_prefix(cache_dir)already confines file access to the cache directory; even with..in a name, the relative path cannot escape.Remove the
reject_path_traversalcheck and its call site (lines 47–58, 56–57), matching pnpm's approach. The glob walking and strip_prefix validation are sufficient.🤖 Prompt for 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. In `@pacquet/crates/cli/src/cli_args/cache.rs` around lines 54 - 58, Remove the `.." rejection check to align with pnpm's behavior and support valid npm package names. Delete the entire if statement block that checks `pkg.contains("..")` and returns the miette error (the reject_path_traversal validation), as the security boundary is already enforced by the glob pattern and strip_prefix validation that follows. This will allow package names like "foo..bar" to be processed normally, matching pnpm's approach of passing filter arguments directly without pre-validation.Source: Coding guidelines
196-209:
⚠️ Potential issue | 🔴 Critical🧩 Analysis chain
🏁 Script executed:
#!/bin/bash # Find pnpm's cache view implementation and output format rg -n -C10 'cachedVersions|nonCachedVersions|cachedAt' pnpm11/cache/src --type=ts # Check registry name encoding in pnpm cache output rg -n 'registry.*replace|host.*port' pnpm11/cache/src --type=ts # Find the cache view handler ast-grep --pattern $'function.*view.*cache($$$) { $$$ }'Repository: pnpm/pnpm
Length of output: 167
🏁 Script executed:
#!/bin/bash # List top-level directories to understand repo structure git ls-files | head -30 | cut -d/ -f1 | sort -u # Search for cache-related files in the repo fd -t f "cache" | grep -E "\.(ts|js|rs)$" | head -20 # Look for "cachedVersions" string in the repo rg -l "cachedVersions" --type=ts --type=js | head -10Repository: pnpm/pnpm
Length of output: 1244
🏁 Script executed:
#!/bin/bash # Read pnpm's cacheView implementation cat pnpm11/cache/api/src/cacheView.ts # Also check the test file for expected output cat pnpm11/cache/commands/test/cacheView.cmd.test.tsRepository: pnpm/pnpm
Length of output: 5646
🏁 Script executed:
#!/bin/bash # Check pacquet's cache test to see expected output cat pacquet/crates/cli/tests/cache.rs # Look at more context in pacquet's cache.rs cat pacquet/crates/cli/src/cli_args/cache.rsRepository: pnpm/pnpm
Length of output: 14906
🏁 Script executed:
#!/bin/bash # Look at pnpm test expectations for cachedAt format rg -A20 "cachedAt" pnpm11/cache/commands/test/cacheView.cmd.test.ts # Check if pacquet has tests that verify cachedAt format rg -n "cachedAt\|toMatchObject" pacquet/crates/cli/tests/cache.rs -A5 -B5 # Look for any snapshot tests or other view tests in pacquet fd cache pacquet/crates/cli/tests --type f -exec grep -l "view\|View" {} \;Repository: pnpm/pnpm
Length of output: 258
🏁 Script executed:
#!/bin/bash # Look at pnpm test expectations for cachedAt format rg -A20 "cachedAt" pnpm11/cache/commands/test/cacheView.cmd.test.ts # Check if pacquet has tests that verify cachedAt format rg -n "cachedAt" pacquet/crates/cli/tests/cache.rs # Look for any snapshot tests or other view tests in pacquet find pacquet/crates/cli/tests -type f -name "*.rs" | xargs grep -l "view\|View"Repository: pnpm/pnpm
Length of output: 88
🏁 Script executed:
#!/bin/bash # Check pnpm test for cachedAt expectations grep -A5 -B5 "cachedAt\|toMatchObject" pnpm11/cache/commands/test/cacheView.cmd.test.ts # Search for cache view tests in pacquet find pacquet -name "*cache*" -type f | grep test # Check if there's a side effects cache test cat pacquet/crates/cli/tests/side_effects_cache.rsRepository: pnpm/pnpm
Length of output: 4608
The
cachedAtfield format does not match pnpm's output schema.pnpm's cache view outputs
cachedAtas a JavaScriptDate.toString()value (e.g.,"Mon Jan 01 2024 12:00:00 GMT+0000"), but pacquet uses RFC3339 format (e.g.,"2024-01-01T12:00:00.000Z"). These formats are incompatible and will break consumers expecting pnpm-compatible JSON output.Additionally:
- Registry names use
.replace('+', ':')which only replaces the first occurrence; pnpm uses.replaceAll('+', ':')to handle registry names with multiple+characters.- No test exists for the
cache viewcommand to verify the output schema matches pnpm.🤖 Prompt for 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. In `@pacquet/crates/cli/src/cli_args/cache.rs` around lines 196 - 209, The cachedAt field in the meta_files_by_path insertion is using milliseconds since UNIX_EPOCH as a string format, but pnpm expects JavaScript Date.toString() format (like "Mon Jan 01 2024 12:00:00 GMT+0000"). Update the mtime mapping to convert the SystemTime to the appropriate JavaScript date string format instead of milliseconds. Additionally, the registry_name replacement should use replaceAll instead of replace to handle registry names with multiple plus characters correctly, ensuring all occurrences of '+' are replaced with ':' not just the first one. Finally, add test cases for the cache view command to verify the output JSON schema matches pnpm's expected format.Source: Coding guidelines
pacquet/crates/cli/src/cli_args/dedupe.rs (1)
48-49:
⚠️ Potential issue | 🟠 Major🧩 Analysis chain
🏁 Script executed:
#!/bin/bash # Verify pnpm's dedupe command behavior for lockfile_only flag # Search for the dedupe command implementation in pnpm rg -n -C5 'lockfileOnly.*dedupe|dedupe.*lockfileOnly' --type=ts # Find the dedupe command entry point ast-grep --pattern $'export function dedupe($$$) { $$$ }' # Search for Install configuration in dedupe command rg -n -C10 'function dedupe|export.*dedupe' pnpm11/installing/commands/src/dedupe.tsRepository: pnpm/pnpm
Length of output: 636
🏁 Script executed:
#!/bin/bash # Read the pacquet dedupe.rs file to see the full context cat -n pacquet/crates/cli/src/cli_args/dedupe.rsRepository: pnpm/pnpm
Length of output: 2460
🏁 Script executed:
#!/bin/bash # Search for dedupe command handler in pnpm to understand lockfile_only behavior rg -n -A20 "export async function handler.*dedupe|export const handler.*=.*async" --type=ts | grep -A20 "dedupe"Repository: pnpm/pnpm
Length of output: 35
🏁 Script executed:
#!/bin/bash # Look for how Install configuration is used in pnpm dedupe and related commands rg -n "lockfileOnly" --type=ts -B3 -A3 | head -100Repository: pnpm/pnpm
Length of output: 8422
🏁 Script executed:
#!/bin/bash # Search for pnpm dedupe command handler find . -name "*.ts" -type f | xargs grep -l "export.*handler.*dedupe\|export.*dedupe" | grep -E "(command|handler)" | head -5Repository: pnpm/pnpm
Length of output: 138
🏁 Script executed:
#!/bin/bash # Search for dedupe.ts files in pnpm fd dedupe -e ts --type fRepository: pnpm/pnpm
Length of output: 715
🏁 Script executed:
#!/bin/bash # Look at the dedupe command implementation in pnpm/installing/commands cat -n pnpm11/installing/commands/src/dedupe.ts 2>/dev/null || echo "File not found, searching nearby..."Repository: pnpm/pnpm
Length of output: 3062
🏁 Script executed:
#!/bin/bash # Find dedupe command in pnpm rg -l "dedupe" --type=ts | grep -i command | head -10Repository: pnpm/pnpm
Length of output: 537
🏁 Script executed:
#!/bin/bash # Search for how lockfile_only is used in pacquet Install rg -n "lockfile_only" pacquet --type=rs -B2 -A2 | head -80Repository: pnpm/pnpm
Length of output: 80
🏁 Script executed:
#!/bin/bash # Search for Install struct definition to understand what lockfile_only does rg -n "struct Install" pacquet --type=rs -A30 | head -100Repository: pnpm/pnpm
Length of output: 80
🏁 Script executed:
#!/bin/bash # Check if pacquet has a lockfileCheck equivalent or how --check is supposed to work rg -n "check|Check" pacquet/crates/cli/src/cli_args/dedupe.rs --type=rsRepository: pnpm/pnpm
Length of output: 80
🏁 Script executed:
#!/bin/bash # Search for lockfile_only usage in the pacquet codebase rg -n "lockfile_only" --type=rust -B2 -A2 | head -80Repository: pnpm/pnpm
Length of output: 5543
🏁 Script executed:
#!/bin/bash # Find and read the Install struct definition in pacquet fd "lib.rs\|install.rs" pacquet | head -5 | xargs grep -l "struct Install" 2>/dev/nullRepository: pnpm/pnpm
Length of output: 37
🏁 Script executed:
#!/bin/bash # Search for Install struct definition more broadly rg "struct Install" -B2 -A30 | head -150Repository: pnpm/pnpm
Length of output: 16302
🏁 Script executed:
#!/bin/bash # Check what dry_run and lockfile_only do by searching their usage in pacquet rg "dry_run|lockfile_only" pacquet/crates/package-manager/src --type=rust -B1 -A3 | head -100Repository: pnpm/pnpm
Length of output: 8756
Fix
lockfile_onlyanddry_runfor dedupe command.The current implementation incorrectly ties both
lockfile_onlyanddry_runto the--checkflag. Dedupe should always operate on the lockfile only (without installing packages); the--checkflag should only control whether changes are written.pnpm's dedupe handler always passes
dryRun: falseand uses a separatelockfileCheckcallback for the check behavior. Pacquet's equivalent should be:
lockfile_only: true(always—dedupe is lockfile-focused)dry_run: self.check(true only when checking)Current code would make normal
dedupe(without--check) skip lockfile materialization while attempting a full install, contradicting both dedupe semantics and pnpm's behavior.🤖 Prompt for 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. In `@pacquet/crates/cli/src/cli_args/dedupe.rs` around lines 48 - 49, In the dedupe command configuration, fix the incorrect flag assignments for lockfile_only and dry_run. The issue is that both fields are currently tied to the self.check flag, but they should behave independently. Change lockfile_only to always be true (since dedupe must always operate on the lockfile only without installing packages) and change dry_run to self.check (so changes are only written when not in check mode). This ensures dedupe always performs lockfile-focused operations while the check flag controls whether modifications are actually persisted.Source: Coding guidelines
| CliCommand::CatFile(args) => { | ||
| args.run(|| config().map(|m| &*m))?; | ||
| } | ||
| CliCommand::CatIndex(args) => { | ||
| CliCommand::Dedupe(args) => match reporter { | ||
| ReporterType::Default | ReporterType::AppendOnly => { | ||
| Box::pin(args.run::<DefaultReporter>(state(false)?)).await?; | ||
| } | ||
| ReporterType::Ndjson => Box::pin(args.run::<NdjsonReporter>(state(false)?)).await?, | ||
| ReporterType::Silent => Box::pin(args.run::<SilentReporter>(state(false)?)).await?, | ||
| }, | ||
| CliCommand::CatIndex(args) => { |
There was a problem hiding this comment.
1. Match arm missing comma 🐞 Bug ≡ Correctness
CliArgs::run inserts the new CliCommand::Dedupe arm immediately after CliCommand::CatFile
without a comma after the CatFile arm, so the match command { ... } does not parse and the CLI
will not compile.
Agent Prompt
### Issue description
`match command { ... }` in `CliArgs::run` is missing a comma between the `CliCommand::CatFile` arm and the newly-added `CliCommand::Dedupe` arm, which is a Rust syntax error.
### Issue Context
The new `Dedupe` dispatch was inserted into the large command `match`, but the preceding arm (`CatFile`) ends with `}` and no trailing comma.
### Fix Focus Areas
- pacquet/crates/cli/src/cli_args.rs[507-519]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
|
Code review by qodo was updated up to the latest commit 4531b4b |
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 `@pacquet/crates/cli/src/cli_args.rs`:
- Line 510: The CliCommand::Dedupe match arm on line 510 has excessive
indentation and does not align with the peer match arms (Store, Cache, CatFile)
above it. Remove the extra leading whitespace from the CliCommand::Dedupe(args)
=> match reporter { line to make it align horizontally with the other match arms
at the same nesting level in the match expression.
- Line 241: The #[allow(clippy::large_stack_frames)] attribute on the run
function is overly broad and silences the lint for the entire method, but the
justification (documented in lines 422-424) only applies to the Install arm.
Move the allow attribute from the function level to either the match expression
on line 320 or directly to the specific match arm (Install) that requires the
exception, so the lint suppression is scoped only to where it is genuinely
needed rather than affecting all dispatch arms in the run method.
🪄 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: a0dc6275-286c-436b-b510-04e41ba8016e
📒 Files selected for processing (2)
pacquet/crates/cli/src/cli_args.rspacquet/crates/cli/src/cli_args/dedupe.rs
🚧 Files skipped from review as they are similar to previous changes (1)
- pacquet/crates/cli/src/cli_args/dedupe.rs
| frozen_lockfile: false, | ||
| prefer_frozen_lockfile: None, | ||
| ignore_manifest_check: false, | ||
| skip_runtimes: false, | ||
| trust_lockfile: false, | ||
| update_checksums: false, | ||
| is_full_install: true, | ||
| resolved_packages, | ||
| supported_architectures: config.supported_architectures.clone(), | ||
| node_linker: config.node_linker, | ||
| lockfile_only: self.check, | ||
| dry_run: self.check, | ||
| update_seed_policy: pacquet_package_manager::UpdateSeedPolicy::KeepAll, |
There was a problem hiding this comment.
1. Dedupe skips full resolve 🐞 Bug ≡ Correctness
DedupeArgs::run wires Install in a way that allows both the optimistic repeat-install early return and the preferFrozenLockfile frozen path, so pacquet dedupe can succeed without performing any re-resolution and therefore not deduplicate the lockfile. This is likely to happen by default because both fast paths are enabled in config defaults.
Agent Prompt
## Issue description
`pacquet dedupe` should always perform a fresh resolution pass, but the current `Install { ... }` options allow `Install::run` to short-circuit as “Already up to date” (optimistic repeat-install) or take the frozen path (preferFrozenLockfile), both of which skip re-resolution.
## Issue Context
- `Install::run` can return early on the optimistic repeat-install path when `is_full_install && UpdateSeedPolicy::KeepAll && !frozen_lockfile`.
- `Install::run` also derives `prefer_frozen_lockfile` from config when the per-invocation value is `None`, and config defaults enable these fast paths.
## Fix Focus Areas
- pacquet/crates/cli/src/cli_args/dedupe.rs[15-54]
### Suggested implementation direction
- Ensure dedupe cannot take either fast path. Minimal options:
- Pass `prefer_frozen_lockfile: Some(false)` so `Install::run` won’t choose the frozen dispatch.
- Also disable the optimistic repeat-install short-circuit for this invocation. If you don’t want to change lifecycle-script semantics by flipping `is_full_install`, add a dedicated `Install` option (e.g. `disable_optimistic_repeat_install: bool`) and gate the optimistic fast path on it.
- Keep `dry_run` behavior for `--check` as-is, but ensure non-check dedupe still forces fresh resolve.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
|
Code review by qodo was updated up to the latest commit 4531b4b |
1 similar comment
|
Code review by qodo was updated up to the latest commit bba2b69 |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #12586 +/- ##
==========================================
- Coverage 88.60% 88.57% -0.03%
==========================================
Files 336 337 +1
Lines 48910 49047 +137
==========================================
+ Hits 43338 43445 +107
- Misses 5572 5602 +30 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Integrated-Benchmark Report (Linux)Commit: Each scenario reports direct installs and pnpr installs. Bencher consumes pacquet@HEAD and pnpr@HEAD. Scenario: Isolated linker: fresh restore, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 4.45532232754,
"stddev": 0.19060096125546008,
"median": 4.3900417886400005,
"user": 3.72359084,
"system": 3.40757482,
"min": 4.3246612011400005,
"max": 4.890722307140001,
"times": [
4.890722307140001,
4.33880159414,
4.398775473140001,
4.719708633140001,
4.370711536140001,
4.3875697351400005,
4.393023702140001,
4.33673525114,
4.3246612011400005,
4.3925138421400005
]
},
{
"command": "pacquet@main",
"mean": 4.39899188424,
"stddev": 0.1407005206686483,
"median": 4.33752357164,
"user": 3.7160376399999997,
"system": 3.38063102,
"min": 4.295201238140001,
"max": 4.76515965114,
"times": [
4.318688324140001,
4.32686108814,
4.47288937214,
4.76515965114,
4.331752933140001,
4.295201238140001,
4.37025616814,
4.343294210140001,
4.32274311914,
4.443072738140001
]
},
{
"command": "pnpr@HEAD",
"mean": 2.87293286584,
"stddev": 0.0826357370647307,
"median": 2.87092643564,
"user": 2.74705564,
"system": 3.00593582,
"min": 2.77875800514,
"max": 3.05480138914,
"times": [
2.81075352714,
2.77875800514,
3.05480138914,
2.86596063514,
2.89616274814,
2.8790063801400003,
2.9530434901400002,
2.87589223614,
2.81105437014,
2.80389587714
]
},
{
"command": "pnpr@main",
"mean": 2.92720174414,
"stddev": 0.13721954287832094,
"median": 2.8595268371399998,
"user": 2.73502234,
"system": 3.02192832,
"min": 2.80966271214,
"max": 3.21688517514,
"times": [
2.80966271214,
3.21688517514,
2.84724877414,
2.85735632914,
2.84767694214,
2.86169734514,
2.99928134814,
2.84517937114,
3.11419419714,
2.87283524714
]
}
]
}Scenario: Isolated linker: fresh restore, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.6233786675000001,
"stddev": 0.010366323254251394,
"median": 0.6205539463,
"user": 0.37420697999999997,
"system": 1.3035937799999997,
"min": 0.6128543043000001,
"max": 0.6422059153,
"times": [
0.6148272073000001,
0.6383111623000001,
0.6128543043000001,
0.6202897773000001,
0.6208181153000001,
0.6227348523,
0.6422059153,
0.6173074163000001,
0.6135659433,
0.6308719813000001
]
},
{
"command": "pacquet@main",
"mean": 0.6569339177000001,
"stddev": 0.01738605748611635,
"median": 0.6540962673000001,
"user": 0.38972658,
"system": 1.3255395799999998,
"min": 0.6302715503,
"max": 0.6851986623,
"times": [
0.6752223663000001,
0.6302715503,
0.6768200633000001,
0.6528323633,
0.6589526623,
0.6419227243000001,
0.6442274603000001,
0.6485311533000001,
0.6553601713000001,
0.6851986623
]
},
{
"command": "pnpr@HEAD",
"mean": 0.6712346410000001,
"stddev": 0.014742597693276899,
"median": 0.6723852948000001,
"user": 0.37458537999999997,
"system": 1.3359689799999999,
"min": 0.6523770123000001,
"max": 0.6972046383000001,
"times": [
0.6873912233000001,
0.6569061593000001,
0.6812605223000001,
0.6566933913,
0.6523770123000001,
0.6600790393000001,
0.6972046383000001,
0.6731018043000001,
0.6716687853000001,
0.6756638343000001
]
},
{
"command": "pnpr@main",
"mean": 0.6820335215000001,
"stddev": 0.018610579789093855,
"median": 0.6719910308000001,
"user": 0.39534018000000004,
"system": 1.3456004799999999,
"min": 0.6631382983,
"max": 0.7106528833000001,
"times": [
0.6669121203,
0.6987672833,
0.7106528833000001,
0.7004333593000001,
0.6721591993000001,
0.7026350293000001,
0.6691494553,
0.6646647243000001,
0.6718228623000001,
0.6631382983
]
}
]
}Scenario: Isolated linker: fresh install, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 4.657370294420001,
"stddev": 0.036697287026121524,
"median": 4.65799212272,
"user": 3.7952919800000005,
"system": 3.3673605800000006,
"min": 4.596738382720001,
"max": 4.734074753720001,
"times": [
4.63961251172,
4.6882632947200005,
4.734074753720001,
4.65931938672,
4.6652380217200005,
4.65666485872,
4.6496067747200005,
4.62341889472,
4.660766064720001,
4.596738382720001
]
},
{
"command": "pacquet@main",
"mean": 4.6837295896199995,
"stddev": 0.02858832466429318,
"median": 4.683790048220001,
"user": 3.80942558,
"system": 3.38643088,
"min": 4.64355585072,
"max": 4.72881832172,
"times": [
4.700542713720001,
4.68023968572,
4.72881832172,
4.64355585072,
4.68360858972,
4.6578838537200005,
4.72376887572,
4.683971506720001,
4.649949121720001,
4.684957376720001
]
},
{
"command": "pnpr@HEAD",
"mean": 3.22148373102,
"stddev": 0.13243273248500975,
"median": 3.18015583172,
"user": 2.8523930799999997,
"system": 3.1921283799999998,
"min": 3.08189910072,
"max": 3.40648006772,
"times": [
3.3812710247199997,
3.11368338672,
3.11040912572,
3.13875039772,
3.38840613872,
3.09278481072,
3.22156126572,
3.40648006772,
3.27959199172,
3.08189910072
]
},
{
"command": "pnpr@main",
"mean": 3.13767206242,
"stddev": 0.08607726470189776,
"median": 3.12115534272,
"user": 2.8477577799999994,
"system": 3.1540606799999997,
"min": 3.00815935872,
"max": 3.30403438472,
"times": [
3.0881123707199998,
3.18250933572,
3.05147000172,
3.15995686572,
3.12461962272,
3.11021271772,
3.22995490372,
3.11769106272,
3.30403438472,
3.00815935872
]
}
]
}Scenario: Isolated linker: fresh install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 1.2870708353400002,
"stddev": 0.008080256355036123,
"median": 1.2879562832400002,
"user": 1.26530192,
"system": 1.6699436400000003,
"min": 1.27383086224,
"max": 1.2982077222400001,
"times": [
1.27383086224,
1.28365504624,
1.29450320824,
1.28730840224,
1.2886041642400001,
1.2780469272400001,
1.29564899724,
1.2982077222400001,
1.2800333832400002,
1.2908696402400002
]
},
{
"command": "pacquet@main",
"mean": 1.32720536814,
"stddev": 0.028141581540076413,
"median": 1.31940620524,
"user": 1.3067203199999997,
"system": 1.70457614,
"min": 1.29885727324,
"max": 1.3946486952400001,
"times": [
1.3035736852400002,
1.3946486952400001,
1.32145418724,
1.31322049924,
1.35238318924,
1.31735822324,
1.32847071724,
1.29885727324,
1.31156239024,
1.33052482124
]
},
{
"command": "pnpr@HEAD",
"mean": 1.39325570334,
"stddev": 0.06406930048046257,
"median": 1.37403483224,
"user": 0.55795252,
"system": 1.5594169399999998,
"min": 1.35432972424,
"max": 1.5727676252400002,
"times": [
1.37571925424,
1.37124606324,
1.5727676252400002,
1.3723504102400002,
1.35432972424,
1.37897721724,
1.36398931324,
1.3676688732400002,
1.3777663132400002,
1.39774223924
]
},
{
"command": "pnpr@main",
"mean": 1.41490004614,
"stddev": 0.07593126726568247,
"median": 1.38702001424,
"user": 0.60372132,
"system": 1.5584531400000001,
"min": 1.3547349112400002,
"max": 1.6012227152400003,
"times": [
1.49577896824,
1.37862411824,
1.4026257772400001,
1.6012227152400003,
1.36824579824,
1.39302043324,
1.3547349112400002,
1.3810195952400002,
1.3776233452400002,
1.3961047992400002
]
}
]
}Scenario: Isolated linker: fresh install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.9730869993800004,
"stddev": 0.051060743887323165,
"median": 2.95763736448,
"user": 1.7354435,
"system": 1.9463790399999996,
"min": 2.93956303198,
"max": 3.11404433998,
"times": [
2.9680368599799998,
2.9428689599799998,
2.96121914698,
2.9526324589799997,
2.94858781598,
2.95405558198,
2.97649536598,
2.97336643198,
3.11404433998,
2.93956303198
]
},
{
"command": "pacquet@main",
"mean": 2.9901825434799996,
"stddev": 0.019125157865758587,
"median": 2.98652437448,
"user": 1.7611754999999998,
"system": 1.9482900399999998,
"min": 2.97052897998,
"max": 3.03146798598,
"times": [
2.98725940898,
2.99054051898,
3.0031293349799997,
2.97052897998,
2.98097180498,
2.97164965298,
2.9857893399799997,
2.97325466598,
3.03146798598,
3.00723374198
]
},
{
"command": "pnpr@HEAD",
"mean": 1.3952086705800002,
"stddev": 0.01826930031026197,
"median": 1.3866139469800003,
"user": 0.5656551999999999,
"system": 1.57890284,
"min": 1.3738064929800002,
"max": 1.43222277798,
"times": [
1.43222277798,
1.4158790499800002,
1.3738064929800002,
1.39829287198,
1.3840372789800002,
1.38022509198,
1.40801597998,
1.3866202389800002,
1.3866076549800002,
1.38637926798
]
},
{
"command": "pnpr@main",
"mean": 1.3960901085800002,
"stddev": 0.07221887016458382,
"median": 1.3705296424800002,
"user": 0.5947766,
"system": 1.5505848399999997,
"min": 1.3509556709800001,
"max": 1.5862479119800001,
"times": [
1.44624586498,
1.38805920498,
1.3631670129800002,
1.5862479119800001,
1.37261008298,
1.35370577998,
1.37359593298,
1.36844920198,
1.3509556709800001,
1.3578644219800002
]
}
]
} |
|
| Branch | pr/12586 |
| Testbed | pacquet |
Click to view all benchmark results
| Benchmark | Latency | Benchmark Result milliseconds (ms) (Result Δ%) | Upper Boundary milliseconds (ms) (Limit %) |
|---|---|---|---|
| isolated-linker.fresh-install.cold-cache.cold-store | 📈 view plot 🚷 view threshold | 4,657.37 ms(+0.19%)Baseline: 4,648.39 ms | 5,578.07 ms (83.49%) |
| isolated-linker.fresh-install.cold-cache.hot-store | 📈 view plot 🚷 view threshold | 2,973.09 ms(-2.38%)Baseline: 3,045.68 ms | 3,654.81 ms (81.35%) |
| isolated-linker.fresh-install.hot-cache.hot-store | 📈 view plot 🚷 view threshold | 1,287.07 ms(-4.75%)Baseline: 1,351.28 ms | 1,621.53 ms (79.37%) |
| isolated-linker.fresh-restore.cold-cache.cold-store | 📈 view plot 🚷 view threshold | 4,455.32 ms(-1.01%)Baseline: 4,500.85 ms | 5,401.02 ms (82.49%) |
| isolated-linker.fresh-restore.hot-cache.hot-store | 📈 view plot 🚷 view threshold | 623.38 ms(-0.78%)Baseline: 628.27 ms | 753.93 ms (82.68%) |
|
| Branch | pr/12586 |
| Testbed | pnpr |
⚠️ WARNING: No Threshold found!Without a Threshold, no Alerts will ever be generated.
Click here to create a new Threshold
For more information, see the Threshold documentation.
To only post results if a Threshold exists, set the--ci-only-thresholdsflag.
Click to view all benchmark results
| Benchmark | Latency | milliseconds (ms) |
|---|---|---|
| isolated-linker.fresh-install.cold-cache.cold-store | 📈 view plot | 3,221.48 ms |
| isolated-linker.fresh-install.cold-cache.hot-store | 📈 view plot | 1,395.21 ms |
| isolated-linker.fresh-install.hot-cache.hot-store | 📈 view plot | 1,393.26 ms |
| isolated-linker.fresh-restore.cold-cache.cold-store | 📈 view plot | 2,872.93 ms |
| isolated-linker.fresh-restore.hot-cache.hot-store | 📈 view plot | 671.23 ms |
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 `@pacquet/crates/cli/tests/dedupe.rs`:
- Around line 6-35: The test name `dedupe_writes_lockfile_without_materializing`
contradicts the actual behavior since the dedupe command is run without the
`--check` flag, which means node_modules will be materialized. Either rename the
test to reflect that materialization occurs (e.g.,
`dedupe_writes_lockfile_and_materializes`) and add an assertion to verify that
the node_modules directory exists after the dedupe command runs, or add the
`--check` argument to the pacquet.with_arg("dedupe") call to prevent
materialization and match the test name's intent.
- Around line 37-63: The test function dedupe_check_does_not_materialize
correctly asserts that node_modules is not created by dedupe --check, but it
lacks verification that the lockfile is not written. Add an additional assertion
after the existing node_modules check that verifies pnpm-lock.yaml does not
exist in the workspace directory by checking that
workspace.join("pnpm-lock.yaml").exists() returns false, with a message
indicating that dedupe --check must not write the lockfile in dry-run mode.
🪄 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: b2699a53-3f4e-436e-a81d-229882342255
📒 Files selected for processing (2)
pacquet/crates/cli/src/cli_args.rspacquet/crates/cli/tests/dedupe.rs
🚧 Files skipped from review as they are similar to previous changes (1)
- pacquet/crates/cli/src/cli_args.rs
|
Code review by qodo was updated up to the latest commit bc8163e |
1 similar comment
|
Code review by qodo was updated up to the latest commit bc8163e |
|
Code review by qodo was updated up to the latest commit 5b1c49d |
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 `@pacquet/crates/cli/src/cli_args/dedupe.rs`:
- Around line 70-78: `Dedupe::check` currently returns the `Lockfile would be
modified by deduplication` error without explicitly restoring the original
lockfile, so a failed rollback can leave `pnpm-lock.yaml` changed while still
reporting only the mismatch. Update the `dedupe` flow in `cli_args/dedupe.rs` to
perform an explicit restore before returning the `--check` mismatch error, and
make the restore/remove path in the affected block (including the guard/rollback
logic used around `existing`, `current`, and `guard`) propagate failures instead
of discarding them. Ensure `--check` preserves atomicity: if rollback fails,
surface that error rather than the generic mismatch.
🪄 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: 5b63c794-df34-4c1a-abdc-38fc87910e87
📒 Files selected for processing (2)
pacquet/crates/cli/src/cli_args.rspacquet/crates/cli/src/cli_args/dedupe.rs
🚧 Files skipped from review as they are similar to previous changes (1)
- pacquet/crates/cli/src/cli_args.rs
|
Code review by qodo was updated up to the latest commit dfd8e88 |
|
Code review by qodo was updated up to the latest commit dfd8e88 |
…zation
The previous commit left the CliCommand::Dedupe arm as a bare match on
reporter (returning () instead of Pin<Box<dyn Future>>), which failed
to compile in all CI targets (clippy, doc, dylint, test).
This commit adds DedupePipeline, mirroring InstallPipeline:
- Calls sync_package_manager_dependencies, install_config_deps, and
run_update_config_hooks before State::init (config-finalization).
- Wraps the reporter match in Box::pin(async move { ... Ok(()) })
so each arm produces the right future type.
- Fixes lockfile path derivation to use config.workspace_dir.
- Sets prefer_frozen_lockfile: Some(false) and UpdateSeedPolicy::DropAll
so the dedupe pipeline re-resolves from scratch.
- Changes lockfile_only to true and dry_run to false (always compute
resolution; --check uses a backup/restore pattern).
- Fixes integration test names and adds lockfile-equality assertion
in the --check test.
DedupePipeline::run runs config-dependency ops that can persist the env-lockfile document into pnpm-lock.yaml BEFORE DedupeArgs::run snapshots the existing lockfile, so --check would compare post-install output against the already-modified lockfile and silently miss the diff. Move the snapshot into DedupePipeline::run, before config-dependency ops. Pass it (and the lockfile path) to DedupeArgs::run as parameters.
Use tempfile::NamedTempFile + persist (rename) for the lockfile restore in --check so the rollback is atomic: a crash mid-write cannot leave a torn pnpm-lock.yaml. The old std::fs::write was non-atomic and followed symlinks.
DedupePipeline::run was always installing config dependencies and running updateConfig hooks, which creates/modifies node_modules/.pnpm-config under the workspace root. This breaks the --check contract of not materializing anything. Guard the config-dependency ops behind !self.args.check so --check skips them entirely while the normal dedupe path still runs them.
Both the Install and Dedupe dispatch arms repeated the same config_root + package_manager_to_sync derivation. Extract a shared helper so the two paths cannot drift.
…ust_lockfile Move the lockfile snapshot and LockfileGuard creation into DedupePipeline::run, before config-dependency syncing, so the --check gate covers all lockfile mutations (including those written by config-deps). Previously the snapshot was taken inside DedupeArgs::run, after config-deps had already run, letting config-dep-driven lockfile changes go undetected by --check. Also set trust_lockfile: config.trust_lockfile instead of hard-coding false, matching the behaviour of the install command and avoiding unnecessary registry round-trips in offline/air-gapped setups.
dfd8e88 to
12b7a78
Compare
|
Code review by qodo was updated up to the latest commit 12b7a78 |
1 similar comment
|
Code review by qodo was updated up to the latest commit 12b7a78 |
|
@zkochan I addressed coderabbitai and qodo reviews here. |
Summary
Ports the pnpm dedupe command to the pacquet Rust CLI. Runs the install pipeline with lockfile_only=true and dry_run=true when --check is passed, matching pnps dedupe behavior which performs a full resolution pass to collapse duplicate dependency ranges.
Related to #11633
Squash Commit Body
Checklist
Summary by CodeRabbit
Summary
pacquet dedupeCLI subcommand to deduplicate dependencies using lockfile-only installs for production, development, and optional groups.--checkto validate deduplication against the current lockfile; if changes are detected, the original lockfile state is restored and the command fails.dedupeemits the standard end-of-command execution-time footer like other install-family commands.dedupe --checkdoes not materializenode_modulesor alterpnpm-lock.yaml.