nx 23.3.0-beta.5 → 23.3.0-beta.7
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.
- package/dist/nx-cloud-internals.d.ts +1 -0
- package/dist/nx-cloud-internals.js +9 -0
- package/dist/src/command-line/affected/affected.js +51 -9
- package/dist/src/command-line/graph/graph.d.ts +31 -0
- package/dist/src/command-line/graph/graph.js +71 -17
- package/dist/src/command-line/release/publish.js +7 -11
- package/dist/src/command-line/release/utils/get-touched-projects-for-group.js +3 -3
- package/dist/src/command-line/run/run-one.js +5 -1
- package/dist/src/command-line/run-many/run-many.js +6 -12
- package/dist/src/command-line/show/projects.js +30 -1
- package/dist/src/config/task-graph.d.ts +1 -1
- package/dist/src/config/workspace-json-project-json.d.ts +21 -1
- package/dist/src/core/graph/main.js +1 -1
- package/dist/src/core/graph/runtime.js +1 -1
- package/dist/src/core/graph/styles.js +1 -1
- package/dist/src/daemon/client/client.d.ts +7 -2
- package/dist/src/daemon/client/client.js +15 -2
- package/dist/src/daemon/message-types/io-snapshot-version.d.ts +5 -0
- package/dist/src/daemon/message-types/io-snapshot-version.js +2 -0
- package/dist/src/daemon/message-types/select-affected-tasks.d.ts +18 -0
- package/dist/src/daemon/message-types/select-affected-tasks.js +11 -0
- package/dist/src/daemon/server/handle-hash-tasks.d.ts +2 -0
- package/dist/src/daemon/server/handle-hash-tasks.js +5 -3
- package/dist/src/daemon/server/handle-select-affected-tasks.d.ts +3 -0
- package/dist/src/daemon/server/handle-select-affected-tasks.js +23 -0
- package/dist/src/daemon/server/io-snapshots-state.d.ts +7 -0
- package/dist/src/daemon/server/io-snapshots-state.js +35 -0
- package/dist/src/daemon/server/planning-context.d.ts +8 -0
- package/dist/src/daemon/server/planning-context.js +18 -0
- package/dist/src/daemon/server/server.d.ts +1 -0
- package/dist/src/daemon/server/server.js +6 -0
- package/dist/src/executors/run-commands/run-commands.impl.d.ts +2 -1
- package/dist/src/executors/run-commands/run-commands.impl.js +19 -5
- package/dist/src/executors/run-commands/running-tasks.d.ts +5 -4
- package/dist/src/executors/run-commands/running-tasks.js +13 -13
- package/dist/src/hasher/create-task-hasher.d.ts +8 -1
- package/dist/src/hasher/create-task-hasher.js +13 -3
- package/dist/src/hasher/hash-plan-inspector.js +2 -2
- package/dist/src/hasher/hash-task.d.ts +2 -2
- package/dist/src/hasher/hash-task.js +7 -1
- package/dist/src/hasher/native-task-hasher-impl.d.ts +13 -5
- package/dist/src/hasher/native-task-hasher-impl.js +38 -15
- package/dist/src/hasher/task-hasher.d.ts +17 -9
- package/dist/src/hasher/task-hasher.js +16 -11
- package/dist/src/hasher/task-planning-context.d.ts +13 -0
- package/dist/src/hasher/task-planning-context.js +12 -0
- package/dist/src/io-snapshots/config.d.ts +23 -0
- package/dist/src/io-snapshots/config.js +32 -0
- package/dist/src/io-snapshots/fetch.d.ts +21 -0
- package/dist/src/io-snapshots/fetch.js +43 -0
- package/dist/src/io-snapshots/outputs.d.ts +12 -0
- package/dist/src/io-snapshots/outputs.js +33 -0
- package/dist/src/io-snapshots/overrides.d.ts +17 -0
- package/dist/src/io-snapshots/overrides.js +60 -0
- package/dist/src/io-snapshots/report.d.ts +13 -0
- package/dist/src/io-snapshots/report.js +68 -0
- package/dist/src/io-snapshots/store.d.ts +37 -0
- package/dist/src/io-snapshots/store.js +162 -0
- package/dist/src/native/index.d.ts +264 -2
- package/dist/src/native/native-bindings.js +10 -0
- package/dist/src/native/nx.wasm32-wasi.debug.wasm +0 -0
- package/dist/src/native/nx.wasm32-wasi.wasm +0 -0
- package/dist/src/native/transform-objects.d.ts +11 -2
- package/dist/src/native/transform-objects.js +46 -0
- package/dist/src/nx-cloud/update-manager.d.ts +3 -0
- package/dist/src/plugins/js/index.js +45 -64
- package/dist/src/plugins/js/lock-file/lock-file.d.ts +4 -4
- package/dist/src/plugins/js/lock-file/lock-file.js +6 -7
- package/dist/src/plugins/js/project-graph/affected/lock-file-changes.d.ts +10 -2
- package/dist/src/plugins/js/project-graph/affected/lock-file-changes.js +51 -29
- package/dist/src/plugins/js/project-graph/affected/npm-packages.d.ts +10 -2
- package/dist/src/plugins/js/project-graph/affected/npm-packages.js +32 -11
- package/dist/src/project-graph/affected/affected-project-graph-models.d.ts +14 -0
- package/dist/src/project-graph/affected/affected-project-graph.js +5 -18
- package/dist/src/project-graph/affected/affected-projects.d.ts +7 -0
- package/dist/src/project-graph/affected/affected-projects.js +42 -0
- package/dist/src/project-graph/affected/affected-tasks.d.ts +90 -0
- package/dist/src/project-graph/affected/affected-tasks.js +214 -0
- package/dist/src/project-graph/file-utils.js +6 -2
- package/dist/src/project-graph/utils/project-configuration/target-merging.js +67 -0
- package/dist/src/project-graph/utils/project-configuration/target-normalization.js +83 -0
- package/dist/src/project-graph/utils/project-configuration/utils.d.ts +1 -0
- package/dist/src/project-graph/utils/project-configuration/utils.js +1 -0
- package/dist/src/tasks-runner/create-task-graph.d.ts +24 -1
- package/dist/src/tasks-runner/create-task-graph.js +56 -2
- package/dist/src/tasks-runner/forked-process-task-runner.js +3 -3
- package/dist/src/tasks-runner/init-tasks-runner.d.ts +7 -2
- package/dist/src/tasks-runner/init-tasks-runner.js +17 -6
- package/dist/src/tasks-runner/run-command.d.ts +41 -5
- package/dist/src/tasks-runner/run-command.js +84 -18
- package/dist/src/tasks-runner/task-io-service.d.ts +11 -3
- package/dist/src/tasks-runner/task-io-service.js +14 -5
- package/dist/src/tasks-runner/task-orchestrator.js +1 -1
- package/dist/src/tasks-runner/utils.d.ts +5 -0
- package/dist/src/tasks-runner/utils.js +9 -0
- package/dist/src/utils/db-connection.d.ts +1 -0
- package/dist/src/utils/db-connection.js +1 -0
- package/dist/src/utils/json-diff.d.ts +4 -2
- package/dist/src/utils/json-diff.js +6 -94
- package/dist/src/utils/nx-cloud-utils.d.ts +2 -0
- package/dist/src/utils/nx-cloud-utils.js +6 -1
- package/dist/src/utils/project-graph-utils.d.ts +2 -0
- package/dist/src/utils/project-graph-utils.js +12 -0
- package/package.json +22 -13
- package/schemas/nx-schema.json +34 -0
- package/schemas/project-schema.json +31 -0
- package/dist/src/project-graph/affected/locators/project-glob-changes.d.ts +0 -2
- package/dist/src/project-graph/affected/locators/project-glob-changes.js +0 -40
- package/dist/src/project-graph/affected/locators/workspace-json-changes.d.ts +0 -4
- package/dist/src/project-graph/affected/locators/workspace-json-changes.js +0 -47
- package/dist/src/project-graph/affected/locators/workspace-projects.d.ts +0 -3
- package/dist/src/project-graph/affected/locators/workspace-projects.js +0 -74
|
@@ -3,8 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.JsonDiffType = void 0;
|
|
4
4
|
exports.isJsonChange = isJsonChange;
|
|
5
5
|
exports.jsonDiff = jsonDiff;
|
|
6
|
-
|
|
7
|
-
exports.deepEquals = deepEquals;
|
|
6
|
+
const native_1 = require("../native");
|
|
8
7
|
var JsonDiffType;
|
|
9
8
|
(function (JsonDiffType) {
|
|
10
9
|
JsonDiffType["Deleted"] = "JsonPropertyDeleted";
|
|
@@ -16,97 +15,10 @@ function isJsonChange(change) {
|
|
|
16
15
|
change.type === JsonDiffType.Deleted ||
|
|
17
16
|
change.type === JsonDiffType.Modified);
|
|
18
17
|
}
|
|
18
|
+
/**
|
|
19
|
+
* The changes from `lhs` to `rhs`: every path whose value was deleted or
|
|
20
|
+
* modified, containers included, then every added path.
|
|
21
|
+
*/
|
|
19
22
|
function jsonDiff(lhs, rhs) {
|
|
20
|
-
|
|
21
|
-
const seenInLhs = new Set();
|
|
22
|
-
walkJsonTree(lhs, [], (path, lhsValue) => {
|
|
23
|
-
seenInLhs.add(hashArray(path));
|
|
24
|
-
const rhsValue = getJsonValue(path, rhs);
|
|
25
|
-
if (rhsValue === undefined) {
|
|
26
|
-
result.push({
|
|
27
|
-
type: JsonDiffType.Deleted,
|
|
28
|
-
path,
|
|
29
|
-
value: {
|
|
30
|
-
lhs: lhsValue,
|
|
31
|
-
rhs: undefined,
|
|
32
|
-
},
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
else if (!deepEquals(lhsValue, rhsValue)) {
|
|
36
|
-
result.push({
|
|
37
|
-
type: JsonDiffType.Modified,
|
|
38
|
-
path,
|
|
39
|
-
value: {
|
|
40
|
-
lhs: lhsValue,
|
|
41
|
-
rhs: rhsValue,
|
|
42
|
-
},
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
return typeof lhsValue === 'object' || Array.isArray(lhsValue);
|
|
46
|
-
});
|
|
47
|
-
walkJsonTree(rhs, [], (path, rhsValue) => {
|
|
48
|
-
const addedInRhs = !seenInLhs.has(hashArray(path));
|
|
49
|
-
if (addedInRhs) {
|
|
50
|
-
result.push({
|
|
51
|
-
type: JsonDiffType.Added,
|
|
52
|
-
path,
|
|
53
|
-
value: {
|
|
54
|
-
lhs: undefined,
|
|
55
|
-
rhs: rhsValue,
|
|
56
|
-
},
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
return typeof rhsValue === 'object' || Array.isArray(rhsValue);
|
|
60
|
-
});
|
|
61
|
-
return result;
|
|
62
|
-
}
|
|
63
|
-
// Depth-first walk down JSON tree.
|
|
64
|
-
function walkJsonTree(json, currPath, visitor) {
|
|
65
|
-
if (!json || typeof json !== 'object') {
|
|
66
|
-
return;
|
|
67
|
-
}
|
|
68
|
-
Object.keys(json).forEach((key) => {
|
|
69
|
-
const path = currPath.concat([key]);
|
|
70
|
-
const shouldContinue = visitor(path, json[key]);
|
|
71
|
-
if (shouldContinue) {
|
|
72
|
-
walkJsonTree(json[key], path, visitor);
|
|
73
|
-
}
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
function hashArray(ary) {
|
|
77
|
-
return JSON.stringify(ary);
|
|
78
|
-
}
|
|
79
|
-
function getJsonValue(path, json) {
|
|
80
|
-
let curr = json;
|
|
81
|
-
for (const k of path) {
|
|
82
|
-
curr = curr[k];
|
|
83
|
-
if (curr === undefined) {
|
|
84
|
-
break;
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
return curr;
|
|
88
|
-
}
|
|
89
|
-
function deepEquals(a, b) {
|
|
90
|
-
if (a === b) {
|
|
91
|
-
return true;
|
|
92
|
-
}
|
|
93
|
-
// Values do not need to be checked for deep equality and the above is false
|
|
94
|
-
if (
|
|
95
|
-
// Values are different types
|
|
96
|
-
typeof a !== typeof b ||
|
|
97
|
-
// Values are the same type but not an object or array
|
|
98
|
-
(typeof a !== 'object' && !Array.isArray(a)) ||
|
|
99
|
-
// Objects are the same type, objects or arrays, but do not have the same number of keys
|
|
100
|
-
Object.keys(a).length !== Object.keys(b).length) {
|
|
101
|
-
return false;
|
|
102
|
-
}
|
|
103
|
-
// Values need to be checked for deep equality
|
|
104
|
-
return Object.entries(a).reduce((equal, [key, aValue]) => {
|
|
105
|
-
// Skip other keys if it is already not equal.
|
|
106
|
-
if (!equal) {
|
|
107
|
-
return equal;
|
|
108
|
-
}
|
|
109
|
-
// Traverse the object
|
|
110
|
-
return deepEquals(aValue, b[key]);
|
|
111
|
-
}, true);
|
|
23
|
+
return ((0, native_1.diffJson)(JSON.stringify(lhs ?? null), JSON.stringify(rhs ?? null)) ?? []);
|
|
112
24
|
}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { NxJsonConfiguration } from '../config/nx-json';
|
|
2
2
|
export declare function isNxCloudDisabled(nxJson: NxJsonConfiguration): boolean;
|
|
3
3
|
export declare function isNxCloudUsed(nxJson: NxJsonConfiguration): boolean;
|
|
4
|
+
/** Whether nx.json connects the workspace to Nx Cloud, ignoring the env. */
|
|
5
|
+
export declare function isNxCloudConfigured(nxJson: NxJsonConfiguration): boolean;
|
|
4
6
|
export declare function getNxCloudUrl(nxJson: NxJsonConfiguration): string;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.isNxCloudDisabled = isNxCloudDisabled;
|
|
4
4
|
exports.isNxCloudUsed = isNxCloudUsed;
|
|
5
|
+
exports.isNxCloudConfigured = isNxCloudConfigured;
|
|
5
6
|
exports.getNxCloudUrl = getNxCloudUrl;
|
|
6
7
|
function isNxCloudDisabled(nxJson) {
|
|
7
8
|
return process.env.NX_NO_CLOUD === 'true' || nxJson.neverConnectToCloud;
|
|
@@ -12,7 +13,11 @@ function isNxCloudUsed(nxJson) {
|
|
|
12
13
|
}
|
|
13
14
|
return (!!process.env.NX_CLOUD_AUTH_TOKEN ||
|
|
14
15
|
!!process.env.NX_CLOUD_ACCESS_TOKEN ||
|
|
15
|
-
|
|
16
|
+
isNxCloudConfigured(nxJson));
|
|
17
|
+
}
|
|
18
|
+
/** Whether nx.json connects the workspace to Nx Cloud, ignoring the env. */
|
|
19
|
+
function isNxCloudConfigured(nxJson) {
|
|
20
|
+
return (!!nxJson.nxCloudAccessToken ||
|
|
16
21
|
!!nxJson.nxCloudId ||
|
|
17
22
|
!!Object.values(nxJson.tasksRunnerOptions ?? {}).find((r) => r.runner == '@nrwl/nx-cloud' || r.runner == 'nx-cloud'));
|
|
18
23
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { ProjectGraph, ProjectGraphProjectNode } from '../config/project-graph';
|
|
2
2
|
import type { ProjectConfiguration } from '../config/workspace-json-project-json';
|
|
3
3
|
export declare function projectHasTarget(project: ProjectGraphProjectNode, target: string): boolean;
|
|
4
|
+
/** The projects that define at least one of `targets`. */
|
|
5
|
+
export declare function runnableForTarget(projects: Record<string, ProjectGraphProjectNode>, targets: string[]): Set<string>;
|
|
4
6
|
export declare function projectHasTargetAndConfiguration(project: ProjectGraphProjectNode, target: string, configuration: string): any;
|
|
5
7
|
export declare function getSourceDirOfDependentProjects(projectName: string, projectGraph?: ProjectGraph): [
|
|
6
8
|
projectDirs: string[],
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.projectHasTarget = projectHasTarget;
|
|
4
|
+
exports.runnableForTarget = runnableForTarget;
|
|
4
5
|
exports.projectHasTargetAndConfiguration = projectHasTargetAndConfiguration;
|
|
5
6
|
exports.getSourceDirOfDependentProjects = getSourceDirOfDependentProjects;
|
|
6
7
|
exports.findAllProjectNodeDependencies = findAllProjectNodeDependencies;
|
|
@@ -13,6 +14,17 @@ function projectHasTarget(project, target) {
|
|
|
13
14
|
project.data.targets &&
|
|
14
15
|
project.data.targets[target]);
|
|
15
16
|
}
|
|
17
|
+
/** The projects that define at least one of `targets`. */
|
|
18
|
+
function runnableForTarget(projects, targets) {
|
|
19
|
+
const runnable = new Set();
|
|
20
|
+
for (const projectName in projects) {
|
|
21
|
+
const project = projects[projectName];
|
|
22
|
+
if (targets.some((target) => projectHasTarget(project, target))) {
|
|
23
|
+
runnable.add(projectName);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
return runnable;
|
|
27
|
+
}
|
|
16
28
|
function projectHasTargetAndConfiguration(project, target, configuration) {
|
|
17
29
|
return (projectHasTarget(project, target) &&
|
|
18
30
|
project.data.targets[target].configurations &&
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nx",
|
|
3
|
-
"version": "23.3.0-beta.
|
|
3
|
+
"version": "23.3.0-beta.7",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"description": "The core Nx plugin contains the core functionality of Nx like the project graph, nx commands and task orchestration.",
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
},
|
|
12
12
|
"files": [
|
|
13
13
|
"dist/bin",
|
|
14
|
+
"dist/nx-cloud-internals.*",
|
|
14
15
|
"dist/plugins",
|
|
15
16
|
"dist/presets",
|
|
16
17
|
"dist/release",
|
|
@@ -114,7 +115,7 @@
|
|
|
114
115
|
"hasown": "2.0.4",
|
|
115
116
|
"https-proxy-agent": "5.0.1",
|
|
116
117
|
"ieee754": "1.2.1",
|
|
117
|
-
"ignore": "7.0.
|
|
118
|
+
"ignore": "7.0.6",
|
|
118
119
|
"inherits": "2.0.4",
|
|
119
120
|
"is-docker": "3.0.0",
|
|
120
121
|
"is-fullwidth-code-point": "3.0.0",
|
|
@@ -148,7 +149,7 @@
|
|
|
148
149
|
"restore-cursor": "3.1.0",
|
|
149
150
|
"run-applescript": "7.0.0",
|
|
150
151
|
"safe-buffer": "5.2.1",
|
|
151
|
-
"semver": "7.8.
|
|
152
|
+
"semver": "7.8.5",
|
|
152
153
|
"signal-exit": "3.0.7",
|
|
153
154
|
"sisteransi": "1.0.5",
|
|
154
155
|
"smol-toml": "1.7.1",
|
|
@@ -184,16 +185,16 @@
|
|
|
184
185
|
}
|
|
185
186
|
},
|
|
186
187
|
"optionalDependencies": {
|
|
187
|
-
"@nx/nx-darwin-arm64": "23.3.0-beta.
|
|
188
|
-
"@nx/nx-darwin-x64": "23.3.0-beta.
|
|
189
|
-
"@nx/nx-freebsd-x64": "23.3.0-beta.
|
|
190
|
-
"@nx/nx-linux-arm-gnueabihf": "23.3.0-beta.
|
|
191
|
-
"@nx/nx-linux-arm64-gnu": "23.3.0-beta.
|
|
192
|
-
"@nx/nx-linux-arm64-musl": "23.3.0-beta.
|
|
193
|
-
"@nx/nx-linux-x64-gnu": "23.3.0-beta.
|
|
194
|
-
"@nx/nx-linux-x64-musl": "23.3.0-beta.
|
|
195
|
-
"@nx/nx-win32-arm64-msvc": "23.3.0-beta.
|
|
196
|
-
"@nx/nx-win32-x64-msvc": "23.3.0-beta.
|
|
188
|
+
"@nx/nx-darwin-arm64": "23.3.0-beta.7",
|
|
189
|
+
"@nx/nx-darwin-x64": "23.3.0-beta.7",
|
|
190
|
+
"@nx/nx-freebsd-x64": "23.3.0-beta.7",
|
|
191
|
+
"@nx/nx-linux-arm-gnueabihf": "23.3.0-beta.7",
|
|
192
|
+
"@nx/nx-linux-arm64-gnu": "23.3.0-beta.7",
|
|
193
|
+
"@nx/nx-linux-arm64-musl": "23.3.0-beta.7",
|
|
194
|
+
"@nx/nx-linux-x64-gnu": "23.3.0-beta.7",
|
|
195
|
+
"@nx/nx-linux-x64-musl": "23.3.0-beta.7",
|
|
196
|
+
"@nx/nx-win32-arm64-msvc": "23.3.0-beta.7",
|
|
197
|
+
"@nx/nx-win32-x64-msvc": "23.3.0-beta.7"
|
|
197
198
|
},
|
|
198
199
|
"nx-migrations": {
|
|
199
200
|
"migrations": "./migrations.json",
|
|
@@ -278,6 +279,9 @@
|
|
|
278
279
|
},
|
|
279
280
|
"typesVersions": {
|
|
280
281
|
"*": {
|
|
282
|
+
"nx-cloud-internals": [
|
|
283
|
+
"dist/nx-cloud-internals.d.ts"
|
|
284
|
+
],
|
|
281
285
|
"bin/*": [
|
|
282
286
|
"dist/bin/*.d.ts"
|
|
283
287
|
],
|
|
@@ -366,6 +370,11 @@
|
|
|
366
370
|
},
|
|
367
371
|
"./package.json": "./package.json",
|
|
368
372
|
"./package": "./package.json",
|
|
373
|
+
"./nx-cloud-internals": {
|
|
374
|
+
"@nx/nx-source": "./nx-cloud-internals.ts",
|
|
375
|
+
"types": "./dist/nx-cloud-internals.d.ts",
|
|
376
|
+
"default": "./dist/nx-cloud-internals.js"
|
|
377
|
+
},
|
|
369
378
|
"./migrations.json": "./migrations.json",
|
|
370
379
|
"./migrations": "./migrations.json",
|
|
371
380
|
"./generators.json": "./generators.json",
|
package/schemas/nx-schema.json
CHANGED
|
@@ -924,6 +924,9 @@
|
|
|
924
924
|
"cache": {
|
|
925
925
|
"$ref": "#/definitions/targetDefaultsConfig/properties/cache"
|
|
926
926
|
},
|
|
927
|
+
"ultracache": {
|
|
928
|
+
"$ref": "#/definitions/targetDefaultsConfig/properties/ultracache"
|
|
929
|
+
},
|
|
927
930
|
"syncGenerators": {
|
|
928
931
|
"$ref": "#/definitions/targetDefaultsConfig/properties/syncGenerators"
|
|
929
932
|
}
|
|
@@ -1050,6 +1053,37 @@
|
|
|
1050
1053
|
"type": "boolean",
|
|
1051
1054
|
"description": "Specifies if the given target should be cacheable"
|
|
1052
1055
|
},
|
|
1056
|
+
"ultracache": {
|
|
1057
|
+
"type": "object",
|
|
1058
|
+
"description": "Configures ultracache for tasks of this target. Nx Cloud only.",
|
|
1059
|
+
"properties": {
|
|
1060
|
+
"...": {
|
|
1061
|
+
"type": "boolean",
|
|
1062
|
+
"const": true,
|
|
1063
|
+
"description": "Merges with the inherited ultracache configuration instead of replacing it. Keys before this token defer to the inherited value; keys after it win."
|
|
1064
|
+
},
|
|
1065
|
+
"mode": {
|
|
1066
|
+
"enum": ["on", "warn", "error", "off"],
|
|
1067
|
+
"default": "on",
|
|
1068
|
+
"description": "How this target's tasks participate. 'on' records IO and lets the recording stand in for the declared inputs and outputs. 'warn' records and reports undeclared reads and writes without applying them. 'error' is reserved for failing the task on an undeclared read or write; until per-target enforcement lands it behaves as 'warn'. 'off' records nothing."
|
|
1069
|
+
},
|
|
1070
|
+
"ignoredReads": {
|
|
1071
|
+
"type": "array",
|
|
1072
|
+
"items": {
|
|
1073
|
+
"type": "string"
|
|
1074
|
+
},
|
|
1075
|
+
"description": "Workspace-relative glob patterns for reads excluded from ultracache reports. The first path segment cannot contain '*', and '?', '!', '[', ']' and extglobs are not supported; anchor the pattern to a directory instead of leading with '**'."
|
|
1076
|
+
},
|
|
1077
|
+
"ignoredWrites": {
|
|
1078
|
+
"type": "array",
|
|
1079
|
+
"items": {
|
|
1080
|
+
"type": "string"
|
|
1081
|
+
},
|
|
1082
|
+
"description": "Workspace-relative glob patterns for writes excluded from ultracache reports. The first path segment cannot contain '*', and '?', '!', '[', ']' and extglobs are not supported; anchor the pattern to a directory instead of leading with '**'."
|
|
1083
|
+
}
|
|
1084
|
+
},
|
|
1085
|
+
"additionalProperties": false
|
|
1086
|
+
},
|
|
1053
1087
|
"syncGenerators": {
|
|
1054
1088
|
"type": "array",
|
|
1055
1089
|
"items": {
|
|
@@ -138,6 +138,37 @@
|
|
|
138
138
|
"type": "boolean",
|
|
139
139
|
"description": "Specifies if the given target should be cacheable"
|
|
140
140
|
},
|
|
141
|
+
"ultracache": {
|
|
142
|
+
"type": "object",
|
|
143
|
+
"description": "Configures ultracache for tasks of this target. Nx Cloud only.",
|
|
144
|
+
"properties": {
|
|
145
|
+
"...": {
|
|
146
|
+
"type": "boolean",
|
|
147
|
+
"const": true,
|
|
148
|
+
"description": "Merges with the inherited ultracache configuration instead of replacing it. Keys before this token defer to the inherited value; keys after it win."
|
|
149
|
+
},
|
|
150
|
+
"mode": {
|
|
151
|
+
"enum": ["on", "warn", "error", "off"],
|
|
152
|
+
"default": "on",
|
|
153
|
+
"description": "How this target's tasks participate. 'on' records IO and lets the recording stand in for the declared inputs and outputs. 'warn' records and reports undeclared reads and writes without applying them. 'error' is reserved for failing the task on an undeclared read or write; until per-target enforcement lands it behaves as 'warn'. 'off' records nothing."
|
|
154
|
+
},
|
|
155
|
+
"ignoredReads": {
|
|
156
|
+
"type": "array",
|
|
157
|
+
"items": {
|
|
158
|
+
"type": "string"
|
|
159
|
+
},
|
|
160
|
+
"description": "Workspace-relative glob patterns for reads excluded from ultracache reports. The first path segment cannot contain '*', and '?', '!', '[', ']' and extglobs are not supported; anchor the pattern to a directory instead of leading with '**'."
|
|
161
|
+
},
|
|
162
|
+
"ignoredWrites": {
|
|
163
|
+
"type": "array",
|
|
164
|
+
"items": {
|
|
165
|
+
"type": "string"
|
|
166
|
+
},
|
|
167
|
+
"description": "Workspace-relative glob patterns for writes excluded from ultracache reports. The first path segment cannot contain '*', and '?', '!', '[', ']' and extglobs are not supported; anchor the pattern to a directory instead of leading with '**'."
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
"additionalProperties": false
|
|
171
|
+
},
|
|
141
172
|
"continuous": {
|
|
142
173
|
"type": "boolean",
|
|
143
174
|
"default": false,
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getTouchedProjectsFromProjectGlobChanges = void 0;
|
|
4
|
-
const minimatch_1 = require("minimatch");
|
|
5
|
-
const nx_json_1 = require("../../../config/nx-json");
|
|
6
|
-
const workspace_root_1 = require("../../../utils/workspace-root");
|
|
7
|
-
const globs_1 = require("../../../utils/globs");
|
|
8
|
-
const get_plugins_1 = require("../../plugins/get-plugins");
|
|
9
|
-
const file_utils_1 = require("../../file-utils");
|
|
10
|
-
const getTouchedProjectsFromProjectGlobChanges = async (touchedFiles, projectGraphNodes, _nxJson, _packageJson, _projectGraph, projectDeletionAffectsAllProjects = true) => {
|
|
11
|
-
// Only deletions matter here. Uses `isDeletedFile`, not `getChanges()`,
|
|
12
|
-
// which also parses json/lock files at two revisions for every touched file.
|
|
13
|
-
const deleted = touchedFiles.filter((touchedFile) => (0, file_utils_1.isDeletedFile)(touchedFile.file));
|
|
14
|
-
if (!deleted.length) {
|
|
15
|
-
return [];
|
|
16
|
-
}
|
|
17
|
-
const globPattern = await (async () => {
|
|
18
|
-
if (process.env.NX_FORCE_REUSE_CACHED_GRAPH === 'true') {
|
|
19
|
-
return (0, globs_1.combineGlobPatterns)([
|
|
20
|
-
'**/package.json',
|
|
21
|
-
'**/project.json',
|
|
22
|
-
'project.json',
|
|
23
|
-
'package.json',
|
|
24
|
-
]);
|
|
25
|
-
}
|
|
26
|
-
const nxJson = (0, nx_json_1.readNxJson)(workspace_root_1.workspaceRoot);
|
|
27
|
-
const capabilities = await (0, get_plugins_1.capabilitiesOfConfiguredPlugins)(nxJson, workspace_root_1.workspaceRoot);
|
|
28
|
-
return (0, globs_1.combineGlobPatterns)(capabilities
|
|
29
|
-
.map((capability) => capability.createNodesPattern)
|
|
30
|
-
.filter((pattern) => !!pattern));
|
|
31
|
-
})();
|
|
32
|
-
const configDeleted = deleted.some((touchedFile) => (0, minimatch_1.minimatch)(touchedFile.file, globPattern, { dot: true }));
|
|
33
|
-
// If any project has been deleted, we must assume all projects were
|
|
34
|
-
// affected. A modified project configuration is under its own project's
|
|
35
|
-
// root, which marks that project affected without this locator.
|
|
36
|
-
return configDeleted && projectDeletionAffectsAllProjects
|
|
37
|
-
? Object.keys(projectGraphNodes)
|
|
38
|
-
: [];
|
|
39
|
-
};
|
|
40
|
-
exports.getTouchedProjectsFromProjectGlobChanges = getTouchedProjectsFromProjectGlobChanges;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { WholeFileChange } from '../../file-utils';
|
|
2
|
-
import { JsonChange } from '../../../utils/json-diff';
|
|
3
|
-
import { TouchedProjectLocator } from '../affected-project-graph-models';
|
|
4
|
-
export declare const getTouchedProjectsInWorkspaceJson: TouchedProjectLocator<WholeFileChange | JsonChange>;
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getTouchedProjectsInWorkspaceJson = void 0;
|
|
4
|
-
const file_utils_1 = require("../../file-utils");
|
|
5
|
-
const json_diff_1 = require("../../../utils/json-diff");
|
|
6
|
-
const getTouchedProjectsInWorkspaceJson = (touchedFiles, projectGraphNodes) => {
|
|
7
|
-
const workspaceChange = touchedFiles.find((change) => change.file === `angular.json`);
|
|
8
|
-
if (!workspaceChange) {
|
|
9
|
-
return [];
|
|
10
|
-
}
|
|
11
|
-
const changes = workspaceChange.getChanges();
|
|
12
|
-
if (changes.some((change) => {
|
|
13
|
-
if ((0, json_diff_1.isJsonChange)(change)) {
|
|
14
|
-
return change.path[0] !== 'projects';
|
|
15
|
-
}
|
|
16
|
-
if ((0, file_utils_1.isWholeFileChange)(change)) {
|
|
17
|
-
return true;
|
|
18
|
-
}
|
|
19
|
-
return false;
|
|
20
|
-
})) {
|
|
21
|
-
return Object.keys(projectGraphNodes);
|
|
22
|
-
}
|
|
23
|
-
const touched = [];
|
|
24
|
-
for (let i = 0; i < changes.length; i++) {
|
|
25
|
-
const change = changes[i];
|
|
26
|
-
if (!(0, json_diff_1.isJsonChange)(change) || change.path[0] !== 'projects') {
|
|
27
|
-
continue;
|
|
28
|
-
}
|
|
29
|
-
// Only look for changes that are changes to the whole project definition
|
|
30
|
-
if (change.path.length !== 2) {
|
|
31
|
-
continue;
|
|
32
|
-
}
|
|
33
|
-
switch (change.type) {
|
|
34
|
-
case json_diff_1.JsonDiffType.Deleted: {
|
|
35
|
-
// We are not sure which projects used to depend on a deleted project
|
|
36
|
-
// so return all projects to be safe
|
|
37
|
-
return Object.keys(projectGraphNodes);
|
|
38
|
-
}
|
|
39
|
-
default: {
|
|
40
|
-
// Add the project name
|
|
41
|
-
touched.push(change.path[1]);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
return touched;
|
|
46
|
-
};
|
|
47
|
-
exports.getTouchedProjectsInWorkspaceJson = getTouchedProjectsInWorkspaceJson;
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getImplicitlyTouchedProjects = exports.getTouchedProjects = void 0;
|
|
4
|
-
const minimatch_1 = require("minimatch");
|
|
5
|
-
const find_project_for_path_1 = require("../../utils/find-project-for-path");
|
|
6
|
-
const getTouchedProjects = (touchedFiles, projectGraphNodes) => {
|
|
7
|
-
const projectRootMap = (0, find_project_for_path_1.createProjectRootMappings)(projectGraphNodes);
|
|
8
|
-
return touchedFiles.reduce((affected, f) => {
|
|
9
|
-
const matchingProject = (0, find_project_for_path_1.findProjectForPath)(f.file, projectRootMap);
|
|
10
|
-
if (matchingProject) {
|
|
11
|
-
affected.push(matchingProject);
|
|
12
|
-
}
|
|
13
|
-
return affected;
|
|
14
|
-
}, []);
|
|
15
|
-
};
|
|
16
|
-
exports.getTouchedProjects = getTouchedProjects;
|
|
17
|
-
const getImplicitlyTouchedProjects = (fileChanges, projectGraphNodes, nxJson) => {
|
|
18
|
-
const implicits = {
|
|
19
|
-
'nx.json': '*',
|
|
20
|
-
};
|
|
21
|
-
Object.values(projectGraphNodes || {}).forEach((node) => {
|
|
22
|
-
const namedInputs = {
|
|
23
|
-
...nxJson.namedInputs,
|
|
24
|
-
...node.data.namedInputs,
|
|
25
|
-
};
|
|
26
|
-
extractFilesFromTargetInputs(node.data.targets, namedInputs).forEach((input) => {
|
|
27
|
-
implicits[input] ??= [];
|
|
28
|
-
if (Array.isArray(implicits[input])) {
|
|
29
|
-
implicits[input].push(node.name);
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
});
|
|
33
|
-
const touched = new Set();
|
|
34
|
-
for (const [pattern, projects] of Object.entries(implicits)) {
|
|
35
|
-
const implicitDependencyWasChanged = fileChanges.some((f) => (0, minimatch_1.minimatch)(f.file, pattern, { dot: true }));
|
|
36
|
-
if (!implicitDependencyWasChanged) {
|
|
37
|
-
continue;
|
|
38
|
-
}
|
|
39
|
-
// File change affects all projects, just return all projects.
|
|
40
|
-
if (projects === '*') {
|
|
41
|
-
return Object.keys(projectGraphNodes);
|
|
42
|
-
}
|
|
43
|
-
else if (Array.isArray(projects)) {
|
|
44
|
-
projects.forEach((project) => touched.add(project));
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
return Array.from(touched);
|
|
48
|
-
};
|
|
49
|
-
exports.getImplicitlyTouchedProjects = getImplicitlyTouchedProjects;
|
|
50
|
-
function extractFilesFromTargetInputs(targets, namedInputs) {
|
|
51
|
-
const globalFiles = [];
|
|
52
|
-
for (const target of Object.values(targets || {})) {
|
|
53
|
-
if (target.inputs) {
|
|
54
|
-
globalFiles.push(...extractFilesFromInputs(target.inputs, namedInputs));
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
return globalFiles;
|
|
58
|
-
}
|
|
59
|
-
function extractFilesFromInputs(inputs, namedInputs) {
|
|
60
|
-
const globalFiles = [];
|
|
61
|
-
for (const input of inputs) {
|
|
62
|
-
if (typeof input === 'string' && input in namedInputs) {
|
|
63
|
-
globalFiles.push(...extractFilesFromInputs(namedInputs[input], namedInputs));
|
|
64
|
-
}
|
|
65
|
-
else if (typeof input === 'string' &&
|
|
66
|
-
input.startsWith('{workspaceRoot}/')) {
|
|
67
|
-
globalFiles.push(input.substring('{workspaceRoot}/'.length));
|
|
68
|
-
}
|
|
69
|
-
else if (input.fileset && input.fileset.startsWith('{workspaceRoot}/')) {
|
|
70
|
-
globalFiles.push(input.fileset.substring('{workspaceRoot}/'.length));
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
return globalFiles;
|
|
74
|
-
}
|