nx 19.5.0-canary.20240705-653cad2 → 19.5.0-canary.20240706-4ae16b3

Sign up to get free protection for your applications and to get access to all the features.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nx",
3
- "version": "19.5.0-canary.20240705-653cad2",
3
+ "version": "19.5.0-canary.20240706-4ae16b3",
4
4
  "private": false,
5
5
  "description": "The core Nx plugin contains the core functionality of Nx like the project graph, nx commands and task orchestration.",
6
6
  "repository": {
@@ -37,6 +37,7 @@
37
37
  },
38
38
  "homepage": "https://nx.dev",
39
39
  "dependencies": {
40
+ "@napi-rs/wasm-runtime": "0.2.4",
40
41
  "@yarnpkg/lockfile": "^1.1.0",
41
42
  "@yarnpkg/parsers": "3.0.0-rc.46",
42
43
  "@zkochan/js-yaml": "0.0.7",
@@ -70,7 +71,7 @@
70
71
  "yargs-parser": "21.1.1",
71
72
  "node-machine-id": "1.1.12",
72
73
  "ora": "5.3.0",
73
- "@nrwl/tao": "19.5.0-canary.20240705-653cad2"
74
+ "@nrwl/tao": "19.5.0-canary.20240706-4ae16b3"
74
75
  },
75
76
  "peerDependencies": {
76
77
  "@swc-node/register": "^1.8.0",
@@ -85,16 +86,16 @@
85
86
  }
86
87
  },
87
88
  "optionalDependencies": {
88
- "@nx/nx-darwin-x64": "19.5.0-canary.20240705-653cad2",
89
- "@nx/nx-darwin-arm64": "19.5.0-canary.20240705-653cad2",
90
- "@nx/nx-linux-x64-gnu": "19.5.0-canary.20240705-653cad2",
91
- "@nx/nx-linux-x64-musl": "19.5.0-canary.20240705-653cad2",
92
- "@nx/nx-win32-x64-msvc": "19.5.0-canary.20240705-653cad2",
93
- "@nx/nx-linux-arm64-gnu": "19.5.0-canary.20240705-653cad2",
94
- "@nx/nx-linux-arm64-musl": "19.5.0-canary.20240705-653cad2",
95
- "@nx/nx-linux-arm-gnueabihf": "19.5.0-canary.20240705-653cad2",
96
- "@nx/nx-win32-arm64-msvc": "19.5.0-canary.20240705-653cad2",
97
- "@nx/nx-freebsd-x64": "19.5.0-canary.20240705-653cad2"
89
+ "@nx/nx-darwin-x64": "19.5.0-canary.20240706-4ae16b3",
90
+ "@nx/nx-darwin-arm64": "19.5.0-canary.20240706-4ae16b3",
91
+ "@nx/nx-linux-x64-gnu": "19.5.0-canary.20240706-4ae16b3",
92
+ "@nx/nx-linux-x64-musl": "19.5.0-canary.20240706-4ae16b3",
93
+ "@nx/nx-win32-x64-msvc": "19.5.0-canary.20240706-4ae16b3",
94
+ "@nx/nx-linux-arm64-gnu": "19.5.0-canary.20240706-4ae16b3",
95
+ "@nx/nx-linux-arm64-musl": "19.5.0-canary.20240706-4ae16b3",
96
+ "@nx/nx-linux-arm-gnueabihf": "19.5.0-canary.20240706-4ae16b3",
97
+ "@nx/nx-win32-arm64-msvc": "19.5.0-canary.20240706-4ae16b3",
98
+ "@nx/nx-freebsd-x64": "19.5.0-canary.20240706-4ae16b3"
98
99
  },
99
100
  "nx-migrations": {
100
101
  "migrations": "./migrations.json",
@@ -170,21 +171,24 @@
170
171
  "access": "public"
171
172
  },
