nx 19.7.0-beta.3 → 19.7.0-beta.4
Sign up to get free protection for your applications and to get access to all the features.
- package/package.json +12 -12
- package/release/changelog-renderer/index.d.ts +1 -1
- package/release/changelog-renderer/index.js +46 -11
- package/schemas/nx-schema.json +5 -0
- package/src/command-line/add/command-object.js +2 -2
- package/src/command-line/affected/command-object.js +1 -1
- package/src/command-line/connect/command-object.js +11 -4
- package/src/command-line/connect/connect-to-nx-cloud.d.ts +3 -1
- package/src/command-line/connect/connect-to-nx-cloud.js +7 -4
- package/src/command-line/daemon/command-object.js +1 -1
- package/src/command-line/deprecated/command-objects.js +2 -2
- package/src/command-line/exec/command-object.js +1 -1
- package/src/command-line/format/command-object.js +4 -4
- package/src/command-line/generate/command-object.js +4 -4
- package/src/command-line/graph/command-object.js +6 -6
- package/src/command-line/import/command-object.js +9 -5
- package/src/command-line/import/import.d.ts +4 -0
- package/src/command-line/import/import.js +147 -12
- package/src/command-line/import/utils/prepare-source-repo.d.ts +1 -1
- package/src/command-line/import/utils/prepare-source-repo.js +31 -85
- package/src/command-line/list/command-object.js +1 -1
- package/src/command-line/login/command-object.js +1 -1
- package/src/command-line/logout/command-object.js +1 -1
- package/src/command-line/migrate/command-object.js +9 -9
- package/src/command-line/new/command-object.js +2 -2
- package/src/command-line/release/changelog.js +53 -12
- package/src/command-line/release/command-object.d.ts +2 -0
- package/src/command-line/release/command-object.js +37 -33
- package/src/command-line/release/config/version-plans.d.ts +14 -1
- package/src/command-line/release/config/version-plans.js +33 -1
- package/src/command-line/release/plan-check.js +8 -61
- package/src/command-line/release/plan.js +131 -37
- package/src/command-line/release/publish.js +3 -0
- package/src/command-line/release/release.js +1 -1
- package/src/command-line/release/utils/get-touched-projects-for-group.d.ts +7 -0
- package/src/command-line/release/utils/get-touched-projects-for-group.js +78 -0
- package/src/command-line/release/utils/git.d.ts +1 -1
- package/src/command-line/release/utils/git.js +46 -19
- package/src/command-line/release/version.js +1 -1
- package/src/command-line/report/command-object.js +1 -1
- package/src/command-line/reset/command-object.js +1 -1
- package/src/command-line/run/command-object.js +1 -1
- package/src/command-line/run-many/command-object.js +1 -1
- package/src/command-line/show/command-object.js +10 -10
- package/src/command-line/watch/command-object.js +1 -1
- package/src/command-line/yargs-utils/shared-options.d.ts +2 -1
- package/src/command-line/yargs-utils/shared-options.js +26 -29
- package/src/core/graph/main.js +1 -1
- package/src/daemon/server/sync-generators.d.ts +4 -0
- package/src/daemon/server/sync-generators.js +172 -52
- package/src/native/nx.wasm32-wasi.wasm +0 -0
- package/src/nx-cloud/generators/connect-to-nx-cloud/connect-to-nx-cloud.d.ts +2 -1
- package/src/nx-cloud/generators/connect-to-nx-cloud/connect-to-nx-cloud.js +25 -23
- package/src/nx-cloud/generators/connect-to-nx-cloud/schema.json +4 -0
- package/src/plugins/js/project-graph/build-dependencies/target-project-locator.js +8 -1
- package/src/project-graph/plugins/isolation/plugin-pool.js +1 -1
- package/src/tasks-runner/cache.d.ts +2 -0
- package/src/tasks-runner/cache.js +15 -1
- package/src/tasks-runner/run-command.js +4 -1
- package/src/tasks-runner/task-orchestrator.js +1 -10
- package/src/utils/command-line-utils.d.ts +1 -0
- package/src/utils/git-utils.d.ts +7 -10
- package/src/utils/git-utils.js +61 -44
- package/src/utils/sync-generators.d.ts +2 -2
- package/src/utils/squash.d.ts +0 -1
- package/src/utils/squash.js +0 -12
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "nx",
|
3
|
-
"version": "19.7.0-beta.
|
3
|
+
"version": "19.7.0-beta.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": {
|
@@ -71,7 +71,7 @@
|
|
71
71
|
"yargs-parser": "21.1.1",
|
72
72
|
"node-machine-id": "1.1.12",
|
73
73
|
"ora": "5.3.0",
|
74
|
-
"@nrwl/tao": "19.7.0-beta.
|
74
|
+
"@nrwl/tao": "19.7.0-beta.4"
|
75
75
|
},
|
76
76
|
"peerDependencies": {
|
77
77
|
"@swc-node/register": "^1.8.0",
|
@@ -86,16 +86,16 @@
|
|
86
86
|
}
|
87
87
|
},
|
88
88
|
"optionalDependencies": {
|
89
|
-
"@nx/nx-darwin-x64": "19.7.0-beta.
|
90
|
-
"@nx/nx-darwin-arm64": "19.7.0-beta.
|
91
|
-
"@nx/nx-linux-x64-gnu": "19.7.0-beta.
|
92
|
-
"@nx/nx-linux-x64-musl": "19.7.0-beta.
|
93
|
-
"@nx/nx-win32-x64-msvc": "19.7.0-beta.
|
94
|
-
"@nx/nx-linux-arm64-gnu": "19.7.0-beta.
|
95
|
-
"@nx/nx-linux-arm64-musl": "19.7.0-beta.
|
96
|
-
"@nx/nx-linux-arm-gnueabihf": "19.7.0-beta.
|
97
|
-
"@nx/nx-win32-arm64-msvc": "19.7.0-beta.
|
98
|
-
"@nx/nx-freebsd-x64": "19.7.0-beta.
|
89
|
+
"@nx/nx-darwin-x64": "19.7.0-beta.4",
|
90
|
+
"@nx/nx-darwin-arm64": "19.7.0-beta.4",
|
91
|
+
"@nx/nx-linux-x64-gnu": "19.7.0-beta.4",
|
92
|
+
"@nx/nx-linux-x64-musl": "19.7.0-beta.4",
|
93
|
+
"@nx/nx-win32-x64-msvc": "19.7.0-beta.4",
|
94
|
+
"@nx/nx-linux-arm64-gnu": "19.7.0-beta.4",
|
95
|
+
"@nx/nx-linux-arm64-musl": "19.7.0-beta.4",
|
96
|
+
"@nx/nx-linux-arm-gnueabihf": "19.7.0-beta.4",
|
97
|
+
"@nx/nx-win32-arm64-msvc": "19.7.0-beta.4",
|
98
|
+
"@nx/nx-freebsd-x64": "19.7.0-beta.4"
|
99
99
|
},
|
100
100
|
"nx-migrations": {
|
101
101
|
"migrations": "./migrations.json",
|
@@ -41,7 +41,7 @@ export type ChangelogRenderer = (config: {
|
|
41
41
|
changelogRenderOptions: DefaultChangelogRenderOptions;
|
42
42
|
dependencyBumps?: DependencyBump[];
|
43
43
|
repoSlug?: RepoSlug;
|
44
|
-
conventionalCommitsConfig: NxReleaseConfig['conventionalCommits'];
|
44
|
+
conventionalCommitsConfig: NxReleaseConfig['conventionalCommits'] | null;
|
45
45
|
}) => Promise<string> | string;
|
46
46
|
/**
|
47
47
|
* The specific options available to the default implementation of the ChangelogRenderer that nx exports
|
@@ -1,6 +1,7 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
const semver_1 = require("semver");
|
4
|
+
const conventional_commits_1 = require("../../src/command-line/release/config/conventional-commits");
|
4
5
|
const github_1 = require("../../src/command-line/release/utils/github");
|
5
6
|
// axios types and values don't seem to match
|
6
7
|
const _axios = require("axios");
|
@@ -10,9 +11,7 @@ const axios = _axios;
|
|
10
11
|
* from the given commits and other metadata.
|
11
12
|
*/
|
12
13
|
const defaultChangelogRenderer = async ({ projectGraph, changes, releaseVersion, project, entryWhenNoChanges, changelogRenderOptions, dependencyBumps, repoSlug, conventionalCommitsConfig, }) => {
|
13
|
-
const changeTypes = conventionalCommitsConfig.types;
|
14
14
|
const markdownLines = [];
|
15
|
-
const breakingChanges = [];
|
16
15
|
// If the current range of changes contains both a commit and its revert, we strip them both from the final list. Changes from version plans are unaffected, as they have no hashes.
|
17
16
|
for (const change of changes) {
|
18
17
|
if (change.type === 'revert' && change.revertedHashes) {
|
@@ -26,10 +25,38 @@ const defaultChangelogRenderer = async ({ projectGraph, changes, releaseVersion,
|
|
26
25
|
}
|
27
26
|
}
|
28
27
|
let relevantChanges = changes;
|
28
|
+
const breakingChanges = [];
|
29
|
+
// For now to keep the interface of the changelog renderer non-breaking for v19 releases we have a somewhat indirect check for whether or not we are generating a changelog for version plans
|
30
|
+
const isVersionPlans = !conventionalCommitsConfig;
|
31
|
+
// Only applicable for version plans
|
32
|
+
const additionalChangesForAuthorsSection = [];
|
33
|
+
// Provide a default configuration for version plans to allow most of the subsequent logic to work in the same way it would for conventional commits
|
34
|
+
// NOTE: The one exception is breaking/major changes, where we do not follow the same structure and instead only show the changes once
|
35
|
+
if (isVersionPlans) {
|
36
|
+
conventionalCommitsConfig = {
|
37
|
+
types: {
|
38
|
+
feat: conventional_commits_1.DEFAULT_CONVENTIONAL_COMMITS_CONFIG.types.feat,
|
39
|
+
fix: conventional_commits_1.DEFAULT_CONVENTIONAL_COMMITS_CONFIG.types.fix,
|
40
|
+
},
|
41
|
+
};
|
42
|
+
// Trim down "relevant changes" to only include non-breaking ones so that we can render them differently under version plans,
|
43
|
+
// but keep track of the changes for the purposes of the authors section
|
44
|
+
// TODO(v20): Clean this abstraction up as part of the larger overall refactor of changelog rendering
|
45
|
+
for (let i = 0; i < relevantChanges.length; i++) {
|
46
|
+
if (relevantChanges[i].isBreaking) {
|
47
|
+
const change = relevantChanges[i];
|
48
|
+
additionalChangesForAuthorsSection.push(change);
|
49
|
+
const line = formatChange(change, changelogRenderOptions, isVersionPlans, repoSlug);
|
50
|
+
breakingChanges.push(line);
|
51
|
+
relevantChanges.splice(i, 1);
|
52
|
+
}
|
53
|
+
}
|
54
|
+
}
|
55
|
+
const changeTypes = conventionalCommitsConfig.types;
|
29
56
|
// workspace root level changelog
|
30
57
|
if (project === null) {
|
31
58
|
// No changes for the workspace
|
32
|
-
if (relevantChanges.length === 0) {
|
59
|
+
if (relevantChanges.length === 0 && breakingChanges.length === 0) {
|
33
60
|
if (dependencyBumps?.length) {
|
34
61
|
applyAdditionalDependencyBumps({
|
35
62
|
markdownLines,
|
@@ -62,7 +89,7 @@ const defaultChangelogRenderer = async ({ projectGraph, changes, releaseVersion,
|
|
62
89
|
for (const scope of scopesSortedAlphabetically) {
|
63
90
|
const changes = changesGroupedByScope[scope];
|
64
91
|
for (const change of changes) {
|
65
|
-
const line = formatChange(change, changelogRenderOptions, repoSlug);
|
92
|
+
const line = formatChange(change, changelogRenderOptions, isVersionPlans, repoSlug);
|
66
93
|
markdownLines.push(line);
|
67
94
|
if (change.isBreaking) {
|
68
95
|
const breakingChangeExplanation = extractBreakingChangeExplanation(change.body);
|
@@ -79,7 +106,7 @@ const defaultChangelogRenderer = async ({ projectGraph, changes, releaseVersion,
|
|
79
106
|
relevantChanges = relevantChanges.filter((c) => c.affectedProjects &&
|
80
107
|
(c.affectedProjects === '*' || c.affectedProjects.includes(project)));
|
81
108
|
// Generating for a named project, but that project has no relevant changes in the current set of commits, exit early
|
82
|
-
if (relevantChanges.length === 0) {
|
109
|
+
if (relevantChanges.length === 0 && breakingChanges.length === 0) {
|
83
110
|
if (dependencyBumps?.length) {
|
84
111
|
applyAdditionalDependencyBumps({
|
85
112
|
markdownLines,
|
@@ -105,7 +132,7 @@ const defaultChangelogRenderer = async ({ projectGraph, changes, releaseVersion,
|
|
105
132
|
markdownLines.push('', `### ${changeTypes[type].changelog.title}`, '');
|
106
133
|
const changesInChronologicalOrder = group.reverse();
|
107
134
|
for (const change of changesInChronologicalOrder) {
|
108
|
-
const line = formatChange(change, changelogRenderOptions, repoSlug);
|
135
|
+
const line = formatChange(change, changelogRenderOptions, isVersionPlans, repoSlug);
|
109
136
|
markdownLines.push(line + '\n');
|
110
137
|
if (change.isBreaking) {
|
111
138
|
const breakingChangeExplanation = extractBreakingChangeExplanation(change.body);
|
@@ -117,7 +144,7 @@ const defaultChangelogRenderer = async ({ projectGraph, changes, releaseVersion,
|
|
117
144
|
}
|
118
145
|
}
|
119
146
|
if (breakingChanges.length > 0) {
|
120
|
-
markdownLines.push('', '
|
147
|
+
markdownLines.push('', '### ⚠️ Breaking Changes', '', ...breakingChanges);
|
121
148
|
}
|
122
149
|
if (dependencyBumps?.length) {
|
123
150
|
applyAdditionalDependencyBumps({
|
@@ -129,7 +156,10 @@ const defaultChangelogRenderer = async ({ projectGraph, changes, releaseVersion,
|
|
129
156
|
}
|
130
157
|
if (changelogRenderOptions.authors) {
|
131
158
|
const _authors = new Map();
|
132
|
-
for (const change of
|
159
|
+
for (const change of [
|
160
|
+
...relevantChanges,
|
161
|
+
...additionalChangesForAuthorsSection,
|
162
|
+
]) {
|
133
163
|
if (!change.author) {
|
134
164
|
continue;
|
135
165
|
}
|
@@ -215,7 +245,7 @@ function groupBy(items, key) {
|
|
215
245
|
}
|
216
246
|
return groups;
|
217
247
|
}
|
218
|
-
function formatChange(change, changelogRenderOptions, repoSlug) {
|
248
|
+
function formatChange(change, changelogRenderOptions, isVersionPlans, repoSlug) {
|
219
249
|
let description = change.description;
|
220
250
|
let extraLines = [];
|
221
251
|
let extraLinesStr = '';
|
@@ -228,9 +258,14 @@ function formatChange(change, changelogRenderOptions, repoSlug) {
|
|
228
258
|
.map((l) => `${indentation}${l}`)
|
229
259
|
.join('\n');
|
230
260
|
}
|
261
|
+
/**
|
262
|
+
* In version plans changelogs:
|
263
|
+
* - don't repeat the breaking change icon
|
264
|
+
* - don't render the scope
|
265
|
+
*/
|
231
266
|
let changeLine = '- ' +
|
232
|
-
(change.isBreaking ? '⚠️ ' : '') +
|
233
|
-
(change.scope ? `**${change.scope.trim()}:** ` : '') +
|
267
|
+
(!isVersionPlans && change.isBreaking ? '⚠️ ' : '') +
|
268
|
+
(!isVersionPlans && change.scope ? `**${change.scope.trim()}:** ` : '') +
|
234
269
|
description;
|
235
270
|
if (repoSlug && changelogRenderOptions.commitReferences) {
|
236
271
|
changeLine += (0, github_1.formatReferences)(change.githubReferences, repoSlug);
|
package/schemas/nx-schema.json
CHANGED
@@ -12,11 +12,11 @@ exports.yargsAddCommand = {
|
|
12
12
|
})
|
13
13
|
.positional('packageSpecifier', {
|
14
14
|
type: 'string',
|
15
|
-
description: 'The package name and optional version (e.g. `@nx/react` or `@nx/react@latest`) to install and initialize. If the version is not specified it will install the same version as the `nx` package for Nx core plugins or the latest version for other packages',
|
15
|
+
description: 'The package name and optional version (e.g. `@nx/react` or `@nx/react@latest`) to install and initialize. If the version is not specified it will install the same version as the `nx` package for Nx core plugins or the latest version for other packages.',
|
16
16
|
})
|
17
17
|
.option('updatePackageScripts', {
|
18
18
|
type: 'boolean',
|
19
|
-
description: 'Update `package.json` scripts with inferred targets. Defaults to `true` when the package is a core Nx plugin',
|
19
|
+
description: 'Update `package.json` scripts with inferred targets. Defaults to `true` when the package is a core Nx plugin.',
|
20
20
|
})
|
21
21
|
.example('$0 add @nx/react', 'Install the latest version of the `@nx/react` package and run its `@nx/react:init` generator')
|
22
22
|
.example('$0 add non-core-nx-plugin', 'Install the latest version of the `non-core-nx-plugin` package and run its `non-core-nx-plugin:init` generator if available')
|
@@ -6,7 +6,7 @@ const shared_options_1 = require("../yargs-utils/shared-options");
|
|
6
6
|
const params_1 = require("../../utils/params");
|
7
7
|
exports.yargsAffectedCommand = {
|
8
8
|
command: 'affected',
|
9
|
-
describe: 'Run target for affected projects',
|
9
|
+
describe: 'Run target for affected projects.',
|
10
10
|
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.withTargetAndConfigurationOption)((0, shared_options_1.withBatch)(yargs)))))
|
11
11
|
.option('all', {
|
12
12
|
type: 'boolean',
|
@@ -3,13 +3,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.yargsViewLogsCommand = exports.yargsConnectCommand = void 0;
|
4
4
|
const documentation_1 = require("../yargs-utils/documentation");
|
5
5
|
const versions_1 = require("../../utils/versions");
|
6
|
+
const shared_options_1 = require("../yargs-utils/shared-options");
|
6
7
|
exports.yargsConnectCommand = {
|
7
8
|
command: 'connect',
|
8
9
|
aliases: ['connect-to-nx-cloud'],
|
9
|
-
describe: `Connect workspace to Nx Cloud
|
10
|
-
builder: (yargs) => (0, documentation_1.linkToNxDevAndExamples)(yargs, 'connect-to-nx-cloud'),
|
11
|
-
handler: async () => {
|
12
|
-
await (await Promise.resolve().then(() => require('./connect-to-nx-cloud'))).connectToNxCloudCommand();
|
10
|
+
describe: `Connect workspace to Nx Cloud.`,
|
11
|
+
builder: (yargs) => (0, documentation_1.linkToNxDevAndExamples)(withConnectOptions(yargs), 'connect-to-nx-cloud'),
|
12
|
+
handler: async (args) => {
|
13
|
+
await (await Promise.resolve().then(() => require('./connect-to-nx-cloud'))).connectToNxCloudCommand(args);
|
13
14
|
await (await Promise.resolve().then(() => require('../../utils/ab-testing'))).recordStat({
|
14
15
|
command: 'connect',
|
15
16
|
nxVersion: versions_1.nxVersion,
|
@@ -18,6 +19,12 @@ exports.yargsConnectCommand = {
|
|
18
19
|
process.exit(0);
|
19
20
|
},
|
20
21
|
};
|
22
|
+
function withConnectOptions(yargs) {
|
23
|
+
return (0, shared_options_1.withVerbose)(yargs).option('generateToken', {
|
24
|
+
type: 'boolean',
|
25
|
+
description: 'Explicitly asks for a token to be created, do not override existing tokens from Nx Cloud.',
|
26
|
+
});
|
27
|
+
}
|
21
28
|
exports.yargsViewLogsCommand = {
|
22
29
|
command: 'view-logs',
|
23
30
|
describe: 'Enables you to view and interact with the logs via the advanced analytic UI from Nx Cloud to help you debug your issue. To do this, Nx needs to connect your workspace to Nx Cloud and upload the most recent run details. Only the metrics are uploaded, not the artefacts.',
|
@@ -5,6 +5,8 @@ import { MessageKey } from '../../utils/ab-testing';
|
|
5
5
|
export declare function onlyDefaultRunnerIsUsed(nxJson: NxJsonConfiguration): boolean;
|
6
6
|
export declare function connectToNxCloudIfExplicitlyAsked(opts: NxArgs): Promise<void>;
|
7
7
|
export declare function connectWorkspaceToCloud(options: ConnectToNxCloudOptions, directory?: string): Promise<string>;
|
8
|
-
export declare function connectToNxCloudCommand(
|
8
|
+
export declare function connectToNxCloudCommand(options: {
|
9
|
+
generateToken?: boolean;
|
10
|
+
}, command?: string): Promise<boolean>;
|
9
11
|
export declare function connectExistingRepoToNxCloudPrompt(command?: string, key?: MessageKey): Promise<boolean>;
|
10
12
|
export declare function connectToNxCloudWithPrompt(command: string): Promise<void>;
|
@@ -54,7 +54,7 @@ async function connectWorkspaceToCloud(options, directory = workspace_root_1.wor
|
|
54
54
|
(0, tree_1.flushChanges)(directory, tree.listChanges());
|
55
55
|
return accessToken;
|
56
56
|
}
|
57
|
-
async function connectToNxCloudCommand(command) {
|
57
|
+
async function connectToNxCloudCommand(options, command) {
|
58
58
|
const nxJson = (0, configuration_1.readNxJson)();
|
59
59
|
const installationSource = process.env.NX_CONSOLE
|
60
60
|
? 'nx-console'
|
@@ -66,7 +66,7 @@ async function connectToNxCloudCommand(command) {
|
|
66
66
|
if (!token) {
|
67
67
|
throw new Error(`Unable to authenticate. If you are connecting to Nx Cloud locally, set Nx Cloud ID in nx.json. If you are connecting in a CI context, either define accessToken in nx.json or set the NX_CLOUD_ACCESS_TOKEN env variable.`);
|
68
68
|
}
|
69
|
-
const connectCloudUrl = await (0, url_shorten_1.createNxCloudOnboardingURL)(installationSource, token);
|
69
|
+
const connectCloudUrl = await (0, url_shorten_1.createNxCloudOnboardingURL)(installationSource, token, options?.generateToken !== true);
|
70
70
|
output_1.output.log({
|
71
71
|
title: '✔ This workspace already has Nx Cloud set up',
|
72
72
|
bodyLines: [
|
@@ -78,9 +78,10 @@ async function connectToNxCloudCommand(command) {
|
|
78
78
|
return false;
|
79
79
|
}
|
80
80
|
const token = await connectWorkspaceToCloud({
|
81
|
+
generateToken: options?.generateToken,
|
81
82
|
installationSource: command ?? installationSource,
|
82
83
|
});
|
83
|
-
const connectCloudUrl = await (0, url_shorten_1.createNxCloudOnboardingURL)('nx-connect', token);
|
84
|
+
const connectCloudUrl = await (0, url_shorten_1.createNxCloudOnboardingURL)('nx-connect', token, options?.generateToken !== true);
|
84
85
|
try {
|
85
86
|
const cloudConnectSpinner = ora(`Opening Nx Cloud ${connectCloudUrl} in your browser to connect your workspace.`).start();
|
86
87
|
await sleep(2000);
|
@@ -115,7 +116,9 @@ async function connectExistingRepoToNxCloudPrompt(command = 'init', key = 'setup
|
|
115
116
|
}
|
116
117
|
async function connectToNxCloudWithPrompt(command) {
|
117
118
|
const setNxCloud = await nxCloudPrompt('setupNxCloud');
|
118
|
-
const useCloud = setNxCloud === 'yes'
|
119
|
+
const useCloud = setNxCloud === 'yes'
|
120
|
+
? await connectToNxCloudCommand({ generateToken: false }, command)
|
121
|
+
: false;
|
119
122
|
await (0, ab_testing_1.recordStat)({
|
120
123
|
command,
|
121
124
|
nxVersion: versions_1.nxVersion,
|
@@ -4,7 +4,7 @@ exports.yargsDaemonCommand = void 0;
|
|
4
4
|
const documentation_1 = require("../yargs-utils/documentation");
|
5
5
|
exports.yargsDaemonCommand = {
|
6
6
|
command: 'daemon',
|
7
|
-
describe: 'Prints information about the Nx Daemon process or starts a daemon process',
|
7
|
+
describe: 'Prints information about the Nx Daemon process or starts a daemon process.',
|
8
8
|
builder: (yargs) => (0, documentation_1.linkToNxDevAndExamples)(withDaemonOptions(yargs), 'daemon'),
|
9
9
|
handler: async (args) => (await Promise.resolve().then(() => require('./daemon'))).daemonHandler(args),
|
10
10
|
};
|
@@ -31,12 +31,12 @@ exports.yargsPrintAffectedCommand = {
|
|
31
31
|
builder: (yargs) => (0, shared_options_1.withAffectedOptions)((0, shared_options_1.withTargetAndConfigurationOption)(yargs, false))
|
32
32
|
.option('select', {
|
33
33
|
type: 'string',
|
34
|
-
describe: 'Select the subset of the returned json document (e.g., --select=projects)',
|
34
|
+
describe: 'Select the subset of the returned json document (e.g., --select=projects).',
|
35
35
|
})
|
36
36
|
.option('type', {
|
37
37
|
type: 'string',
|
38
38
|
choices: ['app', 'lib'],
|
39
|
-
describe: 'Select the type of projects to be returned (e.g., --type=app)',
|
39
|
+
describe: 'Select the type of projects to be returned (e.g., --type=app).',
|
40
40
|
}),
|
41
41
|
handler: async (args) => {
|
42
42
|
const exitCode = await (0, params_1.handleErrors)(false, () => {
|
@@ -4,7 +4,7 @@ exports.yargsExecCommand = void 0;
|
|
4
4
|
const shared_options_1 = require("../yargs-utils/shared-options");
|
5
5
|
exports.yargsExecCommand = {
|
6
6
|
command: 'exec',
|
7
|
-
describe: 'Executes any command as if it was a target on the project',
|
7
|
+
describe: 'Executes any command as if it was a target on the project.',
|
8
8
|
builder: (yargs) => (0, shared_options_1.withRunManyOptions)(yargs),
|
9
9
|
handler: async (args) => {
|
10
10
|
try {
|
@@ -5,7 +5,7 @@ const documentation_1 = require("../yargs-utils/documentation");
|
|
5
5
|
const shared_options_1 = require("../yargs-utils/shared-options");
|
6
6
|
exports.yargsFormatCheckCommand = {
|
7
7
|
command: 'format:check',
|
8
|
-
describe: 'Check for un-formatted files',
|
8
|
+
describe: 'Check for un-formatted files.',
|
9
9
|
builder: (yargs) => (0, documentation_1.linkToNxDevAndExamples)(withFormatOptions(yargs), 'format:check'),
|
10
10
|
handler: async (args) => {
|
11
11
|
await (await Promise.resolve().then(() => require('./format'))).format('check', args);
|
@@ -14,7 +14,7 @@ exports.yargsFormatCheckCommand = {
|
|
14
14
|
};
|
15
15
|
exports.yargsFormatWriteCommand = {
|
16
16
|
command: 'format:write',
|
17
|
-
describe: 'Overwrite un-formatted files',
|
17
|
+
describe: 'Overwrite un-formatted files.',
|
18
18
|
aliases: ['format'],
|
19
19
|
builder: (yargs) => (0, documentation_1.linkToNxDevAndExamples)(withFormatOptions(yargs), 'format:write'),
|
20
20
|
handler: async (args) => {
|
@@ -32,12 +32,12 @@ function withFormatOptions(yargs) {
|
|
32
32
|
type: 'boolean',
|
33
33
|
})
|
34
34
|
.option('projects', {
|
35
|
-
describe: 'Projects to format (comma/space delimited)',
|
35
|
+
describe: 'Projects to format (comma/space delimited).',
|
36
36
|
type: 'string',
|
37
37
|
coerce: shared_options_1.parseCSV,
|
38
38
|
})
|
39
39
|
.option('all', {
|
40
|
-
describe: 'Format all projects',
|
40
|
+
describe: 'Format all projects.',
|
41
41
|
type: 'boolean',
|
42
42
|
})
|
43
43
|
.conflicts({
|
@@ -18,23 +18,23 @@ function withGenerateOptions(yargs) {
|
|
18
18
|
const generatorWillShowHelp = process.argv[3] && !process.argv[3].startsWith('-');
|
19
19
|
const res = (0, shared_options_1.withVerbose)(yargs)
|
20
20
|
.positional('generator', {
|
21
|
-
describe: 'Name of the generator (e.g., @nx/js:library, library)',
|
21
|
+
describe: 'Name of the generator (e.g., @nx/js:library, library).',
|
22
22
|
type: 'string',
|
23
23
|
required: true,
|
24
24
|
})
|
25
25
|
.option('dryRun', {
|
26
|
-
describe: 'Preview the changes without updating files',
|
26
|
+
describe: 'Preview the changes without updating files.',
|
27
27
|
alias: 'd',
|
28
28
|
type: 'boolean',
|
29
29
|
default: false,
|
30
30
|
})
|
31
31
|
.option('interactive', {
|
32
|
-
describe: 'When false disables interactive input prompts for options',
|
32
|
+
describe: 'When false disables interactive input prompts for options.',
|
33
33
|
type: 'boolean',
|
34
34
|
default: true,
|
35
35
|
})
|
36
36
|
.option('quiet', {
|
37
|
-
describe: 'Hides logs from tree operations (e.g. `CREATE package.json`)',
|
37
|
+
describe: 'Hides logs from tree operations (e.g. `CREATE package.json`).',
|
38
38
|
type: 'boolean',
|
39
39
|
conflicts: ['verbose'],
|
40
40
|
})
|
@@ -6,12 +6,12 @@ const documentation_1 = require("../yargs-utils/documentation");
|
|
6
6
|
const shared_options_1 = require("../yargs-utils/shared-options");
|
7
7
|
exports.yargsGraphCommand = {
|
8
8
|
command: 'graph',
|
9
|
-
describe: 'Graph dependencies within workspace',
|
9
|
+
describe: 'Graph dependencies within workspace.',
|
10
10
|
aliases: ['dep-graph'],
|
11
11
|
builder: (yargs) => (0, documentation_1.linkToNxDevAndExamples)((0, shared_options_1.withVerbose)((0, shared_options_1.withAffectedOptions)(withGraphOptions(yargs))), 'dep-graph')
|
12
12
|
.option('affected', {
|
13
13
|
type: 'boolean',
|
14
|
-
description: 'Highlight affected projects',
|
14
|
+
description: 'Highlight affected projects.',
|
15
15
|
})
|
16
16
|
.implies('untracked', 'affected')
|
17
17
|
.implies('uncommitted', 'affected')
|
@@ -31,13 +31,13 @@ function withGraphOptions(yargs) {
|
|
31
31
|
type: 'boolean',
|
32
32
|
})
|
33
33
|
.option('view', {
|
34
|
-
describe: 'Choose whether to view the projects or task graph',
|
34
|
+
describe: 'Choose whether to view the projects or task graph.',
|
35
35
|
type: 'string',
|
36
36
|
default: 'projects',
|
37
37
|
choices: ['projects', 'tasks'],
|
38
38
|
})
|
39
39
|
.option('targets', {
|
40
|
-
describe: 'The target to show tasks for in the task graph',
|
40
|
+
describe: 'The target to show tasks for in the task graph.',
|
41
41
|
type: 'string',
|
42
42
|
coerce: shared_options_1.parseCSV,
|
43
43
|
})
|
@@ -51,7 +51,7 @@ function withGraphOptions(yargs) {
|
|
51
51
|
coerce: shared_options_1.parseCSV,
|
52
52
|
})
|
53
53
|
.option('groupByFolder', {
|
54
|
-
describe: 'Group projects by folder in the project graph',
|
54
|
+
describe: 'Group projects by folder in the project graph.',
|
55
55
|
type: 'boolean',
|
56
56
|
})
|
57
57
|
.option('host', {
|
@@ -63,7 +63,7 @@ function withGraphOptions(yargs) {
|
|
63
63
|
type: 'number',
|
64
64
|
})
|
65
65
|
.option('watch', {
|
66
|
-
describe: 'Watch for changes to project graph and update in-browser',
|
66
|
+
describe: 'Watch for changes to project graph and update in-browser.',
|
67
67
|
type: 'boolean',
|
68
68
|
default: true,
|
69
69
|
})
|
@@ -10,23 +10,27 @@ exports.yargsImportCommand = {
|
|
10
10
|
builder: (yargs) => (0, documentation_1.linkToNxDevAndExamples)((0, shared_options_1.withVerbose)(yargs
|
11
11
|
.positional('sourceRemoteUrl', {
|
12
12
|
type: 'string',
|
13
|
-
description: 'The remote URL of the source to import',
|
13
|
+
description: 'The remote URL of the source to import.',
|
14
14
|
})
|
15
15
|
.positional('destination', {
|
16
16
|
type: 'string',
|
17
|
-
description: 'The directory in the current workspace to import into',
|
17
|
+
description: 'The directory in the current workspace to import into.',
|
18
18
|
})
|
19
19
|
.option('source', {
|
20
20
|
type: 'string',
|
21
|
-
description: 'The directory in the source repository to import from',
|
21
|
+
description: 'The directory in the source repository to import from.',
|
22
22
|
})
|
23
23
|
.option('ref', {
|
24
24
|
type: 'string',
|
25
|
-
description: 'The branch from the source repository to import',
|
25
|
+
description: 'The branch from the source repository to import.',
|
26
|
+
})
|
27
|
+
.option('depth', {
|
28
|
+
type: 'number',
|
29
|
+
description: 'The depth to clone the source repository (limit this for faster git clone).',
|
26
30
|
})
|
27
31
|
.option('interactive', {
|
28
32
|
type: 'boolean',
|
29
|
-
description: 'Interactive mode',
|
33
|
+
description: 'Interactive mode.',
|
30
34
|
default: true,
|
31
35
|
})), 'import'),
|
32
36
|
handler: async (args) => {
|
@@ -15,6 +15,10 @@ export interface ImportOptions {
|
|
15
15
|
* The directory in the destination repo to import into
|
16
16
|
*/
|
17
17
|
destination: string;
|
18
|
+
/**
|
19
|
+
* The depth to clone the source repository (limit this for faster clone times)
|
20
|
+
*/
|
21
|
+
depth: number;
|
18
22
|
verbose: boolean;
|
19
23
|
interactive: boolean;
|
20
24
|
}
|