nx 19.8.0-beta.0 → 19.8.0-beta.1
Sign up to get free protection for your applications and to get access to all the features.
- package/bin/nx-cloud.js +0 -0
- package/package.json +17 -17
- package/src/command-line/activate-powerpack/activate-powerpack.d.ts +2 -0
- package/src/command-line/activate-powerpack/activate-powerpack.js +32 -0
- package/src/command-line/activate-powerpack/command-object.d.ts +6 -0
- package/src/command-line/activate-powerpack/command-object.js +25 -0
- package/src/command-line/add/command-object.d.ts +1 -1
- package/src/command-line/format/format.js +24 -7
- package/src/command-line/list/list.js +2 -0
- package/src/command-line/nx-commands.d.ts +1 -1
- package/src/command-line/nx-commands.js +77 -57
- package/src/command-line/report/report.d.ts +3 -0
- package/src/command-line/report/report.js +27 -1
- package/src/core/graph/main.js +1 -1
- package/src/native/index.d.ts +2 -1
- package/src/native/nx.wasm32-wasi.wasm +0 -0
- package/src/tasks-runner/cache.d.ts +5 -1
- package/src/tasks-runner/cache.js +51 -5
- package/src/tasks-runner/run-command.js +2 -0
- package/src/utils/db-connection.d.ts +4 -1
- package/src/utils/db-connection.js +15 -4
- package/src/utils/plugins/output.d.ts +1 -0
- package/src/utils/plugins/output.js +7 -0
- package/src/utils/powerpack.d.ts +5 -0
- package/src/utils/powerpack.js +38 -0
package/bin/nx-cloud.js
CHANGED
File without changes
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "nx",
|
3
|
-
"version": "19.8.0-beta.
|
3
|
+
"version": "19.8.0-beta.1",
|
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": {
|
@@ -8,9 +8,6 @@
|
|
8
8
|
"url": "https://github.com/nrwl/nx.git",
|
9
9
|
"directory": "packages/nx"
|
10
10
|
},
|
11
|
-
"scripts": {
|
12
|
-
"postinstall": "node ./bin/post-install"
|
13
|
-
},
|
14
11
|
"keywords": [
|
15
12
|
"Monorepo",
|
16
13
|
"Angular",
|
@@ -71,7 +68,7 @@
|
|
71
68
|
"yargs-parser": "21.1.1",
|
72
69
|
"node-machine-id": "1.1.12",
|
73
70
|
"ora": "5.3.0",
|
74
|
-
"@nrwl/tao": "19.8.0-beta.
|
71
|
+
"@nrwl/tao": "19.8.0-beta.1"
|
75
72
|
},
|
76
73
|
"peerDependencies": {
|
77
74
|
"@swc-node/register": "^1.8.0",
|
@@ -86,16 +83,16 @@
|
|
86
83
|
}
|
87
84
|
},
|
88
85
|
"optionalDependencies": {
|
89
|
-
"@nx/nx-darwin-x64": "19.8.0-beta.
|
90
|
-
"@nx/nx-darwin-arm64": "19.8.0-beta.
|
91
|
-
"@nx/nx-linux-x64-gnu": "19.8.0-beta.
|
92
|
-
"@nx/nx-linux-x64-musl": "19.8.0-beta.
|
93
|
-
"@nx/nx-win32-x64-msvc": "19.8.0-beta.
|
94
|
-
"@nx/nx-linux-arm64-gnu": "19.8.0-beta.
|
95
|
-
"@nx/nx-linux-arm64-musl": "19.8.0-beta.
|
96
|
-
"@nx/nx-linux-arm-gnueabihf": "19.8.0-beta.
|
97
|
-
"@nx/nx-win32-arm64-msvc": "19.8.0-beta.
|
98
|
-
"@nx/nx-freebsd-x64": "19.8.0-beta.
|
86
|
+
"@nx/nx-darwin-x64": "19.8.0-beta.1",
|
87
|
+
"@nx/nx-darwin-arm64": "19.8.0-beta.1",
|
88
|
+
"@nx/nx-linux-x64-gnu": "19.8.0-beta.1",
|
89
|
+
"@nx/nx-linux-x64-musl": "19.8.0-beta.1",
|
90
|
+
"@nx/nx-win32-x64-msvc": "19.8.0-beta.1",
|
91
|
+
"@nx/nx-linux-arm64-gnu": "19.8.0-beta.1",
|
92
|
+
"@nx/nx-linux-arm64-musl": "19.8.0-beta.1",
|
93
|
+
"@nx/nx-linux-arm-gnueabihf": "19.8.0-beta.1",
|
94
|
+
"@nx/nx-win32-arm64-msvc": "19.8.0-beta.1",
|
95
|
+
"@nx/nx-freebsd-x64": "19.8.0-beta.1"
|
99
96
|
},
|
100
97
|
"nx-migrations": {
|
101
98
|
"migrations": "./migrations.json",
|
@@ -192,5 +189,8 @@
|
|
192
189
|
},
|
193
190
|
"main": "./bin/nx.js",
|
194
191
|
"type": "commonjs",
|
195
|
-
"types": "./bin/nx.d.ts"
|
196
|
-
|
192
|
+
"types": "./bin/nx.d.ts",
|
193
|
+
"scripts": {
|
194
|
+
"postinstall": "node ./bin/post-install"
|
195
|
+
}
|
196
|
+
}
|
@@ -0,0 +1,32 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.handleActivatePowerpack = handleActivatePowerpack;
|
4
|
+
const workspace_root_1 = require("../../utils/workspace-root");
|
5
|
+
const enquirer_1 = require("enquirer");
|
6
|
+
const child_process_1 = require("child_process");
|
7
|
+
const package_manager_1 = require("../../utils/package-manager");
|
8
|
+
async function handleActivatePowerpack(options) {
|
9
|
+
const license = options.license ??
|
10
|
+
(await (0, enquirer_1.prompt)({
|
11
|
+
type: 'input',
|
12
|
+
name: 'license',
|
13
|
+
message: 'Enter your License Key',
|
14
|
+
}));
|
15
|
+
const { activatePowerpack } = await requirePowerpack();
|
16
|
+
activatePowerpack(workspace_root_1.workspaceRoot, license);
|
17
|
+
}
|
18
|
+
async function requirePowerpack() {
|
19
|
+
// @ts-ignore
|
20
|
+
return Promise.resolve().then(() => require('@nx/powerpack-license')).catch(async (e) => {
|
21
|
+
if ('code' in e && e.code === 'MODULE_NOT_FOUND') {
|
22
|
+
try {
|
23
|
+
(0, child_process_1.execSync)(`${(0, package_manager_1.getPackageManagerCommand)().addDev} @nx/powerpack-license@latest`);
|
24
|
+
// @ts-ignore
|
25
|
+
return await Promise.resolve().then(() => require('@nx/powerpack-license'));
|
26
|
+
}
|
27
|
+
catch (e) {
|
28
|
+
throw new Error('Failed to install @nx/powerpack-license. Please install @nx/powerpack-license and try again.');
|
29
|
+
}
|
30
|
+
}
|
31
|
+
});
|
32
|
+
}
|
@@ -0,0 +1,25 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.yargsActivatePowerpackCommand = void 0;
|
4
|
+
const shared_options_1 = require("../yargs-utils/shared-options");
|
5
|
+
const handle_errors_1 = require("../../utils/handle-errors");
|
6
|
+
exports.yargsActivatePowerpackCommand = {
|
7
|
+
command: 'activate-powerpack <license>',
|
8
|
+
describe: 'Activate a Nx Powerpack license.',
|
9
|
+
builder: (yargs) => (0, shared_options_1.withVerbose)(yargs)
|
10
|
+
.parserConfiguration({
|
11
|
+
'strip-dashed': true,
|
12
|
+
'unknown-options-as-args': true,
|
13
|
+
})
|
14
|
+
.positional('license', {
|
15
|
+
type: 'string',
|
16
|
+
description: 'This is a License Key for Nx Powerpack.',
|
17
|
+
})
|
18
|
+
.example('$0 activate-powerpack <license key>', 'Activate a Nx Powerpack license'),
|
19
|
+
handler: async (args) => {
|
20
|
+
const exitCode = await (0, handle_errors_1.handleErrors)(args.verbose, async () => {
|
21
|
+
return (await Promise.resolve().then(() => require('./activate-powerpack'))).handleActivatePowerpack(args);
|
22
|
+
});
|
23
|
+
process.exit(exitCode);
|
24
|
+
},
|
25
|
+
};
|
@@ -7,7 +7,6 @@ const file_utils_1 = require("../../project-graph/file-utils");
|
|
7
7
|
const command_line_utils_1 = require("../../utils/command-line-utils");
|
8
8
|
const fileutils_1 = require("../../utils/fileutils");
|
9
9
|
const ignore_1 = require("../../utils/ignore");
|
10
|
-
const prettier = require("prettier");
|
11
10
|
const configuration_1 = require("../../config/configuration");
|
12
11
|
const typescript_1 = require("../../plugins/js/utils/typescript");
|
13
12
|
const affected_project_graph_1 = require("../../project-graph/affected/affected-project-graph");
|
@@ -18,8 +17,19 @@ const object_sort_1 = require("../../utils/object-sort");
|
|
18
17
|
const output_1 = require("../../utils/output");
|
19
18
|
const package_json_1 = require("../../utils/package-json");
|
20
19
|
const workspace_root_1 = require("../../utils/workspace-root");
|
21
|
-
const PRETTIER_PATH = getPrettierPath();
|
22
20
|
async function format(command, args) {
|
21
|
+
try {
|
22
|
+
require('prettier');
|
23
|
+
}
|
24
|
+
catch {
|
25
|
+
output_1.output.error({
|
26
|
+
title: 'Prettier is not installed.',
|
27
|
+
bodyLines: [
|
28
|
+
`Please install "prettier" and try again, or don't run the "nx format:${command}" command.`,
|
29
|
+
],
|
30
|
+
});
|
31
|
+
process.exit(1);
|
32
|
+
}
|
23
33
|
const { nxArgs } = (0, command_line_utils_1.splitArgsIntoNxArgsAndOverrides)(args, 'affected', { printWarnings: false }, (0, configuration_1.readNxJson)());
|
24
34
|
const patterns = (await getPatterns({ ...args, ...nxArgs })).map(
|
25
35
|
// prettier removes one of the \
|
@@ -72,7 +82,7 @@ async function getPatterns(args) {
|
|
72
82
|
}
|
73
83
|
const p = (0, command_line_utils_1.parseFiles)(args);
|
74
84
|
// In prettier v3 the getSupportInfo result is a promise
|
75
|
-
const supportedExtensions = new Set((await prettier.getSupportInfo()).languages
|
85
|
+
const supportedExtensions = new Set((await require('prettier').getSupportInfo()).languages
|
76
86
|
.flatMap((language) => language.extensions)
|
77
87
|
.filter((extension) => !!extension)
|
78
88
|
// Prettier supports ".swcrc" as a file instead of an extension
|
@@ -131,11 +141,12 @@ function write(patterns) {
|
|
131
141
|
result[pattern.includes('.swcrc') ? 0 : 1].push(pattern);
|
132
142
|
return result;
|
133
143
|
}, [[], []]);
|
134
|
-
|
144
|
+
const prettierPath = getPrettierPath();
|
145
|
+
(0, node_child_process_1.execSync)(`node "${prettierPath}" --write --list-different ${regularPatterns.join(' ')}`, {
|
135
146
|
stdio: [0, 1, 2],
|
136
147
|
});
|
137
148
|
if (swcrcPatterns.length > 0) {
|
138
|
-
(0, node_child_process_1.execSync)(`node "${
|
149
|
+
(0, node_child_process_1.execSync)(`node "${prettierPath}" --write --list-different ${swcrcPatterns.join(' ')} --parser json`, {
|
139
150
|
stdio: [0, 1, 2],
|
140
151
|
});
|
141
152
|
}
|
@@ -145,8 +156,9 @@ async function check(patterns) {
|
|
145
156
|
if (patterns.length === 0) {
|
146
157
|
return [];
|
147
158
|
}
|
159
|
+
const prettierPath = getPrettierPath();
|
148
160
|
return new Promise((resolve) => {
|
149
|
-
(0, node_child_process_1.exec)(`node "${
|
161
|
+
(0, node_child_process_1.exec)(`node "${prettierPath}" --list-different ${patterns.join(' ')}`, { encoding: 'utf-8' }, (error, stdout) => {
|
150
162
|
if (error) {
|
151
163
|
// The command failed so there are files with different formatting. Prettier writes them to stdout, newline separated.
|
152
164
|
resolve(stdout.trim().split('\n'));
|
@@ -170,7 +182,12 @@ function sortTsConfig() {
|
|
170
182
|
// catch noop
|
171
183
|
}
|
172
184
|
}
|
185
|
+
let prettierPath;
|
173
186
|
function getPrettierPath() {
|
187
|
+
if (prettierPath) {
|
188
|
+
return prettierPath;
|
189
|
+
}
|
174
190
|
const { bin } = (0, package_json_1.readModulePackageJson)('prettier').packageJson;
|
175
|
-
|
191
|
+
prettierPath = require.resolve(path.join('prettier', bin));
|
192
|
+
return prettierPath;
|
176
193
|
}
|
@@ -6,6 +6,7 @@ const project_graph_1 = require("../../project-graph/project-graph");
|
|
6
6
|
const output_1 = require("../../utils/output");
|
7
7
|
const plugins_1 = require("../../utils/plugins");
|
8
8
|
const workspace_root_1 = require("../../utils/workspace-root");
|
9
|
+
const output_2 = require("../../utils/plugins/output");
|
9
10
|
/**
|
10
11
|
* List available plugins or capabilities within a specific plugin
|
11
12
|
*
|
@@ -29,6 +30,7 @@ async function listHandler(args) {
|
|
29
30
|
}
|
30
31
|
(0, plugins_1.listPlugins)(installedPlugins, 'Installed plugins:');
|
31
32
|
(0, plugins_1.listAlsoAvailableCorePlugins)(installedPlugins);
|
33
|
+
(0, output_2.listPowerpackPlugins)();
|
32
34
|
output_1.output.note({
|
33
35
|
title: 'Community Plugins',
|
34
36
|
bodyLines: [
|
@@ -7,4 +7,4 @@ export declare const parserConfiguration: Partial<yargs.ParserConfigurationOptio
|
|
7
7
|
* from the `.argv` call, so the object and it's relative scripts can
|
8
8
|
* le executed correctly.
|
9
9
|
*/
|
10
|
-
export declare const commandsObject: yargs.Argv<
|
10
|
+
export declare const commandsObject: yargs.Argv<unknown>;
|
@@ -3,31 +3,32 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.commandsObject = exports.parserConfiguration = void 0;
|
4
4
|
const chalk = require("chalk");
|
5
5
|
const yargs = require("yargs");
|
6
|
-
const command_object_1 = require("./
|
7
|
-
const command_object_2 = require("./
|
8
|
-
const command_object_3 = require("./
|
9
|
-
const command_object_4 = require("./
|
10
|
-
const command_object_5 = require("./
|
11
|
-
const command_object_6 = require("./
|
12
|
-
const command_object_7 = require("./
|
13
|
-
const command_object_8 = require("./
|
14
|
-
const command_object_9 = require("./
|
15
|
-
const command_object_10 = require("./
|
16
|
-
const command_object_11 = require("./
|
17
|
-
const command_object_12 = require("./
|
18
|
-
const command_object_13 = require("./
|
19
|
-
const command_object_14 = require("./
|
20
|
-
const command_object_15 = require("./
|
21
|
-
const command_object_16 = require("./run
|
22
|
-
const command_object_17 = require("./
|
23
|
-
const command_object_18 = require("./
|
24
|
-
const command_object_19 = require("./
|
25
|
-
const command_object_20 = require("./
|
26
|
-
const command_object_21 = require("./
|
27
|
-
const command_object_22 = require("./
|
28
|
-
const command_object_23 = require("./
|
6
|
+
const command_object_1 = require("./activate-powerpack/command-object");
|
7
|
+
const command_object_2 = require("./affected/command-object");
|
8
|
+
const command_object_3 = require("./connect/command-object");
|
9
|
+
const command_object_4 = require("./daemon/command-object");
|
10
|
+
const command_object_5 = require("./graph/command-object");
|
11
|
+
const command_object_6 = require("./exec/command-object");
|
12
|
+
const command_object_7 = require("./format/command-object");
|
13
|
+
const command_object_8 = require("./generate/command-object");
|
14
|
+
const command_object_9 = require("./import/command-object");
|
15
|
+
const command_object_10 = require("./init/command-object");
|
16
|
+
const command_object_11 = require("./list/command-object");
|
17
|
+
const command_object_12 = require("./migrate/command-object");
|
18
|
+
const command_object_13 = require("./new/command-object");
|
19
|
+
const command_object_14 = require("./repair/command-object");
|
20
|
+
const command_object_15 = require("./report/command-object");
|
21
|
+
const command_object_16 = require("./run/command-object");
|
22
|
+
const command_object_17 = require("./run-many/command-object");
|
23
|
+
const command_object_18 = require("./show/command-object");
|
24
|
+
const command_object_19 = require("./watch/command-object");
|
25
|
+
const command_object_20 = require("./reset/command-object");
|
26
|
+
const command_object_21 = require("./release/command-object");
|
27
|
+
const command_object_22 = require("./add/command-object");
|
28
|
+
const command_object_23 = require("./login/command-object");
|
29
|
+
const command_object_24 = require("./logout/command-object");
|
29
30
|
const command_objects_1 = require("./deprecated/command-objects");
|
30
|
-
const
|
31
|
+
const command_object_25 = require("./sync/command-object");
|
31
32
|
// Ensure that the output takes up the available width of the terminal.
|
32
33
|
yargs.wrap(yargs.terminalWidth());
|
33
34
|
exports.parserConfiguration = {
|
@@ -44,44 +45,63 @@ exports.commandsObject = yargs
|
|
44
45
|
.parserConfiguration(exports.parserConfiguration)
|
45
46
|
.usage(chalk.bold('Smart Monorepos · Fast CI'))
|
46
47
|
.demandCommand(1, '')
|
47
|
-
.command(
|
48
|
-
.command(
|
49
|
-
.command(
|
50
|
-
.command(
|
51
|
-
.command(
|
52
|
-
.command(
|
48
|
+
.command(command_object_1.yargsActivatePowerpackCommand)
|
49
|
+
.command(command_object_22.yargsAddCommand)
|
50
|
+
.command(command_object_2.yargsAffectedBuildCommand)
|
51
|
+
.command(command_object_2.yargsAffectedCommand)
|
52
|
+
.command(command_object_2.yargsAffectedE2ECommand)
|
53
|
+
.command(command_object_2.yargsAffectedLintCommand)
|
54
|
+
.command(command_object_2.yargsAffectedTestCommand)
|
53
55
|
.command(command_objects_1.yargsAffectedGraphCommand)
|
54
|
-
.command(
|
55
|
-
.command(
|
56
|
-
.command(
|
57
|
-
.command(
|
58
|
-
.command(
|
59
|
-
.command(
|
60
|
-
.command(
|
61
|
-
.command(
|
62
|
-
.command(
|
63
|
-
.command(
|
64
|
-
.command(
|
65
|
-
.command(
|
66
|
-
.command(
|
56
|
+
.command(command_object_3.yargsConnectCommand)
|
57
|
+
.command(command_object_4.yargsDaemonCommand)
|
58
|
+
.command(command_object_5.yargsGraphCommand)
|
59
|
+
.command(command_object_6.yargsExecCommand)
|
60
|
+
.command(command_object_7.yargsFormatCheckCommand)
|
61
|
+
.command(command_object_7.yargsFormatWriteCommand)
|
62
|
+
.command(command_object_8.yargsGenerateCommand)
|
63
|
+
.command(command_object_9.yargsImportCommand)
|
64
|
+
.command(command_object_10.yargsInitCommand)
|
65
|
+
.command(command_object_12.yargsInternalMigrateCommand)
|
66
|
+
.command(command_object_11.yargsListCommand)
|
67
|
+
.command(command_object_12.yargsMigrateCommand)
|
68
|
+
.command(command_object_13.yargsNewCommand)
|
67
69
|
.command(command_objects_1.yargsPrintAffectedCommand)
|
68
|
-
.command(
|
69
|
-
.command(
|
70
|
-
.command(
|
71
|
-
.command(
|
72
|
-
.command(
|
73
|
-
.command(
|
74
|
-
.command(
|
75
|
-
.command(
|
76
|
-
.command(
|
77
|
-
.command(
|
78
|
-
.command(
|
79
|
-
.command(
|
80
|
-
.command(
|
81
|
-
.command(
|
70
|
+
.command(command_object_21.yargsReleaseCommand)
|
71
|
+
.command(command_object_14.yargsRepairCommand)
|
72
|
+
.command(command_object_15.yargsReportCommand)
|
73
|
+
.command(command_object_20.yargsResetCommand)
|
74
|
+
.command(command_object_16.yargsRunCommand)
|
75
|
+
.command(command_object_17.yargsRunManyCommand)
|
76
|
+
.command(command_object_18.yargsShowCommand)
|
77
|
+
.command(command_object_25.yargsSyncCommand)
|
78
|
+
.command(command_object_25.yargsSyncCheckCommand)
|
79
|
+
.command(command_object_3.yargsViewLogsCommand)
|
80
|
+
.command(command_object_19.yargsWatchCommand)
|
81
|
+
.command(command_object_16.yargsNxInfixCommand)
|
82
|
+
.command(command_object_23.yargsLoginCommand)
|
83
|
+
.command(command_object_24.yargsLogoutCommand)
|
84
|
+
.command(resolveConformanceCommandObject())
|
82
85
|
.scriptName('nx')
|
83
86
|
.help()
|
84
87
|
// NOTE: we handle --version in nx.ts, this just tells yargs that the option exists
|
85
88
|
// so that it shows up in help. The default yargs implementation of --version is not
|
86
89
|
// hit, as the implementation in nx.ts is hit first and calls process.exit(0).
|
87
90
|
.version();
|
91
|
+
function resolveConformanceCommandObject() {
|
92
|
+
try {
|
93
|
+
const { yargsConformanceCommand } = require('@nx/powerpack-conformance');
|
94
|
+
return yargsConformanceCommand;
|
95
|
+
}
|
96
|
+
catch (e) {
|
97
|
+
return {
|
98
|
+
command: 'conformance',
|
99
|
+
// Hide from --help output in the common case of not having the plugin installed
|
100
|
+
describe: false,
|
101
|
+
handler: () => {
|
102
|
+
// TODO: Add messaging to help with learning more about powerpack and conformance
|
103
|
+
process.exit(1);
|
104
|
+
},
|
105
|
+
};
|
106
|
+
}
|
107
|
+
}
|
@@ -15,6 +15,8 @@ export declare function reportHandler(): Promise<void>;
|
|
15
15
|
export interface ReportData {
|
16
16
|
pm: PackageManager;
|
17
17
|
pmVersion: string;
|
18
|
+
powerpackLicense: any | null;
|
19
|
+
powerpackPlugins: PackageJson[];
|
18
20
|
localPlugins: string[];
|
19
21
|
communityPlugins: PackageJson[];
|
20
22
|
registeredPlugins: string[];
|
@@ -43,6 +45,7 @@ interface OutOfSyncPackageGroup {
|
|
43
45
|
migrateTarget: string;
|
44
46
|
}
|
45
47
|
export declare function findMisalignedPackagesForPackage(base: PackageJson): undefined | OutOfSyncPackageGroup;
|
48
|
+
export declare function findInstalledPowerpackPlugins(): PackageJson[];
|
46
49
|
export declare function findInstalledCommunityPlugins(): PackageJson[];
|
47
50
|
export declare function findRegisteredPluginsBeingUsed(nxJson: NxJsonConfiguration): string[];
|
48
51
|
export declare function findInstalledPackagesWeCareAbout(): {
|
@@ -4,6 +4,7 @@ exports.patternsWeIgnoreInCommunityReport = exports.packagesWeCareAbout = void 0
|
|
4
4
|
exports.reportHandler = reportHandler;
|
5
5
|
exports.getReportData = getReportData;
|
6
6
|
exports.findMisalignedPackagesForPackage = findMisalignedPackagesForPackage;
|
7
|
+
exports.findInstalledPowerpackPlugins = findInstalledPowerpackPlugins;
|
7
8
|
exports.findInstalledCommunityPlugins = findInstalledCommunityPlugins;
|
8
9
|
exports.findRegisteredPluginsBeingUsed = findRegisteredPluginsBeingUsed;
|
9
10
|
exports.findInstalledPackagesWeCareAbout = findInstalledPackagesWeCareAbout;
|
@@ -20,6 +21,7 @@ const installed_plugins_1 = require("../../utils/plugins/installed-plugins");
|
|
20
21
|
const installation_directory_1 = require("../../utils/installation-directory");
|
21
22
|
const nx_json_1 = require("../../config/nx-json");
|
22
23
|
const error_types_1 = require("../../project-graph/error-types");
|
24
|
+
const powerpack_1 = require("../../utils/powerpack");
|
23
25
|
const nxPackageJson = (0, fileutils_1.readJsonFile)((0, path_1.join)(__dirname, '../../../package.json'));
|
24
26
|
exports.packagesWeCareAbout = [
|
25
27
|
'lerna',
|
@@ -29,6 +31,7 @@ exports.packagesWeCareAbout = [
|
|
29
31
|
];
|
30
32
|
exports.patternsWeIgnoreInCommunityReport = [
|
31
33
|
...exports.packagesWeCareAbout,
|
34
|
+
new RegExp('@nx/powerpack*'),
|
32
35
|
'@schematics/angular',
|
33
36
|
new RegExp('@angular/*'),
|
34
37
|
'@nestjs/schematics',
|
@@ -43,7 +46,7 @@ const LINE_SEPARATOR = '---------------------------------------';
|
|
43
46
|
*
|
44
47
|
*/
|
45
48
|
async function reportHandler() {
|
46
|
-
const { pm, pmVersion, localPlugins, communityPlugins, registeredPlugins, packageVersionsWeCareAbout, outOfSyncPackageGroup, projectGraphError, nativeTarget, } = await getReportData();
|
49
|
+
const { pm, pmVersion, powerpackLicense, localPlugins, powerpackPlugins, communityPlugins, registeredPlugins, packageVersionsWeCareAbout, outOfSyncPackageGroup, projectGraphError, nativeTarget, } = await getReportData();
|
47
50
|
const fields = [
|
48
51
|
['Node', process.versions.node],
|
49
52
|
['OS', `${process.platform}-${process.arch}`],
|
@@ -58,6 +61,17 @@ async function reportHandler() {
|
|
58
61
|
packageVersionsWeCareAbout.forEach((p) => {
|
59
62
|
bodyLines.push(`${chalk.green(p.package.padEnd(padding))} : ${chalk.bold(p.version)}`);
|
60
63
|
});
|
64
|
+
if (powerpackLicense) {
|
65
|
+
bodyLines.push(LINE_SEPARATOR);
|
66
|
+
bodyLines.push(chalk.green('Nx Powerpack'));
|
67
|
+
bodyLines.push(`Licensed to ${powerpackLicense.organizationName} for ${powerpackLicense.seatCount} user${powerpackLicense.seatCount > 1 ? 's' : ''} in ${powerpackLicense.workspaceCount} workspace${powerpackLicense.workspaceCount > 1 ? 's' : ''} until ${new Date(powerpackLicense.expiresAt).toLocaleDateString()}`);
|
68
|
+
bodyLines.push('');
|
69
|
+
padding =
|
70
|
+
Math.max(...powerpackPlugins.map((powerpackPlugin) => powerpackPlugin.name.length)) + 1;
|
71
|
+
for (const powerpackPlugin of powerpackPlugins) {
|
72
|
+
bodyLines.push(`${chalk.green(powerpackPlugin.name.padEnd(padding))} : ${chalk.bold(powerpackPlugin.version)}`);
|
73
|
+
}
|
74
|
+
}
|
61
75
|
if (registeredPlugins.length) {
|
62
76
|
bodyLines.push(LINE_SEPARATOR);
|
63
77
|
bodyLines.push('Registered Plugins:');
|
@@ -106,6 +120,7 @@ async function getReportData() {
|
|
106
120
|
const { graph, error: projectGraphError } = await tryGetProjectGraph();
|
107
121
|
const nxJson = (0, nx_json_1.readNxJson)();
|
108
122
|
const localPlugins = await findLocalPlugins(graph, nxJson);
|
123
|
+
const powerpackPlugins = findInstalledPowerpackPlugins();
|
109
124
|
const communityPlugins = findInstalledCommunityPlugins();
|
110
125
|
const registeredPlugins = findRegisteredPluginsBeingUsed(nxJson);
|
111
126
|
const packageVersionsWeCareAbout = findInstalledPackagesWeCareAbout();
|
@@ -121,8 +136,15 @@ async function getReportData() {
|
|
121
136
|
}
|
122
137
|
const outOfSyncPackageGroup = findMisalignedPackagesForPackage(nxPackageJson);
|
123
138
|
const native = isNativeAvailable();
|
139
|
+
let powerpackLicense = null;
|
140
|
+
try {
|
141
|
+
powerpackLicense = await (0, powerpack_1.getPowerpackLicenseInformation)();
|
142
|
+
}
|
143
|
+
catch { }
|
124
144
|
return {
|
125
145
|
pm,
|
146
|
+
powerpackLicense,
|
147
|
+
powerpackPlugins,
|
126
148
|
pmVersion,
|
127
149
|
localPlugins,
|
128
150
|
communityPlugins,
|
@@ -197,6 +219,10 @@ function findMisalignedPackagesForPackage(base) {
|
|
197
219
|
}
|
198
220
|
: undefined;
|
199
221
|
}
|
222
|
+
function findInstalledPowerpackPlugins() {
|
223
|
+
const installedPlugins = (0, installed_plugins_1.findInstalledPlugins)();
|
224
|
+
return installedPlugins.filter((dep) => new RegExp('@nx/powerpack*').test(dep.name));
|
225
|
+
}
|
200
226
|
function findInstalledCommunityPlugins() {
|
201
227
|
const installedPlugins = (0, installed_plugins_1.findInstalledPlugins)();
|
202
228
|
return installedPlugins.filter((dep) => dep.name !== 'nx' &&
|