nx 21.0.0-canary.20250206-8bd0bcd → 21.0.0-canary.20250418-8619c1d
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/migrate/migrate-ui-api.d.ts +56 -0
- package/src/command-line/migrate/migrate-ui-api.js +188 -0
- package/src/command-line/migrate/migrate.d.ts +17 -0
- package/src/command-line/migrate/migrate.js +106 -63
- 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/misc-interfaces.d.ts +10 -0
- 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 +64 -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/git-utils.d.ts +1 -1
- package/src/utils/git-utils.js +8 -3
- 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
@@ -0,0 +1,184 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.NodeChildProcessWithDirectOutput = exports.NodeChildProcessWithNonDirectOutput = void 0;
|
4
|
+
const exit_codes_1 = require("../../utils/exit-codes");
|
5
|
+
const stream_1 = require("stream");
|
6
|
+
const chalk = require("chalk");
|
7
|
+
const fs_1 = require("fs");
|
8
|
+
class NodeChildProcessWithNonDirectOutput {
|
9
|
+
constructor(childProcess, { streamOutput, prefix }) {
|
10
|
+
this.childProcess = childProcess;
|
11
|
+
this.terminalOutput = '';
|
12
|
+
this.exitCallbacks = [];
|
13
|
+
if (streamOutput) {
|
14
|
+
if (process.env.NX_PREFIX_OUTPUT === 'true') {
|
15
|
+
const color = getColor(prefix);
|
16
|
+
const prefixText = `${prefix}:`;
|
17
|
+
this.childProcess.stdout
|
18
|
+
.pipe(logClearLineToPrefixTransformer(color.bold(prefixText) + ' '))
|
19
|
+
.pipe(addPrefixTransformer(color.bold(prefixText)))
|
20
|
+
.pipe(process.stdout);
|
21
|
+
this.childProcess.stderr
|
22
|
+
.pipe(logClearLineToPrefixTransformer(color(prefixText) + ' '))
|
23
|
+
.pipe(addPrefixTransformer(color(prefixText)))
|
24
|
+
.pipe(process.stderr);
|
25
|
+
}
|
26
|
+
else {
|
27
|
+
this.childProcess.stdout
|
28
|
+
.pipe(addPrefixTransformer())
|
29
|
+
.pipe(process.stdout);
|
30
|
+
this.childProcess.stderr
|
31
|
+
.pipe(addPrefixTransformer())
|
32
|
+
.pipe(process.stderr);
|
33
|
+
}
|
34
|
+
}
|
35
|
+
this.childProcess.on('exit', (code, signal) => {
|
36
|
+
if (code === null)
|
37
|
+
code = (0, exit_codes_1.signalToCode)(signal);
|
38
|
+
for (const cb of this.exitCallbacks) {
|
39
|
+
cb(code, this.terminalOutput);
|
40
|
+
}
|
41
|
+
});
|
42
|
+
// Re-emit any messages from the task process
|
43
|
+
this.childProcess.on('message', (message) => {
|
44
|
+
if (process.send) {
|
45
|
+
process.send(message);
|
46
|
+
}
|
47
|
+
});
|
48
|
+
this.childProcess.stdout.on('data', (chunk) => {
|
49
|
+
this.terminalOutput += chunk.toString();
|
50
|
+
});
|
51
|
+
this.childProcess.stderr.on('data', (chunk) => {
|
52
|
+
this.terminalOutput += chunk.toString();
|
53
|
+
});
|
54
|
+
}
|
55
|
+
onExit(cb) {
|
56
|
+
this.exitCallbacks.push(cb);
|
57
|
+
}
|
58
|
+
async getResults() {
|
59
|
+
return new Promise((res) => {
|
60
|
+
this.onExit((code, terminalOutput) => {
|
61
|
+
res({ code, terminalOutput });
|
62
|
+
});
|
63
|
+
});
|
64
|
+
}
|
65
|
+
send(message) {
|
66
|
+
if (this.childProcess.connected) {
|
67
|
+
this.childProcess.send(message);
|
68
|
+
}
|
69
|
+
}
|
70
|
+
kill(signal) {
|
71
|
+
if (this.childProcess.connected) {
|
72
|
+
this.childProcess.kill(signal);
|
73
|
+
}
|
74
|
+
}
|
75
|
+
}
|
76
|
+
exports.NodeChildProcessWithNonDirectOutput = NodeChildProcessWithNonDirectOutput;
|
77
|
+
function addPrefixTransformer(prefix) {
|
78
|
+
const newLineSeparator = process.platform.startsWith('win') ? '\r\n' : '\n';
|
79
|
+
return new stream_1.Transform({
|
80
|
+
transform(chunk, _encoding, callback) {
|
81
|
+
const list = chunk.toString().split(/\r\n|[\n\v\f\r\x85\u2028\u2029]/g);
|
82
|
+
list
|
83
|
+
.filter(Boolean)
|
84
|
+
.forEach((m) => this.push(prefix ? prefix + ' ' + m + newLineSeparator : m + newLineSeparator));
|
85
|
+
callback();
|
86
|
+
},
|
87
|
+
});
|
88
|
+
}
|
89
|
+
const colors = [
|
90
|
+
chalk.green,
|
91
|
+
chalk.greenBright,
|
92
|
+
chalk.red,
|
93
|
+
chalk.redBright,
|
94
|
+
chalk.cyan,
|
95
|
+
chalk.cyanBright,
|
96
|
+
chalk.yellow,
|
97
|
+
chalk.yellowBright,
|
98
|
+
chalk.magenta,
|
99
|
+
chalk.magentaBright,
|
100
|
+
];
|
101
|
+
function getColor(projectName) {
|
102
|
+
let code = 0;
|
103
|
+
for (let i = 0; i < projectName.length; ++i) {
|
104
|
+
code += projectName.charCodeAt(i);
|
105
|
+
}
|
106
|
+
const colorIndex = code % colors.length;
|
107
|
+
return colors[colorIndex];
|
108
|
+
}
|
109
|
+
/**
|
110
|
+
* Prevents terminal escape sequence from clearing line prefix.
|
111
|
+
*/
|
112
|
+
function logClearLineToPrefixTransformer(prefix) {
|
113
|
+
let prevChunk = null;
|
114
|
+
return new stream_1.Transform({
|
115
|
+
transform(chunk, _encoding, callback) {
|
116
|
+
if (prevChunk && prevChunk.toString() === '\x1b[2K') {
|
117
|
+
chunk = chunk.toString().replace(/\x1b\[1G/g, (m) => m + prefix);
|
118
|
+
}
|
119
|
+
this.push(chunk);
|
120
|
+
prevChunk = chunk;
|
121
|
+
callback();
|
122
|
+
},
|
123
|
+
});
|
124
|
+
}
|
125
|
+
class NodeChildProcessWithDirectOutput {
|
126
|
+
constructor(childProcess, temporaryOutputPath) {
|
127
|
+
this.childProcess = childProcess;
|
128
|
+
this.temporaryOutputPath = temporaryOutputPath;
|
129
|
+
this.exitCallbacks = [];
|
130
|
+
this.exited = false;
|
131
|
+
// Re-emit any messages from the task process
|
132
|
+
this.childProcess.on('message', (message) => {
|
133
|
+
if (process.send) {
|
134
|
+
process.send(message);
|
135
|
+
}
|
136
|
+
});
|
137
|
+
this.childProcess.on('exit', (code, signal) => {
|
138
|
+
if (code === null)
|
139
|
+
code = (0, exit_codes_1.signalToCode)(signal);
|
140
|
+
this.exited = true;
|
141
|
+
this.exitCode = code;
|
142
|
+
for (const cb of this.exitCallbacks) {
|
143
|
+
cb(code, signal);
|
144
|
+
}
|
145
|
+
});
|
146
|
+
}
|
147
|
+
send(message) {
|
148
|
+
if (this.childProcess.connected) {
|
149
|
+
this.childProcess.send(message);
|
150
|
+
}
|
151
|
+
}
|
152
|
+
onExit(cb) {
|
153
|
+
this.exitCallbacks.push(cb);
|
154
|
+
}
|
155
|
+
async getResults() {
|
156
|
+
const terminalOutput = this.getTerminalOutput();
|
157
|
+
if (this.exited) {
|
158
|
+
return Promise.resolve({
|
159
|
+
code: this.exitCode,
|
160
|
+
terminalOutput,
|
161
|
+
});
|
162
|
+
}
|
163
|
+
await this.waitForExit();
|
164
|
+
return Promise.resolve({
|
165
|
+
code: this.exitCode,
|
166
|
+
terminalOutput,
|
167
|
+
});
|
168
|
+
}
|
169
|
+
waitForExit() {
|
170
|
+
return new Promise((res) => {
|
171
|
+
this.onExit(() => res());
|
172
|
+
});
|
173
|
+
}
|
174
|
+
getTerminalOutput() {
|
175
|
+
this.terminalOutput ??= (0, fs_1.readFileSync)(this.temporaryOutputPath).toString();
|
176
|
+
return this.terminalOutput;
|
177
|
+
}
|
178
|
+
kill(signal) {
|
179
|
+
if (this.childProcess.connected) {
|
180
|
+
this.childProcess.kill(signal);
|
181
|
+
}
|
182
|
+
}
|
183
|
+
}
|
184
|
+
exports.NodeChildProcessWithDirectOutput = NodeChildProcessWithDirectOutput;
|
@@ -0,0 +1,15 @@
|
|
1
|
+
import { RunningTask } from './running-task';
|
2
|
+
export declare class NoopChildProcess implements RunningTask {
|
3
|
+
private results;
|
4
|
+
constructor(results: {
|
5
|
+
code: number;
|
6
|
+
terminalOutput: string;
|
7
|
+
});
|
8
|
+
send(): void;
|
9
|
+
getResults(): Promise<{
|
10
|
+
code: number;
|
11
|
+
terminalOutput: string;
|
12
|
+
}>;
|
13
|
+
kill(): void;
|
14
|
+
onExit(cb: (code: number) => void): void;
|
15
|
+
}
|
@@ -0,0 +1,19 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.NoopChildProcess = void 0;
|
4
|
+
class NoopChildProcess {
|
5
|
+
constructor(results) {
|
6
|
+
this.results = results;
|
7
|
+
}
|
8
|
+
send() { }
|
9
|
+
async getResults() {
|
10
|
+
return this.results;
|
11
|
+
}
|
12
|
+
kill() {
|
13
|
+
return;
|
14
|
+
}
|
15
|
+
onExit(cb) {
|
16
|
+
cb(this.results.code);
|
17
|
+
}
|
18
|
+
}
|
19
|
+
exports.NoopChildProcess = NoopChildProcess;
|
@@ -1,10 +1,7 @@
|
|
1
1
|
import { Task } from '../config/task-graph';
|
2
2
|
export declare function getEnvVariablesForBatchProcess(skipNxCache: boolean, captureStderr: boolean): NodeJS.ProcessEnv;
|
3
3
|
export declare function getTaskSpecificEnv(task: Task): NodeJS.ProcessEnv;
|
4
|
-
export declare function getEnvVariablesForTask(task: Task, taskSpecificEnv: NodeJS.ProcessEnv, forceColor: string, skipNxCache: boolean, captureStderr: boolean, outputPath: string, streamOutput: boolean):
|
5
|
-
[x: string]: string;
|
6
|
-
TZ?: string;
|
7
|
-
};
|
4
|
+
export declare function getEnvVariablesForTask(task: Task, taskSpecificEnv: NodeJS.ProcessEnv, forceColor: string, skipNxCache: boolean, captureStderr: boolean, outputPath: string, streamOutput: boolean): NodeJS.ProcessEnv;
|
8
5
|
/**
|
9
6
|
* This function loads a .env file and expands the variables in it.
|
10
7
|
* @param filename the .env file to load
|
@@ -75,6 +75,8 @@ function getNxEnvVariablesForTask(task, forceColor, skipNxCache, captureStderr,
|
|
75
75
|
return {
|
76
76
|
...getNxEnvVariablesForForkedProcess(forceColor, skipNxCache, captureStderr, outputPath, streamOutput),
|
77
77
|
...env,
|
78
|
+
// Ensure the TUI does not get spawned within the TUI if ever tasks invoke Nx again
|
79
|
+
NX_TUI: 'false',
|
78
80
|
};
|
79
81
|
}
|
80
82
|
/**
|
@@ -1,10 +1,12 @@
|
|
1
|
+
import { NxJsonConfiguration } from '../config/nx-json';
|
2
|
+
import { ProjectGraph } from '../config/project-graph';
|
3
|
+
import { Task, TaskGraph } from '../config/task-graph';
|
4
|
+
import { DaemonClient } from '../daemon/client/client';
|
1
5
|
import { TaskHasher } from '../hasher/task-hasher';
|
6
|
+
import { NxArgs } from '../utils/command-line-utils';
|
2
7
|
import { DefaultTasksRunnerOptions } from './default-tasks-runner';
|
8
|
+
import { RunningTask } from './running-tasks/running-task';
|
3
9
|
import { TaskStatus } from './tasks-runner';
|
4
|
-
import { ProjectGraph } from '../config/project-graph';
|
5
|
-
import { TaskGraph } from '../config/task-graph';
|
6
|
-
import { DaemonClient } from '../daemon/client/client';
|
7
|
-
import { NxJsonConfiguration } from '../config/nx-json';
|
8
10
|
export declare class TaskOrchestrator {
|
9
11
|
private readonly hasher;
|
10
12
|
private readonly initiatingProject;
|
@@ -15,9 +17,12 @@ export declare class TaskOrchestrator {
|
|
15
17
|
private readonly bail;
|
16
18
|
private readonly daemon;
|
17
19
|
private readonly outputStyle;
|
20
|
+
private readonly taskGraphForHashing;
|
18
21
|
private taskDetails;
|
19
22
|
private cache;
|
23
|
+
private readonly tuiEnabled;
|
20
24
|
private forkedProcessTaskRunner;
|
25
|
+
private runningTasksService;
|
21
26
|
private tasksSchedule;
|
22
27
|
private batchEnv;
|
23
28
|
private reverseTaskDeps;
|
@@ -27,22 +32,33 @@ export declare class TaskOrchestrator {
|
|
27
32
|
private waitingForTasks;
|
28
33
|
private groups;
|
29
34
|
private bailed;
|
30
|
-
|
35
|
+
private runningContinuousTasks;
|
36
|
+
private cleaningUp;
|
37
|
+
constructor(hasher: TaskHasher, initiatingProject: string | undefined, projectGraph: ProjectGraph, taskGraph: TaskGraph, nxJson: NxJsonConfiguration, options: NxArgs & DefaultTasksRunnerOptions, bail: boolean, daemon: DaemonClient, outputStyle: string, taskGraphForHashing?: TaskGraph);
|
38
|
+
init(): Promise<void>;
|
31
39
|
run(): Promise<{
|
32
40
|
[id: string]: TaskStatus;
|
33
41
|
}>;
|
34
42
|
private executeNextBatchOfTasksUsingTaskSchedule;
|
35
|
-
|
43
|
+
processTask(taskId: string): Promise<NodeJS.ProcessEnv>;
|
36
44
|
private processScheduledBatch;
|
37
45
|
private processAllScheduledTasks;
|
38
46
|
private applyCachedResults;
|
39
47
|
private applyCachedResult;
|
40
48
|
private applyFromCacheOrRunBatch;
|
41
49
|
private runBatch;
|
42
|
-
|
50
|
+
applyFromCacheOrRunTask(doNotSkipCache: boolean, task: Task, groupId: number): Promise<{
|
51
|
+
task: Task;
|
52
|
+
code: number;
|
53
|
+
status: TaskStatus;
|
54
|
+
terminalOutput?: string;
|
55
|
+
}>;
|
56
|
+
private runTask;
|
43
57
|
private runTaskInForkedProcess;
|
58
|
+
startContinuousTask(task: Task, groupId: number): Promise<RunningTask>;
|
44
59
|
private preRunSteps;
|
45
60
|
private postRunSteps;
|
61
|
+
private scheduleNextTasksAndReleaseThreads;
|
46
62
|
private complete;
|
47
63
|
private pipeOutputCapture;
|
48
64
|
private shouldCacheTaskResult;
|
@@ -50,4 +66,6 @@ export declare class TaskOrchestrator {
|
|
50
66
|
private openGroup;
|
51
67
|
private shouldCopyOutputsFromCache;
|
52
68
|
private recordOutputsHash;
|
69
|
+
private cleanup;
|
53
70
|
}
|
71
|
+
export declare function getThreadCount(options: NxArgs & DefaultTasksRunnerOptions, taskGraph: TaskGraph): number;
|