nx 21.0.0-canary.20250206-8bd0bcd → 21.0.0-canary.20250416-caa26a7
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/.eslintrc.json +5 -1
- package/package.json +13 -12
- package/release/index.d.ts +1 -1
- package/release/index.js +2 -1
- package/schemas/nx-schema.json +186 -35
- package/src/adapter/compat.d.ts +1 -1
- package/src/adapter/compat.js +3 -0
- package/src/command-line/add/add.js +6 -16
- package/src/command-line/affected/command-object.js +6 -6
- package/src/command-line/examples.js +0 -4
- package/src/command-line/exec/command-object.js +1 -1
- package/src/command-line/generate/generator-utils.js +8 -3
- package/src/command-line/graph/graph.js +2 -0
- package/src/command-line/import/import.js +1 -1
- package/src/command-line/init/command-object.js +18 -6
- package/src/command-line/init/configure-plugins.d.ts +6 -7
- package/src/command-line/init/configure-plugins.js +47 -35
- package/src/command-line/init/implementation/add-nx-to-turborepo.d.ts +4 -0
- package/src/command-line/init/implementation/add-nx-to-turborepo.js +49 -0
- package/src/command-line/init/implementation/check-compatible-with-plugins.js +7 -1
- package/src/command-line/init/implementation/deduce-default-base.d.ts +1 -0
- package/src/command-line/init/implementation/deduce-default-base.js +53 -0
- package/src/command-line/init/implementation/react/add-vite-commands-to-package-scripts.js +6 -4
- package/src/command-line/init/implementation/react/index.d.ts +1 -1
- package/src/command-line/init/implementation/react/index.js +32 -185
- package/src/command-line/init/implementation/react/write-vite-config.js +19 -3
- package/src/command-line/init/implementation/utils.d.ts +4 -1
- package/src/command-line/init/implementation/utils.js +108 -44
- package/src/command-line/init/init-v1.js +1 -1
- package/src/command-line/init/init-v2.d.ts +1 -0
- package/src/command-line/init/init-v2.js +68 -38
- package/src/command-line/nx-commands.js +19 -5
- package/src/command-line/register/command-object.d.ts +6 -0
- package/src/command-line/{activate-powerpack → register}/command-object.js +9 -9
- package/src/command-line/register/register.d.ts +2 -0
- package/src/command-line/register/register.js +9 -0
- package/src/command-line/release/changelog.js +18 -15
- package/src/command-line/release/command-object.d.ts +2 -0
- package/src/command-line/release/command-object.js +9 -0
- package/src/command-line/release/config/config.d.ts +8 -7
- package/src/command-line/release/config/config.js +129 -42
- package/src/command-line/release/config/use-legacy-versioning.d.ts +2 -0
- package/src/command-line/release/config/use-legacy-versioning.js +9 -0
- package/src/command-line/release/index.d.ts +4 -0
- package/src/command-line/release/index.js +6 -1
- package/src/command-line/release/plan-check.js +6 -3
- package/src/command-line/release/plan.js +7 -3
- package/src/command-line/release/publish.js +7 -3
- package/src/command-line/release/release.js +8 -3
- package/src/command-line/release/utils/batch-projects-by-generator-config.js +6 -3
- package/src/command-line/release/utils/git.d.ts +3 -2
- package/src/command-line/release/utils/git.js +65 -9
- package/src/command-line/release/utils/github.js +3 -1
- package/src/command-line/release/utils/resolve-semver-specifier.d.ts +2 -1
- package/src/command-line/release/utils/resolve-semver-specifier.js +2 -1
- package/src/command-line/release/utils/semver.d.ts +8 -0
- package/src/command-line/release/utils/semver.js +8 -0
- package/src/command-line/release/utils/shared-legacy.d.ts +25 -0
- package/src/command-line/release/utils/shared-legacy.js +2 -0
- package/src/command-line/release/utils/shared.d.ts +11 -17
- package/src/command-line/release/version/derive-specifier-from-conventional-commits.d.ts +7 -0
- package/src/command-line/release/version/derive-specifier-from-conventional-commits.js +47 -0
- package/src/command-line/release/version/deriver-specifier-from-version-plans.d.ts +8 -0
- package/src/command-line/release/version/deriver-specifier-from-version-plans.js +59 -0
- package/src/command-line/release/version/project-logger.d.ts +8 -0
- package/src/command-line/release/version/project-logger.js +45 -0
- package/src/command-line/release/version/release-group-processor.d.ts +251 -0
- package/src/command-line/release/version/release-group-processor.js +1040 -0
- package/src/command-line/release/version/resolve-current-version.d.ts +32 -0
- package/src/command-line/release/version/resolve-current-version.js +241 -0
- package/src/command-line/release/version/test-utils.d.ts +95 -0
- package/src/command-line/release/version/test-utils.js +416 -0
- package/src/command-line/release/version/topological-sort.d.ts +9 -0
- package/src/command-line/release/version/topological-sort.js +41 -0
- package/src/command-line/release/version/version-actions.d.ts +170 -0
- package/src/command-line/release/version/version-actions.js +183 -0
- package/src/command-line/release/version-legacy.d.ts +46 -0
- package/src/command-line/release/version-legacy.js +453 -0
- package/src/command-line/release/version.d.ts +0 -40
- package/src/command-line/release/version.js +80 -262
- package/src/command-line/report/report.d.ts +7 -3
- package/src/command-line/report/report.js +52 -18
- package/src/command-line/run/command-object.js +2 -2
- package/src/command-line/run/run.js +1 -1
- package/src/command-line/run-many/command-object.js +2 -2
- package/src/command-line/yargs-utils/shared-options.d.ts +4 -0
- package/src/command-line/yargs-utils/shared-options.js +20 -0
- package/src/commands-runner/get-command-projects.js +17 -2
- package/src/config/nx-json.d.ts +153 -15
- package/src/config/project-graph.d.ts +4 -2
- package/src/config/project-graph.js +8 -0
- package/src/config/task-graph.d.ts +5 -0
- package/src/config/workspace-json-project-json.d.ts +6 -2
- package/src/core/graph/main.js +1 -1
- package/src/core/graph/runtime.js +1 -1
- package/src/core/graph/styles.css +2 -2
- package/src/core/graph/styles.js +1 -1
- package/src/daemon/client/client.d.ts +2 -0
- package/src/daemon/client/client.js +15 -0
- package/src/daemon/message-types/glob.d.ts +7 -0
- package/src/daemon/message-types/glob.js +9 -1
- package/src/daemon/message-types/hash-glob.d.ts +6 -0
- package/src/daemon/message-types/hash-glob.js +9 -1
- package/src/daemon/server/handle-glob.d.ts +1 -0
- package/src/daemon/server/handle-glob.js +8 -0
- package/src/daemon/server/handle-hash-glob.d.ts +1 -0
- package/src/daemon/server/handle-hash-glob.js +8 -0
- package/src/daemon/server/logger.js +2 -1
- package/src/daemon/server/server.js +7 -0
- package/src/devkit-internals.d.ts +2 -1
- package/src/devkit-internals.js +4 -1
- package/src/executors/run-commands/run-commands.impl.d.ts +18 -17
- package/src/executors/run-commands/run-commands.impl.js +25 -292
- package/src/executors/run-commands/running-tasks.d.ts +40 -0
- package/src/executors/run-commands/running-tasks.js +386 -0
- package/src/executors/run-script/run-script.impl.js +4 -3
- package/src/generators/internal-utils/format-changed-files-with-prettier-if-available.js +8 -0
- package/src/generators/testing-utils/create-tree.js +5 -1
- package/src/native/index.d.ts +94 -19
- package/src/native/index.js +16 -2
- package/src/native/native-bindings.js +6 -0
- package/src/native/nx.wasi-browser.js +20 -19
- package/src/native/nx.wasi.cjs +20 -19
- package/src/native/nx.wasm32-wasi.wasm +0 -0
- package/src/nx-cloud/nx-cloud-tasks-runner-shell.js +3 -3
- package/src/plugins/js/lock-file/lock-file.js +28 -13
- package/src/plugins/js/lock-file/utils/package-json.d.ts +1 -1
- package/src/plugins/js/lock-file/utils/package-json.js +2 -1
- package/src/plugins/js/lock-file/yarn-parser.js +85 -39
- package/src/plugins/js/project-graph/affected/lock-file-changes.js +1 -0
- package/src/plugins/js/project-graph/build-dependencies/explicit-project-dependencies.js +1 -1
- package/src/plugins/js/project-graph/build-dependencies/target-project-locator.d.ts +10 -1
- package/src/plugins/js/project-graph/build-dependencies/target-project-locator.js +59 -6
- package/src/plugins/js/utils/packages.js +22 -3
- package/src/plugins/js/utils/register.js +1 -0
- package/src/plugins/js/utils/typescript.js +3 -3
- package/src/plugins/package-json/create-nodes.d.ts +1 -1
- package/src/plugins/package-json/create-nodes.js +3 -1
- package/src/project-graph/affected/locators/project-glob-changes.js +2 -2
- package/src/project-graph/error-types.js +32 -2
- package/src/project-graph/plugins/get-plugins.js +2 -1
- package/src/project-graph/plugins/in-process-loader.js +1 -1
- package/src/project-graph/plugins/isolation/plugin-worker.js +12 -6
- package/src/project-graph/plugins/loaded-nx-plugin.d.ts +2 -1
- package/src/project-graph/plugins/utils.d.ts +2 -2
- package/src/project-graph/plugins/utils.js +2 -2
- package/src/project-graph/project-graph.js +1 -1
- package/src/project-graph/utils/project-configuration-utils.d.ts +1 -1
- package/src/project-graph/utils/project-configuration-utils.js +25 -11
- package/src/project-graph/utils/retrieve-workspace-files.d.ts +1 -1
- package/src/project-graph/utils/retrieve-workspace-files.js +14 -18
- package/src/tasks-runner/batch/batch-messages.d.ts +2 -0
- package/src/tasks-runner/batch/run-batch.js +2 -3
- package/src/tasks-runner/cache.d.ts +20 -6
- package/src/tasks-runner/cache.js +104 -20
- package/src/tasks-runner/create-task-graph.d.ts +4 -1
- package/src/tasks-runner/create-task-graph.js +48 -16
- package/src/tasks-runner/default-tasks-runner.js +4 -13
- package/src/tasks-runner/forked-process-task-runner.d.ts +13 -14
- package/src/tasks-runner/forked-process-task-runner.js +160 -303
- package/src/tasks-runner/init-tasks-runner.d.ts +15 -1
- package/src/tasks-runner/init-tasks-runner.js +59 -2
- package/src/tasks-runner/is-tui-enabled.d.ts +2 -0
- package/src/tasks-runner/is-tui-enabled.js +58 -0
- package/src/tasks-runner/life-cycle.d.ts +10 -3
- package/src/tasks-runner/life-cycle.js +23 -2
- package/src/tasks-runner/life-cycles/task-history-life-cycle-old.js +7 -2
- package/src/tasks-runner/life-cycles/task-history-life-cycle.js +6 -1
- package/src/tasks-runner/life-cycles/tui-summary-life-cycle.d.ts +17 -0
- package/src/tasks-runner/life-cycles/tui-summary-life-cycle.js +221 -0
- package/src/tasks-runner/pseudo-terminal.d.ts +17 -8
- package/src/tasks-runner/pseudo-terminal.js +63 -47
- package/src/tasks-runner/run-command.d.ts +1 -0
- package/src/tasks-runner/run-command.js +180 -23
- package/src/tasks-runner/running-tasks/batch-process.d.ts +14 -0
- package/src/tasks-runner/running-tasks/batch-process.js +70 -0
- package/src/tasks-runner/running-tasks/node-child-process.d.ts +36 -0
- package/src/tasks-runner/running-tasks/node-child-process.js +184 -0
- package/src/tasks-runner/running-tasks/noop-child-process.d.ts +15 -0
- package/src/tasks-runner/running-tasks/noop-child-process.js +19 -0
- package/src/tasks-runner/running-tasks/running-task.d.ts +8 -0
- package/src/tasks-runner/running-tasks/running-task.js +6 -0
- package/src/tasks-runner/task-env.d.ts +1 -4
- package/src/tasks-runner/task-env.js +2 -0
- package/src/tasks-runner/task-orchestrator.d.ts +25 -7
- package/src/tasks-runner/task-orchestrator.js +237 -95
- package/src/tasks-runner/tasks-schedule.js +5 -1
- package/src/tasks-runner/utils.d.ts +2 -10
- package/src/tasks-runner/utils.js +27 -15
- package/src/utils/child-process.d.ts +4 -0
- package/src/utils/child-process.js +23 -30
- package/src/utils/command-line-utils.d.ts +1 -1
- package/src/utils/find-matching-projects.js +2 -2
- package/src/utils/handle-errors.js +15 -0
- package/src/utils/is-ci.js +4 -1
- package/src/utils/is-using-prettier.d.ts +3 -0
- package/src/utils/is-using-prettier.js +62 -0
- package/src/utils/nx-key.d.ts +7 -0
- package/src/utils/nx-key.js +52 -0
- package/src/utils/package-manager.js +2 -2
- package/src/utils/path.js +1 -1
- package/src/utils/require-nx-key.d.ts +1 -0
- package/src/utils/require-nx-key.js +22 -0
- package/src/utils/workspace-context.d.ts +2 -0
- package/src/utils/workspace-context.js +16 -0
- package/src/command-line/activate-powerpack/activate-powerpack.d.ts +0 -2
- package/src/command-line/activate-powerpack/activate-powerpack.js +0 -34
- package/src/command-line/activate-powerpack/command-object.d.ts +0 -6
- package/src/command-line/init/implementation/react/write-craco-config.d.ts +0 -1
- package/src/command-line/init/implementation/react/write-craco-config.js +0 -61
- package/src/utils/powerpack.d.ts +0 -5
- package/src/utils/powerpack.js +0 -33
@@ -1,23 +1,29 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.TaskOrchestrator = void 0;
|
4
|
+
exports.getThreadCount = getThreadCount;
|
4
5
|
const events_1 = require("events");
|
5
|
-
const perf_hooks_1 = require("perf_hooks");
|
6
|
-
const path_1 = require("path");
|
7
6
|
const fs_1 = require("fs");
|
7
|
+
const path_1 = require("path");
|
8
|
+
const perf_hooks_1 = require("perf_hooks");
|
8
9
|
const run_commands_impl_1 = require("../executors/run-commands/run-commands.impl");
|
9
|
-
const forked_process_task_runner_1 = require("./forked-process-task-runner");
|
10
|
-
const cache_1 = require("./cache");
|
11
|
-
const utils_1 = require("./utils");
|
12
|
-
const tasks_schedule_1 = require("./tasks-schedule");
|
13
10
|
const hash_task_1 = require("../hasher/hash-task");
|
14
|
-
const
|
15
|
-
const
|
11
|
+
const native_1 = require("../native");
|
12
|
+
const db_connection_1 = require("../utils/db-connection");
|
16
13
|
const output_1 = require("../utils/output");
|
17
14
|
const params_1 = require("../utils/params");
|
15
|
+
const workspace_root_1 = require("../utils/workspace-root");
|
16
|
+
const cache_1 = require("./cache");
|
17
|
+
const forked_process_task_runner_1 = require("./forked-process-task-runner");
|
18
|
+
const is_tui_enabled_1 = require("./is-tui-enabled");
|
19
|
+
const pseudo_terminal_1 = require("./pseudo-terminal");
|
20
|
+
const noop_child_process_1 = require("./running-tasks/noop-child-process");
|
21
|
+
const task_env_1 = require("./task-env");
|
22
|
+
const tasks_schedule_1 = require("./tasks-schedule");
|
23
|
+
const utils_1 = require("./utils");
|
18
24
|
class TaskOrchestrator {
|
19
25
|
// endregion internal state
|
20
|
-
constructor(hasher, initiatingProject, projectGraph, taskGraph, nxJson, options, bail, daemon, outputStyle) {
|
26
|
+
constructor(hasher, initiatingProject, projectGraph, taskGraph, nxJson, options, bail, daemon, outputStyle, taskGraphForHashing = taskGraph) {
|
21
27
|
this.hasher = hasher;
|
22
28
|
this.initiatingProject = initiatingProject;
|
23
29
|
this.projectGraph = projectGraph;
|
@@ -27,9 +33,12 @@ class TaskOrchestrator {
|
|
27
33
|
this.bail = bail;
|
28
34
|
this.daemon = daemon;
|
29
35
|
this.outputStyle = outputStyle;
|
36
|
+
this.taskGraphForHashing = taskGraphForHashing;
|
30
37
|
this.taskDetails = (0, hash_task_1.getTaskDetails)();
|
31
38
|
this.cache = (0, cache_1.getCache)(this.options);
|
32
|
-
this.
|
39
|
+
this.tuiEnabled = (0, is_tui_enabled_1.isTuiEnabled)(this.nxJson);
|
40
|
+
this.forkedProcessTaskRunner = new forked_process_task_runner_1.ForkedProcessTaskRunner(this.options, this.tuiEnabled);
|
41
|
+
this.runningTasksService = new native_1.RunningTasksService((0, db_connection_1.getDbConnection)());
|
33
42
|
this.tasksSchedule = new tasks_schedule_1.TasksSchedule(this.projectGraph, this.taskGraph, this.options);
|
34
43
|
// region internal state
|
35
44
|
this.batchEnv = (0, task_env_1.getEnvVariablesForBatchProcess)(this.options.skipNxCache, this.options.captureStderr);
|
@@ -40,28 +49,47 @@ class TaskOrchestrator {
|
|
40
49
|
this.waitingForTasks = [];
|
41
50
|
this.groups = [];
|
42
51
|
this.bailed = false;
|
52
|
+
this.runningContinuousTasks = new Map();
|
53
|
+
this.cleaningUp = false;
|
43
54
|
}
|
44
|
-
async
|
55
|
+
async init() {
|
45
56
|
// Init the ForkedProcessTaskRunner, TasksSchedule, and Cache
|
46
57
|
await Promise.all([
|
47
58
|
this.forkedProcessTaskRunner.init(),
|
48
59
|
this.tasksSchedule.init(),
|
49
60
|
'init' in this.cache ? this.cache.init() : null,
|
50
61
|
]);
|
62
|
+
}
|
63
|
+
async run() {
|
64
|
+
await this.init();
|
51
65
|
// initial scheduling
|
52
66
|
await this.tasksSchedule.scheduleNextTasks();
|
53
67
|
perf_hooks_1.performance.mark('task-execution:start');
|
68
|
+
const threadCount = getThreadCount(this.options, this.taskGraph);
|
54
69
|
const threads = [];
|
55
|
-
process.stdout.setMaxListeners(
|
56
|
-
process.stderr.setMaxListeners(
|
70
|
+
process.stdout.setMaxListeners(threadCount + events_1.defaultMaxListeners);
|
71
|
+
process.stderr.setMaxListeners(threadCount + events_1.defaultMaxListeners);
|
57
72
|
// initial seeding of the queue
|
58
|
-
for (let i = 0; i <
|
73
|
+
for (let i = 0; i < threadCount; ++i) {
|
59
74
|
threads.push(this.executeNextBatchOfTasksUsingTaskSchedule());
|
60
75
|
}
|
61
|
-
await Promise.
|
76
|
+
await Promise.race([
|
77
|
+
Promise.all(threads),
|
78
|
+
...(this.tuiEnabled
|
79
|
+
? [
|
80
|
+
new Promise((resolve) => {
|
81
|
+
this.options.lifeCycle.registerForcedShutdownCallback(() => {
|
82
|
+
// The user force quit the TUI with ctrl+c, so proceed onto cleanup
|
83
|
+
resolve(undefined);
|
84
|
+
});
|
85
|
+
}),
|
86
|
+
]
|
87
|
+
: []),
|
88
|
+
]);
|
62
89
|
perf_hooks_1.performance.mark('task-execution:end');
|
63
90
|
perf_hooks_1.performance.measure('task-execution', 'task-execution:start', 'task-execution:end');
|
64
91
|
this.cache.removeOldCacheRecords();
|
92
|
+
await this.cleanup();
|
65
93
|
return this.completedTasks;
|
66
94
|
}
|
67
95
|
async executeNextBatchOfTasksUsingTaskSchedule() {
|
@@ -82,7 +110,12 @@ class TaskOrchestrator {
|
|
82
110
|
const task = this.tasksSchedule.nextTask();
|
83
111
|
if (task) {
|
84
112
|
const groupId = this.closeGroup();
|
85
|
-
|
113
|
+
if (task.continuous) {
|
114
|
+
await this.startContinuousTask(task, groupId);
|
115
|
+
}
|
116
|
+
else {
|
117
|
+
await this.applyFromCacheOrRunTask(doNotSkipCache, task, groupId);
|
118
|
+
}
|
86
119
|
this.openGroup(groupId);
|
87
120
|
return this.executeNextBatchOfTasksUsingTaskSchedule();
|
88
121
|
}
|
@@ -90,11 +123,11 @@ class TaskOrchestrator {
|
|
90
123
|
return new Promise((res) => this.waitingForTasks.push(res)).then(() => this.executeNextBatchOfTasksUsingTaskSchedule());
|
91
124
|
}
|
92
125
|
// region Processing Scheduled Tasks
|
93
|
-
async
|
126
|
+
async processTask(taskId) {
|
94
127
|
const task = this.taskGraph.tasks[taskId];
|
95
128
|
const taskSpecificEnv = (0, task_env_1.getTaskSpecificEnv)(task);
|
96
129
|
if (!task.hash) {
|
97
|
-
await (0, hash_task_1.hashTask)(this.hasher, this.projectGraph, this.
|
130
|
+
await (0, hash_task_1.hashTask)(this.hasher, this.projectGraph, this.taskGraphForHashing, task, taskSpecificEnv, this.taskDetails);
|
98
131
|
}
|
99
132
|
await this.options.lifeCycle.scheduleTask(task);
|
100
133
|
return taskSpecificEnv;
|
@@ -102,7 +135,7 @@ class TaskOrchestrator {
|
|
102
135
|
async processScheduledBatch(batch) {
|
103
136
|
await Promise.all(Object.values(batch.taskGraph.tasks).map(async (task) => {
|
104
137
|
if (!task.hash) {
|
105
|
-
await (0, hash_task_1.hashTask)(this.hasher, this.projectGraph, this.
|
138
|
+
await (0, hash_task_1.hashTask)(this.hasher, this.projectGraph, this.taskGraphForHashing, task, this.batchEnv, this.taskDetails);
|
106
139
|
}
|
107
140
|
await this.options.lifeCycle.scheduleTask(task);
|
108
141
|
}));
|
@@ -115,7 +148,7 @@ class TaskOrchestrator {
|
|
115
148
|
for (const taskId of scheduledTasks) {
|
116
149
|
// Task is already handled or being handled
|
117
150
|
if (!this.processedTasks.has(taskId)) {
|
118
|
-
this.processedTasks.set(taskId, this.
|
151
|
+
this.processedTasks.set(taskId, this.processTask(taskId));
|
119
152
|
}
|
120
153
|
}
|
121
154
|
}
|
@@ -131,7 +164,12 @@ class TaskOrchestrator {
|
|
131
164
|
if (!cachedResult || cachedResult.code !== 0)
|
132
165
|
return null;
|
133
166
|
const outputs = task.outputs;
|
134
|
-
const shouldCopyOutputsFromCache =
|
167
|
+
const shouldCopyOutputsFromCache =
|
168
|
+
// No output files to restore
|
169
|
+
!!outputs.length &&
|
170
|
+
// Remote caches are restored to output dirs when applied and using db cache
|
171
|
+
(!cachedResult.remote || !(0, cache_1.dbCacheEnabled)(this.nxJson)) &&
|
172
|
+
// Output files have not been touched since last run
|
135
173
|
(await this.shouldCopyOutputsFromCache(outputs, task.hash));
|
136
174
|
if (shouldCopyOutputsFromCache) {
|
137
175
|
await this.cache.copyFilesFromCache(task.hash, cachedResult, outputs);
|
@@ -143,6 +181,7 @@ class TaskOrchestrator {
|
|
143
181
|
: 'local-cache-kept-existing';
|
144
182
|
this.options.lifeCycle.printTaskTerminalOutput(task, status, cachedResult.terminalOutput);
|
145
183
|
return {
|
184
|
+
code: cachedResult.code,
|
146
185
|
task,
|
147
186
|
status,
|
148
187
|
};
|
@@ -166,6 +205,7 @@ class TaskOrchestrator {
|
|
166
205
|
results.push(...batchResults);
|
167
206
|
}
|
168
207
|
await this.postRunSteps(tasks, results, doNotSkipCache, { groupId });
|
208
|
+
this.forkedProcessTaskRunner.cleanUpBatchProcesses();
|
169
209
|
const tasksCompleted = taskEntries.filter(([taskId]) => this.completedTasks[taskId]);
|
170
210
|
// Batch is still not done, run it again
|
171
211
|
if (tasksCompleted.length !== taskEntries.length) {
|
@@ -177,7 +217,8 @@ class TaskOrchestrator {
|
|
177
217
|
}
|
178
218
|
async runBatch(batch, env) {
|
179
219
|
try {
|
180
|
-
const
|
220
|
+
const batchProcess = await this.forkedProcessTaskRunner.forkProcessForBatch(batch, this.projectGraph, this.taskGraph, env);
|
221
|
+
const results = await batchProcess.getResults();
|
181
222
|
const batchResultEntries = Object.entries(results);
|
182
223
|
return batchResultEntries.map(([taskId, result]) => ({
|
183
224
|
...result,
|
@@ -217,88 +258,112 @@ class TaskOrchestrator {
|
|
217
258
|
let results = doNotSkipCache ? await this.applyCachedResults([task]) : [];
|
218
259
|
// the task wasn't cached
|
219
260
|
if (results.length === 0) {
|
220
|
-
const
|
221
|
-
const
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
}
|
246
|
-
|
247
|
-
|
248
|
-
const
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
261
|
+
const childProcess = await this.runTask(task, streamOutput, env, temporaryOutputPath, pipeOutput);
|
262
|
+
const { code, terminalOutput } = await childProcess.getResults();
|
263
|
+
results.push({
|
264
|
+
task,
|
265
|
+
code,
|
266
|
+
status: code === 0 ? 'success' : 'failure',
|
267
|
+
terminalOutput,
|
268
|
+
});
|
269
|
+
}
|
270
|
+
await this.postRunSteps([task], results, doNotSkipCache, { groupId });
|
271
|
+
return results[0];
|
272
|
+
}
|
273
|
+
async runTask(task, streamOutput, env, temporaryOutputPath, pipeOutput) {
|
274
|
+
const shouldPrefix = streamOutput && process.env.NX_PREFIX_OUTPUT === 'true';
|
275
|
+
const targetConfiguration = (0, utils_1.getTargetConfigurationForTask)(task, this.projectGraph);
|
276
|
+
if (process.env.NX_RUN_COMMANDS_DIRECTLY !== 'false' &&
|
277
|
+
targetConfiguration.executor === 'nx:run-commands' &&
|
278
|
+
!shouldPrefix) {
|
279
|
+
try {
|
280
|
+
const { schema } = (0, utils_1.getExecutorForTask)(task, this.projectGraph);
|
281
|
+
const combinedOptions = (0, params_1.combineOptionsForExecutor)(task.overrides, task.target.configuration ?? targetConfiguration.defaultConfiguration, targetConfiguration, schema, task.target.project, (0, path_1.relative)(task.projectRoot ?? workspace_root_1.workspaceRoot, process.cwd()), process.env.NX_VERBOSE_LOGGING === 'true');
|
282
|
+
if (combinedOptions.env) {
|
283
|
+
env = {
|
284
|
+
...env,
|
285
|
+
...combinedOptions.env,
|
286
|
+
};
|
287
|
+
}
|
288
|
+
if (streamOutput) {
|
289
|
+
const args = (0, utils_1.getPrintableCommandArgsForTask)(task);
|
290
|
+
output_1.output.logCommand(args.join(' '));
|
291
|
+
}
|
292
|
+
const runCommandsOptions = {
|
293
|
+
...combinedOptions,
|
294
|
+
env,
|
295
|
+
usePty: this.tuiEnabled ||
|
296
|
+
(!this.tasksSchedule.hasTasks() &&
|
297
|
+
this.runningContinuousTasks.size === 0),
|
298
|
+
streamOutput,
|
299
|
+
};
|
300
|
+
const runningTask = await (0, run_commands_impl_1.runCommands)(runCommandsOptions, {
|
301
|
+
root: workspace_root_1.workspaceRoot, // only root is needed in runCommands
|
302
|
+
});
|
303
|
+
if (this.tuiEnabled && runningTask instanceof pseudo_terminal_1.PseudoTtyProcess) {
|
304
|
+
// This is an external of a the pseudo terminal where a task is running and can be passed to the TUI
|
305
|
+
this.options.lifeCycle.registerRunningTask(task.id, runningTask.getParserAndWriter());
|
258
306
|
}
|
259
|
-
|
260
|
-
if (
|
261
|
-
|
307
|
+
if (!streamOutput) {
|
308
|
+
if (runningTask instanceof pseudo_terminal_1.PseudoTtyProcess) {
|
309
|
+
// TODO: shouldn't this be checking if the task is continuous before writing anything to disk or calling printTaskTerminalOutput?
|
310
|
+
let terminalOutput = '';
|
311
|
+
runningTask.onOutput((data) => {
|
312
|
+
terminalOutput += data;
|
313
|
+
});
|
314
|
+
runningTask.onExit((code) => {
|
315
|
+
this.options.lifeCycle.printTaskTerminalOutput(task, code === 0 ? 'success' : 'failure', terminalOutput);
|
316
|
+
(0, fs_1.writeFileSync)(temporaryOutputPath, terminalOutput);
|
317
|
+
});
|
262
318
|
}
|
263
319
|
else {
|
264
|
-
|
320
|
+
runningTask.onExit((code, terminalOutput) => {
|
321
|
+
this.options.lifeCycle.printTaskTerminalOutput(task, code === 0 ? 'success' : 'failure', terminalOutput);
|
322
|
+
(0, fs_1.writeFileSync)(temporaryOutputPath, terminalOutput);
|
323
|
+
});
|
265
324
|
}
|
266
|
-
const terminalOutput = e.stack ?? e.message ?? '';
|
267
|
-
(0, fs_1.writeFileSync)(temporaryOutputPath, terminalOutput);
|
268
|
-
results.push({
|
269
|
-
task,
|
270
|
-
status: 'failure',
|
271
|
-
terminalOutput,
|
272
|
-
});
|
273
325
|
}
|
326
|
+
return runningTask;
|
274
327
|
}
|
275
|
-
|
276
|
-
(
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
}
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
results.push({
|
287
|
-
task,
|
288
|
-
status: code === 0 ? 'success' : 'failure',
|
328
|
+
catch (e) {
|
329
|
+
if (process.env.NX_VERBOSE_LOGGING === 'true') {
|
330
|
+
console.error(e);
|
331
|
+
}
|
332
|
+
else {
|
333
|
+
console.error(e.message);
|
334
|
+
}
|
335
|
+
const terminalOutput = e.stack ?? e.message ?? '';
|
336
|
+
(0, fs_1.writeFileSync)(temporaryOutputPath, terminalOutput);
|
337
|
+
return new noop_child_process_1.NoopChildProcess({
|
338
|
+
code: 1,
|
289
339
|
terminalOutput,
|
290
340
|
});
|
291
341
|
}
|
292
342
|
}
|
293
|
-
|
343
|
+
else if (targetConfiguration.executor === 'nx:noop') {
|
344
|
+
(0, fs_1.writeFileSync)(temporaryOutputPath, '');
|
345
|
+
return new noop_child_process_1.NoopChildProcess({
|
346
|
+
code: 0,
|
347
|
+
terminalOutput: '',
|
348
|
+
});
|
349
|
+
}
|
350
|
+
else {
|
351
|
+
// cache prep
|
352
|
+
const runningTask = await this.runTaskInForkedProcess(task, env, pipeOutput, temporaryOutputPath, streamOutput);
|
353
|
+
if (this.tuiEnabled && runningTask instanceof pseudo_terminal_1.PseudoTtyProcess) {
|
354
|
+
// This is an external of a the pseudo terminal where a task is running and can be passed to the TUI
|
355
|
+
this.options.lifeCycle.registerRunningTask(task.id, runningTask.getParserAndWriter());
|
356
|
+
}
|
357
|
+
return runningTask;
|
358
|
+
}
|
294
359
|
}
|
295
360
|
async runTaskInForkedProcess(task, env, pipeOutput, temporaryOutputPath, streamOutput) {
|
296
361
|
try {
|
297
362
|
const usePtyFork = process.env.NX_NATIVE_COMMAND_RUNNER !== 'false';
|
298
|
-
// Disable the pseudo terminal if this is a run-many
|
299
|
-
const disablePseudoTerminal = !this.initiatingProject;
|
363
|
+
// Disable the pseudo terminal if this is a run-many or when running a continuous task as part of a run-one
|
364
|
+
const disablePseudoTerminal = !this.tuiEnabled && (!this.initiatingProject || task.continuous);
|
300
365
|
// execution
|
301
|
-
const
|
366
|
+
const childProcess = usePtyFork
|
302
367
|
? await this.forkedProcessTaskRunner.forkProcess(task, {
|
303
368
|
temporaryOutputPath,
|
304
369
|
streamOutput,
|
@@ -314,19 +379,62 @@ class TaskOrchestrator {
|
|
314
379
|
taskGraph: this.taskGraph,
|
315
380
|
env,
|
316
381
|
});
|
317
|
-
return
|
318
|
-
code,
|
319
|
-
terminalOutput,
|
320
|
-
};
|
382
|
+
return childProcess;
|
321
383
|
}
|
322
384
|
catch (e) {
|
323
385
|
if (process.env.NX_VERBOSE_LOGGING === 'true') {
|
324
386
|
console.error(e);
|
325
387
|
}
|
326
|
-
return {
|
388
|
+
return new noop_child_process_1.NoopChildProcess({
|
327
389
|
code: 1,
|
328
|
-
|
390
|
+
terminalOutput: undefined,
|
391
|
+
});
|
392
|
+
}
|
393
|
+
}
|
394
|
+
async startContinuousTask(task, groupId) {
|
395
|
+
if (this.runningTasksService.getRunningTasks([task.id]).length) {
|
396
|
+
await this.preRunSteps([task], { groupId });
|
397
|
+
if (this.tuiEnabled) {
|
398
|
+
this.options.lifeCycle.setTaskStatus(task.id, 8 /* NativeTaskStatus.Shared */);
|
399
|
+
}
|
400
|
+
// task is already running by another process, we schedule the next tasks
|
401
|
+
// and release the threads
|
402
|
+
await this.scheduleNextTasksAndReleaseThreads();
|
403
|
+
// wait for the running task to finish
|
404
|
+
do {
|
405
|
+
console.log(`Waiting for ${task.id} in another nx process`);
|
406
|
+
await new Promise((resolve) => setTimeout(resolve, 100));
|
407
|
+
} while (this.runningTasksService.getRunningTasks([task.id]).length);
|
408
|
+
return;
|
409
|
+
}
|
410
|
+
const taskSpecificEnv = await this.processedTasks.get(task.id);
|
411
|
+
await this.preRunSteps([task], { groupId });
|
412
|
+
const pipeOutput = await this.pipeOutputCapture(task);
|
413
|
+
// obtain metadata
|
414
|
+
const temporaryOutputPath = this.cache.temporaryOutputPath(task);
|
415
|
+
const streamOutput = this.outputStyle === 'static'
|
416
|
+
? false
|
417
|
+
: (0, utils_1.shouldStreamOutput)(task, this.initiatingProject);
|
418
|
+
let env = pipeOutput
|
419
|
+
? (0, task_env_1.getEnvVariablesForTask)(task, taskSpecificEnv, process.env.FORCE_COLOR === undefined
|
420
|
+
? 'true'
|
421
|
+
: process.env.FORCE_COLOR, this.options.skipNxCache, this.options.captureStderr, null, null)
|
422
|
+
: (0, task_env_1.getEnvVariablesForTask)(task, taskSpecificEnv, undefined, this.options.skipNxCache, this.options.captureStderr, temporaryOutputPath, streamOutput);
|
423
|
+
const childProcess = await this.runTask(task, streamOutput, env, temporaryOutputPath, pipeOutput);
|
424
|
+
this.runningTasksService.addRunningTask(task.id);
|
425
|
+
this.runningContinuousTasks.set(task.id, childProcess);
|
426
|
+
childProcess.onExit(() => {
|
427
|
+
this.runningTasksService.removeRunningTask(task.id);
|
428
|
+
});
|
429
|
+
if (this.initiatingProject === task.target.project &&
|
430
|
+
this.options.targets.length === 1 &&
|
431
|
+
this.options.targets[0] === task.target.target) {
|
432
|
+
await childProcess.getResults();
|
433
|
+
}
|
434
|
+
else {
|
435
|
+
await this.scheduleNextTasksAndReleaseThreads();
|
329
436
|
}
|
437
|
+
return childProcess;
|
330
438
|
}
|
331
439
|
// endregion Single Task
|
332
440
|
// region Lifecycle
|
@@ -387,6 +495,9 @@ class TaskOrchestrator {
|
|
387
495
|
status,
|
388
496
|
};
|
389
497
|
}));
|
498
|
+
await this.scheduleNextTasksAndReleaseThreads();
|
499
|
+
}
|
500
|
+
async scheduleNextTasksAndReleaseThreads() {
|
390
501
|
await this.tasksSchedule.scheduleNextTasks();
|
391
502
|
// release blocked threads
|
392
503
|
this.waitingForTasks.forEach((f) => f(null));
|
@@ -458,5 +569,36 @@ class TaskOrchestrator {
|
|
458
569
|
return this.daemon.recordOutputsHash(task.outputs, task.hash);
|
459
570
|
}
|
460
571
|
}
|
572
|
+
// endregion utils
|
573
|
+
async cleanup() {
|
574
|
+
this.cleaningUp = true;
|
575
|
+
await Promise.all(Array.from(this.runningContinuousTasks).map(async ([taskId, t]) => {
|
576
|
+
try {
|
577
|
+
return t.kill();
|
578
|
+
}
|
579
|
+
catch (e) {
|
580
|
+
console.error(`Unable to terminate ${taskId}\nError:`, e);
|
581
|
+
}
|
582
|
+
finally {
|
583
|
+
this.runningTasksService.removeRunningTask(taskId);
|
584
|
+
}
|
585
|
+
}));
|
586
|
+
}
|
461
587
|
}
|
462
588
|
exports.TaskOrchestrator = TaskOrchestrator;
|
589
|
+
function getThreadCount(options, taskGraph) {
|
590
|
+
if (options['parallel'] === 'false' ||
|
591
|
+
options['parallel'] === false) {
|
592
|
+
options['parallel'] = 1;
|
593
|
+
}
|
594
|
+
else if (options['parallel'] === 'true' ||
|
595
|
+
options['parallel'] === true ||
|
596
|
+
options['parallel'] === undefined ||
|
597
|
+
options['parallel'] === '') {
|
598
|
+
options['parallel'] = Number(options['maxParallel'] || 3);
|
599
|
+
}
|
600
|
+
const maxParallel = options['parallel'] +
|
601
|
+
Object.values(taskGraph.tasks).filter((t) => t.continuous).length;
|
602
|
+
const totalTasks = Object.keys(taskGraph.tasks).length;
|
603
|
+
return Math.min(maxParallel, totalTasks);
|
604
|
+
}
|
@@ -147,11 +147,14 @@ class TasksSchedule {
|
|
147
147
|
{
|
148
148
|
tasks: {},
|
149
149
|
dependencies: {},
|
150
|
+
continuousDependencies: {},
|
150
151
|
roots: [],
|
151
152
|
});
|
152
153
|
batch.tasks[task.id] = task;
|
153
154
|
batch.dependencies[task.id] =
|
154
155
|
this.notScheduledTaskGraph.dependencies[task.id];
|
156
|
+
batch.continuousDependencies[task.id] =
|
157
|
+
this.notScheduledTaskGraph.continuousDependencies[task.id];
|
155
158
|
if (isRoot) {
|
156
159
|
batch.roots.push(task.id);
|
157
160
|
}
|
@@ -168,8 +171,9 @@ class TasksSchedule {
|
|
168
171
|
}
|
169
172
|
canBeScheduled(taskId) {
|
170
173
|
const hasDependenciesCompleted = this.taskGraph.dependencies[taskId].every((id) => this.completedTasks.has(id));
|
174
|
+
const hasContinuousDependenciesStarted = this.taskGraph.continuousDependencies[taskId].every((id) => this.runningTasks.has(id));
|
171
175
|
// if dependencies have not completed, cannot schedule
|
172
|
-
if (!hasDependenciesCompleted) {
|
176
|
+
if (!hasDependenciesCompleted || !hasContinuousDependenciesStarted) {
|
173
177
|
return false;
|
174
178
|
}
|
175
179
|
// if there are no running tasks, can schedule anything
|
@@ -1,7 +1,7 @@
|
|
1
|
-
import {
|
1
|
+
import { CustomHasher, ExecutorConfig } from '../config/misc-interfaces';
|
2
2
|
import { ProjectGraph, ProjectGraphProjectNode } from '../config/project-graph';
|
3
|
+
import { Task, TaskGraph } from '../config/task-graph';
|
3
4
|
import { TargetConfiguration, TargetDependencyConfig } from '../config/workspace-json-project-json';
|
4
|
-
import { CustomHasher, ExecutorConfig } from '../config/misc-interfaces';
|
5
5
|
export type NormalizedTargetDependencyConfig = TargetDependencyConfig & {
|
6
6
|
projects: string[];
|
7
7
|
};
|
@@ -37,14 +37,6 @@ export declare function getExecutorForTask(task: Task, projectGraph: ProjectGrap
|
|
37
37
|
};
|
38
38
|
export declare function getCustomHasher(task: Task, projectGraph: ProjectGraph): CustomHasher | null;
|
39
39
|
export declare function removeTasksFromTaskGraph(graph: TaskGraph, ids: string[]): TaskGraph;
|
40
|
-
export declare function removeIdsFromGraph<T>(graph: {
|
41
|
-
roots: string[];
|
42
|
-
dependencies: Record<string, string[]>;
|
43
|
-
}, ids: string[], mapWithIds: Record<string, T>): {
|
44
|
-
mapWithIds: Record<string, T>;
|
45
|
-
roots: string[];
|
46
|
-
dependencies: Record<string, string[]>;
|
47
|
-
};
|
48
40
|
export declare function calculateReverseDeps(taskGraph: TaskGraph): Record<string, string[]>;
|
49
41
|
export declare function getCliPath(): string;
|
50
42
|
export declare function getPrintableCommandArgsForTask(task: Task): string[];
|
@@ -17,7 +17,6 @@ exports.getExecutorNameForTask = getExecutorNameForTask;
|
|
17
17
|
exports.getExecutorForTask = getExecutorForTask;
|
18
18
|
exports.getCustomHasher = getCustomHasher;
|
19
19
|
exports.removeTasksFromTaskGraph = removeTasksFromTaskGraph;
|
20
|
-
exports.removeIdsFromGraph = removeIdsFromGraph;
|
21
20
|
exports.calculateReverseDeps = calculateReverseDeps;
|
22
21
|
exports.getCliPath = getCliPath;
|
23
22
|
exports.getPrintableCommandArgsForTask = getPrintableCommandArgsForTask;
|
@@ -25,19 +24,20 @@ exports.getSerializedArgsForTask = getSerializedArgsForTask;
|
|
25
24
|
exports.shouldStreamOutput = shouldStreamOutput;
|
26
25
|
exports.isCacheableTask = isCacheableTask;
|
27
26
|
exports.unparse = unparse;
|
28
|
-
const
|
29
|
-
const
|
30
|
-
const
|
31
|
-
const path_2 = require("../utils/path");
|
32
|
-
const fileutils_1 = require("../utils/fileutils");
|
33
|
-
const serialize_overrides_into_command_line_1 = require("../utils/serialize-overrides-into-command-line");
|
34
|
-
const split_target_1 = require("../utils/split-target");
|
27
|
+
const minimatch_1 = require("minimatch");
|
28
|
+
const node_path_1 = require("node:path");
|
29
|
+
const posix_1 = require("node:path/posix");
|
35
30
|
const executor_utils_1 = require("../command-line/run/executor-utils");
|
31
|
+
const native_1 = require("../native");
|
36
32
|
const project_graph_1 = require("../project-graph/project-graph");
|
33
|
+
const fileutils_1 = require("../utils/fileutils");
|
37
34
|
const find_matching_projects_1 = require("../utils/find-matching-projects");
|
38
|
-
const minimatch_1 = require("minimatch");
|
39
35
|
const globs_1 = require("../utils/globs");
|
40
|
-
const
|
36
|
+
const path_1 = require("../utils/path");
|
37
|
+
const serialize_overrides_into_command_line_1 = require("../utils/serialize-overrides-into-command-line");
|
38
|
+
const split_target_1 = require("../utils/split-target");
|
39
|
+
const workspace_root_1 = require("../utils/workspace-root");
|
40
|
+
const is_tui_enabled_1 = require("./is-tui-enabled");
|
41
41
|
function getDependencyConfigs({ project, target }, extraTargetDependencies, projectGraph, allTargetNames) {
|
42
42
|
const dependencyConfigs = (projectGraph.nodes[project].data?.targets[target]?.dependsOn ??
|
43
43
|
// This is passed into `run-command` from programmatic invocations
|
@@ -194,10 +194,10 @@ function transformLegacyOutputs(projectRoot, outputs) {
|
|
194
194
|
: [false, output];
|
195
195
|
const relativePath = (0, fileutils_1.isRelativePath)(outputPath)
|
196
196
|
? output
|
197
|
-
: (0,
|
197
|
+
: (0, node_path_1.relative)(projectRoot, outputPath);
|
198
198
|
const isWithinProject = !relativePath.startsWith('..');
|
199
199
|
return ((isNegated ? '!' : '') +
|
200
|
-
(0,
|
200
|
+
(0, path_1.joinPathFragments)(isWithinProject ? '{projectRoot}' : '{workspaceRoot}', isWithinProject ? relativePath : outputPath));
|
201
201
|
});
|
202
202
|
}
|
203
203
|
/**
|
@@ -302,27 +302,31 @@ function getCustomHasher(task, projectGraph) {
|
|
302
302
|
return factory ? factory() : null;
|
303
303
|
}
|
304
304
|
function removeTasksFromTaskGraph(graph, ids) {
|
305
|
-
const newGraph =
|
305
|
+
const newGraph = removeIdsFromTaskGraph(graph, ids, graph.tasks);
|
306
306
|
return {
|
307
307
|
dependencies: newGraph.dependencies,
|
308
|
+
continuousDependencies: newGraph.continuousDependencies,
|
308
309
|
roots: newGraph.roots,
|
309
310
|
tasks: newGraph.mapWithIds,
|
310
311
|
};
|
311
312
|
}
|
312
|
-
function
|
313
|
+
function removeIdsFromTaskGraph(graph, ids, mapWithIds) {
|
313
314
|
const filteredMapWithIds = {};
|
314
315
|
const dependencies = {};
|
316
|
+
const continuousDependencies = {};
|
315
317
|
const removedSet = new Set(ids);
|
316
318
|
for (let id of Object.keys(mapWithIds)) {
|
317
319
|
if (!removedSet.has(id)) {
|
318
320
|
filteredMapWithIds[id] = mapWithIds[id];
|
319
321
|
dependencies[id] = graph.dependencies[id].filter((depId) => !removedSet.has(depId));
|
322
|
+
continuousDependencies[id] = graph.continuousDependencies[id].filter((depId) => !removedSet.has(depId));
|
320
323
|
}
|
321
324
|
}
|
322
325
|
return {
|
323
326
|
mapWithIds: filteredMapWithIds,
|
324
327
|
dependencies: dependencies,
|
325
|
-
|
328
|
+
continuousDependencies,
|
329
|
+
roots: Object.keys(filteredMapWithIds).filter((k) => dependencies[k].length === 0 && continuousDependencies[k].length === 0),
|
326
330
|
};
|
327
331
|
}
|
328
332
|
function calculateReverseDeps(taskGraph) {
|
@@ -335,6 +339,11 @@ function calculateReverseDeps(taskGraph) {
|
|
335
339
|
reverseTaskDeps[d].push(taskId);
|
336
340
|
});
|
337
341
|
});
|
342
|
+
Object.keys(taskGraph.continuousDependencies).forEach((taskId) => {
|
343
|
+
taskGraph.continuousDependencies[taskId].forEach((d) => {
|
344
|
+
reverseTaskDeps[d].push(taskId);
|
345
|
+
});
|
346
|
+
});
|
338
347
|
return reverseTaskDeps;
|
339
348
|
}
|
340
349
|
function getCliPath() {
|
@@ -360,6 +369,9 @@ function getSerializedArgsForTask(task, isVerbose) {
|
|
360
369
|
];
|
361
370
|
}
|
362
371
|
function shouldStreamOutput(task, initiatingProject) {
|
372
|
+
// For now, disable streaming output on the JS side when running the TUI
|
373
|
+
if ((0, is_tui_enabled_1.isTuiEnabled)())
|
374
|
+
return false;
|
363
375
|
if (process.env.NX_STREAM_OUTPUT === 'true')
|
364
376
|
return true;
|
365
377
|
if (longRunningTask(task))
|
@@ -1,11 +1,15 @@
|
|
1
1
|
import { type ExecOptions, type ExecSyncOptions } from 'child_process';
|
2
|
+
import { PackageManagerCommands } from './package-manager';
|
2
3
|
import { ChildProcess } from '../native';
|
4
|
+
export declare function getRunNxBaseCommand(packageManagerCommand?: PackageManagerCommands, cwd?: string): string;
|
3
5
|
export declare function runNxSync(cmd: string, options?: ExecSyncOptions & {
|
4
6
|
cwd?: string;
|
7
|
+
packageManagerCommand?: PackageManagerCommands;
|
5
8
|
}): void;
|
6
9
|
export declare function runNxAsync(cmd: string, options?: ExecOptions & {
|
7
10
|
cwd?: string;
|
8
11
|
silent?: boolean;
|
12
|
+
packageManagerCommand?: PackageManagerCommands;
|
9
13
|
}): Promise<void>;
|
10
14
|
export declare class PseudoTtyProcess {
|
11
15
|
private childProcess;
|