diff --git a/cli/common-cli-options-help/src/index.ts b/cli/common-cli-options-help/src/index.ts index 0c54d5fe618..ab5d6fa2dba 100644 --- a/cli/common-cli-options-help/src/index.ts +++ b/cli/common-cli-options-help/src/index.ts @@ -7,6 +7,10 @@ export const OPTIONS = { description: "Don't run lifecycle scripts", name: '--ignore-scripts', }, + ignoreWorkspace: { + description: 'Ignore pnpm-workspace.yaml if exists in the parent directory, and treat the command as normal non-workspace command.', + name: '--ignore-workspace', + }, offline: { description: 'Trigger an error if any required dependencies are not available in local store', name: '--offline', diff --git a/pkg-manager/plugin-commands-installation/src/add.ts b/pkg-manager/plugin-commands-installation/src/add.ts index 17aef3d2796..3371997d4e1 100644 --- a/pkg-manager/plugin-commands-installation/src/add.ts +++ b/pkg-manager/plugin-commands-installation/src/add.ts @@ -136,6 +136,7 @@ For options that may be used with `-r`, see "pnpm help recursive"', name: '--workspace', }, OPTIONS.ignoreScripts, + OPTIONS.ignoreWorkspace, OPTIONS.offline, OPTIONS.preferOffline, OPTIONS.storeDir, diff --git a/pkg-manager/plugin-commands-installation/src/dedupe.ts b/pkg-manager/plugin-commands-installation/src/dedupe.ts index 4de364b57ff..d9338e5b1ba 100644 --- a/pkg-manager/plugin-commands-installation/src/dedupe.ts +++ b/pkg-manager/plugin-commands-installation/src/dedupe.ts @@ -34,6 +34,7 @@ export function help () { name: '--check', }, OPTIONS.ignoreScripts, + OPTIONS.ignoreWorkspace, OPTIONS.offline, OPTIONS.preferOffline, OPTIONS.storeDir, diff --git a/pkg-manager/plugin-commands-installation/src/install.ts b/pkg-manager/plugin-commands-installation/src/install.ts index e2395af380a..5f99d1936fd 100644 --- a/pkg-manager/plugin-commands-installation/src/install.ts +++ b/pkg-manager/plugin-commands-installation/src/install.ts @@ -183,10 +183,7 @@ by any dependencies, so it is an emulation of a flat node_modules', description: 'Disable pnpm hooks defined in .pnpmfile.cjs', name: '--ignore-pnpmfile', }, - { - description: 'Ignore pnpm-workspace.yaml if exists in the parent directory, and treat the installation as normal non-workspace installation.', - name: '--ignore-workspace', - }, + OPTIONS.ignoreWorkspace, { description: "If false, doesn't check whether packages in the store were mutated", name: '--[no-]verify-store-integrity', diff --git a/pkg-manager/plugin-commands-installation/src/remove.ts b/pkg-manager/plugin-commands-installation/src/remove.ts index b506c13f60d..01a424e8606 100644 --- a/pkg-manager/plugin-commands-installation/src/remove.ts +++ b/pkg-manager/plugin-commands-installation/src/remove.ts @@ -104,6 +104,7 @@ For options that may be used with `-r`, see "pnpm help recursive"', name: '--save-prod', shortAlias: '-P', }, + OPTIONS.ignoreWorkspace, OPTIONS.globalDir, ...UNIVERSAL_OPTIONS, ], diff --git a/pkg-manager/plugin-commands-installation/src/update/index.ts b/pkg-manager/plugin-commands-installation/src/update/index.ts index 5669c862c61..5df5a948546 100644 --- a/pkg-manager/plugin-commands-installation/src/update/index.ts +++ b/pkg-manager/plugin-commands-installation/src/update/index.ts @@ -150,6 +150,7 @@ dependencies is not found inside the workspace', name: '--interactive', shortAlias: '-i', }, + OPTIONS.ignoreWorkspace, OPTIONS.globalDir, ...UNIVERSAL_OPTIONS, ],