nx 19.0.0-rc.1 → 19.0.0
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/package.json +12 -12
- package/src/command-line/connect/connect-to-nx-cloud.js +8 -3
- package/src/core/graph/main.js +1 -1
- package/src/native/index.d.ts +2 -2
- package/src/nx-cloud/generators/connect-to-nx-cloud/connect-to-nx-cloud.d.ts +2 -2
- package/src/nx-cloud/generators/connect-to-nx-cloud/connect-to-nx-cloud.js +1 -0
- package/src/tasks-runner/fork.js +7 -0
- package/src/tasks-runner/forked-process-task-runner.js +1 -0
- package/src/tasks-runner/pseudo-terminal.d.ts +4 -2
- package/src/tasks-runner/pseudo-terminal.js +4 -4
package/src/native/index.d.ts
CHANGED
@@ -150,12 +150,12 @@ export class ChildProcess {
|
|
150
150
|
}
|
151
151
|
export class RustPseudoTerminal {
|
152
152
|
constructor()
|
153
|
-
runCommand(command: string, commandDir?: string | undefined | null, jsEnv?: Record<string, string> | undefined | null, quiet?: boolean | undefined | null, tty?: boolean | undefined | null): ChildProcess
|
153
|
+
runCommand(command: string, commandDir?: string | undefined | null, jsEnv?: Record<string, string> | undefined | null, execArgv?: Array<string> | undefined | null, quiet?: boolean | undefined | null, tty?: boolean | undefined | null): ChildProcess
|
154
154
|
/**
|
155
155
|
* This allows us to run a pseudoterminal with a fake node ipc channel
|
156
156
|
* this makes it possible to be backwards compatible with the old implementation
|
157
157
|
*/
|
158
|
-
fork(id: string, forkScript: string, pseudoIpcPath: string, commandDir: string | undefined | null, jsEnv: Record<string, string> | undefined | null, quiet: boolean): ChildProcess
|
158
|
+
fork(id: string, forkScript: string, pseudoIpcPath: string, commandDir: string | undefined | null, jsEnv: Record<string, string> | undefined | null, execArgv: Array<string> | undefined | null, quiet: boolean): ChildProcess
|
159
159
|
}
|
160
160
|
export class HashPlanner {
|
161
161
|
constructor(nxJson: NxJson, projectGraph: ExternalObject<ProjectGraph>)
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { Tree } from '../../../generators/tree';
|
2
2
|
interface ConnectToNxCloudOptions {
|
3
|
-
analytics
|
4
|
-
installationSource
|
3
|
+
analytics?: boolean;
|
4
|
+
installationSource?: string;
|
5
5
|
hideFormatLogs?: boolean;
|
6
6
|
}
|
7
7
|
export declare function connectToNxCloud(tree: Tree, schema: ConnectToNxCloudOptions): Promise<() => void>;
|
@@ -83,6 +83,7 @@ function addNxCloudOptionsToNxJson(tree, nxJson, token) {
|
|
83
83
|
(0, nx_json_1.updateNxJson)(tree, nxJson);
|
84
84
|
}
|
85
85
|
async function connectToNxCloud(tree, schema) {
|
86
|
+
schema.installationSource ??= 'user';
|
86
87
|
const nxJson = (0, nx_json_1.readNxJson)(tree);
|
87
88
|
if (nxJson?.neverConnectToCloud) {
|
88
89
|
return () => {
|
package/src/tasks-runner/fork.js
CHANGED
@@ -6,8 +6,15 @@ const pseudo_ipc_1 = require("./pseudo-ipc");
|
|
6
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
|
+
let execArgv;
|
10
|
+
if (process.env['NX_PSEUDO_TERMINAL_EXEC_ARGV']) {
|
11
|
+
execArgv = process.env['NX_PSEUDO_TERMINAL_EXEC_ARGV'].split('|');
|
12
|
+
delete process.env['NX_PSEUDO_TERMINAL_EXEC_ARGV'];
|
13
|
+
}
|
9
14
|
const childProcess = (0, child_process_1.fork)(script, {
|
10
15
|
stdio: ['inherit', 'inherit', 'inherit', 'ipc'],
|
16
|
+
env: process.env,
|
17
|
+
execArgv,
|
11
18
|
});
|
12
19
|
const pseudoIPC = new pseudo_ipc_1.PseudoIPCClient(pseudoIPCPath);
|
13
20
|
pseudoIPC.onMessageFromParent(forkId, (message) => {
|
@@ -11,14 +11,16 @@ export declare class PseudoTerminal {
|
|
11
11
|
static isSupported(): boolean;
|
12
12
|
constructor(rustPseudoTerminal: RustPseudoTerminal);
|
13
13
|
init(): Promise<void>;
|
14
|
-
runCommand(command: string, { cwd, jsEnv, quiet, tty, }?: {
|
14
|
+
runCommand(command: string, { cwd, execArgv, jsEnv, quiet, tty, }?: {
|
15
15
|
cwd?: string;
|
16
|
+
execArgv?: string[];
|
16
17
|
jsEnv?: Record<string, string>;
|
17
18
|
quiet?: boolean;
|
18
19
|
tty?: boolean;
|
19
20
|
}): PseudoTtyProcess;
|
20
|
-
fork(id: string, script: string, { cwd, jsEnv, quiet, }: {
|
21
|
+
fork(id: string, script: string, { cwd, execArgv, jsEnv, quiet, }: {
|
21
22
|
cwd?: string;
|
23
|
+
execArgv?: string[];
|
22
24
|
jsEnv?: Record<string, string>;
|
23
25
|
quiet?: boolean;
|
24
26
|
}): Promise<PseudoTtyProcessWithSend>;
|
@@ -32,14 +32,14 @@ class PseudoTerminal {
|
|
32
32
|
await this.pseudoIPC.init();
|
33
33
|
this.initialized = true;
|
34
34
|
}
|
35
|
-
runCommand(command, { cwd, jsEnv, quiet, tty, } = {}) {
|
36
|
-
return new PseudoTtyProcess(this.rustPseudoTerminal.runCommand(command, cwd, jsEnv, quiet, tty));
|
35
|
+
runCommand(command, { cwd, execArgv, jsEnv, quiet, tty, } = {}) {
|
36
|
+
return new PseudoTtyProcess(this.rustPseudoTerminal.runCommand(command, cwd, jsEnv, execArgv, quiet, tty));
|
37
37
|
}
|
38
|
-
async fork(id, script, { cwd, jsEnv, quiet, }) {
|
38
|
+
async fork(id, script, { cwd, execArgv, jsEnv, quiet, }) {
|
39
39
|
if (!this.initialized) {
|
40
40
|
throw new Error('Call init() before forking processes');
|
41
41
|
}
|
42
|
-
const cp = new PseudoTtyProcessWithSend(this.rustPseudoTerminal.fork(id, script, this.pseudoIPCPath, cwd, jsEnv, quiet), id, this.pseudoIPC);
|
42
|
+
const cp = new PseudoTtyProcessWithSend(this.rustPseudoTerminal.fork(id, script, this.pseudoIPCPath, cwd, jsEnv, execArgv, quiet), id, this.pseudoIPC);
|
43
43
|
await this.pseudoIPC.waitForChildReady(id);
|
44
44
|
return cp;
|
45
45
|
}
|