nx 22.1.0-canary.20251029-4a07faf → 22.1.0-canary.20251106-e9146c7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/executors.json +16 -16
  2. package/generators.json +13 -13
  3. package/migrations.json +143 -137
  4. package/package.json +11 -14
  5. package/presets/npm.json +4 -4
  6. package/schemas/nx-schema.json +1286 -1286
  7. package/schemas/project-schema.json +359 -359
  8. package/schemas/workspace-schema.json +165 -165
  9. package/src/ai/set-up-ai-agents/get-agent-rules.d.ts.map +1 -1
  10. package/src/ai/set-up-ai-agents/get-agent-rules.js +0 -11
  11. package/src/ai/set-up-ai-agents/schema.json +31 -31
  12. package/src/command-line/init/implementation/dot-nx/add-nx-scripts.d.ts +2 -0
  13. package/src/command-line/init/implementation/dot-nx/add-nx-scripts.d.ts.map +1 -1
  14. package/src/command-line/init/implementation/dot-nx/add-nx-scripts.js +11 -1
  15. package/src/config/nx-json.d.ts.map +1 -1
  16. package/src/config/nx-json.js +2 -1
  17. package/src/core/graph/main.js +1 -1
  18. package/src/daemon/client/client.d.ts +1 -0
  19. package/src/daemon/client/client.d.ts.map +1 -1
  20. package/src/daemon/client/client.js +18 -1
  21. package/src/devkit-internals.d.ts +1 -1
  22. package/src/devkit-internals.d.ts.map +1 -1
  23. package/src/devkit-internals.js +2 -1
  24. package/src/executors/noop/schema.json +8 -8
  25. package/src/executors/run-commands/run-commands.impl.d.ts +1 -1
  26. package/src/executors/run-commands/run-commands.impl.d.ts.map +1 -1
  27. package/src/executors/run-commands/run-commands.impl.js +7 -4
  28. package/src/executors/run-commands/running-tasks.d.ts +4 -3
  29. package/src/executors/run-commands/running-tasks.d.ts.map +1 -1
  30. package/src/executors/run-commands/running-tasks.js +30 -9
  31. package/src/executors/run-commands/schema.json +187 -187
  32. package/src/executors/run-script/schema.json +25 -25
  33. package/src/generators/internal-utils/format-changed-files-with-prettier-if-available.d.ts.map +1 -1
  34. package/src/generators/internal-utils/format-changed-files-with-prettier-if-available.js +5 -1
  35. package/src/hasher/hash-task.d.ts +1 -0
  36. package/src/hasher/hash-task.d.ts.map +1 -1
  37. package/src/hasher/hash-task.js +57 -0
  38. package/src/migrations/update-22-1-0/update-nx-wrapper.d.ts +3 -0
  39. package/src/migrations/update-22-1-0/update-nx-wrapper.d.ts.map +1 -0
  40. package/src/migrations/update-22-1-0/update-nx-wrapper.js +7 -0
  41. package/src/native/index.d.ts +90 -0
  42. package/src/native/native-bindings.js +1 -0
  43. package/src/native/nx.wasm32-wasi.wasm +0 -0
  44. package/src/nx-cloud/generators/connect-to-nx-cloud/schema.json +38 -38
  45. package/src/project-graph/plugins/isolation/plugin-pool.d.ts.map +1 -1
  46. package/src/project-graph/plugins/isolation/plugin-pool.js +17 -1
  47. package/src/tasks-runner/create-task-graph.d.ts.map +1 -1
  48. package/src/tasks-runner/create-task-graph.js +4 -11
  49. package/src/tasks-runner/forked-process-task-runner.d.ts.map +1 -1
  50. package/src/tasks-runner/forked-process-task-runner.js +36 -4
  51. package/src/tasks-runner/is-tui-enabled.d.ts.map +1 -1
  52. package/src/tasks-runner/is-tui-enabled.js +0 -4
  53. package/src/tasks-runner/process-metrics-service.d.ts +54 -0
  54. package/src/tasks-runner/process-metrics-service.d.ts.map +1 -0
  55. package/src/tasks-runner/process-metrics-service.js +161 -0
  56. package/src/tasks-runner/pseudo-terminal.d.ts +1 -0
  57. package/src/tasks-runner/pseudo-terminal.d.ts.map +1 -1
  58. package/src/tasks-runner/pseudo-terminal.js +3 -0
  59. package/src/tasks-runner/running-tasks/node-child-process.d.ts.map +1 -1
  60. package/src/tasks-runner/task-orchestrator.d.ts.map +1 -1
  61. package/src/tasks-runner/task-orchestrator.js +3 -7
  62. package/src/tasks-runner/utils.d.ts +1 -0
  63. package/src/tasks-runner/utils.d.ts.map +1 -1
  64. package/src/tasks-runner/utils.js +8 -0
  65. package/src/utils/update-nxw.d.ts.map +1 -1
  66. package/src/utils/update-nxw.js +11 -0
