Skip to content

feat(pacquet): expose linkWorkspacePackages in the @pnpm/napi binding - #12844

Merged
zkochan merged 1 commit into
mainfrom
feat/napi-link-workspace-packages
Jul 7, 2026
Merged

zkochan merged 1 commit into
mainfrom
feat/napi-link-workspace-packages

Conversation

@zkochan

@zkochan zkochan commented Jul 7, 2026 •

Copy link
Copy Markdown
Member

Summary

Exposes pnpm's linkWorkspacePackages (true / false / "deep") as an
install option on the @pnpm/napi binding (added in #12822), mapping it
onto Config::link_workspace_packages via the config crate's existing
Deserialize. The default stays false, so nothing changes for existing
callers.

Motivation

The binding exposes most install options but was missing linkWorkspacePackages,
so programmatic consumers had no way to opt into it — the engine was pinned to the
Off default. This surfaced in a real consumer (Bit): a component whose only
reference to a sibling workspace component is a peerDependency, with
autoInstallPeers: true, fails to install. The auto-installed peer is a
bare-semver range, so with link-workspace-packages: false it resolves against
the registry and 404s — exactly as stock pnpm does with the same setting. The
fix on the consumer side is to set linkWorkspacePackages: 'deep' (as pnpm users
do), which requires the binding to accept it.

This is a binding-completeness change, not a behavior change: pacquet with
linkWorkspacePackages set behaves identically to the pnpm CLI with the same
config; the engine's resolution semantics are untouched.

Verification

  • Unit test: linkWorkspacePackages parses true → DirectOnly, false →
    Off, "deep" → Deep, and rejects anything else.
  • Runtime (two-importer workspace, one peer-depending on the other, the peer
    unpublished):
    • default / omitted → still 404s (matches stock pnpm — no divergence),
    • linkWorkspacePackages: 'deep' → the peer resolves from the workspace.
  • cargo fmt --check, clippy -D warnings, cargo doc -D warnings, and
    cargo dylint all clean; pacquet-napi tests green.

Ref: #12822.


Written by an agent (Claude Code, claude-fable-5), on behalf of @zkochan.

Summary by CodeRabbit

  • New Features

    • Added support for a new install option, linkWorkspacePackages, including true, false, and "deep" values.
    • Workspace package resolution can now be enabled so bare semver dependencies may resolve to matching workspace packages by name.
  • Bug Fixes

    • The new install setting is now correctly carried through configuration and applied during installation.
    • Invalid values for the option are now rejected with a clear error.

Add `linkWorkspacePackages` (`true` / `false` / `"deep"`) to the `@pnpm/napi`
install options, mapping it onto `Config::link_workspace_packages` (reusing the
config crate's `Deserialize`). Programmatic consumers need this to opt
bare-semver dependencies — including an auto-installed peer that names a sibling
workspace package — into workspace-package resolution, matching pnpm's
`link-workspace-packages` setting. The default stays `false`, so existing
behavior is unchanged.
Copilot AI review requested due to automatic review settings July 7, 2026 15:49

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Jul 7, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

Auto-approved notes - no code review findings
- 'auto_approve_for_no_suggestions' flag enabled

Previous review results

Review updated until commit 6a6154a

Results up to commit N/A


New Review Started


This review has been superseded by a new analysis


Qodo Logo

@coderabbitai

coderabbitai Bot commented Jul 7, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 32be31d8-eaea-4176-b09d-fb44ac9b9139

📥 Commits

Reviewing files that changed from the base of the PR and between b789d81 and 6a6154a.

📒 Files selected for processing (4)
  • pacquet/crates/napi/src/config.rs
  • pacquet/crates/napi/src/install.rs
  • pacquet/crates/napi/src/install/tests.rs
  • pacquet/npm/napi/index.d.ts

📝 Walkthrough

Walkthrough

This PR adds a new optional linkWorkspacePackages install option to pacquet's N-API layer. It extends ConfigOverlay with a corresponding field, parses and validates the JS value (true/false/"deep") via a new helper, wires it into build_config, updates the TypeScript definitions, and adds unit tests.

Changes

linkWorkspacePackages N-API Option

Layer / File(s) Summary
ConfigOverlay field and build_config wiring
pacquet/crates/napi/src/config.rs
Adds link_workspace_packages: Option<LinkWorkspacePackages> to ConfigOverlay with documentation, and applies it to Config during build_config when present.
InstallOptions parsing and validation
pacquet/crates/napi/src/install.rs
Documents linkWorkspacePackages on InstallOptions, updates build_overlay to populate the overlay field, and adds parse_link_workspace_packages to validate JS input and return a napi::Error for invalid values.
Tests and TypeScript type
pacquet/crates/napi/src/install/tests.rs, pacquet/npm/napi/index.d.ts
Adds a test covering "deep"/true/false/invalid parsing, sets the default in the test helper, and exposes linkWorkspacePackages?: boolean | 'deep' in the TypeScript InstallOptions type.

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

Sequence Diagram(s)

sequenceDiagram
  participant JS as JS caller
  participant BuildOverlay as build_overlay
  participant Parser as parse_link_workspace_packages
  participant Overlay as ConfigOverlay
  participant Config as build_config

  JS->>BuildOverlay: InstallOptions.linkWorkspacePackages
  BuildOverlay->>Parser: parse_link_workspace_packages(value)
  Parser-->>BuildOverlay: LinkWorkspacePackages or napi::Error
  BuildOverlay->>Overlay: set link_workspace_packages
  Overlay->>Config: apply overlay.link_workspace_packages
Loading

Possibly related PRs

  • pnpm/pnpm#11930: Implements resolver behavior reading config.link_workspace_packages to enable workspace fallback for bare-semver specs, directly connected to this PR's config value flow.

Suggested labels: product: pacquet

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/napi-link-workspace-packages

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

pacquet/npm/napi/index.d.ts

Parsing error: "parserOptions.project" has been provided for @typescript-eslint/parser.
The file was not found in any of the provided project(s): pacquet/npm/napi/index.d.ts


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Jul 7, 2026 •

Copy link
Copy Markdown

PR Summary by Qodo

Expose linkWorkspacePackages in @pnpm/napi install options

✨ Enhancement 🧪 Tests 🕐 10-20 Minutes

Grey Divider

AI Description

• Add linkWorkspacePackages to the @pnpm/napi install options (true/false/"deep").
• Deserialize into Config::link_workspace_packages via a ConfigOverlay field.
• Add Rust unit tests and update TypeScript typings/docs for the new option.
Diagram

graph TD
  A["JS consumer"] --> C["InstallOptions (napi)"] --> D["parse linkWorkspace"] --> E["ConfigOverlay"] --> F["pacquet_config::Config"]
  B["index.d.ts"] -. "types" .-> C
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Expose a dedicated N-API enum/union instead of serde_json::Value
  • ➕ Improves type-safety at the Rust boundary (no arbitrary JSON values)
  • ➕ Avoids cloning serde_json::Value during parsing
  • ➕ Can yield more targeted error messages per variant
  • ➖ More binding glue code and maintenance overhead
  • ➖ Duplicates the config crate’s existing serde model unless kept in sync
2. Normalize in JS wrapper (convert to canonical string) before calling N-API
  • ➕ Keeps Rust side simple (e.g., accept only "off"|"direct"|"deep")
  • ➕ Allows richer JS-side validation/messages
  • ➖ Requires all consumers to use the wrapper consistently
  • ➖ Shifts responsibility away from the binding; still needs Rust-side validation for safety

Recommendation: The PR’s approach (accept the JS union via serde_json::Value and reuse pacquet_config’s existing Deserialize) is the best fit for a binding-completeness change: it minimizes duplicate logic, stays aligned with CLI semantics, and keeps the default behavior unchanged. Consider a dedicated N-API enum only if more tri-state options accumulate and boundary type-safety becomes a recurring issue.

Files changed (4) +70 / -1

Enhancement (3) +41 / -1
config.rsThread link_workspace_packages through ConfigOverlay into Config +9/-1

Thread link_workspace_packages through ConfigOverlay into Config

• Adds 'link_workspace_packages: Option<LinkWorkspacePackages>' to the host overlay and applies it when building the effective 'pacquet_config::Config'. This enables the engine to honor the new N-API install option without changing defaults.

pacquet/crates/napi/src/config.rs

install.rsAdd linkWorkspacePackages to InstallOptions and parse into overlay +26/-0

Add linkWorkspacePackages to InstallOptions and parse into overlay

• Introduces 'link_workspace_packages' on the N-API 'InstallOptions' and maps it into 'ConfigOverlay' via a new 'parse_link_workspace_packages' helper. The parser reuses the config crate’s 'Deserialize' to accept 'true', 'false', or '"deep"' and rejects other values.

pacquet/crates/napi/src/install.rs

index.d.tsExpose linkWorkspacePackages in TypeScript install options contract +6/-0

Expose linkWorkspacePackages in TypeScript install options contract

• Adds 'linkWorkspacePackages?: boolean | 'deep'' to the public 'InstallOptions' interface with documentation describing resolution behavior and default. This makes the new capability discoverable to TypeScript consumers.

pacquet/npm/napi/index.d.ts

Tests (1) +29 / -0
tests.rsUnit-test linkWorkspacePackages parsing and rejection +29/-0

Unit-test linkWorkspacePackages parsing and rejection

• Adds coverage ensuring '"deep"', 'true', and 'false' map to 'Deep', 'DirectOnly', and 'Off' respectively, and that unsupported values fail. Updates the shared 'install_options()' test helper to include the new field.

pacquet/crates/napi/src/install/tests.rs

@qodo-code-review

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

Copy link
Copy Markdown

Code Review by Qodo

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

Context used
✅ Compliance rules (platform): 51 rules

Grey Divider


Action required

1. Missing changeset for @pnpm/napi ✗ Dismissed 📘 Rule violation § Compliance
Description
The PR changes the published @pnpm/napi TypeScript API by adding linkWorkspacePackages to
InstallOptions, but no new .changeset/*.md file is included to version and document the release.
This can cause untracked user-visible changes in releases.
Code

pacquet/npm/napi/index.d.ts[R93-98]

+  /**
+   * pnpm's `linkWorkspacePackages`. When `true`/`'deep'`, a bare-semver
+   * dependency (including an auto-installed peer) may resolve to a workspace
+   * package by name; `false` (the default) matches only `workspace:` ranges.
+   */
+  linkWorkspacePackages?: boolean | 'deep'
Evidence
The diff adds a new exported field to the InstallOptions interface (a user-visible API change).
Per the checklist, published TypeScript package changes must be accompanied by a new changeset file.

Rule 713441: Require changeset for TypeScript package changes
pacquet/npm/napi/index.d.ts[93-98]
pacquet/npm/napi/package.json[1-21]

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

## Issue description
A new public option `linkWorkspacePackages` was added to the published `@pnpm/napi` package API, but the PR does not include a changeset documenting the change and specifying the correct bump type.

## Issue Context
The change is user-visible to consumers via the exported `InstallOptions` type.

## Fix Focus Areas
- pacquet/npm/napi/index.d.ts[93-98]

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



Remediation recommended

2. linkWorkspacePackages clones JSON 📘 Rule violation ➹ Performance
Description
parse_link_workspace_packages() clones the full serde_json::Value before parsing, causing
unnecessary allocations and potential performance/DoS concerns if callers pass a large JSON value,
even though the accepted domain is only true, false, or "deep". This should parse from a
borrowed &Value (via matching) to avoid copying untrusted input while keeping behavior and errors
consistent (and potentially clearer for invalid values).
Code

pacquet/crates/napi/src/install.rs[R616-625]

+    value
+        .map(|value| {
+            serde_json::from_value::<pacquet_config::LinkWorkspacePackages>(value.clone()).map_err(
+                |error| {
+                    napi::Error::from_reason(format!(
+                        r#"invalid linkWorkspacePackages (expected true, false, or "deep"): {error}"#,
+                    ))
+                },
+            )
+        })
Evidence
The cited code path clones an owned serde_json::Value and then uses serde_json::from_value(...),
which forces a full copy of the input before any validation, violating the requirement to avoid
unnecessary allocations. This is unnecessary because the option’s accepted domain is limited to
bool or the string "deep" (as indicated by the enum’s deserialization expectations), and other
option parsers in the same module already decode options by matching on &Value without cloning
potentially large objects/arrays; therefore, matching directly on a borrowed value is sufficient to
validate/map the input and avoids the extra allocation/copy.

Rule 713447: Use the most general borrowed parameter types to avoid unnecessary allocations
pacquet/crates/napi/src/install.rs[616-625]
pacquet/crates/napi/src/install.rs[610-627]
pacquet/crates/napi/src/install.rs[550-563]
pacquet/crates/config/src/lib.rs[235-318]

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

## Issue description
`parse_link_workspace_packages()` currently performs `value.clone()` and then `serde_json::from_value(...)`, which clones the entire JSON value before validating it. Because this option only accepts `true`, `false`, or `"deep"`, cloning untrusted input is unnecessary and can become expensive (and potentially exploitable for performance/DoS) if a large object/array is passed.

## Issue Context
This option is fed from JS as `InstallOptions.link_workspace_packages: Option<serde_json::Value>`. Even though invalid values are ultimately rejected, the clone happens before rejection. The valid mappings are:
- `true` → `DirectOnly`
- `false` → `Off`
- `"deep"` → `Deep`
Other parsers in this file already match on `&serde_json::Value` without cloning.

## Fix Focus Areas
- pacquet/crates/napi/src/install.rs[610-627]

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


Grey Divider

Qodo Logo

Comment thread pacquet/npm/napi/index.d.ts Resolved
@qodo-code-review

Copy link
Copy Markdown

PR Code Suggestions ✨

Warning

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

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
Possible issue
Include new field in cache hash

Include the new link_workspace_packages field in the cache key hashing function.

pacquet/crates/napi/src/config.rs [139-150]

 fn cache_key(dir: &Path, overlay: &ConfigOverlay) -> u64 {
     let mut hasher = DefaultHasher::new();
     dir.hash(&mut hasher);
     // ... other overlay fields hashed ...
+    if let Some(link_workspace_packages) = &overlay.link_workspace_packages {
+        // incorporate this flag into the key
+        link_workspace_packages.hash(&mut hasher);
+    }
     hasher.finish()
 }

[To ensure code accuracy, apply this suggestion manually]

Suggestion importance[1-10]: 9

__

Why: Failing to hash the new link_workspace_packages field in cache_key is a critical bug that will cause cache collisions for different configurations.

High
General
Test default None behavior

Add a test case to verify that link_workspace_packages defaults to None.

pacquet/crates/napi/src/install/tests.rs [89-98]

 #[test]
 fn build_overlay_parses_link_workspace_packages() {
     use pacquet_config::LinkWorkspacePackages;
+
+    // default: not set
+    let options = install_options();
+    assert!(build_overlay(&options)
+        .expect("overlay")
+        .link_workspace_packages
+        .is_none());
 
     let mut options = install_options();
     options.link_workspace_packages = Some(serde_json::json!("deep"));
     assert_eq!(
         build_overlay(&options).expect("overlay").link_workspace_packages,
         Some(LinkWorkspacePackages::Deep),
     );
     // ...
 }

[To ensure code accuracy, apply this suggestion manually]

Suggestion importance[1-10]: 4

__

Why: Adding a test for the default None behavior slightly improves test coverage, though the behavior is somewhat trivial.

Low
  • More

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 6a6154a

@github-actions github-actions Bot added reviewed: qodo reviewed: coderabbit CodeRabbit submitted an approving review labels Jul 7, 2026
@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Micro-Benchmark Results

Linux

group                          main                                   pr
-----                          ----                                   --
tarball/download_dependency    1.00      6.5±0.19ms   664.6 KB/sec    1.02      6.7±0.32ms   651.6 KB/sec

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.44444% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 85.80%. Comparing base (de1371d) to head (6a6154a).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
pacquet/crates/napi/src/config.rs 66.66% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main   #12844   +/-   ##
=======================================
  Coverage   85.80%   85.80%           
=======================================
  Files         448      448           
  Lines       69402    69420   +18     
=======================================
+ Hits        59552    59569   +17     
- Misses       9850     9851    +1     

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

@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Integrated-Benchmark Report (Linux)

Commit: 6a6154a90f2d

Each scenario reports direct installs and pnpr installs. Bencher consumes pacquet@HEAD and pnpr@HEAD.

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 4.109 ± 0.114 3.957 4.352 1.89 ± 0.11
pacquet@main 4.096 ± 0.120 3.957 4.301 1.88 ± 0.11
pnpr@HEAD 2.184 ± 0.179 2.012 2.563 1.00 ± 0.10
pnpr@main 2.179 ± 0.115 2.083 2.404 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 4.10874334638,
      "stddev": 0.1139441550573829,
      "median": 4.083283015879999,
      "user": 3.8752317399999994,
      "system": 3.56542726,
      "min": 3.95737447638,
      "max": 4.3523703413799995,
      "times": [
        4.1064534533799995,
        4.12236595138,
        4.044743726379999,
        4.3523703413799995,
        4.24965744138,
        4.06321380138,
        4.08479580638,
        4.08177022538,
        4.02468824038,
        3.95737447638
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 4.09643720938,
      "stddev": 0.11976898726852236,
      "median": 4.062686835379999,
      "user": 3.9073270399999998,
      "system": 3.53538336,
      "min": 3.9571350993800003,
      "max": 4.30062682138,
      "times": [
        4.30062682138,
        3.9571350993800003,
        3.99809046238,
        4.12086438438,
        3.97964795738,
        4.23030797838,
        4.097701391379999,
        4.22534877938,
        4.02767227938,
        4.02697694038
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 2.18399596798,
      "stddev": 0.1789484540793791,
      "median": 2.09588208788,
      "user": 2.69191924,
      "system": 3.09137706,
      "min": 2.01226285738,
      "max": 2.56340088638,
      "times": [
        2.09610004638,
        2.0603792583800002,
        2.05852718738,
        2.01226285738,
        2.3817304153800003,
        2.20519082338,
        2.30306401338,
        2.0956641293800002,
        2.56340088638,
        2.06364006238
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 2.1789382651800002,
      "stddev": 0.1150738185507871,
      "median": 2.12847519288,
      "user": 2.7368862399999996,
      "system": 3.11053406,
      "min": 2.08296083738,
      "max": 2.40448930138,
      "times": [
        2.40448930138,
        2.1250233293800003,
        2.10154749338,
        2.13192705638,
        2.09756059838,
        2.13804198838,
        2.32191435538,
        2.29005819038,
        2.08296083738,
        2.09585950138
      ]
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 672.3 ± 16.3 644.1 710.3 1.00
pacquet@main 704.7 ± 68.3 655.0 893.8 1.05 ± 0.10
pnpr@HEAD 724.4 ± 69.0 668.1 913.2 1.08 ± 0.11
pnpr@main 747.2 ± 68.0 691.6 932.7 1.11 ± 0.10
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.6723497272000001,
      "stddev": 0.016289562669591178,
      "median": 0.6709311778,
      "user": 0.40166443999999996,
      "system": 1.3495544800000001,
      "min": 0.6440765078,
      "max": 0.7103182208000001,
      "times": [
        0.6697105848,
        0.6781658908,
        0.6440765078,
        0.6721517708,
        0.7103182208000001,
        0.6675996308000001,
        0.6742044038,
        0.6647913908,
        0.6680193408,
        0.6744595308
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.7046748844,
      "stddev": 0.06825381873000795,
      "median": 0.6884060548,
      "user": 0.40558313999999995,
      "system": 1.36862638,
      "min": 0.6549731308,
      "max": 0.8937890858,
      "times": [
        0.6549731308,
        0.6933125768,
        0.7030107738,
        0.6735930838,
        0.6902283788,
        0.6865837308,
        0.6770123068,
        0.6687176698,
        0.8937890858,
        0.7055281068
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.7244423001,
      "stddev": 0.0690434105866577,
      "median": 0.7045986978000001,
      "user": 0.39756944,
      "system": 1.36507868,
      "min": 0.6680657788000001,
      "max": 0.9131719538,
      "times": [
        0.6880960048,
        0.7216603118,
        0.6680657788000001,
        0.6891420548,
        0.7020287668,
        0.6985082738,
        0.7071686288,
        0.9131719538,
        0.7320255608,
        0.7245556668
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.7472431011,
      "stddev": 0.06798907199527894,
      "median": 0.7312968808,
      "user": 0.40056304000000004,
      "system": 1.38124168,
      "min": 0.6916469738000001,
      "max": 0.9327068098,
      "times": [
        0.7555105188,
        0.7295341398,
        0.7481722688,
        0.6916469738000001,
        0.7296403238,
        0.7329534378,
        0.9327068098,
        0.7360810978,
        0.7118304018,
        0.7043550388
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 4.388 ± 0.045 4.298 4.458 2.00 ± 0.09
pacquet@main 4.392 ± 0.038 4.350 4.478 2.00 ± 0.09
pnpr@HEAD 2.195 ± 0.120 2.082 2.480 1.00 ± 0.07
pnpr@main 2.192 ± 0.091 2.098 2.346 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 4.38846699758,
      "stddev": 0.04479302025830293,
      "median": 4.3922741595799994,
      "user": 3.90114304,
      "system": 3.4972896999999996,
      "min": 4.29821982658,
      "max": 4.45765165958,
      "times": [
        4.409727913579999,
        4.37051583658,
        4.358070479579999,
        4.3816347235799995,
        4.45765165958,
        4.42656575158,
        4.36037147258,
        4.41899871658,
        4.402913595579999,
        4.29821982658
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 4.391910082979999,
      "stddev": 0.037664513924649305,
      "median": 4.3888359350799995,
      "user": 3.90604294,
      "system": 3.4917216999999994,
      "min": 4.34980557158,
      "max": 4.47809440958,
      "times": [
        4.40012278858,
        4.39963355258,
        4.35697653858,
        4.36136860358,
        4.34980557158,
        4.47809440958,
        4.41502574258,
        4.40664376558,
        4.37803831758,
        4.37339153958
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 2.19506536558,
      "stddev": 0.11955804210857522,
      "median": 2.1610784800800005,
      "user": 2.55311284,
      "system": 3.0049611,
      "min": 2.08199975058,
      "max": 2.48049156858,
      "times": [
        2.48049156858,
        2.1745479065800004,
        2.14760905358,
        2.09246096358,
        2.13270502258,
        2.2961247425800004,
        2.2136689635800004,
        2.2155279515800004,
        2.1155177325800003,
        2.08199975058
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 2.1923739495800003,
      "stddev": 0.09111035783574634,
      "median": 2.15937339358,
      "user": 2.5574149399999997,
      "system": 3.0008282,
      "min": 2.0978194465800004,
      "max": 2.34553660158,
      "times": [
        2.1640699215800003,
        2.34553660158,
        2.12480237258,
        2.33674134558,
        2.1546768655800004,
        2.0978194465800004,
        2.12352237158,
        2.11142543358,
        2.22375745158,
        2.2413876855800003
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 1.425 ± 0.048 1.354 1.480 2.17 ± 0.08
pacquet@main 1.399 ± 0.093 1.351 1.661 2.13 ± 0.14
pnpr@HEAD 0.673 ± 0.032 0.639 0.753 1.03 ± 0.05
pnpr@main 0.656 ± 0.007 0.645 0.667 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 1.4252668316600001,
      "stddev": 0.04841898410554801,
      "median": 1.44575026216,
      "user": 1.39488878,
      "system": 1.7142824599999997,
      "min": 1.3542490416600002,
      "max": 1.48025806866,
      "times": [
        1.44116106566,
        1.45848323366,
        1.47750295166,
        1.48025806866,
        1.45033945866,
        1.4545796536600002,
        1.40361100866,
        1.3696121836600001,
        1.36287165066,
        1.3542490416600002
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 1.39867819426,
      "stddev": 0.09300192924459157,
      "median": 1.37175648266,
      "user": 1.31509078,
      "system": 1.7172216599999999,
      "min": 1.35107930466,
      "max": 1.6609077546600002,
      "times": [
        1.6609077546600002,
        1.37939692466,
        1.3637181626600001,
        1.38063116766,
        1.35510240866,
        1.36149394466,
        1.37999790066,
        1.3903383336600001,
        1.3641160406600001,
        1.35107930466
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.6731732724599999,
      "stddev": 0.03185814427933291,
      "median": 0.6647423476600001,
      "user": 0.34326927999999995,
      "system": 1.30797026,
      "min": 0.63884245166,
      "max": 0.75258467566,
      "times": [
        0.65977825166,
        0.64457500166,
        0.63884245166,
        0.75258467566,
        0.68021040666,
        0.66018167966,
        0.67653192566,
        0.68954363666,
        0.66222488666,
        0.66725980866
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.6558593448600002,
      "stddev": 0.0068601260770161055,
      "median": 0.65694494466,
      "user": 0.34373098,
      "system": 1.2806022600000002,
      "min": 0.64511853866,
      "max": 0.6667789106600001,
      "times": [
        0.65023064466,
        0.65899159366,
        0.65524565566,
        0.6667789106600001,
        0.65859189866,
        0.66146605066,
        0.64650359566,
        0.66036856966,
        0.65529799066,
        0.64511853866
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 3.030 ± 0.036 2.986 3.113 4.52 ± 0.09
pacquet@main 3.014 ± 0.024 2.957 3.050 4.49 ± 0.08
pnpr@HEAD 0.671 ± 0.011 0.660 0.686 1.00
pnpr@main 0.681 ± 0.062 0.653 0.856 1.01 ± 0.09
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 3.030068232,
      "stddev": 0.03553619358633245,
      "median": 3.0207852626999996,
      "user": 1.7542870599999998,
      "system": 1.9824057,
      "min": 2.9858841782,
      "max": 3.1130538322,
      "times": [
        3.0457687482,
        3.0189617392,
        3.0054181112,
        3.0128844982,
        2.9858841782,
        3.0226087861999997,
        3.0312259652,
        3.1130538322,
        3.0567853252,
        3.0080911362
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 3.0135685232,
      "stddev": 0.024030396990877924,
      "median": 3.0150343522,
      "user": 1.74874376,
      "system": 1.9891795,
      "min": 2.9570245242,
      "max": 3.0500008942,
      "times": [
        3.0033083702,
        3.0142200241999997,
        3.0108992251999998,
        3.0158486802,
        3.0324963892,
        3.0250502621999997,
        2.9570245242,
        3.0500008942,
        3.0077421922,
        3.0190946702
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.6709275282,
      "stddev": 0.01063342069487255,
      "median": 0.6681080132000001,
      "user": 0.33675266,
      "system": 1.3186012,
      "min": 0.6597616712000001,
      "max": 0.6864913732000001,
      "times": [
        0.6666444852000001,
        0.6844596382,
        0.6718546432,
        0.6623662482,
        0.6614847562,
        0.6849961352,
        0.6695715412000001,
        0.6597616712000001,
        0.6864913732000001,
        0.6616447902
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.6806139581999999,
      "stddev": 0.061757399917277266,
      "median": 0.6615854047,
      "user": 0.33614436,
      "system": 1.2986970000000002,
      "min": 0.6532251052,
      "max": 0.8555801152,
      "times": [
        0.6626190812,
        0.6581482612,
        0.6532251052,
        0.6700629522,
        0.6558846372,
        0.6706200962000001,
        0.6554853532,
        0.6605517282000001,
        0.8555801152,
        0.6639622522
      ]
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 633.2 ± 7.5 616.7 642.9 5.87 ± 0.08
pacquet@main 637.7 ± 4.9 630.6 645.4 5.91 ± 0.06
pnpr@HEAD 108.0 ± 0.6 106.8 109.2 1.00 ± 0.01
pnpr@main 107.9 ± 0.8 105.7 109.2 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.63319066302,
      "stddev": 0.007525829422810574,
      "median": 0.6346917167200001,
      "user": 0.60565198,
      "system": 0.14956527999999997,
      "min": 0.61667126672,
      "max": 0.6428844187200001,
      "times": [
        0.6388820147200001,
        0.6375890927200001,
        0.61667126672,
        0.63833659872,
        0.63563457172,
        0.6321638057200001,
        0.62669433472,
        0.6337488617200001,
        0.6428844187200001,
        0.62930166472
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.63770684932,
      "stddev": 0.004887651381875211,
      "median": 0.6378294607200001,
      "user": 0.60398768,
      "system": 0.15331457999999995,
      "min": 0.6305669327200001,
      "max": 0.6453702497200001,
      "times": [
        0.6376692557200001,
        0.6352923997200001,
        0.63973506272,
        0.6335096117200001,
        0.6320475997200001,
        0.6305669327200001,
        0.63798966572,
        0.6430558577200001,
        0.6453702497200001,
        0.6418318577200001
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.10804543416000004,
      "stddev": 0.0006026201434806083,
      "median": 0.10812883572,
      "user": 0.027852299999999993,
      "system": 0.018211299999999996,
      "min": 0.10683578372000001,
      "max": 0.10915676772,
      "times": [
        0.10769829672,
        0.10860143372,
        0.10812883572,
        0.10833960372,
        0.10891999472,
        0.10683887872,
        0.10797531972,
        0.10774521572000001,
        0.10808754272,
        0.10872126972,
        0.10742523572,
        0.10833833072,
        0.10729222472000001,
        0.10747328672,
        0.10837512072000001,
        0.10830314472000001,
        0.10798599072000001,
        0.10826507772,
        0.10768187872,
        0.10821247372000001,
        0.10758146772,
        0.10826900172000001,
        0.10888367772,
        0.10683578372000001,
        0.10915676772
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.10786478702769231,
      "stddev": 0.0007737446821743585,
      "median": 0.10801179522000001,
      "user": 0.026564941538461537,
      "system": 0.019509603076923072,
      "min": 0.10574595572,
      "max": 0.10923639872,
      "times": [
        0.10622177372000001,
        0.10771748872,
        0.10846363972,
        0.10778957572,
        0.10864119372,
        0.10923639872,
        0.10574595572,
        0.10788538672,
        0.10828828772,
        0.10805815272000001,
        0.10802555172,
        0.10736964272,
        0.10849397172,
        0.10777883572000001,
        0.10816787972,
        0.10824000672,
        0.10799803872000001,
        0.10730319672000001,
        0.10838941872,
        0.10759142172,
        0.10894945572,
        0.10726522972000001,
        0.10680018572000001,
        0.10829445872,
        0.10753393272,
        0.10823538272000001
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 6.832 ± 0.072 6.721 6.916 1.38 ± 0.04
pacquet@main 6.981 ± 0.169 6.711 7.264 1.41 ± 0.05
pnpr@HEAD 4.965 ± 0.131 4.829 5.227 1.00
pnpr@main 4.983 ± 0.085 4.871 5.162 1.00 ± 0.03
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 6.83185325578,
      "stddev": 0.0718941589348632,
      "median": 6.84896079008,
      "user": 4.027806399999999,
      "system": 3.8110504999999995,
      "min": 6.7206434795800005,
      "max": 6.91602905458,
      "times": [
        6.8882482755800005,
        6.88524065258,
        6.77054160458,
        6.75695239058,
        6.87192433858,
        6.7206434795800005,
        6.7713327885800005,
        6.9116227315800005,
        6.91602905458,
        6.82599724158
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 6.98063391068,
      "stddev": 0.168985244668443,
      "median": 6.96460462558,
      "user": 4.0369771,
      "system": 3.8077468999999993,
      "min": 6.71068867658,
      "max": 7.2642619255800005,
      "times": [
        6.84590428958,
        7.18624029658,
        6.83935136858,
        6.98629935058,
        7.2642619255800005,
        6.95301317958,
        6.92463896058,
        6.71068867658,
        7.11974498758,
        6.97619607158
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 4.96530127208,
      "stddev": 0.13099339509185307,
      "median": 4.93426205508,
      "user": 2.7861531,
      "system": 3.251330199999999,
      "min": 4.82863586958,
      "max": 5.22680594058,
      "times": [
        5.22680594058,
        5.03683972658,
        4.83533285458,
        4.90800255258,
        4.95343109558,
        4.99435977458,
        4.91509301458,
        5.11561530358,
        4.83889658858,
        4.82863586958
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 4.98331358948,
      "stddev": 0.08457220128803022,
      "median": 4.98104068258,
      "user": 2.7623588999999997,
      "system": 3.257930199999999,
      "min": 4.87149388858,
      "max": 5.16201180758,
      "times": [
        5.04985426958,
        4.92272505958,
        5.0006384635800005,
        5.00009245258,
        5.16201180758,
        4.93513419458,
        4.90223420258,
        5.02696264358,
        4.96198891258,
        4.87149388858
      ]
    }
  ]
}

@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

Branchpr/12844
Testbedpacquet
Click to view all benchmark results
BenchmarkLatencyBenchmark Result
milliseconds (ms)
(Result Δ%)
Upper Boundary
milliseconds (ms)
(Limit %)
isolated-linker.fresh-install.cold-cache.cold-store📈 view plot
🚷 view threshold
4,388.47 ms
(+3.83%)Baseline: 4,226.41 ms
5,071.69 ms
(86.53%)
isolated-linker.fresh-install.cold-cache.hot-store📈 view plot
🚷 view threshold
3,030.07 ms
(+0.50%)Baseline: 3,014.96 ms
3,617.96 ms
(83.75%)
isolated-linker.fresh-install.hot-cache.hot-store📈 view plot
🚷 view threshold
1,425.27 ms
(+6.67%)Baseline: 1,336.10 ms
1,603.32 ms
(88.89%)
isolated-linker.fresh-resolve.hot-cache.offline📈 view plot
🚷 view threshold
633.19 ms
(-0.07%)Baseline: 633.64 ms
760.37 ms
(83.27%)
isolated-linker.fresh-restore.cold-cache.cold-store📈 view plot
🚷 view threshold
4,108.74 ms
(+3.27%)Baseline: 3,978.68 ms
4,774.41 ms
(86.06%)
isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr📈 view plot
🚷 view threshold
6,831.85 ms
(+0.21%)Baseline: 6,817.85 ms
8,181.42 ms
(83.50%)
isolated-linker.fresh-restore.hot-cache.hot-store📈 view plot
🚷 view threshold
672.35 ms
(+6.41%)Baseline: 631.84 ms
758.21 ms
(88.68%)
🐰 View full continuous benchmarking report in Bencher

@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

Branchpr/12844
Testbedpnpr

⚠️ 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-thresholds flag.

Click to view all benchmark results
BenchmarkLatencymilliseconds (ms)
isolated-linker.fresh-install.cold-cache.cold-store📈 view plot
⚠️ NO THRESHOLD
2,195.07 ms
isolated-linker.fresh-install.cold-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
670.93 ms
isolated-linker.fresh-install.hot-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
673.17 ms
isolated-linker.fresh-resolve.hot-cache.offline📈 view plot
⚠️ NO THRESHOLD
108.05 ms
isolated-linker.fresh-restore.cold-cache.cold-store📈 view plot
⚠️ NO THRESHOLD
2,184.00 ms
isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr📈 view plot
⚠️ NO THRESHOLD
4,965.30 ms
isolated-linker.fresh-restore.hot-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
724.44 ms
🐰 View full continuous benchmarking report in Bencher

@zkochan
zkochan merged commit be8e8ea into main Jul 7, 2026
36 checks passed
@zkochan
zkochan deleted the feat/napi-link-workspace-packages branch July 7, 2026 17:30
zkochan added a commit to zkochan/bit that referenced this pull request Jul 7, 2026
…deep'

- @pnpm/napi 12.0.0-alpha.3 -> 12.0.0-alpha.4, which adds the
  linkWorkspacePackages install option (pnpm/pnpm#12844).
- lynx.ts sets linkWorkspacePackages: 'deep' so bare-semver deps on workspace
  components — including auto-installed peers that name a sibling component —
  resolve from the workspace instead of 404ing against the registry. Fixes the
  peer-dependency-component e2e failures.
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 reviewed: qodo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants