nx 18.1.2 → 18.2.0-beta.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/adapter/compat.d.ts +1 -1
- package/src/adapter/compat.js +1 -0
- package/src/command-line/add/add.js +1 -1
- package/src/command-line/affected/command-object.js +49 -22
- package/src/command-line/generate/generate.js +3 -3
- package/src/command-line/init/init-v2.js +43 -31
- package/src/command-line/run/command-object.js +9 -2
- package/src/command-line/run/run-one.js +1 -1
- package/src/command-line/run-many/command-object.js +4 -1
- package/src/command-line/show/command-object.d.ts +2 -0
- package/src/command-line/show/command-object.js +19 -2
- package/src/config/workspace-json-project-json.d.ts +4 -0
- package/src/core/graph/main.js +1 -1
- package/src/core/graph/polyfills.js +1 -1
- package/src/daemon/client/client.js +19 -7
- package/src/daemon/daemon-project-graph-error.d.ts +8 -0
- package/src/daemon/daemon-project-graph-error.js +13 -0
- package/src/daemon/server/handle-hash-tasks.js +11 -1
- package/src/daemon/server/project-graph-incremental-recomputation.d.ts +1 -0
- package/src/daemon/server/project-graph-incremental-recomputation.js +55 -6
- package/src/daemon/server/shutdown-utils.js +1 -3
- package/src/daemon/socket-utils.js +7 -1
- package/src/executors/run-commands/run-commands.impl.js +5 -1
- package/src/plugins/js/versions.d.ts +1 -1
- package/src/plugins/js/versions.js +1 -1
- package/src/project-graph/build-project-graph.d.ts +18 -1
- package/src/project-graph/build-project-graph.js +71 -24
- package/src/project-graph/project-graph.d.ts +23 -2
- package/src/project-graph/project-graph.js +117 -14
- package/src/project-graph/utils/project-configuration-utils.d.ts +27 -4
- package/src/project-graph/utils/project-configuration-utils.js +176 -45
- package/src/project-graph/utils/retrieve-workspace-files.d.ts +6 -14
- package/src/project-graph/utils/retrieve-workspace-files.js +3 -16
- package/src/utils/output.d.ts +1 -1
- package/src/utils/params.d.ts +2 -2
- package/src/utils/params.js +14 -0
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "nx",
|
3
|
-
"version": "18.
|
3
|
+
"version": "18.2.0-beta.0",
|
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": {
|
@@ -66,7 +66,7 @@
|
|
66
66
|
"yargs-parser": "21.1.1",
|
67
67
|
"node-machine-id": "1.1.12",
|
68
68
|
"ora": "5.3.0",
|
69
|
-
"@nrwl/tao": "18.
|
69
|
+
"@nrwl/tao": "18.2.0-beta.0"
|
70
70
|
},
|
71
71
|
"peerDependencies": {
|
72
72
|
"@swc-node/register": "^1.8.0",
|
@@ -81,16 +81,16 @@
|
|
81
81
|
}
|
82
82
|
},
|
83
83
|
"optionalDependencies": {
|
84
|
-
"@nx/nx-darwin-x64": "18.
|
85
|
-
"@nx/nx-darwin-arm64": "18.
|
86
|
-
"@nx/nx-linux-x64-gnu": "18.
|
87
|
-
"@nx/nx-linux-x64-musl": "18.
|
88
|
-
"@nx/nx-win32-x64-msvc": "18.
|
89
|
-
"@nx/nx-linux-arm64-gnu": "18.
|
90
|
-
"@nx/nx-linux-arm64-musl": "18.
|
91
|
-
"@nx/nx-linux-arm-gnueabihf": "18.
|
92
|
-
"@nx/nx-win32-arm64-msvc": "18.
|
93
|
-
"@nx/nx-freebsd-x64": "18.
|
84
|
+
"@nx/nx-darwin-x64": "18.2.0-beta.0",
|
85
|
+
"@nx/nx-darwin-arm64": "18.2.0-beta.0",
|
86
|
+
"@nx/nx-linux-x64-gnu": "18.2.0-beta.0",
|
87
|
+
"@nx/nx-linux-x64-musl": "18.2.0-beta.0",
|
88
|
+
"@nx/nx-win32-x64-msvc": "18.2.0-beta.0",
|
89
|
+
"@nx/nx-linux-arm64-gnu": "18.2.0-beta.0",
|
90
|
+
"@nx/nx-linux-arm64-musl": "18.2.0-beta.0",
|
91
|
+
"@nx/nx-linux-arm-gnueabihf": "18.2.0-beta.0",
|
92
|
+
"@nx/nx-win32-arm64-msvc": "18.2.0-beta.0",
|
93
|
+
"@nx/nx-freebsd-x64": "18.2.0-beta.0"
|
94
94
|
},
|
95
95
|
"nx-migrations": {
|
96
96
|
"migrations": "./migrations.json",
|
package/src/adapter/compat.d.ts
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
export declare const allowedProjectExtensions: readonly ["tags", "implicitDependencies", "configFilePath", "$schema", "generators", "namedInputs", "name", "files", "root", "sourceRoot", "projectType", "release", "includedScripts"];
|
1
|
+
export declare const allowedProjectExtensions: readonly ["tags", "implicitDependencies", "configFilePath", "$schema", "generators", "namedInputs", "name", "files", "root", "sourceRoot", "projectType", "release", "includedScripts", "metadata"];
|
2
2
|
export declare const allowedWorkspaceExtensions: readonly ["implicitDependencies", "affected", "defaultBase", "tasksRunnerOptions", "workspaceLayout", "plugins", "targetDefaults", "files", "generators", "namedInputs", "extends", "cli", "pluginsConfig", "defaultProject", "installation", "release", "nxCloudAccessToken", "nxCloudUrl", "nxCloudEncryptionKey", "parallel", "cacheDirectory", "useDaemonProcess", "useInferencePlugins"];
|
package/src/adapter/compat.js
CHANGED
@@ -55,7 +55,7 @@ async function installPackage(pkgName, version) {
|
|
55
55
|
nxJson.installation.plugins[pkgName] = version;
|
56
56
|
(0, fileutils_1.writeJsonFile)('nx.json', nxJson);
|
57
57
|
try {
|
58
|
-
await (0, child_process_2.runNxAsync)('');
|
58
|
+
await (0, child_process_2.runNxAsync)('--help', { silent: true });
|
59
59
|
}
|
60
60
|
catch (e) {
|
61
61
|
// revert adding the plugin to nx.json
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.yargsPrintAffectedCommand = exports.printAffectedDeprecationMessage = exports.yargsAffectedGraphCommand = exports.affectedGraphDeprecationMessage = exports.yargsAffectedE2ECommand = exports.yargsAffectedLintCommand = exports.yargsAffectedBuildCommand = exports.yargsAffectedTestCommand = exports.yargsAffectedCommand = void 0;
|
4
4
|
const documentation_1 = require("../yargs-utils/documentation");
|
5
5
|
const shared_options_1 = require("../yargs-utils/shared-options");
|
6
|
+
const params_1 = require("../../utils/params");
|
6
7
|
exports.yargsAffectedCommand = {
|
7
8
|
command: 'affected',
|
8
9
|
describe: 'Run target for affected projects',
|
@@ -16,43 +17,63 @@ exports.yargsAffectedCommand = {
|
|
16
17
|
throw new Error("The '--all' option has been removed for `nx affected`. Use 'nx run-many' instead.");
|
17
18
|
}
|
18
19
|
}), 'affected'),
|
19
|
-
handler: async (args) =>
|
20
|
+
handler: async (args) => {
|
21
|
+
return (0, params_1.handleErrors)(args.verbose ?? process.env.NX_VERBOSE_LOGGING === 'true', async () => {
|
22
|
+
return (await Promise.resolve().then(() => require('./affected'))).affected('affected', (0, shared_options_1.withOverrides)(args));
|
23
|
+
});
|
24
|
+
},
|
20
25
|
};
|
21
26
|
exports.yargsAffectedTestCommand = {
|
22
27
|
command: 'affected:test',
|
23
28
|
describe: false,
|
24
29
|
builder: (yargs) => (0, documentation_1.linkToNxDevAndExamples)((0, shared_options_1.withAffectedOptions)((0, shared_options_1.withRunOptions)((0, shared_options_1.withOutputStyleOption)((0, shared_options_1.withConfiguration)(yargs)))), 'affected'),
|
25
|
-
handler: async (args) =>
|
26
|
-
|
27
|
-
|
28
|
-
|
30
|
+
handler: async (args) => {
|
31
|
+
return (0, params_1.handleErrors)(args.verbose ?? process.env.NX_VERBOSE_LOGGING === 'true', async () => {
|
32
|
+
return (await Promise.resolve().then(() => require('./affected'))).affected('affected', {
|
33
|
+
...(0, shared_options_1.withOverrides)(args),
|
34
|
+
target: 'test',
|
35
|
+
});
|
36
|
+
});
|
37
|
+
},
|
29
38
|
};
|
30
39
|
exports.yargsAffectedBuildCommand = {
|
31
40
|
command: 'affected:build',
|
32
41
|
describe: false,
|
33
42
|
builder: (yargs) => (0, documentation_1.linkToNxDevAndExamples)((0, shared_options_1.withAffectedOptions)((0, shared_options_1.withRunOptions)((0, shared_options_1.withOutputStyleOption)((0, shared_options_1.withConfiguration)(yargs)))), 'affected'),
|
34
|
-
handler: async (args) =>
|
35
|
-
|
36
|
-
|
37
|
-
|
43
|
+
handler: async (args) => {
|
44
|
+
return (0, params_1.handleErrors)(args.verbose ?? process.env.NX_VERBOSE_LOGGING === 'true', async () => {
|
45
|
+
return (await Promise.resolve().then(() => require('./affected'))).affected('affected', {
|
46
|
+
...(0, shared_options_1.withOverrides)(args),
|
47
|
+
target: 'build',
|
48
|
+
});
|
49
|
+
});
|
50
|
+
},
|
38
51
|
};
|
39
52
|
exports.yargsAffectedLintCommand = {
|
40
53
|
command: 'affected:lint',
|
41
54
|
describe: false,
|
42
55
|
builder: (yargs) => (0, documentation_1.linkToNxDevAndExamples)((0, shared_options_1.withAffectedOptions)((0, shared_options_1.withRunOptions)((0, shared_options_1.withOutputStyleOption)((0, shared_options_1.withConfiguration)(yargs)))), 'affected'),
|
43
|
-
handler: async (args) =>
|
44
|
-
|
45
|
-
|
46
|
-
|
56
|
+
handler: async (args) => {
|
57
|
+
return (0, params_1.handleErrors)(args.verbose ?? process.env.NX_VERBOSE_LOGGING === 'true', async () => {
|
58
|
+
return (await Promise.resolve().then(() => require('./affected'))).affected('affected', {
|
59
|
+
...(0, shared_options_1.withOverrides)(args),
|
60
|
+
target: 'lint',
|
61
|
+
});
|
62
|
+
});
|
63
|
+
},
|
47
64
|
};
|
48
65
|
exports.yargsAffectedE2ECommand = {
|
49
66
|
command: 'affected:e2e',
|
50
67
|
describe: false,
|
51
68
|
builder: (yargs) => (0, documentation_1.linkToNxDevAndExamples)((0, shared_options_1.withAffectedOptions)((0, shared_options_1.withRunOptions)((0, shared_options_1.withOutputStyleOption)((0, shared_options_1.withConfiguration)(yargs)))), 'affected'),
|
52
|
-
handler: async (args) =>
|
53
|
-
|
54
|
-
|
55
|
-
|
69
|
+
handler: async (args) => {
|
70
|
+
return (0, params_1.handleErrors)(args.verbose ?? process.env.NX_VERBOSE_LOGGING === 'true', async () => {
|
71
|
+
return (await Promise.resolve().then(() => require('./affected'))).affected('affected', {
|
72
|
+
...(0, shared_options_1.withOverrides)(args),
|
73
|
+
target: 'e2e',
|
74
|
+
});
|
75
|
+
});
|
76
|
+
},
|
56
77
|
};
|
57
78
|
exports.affectedGraphDeprecationMessage = 'Use `nx graph --affected`, or `nx affected --graph` instead depending on which best suits your use case. The `affected:graph` command will be removed in Nx 19.';
|
58
79
|
/**
|
@@ -63,9 +84,13 @@ exports.yargsAffectedGraphCommand = {
|
|
63
84
|
describe: 'Graph dependencies affected by changes',
|
64
85
|
aliases: ['affected:dep-graph'],
|
65
86
|
builder: (yargs) => (0, documentation_1.linkToNxDevAndExamples)((0, shared_options_1.withAffectedOptions)((0, shared_options_1.withDepGraphOptions)(yargs)), 'affected:graph'),
|
66
|
-
handler: async (args) =>
|
67
|
-
|
68
|
-
|
87
|
+
handler: async (args) => {
|
88
|
+
return (0, params_1.handleErrors)(args.verbose ?? process.env.NX_VERBOSE_LOGGING === 'true', async () => {
|
89
|
+
return await (await Promise.resolve().then(() => require('./affected'))).affected('graph', {
|
90
|
+
...args,
|
91
|
+
});
|
92
|
+
});
|
93
|
+
},
|
69
94
|
deprecated: exports.affectedGraphDeprecationMessage,
|
70
95
|
};
|
71
96
|
exports.printAffectedDeprecationMessage = 'Use `nx show projects --affected`, `nx affected --graph -t build` or `nx graph --affected` depending on which best suits your use case. The `print-affected` command will be removed in Nx 19.';
|
@@ -86,8 +111,10 @@ exports.yargsPrintAffectedCommand = {
|
|
86
111
|
describe: 'Select the type of projects to be returned (e.g., --type=app)',
|
87
112
|
}),
|
88
113
|
handler: async (args) => {
|
89
|
-
|
90
|
-
|
114
|
+
return (0, params_1.handleErrors)(args.verbose ?? process.env.NX_VERBOSE_LOGGING === 'true', async () => {
|
115
|
+
await (await Promise.resolve().then(() => require('./affected'))).affected('print-affected', (0, shared_options_1.withOverrides)(args));
|
116
|
+
process.exit(0);
|
117
|
+
});
|
91
118
|
},
|
92
119
|
deprecated: exports.printAffectedDeprecationMessage,
|
93
120
|
};
|
@@ -210,10 +210,10 @@ async function generate(cwd, args) {
|
|
210
210
|
process.env.NX_VERBOSE_LOGGING = 'true';
|
211
211
|
}
|
212
212
|
const verbose = process.env.NX_VERBOSE_LOGGING === 'true';
|
213
|
-
const nxJsonConfiguration = (0, configuration_1.readNxJson)();
|
214
|
-
const projectGraph = await (0, project_graph_1.createProjectGraphAsync)({ exitOnError: true });
|
215
|
-
const projectsConfigurations = (0, project_graph_1.readProjectsConfigurationFromProjectGraph)(projectGraph);
|
216
213
|
return (0, params_1.handleErrors)(verbose, async () => {
|
214
|
+
const nxJsonConfiguration = (0, configuration_1.readNxJson)();
|
215
|
+
const projectGraph = await (0, project_graph_1.createProjectGraphAsync)();
|
216
|
+
const projectsConfigurations = (0, project_graph_1.readProjectsConfigurationFromProjectGraph)(projectGraph);
|
217
217
|
const opts = await convertToGenerateOptions(args, 'generate', projectsConfigurations);
|
218
218
|
const { normalizedGeneratorName, schema, implementationFactory, generatorConfiguration: { aliases, hidden, ['x-deprecated']: deprecated, ['x-use-standalone-layout']: isStandalonePreset, }, } = (0, generator_utils_1.getGeneratorInformation)(opts.collectionName, opts.generatorName, workspace_root_1.workspaceRoot, projectsConfigurations.projects);
|
219
219
|
if (deprecated) {
|
@@ -32,6 +32,12 @@ async function initHandler(options) {
|
|
32
32
|
console.log('Setting Nx up installation in `.nx`. You can run Nx commands like: `./nx.bat --help`');
|
33
33
|
}
|
34
34
|
(0, add_nx_scripts_1.generateDotNxSetup)(version);
|
35
|
+
const { plugins } = await detectPlugins();
|
36
|
+
plugins.forEach((plugin) => {
|
37
|
+
(0, child_process_2.execSync)(`./nx add ${plugin}`, {
|
38
|
+
stdio: 'inherit',
|
39
|
+
});
|
40
|
+
});
|
35
41
|
// invokes the wrapper, thus invoking the initial installation process
|
36
42
|
(0, child_process_1.runNxSync)('--version', { stdio: 'ignore' });
|
37
43
|
return;
|
@@ -45,8 +51,8 @@ async function initHandler(options) {
|
|
45
51
|
return;
|
46
52
|
}
|
47
53
|
output_1.output.log({ title: '🧐 Checking dependencies' });
|
48
|
-
const
|
49
|
-
if (!
|
54
|
+
const { plugins, updatePackageScripts } = await detectPlugins();
|
55
|
+
if (!plugins.length) {
|
50
56
|
// If no plugins are detected/chosen, guide users to setup
|
51
57
|
// their targetDefaults correctly so their package scripts will work.
|
52
58
|
const packageJson = (0, fileutils_1.readJsonFile)('package.json');
|
@@ -66,19 +72,17 @@ async function initHandler(options) {
|
|
66
72
|
const pmc = (0, package_manager_1.getPackageManagerCommand)();
|
67
73
|
(0, utils_1.createNxJsonFile)(repoRoot, [], [], {});
|
68
74
|
(0, utils_1.updateGitIgnore)(repoRoot);
|
69
|
-
(0, utils_1.addDepsToPackageJson)(repoRoot,
|
75
|
+
(0, utils_1.addDepsToPackageJson)(repoRoot, plugins);
|
70
76
|
output_1.output.log({ title: '📦 Installing Nx' });
|
71
77
|
(0, utils_1.runInstall)(repoRoot, pmc);
|
72
78
|
output_1.output.log({ title: '🔨 Configuring plugins' });
|
73
|
-
for (const plugin of
|
74
|
-
(0, child_process_2.execSync)(`${pmc.exec} nx g ${plugin}:init --keepExistingVersions ${
|
75
|
-
? '--updatePackageScripts'
|
76
|
-
: ''} --no-interactive`, {
|
79
|
+
for (const plugin of plugins) {
|
80
|
+
(0, child_process_2.execSync)(`${pmc.exec} nx g ${plugin}:init --keepExistingVersions ${updatePackageScripts ? '--updatePackageScripts' : ''} --no-interactive`, {
|
77
81
|
stdio: [0, 1, 2],
|
78
82
|
cwd: repoRoot,
|
79
83
|
});
|
80
84
|
}
|
81
|
-
if (!
|
85
|
+
if (!updatePackageScripts) {
|
82
86
|
const rootPackageJsonPath = (0, path_1.join)(repoRoot, 'package.json');
|
83
87
|
const json = (0, fileutils_1.readJsonFile)(rootPackageJsonPath);
|
84
88
|
json.nx = { includedScripts: [] };
|
@@ -146,9 +150,16 @@ async function detectPlugins() {
|
|
146
150
|
}
|
147
151
|
}
|
148
152
|
}
|
153
|
+
if ((0, fs_1.existsSync)('gradlew') || (0, fs_1.existsSync)('gradlew.bat')) {
|
154
|
+
detectedPlugins.add('@nx/gradle');
|
155
|
+
}
|
149
156
|
const plugins = Array.from(detectedPlugins);
|
150
|
-
if (plugins.length === 0)
|
151
|
-
return
|
157
|
+
if (plugins.length === 0) {
|
158
|
+
return {
|
159
|
+
plugins: [],
|
160
|
+
updatePackageScripts: false,
|
161
|
+
};
|
162
|
+
}
|
152
163
|
output_1.output.log({
|
153
164
|
title: `Recommended Plugins:`,
|
154
165
|
bodyLines: [
|
@@ -165,25 +176,26 @@ async function detectPlugins() {
|
|
165
176
|
},
|
166
177
|
]).then((r) => r.plugins);
|
167
178
|
if (pluginsToInstall?.length === 0)
|
168
|
-
return
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
179
|
+
return {
|
180
|
+
plugins: [],
|
181
|
+
updatePackageScripts: false,
|
182
|
+
};
|
183
|
+
const updatePackageScripts = (0, fs_1.existsSync)('package.json') &&
|
184
|
+
(await (0, enquirer_1.prompt)([
|
185
|
+
{
|
186
|
+
name: 'updatePackageScripts',
|
187
|
+
type: 'autocomplete',
|
188
|
+
message: `Do you want to start using Nx in your package.json scripts?`,
|
189
|
+
choices: [
|
190
|
+
{
|
191
|
+
name: 'Yes',
|
192
|
+
},
|
193
|
+
{
|
194
|
+
name: 'No',
|
195
|
+
},
|
196
|
+
],
|
197
|
+
initial: 0,
|
198
|
+
},
|
199
|
+
]).then((r) => r.updatePackageScripts === 'Yes'));
|
200
|
+
return { plugins: pluginsToInstall, updatePackageScripts };
|
189
201
|
}
|
@@ -2,6 +2,7 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.yargsNxInfixCommand = exports.yargsRunCommand = void 0;
|
4
4
|
const shared_options_1 = require("../yargs-utils/shared-options");
|
5
|
+
const params_1 = require("../../utils/params");
|
5
6
|
exports.yargsRunCommand = {
|
6
7
|
command: 'run [project][:target][:configuration] [_..]',
|
7
8
|
describe: `Run a target for a project
|
@@ -12,7 +13,9 @@ exports.yargsRunCommand = {
|
|
12
13
|
|
13
14
|
You can skip the use of Nx cache by using the --skip-nx-cache option.`,
|
14
15
|
builder: (yargs) => (0, shared_options_1.withRunOneOptions)((0, shared_options_1.withBatch)(yargs)),
|
15
|
-
handler: async (args) =>
|
16
|
+
handler: async (args) => await (0, params_1.handleErrors)(args.verbose ?? process.env.NX_VERBOSE_LOGGING === 'true', async () => {
|
17
|
+
(await Promise.resolve().then(() => require('./run-one'))).runOne(process.cwd(), (0, shared_options_1.withOverrides)(args));
|
18
|
+
}),
|
16
19
|
};
|
17
20
|
/**
|
18
21
|
* Handles the infix notation for running a target.
|
@@ -21,5 +24,9 @@ exports.yargsNxInfixCommand = {
|
|
21
24
|
...exports.yargsRunCommand,
|
22
25
|
command: '$0 <target> [project] [_..]',
|
23
26
|
describe: 'Run a target for a project',
|
24
|
-
handler: async (args) =>
|
27
|
+
handler: async (args) => {
|
28
|
+
await (0, params_1.handleErrors)(args.verbose ?? process.env.NX_VERBOSE_LOGGING === 'true', async () => {
|
29
|
+
return (await Promise.resolve().then(() => require('./run-one'))).runOne(process.cwd(), (0, shared_options_1.withOverrides)(args, 0));
|
30
|
+
});
|
31
|
+
},
|
25
32
|
};
|
@@ -18,7 +18,7 @@ async function runOne(cwd, args, extraTargetDependencies = {}, extraOptions = {
|
|
18
18
|
perf_hooks_1.performance.measure('code-loading', 'init-local', 'code-loading:end');
|
19
19
|
(0, workspace_configuration_check_1.workspaceConfigurationCheck)();
|
20
20
|
const nxJson = (0, configuration_1.readNxJson)();
|
21
|
-
const projectGraph = await (0, project_graph_1.createProjectGraphAsync)(
|
21
|
+
const projectGraph = await (0, project_graph_1.createProjectGraphAsync)();
|
22
22
|
const opts = parseRunOneOptions(cwd, args, projectGraph, nxJson);
|
23
23
|
const { nxArgs, overrides } = (0, command_line_utils_1.splitArgsIntoNxArgsAndOverrides)({
|
24
24
|
...opts.parsedArgs,
|
@@ -3,9 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.yargsRunManyCommand = void 0;
|
4
4
|
const documentation_1 = require("../yargs-utils/documentation");
|
5
5
|
const shared_options_1 = require("../yargs-utils/shared-options");
|
6
|
+
const params_1 = require("../../utils/params");
|
6
7
|
exports.yargsRunManyCommand = {
|
7
8
|
command: 'run-many',
|
8
9
|
describe: 'Run target for multiple listed projects',
|
9
10
|
builder: (yargs) => (0, documentation_1.linkToNxDevAndExamples)((0, shared_options_1.withRunManyOptions)((0, shared_options_1.withOutputStyleOption)((0, shared_options_1.withTargetAndConfigurationOption)((0, shared_options_1.withBatch)(yargs)))), 'run-many'),
|
10
|
-
handler: async (args) =>
|
11
|
+
handler: async (args) => await (0, params_1.handleErrors)(args.verbose ?? process.env.NX_VERBOSE_LOGGING === 'true', async () => {
|
12
|
+
(await Promise.resolve().then(() => require('./run-many'))).runMany((0, shared_options_1.withOverrides)(args));
|
13
|
+
}),
|
11
14
|
};
|
@@ -14,9 +14,11 @@ export type ShowProjectsOptions = NxShowArgs & {
|
|
14
14
|
type: ProjectGraphProjectNode['type'];
|
15
15
|
projects: string[];
|
16
16
|
withTarget: string[];
|
17
|
+
verbose: boolean;
|
17
18
|
};
|
18
19
|
export type ShowProjectOptions = NxShowArgs & {
|
19
20
|
projectName: string;
|
20
21
|
web?: boolean;
|
22
|
+
verbose: boolean;
|
21
23
|
};
|
22
24
|
export declare const yargsShowCommand: CommandModule<Record<string, unknown>, NxShowArgs>;
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.yargsShowCommand = void 0;
|
4
4
|
const yargs_1 = require("yargs");
|
5
5
|
const shared_options_1 = require("../yargs-utils/shared-options");
|
6
|
+
const params_1 = require("../../utils/params");
|
6
7
|
exports.yargsShowCommand = {
|
7
8
|
command: 'show',
|
8
9
|
describe: 'Show information about the workspace (e.g., list of projects)',
|
@@ -46,6 +47,10 @@ const showProjectsCommand = {
|
|
46
47
|
type: 'string',
|
47
48
|
description: 'Select only projects of the given type',
|
48
49
|
choices: ['app', 'lib', 'e2e'],
|
50
|
+
})
|
51
|
+
.option('verbose', {
|
52
|
+
type: 'boolean',
|
53
|
+
description: 'Prints additional information about the commands (e.g., stack traces)',
|
49
54
|
})
|
50
55
|
.implies('untracked', 'affected')
|
51
56
|
.implies('uncommitted', 'affected')
|
@@ -57,7 +62,11 @@ const showProjectsCommand = {
|
|
57
62
|
.example('$0 show projects --affected', 'Show affected projects in the workspace')
|
58
63
|
.example('$0 show projects --type app --affected', 'Show affected apps in the workspace')
|
59
64
|
.example('$0 show projects --affected --exclude=*-e2e', 'Show affected projects in the workspace, excluding end-to-end projects'),
|
60
|
-
handler: (args) =>
|
65
|
+
handler: (args) => {
|
66
|
+
return (0, params_1.handleErrors)(args.verbose ?? process.env.NX_VERBOSE_LOGGING === 'true', async () => {
|
67
|
+
return (await Promise.resolve().then(() => require('./show'))).showProjectsHandler(args);
|
68
|
+
});
|
69
|
+
},
|
61
70
|
};
|
62
71
|
const showProjectCommand = {
|
63
72
|
command: 'project <projectName>',
|
@@ -72,6 +81,10 @@ const showProjectCommand = {
|
|
72
81
|
.option('web', {
|
73
82
|
type: 'boolean',
|
74
83
|
description: 'Show project details in the browser',
|
84
|
+
})
|
85
|
+
.option('verbose', {
|
86
|
+
type: 'boolean',
|
87
|
+
description: 'Prints additional information about the commands (e.g., stack traces)',
|
75
88
|
})
|
76
89
|
.check((argv) => {
|
77
90
|
if (argv.web) {
|
@@ -80,5 +93,9 @@ const showProjectCommand = {
|
|
80
93
|
return true;
|
81
94
|
})
|
82
95
|
.example('$0 show project my-app', 'View project information for my-app in JSON format'),
|
83
|
-
handler: (args) =>
|
96
|
+
handler: (args) => {
|
97
|
+
return (0, params_1.handleErrors)(args.verbose ?? process.env.NX_VERBOSE_LOGGING === 'true', async () => {
|
98
|
+
return (await Promise.resolve().then(() => require('./show'))).showProjectHandler(args);
|
99
|
+
});
|
100
|
+
},
|
84
101
|
};
|
@@ -99,6 +99,10 @@ export interface ProjectConfiguration {
|
|
99
99
|
release?: {
|
100
100
|
version?: Pick<NxReleaseVersionConfiguration, 'generator' | 'generatorOptions'>;
|
101
101
|
};
|
102
|
+
metadata?: {
|
103
|
+
technologies?: string[];
|
104
|
+
targetGroups?: Record<string, string[]>;
|
105
|
+
};
|
102
106
|
}
|
103
107
|
export interface TargetDependencyConfig {
|
104
108
|
/**
|