Skip to content

fix(cli): support --bare in pnpm init (pnpm/pnpm#15538) - #15541

Merged
zkochan merged 2 commits into
mainfrom
fix-15538
Sep 24, 2026
Merged

zkochan merged 2 commits into
mainfrom
fix-15538

Conversation

@zkochan

@zkochan zkochan commented Sep 24, 2026 •

Copy link
Copy Markdown
Member

Summary

Closes #15538

Adds the --bare CLI flag to pnpm init in pacquet, scaffolding a minimal package.json with only the required fields (devEngines, packageManager, and type: "module") rather than the full scaffold.

Squash Commit Body

Add the --bare CLI flag to pnpm init in pacquet, scaffolding a minimal
package.json with only the required fields (devEngines, packageManager,
and type: "module").

Closes #15538

Checklist

  • I checked the referenced issue and verified that none of the PRs already linked to it solves it.
  • New features are implemented only in the Rust pnpm v12 CLI. Bug fixes are implemented in every affected version.
  • 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.

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

Summary by CodeRabbit

  • New Features
    • Added the pnpm init --bare option to create a minimal package.json instead of the standard scaffold.
    • The option respects applicable initialization settings, including the requested license and version, and can be combined with options to omit the package manager entry or select CommonJS.
    • Added --bare to the pnpm init help output.

Add the `--bare` CLI flag to `pnpm init` in pacquet, scaffolding a minimal
`package.json` with only the required fields (`devEngines`, `packageManager`,
and `type: "module"`).
@coderabbitai

coderabbitai Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: pnpm/pnpm/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 8d324c56-f466-4f8a-811a-bbdaea011f68

📥 Commits

Reviewing files that changed from the base of the PR and between d81c8eb and bdca55b.

📒 Files selected for processing (2)
  • .changeset/init-bare-flag.md
  • pnpm/crates/package-manifest/src/initialization.rs
🚧 Files skipped from review as they are similar to previous changes (1)
  • .changeset/init-bare-flag.md

Included review availability: Your plan provides up to 10 included reviews per hour; 3 remain after this review.


📝 Walkthrough

Walkthrough

pnpm init now accepts --bare and passes the option to package initialization. Bare mode omits the standard scaffold fields while retaining applicable package-manager, module-type, and explicit initialization settings.

Changes

Bare package initialization

Layer / File(s) Summary
Add and pass the CLI option
pnpm/crates/cli/src/cli_args/init.rs, pnpm/crates/cli/src/cli_args/dispatch_script.rs
Adds the --bare argument and passes its value into InitOptions.
Generate and validate bare manifests
pnpm/crates/package-manifest/src/initialization.rs, pnpm/crates/package-manifest/src/tests/manifests.rs, pnpm/crates/cli/tests/suite/init.rs, .changeset/init-bare-flag.md
Bare mode starts with an empty manifest. Package-manager pinning and other applicable init settings are applied separately. Tests cover generated fields, explicit settings, and help output. A changeset declares a patch release.

Priority: ➖ Normal

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

Change: Bug fix · Severity of issue fixed: Medium

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant InitCLI
  participant InitDispatcher
  participant PackageManifest
  User->>InitCLI: run pnpm init --bare
  InitCLI->>InitDispatcher: pass bare option
  InitDispatcher->>PackageManifest: initialize with bare option
  PackageManifest-->>User: produce package.json
Loading

Assessment against linked issues

Objective Addressed Explanation
Support pnpm init --bare and generate a package manifest with the expected bare fields [#15538] ✅
Show --bare in pnpm init help [#15538] ✅

Suggested labels: product: pacquet

Suggested reviewers: krosci

Merge Risk: ⚪ Minimal · up to bdca5

The bare initialization path and its documented output have test coverage; no actionable issue remains before normal merge checks.

✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

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.

@zkochan
zkochan marked this pull request as ready for review September 24, 2026 11:50
@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Support bare package manifests in pnpm init

🐞 Bug fix ✨ Enhancement 🧪 Tests 🕐 20-40 Minutes

Grey Divider

AI Description

• Adds pnpm init --bare for minimal package manifests.
• Preserves package-manager pinning, module type, and explicit initialization settings.
• Covers manifest output, flag interactions, and CLI help with automated tests.
Diagram

graph TD
  A["pnpm init"] --> B["CLI parser"] --> C["Init dispatch"] --> D{"Bare mode?"}
  D -->|yes| E["Empty scaffold"] --> G["Apply init options"] --> H["package.json"]
  D -->|no| F["Default scaffold"] --> G
Loading
High-Level Assessment

The selected approach is appropriate: choosing the base scaffold before applying shared initialization options keeps existing behavior intact and naturally preserves explicit configuration. Filtering fields from a completed full scaffold was considered but would be more fragile as scaffold defaults evolve.

Files changed (6) +193 / -22

Enhancement (3) +43 / -22
dispatch_script.rsPropagate bare mode into manifest initialization +2/-0

Propagate bare mode into manifest initialization

• Reads the parsed bare flag and passes it through 'InitOptions' when dispatching 'pnpm init'. Existing configuration resolution and package-manager version pinning remain shared between bare and default initialization.

pnpm/crates/cli/src/cli_args/dispatch_script.rs

init.rsExpose the --bare initialization flag +4/-0

Expose the --bare initialization flag

• Adds the documented Clap '--bare' boolean option to 'InitArgs', making the flag available in parsing and generated command help.

pnpm/crates/cli/src/cli_args/init.rs

initialization.rsGenerate minimal manifests in bare mode +37/-22

Generate minimal manifests in bare mode

• Extends 'InitOptions' with bare mode and selects either an empty or full base scaffold. Extracts package-manager pin insertion while continuing to apply module type and explicit version, license, and author settings after scaffold selection.

pnpm/crates/package-manifest/src/initialization.rs

Tests (2) +145 / -0
init.rsCover bare initialization through the CLI +109/-0

Cover bare initialization through the CLI

• Adds integration tests for minimal output, CommonJS without package-manager pinning, explicit license and version settings, and help visibility. The assertions also verify that standard scaffold fields are omitted.

pnpm/crates/cli/tests/suite/init.rs

manifests.rsVerify bare manifest construction +36/-0

Verify bare manifest construction

• Updates the complete-options fixture for the new field and adds a unit test confirming bare output includes shared required fields while excluding standard scaffold defaults.

pnpm/crates/package-manifest/src/tests/manifests.rs

Documentation (1) +5 / -0
init-bare-flag.mdDocument bare initialization support +5/-0

Document bare initialization support

• Adds a patch changeset for pacquet announcing that 'pnpm init --bare' creates a package manifest containing only required fields.

.changeset/init-bare-flag.md

@qodo-code-review

qodo-code-review Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)

Grey Divider


Remediation recommended

1. Release note uses passive voice ✓ Resolved 📘 Rule violation ⚙ Maintainability
Description
The first changeset sentence says `pnpm init --bare is now supported` instead of naming pnpm as
the actor performing the change. This makes the release note less direct about which command gained
the option, while the following sentence already describes the resulting manifest.
Code

.changeset/init-bare-flag.md[5]

+`pnpm init --bare` is now supported. It creates a `package.json` file with only the required fields [pnpm/pnpm#15538](https://github.com/pnpm/pnpm/issues/15538).
Relevance

●●● Strong

Recent changeset precedents accept active-voice rewrites naming pnpm or the responsible tool.

PR-#15148
PR-#14652

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
Rule 3058332 requires an explicit actor and active voice in changeset entries. The added release
note uses the passive phrase is now supported.

Rule 3058332: Use plain, direct, and quantifiable language in changeset entries
.changeset/init-bare-flag.md[5-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 changeset opens with the passive construction ``pnpm init --bare` is now supported`, contrary to the required direct, active wording for release notes.

## Fix Focus Areas
- .changeset/init-bare-flag.md[5-5]

## Recommended Fix
Rewrite the first sentence as ``pnpm init` now supports the `--bare` option.` Keep the second sentence focused on the generated manifest.

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


2. Package pinning gains needless indirection ✓ Resolved 📘 Rule violation ⚙ Maintainability
Description
apply_pinned_pnpm_version extracts unchanged package-manager pinning logic from
create_init_package_json without contributing to the new bare-manifest branch. Because the fix
only needs scaffold_manifest to select the initial fields, this separate helper adds unrelated
refactoring to the bug-fix change.
Code

pnpm/crates/package-manifest/src/initialization.rs[60]

+fn apply_pinned_pnpm_version(fields: &mut Map<String, Value>, version: &str) {
Relevance

●● Moderate

Package-manifest history accepts behavior and test improvements, but lacks a close precedent on
helper extraction refactoring.

PR-#15153
PR-#15223

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
Rule 2255067 excludes unrelated refactoring from bug-fix changes. The new helper and its call merely
relocate the existing pin-field insertion while the bare behavior is implemented independently by
scaffold_manifest.

Rule 2255067: Bug fix changes must not include unrelated refactors or reformatting
pnpm/crates/package-manifest/src/initialization.rs[60-77]
pnpm/crates/package-manifest/src/initialization.rs[81-85]

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 PR extracts unchanged package-manager pinning behavior into a new helper even though that refactor is unnecessary for adding the bare scaffold.

## Fix Focus Areas
- pnpm/crates/package-manifest/src/initialization.rs[60-85]

## Recommended Fix
Keep the existing pinning insertion code inside `create_init_package_json` and retain only the scaffold selection changes required to support `bare`.

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


Grey Divider

Context sources
✅ Compliance rules (platform): 64 rules
✅ Skills: review-code
✅ Cross-repo context — repo relationships
  Explored: repo: pnpm/update (sha: fcaa952e)
  Explored: repo: pnpm/setup (sha: fbda4c85)
  Explored: repo: pnpm/pnpm.io (sha: e3bc12c9)
Review mode: 🚀 Fast: This push is a localized, behavior-preserving refactor that inlines an existing helper, plus a documentation wording change, with no new independent logic or high-risk surface.

Grey Divider

Tip of the day
💡 Did you know, you can choose which labels appear on a finding, and whether they show icons or text

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

@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.

@github-actions github-actions Bot added the reviewed: coderabbit CodeRabbit submitted an approving review label Sep 24, 2026
@codecov-commenter

codecov-commenter commented Sep 24, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.80%. Comparing base (98f304e) to head (bdca55b).

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #15541   +/-   ##
=======================================
  Coverage   91.79%   91.80%           
=======================================
  Files        1424     1424           
  Lines      192482   192489    +7     
=======================================
+ Hits       176691   176710   +19     
+ Misses      15791    15779   -12     

☔ 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.

…geset (#15538)

Keep package-manager pinning logic inline within `create_init_package_json`
and update changeset to active voice.
@github-actions

github-actions Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Micro-Benchmark Results

Linux

group                                            main                                   pr
-----                                            ----                                   --
lockfile/parse_pnpm_lock                         1.00     12.2±0.18ms    30.6 MB/sec    1.03     12.6±0.62ms    29.7 MB/sec
packument/parse                                  1.08     41.9±0.10µs  1584.8 MB/sec    1.00     38.6±0.20µs  1717.2 MB/sec
tarball/download_dependency                      1.02      4.2±0.25ms  1033.3 KB/sec    1.00      4.1±0.15ms  1049.8 KB/sec
tarball_batch/cold_store_many_medium_tarballs    1.00   189.2±14.63ms 84.6 KElem/sec    1.01   191.8±11.80ms 83.4 KElem/sec
workspace_resolution/hoist_heavy                 1.00    271.8±5.23ms        ? ?/sec    1.00    270.8±8.67ms        ? ?/sec
workspace_sort/chained_projects                  1.04     13.7±1.01ms        ? ?/sec    1.00     13.1±1.31ms        ? ?/sec

@qodo-code-review

Copy link
Copy Markdown

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

@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.

@github-actions

Copy link
Copy Markdown
Contributor

Same-run regression check

HEAD and main are measured on the same runner. The tolerance is 5% of the main median or 2 ms, whichever is larger. A regression requires both the median slowdown and the gap between the fastest retained HEAD sample and slowest retained main sample to exceed this tolerance, after trimming up to 10% from each tail. Suspected regressions are rerun once with target order reversed and only fail if reproduced. This conservative noise guard is not a statistical confidence interval.

Inconclusive rows do not fail the check. They remain visible for performance review. Bencher retains absolute minimum timings for historical tracking; historical alerts do not gate this PR. Sequential measurements can still be affected by runner drift.

Scenario Engine main median HEAD median Change Tolerance Result
isolated-fresh-restore-cold-cache-cold-store pacquet 2883.13 ms 2882.97 ms -0.0% 144.16 ms Within tolerance
isolated-fresh-restore-cold-cache-cold-store pnpr 1467.05 ms 1405.53 ms -4.2% 73.35 ms Within tolerance
isolated-fresh-restore-hot-cache-hot-store pacquet 255.56 ms 261.64 ms 2.4% 12.78 ms Within tolerance
isolated-fresh-restore-hot-cache-hot-store pnpr 288.78 ms 290.97 ms 0.8% 14.44 ms Within tolerance
isolated-repeat-install-hot-cache-hot-store pacquet 7.03 ms 6.86 ms -2.5% 2.00 ms Within tolerance
isolated-repeat-install-hot-cache-hot-store pnpr 6.43 ms 6.44 ms 0.1% 2.00 ms Within tolerance
isolated-repeat-install-cold-cache-hot-store pacquet 10.46 ms 12.08 ms 15.4% 2.00 ms Within tolerance
isolated-repeat-install-cold-cache-hot-store pnpr 8.55 ms 8.80 ms 3.0% 2.00 ms Within tolerance
isolated-fresh-install-cold-cache-cold-store pacquet 2567.35 ms 2549.23 ms -0.7% 128.37 ms Within tolerance
isolated-fresh-install-cold-cache-cold-store pnpr 1554.64 ms 1531.28 ms -1.5% 77.73 ms Within tolerance
isolated-fresh-install-hot-cache-hot-store pacquet 506.45 ms 448.79 ms -11.4% 25.32 ms Within tolerance
isolated-fresh-install-hot-cache-hot-store pnpr 349.12 ms 337.86 ms -3.2% 17.46 ms Within tolerance
isolated-fresh-install-cold-cache-hot-store pacquet 1769.98 ms 1715.73 ms -3.1% 88.50 ms Within tolerance
isolated-fresh-install-cold-cache-hot-store pnpr 338.82 ms 350.02 ms 3.3% 16.94 ms Within tolerance
isolated-fresh-resolve-hot-cache-offline pacquet 197.30 ms 202.01 ms 2.4% 9.87 ms Within tolerance
isolated-fresh-resolve-hot-cache-offline pnpr 90.33 ms 87.85 ms -2.7% 4.52 ms Within tolerance
isolated-peer-heavy-resolve-hot-cache-offline pacquet 774.07 ms 759.20 ms -1.9% 38.70 ms Within tolerance
isolated-linked-workspace-resolve-hot-cache-offline pacquet 188.91 ms 182.88 ms -3.2% 9.45 ms Within tolerance
isolated-fresh-restore-cold-cache-cold-store-cold-pnpr pacquet 4573.56 ms 4794.76 ms 4.8% 228.68 ms Within tolerance
isolated-fresh-restore-cold-cache-cold-store-cold-pnpr pnpr 3481.62 ms 3474.01 ms -0.2% 174.08 ms Within tolerance
gvs-fresh-restore-hot-cache-hot-store pacquet 127.92 ms 121.67 ms -4.9% 6.40 ms Within tolerance
gvs-fresh-restore-hot-cache-hot-store pnpr 123.37 ms 134.11 ms 8.7% 6.17 ms Inconclusive (overlapping samples)

Integrated-Benchmark Report (Linux)

Commit: bdca55ba5328

Regular scenarios report direct and pnpr installs. The peer-heavy resolver scenario compares current Rust, main Rust, and TypeScript pnpm; the linked-workspace scenario compares current Rust against main Rust. Bencher consumes pacquet@HEAD and pnpr@HEAD.

The tables below show mean ± σ. Bencher tracks absolute minimum latency; PR regression checks compare HEAD and main samples from the same runner. Historical timing alerts do not gate PRs.

Scenario: Isolated linker: fresh restore, cold cache + cold store

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.917 ± 0.308 2.440 3.403 2.01 ± 0.27
pacquet@main 3.048 ± 0.427 2.557 3.912 2.10 ± 0.34
pnpr@HEAD 1.449 ± 0.120 1.307 1.635 1.00
pnpr@main 1.476 ± 0.098 1.364 1.698 1.02 ± 0.11
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.91693001186,
      "stddev": 0.3078893406562751,
      "median": 2.88296645356,
      "user": 2.34718736,
      "system": 1.99334146,
      "min": 2.43977347506,
      "max": 3.4029516900599996
    },
    {
      "command": "pacquet@main",
      "mean": 3.04842836586,
      "stddev": 0.42673770627785146,
      "median": 2.8831338670599997,
      "user": 2.6474056599999995,
      "system": 2.2656830599999997,
      "min": 2.5574175920599997,
      "max": 3.9115949410599997
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.4494935947600003,
      "stddev": 0.12047453717469256,
      "median": 1.40553198906,
      "user": 1.40167306,
      "system": 1.4208361599999997,
      "min": 1.3072318920600001,
      "max": 1.63545359806
    },
    {
      "command": "pnpr@main",
      "mean": 1.4764914549600001,
      "stddev": 0.09841038002448978,
      "median": 1.4670451125600001,
      "user": 1.58924756,
      "system": 1.65860366,
      "min": 1.36357819906,
      "max": 1.69789635506
    }
  ]
}

Scenario: Isolated linker: fresh restore, hot cache + hot store

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 262.1 ± 9.4 244.1 277.3 1.04 ± 0.07
pacquet@main 252.1 ± 13.7 230.3 267.0 1.00
pnpr@HEAD 292.0 ± 17.5 265.8 317.8 1.16 ± 0.09
pnpr@main 287.9 ± 11.3 261.8 305.0 1.14 ± 0.08
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.26205762048000003,
      "stddev": 0.009420443692694574,
      "median": 0.26163752568000004,
      "user": 0.28108503999999995,
      "system": 0.6240485199999999,
      "min": 0.24410594418,
      "max": 0.27732083618000003
    },
    {
      "command": "pacquet@main",
      "mean": 0.25209040218,
      "stddev": 0.013725220131022006,
      "median": 0.25555850268,
      "user": 0.28021113999999997,
      "system": 0.60990122,
      "min": 0.23032071318,
      "max": 0.26701355418000006
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.29200852378,
      "stddev": 0.01753895220545655,
      "median": 0.29096630668,
      "user": 0.31714694,
      "system": 0.6537393199999999,
      "min": 0.26578699518000004,
      "max": 0.31776013818000004
    },
    {
      "command": "pnpr@main",
      "mean": 0.2879111425800001,
      "stddev": 0.011259330738697067,
      "median": 0.28877921568000003,
      "user": 0.30554064,
      "system": 0.65653162,
      "min": 0.26175073518,
      "max": 0.30503605918000004
    }
  ]
}

