nx 19.7.0-beta.1 → 19.7.0-beta.3
Sign up to get free protection for your applications and to get access to all the features.
- package/.eslintrc.json +12 -1
- package/package.json +13 -13
- package/schemas/nx-schema.json +7 -0
- package/src/command-line/connect/connect-to-nx-cloud.js +7 -6
- package/src/command-line/graph/graph.d.ts +18 -1
- package/src/command-line/graph/graph.js +35 -18
- package/src/command-line/login/command-object.d.ts +2 -0
- package/src/command-line/login/command-object.js +16 -0
- package/src/command-line/login/login.d.ts +5 -0
- package/src/command-line/login/login.js +16 -0
- package/src/command-line/logout/command-object.d.ts +2 -0
- package/src/command-line/logout/command-object.js +12 -0
- package/src/command-line/logout/logout.d.ts +4 -0
- package/src/command-line/logout/logout.js +13 -0
- package/src/command-line/migrate/migrate.js +5 -36
- package/src/command-line/nx-commands.js +7 -3
- package/src/command-line/release/index.d.ts +6 -4
- package/src/command-line/sync/sync.js +12 -1
- package/src/command-line/yargs-utils/shared-options.d.ts +2 -1
- package/src/command-line/yargs-utils/shared-options.js +11 -15
- package/src/config/nx-json.d.ts +5 -1
- package/src/core/graph/main.js +1 -1
- package/src/core/graph/styles.css +1 -1
- package/src/core/graph/styles.js +1 -1
- package/src/daemon/client/client.js +4 -2
- package/src/daemon/server/sync-generators.js +11 -3
- package/src/devkit-exports.d.ts +1 -0
- package/src/executors/run-commands/run-commands.impl.js +8 -3
- package/src/hasher/node-task-hasher-impl.d.ts +1 -1
- package/src/hasher/node-task-hasher-impl.js +34 -16
- package/src/native/nx.wasm32-wasi.wasm +0 -0
- package/src/nx-cloud/update-manager.d.ts +1 -1
- package/src/nx-cloud/utilities/axios.js +1 -6
- package/src/plugins/js/package-json/create-package-json.d.ts +1 -0
- package/src/plugins/js/package-json/create-package-json.js +24 -0
- package/src/tasks-runner/cache.js +2 -2
- package/src/tasks-runner/default-tasks-runner.js +1 -1
- package/src/tasks-runner/init-tasks-runner.d.ts +2 -0
- package/src/tasks-runner/init-tasks-runner.js +1 -0
- package/src/tasks-runner/life-cycles/invoke-runner-terminal-output-life-cycle.d.ts +4 -6
- package/src/tasks-runner/life-cycles/invoke-runner-terminal-output-life-cycle.js +5 -0
- package/src/tasks-runner/run-command.js +2 -11
- package/src/tasks-runner/task-env.d.ts +3 -3
- package/src/tasks-runner/task-env.js +3 -3
- package/src/tasks-runner/task-orchestrator.d.ts +2 -1
- package/src/tasks-runner/task-orchestrator.js +5 -2
- package/src/utils/package-json.d.ts +3 -0
- package/src/utils/sync-generators.d.ts +6 -3
- package/src/utils/sync-generators.js +27 -5
@@ -1,5 +1,7 @@
|
|
1
1
|
import type { GeneratorCallback } from '../config/misc-interfaces';
|
2
|
+
import { type NxJsonConfiguration } from '../config/nx-json';
|
2
3
|
import type { ProjectGraph } from '../config/project-graph';
|
4
|
+
import type { TaskGraph } from '../config/task-graph';
|
3
5
|
import type { ProjectConfiguration } from '../config/workspace-json-project-json';
|
4
6
|
import { FsTree, type FileChange, type Tree } from '../generators/tree';
|
5
7
|
export type SyncGeneratorResult = void | {
|
@@ -15,8 +17,9 @@ export type SyncGeneratorChangesResult = {
|
|
15
17
|
};
|
16
18
|
export declare function getSyncGeneratorChanges(generators: string[]): Promise<SyncGeneratorChangesResult[]>;
|
17
19
|
export declare function flushSyncGeneratorChanges(results: SyncGeneratorChangesResult[]): Promise<void>;
|
18
|
-
export declare function collectAllRegisteredSyncGenerators(projectGraph: ProjectGraph): Promise<string[]>;
|
20
|
+
export declare function collectAllRegisteredSyncGenerators(projectGraph: ProjectGraph, nxJson: NxJsonConfiguration): Promise<string[]>;
|
19
21
|
export declare function runSyncGenerator(tree: FsTree, generatorSpecifier: string, projects: Record<string, ProjectConfiguration>): Promise<SyncGeneratorChangesResult>;
|
20
|
-
export declare function
|
21
|
-
export declare function
|
22
|
+
export declare function collectEnabledTaskSyncGeneratorsFromProjectGraph(projectGraph: ProjectGraph, nxJson: NxJsonConfiguration): Set<string>;
|
23
|
+
export declare function collectEnabledTaskSyncGeneratorsFromTaskGraph(taskGraph: TaskGraph, projectGraph: ProjectGraph, nxJson: NxJsonConfiguration): Set<string>;
|
24
|
+
export declare function collectRegisteredGlobalSyncGenerators(nxJson?: NxJsonConfiguration<string[] | "*">): Set<string>;
|
22
25
|
export declare function syncGeneratorResultsToMessageLines(results: SyncGeneratorChangesResult[]): string[];
|
@@ -4,7 +4,8 @@ exports.getSyncGeneratorChanges = getSyncGeneratorChanges;
|
|
4
4
|
exports.flushSyncGeneratorChanges = flushSyncGeneratorChanges;
|
5
5
|
exports.collectAllRegisteredSyncGenerators = collectAllRegisteredSyncGenerators;
|
6
6
|
exports.runSyncGenerator = runSyncGenerator;
|
7
|
-
exports.
|
7
|
+
exports.collectEnabledTaskSyncGeneratorsFromProjectGraph = collectEnabledTaskSyncGeneratorsFromProjectGraph;
|
8
|
+
exports.collectEnabledTaskSyncGeneratorsFromTaskGraph = collectEnabledTaskSyncGeneratorsFromTaskGraph;
|
8
9
|
exports.collectRegisteredGlobalSyncGenerators = collectRegisteredGlobalSyncGenerators;
|
9
10
|
exports.syncGeneratorResultsToMessageLines = syncGeneratorResultsToMessageLines;
|
10
11
|
const perf_hooks_1 = require("perf_hooks");
|
@@ -39,10 +40,10 @@ async function flushSyncGeneratorChanges(results) {
|
|
39
40
|
await client_1.daemonClient.flushSyncGeneratorChangesToDisk(results.map((r) => r.generatorName));
|
40
41
|
}
|
41
42
|
}
|
42
|
-
async function collectAllRegisteredSyncGenerators(projectGraph) {
|
43
|
+
async function collectAllRegisteredSyncGenerators(projectGraph, nxJson) {
|
43
44
|
if (!client_1.daemonClient.enabled()) {
|
44
45
|
return [
|
45
|
-
...
|
46
|
+
...collectEnabledTaskSyncGeneratorsFromProjectGraph(projectGraph, nxJson),
|
46
47
|
...collectRegisteredGlobalSyncGenerators(),
|
47
48
|
];
|
48
49
|
}
|
@@ -69,17 +70,38 @@ async function runSyncGenerator(tree, generatorSpecifier, projects) {
|
|
69
70
|
outOfSyncMessage,
|
70
71
|
};
|
71
72
|
}
|
72
|
-
function
|
73
|
+
function collectEnabledTaskSyncGeneratorsFromProjectGraph(projectGraph, nxJson) {
|
73
74
|
const taskSyncGenerators = new Set();
|
75
|
+
const disabledTaskSyncGenerators = new Set(nxJson.sync?.disabledTaskSyncGenerators ?? []);
|
74
76
|
for (const { data: { targets }, } of Object.values(projectGraph.nodes)) {
|
75
77
|
if (!targets) {
|
76
78
|
continue;
|
77
79
|
}
|
78
80
|
for (const target of Object.values(targets)) {
|
79
|
-
if (!target.syncGenerators) {
|
81
|
+
if (!target.syncGenerators?.length) {
|
80
82
|
continue;
|
81
83
|
}
|
82
84
|
for (const generator of target.syncGenerators) {
|
85
|
+
if (!disabledTaskSyncGenerators.has(generator) &&
|
86
|
+
!taskSyncGenerators.has(generator)) {
|
87
|
+
taskSyncGenerators.add(generator);
|
88
|
+
}
|
89
|
+
}
|
90
|
+
}
|
91
|
+
}
|
92
|
+
return taskSyncGenerators;
|
93
|
+
}
|
94
|
+
function collectEnabledTaskSyncGeneratorsFromTaskGraph(taskGraph, projectGraph, nxJson) {
|
95
|
+
const taskSyncGenerators = new Set();
|
96
|
+
const disabledTaskSyncGenerators = new Set(nxJson.sync?.disabledTaskSyncGenerators ?? []);
|
97
|
+
for (const { target } of Object.values(taskGraph.tasks)) {
|
98
|
+
const { syncGenerators } = projectGraph.nodes[target.project].data.targets[target.target];
|
99
|
+
if (!syncGenerators?.length) {
|
100
|
+
continue;
|
101
|
+
}
|
102
|
+
for (const generator of syncGenerators) {
|
103
|
+
if (!disabledTaskSyncGenerators.has(generator) &&
|
104
|
+
!taskSyncGenerators.has(generator)) {
|
83
105
|
taskSyncGenerators.add(generator);
|
84
106
|
}
|
85
107
|
}
|