nx 21.3.0-canary.20250705-666da3e → 21.3.0-canary.20250710-13551c9
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/release/changelog-renderer/index.js +10 -2
- package/src/command-line/affected/affected.js +1 -1
- package/src/command-line/init/implementation/add-nx-to-monorepo.js +1 -1
- package/src/command-line/init/implementation/add-nx-to-nest.js +1 -1
- package/src/command-line/init/implementation/add-nx-to-npm-repo.js +1 -1
- package/src/command-line/init/implementation/angular/index.js +1 -1
- package/src/command-line/init/implementation/angular/legacy-angular-versions.js +1 -1
- package/src/command-line/init/implementation/utils.js +1 -1
- package/src/command-line/init/init-v2.js +1 -1
- package/src/command-line/migrate/migrate.js +1 -1
- package/src/command-line/{connect → nx-cloud/connect}/command-object.js +4 -4
- package/src/command-line/{connect → nx-cloud/connect}/connect-to-nx-cloud.d.ts +4 -4
- package/src/command-line/{connect → nx-cloud/connect}/connect-to-nx-cloud.js +10 -10
- package/src/command-line/{connect → nx-cloud/connect}/view-logs.js +6 -6
- package/src/command-line/nx-cloud/fix-ci/command-object.d.ts +2 -0
- package/src/command-line/nx-cloud/fix-ci/command-object.js +12 -0
- package/src/command-line/nx-cloud/fix-ci/fix-ci.d.ts +4 -0
- package/src/command-line/nx-cloud/fix-ci/fix-ci.js +7 -0
- package/src/command-line/{login → nx-cloud/login}/command-object.js +1 -1
- package/src/command-line/nx-cloud/login/login.js +10 -0
- package/src/command-line/{logout → nx-cloud/logout}/command-object.js +1 -1
- package/src/command-line/nx-cloud/logout/logout.js +7 -0
- package/src/command-line/nx-cloud/record/command-object.d.ts +2 -0
- package/src/command-line/nx-cloud/record/command-object.js +12 -0
- package/src/command-line/nx-cloud/record/record.d.ts +4 -0
- package/src/command-line/nx-cloud/record/record.js +7 -0
- package/src/command-line/nx-cloud/start-ci-run/command-object.d.ts +2 -0
- package/src/command-line/nx-cloud/start-ci-run/command-object.js +12 -0
- package/src/command-line/nx-cloud/start-ci-run/start-ci-run.d.ts +4 -0
- package/src/command-line/nx-cloud/start-ci-run/start-ci-run.js +7 -0
- package/src/command-line/nx-cloud/utils.d.ts +1 -0
- package/src/command-line/{logout/logout.js → nx-cloud/utils.js} +4 -4
- package/src/command-line/nx-commands.js +12 -6
- package/src/command-line/release/changelog.js +3 -13
- package/src/command-line/release/config/config.js +12 -0
- package/src/command-line/release/utils/git.d.ts +1 -1
- package/src/command-line/release/utils/git.js +18 -10
- package/src/command-line/release/utils/shared.js +7 -1
- package/src/command-line/release/version/release-group-processor.js +1 -1
- package/src/command-line/run/run-one.js +1 -1
- package/src/command-line/run-many/run-many.js +1 -1
- package/src/config/nx-json.d.ts +14 -0
- package/src/daemon/client/client.js +15 -7
- package/src/daemon/client/daemon-socket-messenger.js +9 -2
- package/src/daemon/server/file-watching/file-watcher-sockets.js +1 -1
- package/src/daemon/server/handle-context-file-data.js +1 -1
- package/src/daemon/server/handle-flush-sync-generator-changes-to-disk.js +1 -1
- package/src/daemon/server/handle-get-files-in-directory.js +1 -1
- package/src/daemon/server/handle-get-registered-sync-generators.js +1 -1
- package/src/daemon/server/handle-get-sync-generator-changes.js +1 -1
- package/src/daemon/server/handle-glob.js +2 -2
- package/src/daemon/server/handle-hash-tasks.d.ts +1 -1
- package/src/daemon/server/handle-hash-tasks.js +1 -1
- package/src/daemon/server/handle-nx-workspace-files.js +1 -1
- package/src/daemon/server/handle-outputs-tracking.js +1 -1
- package/src/daemon/server/handle-task-history.d.ts +2 -2
- package/src/daemon/server/handle-task-history.js +2 -2
- package/src/daemon/server/handle-tasks-execution-hooks.d.ts +1 -1
- package/src/daemon/server/handle-tasks-execution-hooks.js +1 -1
- package/src/daemon/server/server.d.ts +2 -2
- package/src/daemon/server/server.js +49 -28
- package/src/daemon/server/shutdown-utils.js +2 -1
- package/src/native/nx.wasm32-wasi.wasm +0 -0
- package/src/plugins/package-json/create-nodes.js +4 -1
- package/src/project-graph/plugins/isolation/messaging.js +2 -1
- package/src/project-graph/plugins/isolation/plugin-pool.js +19 -5
- package/src/project-graph/plugins/loaded-nx-plugin.js +2 -0
- package/src/tasks-runner/pseudo-ipc.js +4 -4
- package/src/tasks-runner/run-command.js +0 -2
- package/src/utils/consume-messages-from-socket.d.ts +2 -0
- package/src/utils/consume-messages-from-socket.js +18 -3
- package/src/utils/workspace-context.js +1 -1
- package/src/command-line/login/login.js +0 -19
- package/src/tasks-runner/life-cycles/nx-cloud-ci-message-life-cycle.d.ts +0 -7
- package/src/tasks-runner/life-cycles/nx-cloud-ci-message-life-cycle.js +0 -49
- /package/src/command-line/{connect → nx-cloud/connect}/command-object.d.ts +0 -0
- /package/src/command-line/{connect → nx-cloud/connect}/view-logs.d.ts +0 -0
- /package/src/command-line/{login → nx-cloud/login}/command-object.d.ts +0 -0
- /package/src/command-line/{login → nx-cloud/login}/login.d.ts +0 -0
- /package/src/command-line/{logout → nx-cloud/logout}/command-object.d.ts +0 -0
- /package/src/command-line/{logout → nx-cloud/logout}/logout.d.ts +0 -0
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "nx",
|
3
|
-
"version": "21.3.0-canary.
|
3
|
+
"version": "21.3.0-canary.20250710-13551c9",
|
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": {
|
@@ -83,16 +83,16 @@
|
|
83
83
|
}
|
84
84
|
},
|
85
85
|
"optionalDependencies": {
|
86
|
-
"@nx/nx-darwin-arm64": "21.3.0-canary.
|
87
|
-
"@nx/nx-darwin-x64": "21.3.0-canary.
|
88
|
-
"@nx/nx-freebsd-x64": "21.3.0-canary.
|
89
|
-
"@nx/nx-linux-arm-gnueabihf": "21.3.0-canary.
|
90
|
-
"@nx/nx-linux-arm64-gnu": "21.3.0-canary.
|
91
|
-
"@nx/nx-linux-arm64-musl": "21.3.0-canary.
|
92
|
-
"@nx/nx-linux-x64-gnu": "21.3.0-canary.
|
93
|
-
"@nx/nx-linux-x64-musl": "21.3.0-canary.
|
94
|
-
"@nx/nx-win32-arm64-msvc": "21.3.0-canary.
|
95
|
-
"@nx/nx-win32-x64-msvc": "21.3.0-canary.
|
86
|
+
"@nx/nx-darwin-arm64": "21.3.0-canary.20250710-13551c9",
|
87
|
+
"@nx/nx-darwin-x64": "21.3.0-canary.20250710-13551c9",
|
88
|
+
"@nx/nx-freebsd-x64": "21.3.0-canary.20250710-13551c9",
|
89
|
+
"@nx/nx-linux-arm-gnueabihf": "21.3.0-canary.20250710-13551c9",
|
90
|
+
"@nx/nx-linux-arm64-gnu": "21.3.0-canary.20250710-13551c9",
|
91
|
+
"@nx/nx-linux-arm64-musl": "21.3.0-canary.20250710-13551c9",
|
92
|
+
"@nx/nx-linux-x64-gnu": "21.3.0-canary.20250710-13551c9",
|
93
|
+
"@nx/nx-linux-x64-musl": "21.3.0-canary.20250710-13551c9",
|
94
|
+
"@nx/nx-win32-arm64-msvc": "21.3.0-canary.20250710-13551c9",
|
95
|
+
"@nx/nx-win32-x64-msvc": "21.3.0-canary.20250710-13551c9"
|
96
96
|
},
|
97
97
|
"nx-migrations": {
|
98
98
|
"migrations": "./migrations.json",
|
@@ -132,8 +132,16 @@ class DefaultChangelogRenderer {
|
|
132
132
|
return '';
|
133
133
|
}
|
134
134
|
renderVersionTitle() {
|
135
|
-
|
136
|
-
|
135
|
+
let isMajorVersion = true;
|
136
|
+
try {
|
137
|
+
isMajorVersion =
|
138
|
+
`${(0, semver_1.major)(this.changelogEntryVersion)}.0.0` ===
|
139
|
+
this.changelogEntryVersion.replace(/^v/, '');
|
140
|
+
}
|
141
|
+
catch {
|
142
|
+
// Do nothing with the error
|
143
|
+
// Prevent non-semver versions from erroring out
|
144
|
+
}
|
137
145
|
let maybeDateStr = '';
|
138
146
|
if (this.changelogRenderOptions.versionTitleDate) {
|
139
147
|
const dateStr = new Date().toISOString().slice(0, 10);
|
@@ -5,7 +5,7 @@ exports.getAffectedGraphNodes = getAffectedGraphNodes;
|
|
5
5
|
const file_utils_1 = require("../../project-graph/file-utils");
|
6
6
|
const run_command_1 = require("../../tasks-runner/run-command");
|
7
7
|
const output_1 = require("../../utils/output");
|
8
|
-
const connect_to_nx_cloud_1 = require("../connect/connect-to-nx-cloud");
|
8
|
+
const connect_to_nx_cloud_1 = require("../nx-cloud/connect/connect-to-nx-cloud");
|
9
9
|
const command_line_utils_1 = require("../../utils/command-line-utils");
|
10
10
|
const perf_hooks_1 = require("perf_hooks");
|
11
11
|
const project_graph_1 = require("../../project-graph/project-graph");
|
@@ -8,7 +8,7 @@ const path_1 = require("path");
|
|
8
8
|
const fileutils_1 = require("../../../utils/fileutils");
|
9
9
|
const output_1 = require("../../../utils/output");
|
10
10
|
const utils_1 = require("./utils");
|
11
|
-
const connect_to_nx_cloud_1 = require("../../connect/connect-to-nx-cloud");
|
11
|
+
const connect_to_nx_cloud_1 = require("../../nx-cloud/connect/connect-to-nx-cloud");
|
12
12
|
async function addNxToMonorepo(options) {
|
13
13
|
const repoRoot = process.cwd();
|
14
14
|
output_1.output.log({ title: '🐳 Nx initialization' });
|
@@ -9,7 +9,7 @@ const output_1 = require("../../../utils/output");
|
|
9
9
|
const package_manager_1 = require("../../../utils/package-manager");
|
10
10
|
const utils_1 = require("./utils");
|
11
11
|
const versions_1 = require("../../../utils/versions");
|
12
|
-
const connect_to_nx_cloud_1 = require("../../connect/connect-to-nx-cloud");
|
12
|
+
const connect_to_nx_cloud_1 = require("../../nx-cloud/connect/connect-to-nx-cloud");
|
13
13
|
async function addNxToNest(options, packageJson) {
|
14
14
|
const repoRoot = process.cwd();
|
15
15
|
output_1.output.log({ title: '🐳 Nx initialization' });
|
@@ -7,7 +7,7 @@ const fileutils_1 = require("../../../utils/fileutils");
|
|
7
7
|
const output_1 = require("../../../utils/output");
|
8
8
|
const package_manager_1 = require("../../../utils/package-manager");
|
9
9
|
const utils_1 = require("./utils");
|
10
|
-
const connect_to_nx_cloud_1 = require("../../connect/connect-to-nx-cloud");
|
10
|
+
const connect_to_nx_cloud_1 = require("../../nx-cloud/connect/connect-to-nx-cloud");
|
11
11
|
async function addNxToNpmRepo(options) {
|
12
12
|
const repoRoot = process.cwd();
|
13
13
|
output_1.output.log({ title: '🐳 Nx initialization' });
|
@@ -11,7 +11,7 @@ const utils_1 = require("../utils");
|
|
11
11
|
const integrated_workspace_1 = require("./integrated-workspace");
|
12
12
|
const legacy_angular_versions_1 = require("./legacy-angular-versions");
|
13
13
|
const standalone_workspace_1 = require("./standalone-workspace");
|
14
|
-
const connect_to_nx_cloud_1 = require("../../../connect/connect-to-nx-cloud");
|
14
|
+
const connect_to_nx_cloud_1 = require("../../../nx-cloud/connect/connect-to-nx-cloud");
|
15
15
|
const defaultCacheableOperations = [
|
16
16
|
'build',
|
17
17
|
'server',
|
@@ -10,7 +10,7 @@ const object_sort_1 = require("../../../../utils/object-sort");
|
|
10
10
|
const output_1 = require("../../../../utils/output");
|
11
11
|
const package_json_1 = require("../../../../utils/package-json");
|
12
12
|
const package_manager_1 = require("../../../../utils/package-manager");
|
13
|
-
const connect_to_nx_cloud_1 = require("../../../connect/connect-to-nx-cloud");
|
13
|
+
const connect_to_nx_cloud_1 = require("../../../nx-cloud/connect/connect-to-nx-cloud");
|
14
14
|
const utils_1 = require("../utils");
|
15
15
|
// map of Angular major versions to Nx versions to use for legacy `nx init` migrations,
|
16
16
|
// key is major Angular version and value is Nx version to use
|
@@ -22,7 +22,7 @@ const versions_1 = require("../../../utils/versions");
|
|
22
22
|
const fs_1 = require("fs");
|
23
23
|
const connect_to_nx_cloud_1 = require("../../../nx-cloud/generators/connect-to-nx-cloud/connect-to-nx-cloud");
|
24
24
|
const url_shorten_1 = require("../../../nx-cloud/utilities/url-shorten");
|
25
|
-
const connect_to_nx_cloud_2 = require("../../connect/connect-to-nx-cloud");
|
25
|
+
const connect_to_nx_cloud_2 = require("../../nx-cloud/connect/connect-to-nx-cloud");
|
26
26
|
const deduce_default_base_1 = require("./deduce-default-base");
|
27
27
|
const child_process_2 = require("../../../utils/child-process");
|
28
28
|
function createNxJsonFile(repoRoot, topologicalTargets, cacheableOperations, scriptOutputs) {
|
@@ -12,7 +12,7 @@ const output_1 = require("../../utils/output");
|
|
12
12
|
const package_manager_1 = require("../../utils/package-manager");
|
13
13
|
const versions_1 = require("../../utils/versions");
|
14
14
|
const workspace_context_1 = require("../../utils/workspace-context");
|
15
|
-
const connect_to_nx_cloud_1 = require("../connect/connect-to-nx-cloud");
|
15
|
+
const connect_to_nx_cloud_1 = require("../nx-cloud/connect/connect-to-nx-cloud");
|
16
16
|
const configure_plugins_1 = require("./configure-plugins");
|
17
17
|
const add_nx_to_monorepo_1 = require("./implementation/add-nx-to-monorepo");
|
18
18
|
const add_nx_to_npm_repo_1 = require("./implementation/add-nx-to-npm-repo");
|
@@ -24,7 +24,7 @@ const git_utils_1 = require("../../utils/git-utils");
|
|
24
24
|
const package_json_1 = require("../../utils/package-json");
|
25
25
|
const package_manager_1 = require("../../utils/package-manager");
|
26
26
|
const handle_errors_1 = require("../../utils/handle-errors");
|
27
|
-
const connect_to_nx_cloud_1 = require("../connect/connect-to-nx-cloud");
|
27
|
+
const connect_to_nx_cloud_1 = require("../nx-cloud/connect/connect-to-nx-cloud");
|
28
28
|
const output_1 = require("../../utils/output");
|
29
29
|
const fs_1 = require("fs");
|
30
30
|
const workspace_root_1 = require("../../utils/workspace-root");
|
@@ -1,9 +1,9 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.yargsViewLogsCommand = exports.yargsConnectCommand = void 0;
|
4
|
-
const documentation_1 = require("
|
5
|
-
const versions_1 = require("
|
6
|
-
const shared_options_1 = require("
|
4
|
+
const documentation_1 = require("../../yargs-utils/documentation");
|
5
|
+
const versions_1 = require("../../../utils/versions");
|
6
|
+
const shared_options_1 = require("../../yargs-utils/shared-options");
|
7
7
|
exports.yargsConnectCommand = {
|
8
8
|
command: 'connect',
|
9
9
|
aliases: ['connect-to-nx-cloud'],
|
@@ -11,7 +11,7 @@ exports.yargsConnectCommand = {
|
|
11
11
|
builder: (yargs) => (0, documentation_1.linkToNxDevAndExamples)(withConnectOptions(yargs), 'connect-to-nx-cloud'),
|
12
12
|
handler: async (args) => {
|
13
13
|
await (await Promise.resolve().then(() => require('./connect-to-nx-cloud'))).connectToNxCloudCommand(args);
|
14
|
-
await (await Promise.resolve().then(() => require('
|
14
|
+
await (await Promise.resolve().then(() => require('../../../utils/ab-testing'))).recordStat({
|
15
15
|
command: 'connect',
|
16
16
|
nxVersion: versions_1.nxVersion,
|
17
17
|
useCloud: true,
|
@@ -1,7 +1,7 @@
|
|
1
|
-
import { ConnectToNxCloudOptions } from '
|
2
|
-
import { NxJsonConfiguration } from '
|
3
|
-
import { NxArgs } from '
|
4
|
-
import { MessageKey } from '
|
1
|
+
import { ConnectToNxCloudOptions } from '../../../nx-cloud/generators/connect-to-nx-cloud/connect-to-nx-cloud';
|
2
|
+
import { NxJsonConfiguration } from '../../../config/nx-json';
|
3
|
+
import { NxArgs } from '../../../utils/command-line-utils';
|
4
|
+
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>;
|
@@ -6,16 +6,16 @@ exports.connectWorkspaceToCloud = connectWorkspaceToCloud;
|
|
6
6
|
exports.connectToNxCloudCommand = connectToNxCloudCommand;
|
7
7
|
exports.connectExistingRepoToNxCloudPrompt = connectExistingRepoToNxCloudPrompt;
|
8
8
|
exports.connectToNxCloudWithPrompt = connectToNxCloudWithPrompt;
|
9
|
-
const output_1 = require("
|
10
|
-
const configuration_1 = require("
|
11
|
-
const tree_1 = require("
|
12
|
-
const connect_to_nx_cloud_1 = require("
|
13
|
-
const url_shorten_1 = require("
|
14
|
-
const nx_cloud_utils_1 = require("
|
15
|
-
const child_process_1 = require("
|
16
|
-
const ab_testing_1 = require("
|
17
|
-
const versions_1 = require("
|
18
|
-
const workspace_root_1 = require("
|
9
|
+
const output_1 = require("../../../utils/output");
|
10
|
+
const configuration_1 = require("../../../config/configuration");
|
11
|
+
const tree_1 = require("../../../generators/tree");
|
12
|
+
const connect_to_nx_cloud_1 = require("../../../nx-cloud/generators/connect-to-nx-cloud/connect-to-nx-cloud");
|
13
|
+
const url_shorten_1 = require("../../../nx-cloud/utilities/url-shorten");
|
14
|
+
const nx_cloud_utils_1 = require("../../../utils/nx-cloud-utils");
|
15
|
+
const child_process_1 = require("../../../utils/child-process");
|
16
|
+
const ab_testing_1 = require("../../../utils/ab-testing");
|
17
|
+
const versions_1 = require("../../../utils/versions");
|
18
|
+
const workspace_root_1 = require("../../../utils/workspace-root");
|
19
19
|
const chalk = require("chalk");
|
20
20
|
const ora = require("ora");
|
21
21
|
const open = require("open");
|
@@ -1,14 +1,14 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.viewLogs = viewLogs;
|
4
|
-
const package_manager_1 = require("
|
4
|
+
const package_manager_1 = require("../../../utils/package-manager");
|
5
5
|
const child_process_1 = require("child_process");
|
6
|
-
const nx_cloud_utils_1 = require("
|
7
|
-
const output_1 = require("
|
8
|
-
const nx_json_1 = require("
|
6
|
+
const nx_cloud_utils_1 = require("../../../utils/nx-cloud-utils");
|
7
|
+
const output_1 = require("../../../utils/output");
|
8
|
+
const nx_json_1 = require("../../../config/nx-json");
|
9
9
|
const connect_to_nx_cloud_1 = require("./connect-to-nx-cloud");
|
10
|
-
const connect_to_nx_cloud_2 = require("
|
11
|
-
const url_shorten_1 = require("
|
10
|
+
const connect_to_nx_cloud_2 = require("../../../nx-cloud/generators/connect-to-nx-cloud/connect-to-nx-cloud");
|
11
|
+
const url_shorten_1 = require("../../../nx-cloud/utilities/url-shorten");
|
12
12
|
async function viewLogs() {
|
13
13
|
const cloudUsed = (0, nx_cloud_utils_1.isNxCloudUsed)((0, nx_json_1.readNxJson)());
|
14
14
|
if (cloudUsed) {
|
@@ -0,0 +1,12 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.yargsFixCiCommand = void 0;
|
4
|
+
const shared_options_1 = require("../../yargs-utils/shared-options");
|
5
|
+
exports.yargsFixCiCommand = {
|
6
|
+
command: 'fix-ci [options]',
|
7
|
+
describe: 'Fixes CI failures. This command is an alias for [`nx-cloud fix-ci`](/ci/reference/nx-cloud-cli#npx-nxcloud-fix-ci).',
|
8
|
+
builder: (yargs) => (0, shared_options_1.withVerbose)(yargs),
|
9
|
+
handler: async (args) => {
|
10
|
+
process.exit(await (await Promise.resolve().then(() => require('./fix-ci'))).fixCiHandler(args));
|
11
|
+
},
|
12
|
+
};
|
@@ -1,7 +1,7 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.yargsLoginCommand = void 0;
|
4
|
-
const shared_options_1 = require("../../
|
4
|
+
const shared_options_1 = require("../../yargs-utils/shared-options");
|
5
5
|
exports.yargsLoginCommand = {
|
6
6
|
command: 'login [nxCloudUrl]',
|
7
7
|
describe: 'Login to Nx Cloud. This command is an alias for [`nx-cloud login`](/ci/reference/nx-cloud-cli#npx-nxcloud-login).',
|
@@ -0,0 +1,10 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.loginHandler = loginHandler;
|
4
|
+
const utils_1 = require("../utils");
|
5
|
+
function loginHandler(args) {
|
6
|
+
if (args.nxCloudUrl) {
|
7
|
+
process.env.NX_CLOUD_API = args.nxCloudUrl;
|
8
|
+
}
|
9
|
+
return (0, utils_1.executeNxCloudCommand)('login', args.verbose);
|
10
|
+
}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.yargsLogoutCommand = void 0;
|
4
|
-
const shared_options_1 = require("../../
|
4
|
+
const shared_options_1 = require("../../yargs-utils/shared-options");
|
5
5
|
exports.yargsLogoutCommand = {
|
6
6
|
command: 'logout',
|
7
7
|
describe: 'Logout from Nx Cloud. This command is an alias for [`nx-cloud logout`](/ci/reference/nx-cloud-cli#npx-nxcloud-logout).',
|
@@ -0,0 +1,12 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.yargsRecordCommand = void 0;
|
4
|
+
const shared_options_1 = require("../../yargs-utils/shared-options");
|
5
|
+
exports.yargsRecordCommand = {
|
6
|
+
command: 'record [options]',
|
7
|
+
describe: 'Records a command execution for distributed task execution. This command is an alias for [`nx-cloud record`](/ci/reference/nx-cloud-cli#npx-nxcloud-record).',
|
8
|
+
builder: (yargs) => (0, shared_options_1.withVerbose)(yargs),
|
9
|
+
handler: async (args) => {
|
10
|
+
process.exit(await (await Promise.resolve().then(() => require('./record'))).recordHandler(args));
|
11
|
+
},
|
12
|
+
};
|
@@ -0,0 +1,12 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.yargsStartCiRunCommand = void 0;
|
4
|
+
const shared_options_1 = require("../../yargs-utils/shared-options");
|
5
|
+
exports.yargsStartCiRunCommand = {
|
6
|
+
command: 'start-ci-run [options]',
|
7
|
+
describe: 'Starts a new CI run for distributed task execution. This command is an alias for [`nx-cloud start-ci-run`](/ci/reference/nx-cloud-cli#npx-nxcloud-start-ci-run).',
|
8
|
+
builder: (yargs) => (0, shared_options_1.withVerbose)(yargs),
|
9
|
+
handler: async (args) => {
|
10
|
+
process.exit(await (await Promise.resolve().then(() => require('./start-ci-run'))).startCiRunHandler(args));
|
11
|
+
},
|
12
|
+
};
|
@@ -0,0 +1,7 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.startCiRunHandler = startCiRunHandler;
|
4
|
+
const utils_1 = require("../utils");
|
5
|
+
function startCiRunHandler(args) {
|
6
|
+
return (0, utils_1.executeNxCloudCommand)('start-ci-run', args.verbose);
|
7
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare function executeNxCloudCommand(commandName: string, verbose?: boolean): Promise<number>;
|
@@ -1,16 +1,16 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.
|
3
|
+
exports.executeNxCloudCommand = executeNxCloudCommand;
|
4
4
|
const update_manager_1 = require("../../nx-cloud/update-manager");
|
5
5
|
const get_cloud_options_1 = require("../../nx-cloud/utilities/get-cloud-options");
|
6
6
|
const handle_errors_1 = require("../../utils/handle-errors");
|
7
7
|
const resolution_helpers_1 = require("../../nx-cloud/resolution-helpers");
|
8
|
-
function
|
9
|
-
return (0, handle_errors_1.handleErrors)(
|
8
|
+
async function executeNxCloudCommand(commandName, verbose) {
|
9
|
+
return (0, handle_errors_1.handleErrors)(verbose, async () => {
|
10
10
|
const nxCloudClient = (await (0, update_manager_1.verifyOrUpdateNxCloudClient)((0, get_cloud_options_1.getCloudOptions)()))
|
11
11
|
.nxCloudClient;
|
12
12
|
const paths = (0, resolution_helpers_1.findAncestorNodeModules)(__dirname, []);
|
13
13
|
nxCloudClient.configureLightClientRequire()(paths);
|
14
|
-
await nxCloudClient.commands
|
14
|
+
await nxCloudClient.commands[commandName]();
|
15
15
|
});
|
16
16
|
}
|
@@ -5,7 +5,7 @@ const chalk = require("chalk");
|
|
5
5
|
const yargs = require("yargs");
|
6
6
|
const command_object_1 = require("./register/command-object");
|
7
7
|
const command_object_2 = require("./affected/command-object");
|
8
|
-
const command_object_3 = require("./connect/command-object");
|
8
|
+
const command_object_3 = require("./nx-cloud/connect/command-object");
|
9
9
|
const command_object_4 = require("./daemon/command-object");
|
10
10
|
const command_object_5 = require("./graph/command-object");
|
11
11
|
const command_object_6 = require("./exec/command-object");
|
@@ -25,10 +25,13 @@ const command_object_19 = require("./watch/command-object");
|
|
25
25
|
const command_object_20 = require("./reset/command-object");
|
26
26
|
const command_object_21 = require("./release/command-object");
|
27
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");
|
28
|
+
const command_object_23 = require("./nx-cloud/login/command-object");
|
29
|
+
const command_object_24 = require("./nx-cloud/logout/command-object");
|
30
|
+
const command_object_25 = require("./nx-cloud/record/command-object");
|
31
|
+
const command_object_26 = require("./nx-cloud/start-ci-run/command-object");
|
32
|
+
const command_object_27 = require("./nx-cloud/fix-ci/command-object");
|
30
33
|
const command_objects_1 = require("./deprecated/command-objects");
|
31
|
-
const
|
34
|
+
const command_object_28 = require("./sync/command-object");
|
32
35
|
const output_1 = require("../utils/output");
|
33
36
|
// Ensure that the output takes up the available width of the terminal.
|
34
37
|
yargs.wrap(yargs.terminalWidth());
|
@@ -75,13 +78,16 @@ exports.commandsObject = yargs
|
|
75
78
|
.command(command_object_16.yargsRunCommand)
|
76
79
|
.command(command_object_17.yargsRunManyCommand)
|
77
80
|
.command(command_object_18.yargsShowCommand)
|
78
|
-
.command(
|
79
|
-
.command(
|
81
|
+
.command(command_object_28.yargsSyncCommand)
|
82
|
+
.command(command_object_28.yargsSyncCheckCommand)
|
80
83
|
.command(command_object_3.yargsViewLogsCommand)
|
81
84
|
.command(command_object_19.yargsWatchCommand)
|
82
85
|
.command(command_object_16.yargsNxInfixCommand)
|
83
86
|
.command(command_object_23.yargsLoginCommand)
|
84
87
|
.command(command_object_24.yargsLogoutCommand)
|
88
|
+
.command(command_object_25.yargsRecordCommand)
|
89
|
+
.command(command_object_26.yargsStartCiRunCommand)
|
90
|
+
.command(command_object_27.yargsFixCiCommand)
|
85
91
|
.command(resolveConformanceCommandObject())
|
86
92
|
.command(resolveConformanceCheckCommandObject())
|
87
93
|
.scriptName('nx')
|
@@ -5,7 +5,6 @@ exports.createAPI = createAPI;
|
|
5
5
|
const chalk = require("chalk");
|
6
6
|
const enquirer_1 = require("enquirer");
|
7
7
|
const node_fs_1 = require("node:fs");
|
8
|
-
const semver_1 = require("semver");
|
9
8
|
const tmp_1 = require("tmp");
|
10
9
|
const nx_json_1 = require("../../config/nx-json");
|
11
10
|
const tree_1 = require("../../generators/tree");
|
@@ -192,7 +191,7 @@ function createAPI(overrideReleaseConfig) {
|
|
192
191
|
}
|
193
192
|
else {
|
194
193
|
let workspaceChangelogFromRef = args.from ||
|
195
|
-
(await (0, git_1.getLatestGitTagForPattern)(nxReleaseConfig.releaseTagPattern, {}, nxReleaseConfig.releaseTagPatternCheckAllBranchesWhen))?.tag;
|
194
|
+
(await (0, git_1.getLatestGitTagForPattern)(nxReleaseConfig.releaseTagPattern, {}, nxReleaseConfig.releaseTagPatternCheckAllBranchesWhen, nxReleaseConfig.releaseTagPatternRequireSemver))?.tag;
|
196
195
|
if (!workspaceChangelogFromRef) {
|
197
196
|
if (useAutomaticFromRef) {
|
198
197
|
workspaceChangelogFromRef = await (0, git_1.getFirstGitCommit)();
|
@@ -327,7 +326,7 @@ function createAPI(overrideReleaseConfig) {
|
|
327
326
|
(await (0, git_1.getLatestGitTagForPattern)(releaseGroup.releaseTagPattern, {
|
328
327
|
projectName: project.name,
|
329
328
|
releaseGroupName: releaseGroup.name,
|
330
|
-
}, releaseGroup.releaseTagPatternCheckAllBranchesWhen))?.tag;
|
329
|
+
}, releaseGroup.releaseTagPatternCheckAllBranchesWhen, releaseGroup.releaseTagPatternRequireSemver))?.tag;
|
331
330
|
if (!fromRef && useAutomaticFromRef) {
|
332
331
|
const firstCommit = await (0, git_1.getFirstGitCommit)();
|
333
332
|
commits = await filterProjectCommits({
|
@@ -437,7 +436,7 @@ function createAPI(overrideReleaseConfig) {
|
|
437
436
|
}
|
438
437
|
else {
|
439
438
|
let fromRef = args.from ||
|
440
|
-
(await (0, git_1.getLatestGitTagForPattern)(releaseGroup.releaseTagPattern, {}, releaseGroup.releaseTagPatternCheckAllBranchesWhen))?.tag;
|
439
|
+
(await (0, git_1.getLatestGitTagForPattern)(releaseGroup.releaseTagPattern, {}, releaseGroup.releaseTagPatternCheckAllBranchesWhen, releaseGroup.releaseTagPatternRequireSemver))?.tag;
|
441
440
|
if (!fromRef) {
|
442
441
|
if (useAutomaticFromRef) {
|
443
442
|
fromRef = await (0, git_1.getFirstGitCommit)();
|
@@ -502,15 +501,6 @@ function resolveChangelogVersions(args, releaseGroups, releaseGroupToFilteredPro
|
|
502
501
|
if (!args.version && !args.versionData) {
|
503
502
|
throw new Error(`You must provide a version string and/or a versionData object.`);
|
504
503
|
}
|
505
|
-
/**
|
506
|
-
* TODO: revaluate this assumption holistically in a dedicated PR when we add support for calver
|
507
|
-
* (e.g. the Release class also uses semver utils to check if prerelease).
|
508
|
-
*
|
509
|
-
* Right now, the given version must be valid semver in order to proceed
|
510
|
-
*/
|
511
|
-
if (args.version && !(0, semver_1.valid)(args.version)) {
|
512
|
-
throw new Error(`The given version "${args.version}" is not a valid semver version. Please provide your version in the format "1.0.0", "1.0.0-beta.1" etc`);
|
513
|
-
}
|
514
504
|
const versionData = releaseGroups.reduce((versionData, releaseGroup) => {
|
515
505
|
const releaseGroupProjectNames = Array.from(releaseGroupToFilteredProjects.get(releaseGroup));
|
516
506
|
for (const projectName of releaseGroupProjectNames) {
|
@@ -118,6 +118,7 @@ async function createNxReleaseConfig(projectGraph, projectFileMap, userConfig =
|
|
118
118
|
*/
|
119
119
|
const defaultFixedGroupReleaseTagPattern = '{releaseGroupName}-v{version}';
|
120
120
|
const defaultIndependentReleaseTagPattern = '{projectName}@{version}';
|
121
|
+
const defaultReleaseTagPatternRequireSemver = true;
|
121
122
|
const workspaceProjectsRelationship = userConfig.projectsRelationship || 'fixed';
|
122
123
|
const defaultGeneratorOptions = {};
|
123
124
|
if (userConfig.version?.conventionalCommits) {
|
@@ -200,11 +201,15 @@ async function createNxReleaseConfig(projectGraph, projectFileMap, userConfig =
|
|
200
201
|
? defaultIndependentReleaseTagPattern
|
201
202
|
: defaultFixedReleaseTagPattern),
|
202
203
|
releaseTagPatternCheckAllBranchesWhen: userConfig.releaseTagPatternCheckAllBranchesWhen ?? undefined,
|
204
|
+
releaseTagPatternRequireSemver: userConfig.releaseTagPatternRequireSemver ??
|
205
|
+
defaultReleaseTagPatternRequireSemver,
|
203
206
|
conventionalCommits: conventional_commits_1.DEFAULT_CONVENTIONAL_COMMITS_CONFIG,
|
204
207
|
versionPlans: (userConfig.versionPlans ||
|
205
208
|
false),
|
206
209
|
};
|
207
210
|
const groupProjectsRelationship = userConfig.projectsRelationship || WORKSPACE_DEFAULTS.projectsRelationship;
|
211
|
+
const groupReleaseTagPatternRequireSemver = userConfig.releaseTagPatternRequireSemver ??
|
212
|
+
WORKSPACE_DEFAULTS.releaseTagPatternRequireSemver;
|
208
213
|
const GROUP_DEFAULTS = {
|
209
214
|
projectsRelationship: groupProjectsRelationship,
|
210
215
|
version: USE_LEGACY_VERSIONING
|
@@ -238,6 +243,7 @@ async function createNxReleaseConfig(projectGraph, projectFileMap, userConfig =
|
|
238
243
|
? defaultIndependentReleaseTagPattern
|
239
244
|
: WORKSPACE_DEFAULTS.releaseTagPattern,
|
240
245
|
releaseTagPatternCheckAllBranchesWhen: userConfig.releaseTagPatternCheckAllBranchesWhen ?? undefined,
|
246
|
+
releaseTagPatternRequireSemver: groupReleaseTagPatternRequireSemver,
|
241
247
|
versionPlans: false,
|
242
248
|
};
|
243
249
|
/**
|
@@ -339,6 +345,8 @@ async function createNxReleaseConfig(projectGraph, projectFileMap, userConfig =
|
|
339
345
|
version: deepMergeDefaults([GROUP_DEFAULTS.version], rootVersionWithoutGlobalOptions),
|
340
346
|
// If the user has set something custom for releaseTagPattern at the top level, respect it for the implicit default group
|
341
347
|
releaseTagPattern: userConfig.releaseTagPattern || GROUP_DEFAULTS.releaseTagPattern,
|
348
|
+
releaseTagPatternRequireSemver: userConfig.releaseTagPatternRequireSemver ??
|
349
|
+
GROUP_DEFAULTS.releaseTagPatternRequireSemver,
|
342
350
|
// Directly inherit the root level config for projectChangelogs, if set
|
343
351
|
changelog: rootChangelogConfig.projectChangelogs || false,
|
344
352
|
versionPlans: rootVersionPlansConfig || GROUP_DEFAULTS.versionPlans,
|
@@ -418,6 +426,9 @@ async function createNxReleaseConfig(projectGraph, projectFileMap, userConfig =
|
|
418
426
|
releaseTagPatternCheckAllBranchesWhen: releaseGroup.releaseTagPatternCheckAllBranchesWhen ??
|
419
427
|
userConfig.releaseTagPatternCheckAllBranchesWhen ??
|
420
428
|
undefined,
|
429
|
+
releaseTagPatternRequireSemver: releaseGroup.releaseTagPatternRequireSemver ??
|
430
|
+
userConfig.releaseTagPatternRequireSemver ??
|
431
|
+
defaultReleaseTagPatternRequireSemver,
|
421
432
|
versionPlans: releaseGroup.versionPlans ?? rootVersionPlansConfig,
|
422
433
|
};
|
423
434
|
const finalReleaseGroup = deepMergeDefaults([groupDefaults], {
|
@@ -491,6 +502,7 @@ async function createNxReleaseConfig(projectGraph, projectFileMap, userConfig =
|
|
491
502
|
projectsRelationship: WORKSPACE_DEFAULTS.projectsRelationship,
|
492
503
|
releaseTagPattern: WORKSPACE_DEFAULTS.releaseTagPattern,
|
493
504
|
releaseTagPatternCheckAllBranchesWhen: WORKSPACE_DEFAULTS.releaseTagPatternCheckAllBranchesWhen,
|
505
|
+
releaseTagPatternRequireSemver: WORKSPACE_DEFAULTS.releaseTagPatternRequireSemver,
|
494
506
|
git: rootGitConfig,
|
495
507
|
version: rootVersionConfig,
|
496
508
|
changelog: rootChangelogConfig,
|
@@ -22,7 +22,7 @@ export interface GitCommit extends RawGitCommit {
|
|
22
22
|
affectedFiles: string[];
|
23
23
|
revertedHashes: string[];
|
24
24
|
}
|
25
|
-
export declare function getLatestGitTagForPattern(releaseTagPattern: string, additionalInterpolationData?: {}, checkAllBranchesWhen?: boolean | string[]): Promise<{
|
25
|
+
export declare function getLatestGitTagForPattern(releaseTagPattern: string, additionalInterpolationData?: {}, checkAllBranchesWhen?: boolean | string[], releaseTagPatternRequireSemver?: boolean): Promise<{
|
26
26
|
tag: string;
|
27
27
|
extractedVersion: string;
|
28
28
|
} | null>;
|
@@ -26,7 +26,7 @@ function escapeRegExp(string) {
|
|
26
26
|
}
|
27
27
|
// https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string
|
28
28
|
const SEMVER_REGEX = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/g;
|
29
|
-
async function getLatestGitTagForPattern(releaseTagPattern, additionalInterpolationData = {}, checkAllBranchesWhen) {
|
29
|
+
async function getLatestGitTagForPattern(releaseTagPattern, additionalInterpolationData = {}, checkAllBranchesWhen, releaseTagPatternRequireSemver = true) {
|
30
30
|
/**
|
31
31
|
* By default, we will try and resolve the latest match for the releaseTagPattern from the current branch,
|
32
32
|
* falling back to all branches if no match is found on the current branch.
|
@@ -105,17 +105,25 @@ async function getLatestGitTagForPattern(releaseTagPattern, additionalInterpolat
|
|
105
105
|
const tagRegexp = `^${escapeRegExp(interpolatedTagPattern)
|
106
106
|
.replace('%v%', '(.+)')
|
107
107
|
.replace('%p%', '(.+)')}`;
|
108
|
-
const
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
108
|
+
const matchingTags = tags.filter((tag) => {
|
109
|
+
if (releaseTagPatternRequireSemver) {
|
110
|
+
// Match against Semver Regex when using semverVersioning to ensure only valid semver tags are matched
|
111
|
+
return (!!tag.match(tagRegexp) &&
|
112
|
+
tag.match(tagRegexp).some((r) => r.match(SEMVER_REGEX)));
|
113
|
+
}
|
114
|
+
else {
|
115
|
+
return !!tag.match(tagRegexp);
|
116
|
+
}
|
117
|
+
});
|
118
|
+
if (!matchingTags.length) {
|
113
119
|
return null;
|
114
120
|
}
|
115
|
-
const [latestMatchingTag, ...rest] =
|
116
|
-
const version =
|
117
|
-
|
118
|
-
|
121
|
+
const [latestMatchingTag, ...rest] = matchingTags[0].match(tagRegexp);
|
122
|
+
const version = releaseTagPatternRequireSemver
|
123
|
+
? rest.filter((r) => {
|
124
|
+
return r.match(SEMVER_REGEX);
|
125
|
+
})[0]
|
126
|
+
: rest[0];
|
119
127
|
return {
|
120
128
|
tag: latestMatchingTag,
|
121
129
|
extractedVersion: version,
|