From a5a522e92c75d78621e1b5ff2b2aeef43ccc76da Mon Sep 17 00:00:00 2001 From: Jason Jean Date: Fri, 1 Sep 2023 13:10:21 -0400 Subject: [PATCH] =?UTF-8?q?fix(js):=20properly=20throw=20error=20when=20pr?= =?UTF-8?q?ocessing=20lockfile=20during=20postins=E2=80=A6=20(#18968)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/nx/src/plugins/js/index.ts | 4 ++-- packages/nx/src/plugins/js/lock-file/lock-file.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/nx/src/plugins/js/index.ts b/packages/nx/src/plugins/js/index.ts index e338685e6b43c..5898c83bc1079 100644 --- a/packages/nx/src/plugins/js/index.ts +++ b/packages/nx/src/plugins/js/index.ts @@ -38,7 +38,7 @@ export const createNodes: CreateNodes = [ combineGlobPatterns(LOCKFILES), (lockFile, context) => { const pluginConfig = jsPluginConfig(context.nxJsonConfiguration); - if (!pluginConfig.analyzePackageJson) { + if (!pluginConfig.analyzeLockfile) { return {}; } @@ -83,7 +83,7 @@ export const createDependencies: CreateDependencies = ( let lockfileDependencies: ProjectGraphDependencyWithFile[] = []; // lockfile may not exist yet if ( - pluginConfig.analyzePackageJson && + pluginConfig.analyzeLockfile && lockFileExists(packageManager) && parsedLockFile ) { diff --git a/packages/nx/src/plugins/js/lock-file/lock-file.ts b/packages/nx/src/plugins/js/lock-file/lock-file.ts index 513078ea916f4..f2ec5549ab7ef 100644 --- a/packages/nx/src/plugins/js/lock-file/lock-file.ts +++ b/packages/nx/src/plugins/js/lock-file/lock-file.ts @@ -76,7 +76,7 @@ export function getLockFileNodes( bodyLines: errorBodyLines(e), }); } - return; + throw e; } throw new Error(`Unknown package manager: ${packageManager}`); } @@ -107,7 +107,7 @@ export function getLockFileDependencies( bodyLines: errorBodyLines(e), }); } - return; + throw e; } throw new Error(`Unknown package manager: ${packageManager}`); }