From 4e3b99ae0e754f2085cee6a06cc5a765fc199b0b Mon Sep 17 00:00:00 2001 From: Zoltan Kochan Date: Wed, 23 Feb 2022 01:54:55 +0200 Subject: [PATCH] fix: onlyBuiltDependencies should work (#4377) --- .changeset/smooth-singers-smell.md | 7 +++++++ packages/core/src/install/extendInstallOptions.ts | 3 +-- .../src/getOptionsFromRootManifest.ts | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 .changeset/smooth-singers-smell.md diff --git a/.changeset/smooth-singers-smell.md b/.changeset/smooth-singers-smell.md new file mode 100644 index 0000000000..fa25230bba --- /dev/null +++ b/.changeset/smooth-singers-smell.md @@ -0,0 +1,7 @@ +--- +"@pnpm/core": patch +"@pnpm/plugin-commands-installation": patch +"pnpm": patch +--- + +`onlyBuiltDependencies` should work. diff --git a/packages/core/src/install/extendInstallOptions.ts b/packages/core/src/install/extendInstallOptions.ts index c3b6af0bb8..af828a6735 100644 --- a/packages/core/src/install/extendInstallOptions.ts +++ b/packages/core/src/install/extendInstallOptions.ts @@ -49,7 +49,7 @@ export interface StrictInstallOptions { rawConfig: object verifyStoreIntegrity: boolean engineStrict: boolean - neverBuiltDependencies: string[] + neverBuiltDependencies?: string[] onlyBuiltDependencies?: string[] nodeExecPath?: string nodeLinker?: 'isolated' | 'hoisted' | 'pnp' @@ -133,7 +133,6 @@ const defaults = async (opts: InstallOptions) => { }, lockfileDir: opts.lockfileDir ?? opts.dir ?? process.cwd(), lockfileOnly: false, - neverBuiltDependencies: [] as string[], nodeVersion: process.version, nodeLinker: 'isolated', overrides: {}, diff --git a/packages/plugin-commands-installation/src/getOptionsFromRootManifest.ts b/packages/plugin-commands-installation/src/getOptionsFromRootManifest.ts index b1c2574513..24f7b38d99 100644 --- a/packages/plugin-commands-installation/src/getOptionsFromRootManifest.ts +++ b/packages/plugin-commands-installation/src/getOptionsFromRootManifest.ts @@ -15,7 +15,7 @@ export default function getOptionsFromRootManifest (manifest: ProjectManifest): // but we really replace the version specs to any other version spec, not only to exact versions, // so we cannot call it resolutions const overrides = manifest.pnpm?.overrides ?? manifest.resolutions - const neverBuiltDependencies = manifest.pnpm?.neverBuiltDependencies ?? [] + const neverBuiltDependencies = manifest.pnpm?.neverBuiltDependencies const onlyBuiltDependencies = manifest.pnpm?.onlyBuiltDependencies const packageExtensions = manifest.pnpm?.packageExtensions const peerDependencyRules = manifest.pnpm?.peerDependencyRules