172
173
  "napi": {
173
- "name": "nx",
174
- "package": {
175
- "name": "@nx/nx"
174
+ "binaryName": "nx",
175
+ "packageName": "@nx/nx",
176
+ "wasm": {
177
+ "initialMemory": 16384,
178
+ "maximumMemory": 32768
176
179
  },
177
- "triples": {
178
- "additional": [
179
- "aarch64-apple-darwin",
180
- "aarch64-unknown-linux-gnu",
181
- "aarch64-unknown-linux-musl",
182
- "aarch64-pc-windows-msvc",
183
- "armv7-unknown-linux-gnueabihf",
184
- "x86_64-unknown-linux-musl",
185
- "x86_64-unknown-freebsd"
186
- ]
187
- }
180
+ "targets": [
181
+ "x86_64-unknown-linux-gnu",
182
+ "x86_64-pc-windows-msvc",
183
+ "x86_64-apple-darwin",
184
+ "aarch64-apple-darwin",
185
+ "aarch64-unknown-linux-gnu",
186
+ "aarch64-unknown-linux-musl",
187
+ "aarch64-pc-windows-msvc",
188
+ "armv7-unknown-linux-gnueabihf",
189
+ "x86_64-unknown-linux-musl",
190
+ "x86_64-unknown-freebsd"
191
+ ]
188
192
  },
189
193
  "main": "./bin/nx.js",
190
194
  "type": "commonjs"
@@ -319,9 +319,14 @@ async function generateGraph(args, affectedProjects) {
319
319
  }
320
320
  }
321
321
  exports.generateGraph = generateGraph;
322
- async function startServer(html, environmentJs, host, port = 4211, watchForchanges = true, affected = [], focus = null, groupByFolder = false, exclude = []) {
322
+ async function startServer(html, environmentJs, host, port = 4211, watchForChanges = true, affected = [], focus = null, groupByFolder = false, exclude = []) {
323
323
  let unregisterFileWatcher;
324
- if (watchForchanges) {
324
+ if (watchForChanges && !client_1.daemonClient.enabled()) {
325
+ output_1.output.warn({
326
+ title: 'Nx Daemon is not enabled. Graph will not refresh on file changes.',
327
+ });
328
+ }
329
+ if (watchForChanges && client_1.daemonClient.enabled()) {
325
330
  unregisterFileWatcher = await createFileWatcher();
326
331
  }
327
332
  const { projectGraphClientResponse, sourceMapResponse } = await createProjectGraphAndSourceMapClientResponse(affected);
@@ -116,6 +116,12 @@ async function watch(args) {
116
116
  if (args.verbose) {
117
117
  process.env.NX_VERBOSE_LOGGING = 'true';
118
118
  }
119
+ if (client_1.daemonClient.enabled()) {
120
+ output_1.output.error({
121
+ title: 'Daemon is not running. The watch command is not supported without the Nx Daemon.',
122
+ });
123
+ process.exit(1);
124
+ }
119
125
  if (args.includeGlobalWorkspaceFiles &&
120
126
  args.command.match(projectReplacementRegex)) {
121
127
  output_1.output.error({
@@ -3,19 +3,41 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createCommandGraph = void 0;
4
4
  const task_graph_utils_1 = require("../tasks-runner/task-graph-utils");
5
5
  const output_1 = require("../utils/output");
6
+ /**
7
+ * Make structure { lib: [dep], dep: [dep1], dep1: [] } from projectName lib and projectGraph
8
+ * @param projectGraph
9
+ * @param projectName
10
+ * @param resolved reference to an object that will contain resolved dependencies
11
+ * @returns
12
+ */
13
+ const recursiveResolveDeps = (projectGraph, projectName, resolved) => {
14
+ if (projectGraph.dependencies[projectName].length === 0) {
15
+ // no deps - no resolve
16
+ resolved[projectName] = [];
17
+ return;
18
+ }
19
+ // if already resolved - just skip
20
+ if (resolved[projectName]) {
21
+ return resolved[projectName];
22
+ }
23
+ // deps string list
24
+ const projectDeps = [
25
+ ...new Set(projectGraph.dependencies[projectName]
26
+ .map((projectDep) => projectDep.target)
27
+ .filter((projectDep) => projectGraph.nodes[projectDep])).values(),
28
+ ];
29
+ // define
30
+ resolved[projectName] = projectDeps;
31
+ if (projectDeps.length > 0) {
32
+ for (const dep of projectDeps) {
33
+ recursiveResolveDeps(projectGraph, dep, resolved);
34
+ }
35
+ }
36
+ };
6
37
  function createCommandGraph(projectGraph, projectNames, nxArgs) {
7
38
  const dependencies = {};
8
39
  for (const projectName of projectNames) {
9
- if (projectGraph.dependencies[projectName].length >= 1) {
10
- dependencies[projectName] = [
11
- ...new Set(projectGraph.dependencies[projectName]
12
- .map((projectDep) => projectDep.target)
13
- .filter((projectDep) => projectGraph.nodes[projectDep])).values(),
14
- ];
15
- }
16
- else {
17
- dependencies[projectName] = [];
18
- }
40
+ recursiveResolveDeps(projectGraph, projectName, dependencies);
19
41
  }
20
42
  const roots = Object.keys(dependencies).filter((d) => dependencies[d].length === 0);
21
43
  const commandGraph = {