nx 20.7.0-canary.20250326-9dd4766 → 20.7.0-canary.20250328-4a3a824
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 +11 -11
- package/src/command-line/add/add.js +1 -1
- package/src/command-line/generate/generator-utils.js +8 -3
- package/src/command-line/import/import.js +1 -1
- package/src/command-line/init/configure-plugins.d.ts +3 -3
- package/src/command-line/init/configure-plugins.js +29 -13
- package/src/command-line/init/implementation/utils.js +3 -2
- package/src/command-line/init/init-v2.js +11 -24
- package/src/core/graph/main.js +1 -1
- package/src/core/graph/styles.js +1 -1
- package/src/native/nx.wasm32-wasi.wasm +0 -0
- package/src/project-graph/plugins/in-process-loader.js +1 -1
- package/src/utils/child-process.d.ts +4 -0
- package/src/utils/child-process.js +23 -30
- package/src/utils/is-ci.js +4 -1
package/src/core/graph/styles.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[532],{
|
1
|
+
"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[532],{3968:()=>{}},s=>{var e;e=3968,s(s.s=e)}]);
|
Binary file
|
@@ -25,7 +25,7 @@ function readPluginPackageJson(pluginName, projects, paths = (0, installation_di
|
|
25
25
|
const localPluginPath = (0, resolve_plugin_1.resolveLocalNxPlugin)(pluginName, projects);
|
26
26
|
if (localPluginPath) {
|
27
27
|
const localPluginPackageJson = path.join(localPluginPath.path, 'package.json');
|
28
|
-
if ((0, transpiler_1.pluginTranspilerIsRegistered)()) {
|
28
|
+
if (!(0, transpiler_1.pluginTranspilerIsRegistered)()) {
|
29
29
|
(0, transpiler_1.registerPluginTSTranspiler)();
|
30
30
|
}
|
31
31
|
return {
|
@@ -1,11 +1,15 @@
|
|
1
1
|
import { type ExecOptions, type ExecSyncOptions } from 'child_process';
|
2
|
+
import { PackageManagerCommands } from './package-manager';
|
2
3
|
import { ChildProcess } from '../native';
|
4
|
+
export declare function getRunNxBaseCommand(packageManagerCommand?: PackageManagerCommands, cwd?: string): string;
|
3
5
|
export declare function runNxSync(cmd: string, options?: ExecSyncOptions & {
|
4
6
|
cwd?: string;
|
7
|
+
packageManagerCommand?: PackageManagerCommands;
|
5
8
|
}): void;
|
6
9
|
export declare function runNxAsync(cmd: string, options?: ExecOptions & {
|
7
10
|
cwd?: string;
|
8
11
|
silent?: boolean;
|
12
|
+
packageManagerCommand?: PackageManagerCommands;
|
9
13
|
}): Promise<void>;
|
10
14
|
export declare class PseudoTtyProcess {
|
11
15
|
private childProcess;
|
@@ -1,6 +1,7 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.PseudoTtyProcess = void 0;
|
4
|
+
exports.getRunNxBaseCommand = getRunNxBaseCommand;
|
4
5
|
exports.runNxSync = runNxSync;
|
5
6
|
exports.runNxAsync = runNxAsync;
|
6
7
|
const child_process_1 = require("child_process");
|
@@ -8,46 +9,38 @@ const fs_1 = require("fs");
|
|
8
9
|
const path_1 = require("path");
|
9
10
|
const package_manager_1 = require("./package-manager");
|
10
11
|
const workspace_root_1 = require("./workspace-root");
|
11
|
-
function
|
12
|
-
let baseCmd;
|
12
|
+
function getRunNxBaseCommand(packageManagerCommand, cwd = process.cwd()) {
|
13
13
|
if ((0, fs_1.existsSync)((0, path_1.join)(workspace_root_1.workspaceRoot, 'package.json'))) {
|
14
|
-
|
14
|
+
if (!packageManagerCommand) {
|
15
|
+
const pm = (0, package_manager_1.detectPackageManager)();
|
16
|
+
packageManagerCommand = (0, package_manager_1.getPackageManagerCommand)(pm);
|
17
|
+
}
|
18
|
+
return `${packageManagerCommand.exec} nx`;
|
15
19
|
}
|
16
20
|
else {
|
17
|
-
|
18
|
-
options.cwd ??= process.cwd();
|
19
|
-
options.windowsHide ??= true;
|
20
|
-
const offsetFromRoot = (0, path_1.relative)(options.cwd, (0, workspace_root_1.workspaceRootInner)(options.cwd, null));
|
21
|
+
const offsetFromRoot = (0, path_1.relative)(cwd, (0, workspace_root_1.workspaceRootInner)(cwd, null));
|
21
22
|
if (process.platform === 'win32') {
|
22
|
-
|
23
|
+
return '.\\' + (0, path_1.join)(`${offsetFromRoot}`, 'nx.bat');
|
23
24
|
}
|
24
25
|
else {
|
25
|
-
|
26
|
+
return './' + (0, path_1.join)(`${offsetFromRoot}`, 'nx');
|
26
27
|
}
|
27
28
|
}
|
28
|
-
|
29
|
+
}
|
30
|
+
function runNxSync(cmd, options) {
|
31
|
+
let { packageManagerCommand, ...execSyncOptions } = options ?? {};
|
32
|
+
execSyncOptions.cwd ??= process.cwd();
|
33
|
+
execSyncOptions.windowsHide ??= true;
|
34
|
+
const baseCmd = getRunNxBaseCommand(packageManagerCommand, execSyncOptions.cwd);
|
35
|
+
(0, child_process_1.execSync)(`${baseCmd} ${cmd}`, execSyncOptions);
|
29
36
|
}
|
30
37
|
async function runNxAsync(cmd, options) {
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
}
|
35
|
-
|
36
|
-
|
37
|
-
options.cwd ??= process.cwd();
|
38
|
-
options.windowsHide ??= true;
|
39
|
-
const offsetFromRoot = (0, path_1.relative)(options.cwd, (0, workspace_root_1.workspaceRootInner)(options.cwd, null));
|
40
|
-
if (process.platform === 'win32') {
|
41
|
-
baseCmd = '.\\' + (0, path_1.join)(`${offsetFromRoot}`, 'nx.bat');
|
42
|
-
}
|
43
|
-
else {
|
44
|
-
baseCmd = './' + (0, path_1.join)(`${offsetFromRoot}`, 'nx');
|
45
|
-
}
|
46
|
-
}
|
47
|
-
const silent = options?.silent ?? true;
|
48
|
-
if (options?.silent) {
|
49
|
-
delete options.silent;
|
50
|
-
}
|
38
|
+
options ??= {};
|
39
|
+
options.cwd ??= process.cwd();
|
40
|
+
options.windowsHide ??= true;
|
41
|
+
let { silent, packageManagerCommand, ...execSyncOptions } = options;
|
42
|
+
silent ??= true;
|
43
|
+
const baseCmd = getRunNxBaseCommand(packageManagerCommand, execSyncOptions.cwd);
|
51
44
|
return new Promise((resolve, reject) => {
|
52
45
|
const child = (0, child_process_1.exec)(`${baseCmd} ${cmd}`, options, (error, stdout, stderr) => {
|
53
46
|
if (error) {
|
package/src/utils/is-ci.js
CHANGED
@@ -15,6 +15,9 @@ function isCI() {
|
|
15
15
|
!!process.env.GITLAB_CI ||
|
16
16
|
!!process.env.HEROKU_TEST_RUN_ID ||
|
17
17
|
!!process.env.BUILD_ID ||
|
18
|
+
!!process.env.BUILD_NUMBER ||
|
18
19
|
!!process.env.BUILD_BUILDID ||
|
19
|
-
!!process.env.TEAMCITY_VERSION
|
20
|
+
!!process.env.TEAMCITY_VERSION ||
|
21
|
+
!!process.env.JENKINS_URL ||
|
22
|
+
!!process.env.HUDSON_URL);
|
20
23
|
}
|