Scenario: Isolated linker: repeat install, hot cache + hot store

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 6.9 ± 0.5 5.7 10.2 1.07 ± 0.10
pacquet@main 7.1 ± 0.8 5.9 11.0 1.11 ± 0.14
pnpr@HEAD 6.5 ± 0.4 5.7 9.0 1.01 ± 0.09
pnpr@main 6.5 ± 0.4 5.7 8.5 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.006914366743084581,
      "stddev": 0.0004831628008347111,
      "median": 0.00685579786,
      "user": 0.004250445472636821,
      "system": 0.0030969898507462717,
      "min": 0.00569745886,
      "max": 0.01020735686
    },
    {
      "command": "pacquet@main",
      "mean": 0.007144398598028168,
      "stddev": 0.000792664450547942,
      "median": 0.007033932860000001,
      "user": 0.004384803380281689,
      "system": 0.0032032783098591565,
      "min": 0.00587193586,
      "max": 0.01104275186
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.006498377634358973,
      "stddev": 0.0004317947495432477,
      "median": 0.00643560636,
      "user": 0.004201086153846156,
      "system": 0.00267679641025641,
      "min": 0.00570581486,
      "max": 0.00901800986
    },
    {
      "command": "pnpr@main",
      "mean": 0.006450165995922334,
      "stddev": 0.00039418841261667175,
      "median": 0.006426769860000001,
      "user": 0.004266593398058252,
      "system": 0.002563478834951456,
      "min": 0.00570890986,
      "max": 0.00848065286
    }
  ]
}

