nx 18.1.0 → 18.1.1
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/bin/init-local.js +13 -1
- package/package.json +12 -12
- package/release/changelog-renderer/index.d.ts +2 -0
- package/release/changelog-renderer/index.js +4 -18
- package/schemas/nx-schema.json +62 -1
- package/schemas/project-schema.json +20 -0
- package/src/adapter/angular-json.d.ts +1 -2
- package/src/adapter/angular-json.js +0 -1
- package/src/adapter/ngcli-adapter.js +3 -3
- package/src/command-line/generate/generator-utils.js +2 -2
- package/src/command-line/init/implementation/add-nx-to-nest.js +2 -2
- package/src/command-line/init/implementation/add-nx-to-npm-repo.js +2 -2
- package/src/command-line/init/implementation/utils.d.ts +1 -3
- package/src/command-line/init/implementation/utils.js +9 -16
- package/src/command-line/init/init-v2.js +3 -2
- package/src/command-line/release/changelog.js +17 -14
- package/src/command-line/release/command-object.d.ts +1 -0
- package/src/command-line/release/config/config.d.ts +12 -15
- package/src/command-line/release/config/config.js +151 -22
- package/src/command-line/release/config/conventional-commits.d.ts +2 -0
- package/src/command-line/release/config/conventional-commits.js +98 -0
- package/src/command-line/release/publish.js +4 -3
- package/src/command-line/release/release.js +12 -11
- package/src/command-line/release/utils/git.js +30 -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 -13
- package/src/command-line/release/utils/semver.d.ts +2 -8
- package/src/command-line/release/utils/semver.js +4 -1
- package/src/command-line/release/utils/shared.d.ts +5 -1
- package/src/command-line/release/version.d.ts +6 -1
- package/src/command-line/release/version.js +71 -19
- package/src/command-line/run/executor-utils.js +2 -2
- package/src/command-line/run/run.js +3 -3
- package/src/config/nx-json.d.ts +31 -0
- package/src/config/schema-utils.js +2 -2
- package/src/core/graph/main.js +1 -1
- package/src/core/graph/polyfills.js +1 -1
- package/src/core/graph/styles.css +1 -1
- package/src/daemon/server/project-graph-incremental-recomputation.js +1 -0
- package/src/devkit-exports.d.ts +1 -2
- package/src/devkit-internals.d.ts +0 -1
- package/src/devkit-internals.js +1 -3
- package/src/executors/run-commands/run-commands.impl.d.ts +7 -1
- package/src/executors/run-commands/run-commands.impl.js +120 -57
- package/src/executors/run-script/run-script.impl.js +5 -5
- package/src/generators/utils/project-configuration.js +2 -2
- package/src/hasher/hash-task.js +2 -2
- package/src/migrations/update-15-1-0/set-project-names.js +2 -4
- package/src/migrations/update-17-2-0/move-default-base.d.ts +1 -1
- package/src/migrations/update-17-2-0/move-default-base.js +3 -1
- package/src/migrations/update-17-3-0/nx-release-path.js +0 -1
- package/src/native/index.d.ts +14 -11
- package/src/native/index.js +3 -4
- package/src/plugins/js/index.d.ts +1 -1
- package/src/plugins/js/lock-file/lock-file.d.ts +1 -1
- package/src/plugins/js/lock-file/lock-file.js +13 -1
- package/src/plugins/js/lock-file/npm-parser.d.ts +1 -1
- package/src/plugins/js/lock-file/pnpm-parser.d.ts +1 -1
- package/src/plugins/js/lock-file/yarn-parser.d.ts +1 -1
- package/src/plugins/js/project-graph/build-dependencies/build-dependencies.d.ts +1 -1
- package/src/plugins/js/project-graph/build-dependencies/explicit-package-json-dependencies.d.ts +1 -1
- package/src/plugins/js/project-graph/build-dependencies/explicit-project-dependencies.d.ts +1 -1
- package/src/plugins/js/utils/register.js +3 -1
- package/src/plugins/package-json-workspaces/create-nodes.d.ts +2 -2
- package/src/plugins/package-json-workspaces/create-nodes.js +31 -24
- package/src/plugins/package-json-workspaces/index.d.ts +0 -1
- package/src/plugins/package-json-workspaces/index.js +0 -2
- package/src/plugins/project-json/build-nodes/package-json-next-to-project-json.d.ts +1 -2
- package/src/plugins/project-json/build-nodes/package-json-next-to-project-json.js +0 -1
- package/src/plugins/project-json/build-nodes/project-json.d.ts +1 -2
- package/src/plugins/project-json/build-nodes/project-json.js +0 -1
- package/src/plugins/target-defaults/target-defaults-plugin.d.ts +1 -2
- package/src/plugins/target-defaults/target-defaults-plugin.js +0 -1
- package/src/project-graph/affected/locators/project-glob-changes.js +3 -2
- package/src/project-graph/build-project-graph.js +8 -11
- package/src/project-graph/file-utils.js +6 -4
- package/src/project-graph/project-graph-builder.d.ts +1 -1
- package/src/project-graph/project-graph.js +3 -0
- package/src/project-graph/utils/normalize-project-nodes.d.ts +1 -1
- package/src/project-graph/utils/project-configuration-utils.d.ts +4 -4
- package/src/project-graph/utils/project-configuration-utils.js +58 -17
- package/src/project-graph/utils/retrieve-workspace-files.d.ts +4 -8
- package/src/project-graph/utils/retrieve-workspace-files.js +18 -20
- package/src/tasks-runner/fork.js +7 -7
- package/src/tasks-runner/forked-process-task-runner.d.ts +2 -4
- package/src/tasks-runner/forked-process-task-runner.js +13 -17
- package/src/tasks-runner/life-cycles/dynamic-run-many-terminal-output-life-cycle.js +16 -13
- package/src/tasks-runner/life-cycles/dynamic-run-one-terminal-output-life-cycle.js +8 -7
- package/src/tasks-runner/{psuedo-ipc.d.ts → pseudo-ipc.d.ts} +7 -7
- package/src/tasks-runner/{psuedo-ipc.js → pseudo-ipc.js} +9 -9
- package/src/tasks-runner/pseudo-terminal.d.ts +42 -0
- package/src/tasks-runner/pseudo-terminal.js +133 -0
- package/src/tasks-runner/task-orchestrator.js +45 -9
- package/src/tasks-runner/tasks-schedule.js +3 -3
- package/src/tasks-runner/utils.d.ts +7 -6
- package/src/tasks-runner/utils.js +11 -7
- package/src/utils/ignore.js +1 -1
- package/src/utils/logger.d.ts +0 -1
- package/src/utils/logger.js +0 -5
- package/src/{project-graph/plugins/public-api.d.ts → utils/nx-plugin.d.ts} +45 -7
- package/src/utils/nx-plugin.deprecated.d.ts +2 -4
- package/src/utils/nx-plugin.deprecated.js +4 -4
- package/src/utils/nx-plugin.js +293 -0
- package/src/utils/output.js +1 -1
- package/src/utils/plugins/plugin-capabilities.d.ts +1 -1
- package/src/utils/plugins/plugin-capabilities.js +7 -8
- package/src/project-graph/plugins/index.d.ts +0 -2
- package/src/project-graph/plugins/index.js +0 -8
- package/src/project-graph/plugins/internal-api.d.ts +0 -18
- package/src/project-graph/plugins/internal-api.js +0 -48
- package/src/project-graph/plugins/messaging.d.ts +0 -94
- package/src/project-graph/plugins/messaging.js +0 -23
- package/src/project-graph/plugins/plugin-pool.d.ts +0 -4
- package/src/project-graph/plugins/plugin-pool.js +0 -216
- package/src/project-graph/plugins/plugin-worker.d.ts +0 -1
- package/src/project-graph/plugins/plugin-worker.js +0 -115
- package/src/project-graph/plugins/public-api.js +0 -4
- package/src/project-graph/plugins/utils.d.ts +0 -9
- package/src/project-graph/plugins/utils.js +0 -55
- package/src/project-graph/plugins/worker-api.d.ts +0 -26
- package/src/project-graph/plugins/worker-api.js +0 -177
@@ -7,8 +7,6 @@ const workspace_root_1 = require("../../utils/workspace-root");
|
|
7
7
|
const target_defaults_plugin_1 = require("../../plugins/target-defaults/target-defaults-plugin");
|
8
8
|
const minimatch_1 = require("minimatch");
|
9
9
|
const path_1 = require("path");
|
10
|
-
const utils_1 = require("../plugins/utils");
|
11
|
-
const plugin_pool_1 = require("../plugins/plugin-pool");
|
12
10
|
function mergeProjectConfigurationIntoRootMap(projectRootMap, project, configurationSourceMaps, sourceInformation,
|
13
11
|
// This function is used when reading project configuration
|
14
12
|
// in generators, where we don't want to do this.
|
@@ -126,33 +124,62 @@ exports.mergeProjectConfigurationIntoRootMap = mergeProjectConfigurationIntoRoot
|
|
126
124
|
* Transforms a list of project paths into a map of project configurations.
|
127
125
|
*
|
128
126
|
* @param nxJson The NxJson configuration
|
129
|
-
* @param
|
127
|
+
* @param workspaceFiles A list of non-ignored workspace files
|
130
128
|
* @param plugins The plugins that should be used to infer project configuration
|
131
129
|
* @param root The workspace root
|
132
130
|
*/
|
133
|
-
function buildProjectsConfigurationsFromProjectPathsAndPlugins(nxJson,
|
131
|
+
function buildProjectsConfigurationsFromProjectPathsAndPlugins(nxJson, workspaceFiles, // making this parameter allows devkit to pick up newly created projects
|
134
132
|
plugins, root = workspace_root_1.workspaceRoot) {
|
135
133
|
const results = [];
|
136
134
|
// We iterate over plugins first - this ensures that plugins specified first take precedence.
|
137
|
-
for (const plugin of plugins) {
|
135
|
+
for (const { plugin, options } of plugins) {
|
138
136
|
const [pattern, createNodes] = plugin.createNodes ?? [];
|
137
|
+
const pluginResults = [];
|
138
|
+
performance.mark(`${plugin.name}:createNodes - start`);
|
139
139
|
if (!pattern) {
|
140
140
|
continue;
|
141
141
|
}
|
142
|
-
const
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
142
|
+
const matchingConfigFiles = workspaceFiles.filter(minimatch_1.minimatch.filter(pattern, { dot: true }));
|
143
|
+
for (const file of matchingConfigFiles) {
|
144
|
+
performance.mark(`${plugin.name}:createNodes:${file} - start`);
|
145
|
+
try {
|
146
|
+
let r = createNodes(file, options, {
|
147
|
+
nxJsonConfiguration: nxJson,
|
148
|
+
workspaceRoot: root,
|
149
|
+
configFiles: matchingConfigFiles,
|
150
|
+
});
|
151
|
+
if (r instanceof Promise) {
|
152
|
+
pluginResults.push(r
|
153
|
+
.catch((e) => {
|
154
|
+
performance.mark(`${plugin.name}:createNodes:${file} - end`);
|
155
|
+
throw new CreateNodesError(`Unable to create nodes for ${file} using plugin ${plugin.name}.`, e);
|
156
|
+
})
|
157
|
+
.then((r) => {
|
158
|
+
performance.mark(`${plugin.name}:createNodes:${file} - end`);
|
159
|
+
performance.measure(`${plugin.name}:createNodes:${file}`, `${plugin.name}:createNodes:${file} - start`, `${plugin.name}:createNodes:${file} - end`);
|
160
|
+
return { ...r, file, pluginName: plugin.name };
|
161
|
+
}));
|
162
|
+
}
|
163
|
+
else {
|
164
|
+
performance.mark(`${plugin.name}:createNodes:${file} - end`);
|
165
|
+
performance.measure(`${plugin.name}:createNodes:${file}`, `${plugin.name}:createNodes:${file} - start`, `${plugin.name}:createNodes:${file} - end`);
|
166
|
+
pluginResults.push({
|
167
|
+
...r,
|
168
|
+
file,
|
169
|
+
pluginName: plugin.name,
|
170
|
+
});
|
171
|
+
}
|
172
|
+
}
|
173
|
+
catch (e) {
|
174
|
+
throw new CreateNodesError(`Unable to create nodes for ${file} using plugin ${plugin.name}.`, e);
|
147
175
|
}
|
148
176
|
}
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
177
|
+
// If there are no promises (counter undefined) or all promises have resolved (counter === 0)
|
178
|
+
results.push(Promise.all(pluginResults).then((results) => {
|
179
|
+
performance.mark(`${plugin.name}:createNodes - end`);
|
180
|
+
performance.measure(`${plugin.name}:createNodes`, `${plugin.name}:createNodes - start`, `${plugin.name}:createNodes - end`);
|
181
|
+
return results;
|
154
182
|
}));
|
155
|
-
results.push(r);
|
156
183
|
}
|
157
184
|
return Promise.all(results).then((results) => {
|
158
185
|
performance.mark('createNodes:merge - start');
|
@@ -174,7 +201,7 @@ plugins, root = workspace_root_1.workspaceRoot) {
|
|
174
201
|
mergeProjectConfigurationIntoRootMap(projectRootMap, project, configurationSourceMaps, sourceInfo);
|
175
202
|
}
|
176
203
|
catch (e) {
|
177
|
-
throw new
|
204
|
+
throw new CreateNodesError(`Unable to merge project information for "${project.root}" from ${result.file} using plugin ${result.pluginName}.`, e);
|
178
205
|
}
|
179
206
|
}
|
180
207
|
Object.assign(externalNodes, pluginExternalNodes);
|
@@ -234,6 +261,20 @@ function readProjectConfigurationsFromRootMap(projectRootMap) {
|
|
234
261
|
return projects;
|
235
262
|
}
|
236
263
|
exports.readProjectConfigurationsFromRootMap = readProjectConfigurationsFromRootMap;
|
264
|
+
class CreateNodesError extends Error {
|
265
|
+
constructor(msg, cause) {
|
266
|
+
const message = `${msg} ${!cause
|
267
|
+
? ''
|
268
|
+
: cause instanceof Error
|
269
|
+
? `\n\n\t Inner Error: ${cause.stack}`
|
270
|
+
: cause}`;
|
271
|
+
// These errors are thrown during a JS callback which is invoked via rust.
|
272
|
+
// The errors messaging gets lost in the rust -> js -> rust transition, but
|
273
|
+
// logging the error here will ensure that it is visible in the console.
|
274
|
+
console.error(message);
|
275
|
+
super(message, { cause });
|
276
|
+
}
|
277
|
+
}
|
237
278
|
/**
|
238
279
|
* Merges two targets.
|
239
280
|
*
|
@@ -2,7 +2,7 @@ import { ProjectConfiguration } from '../../config/workspace-json-project-json';
|
|
2
2
|
import { NxJsonConfiguration } from '../../config/nx-json';
|
3
3
|
import { ProjectGraphExternalNode } from '../../config/project-graph';
|
4
4
|
import { ConfigurationSourceMaps } from './project-configuration-utils';
|
5
|
-
import {
|
5
|
+
import { LoadedNxPlugin } from '../../utils/nx-plugin';
|
6
6
|
/**
|
7
7
|
* Walks the workspace directory to create the `projectFileMap`, `ProjectConfigurations` and `allWorkspaceFiles`
|
8
8
|
* @throws
|
@@ -31,11 +31,7 @@ export type RetrievedGraphNodes = {
|
|
31
31
|
sourceMaps: ConfigurationSourceMaps;
|
32
32
|
projectRootMap: Record<string, string>;
|
33
33
|
};
|
34
|
-
export declare function retrieveProjectConfigurationPaths(root: string, plugins:
|
34
|
+
export declare function retrieveProjectConfigurationPaths(root: string, plugins: LoadedNxPlugin[]): string[];
|
35
35
|
export declare function retrieveProjectConfigurationsWithoutPluginInference(root: string): Promise<Record<string, ProjectConfiguration>>;
|
36
|
-
export declare function createProjectConfigurations(workspaceRoot: string, nxJson: NxJsonConfiguration, configFiles: string[], plugins:
|
37
|
-
|
38
|
-
createNodes?: readonly [string, ...unknown[]];
|
39
|
-
}>;
|
40
|
-
export declare function configurationGlobs(plugins: PluginGlobsOnly): string[];
|
41
|
-
export {};
|
36
|
+
export declare function createProjectConfigurations(workspaceRoot: string, nxJson: NxJsonConfiguration, configFiles: string[], plugins: LoadedNxPlugin[]): Promise<RetrievedGraphNodes>;
|
37
|
+
export declare function configurationGlobs(plugins: LoadedNxPlugin[]): string[];
|
@@ -2,14 +2,15 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.configurationGlobs = exports.createProjectConfigurations = exports.retrieveProjectConfigurationsWithoutPluginInference = exports.retrieveProjectConfigurationPaths = exports.retrieveProjectConfigurationsWithAngularProjects = exports.retrieveProjectConfigurations = exports.retrieveWorkspaceFiles = void 0;
|
4
4
|
const perf_hooks_1 = require("perf_hooks");
|
5
|
+
const installation_directory_1 = require("../../utils/installation-directory");
|
5
6
|
const angular_json_1 = require("../../adapter/angular-json");
|
6
7
|
const nx_json_1 = require("../../config/nx-json");
|
8
|
+
const package_json_workspaces_1 = require("../../plugins/package-json-workspaces");
|
7
9
|
const project_configuration_utils_1 = require("./project-configuration-utils");
|
8
|
-
const
|
10
|
+
const nx_plugin_1 = require("../../utils/nx-plugin");
|
11
|
+
const project_json_1 = require("../../plugins/project-json/build-nodes/project-json");
|
9
12
|
const workspace_context_1 = require("../../utils/workspace-context");
|
10
13
|
const build_all_workspace_files_1 = require("./build-all-workspace-files");
|
11
|
-
const path_1 = require("path");
|
12
|
-
const plugin_pool_1 = require("../plugins/plugin-pool");
|
13
14
|
/**
|
14
15
|
* Walks the workspace directory to create the `projectFileMap`, `ProjectConfigurations` and `allWorkspaceFiles`
|
15
16
|
* @throws
|
@@ -41,29 +42,23 @@ exports.retrieveWorkspaceFiles = retrieveWorkspaceFiles;
|
|
41
42
|
* @param nxJson
|
42
43
|
*/
|
43
44
|
async function retrieveProjectConfigurations(workspaceRoot, nxJson) {
|
44
|
-
const plugins = await (0,
|
45
|
-
|
46
|
-
if (!global.NX_GRAPH_CREATION) {
|
47
|
-
await (0, plugin_pool_1.shutdownPluginWorkers)();
|
48
|
-
}
|
49
|
-
return projects;
|
45
|
+
const plugins = await (0, nx_plugin_1.loadNxPlugins)(nxJson?.plugins ?? [], (0, installation_directory_1.getNxRequirePaths)(workspaceRoot), workspaceRoot);
|
46
|
+
return _retrieveProjectConfigurations(workspaceRoot, nxJson, plugins);
|
50
47
|
}
|
51
48
|
exports.retrieveProjectConfigurations = retrieveProjectConfigurations;
|
52
49
|
async function retrieveProjectConfigurationsWithAngularProjects(workspaceRoot, nxJson) {
|
53
|
-
const
|
50
|
+
const plugins = await (0, nx_plugin_1.loadNxPlugins)(nxJson?.plugins ?? [], (0, installation_directory_1.getNxRequirePaths)(workspaceRoot), workspaceRoot);
|
54
51
|
if ((0, angular_json_1.shouldMergeAngularProjects)(workspaceRoot, true) &&
|
55
|
-
!
|
56
|
-
|
57
|
-
pluginsToLoad.push((0, path_1.join)(__dirname, '../../adapter/angular-json'));
|
52
|
+
!plugins.some((p) => p.plugin.name === angular_json_1.NX_ANGULAR_JSON_PLUGIN_NAME)) {
|
53
|
+
plugins.push({ plugin: angular_json_1.NxAngularJsonPlugin });
|
58
54
|
}
|
59
|
-
const plugins = await (0, internal_api_1.loadNxPlugins)(nxJson?.plugins ?? [], workspaceRoot);
|
60
55
|
return _retrieveProjectConfigurations(workspaceRoot, nxJson, plugins);
|
61
56
|
}
|
62
57
|
exports.retrieveProjectConfigurationsWithAngularProjects = retrieveProjectConfigurationsWithAngularProjects;
|
63
58
|
function _retrieveProjectConfigurations(workspaceRoot, nxJson, plugins) {
|
64
59
|
const globPatterns = configurationGlobs(plugins);
|
65
|
-
const
|
66
|
-
return createProjectConfigurations(workspaceRoot, nxJson,
|
60
|
+
const workspaceFiles = (0, workspace_context_1.globWithWorkspaceContext)(workspaceRoot, globPatterns);
|
61
|
+
return createProjectConfigurations(workspaceRoot, nxJson, workspaceFiles, plugins);
|
67
62
|
}
|
68
63
|
function retrieveProjectConfigurationPaths(root, plugins) {
|
69
64
|
const projectGlobPatterns = configurationGlobs(plugins);
|
@@ -74,14 +69,17 @@ const projectsWithoutPluginCache = new Map();
|
|
74
69
|
// TODO: This function is called way too often, it should be optimized without this cache
|
75
70
|
async function retrieveProjectConfigurationsWithoutPluginInference(root) {
|
76
71
|
const nxJson = (0, nx_json_1.readNxJson)(root);
|
77
|
-
const plugins = await (0,
|
72
|
+
const plugins = await (0, nx_plugin_1.getDefaultPlugins)(root);
|
78
73
|
const projectGlobPatterns = retrieveProjectConfigurationPaths(root, plugins);
|
79
74
|
const cacheKey = root + ',' + projectGlobPatterns.join(',');
|
80
75
|
if (projectsWithoutPluginCache.has(cacheKey)) {
|
81
76
|
return projectsWithoutPluginCache.get(cacheKey);
|
82
77
|
}
|
83
|
-
const projectFiles = (0, workspace_context_1.globWithWorkspaceContext)(root, projectGlobPatterns);
|
84
|
-
const { projects } = await createProjectConfigurations(root, nxJson, projectFiles,
|
78
|
+
const projectFiles = (0, workspace_context_1.globWithWorkspaceContext)(root, projectGlobPatterns) ?? [];
|
79
|
+
const { projects } = await createProjectConfigurations(root, nxJson, projectFiles, [
|
80
|
+
{ plugin: (0, package_json_workspaces_1.getNxPackageJsonWorkspacesPlugin)(root) },
|
81
|
+
{ plugin: project_json_1.ProjectJsonProjectsPlugin },
|
82
|
+
]);
|
85
83
|
projectsWithoutPluginCache.set(cacheKey, projects);
|
86
84
|
return projects;
|
87
85
|
}
|
@@ -101,7 +99,7 @@ async function createProjectConfigurations(workspaceRoot, nxJson, configFiles, p
|
|
101
99
|
exports.createProjectConfigurations = createProjectConfigurations;
|
102
100
|
function configurationGlobs(plugins) {
|
103
101
|
const globPatterns = [];
|
104
|
-
for (const plugin of plugins) {
|
102
|
+
for (const { plugin } of plugins) {
|
105
103
|
if (plugin.createNodes) {
|
106
104
|
globPatterns.push(plugin.createNodes[0]);
|
107
105
|
}
|
package/src/tasks-runner/fork.js
CHANGED
@@ -2,22 +2,22 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
const child_process_1 = require("child_process");
|
4
4
|
const path_1 = require("path");
|
5
|
-
const
|
6
|
-
const
|
5
|
+
const pseudo_ipc_1 = require("./pseudo-ipc");
|
6
|
+
const pseudoIPCPath = process.argv[2];
|
7
7
|
const forkId = process.argv[3];
|
8
8
|
const script = (0, path_1.join)(__dirname, '../../bin/run-executor.js');
|
9
9
|
const childProcess = (0, child_process_1.fork)(script, {
|
10
10
|
stdio: ['inherit', 'inherit', 'inherit', 'ipc'],
|
11
11
|
});
|
12
|
-
const
|
13
|
-
|
12
|
+
const pseudoIPC = new pseudo_ipc_1.PseudoIPCClient(pseudoIPCPath);
|
13
|
+
pseudoIPC.onMessageFromParent(forkId, (message) => {
|
14
14
|
childProcess.send(message);
|
15
15
|
});
|
16
|
-
|
16
|
+
pseudoIPC.notifyChildIsReady(forkId);
|
17
17
|
process.on('message', (message) => {
|
18
|
-
|
18
|
+
pseudoIPC.sendMessageToParent(message);
|
19
19
|
});
|
20
20
|
childProcess.on('exit', (code) => {
|
21
|
-
|
21
|
+
pseudoIPC.close();
|
22
22
|
process.exit(code);
|
23
23
|
});
|
@@ -8,8 +8,7 @@ export declare class ForkedProcessTaskRunner {
|
|
8
8
|
cliPath: string;
|
9
9
|
private readonly verbose;
|
10
10
|
private processes;
|
11
|
-
private
|
12
|
-
private psuedoIPC;
|
11
|
+
private pseudoTerminal;
|
13
12
|
constructor(options: DefaultTasksRunnerOptions);
|
14
13
|
init(): Promise<void>;
|
15
14
|
forkProcessForBatch({ executorName, taskGraph: batchTaskGraph }: Batch, fullTaskGraph: TaskGraph, env: NodeJS.ProcessEnv): Promise<BatchResults>;
|
@@ -33,12 +32,11 @@ export declare class ForkedProcessTaskRunner {
|
|
33
32
|
code: number;
|
34
33
|
terminalOutput: string;
|
35
34
|
}>;
|
36
|
-
private
|
35
|
+
private forkProcessWithPseudoTerminal;
|
37
36
|
private forkProcessPipeOutputCapture;
|
38
37
|
private forkProcessWithPrefixAndNotTTY;
|
39
38
|
private forkProcessDirectOutputCapture;
|
40
39
|
private readTerminalOutput;
|
41
40
|
private writeTerminalOutput;
|
42
41
|
private setupProcessEventListeners;
|
43
|
-
destroy(): void;
|
44
42
|
}
|
@@ -11,10 +11,7 @@ const path_1 = require("path");
|
|
11
11
|
const batch_messages_1 = require("./batch/batch-messages");
|
12
12
|
const strip_indents_1 = require("../utils/strip-indents");
|
13
13
|
const stream_1 = require("stream");
|
14
|
-
const
|
15
|
-
const psuedo_ipc_1 = require("./psuedo-ipc");
|
16
|
-
const socket_utils_1 = require("../daemon/socket-utils");
|
17
|
-
const child_process_2 = require("../utils/child-process");
|
14
|
+
const pseudo_terminal_1 = require("./pseudo-terminal");
|
18
15
|
const exit_codes_1 = require("../utils/exit-codes");
|
19
16
|
const forkScript = (0, path_1.join)(__dirname, './fork.js');
|
20
17
|
const workerPath = (0, path_1.join)(__dirname, './batch/run-batch.js');
|
@@ -24,11 +21,10 @@ class ForkedProcessTaskRunner {
|
|
24
21
|
this.cliPath = (0, utils_1.getCliPath)();
|
25
22
|
this.verbose = process.env.NX_VERBOSE_LOGGING === 'true';
|
26
23
|
this.processes = new Set();
|
27
|
-
this.
|
28
|
-
this.psuedoIPC = new psuedo_ipc_1.PsuedoIPCServer(this.psuedoIPCPath);
|
24
|
+
this.pseudoTerminal = (0, pseudo_terminal_1.getPseudoTerminal)();
|
29
25
|
}
|
30
26
|
async init() {
|
31
|
-
await this.
|
27
|
+
await this.pseudoTerminal.init();
|
32
28
|
this.setupProcessEventListeners();
|
33
29
|
}
|
34
30
|
// TODO: vsavkin delegate terminal output printing
|
@@ -121,7 +117,7 @@ class ForkedProcessTaskRunner {
|
|
121
117
|
});
|
122
118
|
}
|
123
119
|
else {
|
124
|
-
return this.
|
120
|
+
return this.forkProcessWithPseudoTerminal(task, {
|
125
121
|
temporaryOutputPath,
|
126
122
|
streamOutput,
|
127
123
|
taskGraph,
|
@@ -129,15 +125,18 @@ class ForkedProcessTaskRunner {
|
|
129
125
|
});
|
130
126
|
}
|
131
127
|
}
|
132
|
-
async
|
128
|
+
async forkProcessWithPseudoTerminal(task, { streamOutput, taskGraph, env, }) {
|
133
129
|
const args = (0, utils_1.getPrintableCommandArgsForTask)(task);
|
134
130
|
if (streamOutput) {
|
135
131
|
output_1.output.logCommand(args.join(' '));
|
136
132
|
}
|
137
133
|
const childId = task.id;
|
138
|
-
const p =
|
139
|
-
|
140
|
-
|
134
|
+
const p = await this.pseudoTerminal.fork(childId, forkScript, {
|
135
|
+
cwd: process.cwd(),
|
136
|
+
jsEnv: env,
|
137
|
+
quiet: !streamOutput,
|
138
|
+
});
|
139
|
+
p.send({
|
141
140
|
targetDescription: task.target,
|
142
141
|
overrides: task.overrides,
|
143
142
|
taskGraph,
|
@@ -304,13 +303,13 @@ class ForkedProcessTaskRunner {
|
|
304
303
|
(0, fs_1.writeFileSync)(outputPath, content);
|
305
304
|
}
|
306
305
|
setupProcessEventListeners() {
|
307
|
-
this.
|
306
|
+
this.pseudoTerminal.onMessageFromChildren((message) => {
|
308
307
|
process.send(message);
|
309
308
|
});
|
310
309
|
// When the nx process gets a message, it will be sent into the task's process
|
311
310
|
process.on('message', (message) => {
|
312
311
|
// this.publisher.publish(message.toString());
|
313
|
-
this.
|
312
|
+
this.pseudoTerminal.sendMessageToChildren(message);
|
314
313
|
this.processes.forEach((p) => {
|
315
314
|
if ('connected' in p && p.connected) {
|
316
315
|
p.send(message);
|
@@ -353,9 +352,6 @@ class ForkedProcessTaskRunner {
|
|
353
352
|
// will store results to the cache and will terminate this process
|
354
353
|
});
|
355
354
|
}
|
356
|
-
destroy() {
|
357
|
-
this.psuedoIPC.close();
|
358
|
-
}
|
359
355
|
}
|
360
356
|
exports.ForkedProcessTaskRunner = ForkedProcessTaskRunner;
|
361
357
|
const colors = [
|
@@ -9,8 +9,9 @@ const output_1 = require("../../utils/output");
|
|
9
9
|
const pretty_time_1 = require("./pretty-time");
|
10
10
|
const formatting_utils_1 = require("./formatting-utils");
|
11
11
|
const view_logs_utils_1 = require("./view-logs-utils");
|
12
|
-
const LEFT_PAD = `
|
13
|
-
const
|
12
|
+
const LEFT_PAD = ` `;
|
13
|
+
const SPACER = ` `;
|
14
|
+
const EXTENDED_LEFT_PAD = ` `;
|
14
15
|
/**
|
15
16
|
* The following function is responsible for creating a life cycle with dynamic
|
16
17
|
* outputs, meaning previous outputs can be rewritten or modified as new outputs
|
@@ -92,7 +93,7 @@ async function createRunManyDynamicOutputRenderer({ projectNames, tasks, args, o
|
|
92
93
|
switch (status) {
|
93
94
|
case 'local-cache':
|
94
95
|
writeCompletedTaskResultLine(`${output_1.output.colors.green(figures.tick) +
|
95
|
-
|
96
|
+
SPACER +
|
96
97
|
output_1.output.formatCommand(task.id)} ${output_1.output.dim('[local cache]')}`);
|
97
98
|
if (isVerbose) {
|
98
99
|
writeCommandOutputBlock(tasksToTerminalOutputs[task.id]);
|
@@ -100,7 +101,7 @@ async function createRunManyDynamicOutputRenderer({ projectNames, tasks, args, o
|
|
100
101
|
break;
|
101
102
|
case 'local-cache-kept-existing':
|
102
103
|
writeCompletedTaskResultLine(`${output_1.output.colors.green(figures.tick) +
|
103
|
-
|
104
|
+
SPACER +
|
104
105
|
output_1.output.formatCommand(task.id)} ${output_1.output.dim('[existing outputs match the cache, left as is]')}`);
|
105
106
|
if (isVerbose) {
|
106
107
|
writeCommandOutputBlock(tasksToTerminalOutputs[task.id]);
|
@@ -108,7 +109,7 @@ async function createRunManyDynamicOutputRenderer({ projectNames, tasks, args, o
|
|
108
109
|
break;
|
109
110
|
case 'remote-cache':
|
110
111
|
writeCompletedTaskResultLine(`${output_1.output.colors.green(figures.tick) +
|
111
|
-
|
112
|
+
SPACER +
|
112
113
|
output_1.output.formatCommand(task.id)} ${output_1.output.dim('[remote cache]')}`);
|
113
114
|
if (isVerbose) {
|
114
115
|
writeCommandOutputBlock(tasksToTerminalOutputs[task.id]);
|
@@ -117,7 +118,7 @@ async function createRunManyDynamicOutputRenderer({ projectNames, tasks, args, o
|
|
117
118
|
case 'success': {
|
118
119
|
const timeTakenText = (0, pretty_time_1.prettyTime)(process.hrtime(tasksToProcessStartTimes[task.id]));
|
119
120
|
writeCompletedTaskResultLine(output_1.output.colors.green(figures.tick) +
|
120
|
-
|
121
|
+
SPACER +
|
121
122
|
output_1.output.formatCommand(task.id) +
|
122
123
|
output_1.output.dim(` (${timeTakenText})`));
|
123
124
|
if (isVerbose) {
|
@@ -126,9 +127,10 @@ async function createRunManyDynamicOutputRenderer({ projectNames, tasks, args, o
|
|
126
127
|
break;
|
127
128
|
}
|
128
129
|
case 'failure':
|
130
|
+
output_1.output.addNewline();
|
129
131
|
output_1.output.addNewline();
|
130
132
|
writeCompletedTaskResultLine(output_1.output.colors.red(figures.cross) +
|
131
|
-
|
133
|
+
SPACER +
|
132
134
|
output_1.output.formatCommand(output_1.output.colors.red(task.id)));
|
133
135
|
writeCommandOutputBlock(tasksToTerminalOutputs[task.id]);
|
134
136
|
break;
|
@@ -145,10 +147,10 @@ async function createRunManyDynamicOutputRenderer({ projectNames, tasks, args, o
|
|
145
147
|
const runningTasks = taskRows.filter((row) => row.status === 'running');
|
146
148
|
const remainingTasks = totalTasks - totalCompletedTasks;
|
147
149
|
if (runningTasks.length > 0) {
|
148
|
-
additionalFooterRows.push(output_1.output.dim(`${LEFT_PAD}${output_1.output.colors.cyan(figures.arrowRight)}
|
150
|
+
additionalFooterRows.push(output_1.output.dim(`${LEFT_PAD}${output_1.output.colors.cyan(figures.arrowRight)}${SPACER}Executing ${runningTasks.length}/${remainingTasks} remaining tasks${runningTasks.length > 1 ? ' in parallel' : ''}...`));
|
149
151
|
additionalFooterRows.push('');
|
150
152
|
for (const runningTask of runningTasks) {
|
151
|
-
additionalFooterRows.push(`${LEFT_PAD}${output_1.output.dim.cyan(cli_spinners_1.dots.frames[currentFrame])}
|
153
|
+
additionalFooterRows.push(`${LEFT_PAD}${output_1.output.dim.cyan(cli_spinners_1.dots.frames[currentFrame])}${SPACER}${output_1.output.formatCommand(runningTask.task.id)}`);
|
152
154
|
}
|
153
155
|
/**
|
154
156
|
* Reduce layout thrashing by ensuring that there is a relatively consistent
|
@@ -172,10 +174,10 @@ async function createRunManyDynamicOutputRenderer({ projectNames, tasks, args, o
|
|
172
174
|
additionalFooterRows.push('');
|
173
175
|
}
|
174
176
|
if (totalSuccessfulTasks > 0) {
|
175
|
-
additionalFooterRows.push(`${LEFT_PAD}${output_1.output.colors.green(figures.tick)}
|
177
|
+
additionalFooterRows.push(`${LEFT_PAD}${output_1.output.colors.green(figures.tick)}${SPACER}${totalSuccessfulTasks}${`/${totalCompletedTasks}`} succeeded ${output_1.output.dim(`[${totalCachedTasks} read from cache]`)}`);
|
176
178
|
}
|
177
179
|
if (totalFailedTasks > 0) {
|
178
|
-
additionalFooterRows.push(`${LEFT_PAD}${output_1.output.colors.red(figures.cross)}
|
180
|
+
additionalFooterRows.push(`${LEFT_PAD}${output_1.output.colors.red(figures.cross)}${SPACER}${totalFailedTasks}${`/${totalCompletedTasks}`} failed`);
|
179
181
|
}
|
180
182
|
moveCursorToStartOfPinnedFooter();
|
181
183
|
if (additionalFooterRows.length > 1) {
|
@@ -253,9 +255,10 @@ async function createRunManyDynamicOutputRenderer({ projectNames, tasks, args, o
|
|
253
255
|
output_1.output.applyNxPrefix('red', output_1.output.colors.red(text) + output_1.output.dim.white(` (${timeTakenText})`)),
|
254
256
|
...taskOverridesRows,
|
255
257
|
'',
|
256
|
-
output_1.output.dim(`${LEFT_PAD}${output_1.output.dim(figures.tick)}
|
258
|
+
output_1.output.dim(`${LEFT_PAD}${output_1.output.dim(figures.tick)}${SPACER}${totalSuccessfulTasks}${`/${totalCompletedTasks}`} succeeded ${output_1.output.dim(`[${totalCachedTasks} read from cache]`)}`),
|
259
|
+
'',
|
260
|
+
`${LEFT_PAD}${output_1.output.colors.red(figures.cross)}${SPACER}${totalFailedTasks}${`/${totalCompletedTasks}`} targets failed, including the following:`,
|
257
261
|
'',
|
258
|
-
`${LEFT_PAD}${output_1.output.colors.red(figures.cross)} ${totalFailedTasks}${`/${totalCompletedTasks}`} targets failed, including the following:`,
|
259
262
|
`${failedTasksForPrinting
|
260
263
|
.map((t) => `${EXTENDED_LEFT_PAD}${output_1.output.colors.red('-')} ${output_1.output.formatCommand(t.toString())}`)
|
261
264
|
.join('\n ')}`,
|
@@ -9,8 +9,9 @@ const output_1 = require("../../utils/output");
|
|
9
9
|
const pretty_time_1 = require("./pretty-time");
|
10
10
|
const formatting_utils_1 = require("./formatting-utils");
|
11
11
|
const view_logs_utils_1 = require("./view-logs-utils");
|
12
|
-
const LEFT_PAD = `
|
13
|
-
const
|
12
|
+
const LEFT_PAD = ` `;
|
13
|
+
const SPACER = ` `;
|
14
|
+
const EXTENDED_LEFT_PAD = ` `;
|
14
15
|
/**
|
15
16
|
* The following function is responsible for creating a life cycle with dynamic
|
16
17
|
* outputs, meaning previous outputs can be rewritten or modified as new outputs
|
@@ -88,7 +89,7 @@ async function createRunOneDynamicOutputRenderer({ initiatingProject, tasks, arg
|
|
88
89
|
switch (state) {
|
89
90
|
case 'EXECUTING_DEPENDENT_TARGETS':
|
90
91
|
if (totalFailedTasks === 0) {
|
91
|
-
linesToRender.push(`${LEFT_PAD}${output_1.output.colors.cyan(cli_spinners_1.dots.frames[dependentTargetsCurrentFrame])}
|
92
|
+
linesToRender.push(`${LEFT_PAD}${output_1.output.colors.cyan(cli_spinners_1.dots.frames[dependentTargetsCurrentFrame])}${SPACER}${output_1.output.dim(`Nx is waiting on ${remainingDependentTasksNotFromInitiatingProject} dependent project tasks before running tasks from`)} ${initiatingProject}${output_1.output.dim('...')}`);
|
92
93
|
if (totalSuccessfulTasks > 0) {
|
93
94
|
linesToRender.push('');
|
94
95
|
}
|
@@ -96,10 +97,10 @@ async function createRunOneDynamicOutputRenderer({ initiatingProject, tasks, arg
|
|
96
97
|
break;
|
97
98
|
}
|
98
99
|
if (totalFailedTasks > 0) {
|
99
|
-
linesToRender.push(output_1.output.colors.red.dim(`${LEFT_PAD}${output_1.output.colors.red(figures.cross)}
|
100
|
+
linesToRender.push(output_1.output.colors.red.dim(`${LEFT_PAD}${output_1.output.colors.red(figures.cross)}${SPACER}${totalFailedTasks}${`/${totalCompletedTasks}`} dependent project tasks failed (see below)`));
|
100
101
|
}
|
101
102
|
if (totalSuccessfulTasks > 0) {
|
102
|
-
linesToRender.push(output_1.output.dim(`${LEFT_PAD}${output_1.output.dim(figures.tick)}
|
103
|
+
linesToRender.push(output_1.output.dim(`${LEFT_PAD}${output_1.output.dim(figures.tick)}${SPACER}${totalSuccessfulTasks}${`/${totalCompletedTasks}`} dependent project tasks succeeded ${output_1.output.dim(`[${totalCachedTasks} read from cache]`)}`));
|
103
104
|
}
|
104
105
|
moveCursorToStartOfDependentTargetLines();
|
105
106
|
if (linesToRender.length > 1) {
|
@@ -212,8 +213,8 @@ async function createRunOneDynamicOutputRenderer({ initiatingProject, tasks, arg
|
|
212
213
|
output_1.output.applyNxPrefix('red', output_1.output.colors.red(text) + output_1.output.dim(` (${timeTakenText})`)),
|
213
214
|
...taskOverridesLines,
|
214
215
|
'',
|
215
|
-
`${LEFT_PAD}${output_1.output.colors.red(figures.cross)}
|
216
|
-
`${LEFT_PAD}${output_1.output.dim(figures.tick)}
|
216
|
+
`${LEFT_PAD}${output_1.output.colors.red(figures.cross)}${SPACER}${totalFailedTasks}${`/${totalCompletedTasks}`} failed`,
|
217
|
+
`${LEFT_PAD}${output_1.output.dim(figures.tick)}${SPACER}${totalSuccessfulTasks}${`/${totalCompletedTasks}`} succeeded ${output_1.output.dim(`[${totalCachedTasks} read from cache]`)}`,
|
217
218
|
...viewLogs,
|
218
219
|
], 'red');
|
219
220
|
}
|
@@ -6,24 +6,24 @@
|
|
6
6
|
* Main Nx Process
|
7
7
|
* * Calls Rust Fork Function
|
8
8
|
* * `node fork.js`
|
9
|
-
* * Create a Rust - Node.js Agnostic Channel aka
|
9
|
+
* * Create a Rust - Node.js Agnostic Channel aka Pseudo IPC Channel
|
10
10
|
* * This returns RustChildProcess
|
11
11
|
* * RustChildProcess.onMessage(msg => ());
|
12
|
-
* *
|
12
|
+
* * pseudo_ipc_channel.on_message() => tx.send(msg);
|
13
13
|
* * Node.js Fork Wrapper (fork.js)
|
14
14
|
* * fork(run-command.js) with `inherit` and `ipc`
|
15
15
|
* * This will create a Node IPC Channel
|
16
|
-
* * channel =
|
17
|
-
* * forkChildProcess.on('message',
|
16
|
+
* * channel = getPseudoIpcChannel(process.env.NX_IPC_CHANNEL_ID)
|
17
|
+
* * forkChildProcess.on('message', writeToPseudoIpcChannel)
|
18
18
|
*/
|
19
19
|
/// <reference types="node" />
|
20
20
|
import { Serializable } from 'child_process';
|
21
|
-
export interface
|
21
|
+
export interface PseudoIPCMessage {
|
22
22
|
type: 'TO_CHILDREN_FROM_PARENT' | 'TO_PARENT_FROM_CHILDREN' | 'CHILD_READY';
|
23
23
|
id: string | undefined;
|
24
24
|
message: Serializable;
|
25
25
|
}
|
26
|
-
export declare class
|
26
|
+
export declare class PseudoIPCServer {
|
27
27
|
private path;
|
28
28
|
private sockets;
|
29
29
|
private server;
|
@@ -38,7 +38,7 @@ export declare class PsuedoIPCServer {
|
|
38
38
|
onMessageFromChildren(onMessage: (message: Serializable) => void, onClose?: () => void, onError?: (err: Error) => void): void;
|
39
39
|
close(): void;
|
40
40
|
}
|
41
|
-
export declare class
|
41
|
+
export declare class PseudoIPCClient {
|
42
42
|
private path;
|
43
43
|
private socket;
|
44
44
|
constructor(path: string);
|
@@ -7,21 +7,21 @@
|
|
7
7
|
* Main Nx Process
|
8
8
|
* * Calls Rust Fork Function
|
9
9
|
* * `node fork.js`
|
10
|
-
* * Create a Rust - Node.js Agnostic Channel aka
|
10
|
+
* * Create a Rust - Node.js Agnostic Channel aka Pseudo IPC Channel
|
11
11
|
* * This returns RustChildProcess
|
12
12
|
* * RustChildProcess.onMessage(msg => ());
|
13
|
-
* *
|
13
|
+
* * pseudo_ipc_channel.on_message() => tx.send(msg);
|
14
14
|
* * Node.js Fork Wrapper (fork.js)
|
15
15
|
* * fork(run-command.js) with `inherit` and `ipc`
|
16
16
|
* * This will create a Node IPC Channel
|
17
|
-
* * channel =
|
18
|
-
* * forkChildProcess.on('message',
|
17
|
+
* * channel = getPseudoIpcChannel(process.env.NX_IPC_CHANNEL_ID)
|
18
|
+
* * forkChildProcess.on('message', writeToPseudoIpcChannel)
|
19
19
|
*/
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
21
|
-
exports.
|
21
|
+
exports.PseudoIPCClient = exports.PseudoIPCServer = void 0;
|
22
22
|
const net_1 = require("net");
|
23
23
|
const consume_messages_from_socket_1 = require("../utils/consume-messages-from-socket");
|
24
|
-
class
|
24
|
+
class PseudoIPCServer {
|
25
25
|
constructor(path) {
|
26
26
|
this.path = path;
|
27
27
|
this.sockets = new Set();
|
@@ -98,8 +98,8 @@ class PsuedoIPCServer {
|
|
98
98
|
this.sockets.forEach((s) => s.destroy());
|
99
99
|
}
|
100
100
|
}
|
101
|
-
exports.
|
102
|
-
class
|
101
|
+
exports.PseudoIPCServer = PseudoIPCServer;
|
102
|
+
class PseudoIPCClient {
|
103
103
|
constructor(path) {
|
104
104
|
this.path = path;
|
105
105
|
this.socket = (0, net_1.connect)(this.path);
|
@@ -137,4 +137,4 @@ class PsuedoIPCClient {
|
|
137
137
|
this.socket?.destroy();
|
138
138
|
}
|
139
139
|
}
|
140
|
-
exports.
|
140
|
+
exports.PseudoIPCClient = PseudoIPCClient;
|
@@ -0,0 +1,42 @@
|
|
1
|
+
/// <reference types="node" />
|
2
|
+
import { ChildProcess, RustPseudoTerminal } from '../native';
|
3
|
+
import { PseudoIPCServer } from './pseudo-ipc';
|
4
|
+
import { Serializable } from 'child_process';
|
5
|
+
export declare function getPseudoTerminal(): PseudoTerminal;
|
6
|
+
export declare class PseudoTerminal {
|
7
|
+
private rustPseudoTerminal;
|
8
|
+
private pseudoIPCPath;
|
9
|
+
private pseudoIPC;
|
10
|
+
private initialized;
|
11
|
+
constructor(rustPseudoTerminal: RustPseudoTerminal);
|
12
|
+
init(): Promise<void>;
|
13
|
+
runCommand(command: string, { cwd, jsEnv, quiet, }?: {
|
14
|
+
cwd?: string;
|
15
|
+
jsEnv?: Record<string, string>;
|
16
|
+
quiet?: boolean;
|
17
|
+
}): PseudoTtyProcess;
|
18
|
+
fork(id: string, script: string, { cwd, jsEnv, quiet, }: {
|
19
|
+
cwd?: string;
|
20
|
+
jsEnv?: Record<string, string>;
|
21
|
+
quiet?: boolean;
|
22
|
+
}): Promise<PseudoTtyProcessWithSend>;
|
23
|
+
sendMessageToChildren(message: Serializable): void;
|
24
|
+
onMessageFromChildren(callback: (message: Serializable) => void): void;
|
25
|
+
private setupProcessListeners;
|
26
|
+
private shutdownPseudoIPC;
|
27
|
+
}
|
28
|
+
export declare class PseudoTtyProcess {
|
29
|
+
private childProcess;
|
30
|
+
isAlive: boolean;
|
31
|
+
exitCallbacks: any[];
|
32
|
+
constructor(childProcess: ChildProcess);
|
33
|
+
onExit(callback: (code: number) => void): void;
|
34
|
+
onOutput(callback: (message: string) => void): void;
|
35
|
+
kill(): void;
|
36
|
+
}
|
37
|
+
export declare class PseudoTtyProcessWithSend extends PseudoTtyProcess {
|
38
|
+
private id;
|
39
|
+
private pseudoIpc;
|
40
|
+
constructor(_childProcess: ChildProcess, id: string, pseudoIpc: PseudoIPCServer);
|
41
|
+
send(message: Serializable): void;
|
42
|
+
}
|