Skip to content

feat!: stop reading settings from the pnpm field of package.json#10086

Merged
zkochan merged 21 commits intomainfrom
deprecate-pnpm-in-package.json
Mar 18, 2026
Merged

feat!: stop reading settings from the pnpm field of package.json#10086
zkochan merged 21 commits intomainfrom
deprecate-pnpm-in-package.json

Conversation

@zkochan
Copy link
Copy Markdown
Member

@zkochan zkochan commented Oct 13, 2025

Settings should be read from pnpm-workspace.yaml

@zkochan zkochan added this to the v11.0 milestone Oct 14, 2025
@zkochan zkochan changed the base branch from v11 to main November 9, 2025 22:54
@zkochan zkochan force-pushed the deprecate-pnpm-in-package.json branch from c1be855 to f56452a Compare November 13, 2025 11:06
@zkochan zkochan force-pushed the deprecate-pnpm-in-package.json branch from b8c9c88 to cd95e0a Compare March 18, 2026 00:51
zkochan and others added 10 commits March 18, 2026 01:54
Settings should be read from pnpm-workspace.yaml
…tManifest

- Remove pnpm field references from deploy, exportable-manifest, global commands
- Fix rootProjectManifest type in globalAdd/globalUpdate to accept unknown
- Add packageExtensions to install command options (previously from root manifest)
- Use writeYamlFileSync in tests instead of async writeYamlFile
- Move pnpm settings from package.json to pnpm-workspace.yaml in tests

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@zkochan zkochan force-pushed the deprecate-pnpm-in-package.json branch from bbfb27c to 6d91b4f Compare March 18, 2026 00:55
zkochan and others added 10 commits March 18, 2026 01:56
- Remove unused imports (preparePackages, ProjectManifest, createProjectManifestWriter)
- Use top-level type imports instead of inline type specifiers
- Remove unused rootDir destructuring in checkDepsStatus
- Fix import sorting in createDeployFiles

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The test needs builds to be allowed during the initial install so that
the rebuild step can test neverBuiltDependencies filtering.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This test was testing the old pnpm field API. The neverBuiltDependencies
setting is superseded by allowBuilds in pnpm-workspace.yaml.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…st assertion

- Set packageExtensions: undefined in deploy's frozen install (effects are
  already baked into the lockfile snapshots, matching overrides/pnpmfile)
- Fix patchedDependencies YAML assertion to match unquoted output format

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The patch-remove handler needs rootProjectManifestDir to locate the
workspace manifest for writing. DEFAULT_OPTS has it as empty string.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Since the pnpm field is removed from ProjectManifest, warnings about
pnpm.overrides in non-root packages are no longer emitted. Only the
resolutions field warning remains.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Move overrides to root pnpm-workspace.yaml in non-shared lockfile test
  (per-project pnpm-workspace.yaml is not supported; the original test
  used package.json pnpm field which is now removed)
- Remove expected pnpm.overrides warnings in non-root project test
  (pnpm field no longer exists on ProjectManifest)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add 'overrides' to PROJECT_CONFIG_FIELDS so workspaces with
sharedWorkspaceLockfile=false can specify per-project overrides
in pnpm-workspace.yaml's packageConfigs section.

Example:
  packageConfigs:
    my-project:
      overrides:
        is-odd: 1.0.0

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@zkochan zkochan marked this pull request as ready for review March 18, 2026 12:18
Copilot AI review requested due to automatic review settings March 18, 2026 12:18
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR migrates pnpm configuration away from the pnpm field in package.json and toward workspace-level configuration (primarily pnpm-workspace.yaml), updating core types, config reading/writing, deploy behavior, and a large set of tests to reflect the new configuration model.

Changes:

  • Remove ProjectManifest.pnpm support and stop deriving install options from root package.json via getOptionsFromRootManifest().
  • Update config writing to persist settings to the workspace manifest, and adjust commands (e.g. deploy/unlink) to use the new settings flow.
  • Refresh tests/fixtures to express overrides, patchedDependencies, allowBuilds, etc. via pnpm-workspace.yaml / CLI options instead of package.json.

Reviewed changes

