nx 22.1.0-canary.20251030-b283663 → 22.1.0-canary.20251110-73ecb30
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/migrations.json +6 -0
- package/package.json +12 -11
- package/src/command-line/init/implementation/dot-nx/add-nx-scripts.d.ts +2 -0
- package/src/command-line/init/implementation/dot-nx/add-nx-scripts.d.ts.map +1 -1
- package/src/command-line/init/implementation/dot-nx/add-nx-scripts.js +11 -1
- package/src/command-line/init/init-v2.js +1 -1
- package/src/core/graph/main.js +1 -1
- package/src/daemon/client/client.d.ts +1 -0
- package/src/daemon/client/client.d.ts.map +1 -1
- package/src/daemon/client/client.js +18 -1
- package/src/devkit-internals.d.ts +1 -1
- package/src/devkit-internals.d.ts.map +1 -1
- package/src/devkit-internals.js +2 -1
- package/src/executors/run-commands/run-commands.impl.d.ts +1 -1
- package/src/executors/run-commands/run-commands.impl.d.ts.map +1 -1
- package/src/executors/run-commands/run-commands.impl.js +7 -4
- package/src/executors/run-commands/running-tasks.d.ts +4 -3
- package/src/executors/run-commands/running-tasks.d.ts.map +1 -1
- package/src/executors/run-commands/running-tasks.js +30 -9
- package/src/generators/internal-utils/format-changed-files-with-prettier-if-available.d.ts.map +1 -1
- package/src/generators/internal-utils/format-changed-files-with-prettier-if-available.js +5 -1
- package/src/hasher/hash-task.d.ts +1 -0
- package/src/hasher/hash-task.d.ts.map +1 -1
- package/src/hasher/hash-task.js +57 -0
- package/src/migrations/update-22-1-0/update-nx-wrapper.d.ts +3 -0
- package/src/migrations/update-22-1-0/update-nx-wrapper.d.ts.map +1 -0
- package/src/migrations/update-22-1-0/update-nx-wrapper.js +7 -0
- package/src/native/index.d.ts +101 -0
- package/src/native/native-bindings.js +1 -0
- package/src/native/nx.wasm32-wasi.wasm +0 -0
- package/src/plugins/js/project-graph/build-dependencies/target-project-locator.js +1 -1
- package/src/project-graph/plugins/get-plugins.d.ts.map +1 -1
- package/src/project-graph/plugins/get-plugins.js +4 -4
- package/src/project-graph/plugins/isolation/index.d.ts +1 -1
- package/src/project-graph/plugins/isolation/index.d.ts.map +1 -1
- package/src/project-graph/plugins/isolation/index.js +2 -2
- package/src/project-graph/plugins/isolation/plugin-pool.d.ts +1 -1
- package/src/project-graph/plugins/isolation/plugin-pool.d.ts.map +1 -1
- package/src/project-graph/plugins/isolation/plugin-pool.js +22 -2
- package/src/tasks-runner/create-task-graph.d.ts.map +1 -1
- package/src/tasks-runner/create-task-graph.js +4 -11
- package/src/tasks-runner/forked-process-task-runner.d.ts.map +1 -1
- package/src/tasks-runner/forked-process-task-runner.js +36 -4
- package/src/tasks-runner/is-tui-enabled.d.ts.map +1 -1
- package/src/tasks-runner/is-tui-enabled.js +0 -4
- package/src/tasks-runner/process-metrics-service.d.ts +54 -0
- package/src/tasks-runner/process-metrics-service.d.ts.map +1 -0
- package/src/tasks-runner/process-metrics-service.js +161 -0
- package/src/tasks-runner/pseudo-terminal.d.ts +1 -0
- package/src/tasks-runner/pseudo-terminal.d.ts.map +1 -1
- package/src/tasks-runner/pseudo-terminal.js +3 -0
- package/src/tasks-runner/running-tasks/node-child-process.d.ts.map +1 -1
- package/src/tasks-runner/task-orchestrator.d.ts.map +1 -1
- package/src/tasks-runner/task-orchestrator.js +3 -7
- package/src/tasks-runner/utils.d.ts +1 -0
- package/src/tasks-runner/utils.d.ts.map +1 -1
- package/src/tasks-runner/utils.js +8 -0
- package/src/utils/update-nxw.d.ts.map +1 -1
- package/src/utils/update-nxw.js +11 -0
|
@@ -73,6 +73,7 @@ export declare class DaemonClient {
|
|
|
73
73
|
private sendToDaemonViaQueue;
|
|
74
74
|
private setUpConnection;
|
|
75
75
|
private sendMessageToDaemon;
|
|
76
|
+
private registerDaemonProcessWithMetricsService;
|
|
76
77
|
private retryMessageAfterNewDaemonStarts;
|
|
77
78
|
private handleMessage;
|
|
78
79
|
startInBackground(): Promise<ChildProcess['pid']>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,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) {
|
|
421
421
|
this._daemonStatus = DaemonStatus.CONNECTING;
|
|
422
|
+
let daemonPid = null;
|
|
422
423
|
if (!(await this.isServerAvailable())) {
|
|
423
|
-
await this.startInBackground();
|
|
424
|
+
daemonPid = await this.startInBackground();
|
|
424
425
|
}
|
|
425
426
|
this.setUpConnection();
|
|
426
427
|
this._daemonStatus = DaemonStatus.CONNECTED;
|
|
427
428
|
this._daemonReady();
|
|
429
|
+
daemonPid ??= (0, cache_1.getDaemonProcessIdSync)();
|
|
430
|
+
await this.registerDaemonProcessWithMetricsService(daemonPid);
|
|
428
431
|
}
|
|
429
432
|
else if (this._daemonStatus == DaemonStatus.CONNECTING) {
|
|
430
433
|
await this._waitForDaemonReady;
|
|
434
|
+
const daemonPid = (0, cache_1.getDaemonProcessIdSync)();
|
|
435
|
+
await this.registerDaemonProcessWithMetricsService(daemonPid);
|
|
431
436
|
}
|
|
432
437
|
// An open promise isn't enough to keep the event loop
|
|
433
438
|
// alive, so we set a timeout here and clear it when we hear
|
|
@@ -443,6 +448,18 @@ class DaemonClient {
|
|
|
443
448
|
clearTimeout(keepAlive);
|
|
444
449
|
});
|
|
445
450
|
}
|
|
451
|
+
async registerDaemonProcessWithMetricsService(daemonPid) {
|
|
452
|
+
if (!daemonPid) {
|
|
453
|
+
return;
|
|
454
|
+
}
|
|
455
|
+
try {
|
|
456
|
+
const { getProcessMetricsService } = await Promise.resolve().then(() => require('../../tasks-runner/process-metrics-service'));
|
|
457
|
+
getProcessMetricsService().registerDaemonProcess(daemonPid);
|
|
458
|
+
}
|
|
459
|
+
catch {
|
|
460
|
+
// don't error, this is a secondary concern that should not break task execution
|
|
461
|
+
}
|
|
462
|
+
}
|
|
446
463
|
retryMessageAfterNewDaemonStarts() {
|
|
447
464
|
const [msg, res, rej] = [
|
|
448
465
|
this.currentMessage,
|
|
@@ -19,7 +19,7 @@ export { readModulePackageJson, installPackageToTmp, } from './utils/package-jso
|
|
|
19
19
|
export { splitByColons } from './utils/split-target';
|
|
20
20
|
export { hashObject } from './hasher/file-hasher';
|
|
21
21
|
export { hashWithWorkspaceContext, hashMultiGlobWithWorkspaceContext, } from './utils/workspace-context';
|
|
22
|
-
export { createProjectRootMappingsFromProjectConfigurations, findProjectForPath, } from './project-graph/utils/find-project-for-path';
|
|
22
|
+
export { createProjectRootMappingsFromProjectConfigurations, createProjectRootMappings, findProjectForPath, } from './project-graph/utils/find-project-for-path';
|
|
23
23
|
export { retrieveProjectConfigurations } from './project-graph/utils/retrieve-workspace-files';
|
|
24
24
|
export { LoadedNxPlugin } from './project-graph/plugins/loaded-nx-plugin';
|
|
25
25
|
export * from './project-graph/error-types';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"devkit-internals.d.ts","sourceRoot":"","sources":["../../../../packages/nx/src/devkit-internals.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,EACL,sBAAsB,EACtB,aAAa,GACd,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,UAAU,IAAI,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACpE,OAAO,EAAE,2BAA2B,EAAE,MAAM,yCAAyC,CAAC;AACtF,OAAO,EAAE,gDAAgD,EAAE,MAAM,gDAAgD,CAAC;AAClH,OAAO,EAAE,yBAAyB,EAAE,MAAM,mDAAmD,CAAC;AAC9F,OAAO,EACL,oCAAoC,EACpC,uBAAuB,GACxB,MAAM,mDAAmD,CAAC;AAC3D,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EACL,qBAAqB,EACr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|
3
|
-
exports.signalToCode = exports.globalSpinner = exports.readYamlFile = exports.isUsingPrettierInTree = exports.isCI = exports.interpolate = exports.registerTsProject = exports.LoadedNxPlugin = exports.retrieveProjectConfigurations = exports.findProjectForPath = exports.createProjectRootMappingsFromProjectConfigurations = exports.hashMultiGlobWithWorkspaceContext = exports.hashWithWorkspaceContext = exports.hashObject = exports.splitByColons = exports.installPackageToTmp = exports.readModulePackageJson = exports.stripIndent = exports.sortObjectByKeys = exports.combineOptionsForExecutor = exports.splitTarget = exports.getIgnoreObjectForTree = exports.findMatchingConfigFiles = exports.readProjectConfigurationsFromRootMap = exports.mergeTargetConfigurations = exports.retrieveProjectConfigurationsWithAngularProjects = exports.calculateDefaultProjectName = exports.readNxJsonFromDisk = exports.parseExecutor = exports.getExecutorInformation = exports.createTempNpmDirectory = void 0;
|
|
3
|
+
exports.signalToCode = exports.globalSpinner = exports.readYamlFile = exports.isUsingPrettierInTree = exports.isCI = exports.interpolate = exports.registerTsProject = exports.LoadedNxPlugin = exports.retrieveProjectConfigurations = exports.findProjectForPath = exports.createProjectRootMappings = exports.createProjectRootMappingsFromProjectConfigurations = exports.hashMultiGlobWithWorkspaceContext = exports.hashWithWorkspaceContext = exports.hashObject = exports.splitByColons = exports.installPackageToTmp = exports.readModulePackageJson = exports.stripIndent = exports.sortObjectByKeys = exports.combineOptionsForExecutor = exports.splitTarget = exports.getIgnoreObjectForTree = exports.findMatchingConfigFiles = exports.readProjectConfigurationsFromRootMap = exports.mergeTargetConfigurations = exports.retrieveProjectConfigurationsWithAngularProjects = exports.calculateDefaultProjectName = exports.readNxJsonFromDisk = exports.parseExecutor = exports.getExecutorInformation = exports.createTempNpmDirectory = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
/**
|
|
6
6
|
* Note to developers: STOP! These exports are available via requireNx in @nx/devkit.
|
|
@@ -45,6 +45,7 @@ Object.defineProperty(exports, "hashWithWorkspaceContext", { enumerable: true, g
|
|
|
45
45
|
Object.defineProperty(exports, "hashMultiGlobWithWorkspaceContext", { enumerable: true, get: function () { return workspace_context_1.hashMultiGlobWithWorkspaceContext; } });
|
|
46
46
|
var find_project_for_path_1 = require("./project-graph/utils/find-project-for-path");
|
|
47
47
|
Object.defineProperty(exports, "createProjectRootMappingsFromProjectConfigurations", { enumerable: true, get: function () { return find_project_for_path_1.createProjectRootMappingsFromProjectConfigurations; } });
|
|
48
|
+
Object.defineProperty(exports, "createProjectRootMappings", { enumerable: true, get: function () { return find_project_for_path_1.createProjectRootMappings; } });
|
|
48
49
|
Object.defineProperty(exports, "findProjectForPath", { enumerable: true, get: function () { return find_project_for_path_1.findProjectForPath; } });
|
|
49
50
|
var retrieve_workspace_files_2 = require("./project-graph/utils/retrieve-workspace-files");
|
|
50
51
|
Object.defineProperty(exports, "retrieveProjectConfigurations", { enumerable: true, get: function () { return retrieve_workspace_files_2.retrieveProjectConfigurations; } });
|
|
@@ -55,6 +55,6 @@ export default function (options: RunCommandsOptions, context: ExecutorContext):
|
|
|
55
55
|
success: boolean;
|
|
56
56
|
terminalOutput: string;
|
|
57
57
|
}>;
|
|
58
|
-
export declare function runCommands(options: RunCommandsOptions, context: ExecutorContext): Promise<import("../../tasks-runner/pseudo-terminal").PseudoTtyProcess | NoopChildProcess | ParallelRunningTasks | SeriallyRunningTasks>;
|
|
58
|
+
export declare function runCommands(options: RunCommandsOptions, context: ExecutorContext, taskId?: string): Promise<import("../../tasks-runner/pseudo-terminal").PseudoTtyProcess | NoopChildProcess | ParallelRunningTasks | SeriallyRunningTasks>;
|
|
59
59
|
export declare function interpolateArgsIntoCommand(command: string, opts: Pick<NormalizedRunCommandsOptions, 'args' | 'parsedArgs' | '__unparsed__' | 'unknownOptions' | 'unparsedCommandArgs'>, forwardAllArgs: boolean): string;
|
|
60
60
|
//# sourceMappingURL=run-commands.impl.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run-commands.impl.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/executors/run-commands/run-commands.impl.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"run-commands.impl.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/executors/run-commands/run-commands.impl.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAI/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,qDAAqD,CAAC;AACvF,OAAO,EACL,oBAAoB,EAEpB,oBAAoB,EACrB,MAAM,iBAAiB,CAAC;AAEzB,eAAO,MAAM,YAAY,QAAiB,CAAC;AAC3C,MAAM,MAAM,IAAI,GAAG;IACjB,CAAC,CAAC,EAAE,MAAM,GAAG,GAAG,CAAC;CAClB,CAAC;AAEF,MAAM,WAAW,yBAAyB;IACxC,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,kBAAmB,SAAQ,IAAI;IAC9C,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC5B,QAAQ,CAAC,EAAE,KAAK,CAAC,yBAAyB,GAAG,MAAM,CAAC,CAAC;IACrD,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC9B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB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ommand = interpolateArgsIntoCommand;
|
|
|
7
7
|
const yargsParser = require("yargs-parser");
|
|
8
8
|
const is_tui_enabled_1 = require("../../tasks-runner/is-tui-enabled");
|
|
9
9
|
const pseudo_terminal_1 = require("../../tasks-runner/pseudo-terminal");
|
|
10
|
+
const utils_1 = require("../../tasks-runner/utils");
|
|
10
11
|
const noop_child_process_1 = require("../../tasks-runner/running-tasks/noop-child-process");
|
|
11
12
|
const running_tasks_1 = require("./running-tasks");
|
|
12
13
|
exports.LARGE_BUFFER = 1024 * 1000000;
|
|
@@ -37,7 +38,7 @@ async function default_1(options, context) {
|
|
|
37
38
|
success: results.code === 0,
|
|
38
39
|
};
|
|
39
40
|
}
|
|
40
|
-
async function runCommands(options, context) {
|
|
41
|
+
async function runCommands(options, context, taskId) {
|
|
41
42
|
const normalized = normalizeOptions(options);
|
|
42
43
|
if (normalized.readyWhenStatus.length && !normalized.parallel) {
|
|
43
44
|
throw new Error('ERROR: Bad executor config for run-commands - "readyWhen" can only be used when "parallel=true".');
|
|
@@ -59,11 +60,13 @@ async function runCommands(options, context) {
|
|
|
59
60
|
normalized.usePty;
|
|
60
61
|
const tuiEnabled = (0, is_tui_enabled_1.isTuiEnabled)();
|
|
61
62
|
try {
|
|
63
|
+
const resolvedTaskId = taskId ??
|
|
64
|
+
(0, utils_1.createTaskId)(context.projectName, context.targetName, context.configurationName);
|
|
62
65
|
const runningTask = isSingleCommandAndCanUsePseudoTerminal
|
|
63
|
-
? await (0, running_tasks_1.runSingleCommandWithPseudoTerminal)(normalized, context)
|
|
66
|
+
? await (0, running_tasks_1.runSingleCommandWithPseudoTerminal)(normalized, context, resolvedTaskId)
|
|
64
67
|
: options.parallel
|
|
65
|
-
? new running_tasks_1.ParallelRunningTasks(normalized, context)
|
|
66
|
-
: new running_tasks_1.SeriallyRunningTasks(normalized, context, tuiEnabled);
|
|
68
|
+
? new running_tasks_1.ParallelRunningTasks(normalized, context, resolvedTaskId)
|
|
69
|
+
: new running_tasks_1.SeriallyRunningTasks(normalized, context, tuiEnabled, resolvedTaskId);
|
|
67
70
|
return runningTask;
|
|
68
71
|
}
|
|
69
72
|
catch (e) {
|
|
@@ -9,7 +9,7 @@ export declare class ParallelRunningTasks implements RunningTask {
|
|
|
9
9
|
private readonly streamOutput;
|
|
10
10
|
private exitCallbacks;
|
|
11
11
|
private outputCallbacks;
|
|
12
|
-
constructor(options: NormalizedRunCommandsOptions, context: ExecutorContext);
|
|
12
|
+
constructor(options: NormalizedRunCommandsOptions, context: ExecutorContext, taskId: string);
|
|
13
13
|
getResults(): Promise<{
|
|
14
14
|
code: number;
|
|
15
15
|
terminalOutput: string;
|
|
@@ -23,13 +23,14 @@ export declare class ParallelRunningTasks implements RunningTask {
|
|
|
23
23
|
}
|
|
24
24
|
export declare class SeriallyRunningTasks implements RunningTask {
|
|
25
25
|
private readonly tuiEnabled;
|
|
26
|
+
private readonly taskId;
|
|
26
27
|
private terminalOutput;
|
|
27
28
|
private currentProcess;
|
|
28
29
|
private exitCallbacks;
|
|
29
30
|
private code;
|
|
30
31
|
private error;
|
|
31
32
|
private outputCallbacks;
|
|
32
|
-
constructor(options: NormalizedRunCommandsOptions, context: ExecutorContext, tuiEnabled: boolean);
|
|
33
|
+
constructor(options: NormalizedRunCommandsOptions, context: ExecutorContext, tuiEnabled: boolean, taskId: string);
|
|
33
34
|
getResults(): Promise<{
|
|
34
35
|
code: number;
|
|
35
36
|
terminalOutput: string;
|
|
@@ -41,5 +42,5 @@ export declare class SeriallyRunningTasks implements RunningTask {
|
|
|
41
42
|
private run;
|
|
42
43
|
private createProcess;
|
|
43
44
|
}
|
|
44
|
-
export declare function runSingleCommandWithPseudoTerminal(normalized: NormalizedRunCommandsOptions, context: ExecutorContext): Promise<PseudoTtyProcess>;
|
|
45
|
+
export declare function runSingleCommandWithPseudoTerminal(normalized: NormalizedRunCommandsOptions, context: ExecutorContext, taskId: string): Promise<PseudoTtyProcess>;
|
|
45
46
|
//# sourceMappingURL=running-tasks.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"running-tasks.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/executors/run-commands/running-tasks.ts"],"names":[],"mappings":"AACA,OAAO,EAAsB,YAAY,EAAE,MAAM,eAAe,CAAC;AAIjE,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAGL,gBAAgB,EACjB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;
|
|
1
|
+
{"version":3,"file":"running-tasks.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/executors/run-commands/running-tasks.ts"],"names":[],"mappings":"AACA,OAAO,EAAsB,YAAY,EAAE,MAAM,eAAe,CAAC;AAIjE,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAGL,gBAAgB,EACjB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAO5E,OAAO,EAEL,4BAA4B,EAE7B,MAAM,qBAAqB,CAAC;AAE7B,qBAAa,oBAAqB,YAAW,WAAW;IACtD,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAuB;IACtD,OAAO,CAAC,eAAe,CAA8C;IACrE,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAU;IAEvC,OAAO,CAAC,aAAa,CAChB;IACL,OAAO,CAAC,eAAe,CAA+C;gBAGpE,OAAO,EAAE,4BAA4B,EACrC,OAAO,EAAE,eAAe,EACxB,MAAM,EAAE,MAAM;IAqBV,UAAU,IAAI,OAAO,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,cAAc,EAAE,MAAM,CAAA;KAAE,CAAC;IAQrE,QAAQ,CAAC,EAAE,EAAE,CAAC,cAAc,EAAE,MAAM,KAAK,IAAI;IAI7C,MAAM,CAAC,EAAE,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,cAAc,EA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/pseudo-terminal");
|
|
11
11
|
const task_env_1 = require("../../tasks-runner/task-env");
|
|
12
|
+
const process_metrics_service_1 = require("../../tasks-runner/process-metrics-service");
|
|
12
13
|
const exit_codes_1 = require("../../utils/exit-codes");
|
|
13
14
|
const run_commands_impl_1 = require("./run-commands.impl");
|
|
14
15
|
class ParallelRunningTasks {
|
|
15
|
-
constructor(options, context) {
|
|
16
|
+
constructor(options, context, taskId) {
|
|
16
17
|
this.exitCallbacks = [];
|
|
17
18
|
this.outputCallbacks = [];
|
|
18
|
-
this.childProcesses = options.commands.map((commandConfig) => new RunningNodeProcess(commandConfig, options.color, calculateCwd(options.cwd, context), options.env ?? {}, options.readyWhenStatus, options.streamOutput, options.envFile));
|
|
19
|
+
this.childProcesses = options.commands.map((commandConfig) => new RunningNodeProcess(commandConfig, options.color, calculateCwd(options.cwd, context), options.env ?? {}, options.readyWhenStatus, options.streamOutput, options.envFile, taskId));
|
|
19
20
|
this.readyWhenStatus = options.readyWhenStatus;
|
|
20
21
|
this.streamOutput = options.streamOutput;
|
|
21
22
|
this.run();
|
|
@@ -139,8 +140,9 @@ class ParallelRunningTasks {
|
|
|
139
140
|
}
|
|
140
141
|
exports.ParallelRunningTasks = ParallelRunningTasks;
|
|
141
142
|
class SeriallyRunningTasks {
|
|
142
|
-
constructor(options, context, tuiEnabled) {
|
|
143
|
+
constructor(options, context, tuiEnabled, taskId) {
|
|
143
144
|
this.tuiEnabled = tuiEnabled;
|
|
145
|
+
this.taskId = taskId;
|
|
144
146
|
this.terminalOutput = '';
|
|
145
147
|
this.currentProcess = null;
|
|
146
148
|
this.exitCallbacks = [];
|
|
@@ -182,7 +184,7 @@ class SeriallyRunningTasks {
|
|
|
182
184
|
}
|
|
183
185
|
async run(options, context) {
|
|
184
186
|
for (const c of options.commands) {
|
|
185
|
-
const childProcess = await this.createProcess(c, options.color, calculateCwd(options.cwd, context), options.processEnv ?? options.env ?? {}, options.usePty, options.streamOutput, options.tty, options.envFile);
|
|
187
|
+
const childProcess = await this.createProcess(c, options.color, calculateCwd(options.cwd, context), options.processEnv ?? options.env ?? {}, this.taskId, options.usePty, options.streamOutput, options.tty, options.envFile);
|
|
186
188
|
this.currentProcess = childProcess;
|
|
187
189
|
childProcess.onOutput((output) => {
|
|
188
190
|
for (const cb of this.outputCallbacks) {
|
|
@@ -204,7 +206,7 @@ class SeriallyRunningTasks {
|
|
|
204
206
|
}
|
|
205
207
|
}
|
|
206
208
|
}
|
|
207
|
-
async createProcess(commandConfig, color, cwd, env, usePty = true, streamOutput = true, tty, envFile) {
|
|
209
|
+
async createProcess(commandConfig, color, cwd, env, taskId, usePty = true, streamOutput = true, tty, envFile) {
|
|
208
210
|
// The rust runCommand is always a tty, so it will not look nice in parallel and if we need prefixes
|
|
209
211
|
// currently does not work properly in windows
|
|
210
212
|
if (process.env.NX_NATIVE_COMMAND_RUNNER !== 'false' &&
|
|
@@ -213,15 +215,23 @@ class SeriallyRunningTasks {
|
|
|
213
215
|
pseudo_terminal_1.PseudoTerminal.isSupported()) {
|
|
214
216
|
const pseudoTerminal = (0, pseudo_terminal_1.createPseudoTerminal)();
|
|
215
217
|
registerProcessListener(this, pseudoTerminal);
|
|
216
|
-
|
|
218
|
+
const pseudoTtyProcess = await createProcessWithPseudoTty(pseudoTerminal, commandConfig, color, cwd, env, streamOutput, tty, envFile);
|
|
219
|
+
// Register process for metrics collection (direct run-commands execution)
|
|
220
|
+
// Skip registration if we're in a forked executor - the fork wrapper already registered
|
|
221
|
+
const pid = pseudoTtyProcess.getPid();
|
|
222
|
+
if (pid && !process.env.NX_FORKED_TASK_EXECUTOR) {
|
|
223
|
+
(0, process_metrics_service_1.getProcessMetricsService)().registerTaskProcess(taskId, pid);
|
|
224
|
+
}
|
|
225
|
+
return pseudoTtyProcess;
|
|
217
226
|
}
|
|
218
|
-
return new RunningNodeProcess(commandConfig, color, cwd, env, [], streamOutput, envFile);
|
|
227
|
+
return new RunningNodeProcess(commandConfig, color, cwd, env, [], streamOutput, envFile, taskId);
|
|
219
228
|
}
|
|
220
229
|
}
|
|
221
230
|
exports.SeriallyRunningTasks = SeriallyRunningTasks;
|
|
222
231
|
class RunningNodeProcess {
|
|
223
|
-
constructor(commandConfig, color, cwd, env, readyWhenStatus, streamOutput = true, envFile) {
|
|
232
|
+
constructor(commandConfig, color, cwd, env, readyWhenStatus, streamOutput = true, envFile, taskId) {
|
|
224
233
|
this.readyWhenStatus = readyWhenStatus;
|
|
234
|
+
this.taskId = taskId;
|
|
225
235
|
this.terminalOutput = '';
|
|
226
236
|
this.exitCallbacks = [];
|
|
227
237
|
this.outputCallbacks = [];
|
|
@@ -237,6 +247,11 @@ class RunningNodeProcess {
|
|
|
237
247
|
cwd,
|
|
238
248
|
windowsHide: false,
|
|
239
249
|
});
|
|
250
|
+
// Register process for metrics collection
|
|
251
|
+
// Skip registration if we're in a forked executor - the fork wrapper already registered
|
|
252
|
+
if (this.childProcess.pid && !process.env.NX_FORKED_TASK_EXECUTOR) {
|
|
253
|
+
(0, process_metrics_service_1.getProcessMetricsService)().registerTaskProcess(this.taskId, this.childProcess.pid);
|
|
254
|
+
}
|
|
240
255
|
this.addListeners(commandConfig, streamOutput);
|
|
241
256
|
}
|
|
242
257
|
getResults() {
|
|
@@ -341,9 +356,15 @@ class RunningNodeProcess {
|
|
|
341
356
|
});
|
|
342
357
|
}
|
|
343
358
|
}
|
|
344
|
-
async function runSingleCommandWithPseudoTerminal(normalized, context) {
|
|
359
|
+
async function runSingleCommandWithPseudoTerminal(normalized, context, taskId) {
|
|
345
360
|
const pseudoTerminal = (0, pseudo_terminal_1.createPseudoTerminal)();
|
|
346
361
|
const pseudoTtyProcess = await createProcessWithPseudoTty(pseudoTerminal, normalized.commands[0], normalized.color, calculateCwd(normalized.cwd, context), normalized.env, normalized.streamOutput, pseudoTerminal ? normalized.isTTY : false, normalized.envFile);
|
|
362
|
+
// Register process for metrics collection (direct run-commands execution)
|
|
363
|
+
// Skip registration if we're in a forked executor - the fork wrapper already registered
|
|
364
|
+
const pid = pseudoTtyProcess.getPid();
|
|
365
|
+
if (pid && !process.env.NX_FORKED_TASK_EXECUTOR) {
|
|
366
|
+
(0, process_metrics_service_1.getProcessMetricsService)().registerTaskProcess(taskId, pid);
|
|
367
|
+
}
|
|
347
368
|
registerProcessListener(pseudoTtyProcess, pseudoTerminal);
|
|
348
369
|
return pseudoTtyProcess;
|
|
349
370
|
}
|
package/src/generators/internal-utils/format-changed-files-with-prettier-if-available.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format-changed-files-with-prettier-if-available.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/generators/internal-utils/format-changed-files-with-prettier-if-available.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"format-changed-files-with-prettier-if-available.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/generators/internal-utils/format-changed-files-with-prettier-if-available.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAGpC;;;GAGG;AACH,wBAAsB,yCAAyC,CAC7D,IAAI,EAAE,IAAI,EACV,OAAO,CAAC,EAAE;IACR,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,GACA,OAAO,CAAC,IAAI,CAAC,CAcf;AAED,wBAAsB,kCAAkC,CACtD,KAAK,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,EAAE,EACnD,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE;IACR,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,GACA,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CA8D9B"}
|
|
@@ -4,6 +4,7 @@ exports.formatChangedFilesWithPrettierIfAvailable = formatChangedFilesWithPretti
|
|
|
4
4
|
exports.formatFilesWithPrettierIfAvailable = formatFilesWithPrettierIfAvailable;
|
|
5
5
|
const path = require("path");
|
|
6
6
|
const is_using_prettier_1 = require("../../utils/is-using-prettier");
|
|
7
|
+
const installation_directory_1 = require("../../utils/installation-directory");
|
|
7
8
|
/**
|
|
8
9
|
* Formats all the created or updated files using Prettier
|
|
9
10
|
* @param tree - the file system tree
|
|
@@ -19,7 +20,10 @@ async function formatFilesWithPrettierIfAvailable(files, root, options) {
|
|
|
19
20
|
const results = new Map();
|
|
20
21
|
let prettier;
|
|
21
22
|
try {
|
|
22
|
-
|
|
23
|
+
const prettierPath = require.resolve('prettier', {
|
|
24
|
+
paths: [...(0, installation_directory_1.getNxRequirePaths)(root), __dirname],
|
|
25
|
+
});
|
|
26
|
+
prettier = require(prettierPath);
|
|
23
27
|
/**
|
|
24
28
|
* Even after we discovered prettier in node_modules, we need to be sure that the user is intentionally using prettier
|
|
25
29
|
* before proceeding to format with it.
|
|
@@ -6,4 +6,5 @@ import { TaskDetails } from '../native';
|
|
|
6
6
|
export declare function getTaskDetails(): TaskDetails | null;
|
|
7
7
|
export declare function hashTasksThatDoNotDependOnOutputsOfOtherTasks(hasher: TaskHasher, projectGraph: ProjectGraph, taskGraph: TaskGraph, nxJson: NxJsonConfiguration, tasksDetails: TaskDetails | null): Promise<void>;
|
|
8
8
|
export declare function hashTask(hasher: TaskHasher, projectGraph: ProjectGraph, taskGraph: TaskGraph, task: Task, env: NodeJS.ProcessEnv, taskDetails: TaskDetails | null): Promise<void>;
|
|
9
|
+
export declare function hashTasks(hasher: TaskHasher, projectGraph: ProjectGraph, taskGraph: TaskGraph, env: NodeJS.ProcessEnv, taskDetails: TaskDetails | null): Promise<void>;
|
|
9
10
|
//# sourceMappingURL=hash-task.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hash-task.d.ts","sourceRoot":"","sources":["../../../../../packages/nx/src/hasher/hash-task.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,S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jC;AAED,wBAAsB,QAAQ,CAC5B,MAAM,EAAE,UAAU,EAClB,YAAY,EAAE,YAAY,EAC1B,SAAS,EAAE,SAAS,EACpB,IAAI,EAAE,IAAI,EACV,GAAG,EAAE,MAAM,CAAC,UAAU,EACtB,WAAW,EAAE,WAAW,GAAG,IAAI,iBAuChC;AAED,wBAAsB,SAAS,CAC7B,MAAM,EAAE,UAAU,EAClB,YAAY,EAAE,YAAY,EAC1B,SAAS,EAAE,SAAS,EACpB,GAAG,EAAE,MAAM,CAAC,UAAU,EACtB,WAAW,EAAE,WAAW,GAAG,IAAI,iBAuEhC"}
|
package/src/hasher/hash-task.js
CHANGED
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.getTaskDetails = getTaskDetails;
|
|
4
4
|
exports.hashTasksThatDoNotDependOnOutputsOfOtherTasks = hashTasksThatDoNotDependOnOutputsOfOtherTasks;
|
|
5
5
|
exports.hashTask = hashTask;
|
|
6
|
+
exports.hashTasks = hashTasks;
|
|
6
7
|
const utils_1 = require("../tasks-runner/utils");
|
|
7
8
|
const project_graph_1 = require("../project-graph/project-graph");
|
|
8
9
|
const task_hasher_1 = require("./task-hasher");
|
|
@@ -83,3 +84,59 @@ async function hashTask(hasher, projectGraph, taskGraph, task, env, taskDetails)
|
|
|
83
84
|
performance.mark('hashSingleTask:end');
|
|
84
85
|
performance.measure('hashSingleTask', 'hashSingleTask:start', 'hashSingleTask:end');
|
|
85
86
|
}
|
|
87
|
+
async function hashTasks(hasher, projectGraph, taskGraph, env, taskDetails) {
|
|
88
|
+
performance.mark('hashMultipleTasks:start');
|
|
89
|
+
const projectsConfigurations = (0, project_graph_1.readProjectsConfigurationFromProjectGraph)(projectGraph);
|
|
90
|
+
const nxJson = (0, nx_json_1.readNxJson)();
|
|
91
|
+
const tasks = Object.values(taskGraph.tasks).filter((task) => !task.hash);
|
|
92
|
+
// Separate tasks with custom hashers from those without
|
|
93
|
+
const tasksWithCustomHashers = [];
|
|
94
|
+
const tasksWithoutCustomHashers = [];
|
|
95
|
+
for (const task of tasks) {
|
|
96
|
+
const customHasher = (0, utils_1.getCustomHasher)(task, projectGraph);
|
|
97
|
+
if (customHasher) {
|
|
98
|
+
tasksWithCustomHashers.push(task);
|
|
99
|
+
}
|
|
100
|
+
else {
|
|
101
|
+
tasksWithoutCustomHashers.push(task);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
// Hash tasks with custom hashers individually
|
|
105
|
+
const customHasherPromises = tasksWithCustomHashers.map(async (task) => {
|
|
106
|
+
const customHasher = (0, utils_1.getCustomHasher)(task, projectGraph);
|
|
107
|
+
const { value, details } = await customHasher(task, {
|
|
108
|
+
hasher,
|
|
109
|
+
projectGraph,
|
|
110
|
+
taskGraph,
|
|
111
|
+
workspaceConfig: projectsConfigurations,
|
|
112
|
+
projectsConfigurations,
|
|
113
|
+
nxJsonConfiguration: nxJson,
|
|
114
|
+
env,
|
|
115
|
+
});
|
|
116
|
+
task.hash = value;
|
|
117
|
+
task.hashDetails = details;
|
|
118
|
+
});
|
|
119
|
+
// Hash tasks without custom hashers in batch
|
|
120
|
+
let batchHashPromise = Promise.resolve();
|
|
121
|
+
if (tasksWithoutCustomHashers.length > 0) {
|
|
122
|
+
batchHashPromise = hasher
|
|
123
|
+
.hashTasks(tasksWithoutCustomHashers, taskGraph, env)
|
|
124
|
+
.then((hashes) => {
|
|
125
|
+
for (let i = 0; i < tasksWithoutCustomHashers.length; i++) {
|
|
126
|
+
tasksWithoutCustomHashers[i].hash = hashes[i].value;
|
|
127
|
+
tasksWithoutCustomHashers[i].hashDetails = hashes[i].details;
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
await Promise.all([...customHasherPromises, batchHashPromise]);
|
|
132
|
+
if (taskDetails?.recordTaskDetails) {
|
|
133
|
+
taskDetails.recordTaskDetails(tasks.map((task) => ({
|
|
134
|
+
hash: task.hash,
|
|
135
|
+
project: task.target.project,
|
|
136
|
+
target: task.target.target,
|
|
137
|
+
configuration: task.target.configuration,
|
|
138
|
+
})));
|
|
139
|
+
}
|
|
140
|
+
performance.mark('hashMultipleTasks:end');
|
|
141
|
+
performance.measure('hashMultipleTasks', 'hashMultipleTasks:start', 'hashMultipleTasks:end');
|
|
142
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-nx-wrapper.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/migrations/update-22-1-0/update-nx-wrapper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAGlD,yBAA+B,IAAI,EAAE,IAAI,iBAExC"}
|
package/src/native/index.d.ts
CHANGED
|
@@ -27,6 +27,7 @@ export declare class AppLifeCycle {
|
|
|
27
27
|
|
|
28
28
|
export declare class ChildProcess {
|
|
29
29
|
getParserAndWriter(): ExternalObject<[ParserArc, WriterArc]>
|
|
30
|
+
getPid(): number
|
|
30
31
|
kill(signal?: NodeJS.Signals): void
|
|
31
32
|
onExit(callback: (message: string) => void): void
|
|
32
33
|
onOutput(callback: (message: string) => void): void
|
|
@@ -92,6 +93,45 @@ export declare class NxTaskHistory {
|
|
|
92
93
|
getEstimatedTaskTimings(targets: Array<TaskTarget>): Record<string, number>
|
|
93
94
|
}
|
|
94
95
|
|
|
96
|
+
/**
|
|
97
|
+
* High-performance metrics collector for Nx tasks
|
|
98
|
+
* Thread-safe and designed for minimal overhead
|
|
99
|
+
*/
|
|
100
|
+
export declare class ProcessMetricsCollector {
|
|
101
|
+
/** Create a new ProcessMetricsCollector with default configuration */
|
|
102
|
+
constructor()
|
|
103
|
+
/**
|
|
104
|
+
* Start metrics collection
|
|
105
|
+
* Idempotent - safe to call multiple times
|
|
106
|
+
*/
|
|
107
|
+
startCollection(): void
|
|
108
|
+
/**
|
|
109
|
+
* Stop metrics collection
|
|
110
|
+
* Returns true if collection was stopped, false if not running
|
|
111
|
+
*/
|
|
112
|
+
stopCollection(): boolean
|
|
113
|
+
/**
|
|
114
|
+
* Get system information (CPU cores and total memory)
|
|
115
|
+
* This is separate from the collection interval and meant to be called imperatively
|
|
116
|
+
*/
|
|
117
|
+
getSystemInfo(): SystemInfo
|
|
118
|
+
/** Register the main CLI process for metrics collection */
|
|
119
|
+
registerMainCliProcess(pid: number): void
|
|
120
|
+
/** Register a subprocess of the main CLI for metrics collection */
|
|
121
|
+
registerMainCliSubprocess(pid: number, alias?: string | undefined | null): void
|
|
122
|
+
/** Register the daemon process for metrics collection */
|
|
123
|
+
registerDaemonProcess(pid: number): void
|
|
124
|
+
/**
|
|
125
|
+
* Register a process for a specific task
|
|
126
|
+
* Automatically creates the task if it doesn't exist
|
|
127
|
+
*/
|
|
128
|
+
registerTaskProcess(taskId: string, pid: number): void
|
|
129
|
+
/** Register a batch with multiple tasks sharing a worker */
|
|
130
|
+
registerBatch(batchId: string, taskIds: Array<string>, pid: number): void
|
|
131
|
+
/** Subscribe to push-based metrics notifications from TypeScript */
|
|
132
|
+
subscribe(callback: (err: Error | null, event: MetricsUpdate) => void): void
|
|
133
|
+
}
|
|
134
|
+
|
|
95
135
|
export declare class RunningTasksService {
|
|
96
136
|
constructor(db: ExternalObject<NxDbConnection>)
|
|
97
137
|
getRunningTasks(ids: Array<string>): Array<string>
|
|
@@ -153,6 +193,13 @@ export declare class WorkspaceContext {
|
|
|
153
193
|
getFilesInDirectory(directory: string): Array<string>
|
|
154
194
|
}
|
|
155
195
|
|
|
196
|
+
/** Batch metrics snapshot */
|
|
197
|
+
export interface BatchMetricsSnapshot {
|
|
198
|
+
batchId: string
|
|
199
|
+
taskIds: Array<string>
|
|
200
|
+
processes: Array<ProcessMetrics>
|
|
201
|
+
}
|
|
202
|
+
|
|
156
203
|
export interface CachedResult {
|
|
157
204
|
code: number
|
|
158
205
|
terminalOutput?: string
|
|
@@ -264,6 +311,12 @@ export declare export declare function isEditorInstalled(editor: SupportedEditor
|
|
|
264
311
|
|
|
265
312
|
export declare export declare function logDebug(message: string): void
|
|
266
313
|
|
|
314
|
+
/** Metrics update sent every collection cycle */
|
|
315
|
+
export interface MetricsUpdate {
|
|
316
|
+
metrics: ProcessMetricsSnapshot
|
|
317
|
+
metadata?: Record<string, ProcessMetadata>
|
|
318
|
+
}
|
|
319
|
+
|
|
267
320
|
/** Stripped version of the NxJson interface for use in rust */
|
|
268
321
|
export interface NxJson {
|
|
269
322
|
namedInputs?: Record<string, Array<JsInputs>>
|
|
@@ -283,6 +336,39 @@ export interface NxWorkspaceFilesExternals {
|
|
|
283
336
|
|
|
284
337
|
export declare export declare function parseTaskStatus(stringStatus: string): TaskStatus
|
|
285
338
|
|
|
339
|
+
/** Process metadata (static, doesn't change during process lifetime) */
|
|
340
|
+
export interface ProcessMetadata {
|
|
341
|
+
ppid: number
|
|
342
|
+
name: string
|
|
343
|
+
command: string
|
|
344
|
+
exePath: string
|
|
345
|
+
cwd: string
|
|
346
|
+
alias?: string
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
/** Process metrics (dynamic, changes every collection) */
|
|
350
|
+
export interface ProcessMetrics {
|
|
351
|
+
pid: number
|
|
352
|
+
cpu: number
|
|
353
|
+
memory: number
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
/** Organized collection of process metrics with timestamp */
|
|
357
|
+
export interface ProcessMetricsSnapshot {
|
|
358
|
+
timestamp: number
|
|
359
|
+
system: SystemMetrics
|
|
360
|
+
mainCli?: ProcessTreeMetrics
|
|
361
|
+
daemon?: ProcessTreeMetrics
|
|
362
|
+
tasks: Record<string, Array<ProcessMetrics>>
|
|
363
|
+
batches: Record<string, BatchMetricsSnapshot>
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
/** Metrics for a process and its subprocesses (used for both CLI and daemon) */
|
|
367
|
+
export interface ProcessTreeMetrics {
|
|
368
|
+
main: ProcessMetrics
|
|
369
|
+
subprocesses: Array<ProcessMetrics>
|
|
370
|
+
}
|
|
371
|
+
|
|
286
372
|
export interface Project {
|
|
287
373
|
root: string
|
|
288
374
|
namedInputs?: Record<string, Array<JsInputs>>
|
|
@@ -318,6 +404,21 @@ export declare const enum SupportedEditor {
|
|
|
318
404
|
Unknown = 5
|
|
319
405
|
}
|
|
320
406
|
|
|
407
|
+
/** System information (static system-level data) */
|
|
408
|
+
export interface SystemInfo {
|
|
409
|
+
cpuCores: number
|
|
410
|
+
totalMemory: number
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
/** System metrics (dynamic, changes every collection) */
|
|
414
|
+
export interface SystemMetrics {
|
|
415
|
+
cpu: number
|
|
416
|
+
memory: number
|
|
417
|
+
availableMemory: number
|
|
418
|
+
swapUsed: number
|
|
419
|
+
swapTotal: number
|
|
420
|
+
}
|
|
421
|
+
|
|
321
422
|
export interface Target {
|
|
322
423
|
executor?: string
|
|
323
424
|
inputs?: Array<JsInputs>
|
|
@@ -371,6 +371,7 @@ module.exports.ImportResult = nativeBinding.ImportResult
|
|
|
371
371
|
module.exports.NxCache = nativeBinding.NxCache
|
|
372
372
|
module.exports.NxConsolePreferences = nativeBinding.NxConsolePreferences
|
|
373
373
|
module.exports.NxTaskHistory = nativeBinding.NxTaskHistory
|
|
374
|
+
module.exports.ProcessMetricsCollector = nativeBinding.ProcessMetricsCollector
|
|
374
375
|
module.exports.RunningTasksService = nativeBinding.RunningTasksService
|
|
375
376
|
module.exports.RustPseudoTerminal = nativeBinding.RustPseudoTerminal
|
|
376
377
|
module.exports.TaskDetails = nativeBinding.TaskDetails
|
|
Binary file
|
|
@@ -246,7 +246,7 @@ class TargetProjectLocator {
|
|
|
246
246
|
if (normalizedRange.startsWith('file:')) {
|
|
247
247
|
const targetPath = maybeDep?.data.root;
|
|
248
248
|
const normalizedPath = normalizedRange.replace('file:', '');
|
|
249
|
-
const resolvedPath =
|
|
249
|
+
const resolvedPath = node_path_1.posix.join((0, node_path_1.dirname)(packageJsonPath), normalizedPath);
|
|
250
250
|
if (targetPath === resolvedPath) {
|
|
251
251
|
return maybeDep?.name;
|
|
252
252
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-plugins.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/project-graph/plugins/get-plugins.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"get-plugins.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/project-graph/plugins/get-plugins.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AA0BzD,wBAAsB,UAAU,CAC9B,IAAI,SAAgB,GACnB,OAAO,CAAC,cAAc,EAAE,CAAC,CAgC3B;AAaD,wBAAsB,qBAAqB,CAAC,IAAI,SAAgB,6BAyB/D;AAED,wBAAgB,cAAc,SAG7B"}
|