From 9c51737b95714e857d270f3db5d83e5957a500ea Mon Sep 17 00:00:00 2001 From: maxwellium <896080+maxwellium@users.noreply.github.com> Date: Thu, 30 Jun 2022 13:10:16 +0200 Subject: [PATCH] fix filter-prod flag including all workspace pkgs https://github.com/pnpm/pnpm/commit/f48d46ef6fc0b9922403b9c1d85854d7062a52c3 appears to have surfaced a regression where the exclusion filter for workspace root broke was inserted without followProdDepsOnly. i guess we didn't notice earlier because filterProd together with workspaceRoot is an edge-case ;) --- packages/pnpm/src/main.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/pnpm/src/main.ts b/packages/pnpm/src/main.ts index 6ac4df790f9..428125abffe 100644 --- a/packages/pnpm/src/main.ts +++ b/packages/pnpm/src/main.ts @@ -196,9 +196,9 @@ export default async function run (inputArgv: string[]) { ] const relativeWSDirPath = () => path.relative(process.cwd(), wsDir) || '.' if (config.workspaceRoot) { - filters.push({ filter: `{${relativeWSDirPath()}}`, followProdDepsOnly: false }) + filters.push({ filter: `{${relativeWSDirPath()}}`, followProdDepsOnly: Boolean(config.filterProd.length) }) } else if (!config.includeWorkspaceRoot && (cmd === 'run' || cmd === 'exec' || cmd === 'add' || cmd === 'test')) { - filters.push({ filter: `!{${relativeWSDirPath()}}`, followProdDepsOnly: false }) + filters.push({ filter: `!{${relativeWSDirPath()}}`, followProdDepsOnly: Boolean(config.filterProd.length) }) } const filterResults = await filterPackages(allProjects, filters, {