@@ -1,198 +1,198 @@
1
1
  {
2
- "version": 2,
3
- "title": "Run Commands",
4
- "description": "Run any custom commands with Nx.",
5
- "type": "object",
6
- "cli": "nx",
7
- "outputCapture": "pipe",
8
- "presets": [
9
- {
10
- "name": "Arguments forwarding",
11
- "keys": ["commands"]
12
- },
13
- {
14
- "name": "Custom done conditions",
15
- "keys": ["commands", "readyWhen"]
16
- },
17
- {
18
- "name": "Setting the cwd",
19
- "keys": ["commands", "cwd"]
20
- }
21
- ],
22
- "properties": {
23
- "commands": {
24
- "type": "array",
25
- "description": "Commands to run in child process.",
26
- "items": {
27
- "oneOf": [
28
- {
29
- "type": "object",
30
- "properties": {
31
- "command": {
32
- "type": "string",
33
- "description": "Command to run in child process."
34
- },
35
- "forwardAllArgs": {
36
- "type": "boolean",
37
- "description": "Whether arguments should be forwarded when interpolation is not present."
38
- },
39
- "prefix": {
40
- "type": "string",
41
- "description": "Prefix in front of every line out of the output"
42
- },
43
- "prefixColor": {
44
- "type": "string",
45
- "description": "Color of the prefix",
46
- "enum": [
47
- "black",
48
- "red",
49
- "green",
50
- "yellow",
51
- "blue",
52
- "magenta",
53
- "cyan",
54
- "white"
55
- ]
56
- },
57
- "color": {
58
- "type": "string",
59
- "description": "Color of the output",
60
- "enum": [
61
- "black",
62
- "red",
63
- "green",
64
- "yellow",
65
- "blue",
66
- "magenta",
67
- "cyan",
68
- "white"
69
- ]
70
- },
71
- "bgColor": {
72
- "type": "string",
73
- "description": "Background color of the output",
74
- "enum": [
75
- "bgBlack",
76
- "bgRed",
77
- "bgGreen",
78
- "bgYellow",
79
- "bgBlue",
80
- "bgMagenta",
81
- "bgCyan",
82
- "bgWhite"
83
- ]
84
- },
85
- "description": {
86
- "type": "string",
87
- "description": "An optional description useful for inline documentation purposes. It is not used as part of the execution of the command."
88
- }
89
- },
90
- "additionalProperties": false,
91
- "required": ["command"]
92
- },
93
- {
94
- "type": "string"
95
- }
96
- ]
97
- },
98
- "x-priority": "important"
99
- },
100
- "command": {
101
- "oneOf": [
2
+ "version": 2,
3
+ "title": "Run Commands",
4
+ "description": "Run any custom commands with Nx.",
5
+ "type": "object",
6
+ "cli": "nx",
7
+ "outputCapture": "pipe",
8
+ "presets": [
9
+ {
10
+ "name": "Arguments forwarding",
11
+ "keys": ["commands"]
12
+ },
102
13
  {
103
- "type": "array",
104
- "description": "Command to run in child process, but divided into parts.",
105
- "items": {
106
- "type": "string"
107
- },
108
- "x-priority": "important"
14
+ "name": "Custom done conditions",
15
+ "keys": ["commands", "readyWhen"]
109
16
  },
110
17
  {
111
- "type": "string",
112
- "description": "Command to run in child process."
18
+ "name": "Setting the cwd",
19
+ "keys": ["commands", "cwd"]
20
+ }
21
+ ],
22
+ "properties": {
23
+ "commands": {
24
+ "type": "array",
25
+ "description": "Commands to run in child process.",
26
+ "items": {
27
+ "oneOf": [
28
+ {
29
+ "type": "object",
30
+ "properties": {
31
+ "command": {
32
+ "type": "string",
33
+ "description": "Command to run in child process."
34
+ },
35
+ "forwardAllArgs": {
36
+ "type": "boolean",
37
+ "description": "Whether arguments should be forwarded when interpolation is not present."
38
+ },
39
+ "prefix": {
40
+ "type": "string",
41
+ "description": "Prefix in front of every line out of the output"
42
+ },
43
+ "prefixColor": {
44
+ "type": "string",
45
+ "description": "Color of the prefix",
46
+ "enum": [
47
+ "black",
48
+ "red",
49
+ "green",
50
+ "yellow",
51
+ "blue",
52
+ "magenta",
53
+ "cyan",
54
+ "white"
55
+ ]
56
+ },
57
+ "color": {
58
+ "type": "string",
59
+ "description": "Color of the output",
60
+ "enum": [
61
+ "black",
62
+ "red",
63
+ "green",
64
+ "yellow",
65
+ "blue",
66
+ "magenta",
67
+ "cyan",
68
+ "white"
69
+ ]
70
+ },
71
+ "bgColor": {
72
+ "type": "string",
73
+ "description": "Background color of the output",
74
+ "enum": [
75
+ "bgBlack",
76
+ "bgRed",
77
+ "bgGreen",
78
+ "bgYellow",
79
+ "bgBlue",
80
+ "bgMagenta",
81
+ "bgCyan",
82
+ "bgWhite"
83
+ ]
84
+ },
85
+ "description": {
86
+ "type": "string",
87
+ "description": "An optional description useful for inline documentation purposes. It is not used as part of the execution of the command."
88
+ }
89
+ },
90
+ "additionalProperties": false,
91
+ "required": ["command"]
92
+ },
93
+ {
94
+ "type": "string"
95
+ }
96
+ ]
97
+ },
98
+ "x-priority": "important"
99
+ },
100
+ "command": {
101
+ "oneOf": [
102
+ {
103
+ "type": "array",
104
+ "description": "Command to run in child process, but divided into parts.",
105
+ "items": {
106
+ "type": "string"
107
+ },
108
+ "x-priority": "important"
109
+ },
110
+ {
111
+ "type": "string",
112
+ "description": "Command to run in child process."
113
+ }
114
+ ],
115
+ "type": "string",
116
+ "description": "Command to run in child process.",
117
+ "x-priority": "important"
118
+ },
119
+ "parallel": {
120
+ "type": "boolean",
121
+ "description": "Run commands in parallel.",
122
+ "default": true,
123
+ "x-priority": "important"
124
+ },
125
+ "readyWhen": {
126
+ "description": "String or array of strings to appear in `stdout` or `stderr` that indicate that the task is done. When running multiple commands, this option can only be used when `parallel` is set to `true`. If not specified, the task is done when all the child processes complete.",
127
+ "oneOf": [
128
+ { "type": "string" },
129
+ { "type": "array", "items": { "type": "string" } }
130
+ ]
131
+ },
132
+ "args": {
133
+ "oneOf": [
134
+ {
135
+ "type": "array",
136
+ "items": {
137
+ "type": "string"
138
+ }
139
+ },
140
+ {
141
+ "type": "string"
142
+ }
143
+ ],
144
+ "description": "Extra arguments. You can pass them as follows: nx run project:target --args='--wait=100'. You can then use {args.wait} syntax to interpolate them in the workspace config file. See example [above](#chaining-commands-interpolating-args-and-setting-the-cwd)"
145
+ },
146
+ "envFile": {
147
+ "type": "string",
148
+ "description": "You may specify a custom .env file path."
149
+ },
150
+ "color": {
151
+ "type": "boolean",
152
+ "description": "Use colors when showing output of command.",
153
+ "default": false
154
+ },
155
+ "cwd": {
156
+ "type": "string",
157
+ "description": "Current working directory of the commands. If it's not specified the commands will run in the workspace root, if a relative path is specified the commands will run in that path relative to the workspace root and if it's an absolute path the commands will run in that path."
158
+ },
159
+ "env": {
160
+ "type": "object",
161
+ "description": "Environment variables that will be made available to the commands. This property has priority over the `.env` files.",
162
+ "additionalProperties": {
163
+ "type": "string"
164
+ }
165
+ },
166
+ "__unparsed__": {
167
+ "hidden": true,
168
+ "type": "array",
169
+ "items": {
170
+ "type": "string"
171
+ },
172
+ "$default": {
173
+ "$source": "unparsed"
174
+ },
175
+ "x-priority": "internal"
176
+ },
177
+ "forwardAllArgs": {
178
+ "type": "boolean",
179
+ "description": "Whether arguments should be forwarded when interpolation is not present.",
180
+ "default": true
181
+ },
182
+ "tty": {
183
+ "type": "boolean",
184
+ "description": "Whether commands should be run with a tty terminal",
185
+ "hidden": true
113
186
  }
114
- ],
115
- "type": "string",
116
- "description": "Command to run in child process.",
117
- "x-priority": "important"
118
- },
119
- "parallel": {
120
- "type": "boolean",
121
- "description": "Run commands in parallel.",
122
- "default": true,
123
- "x-priority": "important"
124
- },
125
- "readyWhen": {
126
- "description": "String or array of strings to appear in `stdout` or `stderr` that indicate that the task is done. When running multiple commands, this option can only be used when `parallel` is set to `true`. If not specified, the task is done when all the child processes complete.",
127
- "oneOf": [
128
- { "type": "string" },
129
- { "type": "array", "items": { "type": "string" } }
130
- ]
131
187
  },
132
- "args": {
133
- "oneOf": [
188
+ "additionalProperties": true,
189
+ "oneOf": [
134
190
  {
135
- "type": "array",
136
- "items": {
137
- "type": "string"
138
- }
191
+ "required": ["commands"]
139
192
  },
140
193
  {
141
- "type": "string"
194
+ "required": ["command"]
142
195
  }
143
- ],
144
- "description": "Extra arguments. You can pass them as follows: nx run project:target --args='--wait=100'. You can then use {args.wait} syntax to interpolate them in the workspace config file. See example [above](#chaining-commands-interpolating-args-and-setting-the-cwd)"
145
- },
146
- "envFile": {
147
- "type": "string",
148
- "description": "You may specify a custom .env file path."
149
- },
150
- "color": {
151
- "type": "boolean",
152
- "description": "Use colors when showing output of command.",
153
- "default": false
154
- },
155
- "cwd": {
156
- "type": "string",
157
- "description": "Current working directory of the commands. If it's not specified the commands will run in the workspace root, if a relative path is specified the commands will run in that path relative to the workspace root and if it's an absolute path the commands will run in that path."
158
- },
159
- "env": {
160
- "type": "object",
161
- "description": "Environment variables that will be made available to the commands. This property has priority over the `.env` files.",
162
- "additionalProperties": {
163
- "type": "string"
164
- }
165
- },
166
- "__unparsed__": {
167
- "hidden": true,
168
- "type": "array",
169
- "items": {
170
- "type": "string"
171
- },
172
- "$default": {
173
- "$source": "unparsed"
174
- },
175
- "x-priority": "internal"
176
- },
177
- "forwardAllArgs": {
178
- "type": "boolean",
179
- "description": "Whether arguments should be forwarded when interpolation is not present.",
180
- "default": true
181
- },
182
- "tty": {
183
- "type": "boolean",
184
- "description": "Whether commands should be run with a tty terminal",
185
- "hidden": true
186
- }
187
- },
188
- "additionalProperties": true,
189
- "oneOf": [
190
- {
191
- "required": ["commands"]
192
- },
193
- {
194
- "required": ["command"]
195
- }
196
- ],
197
- "examplesFile": "../../../docs/run-commands-examples.md"
196
+ ],
197
+ "examplesFile": "../../../docs/run-commands-examples.md"
198
198
  }
@@ -1,28 +1,28 @@
1
1
  {
2
- "version": 2,
3
- "title": "Run Script",
4
- "description": "Run any NPM script of a project in the project's root directory.",
5
- "type": "object",
6
- "cli": "nx",
7
- "outputCapture": "pipe",
8
- "properties": {
9
- "script": {
10
- "type": "string",
11
- "description": "An npm script name in the `package.json` file of the project (e.g., `build`)."
2
+ "version": 2,
3
+ "title": "Run Script",
4
+ "description": "Run any NPM script of a project in the project's root directory.",
5
+ "type": "object",
6
+ "cli": "nx",
7
+ "outputCapture": "pipe",
8
+ "properties": {
9
+ "script": {
10
+ "type": "string",
11
+ "description": "An npm script name in the `package.json` file of the project (e.g., `build`)."
12
+ },
13
+ "__unparsed__": {
14
+ "hidden": true,
15
+ "type": "array",
16
+ "items": {
17
+ "type": "string"
18
+ },
19
+ "$default": {
20
+ "$source": "unparsed"
21
+ },
22
+ "x-priority": "internal"
23
+ }
12
24
  },
13
- "__unparsed__": {
14
- "hidden": true,
15
- "type": "array",
16
- "items": {
17
- "type": "string"
18
- },
19
- "$default": {
20
- "$source": "unparsed"
21
- },
22
- "x-priority": "internal"
23
- }
24
- },
25
- "additionalProperties": true,
26
- "required": ["script"],
27
- "examplesFile": "../../../docs/run-script-examples.md"
25
+ "additionalProperties": true,
26
+ "required": ["script"],
27
+ "examplesFile": "../../../docs/run-script-examples.md"
28
28
  }
@@ -1 +1 @@
1
- {"version":3,"file":"format-changed-files-with-prettier-if-available.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/generators/internal-utils/format-changed-files-with-prettier-if-available.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAEpC;;;GAGG;AACH,wBAAsB,yCAAyC,CAC7D,IAAI,EAAE,IAAI,EACV,OAAO,CAAC,EAAE;IACR,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,GACA,OAAO,CAAC,IAAI,CAAC,CAcf;AAED,wBAAsB,kCAAkC,CACtD,KAAK,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,EAAE,EACnD,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE;IACR,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,GACA,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CA2D9B"}
1
+ {"version":3,"file":"format-changed-files-with-prettier-if-available.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/generators/internal-utils/format-changed-files-with-prettier-if-available.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAGpC;;;GAGG;AACH,wBAAsB,yCAAyC,CAC7D,IAAI,EAAE,IAAI,EACV,OAAO,CAAC,EAAE;IACR,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,GACA,OAAO,CAAC,IAAI,CAAC,CAcf;AAED,wBAAsB,kCAAkC,CACtD,KAAK,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,EAAE,EACnD,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE;IACR,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,GACA,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CA8D9B"}
@@ -4,6 +4,7 @@ exports.formatChangedFilesWithPrettierIfAvailable = formatChangedFilesWithPretti
4
4
  exports.formatFilesWithPrettierIfAvailable = formatFilesWithPrettierIfAvailable;
5
5
  const path = require("path");
6
6
  const is_using_prettier_1 = require("../../utils/is-using-prettier");
7
+ const installation_directory_1 = require("../../utils/installation-directory");
7
8
  /**
8
9
  * Formats all the created or updated files using Prettier
9
10
  * @param tree - the file system tree
@@ -19,7 +20,10 @@ async function formatFilesWithPrettierIfAvailable(files, root, options) {
19
20
  const results = new Map();
20
21
  let prettier;
21
22
  try {
22
- prettier = await Promise.resolve().then(() => require('prettier'));
23
+ const prettierPath = require.resolve('prettier', {
24
+ paths: [...(0, installation_directory_1.getNxRequirePaths)(root), __dirname],
25
+ });
26
+ prettier = require(prettierPath);
23
27
  /**
24
28
  * Even after we discovered prettier in node_modules, we need to be sure that the user is intentionally using prettier
25
29
  * before proceeding to format with it.
@@ -6,4 +6,5 @@ import { TaskDetails } from '../native';
6
6
  export declare function getTaskDetails(): TaskDetails | null;
7
7
  export declare function hashTasksThatDoNotDependOnOutputsOfOtherTasks(hasher: TaskHasher, projectGraph: ProjectGraph, taskGraph: TaskGraph, nxJson: NxJsonConfiguration, tasksDetails: TaskDetails | null): Promise<void>;
8
8
  export declare function hashTask(hasher: TaskHasher, projectGraph: ProjectGraph, taskGraph: TaskGraph, task: Task, env: NodeJS.ProcessEnv, taskDetails: TaskDetails | null): Promise<void>;
9
+ export declare function hashTasks(hasher: TaskHasher, projectGraph: ProjectGraph, taskGraph: TaskGraph, env: NodeJS.ProcessEnv, taskDetails: TaskDetails | null): Promise<void>;
9
10
  //# sourceMappingURL=hash-task.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"hash-task.d.ts","sourceRoot":"","sources":["../../../../../packages/nx/src/hasher/hash-task.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAGvD,OAAO,EAAa,UAAU,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAExD,OAAO,EAAuB,WAAW,EAAE,MAAM,WAAW,CAAC;AAK7D,wBAAgB,cAAc,IAAI,WAAW,GAAG,IAAI,CASnD;AAED,wBAAsB,6CAA6C,CACjE,MAAM,EAAE,UAAU,EAClB,YAAY,EAAE,YAAY,EAC1B,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,mBAAmB,EAC3B,YAAY,EAAE,WAAW,GAAG,IAAI,iBAgDjC;AAED,wBAAsB,QAAQ,CAC5B,MAAM,EAAE,UAAU,EAClB,YAAY,EAAE,YAAY,EAC1B,SAAS,EAAE,SAAS,EACpB,IAAI,EAAE,IAAI,EACV,GAAG,EAAE,MAAM,CAAC,UAAU,EACtB,WAAW,EAAE,WAAW,GAAG,IAAI,iBAuChC"}
1
+ {"version":3,"file":"hash-task.d.ts","sourceRoot":"","sources":["../../../../../packages/nx/src/hasher/hash-task.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAGvD,OAAO,EAAa,UAAU,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAExD,OAAO,EAAuB,WAAW,EAAE,MAAM,WAAW,CAAC;AAK7D,wBAAgB,cAAc,IAAI,WAAW,GAAG,IAAI,CASnD;AAED,wBAAsB,6CAA6C,CACjE,MAAM,EAAE,UAAU,EAClB,YAAY,EAAE,YAAY,EAC1B,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,mBAAmB,EAC3B,YAAY,EAAE,WAAW,GAAG,IAAI,iBAgDjC;AAED,wBAAsB,QAAQ,CAC5B,MAAM,EAAE,UAAU,EAClB,YAAY,EAAE,YAAY,EAC1B,SAAS,EAAE,SAAS,EACpB,IAAI,EAAE,IAAI,EACV,GAAG,EAAE,MAAM,CAAC,UAAU,EACtB,WAAW,EAAE,WAAW,GAAG,IAAI,iBAuChC;AAED,wBAAsB,SAAS,CAC7B,MAAM,EAAE,UAAU,EAClB,YAAY,EAAE,YAAY,EAC1B,SAAS,EAAE,SAAS,EACpB,GAAG,EAAE,MAAM,CAAC,UAAU,EACtB,WAAW,EAAE,WAAW,GAAG,IAAI,iBAuEhC"}
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getTaskDetails = getTaskDetails;
4
4
  exports.hashTasksThatDoNotDependOnOutputsOfOtherTasks = hashTasksThatDoNotDependOnOutputsOfOtherTasks;
5
5
  exports.hashTask = hashTask;
6
+ exports.hashTasks = hashTasks;
6
7
  const utils_1 = require("../tasks-runner/utils");
7
8
  const project_graph_1 = require("../project-graph/project-graph");
8
9
  const task_hasher_1 = require("./task-hasher");
@@ -83,3 +84,59 @@ async function hashTask(hasher, projectGraph, taskGraph, task, env, taskDetails)
83
84
  performance.mark('hashSingleTask:end');
84
85
  performance.measure('hashSingleTask', 'hashSingleTask:start', 'hashSingleTask:end');
85
86
  }
87
+ async function hashTasks(hasher, projectGraph, taskGraph, env, taskDetails) {
88
+ performance.mark('hashMultipleTasks:start');
89
+ const projectsConfigurations = (0, project_graph_1.readProjectsConfigurationFromProjectGraph)(projectGraph);
90
+ const nxJson = (0, nx_json_1.readNxJson)();
91
+ const tasks = Object.values(taskGraph.tasks).filter((task) => !task.hash);
92
+ // Separate tasks with custom hashers from those without
93
+ const tasksWithCustomHashers = [];
94
+ const tasksWithoutCustomHashers = [];
95
+ for (const task of tasks) {
96
+ const customHasher = (0, utils_1.getCustomHasher)(task, projectGraph);
97
+ if (customHasher) {
98
+ tasksWithCustomHashers.push(task);
99
+ }
100
+ else {
101
+ tasksWithoutCustomHashers.push(task);
102
+ }
103
+ }
104
+ // Hash tasks with custom hashers individually
105
+ const customHasherPromises = tasksWithCustomHashers.map(async (task) => {
106
+ const customHasher = (0, utils_1.getCustomHasher)(task, projectGraph);
107
+ const { value, details } = await customHasher(task, {
108
+ hasher,
109
+ projectGraph,
110
+ taskGraph,
111
+ workspaceConfig: projectsConfigurations,
112
+ projectsConfigurations,
113
+ nxJsonConfiguration: nxJson,
114
+ env,
115
+ });
116
+ task.hash = value;
117
+ task.hashDetails = details;
118
+ });
119
+ // Hash tasks without custom hashers in batch
120
+ let batchHashPromise = Promise.resolve();
121
+ if (tasksWithoutCustomHashers.length > 0) {
122
+ batchHashPromise = hasher
123
+ .hashTasks(tasksWithoutCustomHashers, taskGraph, env)
124
+ .then((hashes) => {
125
+ for (let i = 0; i < tasksWithoutCustomHashers.length; i++) {
126
+ tasksWithoutCustomHashers[i].hash = hashes[i].value;
127
+ tasksWithoutCustomHashers[i].hashDetails = hashes[i].details;
128
+ }
129
+ });
130
+ }
131
+ await Promise.all([...customHasherPromises, batchHashPromise]);
132
+ if (taskDetails?.recordTaskDetails) {
133
+ taskDetails.recordTaskDetails(tasks.map((task) => ({
134
+ hash: task.hash,
135
+ project: task.target.project,
136
+ target: task.target.target,
137
+ configuration: task.target.configuration,
138
+ })));
139
+ }
140
+ performance.mark('hashMultipleTasks:end');
141
+ performance.measure('hashMultipleTasks', 'hashMultipleTasks:start', 'hashMultipleTasks:end');
142
+ }
@@ -0,0 +1,3 @@
1
+ import type { Tree } from '../../generators/tree';
2
+ export default function (tree: Tree): Promise<void>;
3
+ //# sourceMappingURL=update-nx-wrapper.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update-nx-wrapper.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/migrations/update-22-1-0/update-nx-wrapper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAGlD,yBAA+B,IAAI,EAAE,IAAI,iBAExC"}
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = default_1;
4
+ const update_nxw_1 = require("../../utils/update-nxw");
5
+ async function default_1(tree) {
6
+ (0, update_nxw_1.updateNxw)(tree);
7
+ }