From 14a4ef4e936f4491ded9098a10a8fcaba9a747ff Mon Sep 17 00:00:00 2001 From: Adam Wootton Date: Wed, 6 Sep 2023 15:13:11 -0400 Subject: [PATCH] fix(js): workspace lib devDependencies should not be added to package.json (#17802) (cherry picked from commit 9ba98f4b25b8cb5263ab4cb45539028471988a03) --- packages/js/src/utils/package-json/update-package-json.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/js/src/utils/package-json/update-package-json.ts b/packages/js/src/utils/package-json/update-package-json.ts index a516cef36d456..bf87cdfff1286 100644 --- a/packages/js/src/utils/package-json/update-package-json.ts +++ b/packages/js/src/utils/package-json/update-package-json.ts @@ -144,8 +144,13 @@ function addMissingDependencies( packageJson[propType][packageName] = version; } else { const packageName = entry.name; + if (!!workspacePackageJson.devDependencies?.[packageName]) { + return; + } + if ( !packageJson.dependencies?.[packageName] && + !packageJson.devDependencies?.[packageName] && !packageJson.peerDependencies?.[packageName] ) { const outputs = getOutputsForTargetAndConfiguration(