From b3a6b9ba11a027560738bb37f068958b212d6f39 Mon Sep 17 00:00:00 2001 From: Jack Hsu Date: Thu, 29 Aug 2024 14:20:30 -0400 Subject: [PATCH] fix(core): import to let users know that root deps may need to be imported --- packages/nx/src/command-line/import/import.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/packages/nx/src/command-line/import/import.ts b/packages/nx/src/command-line/import/import.ts index 17c491d537594..26c7514ad8e42 100644 --- a/packages/nx/src/command-line/import/import.ts +++ b/packages/nx/src/command-line/import/import.ts @@ -305,6 +305,18 @@ export async function importHandler(options: ImportOptions) { await warnOnMissingWorkspacesEntry(packageManager, pmc, relativeDestination); + // When only a subdirectory is imported, there might be devDependencies in the root package.json file + // that needs to be ported over as well. + if (ref) { + output.log({ + title: `Check root dependencies`, + bodyLines: [ + `"dependencies" and "devDependencies" are not imported from the source repository (${sourceRemoteUrl}).`, + `You may need to add some of those dependencies to this workspace in order to run tasks successfully.`, + ], + }); + } + output.log({ title: `Merging these changes into ${getBaseRef(nxJson)}`, bodyLines: [