nx 21.4.0-beta.1 → 21.4.0-beta.11
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/.eslintrc.json +2 -0
- package/bin/nx.js +6 -6
- package/bin/post-install.js +8 -22
- package/package.json +12 -11
- package/schemas/nx-schema.json +99 -1
- package/src/adapter/compat.d.ts +2 -2
- package/src/adapter/compat.d.ts.map +1 -1
- package/src/adapter/compat.js +3 -0
- package/src/command-line/graph/graph.d.ts.map +1 -1
- package/src/command-line/graph/graph.js +152 -45
- package/src/command-line/init/implementation/utils.d.ts.map +1 -1
- package/src/command-line/init/implementation/utils.js +1 -2
- package/src/command-line/mcp/command-object.d.ts +3 -0
- package/src/command-line/mcp/command-object.d.ts.map +1 -0
- package/src/command-line/mcp/command-object.js +28 -0
- package/src/command-line/mcp/mcp.d.ts +3 -0
- package/src/command-line/mcp/mcp.d.ts.map +1 -0
- package/src/command-line/mcp/mcp.js +23 -0
- package/src/command-line/migrate/migrate-ui-api.d.ts.map +1 -1
- package/src/command-line/migrate/migrate-ui-api.js +18 -8
- package/src/command-line/nx-cloud/connect/command-object.d.ts.map +1 -1
- package/src/command-line/nx-cloud/connect/command-object.js +2 -1
- package/src/command-line/nx-cloud/connect/connect-to-nx-cloud.d.ts +1 -0
- package/src/command-line/nx-cloud/connect/connect-to-nx-cloud.d.ts.map +1 -1
- package/src/command-line/nx-cloud/connect/connect-to-nx-cloud.js +19 -5
- package/src/command-line/nx-cloud/connect/view-logs.d.ts.map +1 -1
- package/src/command-line/nx-cloud/connect/view-logs.js +3 -5
- package/src/command-line/nx-commands.d.ts.map +1 -1
- package/src/command-line/nx-commands.js +2 -0
- package/src/command-line/release/changelog.d.ts.map +1 -1
- package/src/command-line/release/changelog.js +7 -2
- package/src/command-line/release/command-object.d.ts +7 -2
- package/src/command-line/release/command-object.d.ts.map +1 -1
- package/src/command-line/release/command-object.js +22 -4
- package/src/command-line/release/config/config.d.ts +10 -3
- package/src/command-line/release/config/config.d.ts.map +1 -1
- package/src/command-line/release/config/config.js +127 -15
- package/src/command-line/release/config/filter-release-groups.d.ts +5 -1
- package/src/command-line/release/config/filter-release-groups.d.ts.map +1 -1
- package/src/command-line/release/publish.js +13 -1
- package/src/command-line/release/release.d.ts.map +1 -1
- package/src/command-line/release/release.js +10 -2
- package/src/command-line/release/utils/resolve-nx-json-error-message.js +1 -1
- package/src/command-line/release/utils/shared.d.ts +9 -0
- package/src/command-line/release/utils/shared.d.ts.map +1 -1
- package/src/command-line/release/utils/shared.js +25 -4
- package/src/command-line/release/version/project-logger.d.ts.map +1 -1
- package/src/command-line/release/version/project-logger.js +1 -0
- package/src/command-line/release/version/release-group-processor.d.ts +6 -1
- package/src/command-line/release/version/release-group-processor.d.ts.map +1 -1
- package/src/command-line/release/version/release-group-processor.js +73 -3
- package/src/command-line/release/version/version-actions.d.ts +21 -0
- package/src/command-line/release/version/version-actions.d.ts.map +1 -1
- package/src/command-line/release/version/version-actions.js +32 -1
- package/src/command-line/release/version.d.ts.map +1 -1
- package/src/command-line/release/version.js +42 -11
- package/src/config/nx-json.d.ts +58 -0
- package/src/config/nx-json.d.ts.map +1 -1
- package/src/config/workspace-json-project-json.d.ts +2 -1
- package/src/config/workspace-json-project-json.d.ts.map +1 -1
- package/src/core/graph/main.js +1 -1
- package/src/core/graph/styles.css +1 -1
- package/src/core/graph/styles.js +1 -1
- package/src/native/nx.wasm32-wasi.wasm +0 -0
- package/src/nx-cloud/generators/connect-to-nx-cloud/connect-to-nx-cloud.d.ts +1 -1
- package/src/nx-cloud/generators/connect-to-nx-cloud/connect-to-nx-cloud.d.ts.map +1 -1
- package/src/nx-cloud/generators/connect-to-nx-cloud/connect-to-nx-cloud.js +5 -3
- package/src/nx-cloud/utilities/onboarding.d.ts.map +1 -1
- package/src/nx-cloud/utilities/onboarding.js +1 -1
- package/src/nx-cloud/utilities/url-shorten.d.ts +1 -2
- package/src/nx-cloud/utilities/url-shorten.d.ts.map +1 -1
- package/src/nx-cloud/utilities/url-shorten.js +17 -21
- package/src/plugins/js/index.d.ts.map +1 -1
- package/src/plugins/js/index.js +10 -16
- package/src/plugins/js/lock-file/bun-parser.d.ts +15 -0
- package/src/plugins/js/lock-file/bun-parser.d.ts.map +1 -0
- package/src/plugins/js/lock-file/bun-parser.js +964 -0
- package/src/plugins/js/lock-file/lock-file.d.ts +2 -2
- package/src/plugins/js/lock-file/lock-file.d.ts.map +1 -1
- package/src/plugins/js/lock-file/lock-file.js +40 -17
- package/src/plugins/js/lock-file/project-graph-pruning.d.ts.map +1 -1
- package/src/plugins/js/lock-file/project-graph-pruning.js +3 -1
- package/src/plugins/js/package-json/create-package-json.d.ts.map +1 -1
- package/src/plugins/js/package-json/create-package-json.js +6 -4
- package/src/project-graph/plugins/public-api.d.ts +2 -0
- package/src/project-graph/plugins/public-api.d.ts.map +1 -1
- package/src/tasks-runner/life-cycles/dynamic-run-many-terminal-output-life-cycle.d.ts.map +1 -1
- package/src/tasks-runner/life-cycles/dynamic-run-many-terminal-output-life-cycle.js +15 -6
- package/src/tasks-runner/life-cycles/dynamic-run-one-terminal-output-life-cycle.d.ts.map +1 -1
- package/src/tasks-runner/life-cycles/dynamic-run-one-terminal-output-life-cycle.js +10 -4
- package/src/tasks-runner/life-cycles/static-run-many-terminal-output-life-cycle.d.ts.map +1 -1
- package/src/tasks-runner/life-cycles/static-run-many-terminal-output-life-cycle.js +5 -2
- package/src/tasks-runner/life-cycles/task-history-life-cycle-old.js +1 -1
- package/src/tasks-runner/life-cycles/task-history-life-cycle.d.ts +1 -1
- package/src/tasks-runner/life-cycles/task-history-life-cycle.d.ts.map +1 -1
- package/src/tasks-runner/life-cycles/task-history-life-cycle.js +7 -12
- package/src/tasks-runner/life-cycles/tui-summary-life-cycle.d.ts.map +1 -1
- package/src/tasks-runner/life-cycles/tui-summary-life-cycle.js +21 -9
- package/src/tasks-runner/run-command.d.ts.map +1 -1
- package/src/tasks-runner/run-command.js +4 -3
- package/src/utils/ab-testing.d.ts +1 -1
- package/src/utils/ab-testing.d.ts.map +1 -1
- package/src/utils/ab-testing.js +1 -1
- package/src/utils/git-utils.d.ts +6 -5
- package/src/utils/git-utils.d.ts.map +1 -1
- package/src/utils/git-utils.js +73 -41
- package/src/utils/nx-cloud-utils.d.ts.map +1 -1
- package/src/utils/nx-cloud-utils.js +5 -2
package/src/utils/git-utils.js
CHANGED
@@ -2,8 +2,8 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.GitRepository = void 0;
|
4
4
|
exports.cloneFromUpstream = cloneFromUpstream;
|
5
|
-
exports.
|
6
|
-
exports.
|
5
|
+
exports.parseVcsRemoteUrl = parseVcsRemoteUrl;
|
6
|
+
exports.getVcsRemoteInfo = getVcsRemoteInfo;
|
7
7
|
exports.commitChanges = commitChanges;
|
8
8
|
exports.getLatestCommitSha = getLatestCommitSha;
|
9
9
|
const child_process_1 = require("child_process");
|
@@ -170,55 +170,87 @@ class GitRepository {
|
|
170
170
|
}
|
171
171
|
}
|
172
172
|
exports.GitRepository = GitRepository;
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
173
|
+
function parseVcsRemoteUrl(url) {
|
174
|
+
// Remove whitespace and handle common URL formats
|
175
|
+
const cleanUrl = url.trim();
|
176
|
+
// SSH format: git@domain:owner/repo.git
|
177
|
+
const sshMatch = cleanUrl.match(/^git@([^:]+):([^\/]+)\/(.+?)(\.git)?$/);
|
178
|
+
if (sshMatch) {
|
179
|
+
const [, domain, owner, repo] = sshMatch;
|
180
|
+
return {
|
181
|
+
domain,
|
182
|
+
slug: `${owner}/${repo}`,
|
183
|
+
};
|
184
|
+
}
|
185
|
+
// HTTPS with authentication: https://user@domain/owner/repo.git
|
186
|
+
const httpsAuthMatch = cleanUrl.match(/^https?:\/\/[^@]+@([^\/]+)\/([^\/]+)\/(.+?)(\.git)?$/);
|
187
|
+
if (httpsAuthMatch) {
|
188
|
+
const [, domain, owner, repo] = httpsAuthMatch;
|
189
|
+
return {
|
190
|
+
domain,
|
191
|
+
slug: `${owner}/${repo}`,
|
192
|
+
};
|
193
|
+
}
|
194
|
+
// HTTPS format: https://domain/owner/repo.git (without authentication)
|
195
|
+
const httpsMatch = cleanUrl.match(/^https?:\/\/([^@\/]+)\/([^\/]+)\/(.+?)(\.git)?$/);
|
196
|
+
if (httpsMatch) {
|
197
|
+
const [, domain, owner, repo] = httpsMatch;
|
198
|
+
return {
|
199
|
+
domain,
|
200
|
+
slug: `${owner}/${repo}`,
|
201
|
+
};
|
202
|
+
}
|
203
|
+
// SSH alternative format: ssh://git@domain/owner/repo.git or ssh://git@domain:port/owner/repo.git
|
204
|
+
const sshAltMatch = cleanUrl.match(/^ssh:\/\/[^@]+@([^:\/]+)(:[0-9]+)?\/([^\/]+)\/(.+?)(\.git)?$/);
|
205
|
+
if (sshAltMatch) {
|
206
|
+
const [, domain, , owner, repo] = sshAltMatch;
|
207
|
+
return {
|
208
|
+
domain,
|
209
|
+
slug: `${owner}/${repo}`,
|
210
|
+
};
|
211
|
+
}
|
212
|
+
return null;
|
213
|
+
}
|
214
|
+
function getVcsRemoteInfo() {
|
177
215
|
try {
|
178
216
|
const gitRemote = (0, child_process_1.execSync)('git remote -v', {
|
179
217
|
stdio: 'pipe',
|
180
218
|
windowsHide: false,
|
181
|
-
})
|
182
|
-
|
219
|
+
})
|
220
|
+
.toString()
|
221
|
+
.trim();
|
183
222
|
if (!gitRemote || gitRemote.length === 0) {
|
184
|
-
return
|
223
|
+
return null;
|
185
224
|
}
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
foundRemotes[remoteName] = url;
|
203
|
-
if (!firstGitHubUrl) {
|
204
|
-
firstGitHubUrl = url;
|
225
|
+
const lines = gitRemote.split('\n').filter((line) => line.trim());
|
226
|
+
const remotesPriority = ['origin', 'upstream', 'base'];
|
227
|
+
const foundRemotes = {};
|
228
|
+
let firstRemote = null;
|
229
|
+
for (const line of lines) {
|
230
|
+
const match = line.trim().match(/^(\w+)\s+(\S+)\s+\((fetch|push)\)$/);
|
231
|
+
if (match) {
|
232
|
+
const [, remoteName, url] = match;
|
233
|
+
const remoteInfo = parseVcsRemoteUrl(url);
|
234
|
+
if (remoteInfo && !foundRemotes[remoteName]) {
|
235
|
+
foundRemotes[remoteName] = remoteInfo;
|
236
|
+
if (!firstRemote) {
|
237
|
+
firstRemote = remoteInfo;
|
238
|
+
}
|
239
|
+
}
|
240
|
+
}
|
205
241
|
}
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
242
|
+
// Return high-priority remote if found
|
243
|
+
for (const remote of remotesPriority) {
|
244
|
+
if (foundRemotes[remote]) {
|
245
|
+
return foundRemotes[remote];
|
246
|
+
}
|
210
247
|
}
|
248
|
+
// Return first found remote
|
249
|
+
return firstRemote;
|
211
250
|
}
|
212
|
-
|
213
|
-
|
214
|
-
function parseGitHubUrl(url) {
|
215
|
-
const sshPattern = /git@github\.com:([A-Za-z0-9_.-]+)\/([A-Za-z0-9_.-]+)\.git/;
|
216
|
-
const httpsPattern = /https:\/\/github\.com\/([A-Za-z0-9_.-]+)\/([A-Za-z0-9_.-]+)\.git/;
|
217
|
-
let match = url.match(sshPattern) || url.match(httpsPattern);
|
218
|
-
if (match) {
|
219
|
-
return `${match[1]}/${match[2]}`;
|
251
|
+
catch (e) {
|
252
|
+
return null;
|
220
253
|
}
|
221
|
-
return null;
|
222
254
|
}
|
223
255
|
function commitChanges(commitMessage, directory) {
|
224
256
|
try {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"nx-cloud-utils.d.ts","sourceRoot":"","sources":["../../../../../packages/nx/src/utils/nx-cloud-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAExD,wBAAgB,aAAa,CAAC,MAAM,EAAE,mBAAmB,GAAG,OAAO,
|
1
|
+
{"version":3,"file":"nx-cloud-utils.d.ts","sourceRoot":"","sources":["../../../../../packages/nx/src/utils/nx-cloud-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAExD,wBAAgB,aAAa,CAAC,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAclE;AAED,wBAAgB,aAAa,CAAC,MAAM,EAAE,mBAAmB,GAAG,MAAM,CAejE"}
|
@@ -6,7 +6,8 @@ function isNxCloudUsed(nxJson) {
|
|
6
6
|
if (process.env.NX_NO_CLOUD === 'true' || nxJson.neverConnectToCloud) {
|
7
7
|
return false;
|
8
8
|
}
|
9
|
-
return (!!process.env.
|
9
|
+
return (!!process.env.NX_CLOUD_AUTH_TOKEN ||
|
10
|
+
!!process.env.NX_CLOUD_ACCESS_TOKEN ||
|
10
11
|
!!nxJson.nxCloudAccessToken ||
|
11
12
|
!!nxJson.nxCloudId ||
|
12
13
|
!!Object.values(nxJson.tasksRunnerOptions ?? {}).find((r) => r.runner == '@nrwl/nx-cloud' || r.runner == 'nx-cloud'));
|
@@ -14,7 +15,9 @@ function isNxCloudUsed(nxJson) {
|
|
14
15
|
function getNxCloudUrl(nxJson) {
|
15
16
|
const cloudRunner = Object.values(nxJson.tasksRunnerOptions ?? {}).find((r) => r.runner == '@nrwl/nx-cloud' || r.runner == 'nx-cloud');
|
16
17
|
if (!cloudRunner &&
|
17
|
-
!(nxJson.nxCloudAccessToken ||
|
18
|
+
!(nxJson.nxCloudAccessToken ||
|
19
|
+
process.env.NX_CLOUD_AUTH_TOKEN ||
|
20
|
+
process.env.NX_CLOUD_ACCESS_TOKEN) &&
|
18
21
|
!nxJson.nxCloudId)
|
19
22
|
throw new Error('nx-cloud runner not found in nx.json');
|
20
23
|
return cloudRunner?.options?.url ?? nxJson.nxCloudUrl ?? 'https://nx.app';
|