1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | exports.parseYarnLockV1WorkspaceProject = void 0;
|
4 | const build_depgraph_workspace_package_pruned_1 = require("./build-depgraph-workspace-package-pruned");
|
5 | const build_depgraph_workspace_package_1 = require("./build-depgraph-workspace-package");
|
6 | const extract_yarnlock_v1_pkgs_1 = require("./extract-yarnlock-v1-pkgs");
|
7 | const util_1 = require("../util");
|
8 | const c_map_1 = require("../../c-map");
|
9 | const parseYarnLockV1WorkspaceProject = async (yarnLockContent, workspacePackagesPkgJsons, options) => {
|
10 | const { includeDevDeps, includeOptionalDeps, pruneCycles, strictOutOfSync } = options;
|
11 | const extractedYarnLockV1Pkgs = (0, extract_yarnlock_v1_pkgs_1.extractPkgsFromYarnLockV1)(yarnLockContent);
|
12 |
|
13 | const workspacePkgNameToVersion = {};
|
14 | const parsedWorkspacePkgJsons = workspacePackagesPkgJsons.map((wsPkgJsonContent) => {
|
15 | const parsedPkgJson = (0, util_1.parsePkgJson)(wsPkgJsonContent);
|
16 | workspacePkgNameToVersion[parsedPkgJson.name] = parsedPkgJson.version;
|
17 | return parsedPkgJson;
|
18 | });
|
19 | const depGraphs = (0, c_map_1.cMap)(parsedWorkspacePkgJsons, async (parsedPkgJson) => {
|
20 | return pruneCycles
|
21 | ? await (0, build_depgraph_workspace_package_pruned_1.buildDepGraphYarnLockV1WorkspaceCyclesPruned)(extractedYarnLockV1Pkgs, parsedPkgJson, workspacePkgNameToVersion, {
|
22 | includeDevDeps,
|
23 | strictOutOfSync,
|
24 | includeOptionalDeps,
|
25 | })
|
26 | : await (0, build_depgraph_workspace_package_1.buildDepGraphYarnLockV1Workspace)(extractedYarnLockV1Pkgs, parsedPkgJson, workspacePkgNameToVersion, {
|
27 | includeDevDeps,
|
28 | strictOutOfSync,
|
29 | includeOptionalDeps,
|
30 | });
|
31 | });
|
32 | return depGraphs;
|
33 | };
|
34 | exports.parseYarnLockV1WorkspaceProject = parseYarnLockV1WorkspaceProject;
|
35 |
|
\ | No newline at end of file |