nx 21.3.0-canary.20250718-9f1c811 → 21.3.0-rc.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
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "nx",
|
3
|
-
"version": "21.3.0-
|
3
|
+
"version": "21.3.0-rc.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": {
|
@@ -83,16 +83,16 @@
|
|
83
83
|
}
|
84
84
|
},
|
85
85
|
"optionalDependencies": {
|
86
|
-
"@nx/nx-darwin-arm64": "21.3.0-
|
87
|
-
"@nx/nx-darwin-x64": "21.3.0-
|
88
|
-
"@nx/nx-freebsd-x64": "21.3.0-
|
89
|
-
"@nx/nx-linux-arm-gnueabihf": "21.3.0-
|
90
|
-
"@nx/nx-linux-arm64-gnu": "21.3.0-
|
91
|
-
"@nx/nx-linux-arm64-musl": "21.3.0-
|
92
|
-
"@nx/nx-linux-x64-gnu": "21.3.0-
|
93
|
-
"@nx/nx-linux-x64-musl": "21.3.0-
|
94
|
-
"@nx/nx-win32-arm64-msvc": "21.3.0-
|
95
|
-
"@nx/nx-win32-x64-msvc": "21.3.0-
|
86
|
+
"@nx/nx-darwin-arm64": "21.3.0-rc.0",
|
87
|
+
"@nx/nx-darwin-x64": "21.3.0-rc.0",
|
88
|
+
"@nx/nx-freebsd-x64": "21.3.0-rc.0",
|
89
|
+
"@nx/nx-linux-arm-gnueabihf": "21.3.0-rc.0",
|
90
|
+
"@nx/nx-linux-arm64-gnu": "21.3.0-rc.0",
|
91
|
+
"@nx/nx-linux-arm64-musl": "21.3.0-rc.0",
|
92
|
+
"@nx/nx-linux-x64-gnu": "21.3.0-rc.0",
|
93
|
+
"@nx/nx-linux-x64-musl": "21.3.0-rc.0",
|
94
|
+
"@nx/nx-win32-arm64-msvc": "21.3.0-rc.0",
|
95
|
+
"@nx/nx-win32-x64-msvc": "21.3.0-rc.0"
|
96
96
|
},
|
97
97
|
"nx-migrations": {
|
98
98
|
"migrations": "./migrations.json",
|
@@ -4,7 +4,3 @@
|
|
4
4
|
export declare function createNxCloudOnboardingURL(onboardingSource: string, accessToken?: string, usesGithub?: boolean, meta?: string): Promise<string>;
|
5
5
|
export declare function repoUsesGithub(github?: boolean, githubSlug?: string, apiUrl?: string): Promise<boolean>;
|
6
6
|
export declare function getURLifShortenFailed(usesGithub: boolean, githubSlug: string | null, apiUrl: string, source: string, accessToken?: string): string;
|
7
|
-
export declare function getNxCloudVersion(apiUrl: string): Promise<string | null>;
|
8
|
-
export declare function removeVersionModifier(versionString: string): string;
|
9
|
-
export declare function versionIsValid(version: string): boolean;
|
10
|
-
export declare function isOldNxCloudVersion(version: string): boolean;
|
@@ -3,10 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createNxCloudOnboardingURL = createNxCloudOnboardingURL;
|
4
4
|
exports.repoUsesGithub = repoUsesGithub;
|
5
5
|
exports.getURLifShortenFailed = getURLifShortenFailed;
|
6
|
-
exports.getNxCloudVersion = getNxCloudVersion;
|
7
|
-
exports.removeVersionModifier = removeVersionModifier;
|
8
|
-
exports.versionIsValid = versionIsValid;
|
9
|
-
exports.isOldNxCloudVersion = isOldNxCloudVersion;
|
10
6
|
const logger_1 = require("../../utils/logger");
|
11
7
|
const git_utils_1 = require("../../utils/git-utils");
|
12
8
|
const get_cloud_options_1 = require("./get-cloud-options");
|
@@ -19,17 +15,6 @@ async function createNxCloudOnboardingURL(onboardingSource, accessToken, usesGit
|
|
19
15
|
if (usesGithub === undefined || usesGithub === null) {
|
20
16
|
usesGithub = await repoUsesGithub(undefined, githubSlug, apiUrl);
|
21
17
|
}
|
22
|
-
try {
|
23
|
-
const version = await getNxCloudVersion(apiUrl);
|
24
|
-
if (!version || isOldNxCloudVersion(version)) {
|
25
|
-
return apiUrl;
|
26
|
-
}
|
27
|
-
}
|
28
|
-
catch (e) {
|
29
|
-
logger_1.logger.verbose(`Failed to get Nx Cloud version.
|
30
|
-
${e}`);
|
31
|
-
return apiUrl;
|
32
|
-
}
|
33
18
|
const source = getSource(onboardingSource);
|
34
19
|
try {
|
35
20
|
const response = await require('axios').post(`${apiUrl}/nx-cloud/onboarding`, {
|
@@ -80,7 +65,7 @@ function getURLifShortenFailed(usesGithub, githubSlug, apiUrl, source, accessTok
|
|
80
65
|
return `${apiUrl}/setup/connect-workspace/github/connect?name=${encodeURIComponent(githubSlug)}&source=${source}`;
|
81
66
|
}
|
82
67
|
else {
|
83
|
-
return `${apiUrl}/setup/connect-workspace/github/select
|
68
|
+
return `${apiUrl}/setup/connect-workspace/github/select?source=${source}`;
|
84
69
|
}
|
85
70
|
}
|
86
71
|
return `${apiUrl}/setup/connect-workspace/manual?accessToken=${accessToken}&source=${source}`;
|
@@ -101,57 +86,3 @@ async function getInstallationSupportsGitHub(apiUrl) {
|
|
101
86
|
return false;
|
102
87
|
}
|
103
88
|
}
|
104
|
-
async function getNxCloudVersion(apiUrl) {
|
105
|
-
try {
|
106
|
-
const response = await require('axios').get(`${apiUrl}/nx-cloud/system/version`);
|
107
|
-
const version = removeVersionModifier(response.data.version);
|
108
|
-
const isValid = versionIsValid(version);
|
109
|
-
if (!version) {
|
110
|
-
throw new Error('Failed to extract version from response.');
|
111
|
-
}
|
112
|
-
if (!isValid) {
|
113
|
-
throw new Error(`Invalid version format: ${version}`);
|
114
|
-
}
|
115
|
-
return version;
|
116
|
-
}
|
117
|
-
catch (e) {
|
118
|
-
logger_1.logger.verbose(`Failed to get version of Nx Cloud.
|
119
|
-
${e}`);
|
120
|
-
return null;
|
121
|
-
}
|
122
|
-
}
|
123
|
-
function removeVersionModifier(versionString) {
|
124
|
-
// Cloud version string is in the format of YYMM.DD.BuildNumber-Modifier
|
125
|
-
return versionString.split(/[\.-]/).slice(0, 3).join('.');
|
126
|
-
}
|
127
|
-
function versionIsValid(version) {
|
128
|
-
// Updated Regex pattern to require YYMM.DD.BuildNumber format
|
129
|
-
// All parts are required, including the BuildNumber.
|
130
|
-
const pattern = /^\d{4}\.\d{2}\.\d+$/;
|
131
|
-
return pattern.test(version);
|
132
|
-
}
|
133
|
-
function isOldNxCloudVersion(version) {
|
134
|
-
const [major, minor, buildNumber] = version
|
135
|
-
.split('.')
|
136
|
-
.map((part) => parseInt(part, 10));
|
137
|
-
// for on-prem images we are using YYYY.MM.BuildNumber format
|
138
|
-
// the first year is 2025
|
139
|
-
if (major >= 2025 && major < 2300) {
|
140
|
-
return false;
|
141
|
-
}
|
142
|
-
// Previously we used YYMM.DD.BuildNumber
|
143
|
-
// All versions before '2406.11.5' had different URL shortening logic
|
144
|
-
const newVersionMajor = 2406;
|
145
|
-
const newVersionMinor = 11;
|
146
|
-
const newVersionBuildNumber = 5;
|
147
|
-
if (major !== newVersionMajor) {
|
148
|
-
return major < newVersionMajor;
|
149
|
-
}
|
150
|
-
if (minor !== newVersionMinor) {
|
151
|
-
return minor < newVersionMinor;
|
152
|
-
}
|
153
|
-
if (buildNumber !== newVersionBuildNumber) {
|
154
|
-
return buildNumber < newVersionBuildNumber;
|
155
|
-
}
|
156
|
-
return false;
|
157
|
-
}
|