Scenario: Isolated linker: repeat install, cold cache + hot store

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 11.9 ± 2.1 7.9 18.1 1.38 ± 0.27
pacquet@main 10.4 ± 1.7 7.2 15.7 1.20 ± 0.23
pnpr@HEAD 9.0 ± 0.8 7.4 13.1 1.04 ± 0.13
pnpr@main 8.6 ± 0.8 7.0 11.5 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.011930785960000004,
      "stddev": 0.0020567770141344628,
      "median": 0.012075525960000002,
      "user": 0.006903919797979802,
      "system": 0.005642108686868687,
      "min": 0.007932646460000001,
      "max": 0.01814806646
    },
    {
      "command": "pacquet@main",
      "mean": 0.010381741326666668,
      "stddev": 0.0017430827258503722,
      "median": 0.010464908460000002,
      "user": 0.006126704102564104,
      "system": 0.004788977435897434,
      "min": 0.00716576846,
      "max": 0.015653234460000002
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.008969377733722623,
      "stddev": 0.0007833388168845004,
      "median": 0.008804628460000002,
      "user": 0.005196308832116786,
      "system": 0.004303099999999997,
      "min": 0.0073884664600000005,
      "max": 0.013147352460000001
    },
    {
      "command": "pnpr@main",
      "mean": 0.008635185141992338,
      "stddev": 0.0007919126029901586,
      "median": 0.00855189846,
      "user": 0.005092308045977011,
      "system": 0.004044274942528737,
      "min": 0.00696102346,
      "max": 0.01154148846
    }
  ]
}

Scenario: Isolated linker: fresh install, cold cache + cold store

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.560 ± 0.053 2.482 2.673 1.65 ± 0.11
pacquet@main 2.586 ± 0.080 2.485 2.714 1.67 ± 0.12
pnpr@HEAD 1.557 ± 0.145 1.397 1.777 1.00 ± 0.11
pnpr@main 1.551 ± 0.099 1.435 1.720 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.56018992894,
      "stddev": 0.053476024147487054,
      "median": 2.54923102274,
      "user": 2.02387638,
      "system": 1.61490874,
      "min": 2.4817705882400003,
      "max": 2.67337881624
    },
    {
      "command": "pacquet@main",
      "mean": 2.58639939804,
      "stddev": 0.0804277152637953,
      "median": 2.56734546374,
      "user": 2.0407945799999996,
      "system": 1.66755934,
      "min": 2.48512886924,
      "max": 2.71433175224
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.55699292604,
      "stddev": 0.14474842598465115,
      "median": 1.5312833217400001,
      "user": 1.19060278,
      "system": 1.29234734,
      "min": 1.3973911312399998,
      "max": 1.77731945024
    },
    {
      "command": "pnpr@main",
      "mean": 1.55096356464,
      "stddev": 0.09928742401862228,
      "median": 1.55464157424,
      "user": 1.16658588,
      "system": 1.2564432399999999,
      "min": 1.43527784024,
      "max": 1.72022259724
    }
  ]
}

Scenario: Isolated linker: fresh install, hot cache + hot store

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 444.0 ± 37.4 393.4 500.4 1.30 ± 0.14
pacquet@main 491.5 ± 32.8 436.5 536.1 1.44 ± 0.13
pnpr@HEAD 340.4 ± 21.7 312.5 376.0 1.00
pnpr@main 356.2 ± 29.6 320.2 412.3 1.05 ± 0.11
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.4440359751,
      "stddev": 0.03744383302685276,
      "median": 0.44878957620000004,
      "user": 0.6188353999999998,
      "system": 0.72448,
      "min": 0.3933931002,
      "max": 0.5004003182
    },
    {
      "command": "pacquet@main",
      "mean": 0.4915393387,
      "stddev": 0.03279347522698061,
      "median": 0.5064515002000001,
      "user": 0.6753327,
      "system": 0.7813202999999999,
      "min": 0.43646000520000006,
      "max": 0.5360515492
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.3404473652,
      "stddev": 0.021654369224396886,
      "median": 0.3378595407,
      "user": 0.2885124,
      "system": 0.6050886999999999,
      "min": 0.31250080620000004,
      "max": 0.37595027420000005
    },
    {
      "command": "pnpr@main",
      "mean": 0.3561918841,
      "stddev": 0.02956437367471151,
      "median": 0.3491242822,
      "user": 0.3070572,
      "system": 0.6082392000000001,
      "min": 0.3202420322,
      "max": 0.41230329720000003
    }
  ]
}

Scenario: Isolated linker: fresh install, cold cache + hot store

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 1.721 ± 0.055 1.650 1.835 5.02 ± 0.28
pacquet@main 1.764 ± 0.053 1.696 1.846 5.15 ± 0.28
pnpr@HEAD 0.352 ± 0.014 0.326 0.379 1.03 ± 0.06
pnpr@main 0.343 ± 0.016 0.324 0.371 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 1.7210364297200003,
      "stddev": 0.055405639958449826,
      "median": 1.7157328030199999,
      "user": 1.02125138,
      "system": 0.9595621599999997,
      "min": 1.6501255695200001,
      "max": 1.83545181952
    },
    {
      "command": "pacquet@main",
      "mean": 1.76422322242,
      "stddev": 0.05334227564627143,
      "median": 1.76998184302,
      "user": 1.09782828,
      "system": 0.98809526,
      "min": 1.6963975595199998,
      "max": 1.84609349752
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.35177797582,
      "stddev": 0.014273125000283047,
      "median": 0.35002496852000003,
      "user": 0.31395078,
      "system": 0.6472929599999999,
      "min": 0.32640926152,
      "max": 0.37868506152000003
    },
    {
      "command": "pnpr@main",
      "mean": 0.34258014322,
      "stddev": 0.015644811048636253,
      "median": 0.33881705951999996,
      "user": 0.29767847999999997,
      "system": 0.64275646,
      "min": 0.32350516252,
      "max": 0.37105363852
    }
  ]
}

Scenario: Isolated linker: fresh resolve, hot cache, offline

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 200.5 ± 10.4 184.1 216.0 2.27 ± 0.13
pacquet@main 202.2 ± 14.6 183.8 230.7 2.29 ± 0.18
pnpr@HEAD 88.5 ± 2.3 83.7 95.2 1.00
pnpr@main 90.4 ± 2.7 85.8 95.6 1.02 ± 0.04
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.20051984277428575,
      "stddev": 0.010438674340170448,
      "median": 0.20200579356,
      "user": 0.20338021428571432,
      "system": 0.06939435714285713,
      "min": 0.18406766356,
      "max": 0.21601115756
    },
    {
      "command": "pacquet@main",
      "mean": 0.20219175397666667,
      "stddev": 0.014623285097427342,
      "median": 0.19730164556000002,
      "user": 0.20127058333333334,
      "system": 0.06778974999999998,
      "min": 0.18383857256,
      "max": 0.23071194856000002
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.08846139015375,
      "stddev": 0.0022809232130639396,
      "median": 0.08784916656,
      "user": 0.030147656249999998,
      "system": 0.011749078125000003,
      "min": 0.08365563856,
      "max": 0.09521526156
    },
    {
      "command": "pnpr@main",
      "mean": 0.09040911510545455,
      "stddev": 0.002724513773267227,
      "median": 0.09033195356,
      "user": 0.03360781818181817,
      "system": 0.01240975757575758,
      "min": 0.08579917356,
      "max": 0.09556180356
    }
  ]
}

Scenario: Isolated linker: peer-heavy resolve, hot cache, offline

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 741.3 ± 62.5 601.7 814.5 1.00
pacquet@main 782.8 ± 124.1 627.5 1006.4 1.06 ± 0.19
pnpm@HEAD 3218.2 ± 78.3 3117.6 3342.5 4.34 ± 0.38
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.7413188729244444,
      "stddev": 0.06254363375534466,
      "median": 0.75920174648,
      "user": 0.76840546,
      "system": 0.1710827422222222,
      "min": 0.6017241884800001,
      "max": 0.81448753448
    },
    {
      "command": "pacquet@main",
      "mean": 0.7827960495911112,
      "stddev": 0.12413399576376968,
      "median": 0.7740713304800001,
      "user": 0.7964771266666665,
      "system": 0.19383407555555554,
      "min": 0.6275184634800001,
      "max": 1.00637613048
    },
    {
      "command": "pnpm@HEAD",
      "mean": 3.2181526653688888,
      "stddev": 0.07830615821634337,
      "median": 3.21306911948,
      "user": 4.957700348888888,
      "system": 0.22791151999999995,
      "min": 3.11756908948,
      "max": 3.34245101948
    }
  ]
}

Scenario: Isolated linker: linked-workspace resolve, hot cache, offline

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 185.7 ± 10.1 170.7 201.0 1.00
pacquet@main 193.6 ± 19.5 171.8 250.7 1.04 ± 0.12
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.18571237964,
      "stddev": 0.010076465483413104,
      "median": 0.18287827614000002,
      "user": 0.1376968942857143,
      "system": 0.0914545457142857,
      "min": 0.17065395614,
      "max": 0.20099763114
    },
    {
      "command": "pacquet@main",
      "mean": 0.19357606007333333,
      "stddev": 0.019457774174797462,
      "median": 0.18891261014000002,
      "user": 0.15320751333333332,
      "system": 0.08656839333333334,
      "min": 0.17180458014,
      "max": 0.25072490714000006
    }
  ]
}

