Skip to content

Commit 0bbd74d

Browse files
authoredJul 14, 2023
fix: bump nx to >=16.5.1 (#3767)
1 parent b2c4d74 commit 0bbd74d

File tree

10 files changed

+236
-281
lines changed

10 files changed

+236
-281
lines changed
 

‎libs/commands/run/src/index.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ import {
1717
} from "@lerna/core";
1818
import { TargetDependencyConfig } from "@nx/devkit";
1919
import { existsSync } from "fs-extra";
20-
import { runMany } from "nx/src/command-line/run-many";
21-
import { runOne } from "nx/src/command-line/run-one";
20+
import { runMany } from "nx/src/command-line/run-many/run-many";
21+
import { runOne } from "nx/src/command-line/run/run-one";
2222
import pMap from "p-map";
2323
import path from "path";
2424
import { performance } from "perf_hooks";

‎libs/core/src/lib/command/create-project-graph-with-packages.ts

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { ProjectFileMap, ProjectGraph, ProjectGraphProjectNode, workspaceRoot } from "@nx/devkit";
22
import { readJson } from "fs-extra";
3-
import { sortBy } from "lodash";
3+
import { reduce, sortBy } from "lodash";
44
import minimatch from "minimatch";
55
import { resolve } from "npm-package-arg";
66
import { join } from "path";
@@ -62,6 +62,13 @@ export async function createProjectGraphWithPackages(
6262
};
6363
});
6464

65+
// order dependencies to create consistent results when iterating over them
66+
projectGraphWithOrderedNodes.dependencies = reduce(
67+
sortBy(Object.keys(projectGraphWithOrderedNodes.dependencies)),
68+
(prev, next) => ({ ...prev, [next]: projectGraphWithOrderedNodes.dependencies[next] }),
69+
{}
70+
);
71+
6572
// populate local npm package dependencies
6673
Object.values(projectGraphWithOrderedNodes.dependencies).forEach((projectDeps) => {
6774
const workspaceDeps = projectDeps.filter(

‎libs/core/src/lib/command/detect-projects.ts

+1-18
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,7 @@ export async function detectProjects(packageConfigs: string[]): Promise<{
77
projectFileMap: ProjectFileMap;
88
}> {
99
const _projectGraph = await createProjectGraphAsync();
10-
11-
let projectFileMap: ProjectFileMap;
12-
13-
// if we are using Nx >= 16.3.1, we can use the helper function to create the file map
14-
// otherwise, we need to use the old "files" property on the node data
15-
if (createProjectFileMapUsingProjectGraph) {
16-
projectFileMap = await createProjectFileMapUsingProjectGraph(_projectGraph);
17-
} else {
18-
projectFileMap = Object.entries(_projectGraph.nodes).reduce(
19-
(map, [key, node]) => ({
20-
...map,
21-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
22-
[key]: (node.data as any).files,
23-
}),
24-
{}
25-
);
26-
}
27-
10+
const projectFileMap = await createProjectFileMapUsingProjectGraph(_projectGraph);
2811
const projectGraph = await createProjectGraphWithPackages(_projectGraph, projectFileMap, packageConfigs);
2912

3013
return {

‎libs/core/src/lib/test-helpers/create-project-graph.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
process.env.NX_DAEMON = "false";
33
process.env.NX_CACHE_PROJECT_GRAPH = "false";
44

5-
import { fileHasher } from "nx/src/hasher/impl";
65
import { ProjectGraphDependency, ProjectGraphProjectNode } from "@nx/devkit";
6+
import { fileHasher } from "nx/src/hasher/file-hasher";
77
import { Package, RawManifest } from "../package";
88
import {
99
ProjectGraphProjectNodeWithPackage,

‎libs/test-helpers/src/lib/cli.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import execa from "execa";
2-
import { fileHasher } from "nx/src/hasher/impl";
2+
import { fileHasher } from "nx/src/hasher/file-hasher";
33
import { setWorkspaceRoot } from "nx/src/utils/workspace-root";
44
import path, { join } from "path";
55
import yargs from "yargs";

‎package-lock.json

+211-246
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json

+8-8
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@
3333
"license": "MIT",
3434
"homepage": "https://lerna.js.org",
3535
"devDependencies": {
36-
"@nx/esbuild": "16.3.2",
37-
"@nx/eslint-plugin": "16.3.2",
38-
"@nx/jest": "16.3.2",
39-
"@nx/js": "16.3.2",
40-
"@nx/linter": "16.3.2",
41-
"@nx/plugin": "16.3.2",
42-
"@nx/web": "16.3.2",
36+
"@nx/esbuild": "16.5.1",
37+
"@nx/eslint-plugin": "16.5.1",
38+
"@nx/jest": "16.5.1",
39+
"@nx/js": "16.5.1",
40+
"@nx/linter": "16.5.1",
41+
"@nx/plugin": "16.5.1",
42+
"@nx/web": "16.5.1",
4343
"@swc-node/register": "^1.4.2",
4444
"@swc/cli": "0.1.62",
4545
"@swc/core": "^1.2.173",
@@ -96,7 +96,7 @@
9696
"lodash": "^4.17.21",
9797
"normalize-newline": "^3.0.0",
9898
"normalize-path": "^3.0.0",
99-
"nx": "16.3.2",
99+
"nx": "16.5.1",
100100
"nx-cloud": "16.0.5",
101101
"prettier": "^2.2.1",
102102
"resolve.exports": "2.0.0",

‎packages/lerna/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
"@lerna/child-process": "7.1.3",
4141
"@lerna/create": "7.1.3",
4242
"@npmcli/run-script": "6.0.2",
43-
"@nx/devkit": ">=16.1.3 < 17",
43+
"@nx/devkit": ">=16.5.1 < 17",
4444
"@octokit/plugin-enterprise-rest": "6.0.1",
4545
"@octokit/rest": "19.0.11",
4646
"byte-size": "8.1.1",
@@ -82,7 +82,7 @@
8282
"npm-packlist": "5.1.1",
8383
"npm-registry-fetch": "^14.0.5",
8484
"npmlog": "^6.0.2",
85-
"nx": ">=16.1.3 < 17",
85+
"nx": ">=16.5.1 < 17",
8686
"p-map": "4.0.0",
8787
"p-map-series": "2.1.0",
8888
"p-pipe": "3.1.0",

‎packages/lerna/src/commands/repair/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Command } from "@lerna/core";
22
import log from "npmlog";
3-
import { repair } from "nx/src/command-line/repair";
3+
import { repair } from "nx/src/command-line/repair/repair";
44

55
// eslint-disable-next-line @typescript-eslint/no-var-requires
66
const migrationsJson = require("../../../migrations.json");

‎packages/lerna/src/commands/watch/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
ProjectGraphProjectNodeWithPackage,
66
ValidationError,
77
} from "@lerna/core";
8-
import { watch } from "nx/src/command-line/watch";
8+
import { watch } from "nx/src/command-line/watch/watch";
99

1010
module.exports = function factory(argv: NodeJS.Process["argv"]) {
1111
return new WatchCommand(argv);

0 commit comments

Comments
 (0)
Please sign in to comment.