fix(js): properly throw error when processing lockfile during postins… (#18968)
This commit is contained in:
parent
8f1429da97
commit
a5a522e92c
@ -38,7 +38,7 @@ export const createNodes: CreateNodes = [
|
|||||||
combineGlobPatterns(LOCKFILES),
|
combineGlobPatterns(LOCKFILES),
|
||||||
(lockFile, context) => {
|
(lockFile, context) => {
|
||||||
const pluginConfig = jsPluginConfig(context.nxJsonConfiguration);
|
const pluginConfig = jsPluginConfig(context.nxJsonConfiguration);
|
||||||
if (!pluginConfig.analyzePackageJson) {
|
if (!pluginConfig.analyzeLockfile) {
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -83,7 +83,7 @@ export const createDependencies: CreateDependencies = (
|
|||||||
let lockfileDependencies: ProjectGraphDependencyWithFile[] = [];
|
let lockfileDependencies: ProjectGraphDependencyWithFile[] = [];
|
||||||
// lockfile may not exist yet
|
// lockfile may not exist yet
|
||||||
if (
|
if (
|
||||||
pluginConfig.analyzePackageJson &&
|
pluginConfig.analyzeLockfile &&
|
||||||
lockFileExists(packageManager) &&
|
lockFileExists(packageManager) &&
|
||||||
parsedLockFile
|
parsedLockFile
|
||||||
) {
|
) {
|
||||||
|
|||||||
@ -76,7 +76,7 @@ export function getLockFileNodes(
|
|||||||
bodyLines: errorBodyLines(e),
|
bodyLines: errorBodyLines(e),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return;
|
throw e;
|
||||||
}
|
}
|
||||||
throw new Error(`Unknown package manager: ${packageManager}`);
|
throw new Error(`Unknown package manager: ${packageManager}`);
|
||||||
}
|
}
|
||||||
@ -107,7 +107,7 @@ export function getLockFileDependencies(
|
|||||||
bodyLines: errorBodyLines(e),
|
bodyLines: errorBodyLines(e),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return;
|
throw e;
|
||||||
}
|
}
|
||||||
throw new Error(`Unknown package manager: ${packageManager}`);
|
throw new Error(`Unknown package manager: ${packageManager}`);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user