Skip to content

Commit

Permalink
fix(js): properly throw error when processing lockfile during postins… (
Browse files Browse the repository at this point in the history
  • Loading branch information
FrozenPandaz authored Sep 1, 2023
1 parent 8f1429d commit a5a522e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions packages/nx/src/plugins/js/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export const createNodes: CreateNodes = [
combineGlobPatterns(LOCKFILES),
(lockFile, context) => {
const pluginConfig = jsPluginConfig(context.nxJsonConfiguration);
if (!pluginConfig.analyzePackageJson) {
if (!pluginConfig.analyzeLockfile) {
return {};
}

Expand Down Expand Up @@ -83,7 +83,7 @@ export const createDependencies: CreateDependencies = (
let lockfileDependencies: ProjectGraphDependencyWithFile[] = [];
// lockfile may not exist yet
if (
pluginConfig.analyzePackageJson &&
pluginConfig.analyzeLockfile &&
lockFileExists(packageManager) &&
parsedLockFile
) {
Expand Down
4 changes: 2 additions & 2 deletions packages/nx/src/plugins/js/lock-file/lock-file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export function getLockFileNodes(
bodyLines: errorBodyLines(e),
});
}
return;
throw e;
}
throw new Error(`Unknown package manager: ${packageManager}`);
}
Expand Down Expand Up @@ -107,7 +107,7 @@ export function getLockFileDependencies(
bodyLines: errorBodyLines(e),
});
}
return;
throw e;
}
throw new Error(`Unknown package manager: ${packageManager}`);
}
Expand Down

0 comments on commit a5a522e

Please sign in to comment.