Copilot reviewed 47 out of 49 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
workspace/projects-reader/test/index.ts Updates warning expectations after removing non-root pnpm.* warnings.
workspace/projects-reader/src/index.ts Stops warning about pnpm.* fields in non-root workspace package manifests.
releasing/exportable-manifest/test/index.test.ts Updates exportable manifest test to focus on scripts/packageManager handling.
releasing/exportable-manifest/src/index.ts Changes which fields are omitted when producing an exportable manifest.
releasing/commands/test/deploy/shared-lockfile.test.ts Adapts deploy tests to new settings sources (overrides/packageExtensions/patchedDependencies).
releasing/commands/src/deploy/deploy.ts Passes patchedDependencies into deploy file generation and disables packageExtensions during deploy install.
releasing/commands/src/deploy/createDeployFiles.ts Moves patchedDependencies emission to workspace manifest generation for deploy.
pnpm/test/recursive/rebuild.ts Writes workspace manifest in test setup (YAML) for rebuild scenario.
pnpm/test/recursive/filter.ts Moves overrides config from package.json to pnpm-workspace.yaml in tests.
pnpm/test/monorepo/index.ts Moves per-project overrides into packageConfigs in workspace manifest.
pnpm/test/install/lifecycleScripts.ts Switches workspace manifest writes to sync API; moves allowBuilds config into YAML.
pnpm/test/install/global.ts Moves allowBuilds config for global tests into workspace manifest YAML.
pnpm/test/hooks.ts Moves configDependencies from package.json to pnpm-workspace.yaml.
pnpm/test/dlx.ts Updates dlx config-ignoring test to use workspace manifest rather than package.json.
pnpm-lock.yaml Updates lockfile to reflect dependency graph changes (removals).
patching/commands/test/patch.test.ts Adjusts patch/patch-remove tests for workspace-manifest-based patchedDependencies.
installing/deps-installer/test/install/validatePeerDependencies.ts Removes redundant manifest pnpm.overrides usage in tests.
installing/deps-installer/test/install/overrides.ts Moves overrides source in test to options instead of manifest.
installing/commands/test/update/issue-7415.ts Moves git override into handler options.
installing/commands/test/patchedDependencies.ts Refactors patchedDependencies tests to write workspace YAML and pass settings explicitly.
installing/commands/test/install.ts Moves supportedArchitectures config from manifest to handler options.
installing/commands/test/add.ts Moves supportedArchitectures config from manifest to handler options.
installing/commands/src/unlink.ts Writes overrides via config writer (workspace manifest) instead of editing package.json.
installing/commands/src/remove.ts Stops merging options from root manifest via getOptionsFromRootManifest().
installing/commands/src/recursive.ts Stops reading updateConfig from manifest pnpm field; uses config options.
installing/commands/src/installDeps.ts Removes getOptionsFromRootManifest() merging and extends options to include packageExtensions.
installing/commands/src/install.ts Extends command option typing to include packageExtensions.
installing/commands/src/import/index.ts Removes root-manifest-derived options merge during import.
installing/commands/src/getFetchFullMetadata.ts Drops fallback to manifest settings; uses supportedArchitectures options only.
installing/commands/src/fetch.ts Removes root-manifest-derived options merge during fetch.
installing/commands/src/add.ts Uses opts.allowBuilds rather than manifest pnpm allowBuilds for conflict detection.
global/commands/src/installGlobalPackages.ts Removes root-manifest-derived options merge for global installs.
global/commands/src/globalUpdate.ts Removes manifest fallback in fetchFullMetadata and loosens rootProjectManifest typing.
global/commands/src/globalAdd.ts Removes manifest fallback in fetchFullMetadata and loosens rootProjectManifest typing.
engine/pm/commands/src/self-updater/installPnpm.ts Removes manifest fallback in fetchFullMetadata.
deps/status/src/checkDepsStatus.ts Shifts workspace-state comparisons to use config options directly (patchedDependencies/overrides/etc).
deps/compliance/commands/src/licenses/licensesList.ts Uses supportedArchitectures from options rather than root-manifest-derived options.
core/types/src/package.ts Removes pnpm?: PnpmSettings from ProjectManifest type.
config/writer/tsconfig.json Removes project-manifest-reader dependency from TS references.
config/writer/src/index.ts Simplifies writeSettings to only update workspace manifest.
config/writer/package.json Removes unused deps (project-manifest-reader/ramda) after writer refactor.
config/reader/test/getOptionsFromRootManifest.test.ts Removes tests for deleted getOptionsFromRootManifest; focuses on getOptionsFromPnpmSettings.
config/reader/src/projectConfig.ts Adds validation for overrides in project-specific config.
config/reader/src/index.ts Stops applying getOptionsFromRootManifest() to config object.
config/reader/src/getOptionsFromRootManifest.ts Removes getOptionsFromRootManifest implementation; keeps getOptionsFromPnpmSettings.
config/reader/src/Config.ts Adds overrides to project-configurable fields.
building/commands/test/build/index.ts Minor test file trailing whitespace/newline change.
building/after-install/src/extendBuildOptions.ts Removes getOptionsFromRootManifest merge in build option extension.
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

- Defensively omit 'pnpm' field from published manifests even though
  it's removed from the type (existing projects may still have it)
- Fix test title to accurately describe prepublish script removal
- Stat patch files using absolute paths directly instead of
  path.relative which breaks when cwd differs from rootDir

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@zkochan zkochan merged commit 303ca41 into main Mar 18, 2026
11 of 12 checks passed
@zkochan zkochan deleted the deprecate-pnpm-in-package.json branch March 18, 2026 13:46
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.

2 participants