Skip to content

Scope linker-specific settings under the nodeLinker object #72

Closed
pnpm/pnpm
#18149

Description

@zkochan

Problem

Linker-specific settings currently share the top-level namespace. Hoisting options can be mistaken for settings for the hoisted linker even when they primarily control the isolated layout. Group the selector and applicable options under nodeLinker.

Agreed direction

Retain scalar shorthand such as nodeLinker: isolated. Add object forms that validate options for the selected type:

nodeLinker:
  type: isolated
  hoist:
    public: []
    private: ["*"]

Public patterns take precedence when both lists match. Negations apply within each list. Packages matching neither list are not hoisted. Defaults remain public [] and private ["*"]. hoist: false disables both. Do not use an order-dependent map from patterns to destinations.

nodeLinker:
  type: hoisted
  hoistingLimits: workspaces

The immediate loader work uses:

nodeLinker:
  type: loaded
  excluded:
    - vitest

Excluded packages and their complete dependency trees are installed as normal isolated packages in the global virtual store. This does not establish a general system for arbitrary mixtures of linkers.

Future work

  • Inventory actual setting consumers before assigning scopes. hoistWorkspacePackages affects the hoisted linker too, and its workspace handling reads the current hoist patterns. Preserve these capabilities deliberately.
  • Keep settings shared by multiple linkers, such as virtual-store location/type, outside linker-specific options unless a separate design establishes a better home.
  • Preserve existing flat settings as compatibility aliases. Normalize aliases per configuration source before merging, retain source precedence, and specify conflicts between flat and object forms.
  • Define object merging, explicit empty lists, false/null/reset behavior, CLI/environment forms, config get/set output, and pnpmfile hook round trips.
  • Update validation, schema, documentation, and installation-state invalidation together. Provide a configuration migration command before retiring old spellings, including shamefullyHoist.
  • Implement and test this feature in pnpm v12 only.

Scope boundary

Only the object form for the loaded linker is being implemented now in pnpm/pnpm#16482. The broader hoisting/linker-settings refactor described here is future work. Related loader task: #64.


Written by an agent (Codex, GPT-6).

Activity

  1. zkochan commented on Oct 5, 2026

    @zkochan
    MemberAuthor

    Task 72 has been removed from pnpm/pnpm#16613 at the maintainer's request. That PR does not implement or close this task.


    Written by an agent (Codex, GPT-6).

  2. added a commit that references this issue on Nov 21, 2026
    cba2a29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions