nx 20.4.3 → 20.4.4
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
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "nx",
|
3
|
-
"version": "20.4.
|
3
|
+
"version": "20.4.4",
|
4
4
|
"private": false,
|
5
5
|
"description": "The core Nx plugin contains the core functionality of Nx like the project graph, nx commands and task orchestration.",
|
6
6
|
"repository": {
|
@@ -82,16 +82,16 @@
|
|
82
82
|
}
|
83
83
|
},
|
84
84
|
"optionalDependencies": {
|
85
|
-
"@nx/nx-darwin-arm64": "20.4.
|
86
|
-
"@nx/nx-darwin-x64": "20.4.
|
87
|
-
"@nx/nx-freebsd-x64": "20.4.
|
88
|
-
"@nx/nx-linux-arm-gnueabihf": "20.4.
|
89
|
-
"@nx/nx-linux-arm64-gnu": "20.4.
|
90
|
-
"@nx/nx-linux-arm64-musl": "20.4.
|
91
|
-
"@nx/nx-linux-x64-gnu": "20.4.
|
92
|
-
"@nx/nx-linux-x64-musl": "20.4.
|
93
|
-
"@nx/nx-win32-arm64-msvc": "20.4.
|
94
|
-
"@nx/nx-win32-x64-msvc": "20.4.
|
85
|
+
"@nx/nx-darwin-arm64": "20.4.4",
|
86
|
+
"@nx/nx-darwin-x64": "20.4.4",
|
87
|
+
"@nx/nx-freebsd-x64": "20.4.4",
|
88
|
+
"@nx/nx-linux-arm-gnueabihf": "20.4.4",
|
89
|
+
"@nx/nx-linux-arm64-gnu": "20.4.4",
|
90
|
+
"@nx/nx-linux-arm64-musl": "20.4.4",
|
91
|
+
"@nx/nx-linux-x64-gnu": "20.4.4",
|
92
|
+
"@nx/nx-linux-x64-musl": "20.4.4",
|
93
|
+
"@nx/nx-win32-arm64-msvc": "20.4.4",
|
94
|
+
"@nx/nx-win32-x64-msvc": "20.4.4"
|
95
95
|
},
|
96
96
|
"nx-migrations": {
|
97
97
|
"migrations": "./migrations.json",
|
@@ -5,7 +5,6 @@ exports.addHandler = addHandler;
|
|
5
5
|
const child_process_1 = require("child_process");
|
6
6
|
const fs_1 = require("fs");
|
7
7
|
const ora = require("ora");
|
8
|
-
const yargsParser = require("yargs-parser");
|
9
8
|
const nx_json_1 = require("../../config/nx-json");
|
10
9
|
const child_process_2 = require("../../utils/child-process");
|
11
10
|
const fileutils_1 = require("../../utils/fileutils");
|
@@ -79,27 +78,18 @@ async function installPackage(pkgName, version, nxJson) {
|
|
79
78
|
spinner.succeed();
|
80
79
|
}
|
81
80
|
async function initializePlugin(pkgName, options, nxJson) {
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
'parse-positional-numbers': false,
|
86
|
-
'dot-notation': false,
|
87
|
-
'camel-case-expansion': false,
|
88
|
-
},
|
89
|
-
});
|
90
|
-
if (exports.coreNxPluginVersions.has(pkgName)) {
|
91
|
-
parsedCommandArgs.keepExistingVersions = true;
|
92
|
-
if (options.updatePackageScripts ||
|
81
|
+
let updatePackageScripts = false;
|
82
|
+
if (exports.coreNxPluginVersions.has(pkgName) &&
|
83
|
+
(options.updatePackageScripts ||
|
93
84
|
(options.updatePackageScripts === undefined &&
|
94
85
|
nxJson.useInferencePlugins !== false &&
|
95
|
-
process.env.NX_ADD_PLUGINS !== 'false')) {
|
96
|
-
|
97
|
-
}
|
86
|
+
process.env.NX_ADD_PLUGINS !== 'false'))) {
|
87
|
+
updatePackageScripts = true;
|
98
88
|
}
|
99
89
|
const spinner = ora(`Initializing ${pkgName}...`);
|
100
90
|
spinner.start();
|
101
91
|
try {
|
102
|
-
await (0, configure_plugins_1.installPlugin)(pkgName, workspace_root_1.workspaceRoot, options.verbose
|
92
|
+
await (0, configure_plugins_1.installPlugin)(pkgName, workspace_root_1.workspaceRoot, updatePackageScripts, options.verbose);
|
103
93
|
}
|
104
94
|
catch (e) {
|
105
95
|
spinner.fail();
|
@@ -4,19 +4,18 @@ export declare function runPackageManagerInstallPlugins(repoRoot: string, pmc: P
|
|
4
4
|
* Installs a plugin by running its init generator. It will change the file system tree passed in.
|
5
5
|
* @param plugin The name of the plugin to install
|
6
6
|
* @param repoRoot repo root
|
7
|
-
* @param
|
8
|
-
* @param
|
7
|
+
* @param pmc package manager commands
|
8
|
+
* @param updatePackageScripts whether to update package scripts
|
9
|
+
* @param verbose whether to run in verbose mode
|
9
10
|
* @returns void
|
10
11
|
*/
|
11
|
-
export declare function installPlugin(plugin: string, repoRoot
|
12
|
-
[k: string]: any;
|
13
|
-
}): Promise<void>;
|
12
|
+
export declare function installPlugin(plugin: string, repoRoot?: string, updatePackageScripts?: boolean, verbose?: boolean, pmc?: PackageManagerCommands): Promise<void>;
|
14
13
|
/**
|
15
14
|
* Install plugins
|
16
15
|
* Get the implementation of the plugin's init generator and run it
|
17
16
|
* @returns a list of succeeded plugins and a map of failed plugins to errors
|
18
17
|
*/
|
19
|
-
export declare function installPlugins(plugins: string[], updatePackageScripts: boolean, repoRoot?: string, verbose?: boolean): Promise<{
|
18
|
+
export declare function installPlugins(plugins: string[], updatePackageScripts: boolean, pmc: PackageManagerCommands, repoRoot?: string, verbose?: boolean): Promise<{
|
20
19
|
succeededPlugins: string[];
|
21
20
|
failedPlugins: {
|
22
21
|
[plugin: string]: Error;
|
@@ -7,10 +7,9 @@ exports.configurePlugins = configurePlugins;
|
|
7
7
|
exports.getFailedToInstallPluginErrorMessages = getFailedToInstallPluginErrorMessages;
|
8
8
|
const createSpinner = require("ora");
|
9
9
|
const chalk_1 = require("chalk");
|
10
|
+
const child_process_1 = require("child_process");
|
10
11
|
const package_manager_1 = require("../../utils/package-manager");
|
11
12
|
const output_1 = require("../../utils/output");
|
12
|
-
const tree_1 = require("../../generators/tree");
|
13
|
-
const generator_utils_1 = require("../generate/generator-utils");
|
14
13
|
const workspace_root_1 = require("../../utils/workspace-root");
|
15
14
|
const utils_1 = require("./implementation/utils");
|
16
15
|
const plugins_1 = require("../../utils/plugins");
|
@@ -27,12 +26,12 @@ function runPackageManagerInstallPlugins(repoRoot, pmc = (0, package_manager_1.g
|
|
27
26
|
* Installs a plugin by running its init generator. It will change the file system tree passed in.
|
28
27
|
* @param plugin The name of the plugin to install
|
29
28
|
* @param repoRoot repo root
|
30
|
-
* @param
|
31
|
-
* @param
|
29
|
+
* @param pmc package manager commands
|
30
|
+
* @param updatePackageScripts whether to update package scripts
|
31
|
+
* @param verbose whether to run in verbose mode
|
32
32
|
* @returns void
|
33
33
|
*/
|
34
|
-
async function installPlugin(plugin, repoRoot = workspace_root_1.workspaceRoot, verbose = false,
|
35
|
-
const host = new tree_1.FsTree(repoRoot, verbose, `install ${plugin}`);
|
34
|
+
async function installPlugin(plugin, repoRoot = workspace_root_1.workspaceRoot, updatePackageScripts = false, verbose = false, pmc = (0, package_manager_1.getPackageManagerCommand)()) {
|
36
35
|
const capabilities = await (0, plugins_1.getPluginCapabilities)(repoRoot, plugin, {});
|
37
36
|
const generators = capabilities?.generators;
|
38
37
|
if (!generators) {
|
@@ -45,20 +44,18 @@ async function installPlugin(plugin, repoRoot = workspace_root_1.workspaceRoot,
|
|
45
44
|
});
|
46
45
|
return;
|
47
46
|
}
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
await task();
|
54
|
-
}
|
47
|
+
(0, child_process_1.execSync)(`${pmc.exec} nx g ${plugin}:init --keepExistingVersions ${updatePackageScripts ? '--updatePackageScripts' : ''} ${verbose ? '--verbose' : ''}`, {
|
48
|
+
stdio: [0, 1, 2],
|
49
|
+
cwd: repoRoot,
|
50
|
+
windowsHide: false,
|
51
|
+
});
|
55
52
|
}
|
56
53
|
/**
|
57
54
|
* Install plugins
|
58
55
|
* Get the implementation of the plugin's init generator and run it
|
59
56
|
* @returns a list of succeeded plugins and a map of failed plugins to errors
|
60
57
|
*/
|
61
|
-
async function installPlugins(plugins, updatePackageScripts, repoRoot = workspace_root_1.workspaceRoot, verbose = false) {
|
58
|
+
async function installPlugins(plugins, updatePackageScripts, pmc, repoRoot = workspace_root_1.workspaceRoot, verbose = false) {
|
62
59
|
if (plugins.length === 0) {
|
63
60
|
return {
|
64
61
|
succeededPlugins: [],
|
@@ -71,13 +68,7 @@ async function installPlugins(plugins, updatePackageScripts, repoRoot = workspac
|
|
71
68
|
for (const plugin of plugins) {
|
72
69
|
try {
|
73
70
|
spinner.start('Installing plugin ' + plugin);
|
74
|
-
await installPlugin(plugin, repoRoot, verbose,
|
75
|
-
keepExistingVersions: true,
|
76
|
-
updatePackageScripts,
|
77
|
-
addPlugin: true,
|
78
|
-
skipFormat: false,
|
79
|
-
skipPackageJson: false,
|
80
|
-
});
|
71
|
+
await installPlugin(plugin, repoRoot, updatePackageScripts, verbose, pmc);
|
81
72
|
succeededPlugins.push(plugin);
|
82
73
|
spinner.succeed('Installed plugin ' + plugin);
|
83
74
|
}
|
@@ -103,7 +94,7 @@ async function configurePlugins(plugins, updatePackageScripts, pmc, repoRoot = w
|
|
103
94
|
};
|
104
95
|
}
|
105
96
|
output_1.output.log({ title: '🔨 Configuring plugins' });
|
106
|
-
let { succeededPlugins, failedPlugins } = await installPlugins(plugins, updatePackageScripts, repoRoot, verbose);
|
97
|
+
let { succeededPlugins, failedPlugins } = await installPlugins(plugins, updatePackageScripts, pmc, repoRoot, verbose);
|
107
98
|
if (succeededPlugins.length > 0) {
|
108
99
|
output_1.output.success({
|
109
100
|
title: 'Installed Plugins',
|
Binary file
|