feat!: stop reading settings from the pnpm field of package.json#10086
Merged
feat!: stop reading settings from the pnpm field of package.json#10086
Conversation
c1be855 to
f56452a
Compare
b8c9c88 to
cd95e0a
Compare
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>
bbfb27c to
6d91b4f
Compare
- 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>
Contributor
There was a problem hiding this comment.
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.pnpmsupport and stop deriving install options from rootpackage.jsonviagetOptionsFromRootManifest(). - 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 ofpackage.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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Settings should be read from
pnpm-workspace.yaml