Scenario: Isolated linker: fresh restore, cold cache + cold store + cold pnpr

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 4.736 ± 0.167 4.470 4.915 1.37 ± 0.05
pacquet@main 4.635 ± 0.184 4.479 4.998 1.34 ± 0.06
pnpr@HEAD 3.504 ± 0.146 3.377 3.890 1.01 ± 0.05
pnpr@main 3.466 ± 0.066 3.369 3.545 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 4.7361423166200005,
      "stddev": 0.16716819406175545,
      "median": 4.79476407842,
      "user": 2.14630908,
      "system": 1.7534390399999995,
      "min": 4.46953981842,
      "max": 4.91538996642
    },
    {
      "command": "pacquet@main",
      "mean": 4.63500994332,
      "stddev": 0.1838358940266876,
      "median": 4.57356241992,
      "user": 2.10955398,
      "system": 1.78210144,
      "min": 4.47860617442,
      "max": 4.99848664842
    },
    {
      "command": "pnpr@HEAD",
      "mean": 3.5035616043200006,
      "stddev": 0.1457386886728073,
      "median": 3.47401211342,
      "user": 1.59613878,
      "system": 1.55444104,
      "min": 3.37685082542,
      "max": 3.88975913742
    },
    {
      "command": "pnpr@main",
      "mean": 3.4660629182200005,
      "stddev": 0.06622833333683104,
      "median": 3.4816175534200005,
      "user": 1.3897169799999998,
      "system": 1.4072378399999999,
      "min": 3.3687557684200002,
      "max": 3.54515188242
    }
  ]
}

Scenario: GVS linker: fresh restore, hot cache + hot store

Same install as the isolated fresh-restore hot/hot scenario, into the shared virtual store, the layout pnpm 12 installs into by default. Scenarios run on separate machines, so compare main and branch within each table.

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 122.4 ± 4.7 115.8 130.7 1.00
pacquet@main 128.9 ± 7.7 118.8 155.1 1.05 ± 0.07
pnpr@HEAD 134.2 ± 5.9 126.3 147.4 1.10 ± 0.06
pnpr@main 124.0 ± 3.5 118.4 132.6 1.01 ± 0.05
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.12240508293,
      "stddev": 0.004680124122366636,
      "median": 0.12166774198000001,
      "user": 0.15512361000000002,
      "system": 0.13007138000000001,
      "min": 0.11578958648000001,
      "max": 0.13071641548000001
    },
    {
      "command": "pacquet@main",
      "mean": 0.12886910718,
      "stddev": 0.0076924010566428854,
      "median": 0.12791592248,
      "user": 0.16532966,
      "system": 0.13284808,
      "min": 0.11884313348,
      "max": 0.15509285048000002
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.13422478814666663,
      "stddev": 0.005859076385954108,
      "median": 0.13410666298,
      "user": 0.15803500444444446,
      "system": 0.13695424666666667,
      "min": 0.12625978648,
      "max": 0.14743818648
    },
    {
      "command": "pnpr@main",
      "mean": 0.12398259763789475,
      "stddev": 0.0034817081812505515,
      "median": 0.12336975248000001,
      "user": 0.14294748105263158,
      "system": 0.13036884315789474,
      "min": 0.11840724948,
      "max": 0.13257881248
    }
  ]
}

@zkochan
zkochan merged commit 41f43c3 into main Sep 24, 2026
52 checks passed
@zkochan
zkochan deleted the fix-15538 branch September 24, 2026 12:58
u9g pushed a commit to u9g/pnpm that referenced this pull request Sep 25, 2026
* fix(cli): support --bare in pnpm init (pnpm#15538)

Add the `--bare` CLI flag to `pnpm init` in pacquet, scaffolding a minimal
`package.json` with only the required fields (`devEngines`, `packageManager`,
and `type: "module"`).

* refactor(package-manifest): keep pinning logic inline and update changeset (pnpm#15538)

Keep package-manager pinning logic inline within `create_init_package_json`
and update changeset to active voice.
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 init --bare is missing in pnpm 12

2 participants