Skip to content

docs: package map is written only under nodeExperimentalPackageMap - #925

Merged
zkochan merged 1 commit into
mainfrom
docs-package-map-gating
Sep 10, 2026
Merged

zkochan merged 1 commit into
mainfrom
docs-package-map-gating

Conversation

@zkochan

@zkochan zkochan commented Sep 10, 2026 •

Copy link
Copy Markdown
Member

node_modules/.package-map.json is currently described as always generated, with nodeExperimentalPackageMap deciding only whether scripts receive it:

The package map is generated during isolated and hoisted installs. This setting only controls whether pnpm passes the generated map to scripts.

pnpm/pnpm#14511 makes generation conditional on the setting in both stacks — nothing reads the file without it, and building it costs every install a pass over the lockfile — and makes an install that stops writing the map remove the one a previous install left. This updates the current and the version-11.x settings pages to match.

Merge this with the release that carries pnpm/pnpm#14511, not before: until then the published docs are correct as they stand.


🤖 Generated with Claude Code

https://claude.ai/code/session_015YZGn6jMwYeMveHf8RHKfU

Summary by CodeRabbit

  • Documentation
    • Clarified that enabling nodeExperimentalPackageMap creates .package-map.json during isolated and hoisted installs.
    • Documented that the package map is injected into pnpm-managed Node.js script environments when the setting is enabled.
    • Clarified that disabling the setting prevents map creation and removes a map generated by an earlier install.

pnpm/pnpm#14511 gates `node_modules/.package-map.json` on the setting in
both stacks: nothing reads the file without it, and building it costs
every install a pass over the lockfile. The settings pages said the
opposite - that the map is always generated and the setting only decides
whether scripts receive it.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_015YZGn6jMwYeMveHf8RHKfU
@bolt-new-by-stackblitz

Copy link
Copy Markdown

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@coderabbitai

coderabbitai Bot commented Sep 10, 2026 •

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: f8dab115-9f4f-4aea-9779-5f524660618f

📥 Commits

Reviewing files that changed from the base of the PR and between 01e39ca and 4be5d30.

📒 Files selected for processing (2)
  • docs/settings/node-modules.md
  • versioned_docs/version-11.x/settings/node-modules.md

Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review.

📜 Recent review details
⏰ Context from checks skipped due to timeout. (2)
  • GitHub Check: Greptile Review
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (1)
docs/settings/node-modules.md (1)

44-46: 🗄️ Data Integrity & Integration

Publish both pages only with the pnpm release that contains pnpm/pnpm#14511.

The pnpm 11.8 release notes describe unconditional map generation. Commit 4be5d304 changes both pages to document setting-gated writes based on pnpm/pnpm#14511. The release containing that change is not identified, so apply the gate to both pages.


📝 Walkthrough

Walkthrough

The documentation now describes package map creation, Node.js injection, and removal for enabled and disabled nodeExperimentalPackageMap settings in current and versioned documentation.

Changes

Package map documentation

Layer / File(s) Summary
Document package map setting behavior
docs/settings/node-modules.md, versioned_docs/version-11.x/settings/node-modules.md
The documentation states that enabled isolated and hoisted installs write .package-map.json and inject it into pnpm-managed Node.js environments. Disabled installs do not write the map and remove a map created by an earlier install.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Merge Risk: ⚪ Minimal · up to 4be5d

The settings pages now describe package-map creation, injection, and removal consistently. This documentation-only change introduces no current-head production risk.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main documentation change: package map generation occurs only when nodeExperimentalPackageMap is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs-package-map-gating

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

A rabbit reads the setting bright
The package map appears just right
Node receives the passing key
Old maps hop away debris-free
Two docs now tell the tale with glee

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

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Document conditional package-map generation

📝 Documentation 🕐 Less than 10 minutes

Grey Divider

AI Description

• Clarifies package maps are generated only when nodeExperimentalPackageMap is enabled.
• Documents stale-map removal in current and version 11.x settings.
High-Level Assessment

Updating both the current and versioned settings pages is the optimal approach because the duplicated documentation must remain consistent with pnpm/pnpm#14511. Broader documentation deduplication would be disproportionate to this focused correction.

Files changed (2) +4 / -4

Documentation (2) +4 / -4
node-modules.mdCorrect current package-map setting behavior +2/-2

Correct current package-map setting behavior

• Clarifies that enabling 'nodeExperimentalPackageMap' controls both package-map creation and script injection. Documents that disabled installs avoid writing the map and remove stale maps from earlier installs.

docs/settings/node-modules.md

node-modules.mdCorrect version 11.x package-map setting behavior +2/-2

Correct version 11.x package-map setting behavior

• Mirrors the package-map generation and stale-file cleanup behavior in the version 11.x settings documentation.

versioned_docs/version-11.x/settings/node-modules.md

@greptile-apps

greptile-apps Bot commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

The documentation change appears safe to merge when coordinated with the pnpm release containing the corresponding implementation.

Reviews (1) · Last reviewed commit: "docs: package map is written only under ..."

@zkochan
zkochan merged commit 5b8a006 into main Sep 10, 2026
6 checks passed
@zkochan
zkochan deleted the docs-package-map-gating branch September 10, 2026 19:26

This branch was previously deployed

1 inactive deployment
deploy — 4be5d304 Deployed Sep 10, 2026 by zkochan via deploy #992
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant