Repository navigation
Conversation
…o v12 The Tag release operator runs `pnpm add <pkg> --dir <d> --allow-build=<pkg> --registry=<url>`; against pacquet each option aborted the parse with "unexpected argument". Bring pacquet's surface in line with the TypeScript CLI: - `--registry <url>` is now a universal rc-option accepted on every command (a global clap arg layered onto the config the same way `--config.registry=<url>` is), not only the registry-scoped commands that spelled it out locally. - `pnpm add` / `pnpm add -g` accept `--allow-build=<pkg>`, appending the named packages to `allowBuilds` — rejecting any the root explicitly disallows, persisting the rest to `pnpm-workspace.yaml`, and enabling them for the install. `pnpm install` still rejects it, matching the TS CLI (which errors on the unknown option there). - `--dir` / `-C` is now `global = true`, so it parses on either side of the subcommand instead of only before it. Audit of the remaining non-global top-level args: `--if-present` stays non-global (the script subcommands declare their own) and `--version` stays a top-level-only action; only `--dir` was wrongly position-bound. Refs #13242. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
|
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 (5)
💤 Files with no reviewable changes (1)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughPacquet now accepts universal ChangesCLI parity options
Estimated code review effort: 3 (Moderate) | ~25 minutes Assessment against linked issues
Sequence Diagram(s)sequenceDiagram
participant User
participant CliArgs
participant Config
participant AddPipeline
participant WorkspaceManifest
User->>CliArgs: Run add with --registry, --dir, and --allow-build
CliArgs->>Config: Apply registry and allowBuilds overrides
Config->>WorkspaceManifest: Persist allowed build packages
CliArgs->>AddPipeline: Start add using effective configuration
AddPipeline->>User: Complete install and lifecycle scripts
Possibly related issues
Possibly related PRs
Suggested labels: Suggested reviewers: ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
PR Summary by Qodofix(cli): align pacquet with pnpm v12 for --registry, --allow-build, and --dir
AI Description
Diagram
High-Level Assessment
Files changed (12)
|
Confidence Score: 5/5The PR appears safe to merge because no eligible blocking failure remains in this follow-up review. No blocking failure remains. Reviews (3): Last reviewed commit: "test(cli): drop redundant narration from..." | Re-trigger Greptile |
Micro-Benchmark ResultsLinux |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
pnpm/crates/cli/src/cli_args/add/tests.rs (1)
13-19: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueRemove test narration and obsolete implementation history.
pnpm/crates/cli/src/cli_args/add/tests.rs#L13-L19: remove comments that repeat the following assertions.pnpm/crates/cli/src/cli_args/add/tests.rs#L34-L35: let the assertion express the no-write behavior.pnpm/crates/cli/tests/add.rs#L36-L37: remove the pre-fix parser-failure history.pnpm/crates/cli/tests/add.rs#L57-L58: remove the postinstall assertion narration.pnpm/crates/cli/tests/add.rs#L68-L68: remove the persistence assertion narration.As per coding guidelines, Rust comments should explain non-obvious invariants or contracts and must not duplicate test behavior or describe removed implementation history.
🤖 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 `@pnpm/crates/cli/src/cli_args/add/tests.rs` around lines 13 - 19, Remove redundant narration comments from pnpm/crates/cli/src/cli_args/add/tests.rs lines 13-19 and 34-35, and from pnpm/crates/cli/tests/add.rs lines 36-37, 57-58, and 68; leave the assertions unchanged so they express the tested behavior directly.Sources: Coding guidelines, Path instructions
🤖 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.
Nitpick comments:
In `@pnpm/crates/cli/src/cli_args/add/tests.rs`:
- Around line 13-19: Remove redundant narration comments from
pnpm/crates/cli/src/cli_args/add/tests.rs lines 13-19 and 34-35, and from
pnpm/crates/cli/tests/add.rs lines 36-37, 57-58, and 68; leave the assertions
unchanged so they express the tested behavior directly.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 2c5b348d-9454-4b3c-bab3-da62435099ca
📒 Files selected for processing (12)
.changeset/pacquet-registry-allow-build-dir-parity.mdpnpm/crates/cli/src/cli_args/add.rspnpm/crates/cli/src/cli_args/add/tests.rspnpm/crates/cli/src/cli_args/cli_command.rspnpm/crates/cli/src/cli_args/dispatch.rspnpm/crates/cli/src/cli_args/dispatch_install.rspnpm/crates/cli/src/cli_args/global.rspnpm/crates/cli/src/cli_args/runtime.rspnpm/crates/cli/src/cli_args/tests.rspnpm/crates/cli/src/config_overrides.rspnpm/crates/cli/src/config_overrides/tests.rspnpm/crates/cli/tests/add.rs
Code Review by Qodo
Context used✅ Compliance rules (platform):
24 rules 1. set_allow_builds rejects control chars
|
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #13246 +/- ##
==========================================
- Coverage 86.94% 86.92% -0.02%
==========================================
Files 528 528
Lines 90472 90524 +52
==========================================
+ Hits 78661 78690 +29
- Misses 11811 11834 +23 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…ames `set_allow_builds` spliced each package name into a single `- name: true` line without the control-character guard the other block-style setters (`set_overrides`, `set_audit_ignore_ghsas`, …) already apply. `pnpm add --allow-build=<pkg>` is the first user-controlled path into it, so a crafted value containing a newline could persist malformed YAML into `pnpm-workspace.yaml` and break later commands. Guard it the same way, erroring with ERR_PNPM_WORKSPACE_MANIFEST_WRITER_INVALID_CONTROL_CHARACTER. Also drop test comments that narrated assertions or described pre-fix behavior, per the repo comment policy. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
|
Thanks for the reviews. Addressed the two actionable findings in 00243ac:
Greptile (5/5) and CodeRabbit approved; all Rust CI checks were green on the prior commit. Written by an agent (Claude Code, claude-opus-4-8). |
|
Code review by qodo was updated up to the latest commit 00243ac |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
The assertions and test names already document the behavior; remove the inline comments and trimmed the e2e doc comment to just the non-obvious why (the release operator's invocation), per the repo comment policy. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
|
Code review by qodo was updated up to the latest commit 5975383 |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
Summary
Closes #13242.
Moving the Tag workflow's operator pnpm to
12.0.0-alpha.19surfaced three CLI surfaces the TypeScript CLI has that pacquet did not. The operator runs a single command:and against pacquet each option aborted the parse with
error: unexpected argument '...' found. This brings pacquet's surface in line with the TypeScript CLI:--registry <url>is now universal. It is a global clap arg accepted on every command, layered onto the config exactly like--config.registry=<url>(default registry +defaultnamed-registry + the package-manager bootstrap copies). The registry-scoped commands that already spelled--registryout locally keep working — clap lets the global and the command-local arg coexist and both receive the value.pnpm add/pnpm add -gaccept--allow-build=<pkg>. The named packages are appended toallowBuilds: any the root project explicitly disallows (allowBuilds: false) are rejected withERR_PNPM_OVERRIDING_IGNORED_BUILT_DEPENDENCIES, the rest are persisted topnpm-workspace.yamland enabled for the install. This mirrors the TSaddhandler.--dir/-Cis nowglobal = true, so it parses on either side of the subcommand instead of only before it.Notes / decisions
installdeliberately does not accept--allow-build. The issue text says "install / add", but the TSinstallcommand does not registerallow-buildin its option types, sopnpm install --allow-build=fooerrors there withUnknown option: 'allow-build'(exit 1). pacquet'sinstallalready rejects the unknown flag the same way, so honoring it would be a divergence. Onlyadd(and the pre-existingdlx/create) accept it. The concrete operator command isadd, so this covers the reported use case.--if-presentstays non-global — the script subcommands (run,stop,restart, …) declare their own--if-present, and a global would collide; the existing tests document thatinstall --if-presentfails at parse time by design.--versionstays a top-level-onlyVersionaction. Only--dirwas wrongly position-bound.Squash Commit Body
Checklist
pnpm/port, or the description notes what still needs porting. — pacquet-only: these are gaps in pacquet; the TypeScript CLI already has all three surfaces.pnpm changeset) if this PR changes any published package. —pacquetpatch.apply_allow_build/apply_registry_overrideunit tests, and an end-to-endaddtest in the operator's exact flag shape.Written by an agent (Claude Code, claude-opus-4-8).
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by CodeRabbit
New Features
--registry <url>support across commands.--dir/-Cis now position-independent and can appear anywhere on the command line.--allow-build=<package>toaddandadd -g, enabling selected build scripts during installation and persisting the setting for future installs.Bug Fixes
--allow-buildfrom overriding explicitly disabled build dependencies, returning a clear error instead.allowBuildsentries.