nx 22.5.0-beta.2 → 22.5.0-beta.4
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/README.md +3 -3
- package/package.json +13 -13
- package/src/ai/constants.d.ts +1 -0
- package/src/ai/constants.d.ts.map +1 -1
- package/src/ai/constants.js +4 -0
- package/src/ai/set-up-ai-agents/set-up-ai-agents.d.ts.map +1 -1
- package/src/ai/set-up-ai-agents/set-up-ai-agents.js +22 -0
- package/src/command-line/configure-ai-agents/configure-ai-agents.d.ts.map +1 -1
- package/src/command-line/configure-ai-agents/configure-ai-agents.js +77 -43
- package/src/command-line/nx-commands.js +1 -1
- package/src/command-line/release/changelog/version-plan-filtering.d.ts +6 -3
- package/src/command-line/release/changelog/version-plan-filtering.d.ts.map +1 -1
- package/src/command-line/release/changelog/version-plan-filtering.js +4 -3
- package/src/command-line/release/changelog.d.ts.map +1 -1
- package/src/command-line/release/changelog.js +11 -9
- package/src/command-line/release/utils/git.d.ts +3 -2
- package/src/command-line/release/utils/git.d.ts.map +1 -1
- package/src/command-line/release/utils/git.js +3 -69
- package/src/command-line/release/utils/release-graph.d.ts +10 -0
- package/src/command-line/release/utils/release-graph.d.ts.map +1 -1
- package/src/command-line/release/utils/release-graph.js +32 -1
- package/src/command-line/release/utils/repository-git-tags.d.ts +26 -0
- package/src/command-line/release/utils/repository-git-tags.d.ts.map +1 -0
- package/src/command-line/release/utils/repository-git-tags.js +125 -0
- package/src/command-line/release/utils/resolve-semver-specifier.d.ts +2 -1
- package/src/command-line/release/utils/resolve-semver-specifier.d.ts.map +1 -1
- package/src/command-line/release/utils/resolve-semver-specifier.js +2 -2
- package/src/command-line/release/utils/shared.d.ts +3 -2
- package/src/command-line/release/utils/shared.d.ts.map +1 -1
- package/src/command-line/release/utils/shared.js +4 -10
- package/src/command-line/release/version/derive-specifier-from-conventional-commits.d.ts +2 -1
- package/src/command-line/release/version/derive-specifier-from-conventional-commits.d.ts.map +1 -1
- package/src/command-line/release/version/derive-specifier-from-conventional-commits.js +2 -2
- package/src/command-line/release/version/release-group-processor.d.ts.map +1 -1
- package/src/command-line/release/version/release-group-processor.js +1 -1
- package/src/command-line/run/run-one.d.ts +1 -1
- package/src/command-line/run/run-one.d.ts.map +1 -1
- package/src/command-line/run/run-one.js +12 -9
- package/src/core/graph/main.js +1 -1
- package/src/daemon/client/client.js +4 -4
- package/src/daemon/server/server.d.ts.map +1 -1
- package/src/daemon/server/server.js +3 -2
- package/src/daemon/server/shutdown-utils.d.ts.map +1 -1
- package/src/daemon/server/shutdown-utils.js +1 -1
- package/src/executors/run-commands/running-tasks.d.ts.map +1 -1
- package/src/executors/run-commands/running-tasks.js +4 -4
- package/src/hasher/hash-task.d.ts +3 -3
- package/src/hasher/hash-task.d.ts.map +1 -1
- package/src/hasher/hash-task.js +24 -5
- package/src/hasher/native-task-hasher-impl.d.ts +1 -1
- package/src/hasher/native-task-hasher-impl.d.ts.map +1 -1
- package/src/hasher/native-task-hasher-impl.js +2 -2
- package/src/hasher/task-hasher.d.ts +4 -1
- package/src/hasher/task-hasher.d.ts.map +1 -1
- package/src/hasher/task-hasher.js +1 -0
- package/src/native/index.d.ts +18 -2
- package/src/native/nx.wasi.cjs +29 -28
- package/src/native/nx.wasm32-wasi.wasm +0 -0
- package/src/project-graph/plugins/get-plugins.d.ts.map +1 -1
- package/src/project-graph/plugins/get-plugins.js +81 -11
- package/src/project-graph/plugins/isolation/plugin-pool.d.ts.map +1 -1
- package/src/project-graph/plugins/isolation/plugin-pool.js +78 -27
- package/src/project-graph/plugins/isolation/plugin-worker.js +33 -17
- package/src/project-graph/project-graph.js +1 -1
- package/src/tasks-runner/cache.d.ts +2 -2
- package/src/tasks-runner/cache.d.ts.map +1 -1
- package/src/tasks-runner/cache.js +14 -11
- package/src/tasks-runner/forked-process-task-runner.d.ts +3 -3
- package/src/tasks-runner/forked-process-task-runner.d.ts.map +1 -1
- package/src/tasks-runner/forked-process-task-runner.js +12 -11
- package/src/tasks-runner/process-metrics-service.d.ts +2 -2
- package/src/tasks-runner/process-metrics-service.d.ts.map +1 -1
- package/src/tasks-runner/process-metrics-service.js +2 -2
- package/src/tasks-runner/run-command.d.ts.map +1 -1
- package/src/tasks-runner/task-io-service.d.ts +97 -0
- package/src/tasks-runner/task-io-service.d.ts.map +1 -0
- package/src/tasks-runner/task-io-service.js +146 -0
- package/src/utils/consume-messages-from-socket.d.ts.map +1 -1
- package/src/utils/consume-messages-from-socket.js +3 -1
- package/src/utils/promised-based-queue.d.ts +0 -7
- package/src/utils/promised-based-queue.d.ts.map +1 -1
- package/src/utils/promised-based-queue.js +0 -9
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<p style="text-align: center;">
|
|
2
2
|
<picture>
|
|
3
3
|
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-dark.svg">
|
|
4
|
-
<img alt="Nx - Smart
|
|
4
|
+
<img alt="Nx - Smart Monorepos · Fast Builds" src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-light.svg" width="100%">
|
|
5
5
|
</picture>
|
|
6
6
|
</p>
|
|
7
7
|
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
|
|
21
21
|
<hr>
|
|
22
22
|
|
|
23
|
-
# Nx: Smart
|
|
23
|
+
# Nx: Smart Monorepos · Fast Builds
|
|
24
24
|
|
|
25
25
|
Get to green PRs in half the time. Nx optimizes your builds, scales your CI, and fixes failed PRs. Built for developers and AI agents.
|
|
26
26
|
|
|
@@ -62,5 +62,5 @@ npx nx@latest init
|
|
|
62
62
|
- [Blog Posts About Nx](https://nx.dev/blog)
|
|
63
63
|
|
|
64
64
|
<p style="text-align: center;"><a href="https://nx.dev/#learning-materials" target="_blank" rel="noreferrer"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-courses-and-videos.svg"
|
|
65
|
-
width="100%" alt="Nx - Smart
|
|
65
|
+
width="100%" alt="Nx - Smart Monorepos · Fast Builds"></a></p>
|
|
66
66
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nx",
|
|
3
|
-
"version": "22.5.0-beta.
|
|
3
|
+
"version": "22.5.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": {
|
|
@@ -72,8 +72,8 @@
|
|
|
72
72
|
"yargs-parser": "21.1.1"
|
|
73
73
|
},
|
|
74
74
|
"peerDependencies": {
|
|
75
|
-
"@swc-node/register": "
|
|
76
|
-
"@swc/core": "
|
|
75
|
+
"@swc-node/register": "1.11.1",
|
|
76
|
+
"@swc/core": "1.15.8"
|
|
77
77
|
},
|
|
78
78
|
"peerDependenciesMeta": {
|
|
79
79
|
"@swc-node/register": {
|
|
@@ -84,16 +84,16 @@
|
|
|
84
84
|
}
|
|
85
85
|
},
|
|
86
86
|
"optionalDependencies": {
|
|
87
|
-
"@nx/nx-darwin-arm64": "22.5.0-beta.
|
|
88
|
-
"@nx/nx-darwin-x64": "22.5.0-beta.
|
|
89
|
-
"@nx/nx-freebsd-x64": "22.5.0-beta.
|
|
90
|
-
"@nx/nx-linux-arm-gnueabihf": "22.5.0-beta.
|
|
91
|
-
"@nx/nx-linux-arm64-gnu": "22.5.0-beta.
|
|
92
|
-
"@nx/nx-linux-arm64-musl": "22.5.0-beta.
|
|
93
|
-
"@nx/nx-linux-x64-gnu": "22.5.0-beta.
|
|
94
|
-
"@nx/nx-linux-x64-musl": "22.5.0-beta.
|
|
95
|
-
"@nx/nx-win32-arm64-msvc": "22.5.0-beta.
|
|
96
|
-
"@nx/nx-win32-x64-msvc": "22.5.0-beta.
|
|
87
|
+
"@nx/nx-darwin-arm64": "22.5.0-beta.4",
|
|
88
|
+
"@nx/nx-darwin-x64": "22.5.0-beta.4",
|
|
89
|
+
"@nx/nx-freebsd-x64": "22.5.0-beta.4",
|
|
90
|
+
"@nx/nx-linux-arm-gnueabihf": "22.5.0-beta.4",
|
|
91
|
+
"@nx/nx-linux-arm64-gnu": "22.5.0-beta.4",
|
|
92
|
+
"@nx/nx-linux-arm64-musl": "22.5.0-beta.4",
|
|
93
|
+
"@nx/nx-linux-x64-gnu": "22.5.0-beta.4",
|
|
94
|
+
"@nx/nx-linux-x64-musl": "22.5.0-beta.4",
|
|
95
|
+
"@nx/nx-win32-arm64-msvc": "22.5.0-beta.4",
|
|
96
|
+
"@nx/nx-win32-x64-msvc": "22.5.0-beta.4"
|
|
97
97
|
},
|
|
98
98
|
"nx-migrations": {
|
|
99
99
|
"migrations": "./migrations.json",
|
package/src/ai/constants.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export declare function geminiMdPath(root: string): string;
|
|
|
3
3
|
export declare function parseGeminiSettings(root: string): any | undefined;
|
|
4
4
|
export declare function geminiSettingsPath(root: string): string;
|
|
5
5
|
export declare function claudeMdPath(root: string): string;
|
|
6
|
+
export declare function claudeMcpJsonPath(root: string): string;
|
|
6
7
|
export declare function opencodeMcpPath(root: string): string;
|
|
7
8
|
export declare const codexConfigTomlPath: string;
|
|
8
9
|
export declare const nxRulesMarkerCommentStart = "<!-- nx configuration start-->";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../packages/nx/src/ai/constants.ts"],"names":[],"mappings":"AAMA,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEjD;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEjD;AAED,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,GAAG,GAAG,SAAS,CAOjE;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEvD;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEjD;AAED,wBAAgB,eAA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9D,CAAC;AAEF,eAAO,MAAM,eAAe,6BAA2B,CAAC;AAExD;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAQ5D"}
|
package/src/ai/constants.js
CHANGED
|
@@ -6,6 +6,7 @@ exports.geminiMdPath = geminiMdPath;
|
|
|
6
6
|
exports.parseGeminiSettings = parseGeminiSettings;
|
|
7
7
|
exports.geminiSettingsPath = geminiSettingsPath;
|
|
8
8
|
exports.claudeMdPath = claudeMdPath;
|
|
9
|
+
exports.claudeMcpJsonPath = claudeMcpJsonPath;
|
|
9
10
|
exports.opencodeMcpPath = opencodeMcpPath;
|
|
10
11
|
exports.getNxMcpTomlConfig = getNxMcpTomlConfig;
|
|
11
12
|
const os_1 = require("os");
|
|
@@ -34,6 +35,9 @@ function geminiSettingsPath(root) {
|
|
|
34
35
|
function claudeMdPath(root) {
|
|
35
36
|
return (0, path_1.join)(root, 'CLAUDE.md');
|
|
36
37
|
}
|
|
38
|
+
function claudeMcpJsonPath(root) {
|
|
39
|
+
return (0, path_1.join)(root, '.mcp.json');
|
|
40
|
+
}
|
|
37
41
|
function opencodeMcpPath(root) {
|
|
38
42
|
return (0, path_1.join)(root, 'opencode.json');
|
|
39
43
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"set-up-ai-agents.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/ai/set-up-ai-agents/set-up-ai-agents.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAS7C,OAAO,EACL,qBAAqB,EACrB,oBAAoB,EACrB,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"set-up-ai-agents.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/ai/set-up-ai-agents/set-up-ai-agents.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAS7C,OAAO,EACL,qBAAqB,EACrB,oBAAoB,EACrB,MAAM,oBAAoB,CAAC;AAyB5B,OAAO,EACL,sCAAsC,EACtC,4BAA4B,EAC7B,MAAM,UAAU,CAAC;AAElB,MAAM,MAAM,mBAAmB,GAAG;IAChC,QAAQ,EAAE,oBAAoB,EAAE,CAAC;IACjC,MAAM,EAAE,qBAAqB,EAAE,CAAC;CACjC,CAAC;AAmCF,wBAAsB,sBAAsB,CAC1C,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,4BAA4B,EACrC,KAAK,UAAQ,GACZ,OAAO,CAAC,CAAC,KAAK,CAAC,EAAE,OAAO,KAAK,OAAO,CAAC,mBAAmB,CAAC,CAAC,CAmC5D;AAaD,wBAAsB,0BAA0B,CAC9C,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,sCAAsC,GAC9C,OAAO,CAAC,MAAM,OAAO,CAAC,mBAAmB,CAAC,CAAC,CA4O7C;AAkFD,eAAe,sBAAsB,CAAC"}
|
|
@@ -108,6 +108,28 @@ async function setupAiAgentsGeneratorImpl(tree, options) {
|
|
|
108
108
|
'nx@nx-claude-plugins': true,
|
|
109
109
|
},
|
|
110
110
|
}));
|
|
111
|
+
// Clean up .mcp.json (nx-mcp now handled by plugin)
|
|
112
|
+
const mcpJsonPath = (0, constants_1.claudeMcpJsonPath)(options.directory);
|
|
113
|
+
if (tree.exists(mcpJsonPath)) {
|
|
114
|
+
try {
|
|
115
|
+
const mcpJsonContents = (0, json_1.readJson)(tree, mcpJsonPath);
|
|
116
|
+
if (mcpJsonContents?.mcpServers?.['nx-mcp']) {
|
|
117
|
+
const serverKeys = Object.keys(mcpJsonContents.mcpServers || {});
|
|
118
|
+
if (serverKeys.length === 1 && serverKeys[0] === 'nx-mcp') {
|
|
119
|
+
// nx-mcp is the only server, delete the file
|
|
120
|
+
tree.delete(mcpJsonPath);
|
|
121
|
+
}
|
|
122
|
+
else {
|
|
123
|
+
// Other servers exist, just remove nx-mcp entry
|
|
124
|
+
delete mcpJsonContents.mcpServers['nx-mcp'];
|
|
125
|
+
(0, json_1.writeJson)(tree, mcpJsonPath, mcpJsonContents);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
catch {
|
|
130
|
+
// Ignore errors reading .mcp.json
|
|
131
|
+
}
|
|
132
|
+
}
|
|
111
133
|
}
|
|
112
134
|
if (hasAgent('opencode')) {
|
|
113
135
|
const opencodeMcpJsonPath = (0, constants_1.opencodeMcpPath)(options.directory);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configure-ai-agents.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/command-line/configure-ai-agents/configure-ai-agents.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"configure-ai-agents.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/command-line/configure-ai-agents/configure-ai-agents.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AAK5D,wBAAsB,wBAAwB,CAC5C,IAAI,EAAE,wBAAwB,EAC9B,KAAK,UAAQ,GACZ,OAAO,CAAC,IAAI,CAAC,CAmCf;AAED,wBAAsB,4BAA4B,CAChD,OAAO,EAAE,wBAAwB,GAChC,OAAO,CAAC,IAAI,CAAC,CA4Nf"}
|
|
@@ -7,10 +7,12 @@ const output_1 = require("../../utils/output");
|
|
|
7
7
|
const provenance_1 = require("../../utils/provenance");
|
|
8
8
|
const chalk = require("chalk");
|
|
9
9
|
const utils_1 = require("../../ai/utils");
|
|
10
|
+
const constants_1 = require("../../ai/constants");
|
|
10
11
|
const devkit_internals_1 = require("../../devkit-internals");
|
|
11
12
|
const workspace_root_1 = require("../../utils/workspace-root");
|
|
12
13
|
const ora = require("ora");
|
|
13
14
|
const path_1 = require("path");
|
|
15
|
+
const fs_1 = require("fs");
|
|
14
16
|
async function configureAiAgentsHandler(args, inner = false) {
|
|
15
17
|
// Use environment variable to force local execution
|
|
16
18
|
if (process.env.NX_USE_LOCAL === 'true' ||
|
|
@@ -169,18 +171,7 @@ async function configureAiAgentsHandlerImpl(options) {
|
|
|
169
171
|
required: true,
|
|
170
172
|
footer: function () {
|
|
171
173
|
const focused = this.focused;
|
|
172
|
-
|
|
173
|
-
return chalk.dim(focused.partialReason);
|
|
174
|
-
}
|
|
175
|
-
if (focused.agentConfiguration.outdated) {
|
|
176
|
-
return chalk.dim(` The rules file at ${focused.rulesDisplayPath} can be updated with the latest Nx recommendations`);
|
|
177
|
-
}
|
|
178
|
-
if (!focused.agentConfiguration.mcp &&
|
|
179
|
-
!focused.agentConfiguration.rules) {
|
|
180
|
-
return chalk.dim(` Configures agent rules at ${focused.rulesDisplayPath} and the Nx MCP server ${focused.mcpDisplayPath
|
|
181
|
-
? `at ${focused.mcpDisplayPath}`
|
|
182
|
-
: 'via Nx Console'}`);
|
|
183
|
-
}
|
|
174
|
+
return chalk.dim(` ${getAgentFooterDescription(focused.agentConfiguration)}`);
|
|
184
175
|
},
|
|
185
176
|
})).agents;
|
|
186
177
|
}
|
|
@@ -201,16 +192,18 @@ async function configureAiAgentsHandlerImpl(options) {
|
|
|
201
192
|
const configSpinner = ora(`Configuring agent(s)...`).start();
|
|
202
193
|
try {
|
|
203
194
|
await (0, utils_1.configureAgents)(selectedAgents, workspace_root_1.workspaceRoot, false);
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
195
|
+
// Combine all agent configurations for display
|
|
196
|
+
const allAgentConfigs = [
|
|
197
|
+
...nonConfiguredAgents,
|
|
198
|
+
...partiallyConfiguredAgents,
|
|
199
|
+
...fullyConfiguredAgents,
|
|
209
200
|
];
|
|
201
|
+
const configuredOrUpdatedAgents = allAgentConfigs.filter((a) => selectedAgents.includes(a.name) ||
|
|
202
|
+
fullyConfiguredAgents.some((f) => f.name === a.name));
|
|
210
203
|
configSpinner.stop();
|
|
211
|
-
output_1.output.
|
|
212
|
-
title: 'AI agents
|
|
213
|
-
bodyLines: configuredOrUpdatedAgents.map((agent) =>
|
|
204
|
+
output_1.output.success({
|
|
205
|
+
title: 'AI agents configured successfully',
|
|
206
|
+
bodyLines: configuredOrUpdatedAgents.map((agent) => `${agent.displayName}: ${getAgentConfiguredDescription(agent)}`),
|
|
214
207
|
});
|
|
215
208
|
return;
|
|
216
209
|
}
|
|
@@ -223,34 +216,75 @@ async function configureAiAgentsHandlerImpl(options) {
|
|
|
223
216
|
process.exit(1);
|
|
224
217
|
}
|
|
225
218
|
}
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
219
|
+
/**
|
|
220
|
+
* Get the verbose footer description for an agent.
|
|
221
|
+
* Describes the end state per agent type.
|
|
222
|
+
*/
|
|
223
|
+
function getAgentFooterDescription(agent) {
|
|
224
|
+
// Extract filename from rulesPath
|
|
225
|
+
const rulesFile = agent.rulesPath.split('/').pop() || 'AGENTS.md';
|
|
226
|
+
switch (agent.name) {
|
|
227
|
+
case 'claude': {
|
|
228
|
+
let description = `Installs Nx plugin (MCP + skills + agents). Updates ${rulesFile}.`;
|
|
229
|
+
// Check if .mcp.json exists with nx-mcp - if so, mention cleanup
|
|
230
|
+
const mcpJsonPath = (0, constants_1.claudeMcpJsonPath)(workspace_root_1.workspaceRoot);
|
|
231
|
+
if ((0, fs_1.existsSync)(mcpJsonPath)) {
|
|
232
|
+
try {
|
|
233
|
+
const mcpJsonContents = JSON.parse((0, fs_1.readFileSync)(mcpJsonPath, 'utf-8'));
|
|
234
|
+
if (mcpJsonContents?.mcpServers?.['nx-mcp']) {
|
|
235
|
+
description +=
|
|
236
|
+
' Removes nx-mcp from .mcp.json (now handled by plugin).';
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
catch {
|
|
240
|
+
// Ignore errors reading .mcp.json
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
return description;
|
|
244
|
+
}
|
|
245
|
+
case 'cursor':
|
|
246
|
+
case 'copilot':
|
|
247
|
+
return `Installs Nx Console (MCP). Adds skills and agents. Updates ${rulesFile}.`;
|
|
248
|
+
case 'gemini':
|
|
249
|
+
case 'opencode':
|
|
250
|
+
return `Configures MCP server. Adds skills and agents. Updates ${rulesFile}.`;
|
|
251
|
+
case 'codex':
|
|
252
|
+
return `Configures MCP server. Updates ${rulesFile}.`;
|
|
253
|
+
default:
|
|
254
|
+
return '';
|
|
231
255
|
}
|
|
232
|
-
|
|
233
|
-
|
|
256
|
+
}
|
|
257
|
+
/**
|
|
258
|
+
* Get a compact description of what was configured for an agent.
|
|
259
|
+
* Used in the post-configuration output.
|
|
260
|
+
*/
|
|
261
|
+
function getAgentConfiguredDescription(agent) {
|
|
262
|
+
// Extract filename from rulesPath
|
|
263
|
+
const rulesFile = agent.rulesPath.split('/').pop() || 'AGENTS.md';
|
|
264
|
+
switch (agent.name) {
|
|
265
|
+
case 'claude':
|
|
266
|
+
return `Nx plugin (MCP + skills + agents) + ${rulesFile}`;
|
|
267
|
+
case 'cursor':
|
|
268
|
+
case 'copilot':
|
|
269
|
+
return `Nx Console (MCP) + skills + ${rulesFile}`;
|
|
270
|
+
case 'gemini':
|
|
271
|
+
case 'opencode':
|
|
272
|
+
return `MCP + skills + ${rulesFile}`;
|
|
273
|
+
case 'codex':
|
|
274
|
+
return `MCP + ${rulesFile}`;
|
|
275
|
+
default:
|
|
276
|
+
return '';
|
|
234
277
|
}
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
const
|
|
239
|
-
? (0, path_1.relative)(workspace_root_1.workspaceRoot, agent.mcpPath)
|
|
240
|
-
: agent.mcpPath;
|
|
241
|
-
const partialReason = partiallyConfigured
|
|
242
|
-
? agent.rules
|
|
243
|
-
? ` Partially configured: MCP missing ${agent.mcpPath ? `at ${mcpDisplayPath}` : 'via Nx Console'}`
|
|
244
|
-
: ` Partially configured: rules file missing at ${rulesDisplayPath}`
|
|
245
|
-
: undefined;
|
|
278
|
+
}
|
|
279
|
+
function getAgentChoiceForPrompt(agent) {
|
|
280
|
+
const partiallyConfigured = agent.mcp !== agent.rules;
|
|
281
|
+
const needsUpdate = partiallyConfigured || agent.outdated;
|
|
246
282
|
return {
|
|
247
283
|
name: agent.name,
|
|
248
|
-
message
|
|
249
|
-
|
|
250
|
-
|
|
284
|
+
message: needsUpdate
|
|
285
|
+
? `${agent.displayName} (update available)`
|
|
286
|
+
: agent.displayName,
|
|
251
287
|
agentConfiguration: agent,
|
|
252
|
-
rulesDisplayPath,
|
|
253
|
-
mcpDisplayPath,
|
|
254
288
|
};
|
|
255
289
|
}
|
|
256
290
|
function normalizeOptions(options) {
|
|
@@ -51,7 +51,7 @@ exports.parserConfiguration = {
|
|
|
51
51
|
*/
|
|
52
52
|
exports.commandsObject = yargs
|
|
53
53
|
.parserConfiguration(exports.parserConfiguration)
|
|
54
|
-
.usage(chalk.bold('Smart
|
|
54
|
+
.usage(chalk.bold('Smart Monorepos · Fast Builds'))
|
|
55
55
|
.demandCommand(1, '')
|
|
56
56
|
.command(command_object_1.yargsRegisterCommand)
|
|
57
57
|
.command(command_object_22.yargsAddCommand)
|
|
@@ -2,6 +2,7 @@ import type { ChangelogOptions } from '../command-object';
|
|
|
2
2
|
import type { NxReleaseConfig } from '../config/config';
|
|
3
3
|
import { RawVersionPlan } from '../config/version-plans';
|
|
4
4
|
import type { VersionData } from '../utils/shared';
|
|
5
|
+
import type { CheckAllBranchesWhen, RepoGitTags } from '../utils/repository-git-tags';
|
|
5
6
|
/**
|
|
6
7
|
* Filters version plans to only include those that were committed between the specified SHAs
|
|
7
8
|
* @param versionPlans The raw version plans to filter
|
|
@@ -15,24 +16,26 @@ export declare function filterVersionPlansByCommitRange(versionPlans: RawVersion
|
|
|
15
16
|
* Resolves the "from SHA" for changelog purposes.
|
|
16
17
|
* This determines the starting point for changelog generation and optional version plan filtering.
|
|
17
18
|
*/
|
|
18
|
-
export declare function resolveChangelogFromSHA({ fromRef, tagPattern, tagPatternValues, checkAllBranchesWhen, preid, requireSemver, strictPreid, useAutomaticFromRef, }: {
|
|
19
|
+
export declare function resolveChangelogFromSHA({ fromRef, tagPattern, tagPatternValues, checkAllBranchesWhen, preid, requireSemver, strictPreid, useAutomaticFromRef, resolveRepositoryTags, }: {
|
|
19
20
|
fromRef?: string;
|
|
20
21
|
tagPattern: string;
|
|
21
22
|
tagPatternValues: Record<string, string>;
|
|
22
|
-
checkAllBranchesWhen:
|
|
23
|
+
checkAllBranchesWhen: CheckAllBranchesWhen;
|
|
23
24
|
preid?: string;
|
|
24
25
|
requireSemver: boolean;
|
|
25
26
|
strictPreid: boolean;
|
|
26
27
|
useAutomaticFromRef: boolean;
|
|
28
|
+
resolveRepositoryTags: RepoGitTags['resolveTags'];
|
|
27
29
|
}): Promise<string | null>;
|
|
28
30
|
/**
|
|
29
31
|
* Helper function for workspace-level "from SHA" resolution.
|
|
30
32
|
* Extracts preids and calls the generic resolver.
|
|
31
33
|
*/
|
|
32
|
-
export declare function resolveWorkspaceChangelogFromSHA({ args, nxReleaseConfig, useAutomaticFromRef, }: {
|
|
34
|
+
export declare function resolveWorkspaceChangelogFromSHA({ args, nxReleaseConfig, useAutomaticFromRef, resolveRepositoryTags, }: {
|
|
33
35
|
args: ChangelogOptions;
|
|
34
36
|
nxReleaseConfig: NxReleaseConfig;
|
|
35
37
|
useAutomaticFromRef: boolean;
|
|
38
|
+
resolveRepositoryTags: RepoGitTags['resolveTags'];
|
|
36
39
|
}): Promise<string | null>;
|
|
37
40
|
export declare function extractPreidFromVersion(version: string | null | undefined): string | undefined;
|
|
38
41
|
export declare function extractProjectsPreidFromVersionData(versionData: VersionData | undefined): Record<string, string | undefined> | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version-plan-filtering.d.ts","sourceRoot":"","sources":["../../../../../../../packages/nx/src/command-line/release/changelog/version-plan-filtering.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAOzD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"version-plan-filtering.d.ts","sourceRoot":"","sources":["../../../../../../../packages/nx/src/command-line/release/changelog/version-plan-filtering.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAOzD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,KAAK,EACV,oBAAoB,EACpB,WAAW,EACZ,MAAM,8BAA8B,CAAC;AAEtC;;;;;;;GAOG;AACH,wBAAsB,+BAA+B,CACnD,YAAY,EAAE,cAAc,EAAE,EAC9B,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,MAAM,EACb,SAAS,EAAE,OAAO,GACjB,OAAO,CAAC,cAAc,EAAE,CAAC,CAgC3B;AA0DD;;;GAGG;AACH,wBAAsB,uBAAuB,CAAC,EAC5C,OAAO,EACP,UAAU,EACV,gBAAgB,EAChB,oBAAoB,EACpB,KAAK,EACL,aAAa,EACb,WAAW,EACX,mBAAmB,EACnB,qBAAqB,GACtB,EAAE;IACD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACzC,oBAAoB,EAAE,oBAAoB,CAAC;IAC3C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,OAAO,CAAC;IACvB,WAAW,EAAE,OAAO,CAAC;IACrB,mBAAmB,EAAE,OAAO,CAAC;IAC7B,qBAAqB,EAAE,WAAW,CAAC,aAAa,CAAC,CAAC;CACnD,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CA0BzB;AAED;;;GAGG;AACH,wBAAsB,gCAAgC,CAAC,EACrD,IAAI,EACJ,eAAe,EACf,mBAAmB,EACnB,qBAAqB,GACtB,EAAE;IACD,IAAI,EAAE,gBAAgB,CAAC;IACvB,eAAe,EAAE,eAAe,CAAC;IACjC,mBAAmB,EAAE,OAAO,CAAC;IAC7B,qBAAqB,EAAE,WAAW,CAAC,aAAa,CAAC,CAAC;CACnD,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAezB;AAED,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GACjC,MAAM,GAAG,SAAS,CAOpB;AAED,wBAAgB,mCAAmC,CACjD,WAAW,EAAE,WAAW,GAAG,SAAS,GACnC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,GAAG,SAAS,CAYhD"}
|
|
@@ -89,13 +89,13 @@ async function getFilesAddedInCommitRange(fromSHA, toSHA, isVerbose) {
|
|
|
89
89
|
* Resolves the "from SHA" for changelog purposes.
|
|
90
90
|
* This determines the starting point for changelog generation and optional version plan filtering.
|
|
91
91
|
*/
|
|
92
|
-
async function resolveChangelogFromSHA({ fromRef, tagPattern, tagPatternValues, checkAllBranchesWhen, preid, requireSemver, strictPreid, useAutomaticFromRef, }) {
|
|
92
|
+
async function resolveChangelogFromSHA({ fromRef, tagPattern, tagPatternValues, checkAllBranchesWhen, preid, requireSemver, strictPreid, useAutomaticFromRef, resolveRepositoryTags, }) {
|
|
93
93
|
// If user provided a from ref, resolve it to a SHA
|
|
94
94
|
if (fromRef) {
|
|
95
95
|
return await (0, git_1.getCommitHash)(fromRef);
|
|
96
96
|
}
|
|
97
97
|
// Otherwise, try to resolve it from the latest tag
|
|
98
|
-
const latestTag = await (0, git_1.getLatestGitTagForPattern)(tagPattern, tagPatternValues, {
|
|
98
|
+
const latestTag = await (0, git_1.getLatestGitTagForPattern)(tagPattern, tagPatternValues, resolveRepositoryTags, {
|
|
99
99
|
checkAllBranchesWhen,
|
|
100
100
|
preid,
|
|
101
101
|
requireSemver,
|
|
@@ -114,7 +114,7 @@ async function resolveChangelogFromSHA({ fromRef, tagPattern, tagPatternValues,
|
|
|
114
114
|
* Helper function for workspace-level "from SHA" resolution.
|
|
115
115
|
* Extracts preids and calls the generic resolver.
|
|
116
116
|
*/
|
|
117
|
-
async function resolveWorkspaceChangelogFromSHA({ args, nxReleaseConfig, useAutomaticFromRef, }) {
|
|
117
|
+
async function resolveWorkspaceChangelogFromSHA({ args, nxReleaseConfig, useAutomaticFromRef, resolveRepositoryTags, }) {
|
|
118
118
|
const workspacePreid = extractPreidFromVersion(args.version);
|
|
119
119
|
const projectsPreid = extractProjectsPreidFromVersionData(args.versionData);
|
|
120
120
|
return resolveChangelogFromSHA({
|
|
@@ -126,6 +126,7 @@ async function resolveWorkspaceChangelogFromSHA({ args, nxReleaseConfig, useAuto
|
|
|
126
126
|
requireSemver: nxReleaseConfig.releaseTag.requireSemver,
|
|
127
127
|
strictPreid: nxReleaseConfig.releaseTag.strictPreid,
|
|
128
128
|
useAutomaticFromRef,
|
|
129
|
+
resolveRepositoryTags,
|
|
129
130
|
});
|
|
130
131
|
}
|
|
131
132
|
function extractPreidFromVersion(version) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"changelog.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/command-line/release/changelog.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,sBAAsB,EAAc,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"changelog.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/command-line/release/changelog.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,sBAAsB,EAAc,MAAM,sBAAsB,CAAC;AA8B1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAiCpD,OAAO,EACL,cAAc,EASf,MAAM,gBAAgB,CAAC;AAMxB,MAAM,WAAW,wBAAwB;IACvC,kBAAkB,CAAC,EAAE;QACnB,cAAc,EAAE,cAAc,CAAC;QAC/B,QAAQ,EAAE,MAAM,CAAC;QACjB,WAAW,EAAE,WAAW,GAAG,IAAI,CAAC;KACjC,CAAC;IACF,iBAAiB,CAAC,EAAE;QAClB,CAAC,WAAW,EAAE,MAAM,GAAG;YACrB,cAAc,EAAE,cAAc,CAAC;YAC/B,QAAQ,EAAE,MAAM,CAAC;YACjB,WAAW,EAAE,WAAW,GAAG,IAAI,CAAC;SACjC,CAAC;KACH,CAAC;CACH;AAGD,YAAY,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAEtE,MAAM,MAAM,WAAW,GAAG,CAAC,YAAY,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;AAElE,eAAO,MAAM,0BAA0B,GAAI,MAAM,gBAAgB,oBACH,CAAC;AAE/D,wBAAgB,SAAS,CACvB,qBAAqB,EAAE,sBAAsB,EAC7C,kBAAkB,EAAE,OAAO,IAQzB,MAAM,gBAAgB,KACrB,OAAO,CAAC,wBAAwB,CAAC,CAohBrC"}
|
|
@@ -17,6 +17,9 @@ const is_ci_1 = require("../../utils/is-ci");
|
|
|
17
17
|
const output_1 = require("../../utils/output");
|
|
18
18
|
const path_1 = require("../../utils/path");
|
|
19
19
|
const workspace_root_1 = require("../../utils/workspace-root");
|
|
20
|
+
const commit_utils_1 = require("./changelog/commit-utils");
|
|
21
|
+
const version_plan_filtering_1 = require("./changelog/version-plan-filtering");
|
|
22
|
+
const version_plan_utils_1 = require("./changelog/version-plan-utils");
|
|
20
23
|
const config_1 = require("./config/config");
|
|
21
24
|
const deep_merge_json_1 = require("./config/deep-merge-json");
|
|
22
25
|
const version_plans_1 = require("./config/version-plans");
|
|
@@ -30,10 +33,7 @@ const remote_release_client_1 = require("./utils/remote-release-clients/remote-r
|
|
|
30
33
|
const resolve_changelog_renderer_1 = require("./utils/resolve-changelog-renderer");
|
|
31
34
|
const resolve_nx_json_error_message_1 = require("./utils/resolve-nx-json-error-message");
|
|
32
35
|
const shared_1 = require("./utils/shared");
|
|
33
|
-
const
|
|
34
|
-
const version_plan_utils_2 = require("./changelog/version-plan-utils");
|
|
35
|
-
const commit_utils_1 = require("./changelog/commit-utils");
|
|
36
|
-
const version_plan_filtering_1 = require("./changelog/version-plan-filtering");
|
|
36
|
+
const version_plan_utils_2 = require("./utils/version-plan-utils");
|
|
37
37
|
const releaseChangelogCLIHandler = (args) => (0, handle_errors_1.handleErrors)(args.verbose, () => createAPI({}, false)(args));
|
|
38
38
|
exports.releaseChangelogCLIHandler = releaseChangelogCLIHandler;
|
|
39
39
|
function createAPI(overrideReleaseConfig, ignoreNxJsonConfig) {
|
|
@@ -139,6 +139,7 @@ function createAPI(overrideReleaseConfig, ignoreNxJsonConfig) {
|
|
|
139
139
|
args,
|
|
140
140
|
nxReleaseConfig,
|
|
141
141
|
useAutomaticFromRef,
|
|
142
|
+
resolveRepositoryTags: releaseGraph.resolveRepositoryTags.bind(releaseGraph),
|
|
142
143
|
});
|
|
143
144
|
// Filter version plans based on resolveVersionPlans option
|
|
144
145
|
const shouldFilterVersionPlans = args.resolveVersionPlans === 'using-from-and-to';
|
|
@@ -151,7 +152,7 @@ function createAPI(overrideReleaseConfig, ignoreNxJsonConfig) {
|
|
|
151
152
|
// Set resolved version plans on groups
|
|
152
153
|
await (0, version_plans_1.setResolvedVersionPlansOnGroups)(rawVersionPlans, releaseGraph.releaseGroups, Object.keys(projectGraph.nodes), args.verbose);
|
|
153
154
|
// Validate version plans against the filter after resolution
|
|
154
|
-
const versionPlanValidationError = (0,
|
|
155
|
+
const versionPlanValidationError = (0, version_plan_utils_2.validateResolvedVersionPlansAgainstFilter)(releaseGraph.releaseGroups, releaseGraph.releaseGroupToFilteredProjects);
|
|
155
156
|
if (versionPlanValidationError) {
|
|
156
157
|
output_1.output.error(versionPlanValidationError);
|
|
157
158
|
process.exit(1);
|
|
@@ -220,6 +221,7 @@ function createAPI(overrideReleaseConfig, ignoreNxJsonConfig) {
|
|
|
220
221
|
fromRef: args.from,
|
|
221
222
|
tagPattern: pattern,
|
|
222
223
|
tagPatternValues: templateValues,
|
|
224
|
+
resolveRepositoryTags: releaseGraph.resolveRepositoryTags.bind(releaseGraph),
|
|
223
225
|
checkAllBranchesWhen,
|
|
224
226
|
preid,
|
|
225
227
|
requireSemver,
|
|
@@ -286,7 +288,7 @@ function createAPI(overrideReleaseConfig, ignoreNxJsonConfig) {
|
|
|
286
288
|
for (const project of projectNodes) {
|
|
287
289
|
let changes = null;
|
|
288
290
|
if (releaseGroup.resolvedVersionPlans) {
|
|
289
|
-
changes = (0,
|
|
291
|
+
changes = (0, version_plan_utils_1.createChangesFromProjectsVersionPlans)(releaseGroup.resolvedVersionPlans, project.name);
|
|
290
292
|
}
|
|
291
293
|
else {
|
|
292
294
|
const projectCacheKey = `${releaseGroup.name}:${project.name}`;
|
|
@@ -350,7 +352,7 @@ function createAPI(overrideReleaseConfig, ignoreNxJsonConfig) {
|
|
|
350
352
|
let changes = [];
|
|
351
353
|
if (releaseGroup.resolvedVersionPlans) {
|
|
352
354
|
// This is identical to workspace changelog for fixed groups
|
|
353
|
-
changes = (0,
|
|
355
|
+
changes = (0, version_plan_utils_1.createChangesFromGroupVersionPlans)(releaseGroup.resolvedVersionPlans);
|
|
354
356
|
}
|
|
355
357
|
else {
|
|
356
358
|
const groupCacheKey = `${releaseGroup.name}:fixed`;
|
|
@@ -488,7 +490,7 @@ async function applyChangesAndExit(args, nxReleaseConfig, tree, toSHA, postGitTa
|
|
|
488
490
|
const plansToDelete = [];
|
|
489
491
|
for (const plan of group.resolvedVersionPlans) {
|
|
490
492
|
// Only delete if ALL projects in the version plan are being filtered/released
|
|
491
|
-
if ((0,
|
|
493
|
+
if ((0, version_plan_utils_2.areAllVersionPlanProjectsFiltered)(plan, group, filteredProjects)) {
|
|
492
494
|
plansToDelete.push(plan);
|
|
493
495
|
}
|
|
494
496
|
}
|
|
@@ -860,7 +862,7 @@ function resolveWorkspaceChangelogFromVersionPlans(releaseGraph) {
|
|
|
860
862
|
return [];
|
|
861
863
|
}
|
|
862
864
|
const versionPlans = firstReleaseGroup.resolvedVersionPlans;
|
|
863
|
-
return (0,
|
|
865
|
+
return (0, version_plan_utils_1.createChangesFromGroupVersionPlans)(versionPlans);
|
|
864
866
|
}
|
|
865
867
|
async function resolveWorkspaceChangelogFromCommits({ nxReleaseConfig, args, workspacePreid, projectsPreid, useAutomaticFromRef, toSHA, fromSHA, }) {
|
|
866
868
|
// Use the cached fromSHA if available, otherwise throw an error
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { CheckAllBranchesWhen, RepoGitTags } from './repository-git-tags';
|
|
1
2
|
export interface GitCommitAuthor {
|
|
2
3
|
name: string;
|
|
3
4
|
email: string;
|
|
@@ -27,7 +28,7 @@ export interface GitCommit extends RawGitCommit {
|
|
|
27
28
|
revertedHashes: string[];
|
|
28
29
|
}
|
|
29
30
|
export interface GetLatestGitTagForPatternOptions {
|
|
30
|
-
checkAllBranchesWhen?:
|
|
31
|
+
checkAllBranchesWhen?: CheckAllBranchesWhen;
|
|
31
32
|
preid?: string;
|
|
32
33
|
requireSemver: boolean;
|
|
33
34
|
strictPreid: boolean;
|
|
@@ -71,7 +72,7 @@ export declare function extractTagAndVersion(tag: string, tagRegexp: string, opt
|
|
|
71
72
|
*
|
|
72
73
|
* @returns The tag and version
|
|
73
74
|
*/
|
|
74
|
-
export declare function getLatestGitTagForPattern(releaseTagPattern: string, additionalInterpolationData: {}, options: GetLatestGitTagForPatternOptions): Promise<GitTagAndVersion | null>;
|
|
75
|
+
export declare function getLatestGitTagForPattern(releaseTagPattern: string, additionalInterpolationData: {}, resolveTags: RepoGitTags['resolveTags'], options: GetLatestGitTagForPatternOptions): Promise<GitTagAndVersion | null>;
|
|
75
76
|
export declare function getGitDiff(from: string | undefined, to?: string): Promise<RawGitCommit[]>;
|
|
76
77
|
export declare function gitAdd({ changedFiles, deletedFiles, dryRun, verbose, logFn, cwd, }: {
|
|
77
78
|
changedFiles?: string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"git.d.ts","sourceRoot":"","sources":["../../../../../../../packages/nx/src/command-line/release/utils/git.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"git.d.ts","sourceRoot":"","sources":["../../../../../../../packages/nx/src/command-line/release/utils/git.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,oBAAoB,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAG/E,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,eAAe,CAAC;CACzB;AAED,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,GAAG,OAAO,GAAG,cAAc,CAAC;IACxC,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,gBAAgB;IAC/B,GAAG,EAAE,MAAM,CAAC;IACZ,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,SAAU,SAAQ,YAAY;IAC7C,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,SAAS,EAAE,CAAC;IACxB,OAAO,EAAE,eAAe,EAAE,CAAC;IAC3B,UAAU,EAAE,OAAO,CAAC;IACpB,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,cAAc,EAAE,MAAM,EAAE,CAAC;CAC1B;AAED,MAAM,WAAW,gCAAgC;IAC/C,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;IAC5C,KAAK,CAAC,EAAE,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,MAAM,EAAE,YAAY,GAAG;IAC5D,UAAU,EAAE,SAAS,EAAE,CAAC;IACxB,OAAO,EAAE,eAAe,EAAE,CAAC;CAC5B,CAKA;AAED,wBAAgB,cAAc,CAAC,MAAM,EAAE,YAAY,GAAG,SAAS,GAAG,IAAI,CAqDrE;AAED,wBAAsB,aAAa,CAAC,GAAG,EAAE,MAAM,mBAM9C;AAED,wBAAsB,iBAAiB,oBAatC"}
|
|
@@ -20,7 +20,6 @@ exports.getFirstGitCommit = getFirstGitCommit;
|
|
|
20
20
|
* https://github.com/unjs/changelogen
|
|
21
21
|
*/
|
|
22
22
|
const node_path_1 = require("node:path");
|
|
23
|
-
const minimatch_1 = require("minimatch");
|
|
24
23
|
const semver_1 = require("semver");
|
|
25
24
|
const utils_1 = require("../../../tasks-runner/utils");
|
|
26
25
|
const workspace_root_1 = require("../../../utils/workspace-root");
|
|
@@ -101,75 +100,10 @@ function extractTagAndVersion(tag, tagRegexp, options) {
|
|
|
101
100
|
*
|
|
102
101
|
* @returns The tag and version
|
|
103
102
|
*/
|
|
104
|
-
async function getLatestGitTagForPattern(releaseTagPattern, additionalInterpolationData = {}, options) {
|
|
105
|
-
const {
|
|
106
|
-
/**
|
|
107
|
-
* By default, we will try and resolve the latest match for the releaseTagPattern from the current branch,
|
|
108
|
-
* falling back to all branches if no match is found on the current branch.
|
|
109
|
-
*
|
|
110
|
-
* - If checkAllBranchesWhen is true it will cause us to ALWAYS check all branches for the latest match.
|
|
111
|
-
* - If checkAllBranchesWhen is explicitly set to false it will cause us to ONLY check the current branch for the latest match.
|
|
112
|
-
* - If checkAllBranchesWhen is an array of strings it will cause us to check all branches WHEN the current branch is one of the strings in the array.
|
|
113
|
-
*/
|
|
114
|
-
let alwaysCheckAllBranches = false;
|
|
115
|
-
if (typeof checkAllBranchesWhen !== 'undefined') {
|
|
116
|
-
if (typeof checkAllBranchesWhen === 'boolean') {
|
|
117
|
-
alwaysCheckAllBranches = checkAllBranchesWhen;
|
|
118
|
-
}
|
|
119
|
-
else if (Array.isArray(checkAllBranchesWhen)) {
|
|
120
|
-
/**
|
|
121
|
-
* Get the current git branch and determine whether to check all branches based on the checkAllBranchesWhen parameter
|
|
122
|
-
*/
|
|
123
|
-
const currentBranch = await (0, exec_command_1.execCommand)('git', [
|
|
124
|
-
'rev-parse',
|
|
125
|
-
'--abbrev-ref',
|
|
126
|
-
'HEAD',
|
|
127
|
-
]).then((r) => r.trim());
|
|
128
|
-
// Check exact match first
|
|
129
|
-
alwaysCheckAllBranches = checkAllBranchesWhen.includes(currentBranch);
|
|
130
|
-
// Check if any glob pattern matches next
|
|
131
|
-
if (!alwaysCheckAllBranches) {
|
|
132
|
-
alwaysCheckAllBranches = checkAllBranchesWhen.some((pattern) => {
|
|
133
|
-
const r = minimatch_1.minimatch.makeRe(pattern, { dot: true });
|
|
134
|
-
if (!r) {
|
|
135
|
-
return false;
|
|
136
|
-
}
|
|
137
|
-
return r.test(currentBranch);
|
|
138
|
-
});
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
const defaultGitArgs = [
|
|
143
|
-
// Apply git config to take version suffixes into account when sorting, e.g. 1.0.0 is newer than 1.0.0-beta.1
|
|
144
|
-
'-c',
|
|
145
|
-
'versionsort.suffix=-',
|
|
146
|
-
'tag',
|
|
147
|
-
'--sort',
|
|
148
|
-
'-v:refname',
|
|
149
|
-
];
|
|
103
|
+
async function getLatestGitTagForPattern(releaseTagPattern, additionalInterpolationData = {}, resolveTags, options) {
|
|
104
|
+
const { requireSemver, strictPreid, preid, checkAllBranchesWhen } = options;
|
|
150
105
|
try {
|
|
151
|
-
let tags;
|
|
152
|
-
tags = await (0, exec_command_1.execCommand)('git', [
|
|
153
|
-
...defaultGitArgs,
|
|
154
|
-
...(alwaysCheckAllBranches ? [] : ['--merged']),
|
|
155
|
-
]).then((r) => r
|
|
156
|
-
.trim()
|
|
157
|
-
.split('\n')
|
|
158
|
-
.map((t) => t.trim())
|
|
159
|
-
.filter(Boolean));
|
|
160
|
-
if (
|
|
161
|
-
// Do not run this fallback if the user explicitly set checkAllBranchesWhen to false
|
|
162
|
-
checkAllBranchesWhen !== false &&
|
|
163
|
-
!tags.length &&
|
|
164
|
-
// There is no point in running this fallback if we already checked against all branches
|
|
165
|
-
!alwaysCheckAllBranches) {
|
|
166
|
-
// try again, but include all tags on the repo instead of just --merged ones
|
|
167
|
-
tags = await (0, exec_command_1.execCommand)('git', defaultGitArgs).then((r) => r
|
|
168
|
-
.trim()
|
|
169
|
-
.split('\n')
|
|
170
|
-
.map((t) => t.trim())
|
|
171
|
-
.filter(Boolean));
|
|
172
|
-
}
|
|
106
|
+
let tags = await resolveTags(checkAllBranchesWhen);
|
|
173
107
|
if (!tags.length) {
|
|
174
108
|
return null;
|
|
175
109
|
}
|