nx 22.1.0 → 22.2.0-beta.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 +11 -11
- package/release/changelog-renderer/index.d.ts +1 -0
- package/release/changelog-renderer/index.d.ts.map +1 -1
- package/release/changelog-renderer/index.js +12 -12
- package/src/ai/constants.d.ts +6 -1
- package/src/ai/constants.d.ts.map +1 -1
- package/src/ai/constants.js +14 -3
- 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 +41 -7
- package/src/command-line/daemon/command-object.d.ts +3 -2
- package/src/command-line/daemon/command-object.d.ts.map +1 -1
- package/src/command-line/daemon/command-object.js +11 -4
- package/src/command-line/graph/graph.d.ts.map +1 -1
- package/src/command-line/graph/graph.js +25 -16
- package/src/command-line/release/utils/resolve-semver-specifier.d.ts +1 -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 +3 -3
- package/src/command-line/release/utils/shared.d.ts +2 -1
- package/src/command-line/release/utils/shared.d.ts.map +1 -1
- package/src/command-line/release/utils/shared.js +27 -1
- package/src/command-line/release/version/derive-specifier-from-conventional-commits.js +1 -1
- package/src/command-line/report/report.d.ts +4 -0
- package/src/command-line/report/report.d.ts.map +1 -1
- package/src/command-line/report/report.js +72 -1
- package/src/command-line/yargs-utils/arguments-of.d.ts +12 -0
- package/src/command-line/yargs-utils/arguments-of.d.ts.map +1 -0
- package/src/command-line/yargs-utils/arguments-of.js +9 -0
- package/src/core/graph/main.js +1 -1
- package/src/daemon/cache.d.ts +2 -1
- package/src/daemon/cache.d.ts.map +1 -1
- package/src/daemon/cache.js +10 -26
- package/src/daemon/client/client.d.ts +2 -0
- package/src/daemon/client/client.d.ts.map +1 -1
- package/src/daemon/client/client.js +55 -26
- package/src/daemon/is-nx-version-mismatch.d.ts +3 -0
- package/src/daemon/is-nx-version-mismatch.d.ts.map +1 -0
- package/src/daemon/is-nx-version-mismatch.js +24 -0
- package/src/daemon/server/server.d.ts.map +1 -1
- package/src/daemon/server/server.js +7 -18
- package/src/daemon/tmp-dir.d.ts.map +1 -1
- package/src/daemon/tmp-dir.js +1 -0
- package/src/project-graph/error-types.d.ts +3 -2
- package/src/project-graph/error-types.d.ts.map +1 -1
- package/src/project-graph/error-types.js +9 -2
- package/src/project-graph/plugins/get-plugins.d.ts.map +1 -1
- package/src/project-graph/plugins/get-plugins.js +33 -35
- package/src/project-graph/plugins/in-process-loader.d.ts.map +1 -1
- package/src/project-graph/plugins/in-process-loader.js +2 -2
- package/src/project-graph/plugins/isolation/plugin-pool.js +3 -2
- package/src/project-graph/plugins/isolation/plugin-worker.js +3 -3
- package/src/project-graph/plugins/loaded-nx-plugin.d.ts +5 -0
- package/src/project-graph/plugins/loaded-nx-plugin.d.ts.map +1 -1
- package/src/project-graph/plugins/loaded-nx-plugin.js +5 -0
- package/src/project-graph/project-graph.d.ts +1 -0
- package/src/project-graph/project-graph.d.ts.map +1 -1
- package/src/project-graph/project-graph.js +21 -0
- package/src/project-graph/utils/project-configuration-utils.d.ts +1 -1
- package/src/project-graph/utils/project-configuration-utils.d.ts.map +1 -1
- package/src/project-graph/utils/project-configuration-utils.js +46 -15
- package/src/project-graph/utils/retrieve-workspace-files.d.ts +1 -1
- package/src/project-graph/utils/retrieve-workspace-files.d.ts.map +1 -1
- package/src/tasks-runner/pseudo-terminal.js +1 -1
- package/src/tasks-runner/task-orchestrator.d.ts +1 -0
- package/src/tasks-runner/task-orchestrator.d.ts.map +1 -1
- package/src/tasks-runner/task-orchestrator.js +22 -5
- package/src/tasks-runner/utils.d.ts.map +1 -1
- package/src/tasks-runner/utils.js +3 -2
- package/src/utils/ab-testing.js +1 -1
- package/src/utils/assert-workspace-validity.d.ts.map +1 -1
- package/src/utils/assert-workspace-validity.js +5 -8
- package/src/utils/call-sites.d.ts +15 -0
- package/src/utils/call-sites.d.ts.map +1 -0
- package/src/utils/call-sites.js +28 -0
- package/src/utils/package-manager.d.ts +1 -0
- package/src/utils/package-manager.d.ts.map +1 -1
- package/src/utils/package-manager.js +4 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nx",
|
|
3
|
-
"version": "22.
|
|
3
|
+
"version": "22.2.0-beta.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": "22.
|
|
87
|
-
"@nx/nx-darwin-x64": "22.
|
|
88
|
-
"@nx/nx-freebsd-x64": "22.
|
|
89
|
-
"@nx/nx-linux-arm-gnueabihf": "22.
|
|
90
|
-
"@nx/nx-linux-arm64-gnu": "22.
|
|
91
|
-
"@nx/nx-linux-arm64-musl": "22.
|
|
92
|
-
"@nx/nx-linux-x64-gnu": "22.
|
|
93
|
-
"@nx/nx-linux-x64-musl": "22.
|
|
94
|
-
"@nx/nx-win32-arm64-msvc": "22.
|
|
95
|
-
"@nx/nx-win32-x64-msvc": "22.
|
|
86
|
+
"@nx/nx-darwin-arm64": "22.2.0-beta.0",
|
|
87
|
+
"@nx/nx-darwin-x64": "22.2.0-beta.0",
|
|
88
|
+
"@nx/nx-freebsd-x64": "22.2.0-beta.0",
|
|
89
|
+
"@nx/nx-linux-arm-gnueabihf": "22.2.0-beta.0",
|
|
90
|
+
"@nx/nx-linux-arm64-gnu": "22.2.0-beta.0",
|
|
91
|
+
"@nx/nx-linux-arm64-musl": "22.2.0-beta.0",
|
|
92
|
+
"@nx/nx-linux-x64-gnu": "22.2.0-beta.0",
|
|
93
|
+
"@nx/nx-linux-x64-musl": "22.2.0-beta.0",
|
|
94
|
+
"@nx/nx-win32-arm64-msvc": "22.2.0-beta.0",
|
|
95
|
+
"@nx/nx-win32-x64-msvc": "22.2.0-beta.0"
|
|
96
96
|
},
|
|
97
97
|
"nx-migrations": {
|
|
98
98
|
"migrations": "./migrations.json",
|
|
@@ -99,6 +99,7 @@ export default class DefaultChangelogRenderer {
|
|
|
99
99
|
protected shouldRenderAuthors(): boolean;
|
|
100
100
|
protected renderAuthors(): Promise<string[]>;
|
|
101
101
|
protected formatChange(change: ChangelogChange): string;
|
|
102
|
+
protected formatBreakingChangeBase(change: ChangelogChange): string;
|
|
102
103
|
protected formatBreakingChange(change: ChangelogChange): string;
|
|
103
104
|
protected groupChangesByType(): Record<string, ChangelogChange[]>;
|
|
104
105
|
protected groupChangesByScope(changes: ChangelogChange[]): Record<string, ChangelogChange[]>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../packages/nx/release/changelog-renderer/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0CAA0C,CAAC;AAChF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8CAA8C,CAAC;AACpF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mFAAmF,CAAC;AAE7H;;GAEG;AACH,YAAY,EAAE,eAAe,EAAE,CAAC;AAEhC;;;GAGG;AACH,MAAM,MAAM,sBAAsB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAE7D;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF;;;GAGG;AACH,MAAM,WAAW,6BAA8B,SAAQ,sBAAsB;IAC3E;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;OAIG;IACH,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC;;;OAGG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC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@ -273,29 +273,29 @@ class DefaultChangelogRenderer {
|
|
|
273
273
|
}
|
|
274
274
|
return changeLine;
|
|
275
275
|
}
|
|
276
|
-
|
|
277
|
-
const explanation = this.extractBreakingChangeExplanation(change.body);
|
|
278
|
-
if (!explanation) {
|
|
279
|
-
// No explanation found, use the regular formatChange which includes references
|
|
280
|
-
return this.formatChange(change);
|
|
281
|
-
}
|
|
282
|
-
// Build the breaking change line with scope, explanation, and references
|
|
276
|
+
formatBreakingChangeBase(change) {
|
|
283
277
|
let breakingLine = '- ';
|
|
284
278
|
if (change.scope) {
|
|
285
279
|
breakingLine += `**${change.scope.trim()}:** `;
|
|
286
280
|
}
|
|
287
|
-
// Ensure first line of the breaking change contains the commit title
|
|
288
281
|
if (change.description) {
|
|
289
|
-
breakingLine += `${change.description.trim()}
|
|
282
|
+
breakingLine += `${change.description.trim()}`;
|
|
290
283
|
}
|
|
291
|
-
// Add PR/commit references
|
|
292
284
|
if (this.remoteReleaseClient.getRemoteRepoData() &&
|
|
293
285
|
this.changelogRenderOptions.commitReferences &&
|
|
294
286
|
change.githubReferences) {
|
|
295
|
-
breakingLine +=
|
|
287
|
+
breakingLine += ` ${this.remoteReleaseClient.formatReferences(change.githubReferences)}`;
|
|
288
|
+
}
|
|
289
|
+
return breakingLine;
|
|
290
|
+
}
|
|
291
|
+
formatBreakingChange(change) {
|
|
292
|
+
const explanation = this.extractBreakingChangeExplanation(change.body);
|
|
293
|
+
const baseLine = this.formatBreakingChangeBase(change);
|
|
294
|
+
if (!explanation) {
|
|
295
|
+
return baseLine;
|
|
296
296
|
}
|
|
297
297
|
const indentation = ' ';
|
|
298
|
-
breakingLine
|
|
298
|
+
let breakingLine = baseLine + `\n${indentation}`;
|
|
299
299
|
// Handle multi-line explanations
|
|
300
300
|
let explanationText = explanation;
|
|
301
301
|
let extraLines = [];
|
package/src/ai/constants.d.ts
CHANGED
|
@@ -11,5 +11,10 @@ export declare const nxRulesMarkerCommentEnd = "<!-- nx configuration end-->";
|
|
|
11
11
|
export declare const rulesRegex: RegExp;
|
|
12
12
|
export declare const getAgentRulesWrapped: (writeNxCloudRules: boolean) => string;
|
|
13
13
|
export declare const nxMcpTomlHeader = "[mcp_servers.\"nx-mcp\"]";
|
|
14
|
-
|
|
14
|
+
/**
|
|
15
|
+
* Get the MCP TOML configuration based on the Nx version.
|
|
16
|
+
* For Nx 22+, uses 'nx mcp'
|
|
17
|
+
* For Nx < 22, uses 'nx-mcp'
|
|
18
|
+
*/
|
|
19
|
+
export declare function getNxMcpTomlConfig(nxVersion: string): string;
|
|
15
20
|
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -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,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAElD;AAED,eAAO,MAAM,mBAAmB,QAA2C,CAAC;AAE5E,eAAO,MAAM,yBAAyB,mCAAmC,CAAC;AAC1E,eAAO,MAAM,+BAA+B,8EAA8E,CAAC;AAC3H,eAAO,MAAM,uBAAuB,iCAAiC,CAAC;AACtE,eAAO,MAAM,UAAU,QAGtB,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAAI,mBAAmB,OAAO,WAG9D,CAAC;AAEF,eAAO,MAAM,eAAe,6BAA2B,CAAC;
|
|
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,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAElD;AAED,eAAO,MAAM,mBAAmB,QAA2C,CAAC;AAE5E,eAAO,MAAM,yBAAyB,mCAAmC,CAAC;AAC1E,eAAO,MAAM,+BAA+B,8EAA8E,CAAC;AAC3H,eAAO,MAAM,uBAAuB,iCAAiC,CAAC;AACtE,eAAO,MAAM,UAAU,QAGtB,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAAI,mBAAmB,OAAO,WAG9D,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
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.nxMcpTomlHeader = exports.getAgentRulesWrapped = exports.rulesRegex = exports.nxRulesMarkerCommentEnd = exports.nxRulesMarkerCommentDescription = exports.nxRulesMarkerCommentStart = exports.codexConfigTomlPath = void 0;
|
|
4
4
|
exports.agentsMdPath = agentsMdPath;
|
|
5
5
|
exports.geminiMdPath = geminiMdPath;
|
|
6
6
|
exports.parseGeminiSettings = parseGeminiSettings;
|
|
7
7
|
exports.geminiSettingsPath = geminiSettingsPath;
|
|
8
8
|
exports.claudeMdPath = claudeMdPath;
|
|
9
9
|
exports.claudeMcpPath = claudeMcpPath;
|
|
10
|
+
exports.getNxMcpTomlConfig = getNxMcpTomlConfig;
|
|
10
11
|
const os_1 = require("os");
|
|
11
12
|
const path_1 = require("path");
|
|
13
|
+
const semver_1 = require("semver");
|
|
12
14
|
const fileutils_1 = require("../utils/fileutils");
|
|
13
15
|
const get_agent_rules_1 = require("./set-up-ai-agents/get-agent-rules");
|
|
14
16
|
function agentsMdPath(root) {
|
|
@@ -46,8 +48,17 @@ const getAgentRulesWrapped = (writeNxCloudRules) => {
|
|
|
46
48
|
};
|
|
47
49
|
exports.getAgentRulesWrapped = getAgentRulesWrapped;
|
|
48
50
|
exports.nxMcpTomlHeader = `[mcp_servers."nx-mcp"]`;
|
|
49
|
-
|
|
51
|
+
/**
|
|
52
|
+
* Get the MCP TOML configuration based on the Nx version.
|
|
53
|
+
* For Nx 22+, uses 'nx mcp'
|
|
54
|
+
* For Nx < 22, uses 'nx-mcp'
|
|
55
|
+
*/
|
|
56
|
+
function getNxMcpTomlConfig(nxVersion) {
|
|
57
|
+
const majorVersion = (0, semver_1.major)(nxVersion);
|
|
58
|
+
const args = majorVersion >= 22 ? '["nx", "mcp"]' : '["nx-mcp"]';
|
|
59
|
+
return `${exports.nxMcpTomlHeader}
|
|
50
60
|
type = "stdio"
|
|
51
61
|
command = "npx"
|
|
52
|
-
args =
|
|
62
|
+
args = ${args}
|
|
53
63
|
`;
|
|
64
|
+
}
|
|
@@ -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":"
|
|
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;AAQ7C,OAAO,EACL,qBAAqB,EACrB,oBAAoB,EACrB,MAAM,oBAAoB,CAAC;AAkB5B,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,CAwJ7C;AA2DD,eAAe,sBAAsB,CAAC"}
|
|
@@ -5,14 +5,45 @@ exports.setupAiAgentsGeneratorImpl = setupAiAgentsGeneratorImpl;
|
|
|
5
5
|
const fs_1 = require("fs");
|
|
6
6
|
const os_1 = require("os");
|
|
7
7
|
const path_1 = require("path");
|
|
8
|
+
const semver_1 = require("semver");
|
|
8
9
|
const format_changed_files_with_prettier_if_available_1 = require("../../generators/internal-utils/format-changed-files-with-prettier-if-available");
|
|
9
10
|
const json_1 = require("../../generators/utils/json");
|
|
10
11
|
const native_1 = require("../../native");
|
|
11
12
|
const package_json_1 = require("../../utils/package-json");
|
|
12
13
|
const provenance_1 = require("../../utils/provenance");
|
|
14
|
+
const workspace_root_1 = require("../../utils/workspace-root");
|
|
13
15
|
const constants_1 = require("../constants");
|
|
14
16
|
const utils_1 = require("../utils");
|
|
15
17
|
const constants_2 = require("../constants");
|
|
18
|
+
/**
|
|
19
|
+
* Get the installed Nx version, with fallback to workspace package.json or default version.
|
|
20
|
+
*/
|
|
21
|
+
function getNxVersion() {
|
|
22
|
+
try {
|
|
23
|
+
// Try to read from node_modules first
|
|
24
|
+
const { packageJson: { version }, } = (0, package_json_1.readModulePackageJson)('nx');
|
|
25
|
+
return version;
|
|
26
|
+
}
|
|
27
|
+
catch {
|
|
28
|
+
try {
|
|
29
|
+
// Fallback: try to read from workspace package.json
|
|
30
|
+
const workspacePackageJson = JSON.parse((0, fs_1.readFileSync)((0, path_1.join)(workspace_root_1.workspaceRoot, 'package.json'), 'utf-8'));
|
|
31
|
+
// Check devDependencies first, then dependencies
|
|
32
|
+
const nxVersion = workspacePackageJson.devDependencies?.nx ||
|
|
33
|
+
workspacePackageJson.dependencies?.nx;
|
|
34
|
+
if (nxVersion) {
|
|
35
|
+
// Remove any semver range characters (^, ~, >=, etc.)
|
|
36
|
+
return nxVersion.replace(/^[\^~>=<]+/, '');
|
|
37
|
+
}
|
|
38
|
+
throw new Error('Nx not found in package.json');
|
|
39
|
+
}
|
|
40
|
+
catch {
|
|
41
|
+
// If we can't determine the version, default to the newer format
|
|
42
|
+
// This handles cases where nx might not be installed or is globally installed
|
|
43
|
+
return '22.0.0';
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
16
47
|
async function setupAiAgentsGenerator(tree, options, inner = false) {
|
|
17
48
|
const normalizedOptions = normalizeOptions(options);
|
|
18
49
|
// Use environment variable to force local execution
|
|
@@ -42,6 +73,7 @@ function normalizeOptions(options) {
|
|
|
42
73
|
}
|
|
43
74
|
async function setupAiAgentsGeneratorImpl(tree, options) {
|
|
44
75
|
const hasAgent = (agent) => options.agents.includes(agent);
|
|
76
|
+
const nxVersion = getNxVersion();
|
|
45
77
|
const agentsMd = (0, constants_1.agentsMdPath)(options.directory);
|
|
46
78
|
// write AGENTS.md for most agents
|
|
47
79
|
if (hasAgent('cursor') || hasAgent('copilot') || hasAgent('codex')) {
|
|
@@ -54,14 +86,14 @@ async function setupAiAgentsGeneratorImpl(tree, options) {
|
|
|
54
86
|
if (!tree.exists(mcpJsonPath)) {
|
|
55
87
|
(0, json_1.writeJson)(tree, mcpJsonPath, {});
|
|
56
88
|
}
|
|
57
|
-
(0, json_1.updateJson)(tree, mcpJsonPath, mcpConfigUpdater);
|
|
89
|
+
(0, json_1.updateJson)(tree, mcpJsonPath, (json) => mcpConfigUpdater(json, nxVersion));
|
|
58
90
|
}
|
|
59
91
|
if (hasAgent('gemini')) {
|
|
60
92
|
const geminiSettingsPath = (0, path_1.join)(options.directory, '.gemini', 'settings.json');
|
|
61
93
|
if (!tree.exists(geminiSettingsPath)) {
|
|
62
94
|
(0, json_1.writeJson)(tree, geminiSettingsPath, {});
|
|
63
95
|
}
|
|
64
|
-
(0, json_1.updateJson)(tree, geminiSettingsPath, mcpConfigUpdater);
|
|
96
|
+
(0, json_1.updateJson)(tree, geminiSettingsPath, (json) => mcpConfigUpdater(json, nxVersion));
|
|
65
97
|
const contextFileName = (0, json_1.readJson)(tree, geminiSettingsPath).contextFileName;
|
|
66
98
|
const geminiMd = (0, constants_1.geminiMdPath)(options.directory);
|
|
67
99
|
// Only set contextFileName to AGENTS.md if GEMINI.md doesn't exist already to preserve existing setups
|
|
@@ -86,7 +118,7 @@ async function setupAiAgentsGeneratorImpl(tree, options) {
|
|
|
86
118
|
const tomlContents = (0, fs_1.readFileSync)(constants_1.codexConfigTomlPath, 'utf-8');
|
|
87
119
|
if (!tomlContents.includes(constants_2.nxMcpTomlHeader)) {
|
|
88
120
|
if (!check) {
|
|
89
|
-
(0, fs_1.appendFileSync)(constants_1.codexConfigTomlPath, `\n${constants_2.
|
|
121
|
+
(0, fs_1.appendFileSync)(constants_1.codexConfigTomlPath, `\n${(0, constants_2.getNxMcpTomlConfig)(nxVersion)}`);
|
|
90
122
|
}
|
|
91
123
|
messages.push({
|
|
92
124
|
title: `Updated ${constants_1.codexConfigTomlPath} with nx-mcp server`,
|
|
@@ -96,7 +128,7 @@ async function setupAiAgentsGeneratorImpl(tree, options) {
|
|
|
96
128
|
else {
|
|
97
129
|
if (!check) {
|
|
98
130
|
(0, fs_1.mkdirSync)((0, path_1.join)((0, os_1.homedir)(), '.codex'), { recursive: true });
|
|
99
|
-
(0, fs_1.writeFileSync)(constants_1.codexConfigTomlPath, constants_2.
|
|
131
|
+
(0, fs_1.writeFileSync)(constants_1.codexConfigTomlPath, (0, constants_2.getNxMcpTomlConfig)(nxVersion));
|
|
100
132
|
}
|
|
101
133
|
messages.push({
|
|
102
134
|
title: `Created ${constants_1.codexConfigTomlPath} with nx-mcp server`,
|
|
@@ -191,12 +223,14 @@ function writeAgentRules(tree, path, writeNxCloudRules) {
|
|
|
191
223
|
tree.write(path, existing + '\n\n' + expectedRules);
|
|
192
224
|
}
|
|
193
225
|
}
|
|
194
|
-
function mcpConfigUpdater(existing) {
|
|
226
|
+
function mcpConfigUpdater(existing, nxVersion) {
|
|
227
|
+
const majorVersion = (0, semver_1.major)(nxVersion);
|
|
228
|
+
const mcpArgs = majorVersion >= 22 ? ['nx', 'mcp'] : ['nx-mcp'];
|
|
195
229
|
if (existing.mcpServers) {
|
|
196
230
|
existing.mcpServers['nx-mcp'] = {
|
|
197
231
|
type: 'stdio',
|
|
198
232
|
command: 'npx',
|
|
199
|
-
args:
|
|
233
|
+
args: mcpArgs,
|
|
200
234
|
};
|
|
201
235
|
}
|
|
202
236
|
else {
|
|
@@ -204,7 +238,7 @@ function mcpConfigUpdater(existing) {
|
|
|
204
238
|
'nx-mcp': {
|
|
205
239
|
type: 'stdio',
|
|
206
240
|
command: 'npx',
|
|
207
|
-
args:
|
|
241
|
+
args: mcpArgs,
|
|
208
242
|
},
|
|
209
243
|
};
|
|
210
244
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
export declare const yargsDaemonCommand: import("../yargs-utils/arguments-of").CommandModule<{}, {
|
|
2
|
+
verbose: boolean;
|
|
3
|
+
}>;
|
|
3
4
|
//# sourceMappingURL=command-object.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-object.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/command-line/daemon/command-object.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"command-object.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/command-line/daemon/command-object.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,kBAAkB;;EAW7B,CAAC"}
|
|
@@ -2,12 +2,19 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.yargsDaemonCommand = void 0;
|
|
4
4
|
const documentation_1 = require("../yargs-utils/documentation");
|
|
5
|
-
|
|
5
|
+
const handle_errors_1 = require("../../utils/handle-errors");
|
|
6
|
+
const shared_options_1 = require("../yargs-utils/shared-options");
|
|
7
|
+
const arguments_of_1 = require("../yargs-utils/arguments-of");
|
|
8
|
+
const builder = (yargs) => (0, documentation_1.linkToNxDevAndExamples)((0, shared_options_1.withVerbose)(withDaemonOptions(yargs)), 'daemon');
|
|
9
|
+
exports.yargsDaemonCommand = (0, arguments_of_1.makeCommandModule)({
|
|
6
10
|
command: 'daemon',
|
|
7
11
|
describe: 'Prints information about the Nx Daemon process or starts a daemon process.',
|
|
8
|
-
builder
|
|
9
|
-
handler: async (args) =>
|
|
10
|
-
|
|
12
|
+
builder,
|
|
13
|
+
handler: async (args) => {
|
|
14
|
+
const exitCode = await (0, handle_errors_1.handleErrors)(args.verbose, async () => (await Promise.resolve().then(() => require('./daemon'))).daemonHandler(args));
|
|
15
|
+
process.exit(exitCode);
|
|
16
|
+
},
|
|
17
|
+
});
|
|
11
18
|
function withDaemonOptions(yargs) {
|
|
12
19
|
return yargs
|
|
13
20
|
.option('start', {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graph.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/command-line/graph/graph.ts"],"names":[],"mappings":"AA0BA,OAAO,EAEL,cAAc,EACd,YAAY,EACZ,sBAAsB,EACtB,uBAAuB,EACxB,MAAM,4BAA4B,CAAC;AAKpC,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"graph.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/command-line/graph/graph.ts"],"names":[],"mappings":"AA0BA,OAAO,EAEL,cAAc,EACd,YAAY,EACZ,sBAAsB,EACtB,uBAAuB,EACxB,MAAM,4BAA4B,CAAC;AAKpC,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAwBpD,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,OAAO,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,0BAA0B;IACzC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,uBAAuB,EAAE,CAAC;IACpC,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,sBAAsB,EAAE,CAAC,CAAC;IACvD,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB,MAAM,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IAC7C,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,OAAO,CAAC;IACvB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,SAAS,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,UAAU,EAAE,CAAC;IACtB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,0BAA0B,CAAC,EAAE,MAAM,EAAE,CAAC;CACvC;AAED,MAAM,WAAW,uBAAuB;IACtC,SAAS,EAAE,SAAS,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IACjC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB;AAED,MAAM,WAAW,yBAAyB;IACxC,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;CAC5C;AAiJD,wBAAsB,aAAa,CACjC,IAAI,EAAE;IACJ,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,IAAI,EAAE,UAAU,GAAG,OAAO,GAAG,iBAAiB,CAAC;IAC/C,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,EACD,gBAAgB,EAAE,MAAM,EAAE,GACzB,OAAO,CAAC,IAAI,CAAC,CA4Tf;AAuvBD;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IACrC;;OAEG;IACH,KAAK,EAAE,YAAY,CAAC;CACrB"}
|
|
@@ -27,6 +27,7 @@ const transform_objects_1 = require("../../native/transform-objects");
|
|
|
27
27
|
const affected_1 = require("../affected/affected");
|
|
28
28
|
const nx_deps_cache_1 = require("../../project-graph/nx-deps-cache");
|
|
29
29
|
const task_hasher_1 = require("../../hasher/task-hasher");
|
|
30
|
+
const find_matching_projects_1 = require("../../utils/find-matching-projects");
|
|
30
31
|
const create_task_hasher_1 = require("../../hasher/create-task-hasher");
|
|
31
32
|
const error_types_1 = require("../../project-graph/error-types");
|
|
32
33
|
const nx_cloud_utils_1 = require("../../utils/nx-cloud-utils");
|
|
@@ -203,23 +204,29 @@ async function generateGraph(args, affectedProjects) {
|
|
|
203
204
|
// and the operation might fail (i.e: in e2e tests), we fallback to empty array
|
|
204
205
|
affectedProjects = [];
|
|
205
206
|
}
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
207
|
+
let excludePatterns = [];
|
|
208
|
+
if (args.exclude && args.exclude.length > 0) {
|
|
209
|
+
try {
|
|
210
|
+
// Use findMatchingProjects to expand patterns (supports globs, tags, directories, etc.)
|
|
211
|
+
excludePatterns = (0, find_matching_projects_1.findMatchingProjects)(args.exclude, prunedGraph.nodes);
|
|
212
|
+
// If no projects matched any of the exclude patterns, show a warning
|
|
213
|
+
if (excludePatterns.length === 0) {
|
|
214
|
+
output_1.output.warn({
|
|
215
|
+
title: `No projects matched the following exclude patterns:`,
|
|
216
|
+
bodyLines: args.exclude,
|
|
217
|
+
});
|
|
211
218
|
}
|
|
212
|
-
}
|
|
213
|
-
|
|
219
|
+
}
|
|
220
|
+
catch (e) {
|
|
214
221
|
output_1.output.error({
|
|
215
|
-
title: `
|
|
216
|
-
bodyLines:
|
|
222
|
+
title: `Invalid exclude pattern:`,
|
|
223
|
+
bodyLines: [e.message],
|
|
217
224
|
});
|
|
218
225
|
process.exit(1);
|
|
219
226
|
}
|
|
220
227
|
}
|
|
221
228
|
let html = (0, node_fs_1.readFileSync)((0, node_path_1.join)(__dirname, '../../core/graph/index.html'), 'utf-8');
|
|
222
|
-
prunedGraph = filterGraph(prunedGraph, args.focus || null,
|
|
229
|
+
prunedGraph = filterGraph(prunedGraph, args.focus || null, excludePatterns);
|
|
223
230
|
if (args.print || args.file === 'stdout') {
|
|
224
231
|
console.log(JSON.stringify(await createJsonOutput(prunedGraph, rawGraph, args.projects, args.targets), null, 2));
|
|
225
232
|
await output_1.output.drain();
|
|
@@ -250,7 +257,7 @@ async function generateGraph(args, affectedProjects) {
|
|
|
250
257
|
? await createTaskGraphForTargetsAndProjects(args.targets, args.projects)
|
|
251
258
|
: await createTaskGraphClientResponse();
|
|
252
259
|
const taskInputsReponse = await createExpandedTaskInputResponse(taskGraphClientResponse, projectGraphClientResponse);
|
|
253
|
-
const environmentJs = buildEnvironmentJs(
|
|
260
|
+
const environmentJs = buildEnvironmentJs(excludePatterns, args.watch, !!args.file && args.file.endsWith('html') ? 'build' : 'serve', projectGraphClientResponse, taskGraphClientResponse, taskInputsReponse, sourceMaps);
|
|
254
261
|
html = html.replace(/src="/g, 'src="static/');
|
|
255
262
|
html = html.replace(/href="styles/g, 'href="static/styles');
|
|
256
263
|
html = html.replace(/<base href="\/".*>/g, '');
|
|
@@ -281,11 +288,11 @@ async function generateGraph(args, affectedProjects) {
|
|
|
281
288
|
process.exit(0);
|
|
282
289
|
}
|
|
283
290
|
else {
|
|
284
|
-
const environmentJs = buildEnvironmentJs(
|
|
291
|
+
const environmentJs = buildEnvironmentJs(excludePatterns, args.watch, !!args.file && args.file.endsWith('html') ? 'build' : 'serve');
|
|
285
292
|
let app;
|
|
286
293
|
let url;
|
|
287
294
|
try {
|
|
288
|
-
const result = await startServer(html, environmentJs, args.host || '127.0.0.1', args.port || 4211, args.watch, affectedProjects, args.focus, args.groupByFolder,
|
|
295
|
+
const result = await startServer(html, environmentJs, args.host || '127.0.0.1', args.port || 4211, args.watch, affectedProjects, args.focus, args.groupByFolder, excludePatterns);
|
|
289
296
|
app = result.app;
|
|
290
297
|
url = result.url;
|
|
291
298
|
}
|
|
@@ -377,7 +384,7 @@ async function startServer(html, environmentJs, host, port = 4211, watchForChang
|
|
|
377
384
|
if (watchForChanges && client_1.daemonClient.enabled()) {
|
|
378
385
|
unregisterFileWatcher = await createFileWatcher();
|
|
379
386
|
}
|
|
380
|
-
const { projectGraphClientResponse, sourceMapResponse } = await createProjectGraphAndSourceMapClientResponse(affected);
|
|
387
|
+
const { projectGraphClientResponse, sourceMapResponse } = await createProjectGraphAndSourceMapClientResponse(affected, focus, exclude);
|
|
381
388
|
currentProjectGraphClientResponse = projectGraphClientResponse;
|
|
382
389
|
currentProjectGraphClientResponse.focus = focus;
|
|
383
390
|
currentProjectGraphClientResponse.groupByFolder = groupByFolder;
|
|
@@ -534,7 +541,7 @@ function createFileWatcher() {
|
|
|
534
541
|
}
|
|
535
542
|
else if (changes !== null && changes.changedFiles.length > 0) {
|
|
536
543
|
output_1.output.note({ title: 'Recalculating project graph...' });
|
|
537
|
-
const { projectGraphClientResponse, sourceMapResponse } = await createProjectGraphAndSourceMapClientResponse();
|
|
544
|
+
const { projectGraphClientResponse, sourceMapResponse } = await createProjectGraphAndSourceMapClientResponse([], currentProjectGraphClientResponse.focus, currentProjectGraphClientResponse.exclude);
|
|
538
545
|
if (projectGraphClientResponse.hash !==
|
|
539
546
|
currentProjectGraphClientResponse.hash &&
|
|
540
547
|
sourceMapResponse) {
|
|
@@ -563,7 +570,7 @@ function createFileWatcher() {
|
|
|
563
570
|
}
|
|
564
571
|
}, 500));
|
|
565
572
|
}
|
|
566
|
-
async function createProjectGraphAndSourceMapClientResponse(affected = []) {
|
|
573
|
+
async function createProjectGraphAndSourceMapClientResponse(affected = [], focus = null, exclude = []) {
|
|
567
574
|
node_perf_hooks_1.performance.mark('project graph watch calculation:start');
|
|
568
575
|
let projectGraph;
|
|
569
576
|
let sourceMaps;
|
|
@@ -598,6 +605,8 @@ async function createProjectGraphAndSourceMapClientResponse(affected = []) {
|
|
|
598
605
|
}
|
|
599
606
|
}
|
|
600
607
|
let graph = (0, operators_1.pruneExternalNodes)(projectGraph);
|
|
608
|
+
// Apply focus and exclude filters
|
|
609
|
+
graph = filterGraph(graph, focus, exclude);
|
|
601
610
|
const fileMap = (0, nx_deps_cache_1.readFileMapCache)()?.fileMap.projectFileMap || {};
|
|
602
611
|
node_perf_hooks_1.performance.mark('project graph watch calculation:end');
|
|
603
612
|
node_perf_hooks_1.performance.mark('project graph response generation:start');
|
|
@@ -2,6 +2,6 @@ import { ProjectGraph } from '../../../config/project-graph';
|
|
|
2
2
|
import { NxReleaseConfig } from '../config/config';
|
|
3
3
|
import { SemverBumpType } from '../version/version-actions';
|
|
4
4
|
import { SemverSpecifier } from './semver';
|
|
5
|
-
export declare function resolveSemverSpecifierFromConventionalCommits(from: string, projectGraph: ProjectGraph, projectNames: string[],
|
|
5
|
+
export declare function resolveSemverSpecifierFromConventionalCommits(from: string, projectGraph: ProjectGraph, projectNames: string[], releaseConfig: NxReleaseConfig): Promise<Map<string, SemverSpecifier | null>>;
|
|
6
6
|
export declare function resolveSemverSpecifierFromPrompt(selectionMessage: string, customVersionMessage: string): Promise<SemverBumpType | string>;
|
|
7
7
|
//# sourceMappingURL=resolve-semver-specifier.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve-semver-specifier.d.ts","sourceRoot":"","sources":["../../../../../../../packages/nx/src/command-line/release/utils/resolve-semver-specifier.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAE5D,OAAO,EAAyB,eAAe,EAAE,MAAM,UAAU,CAAC;AAGlE,wBAAsB,6CAA6C,CACjE,IAAI,EAAE,MAAM,EACZ,YAAY,EAAE,YAAY,EAC1B,YAAY,EAAE,MAAM,EAAE,EACtB,
|
|
1
|
+
{"version":3,"file":"resolve-semver-specifier.d.ts","sourceRoot":"","sources":["../../../../../../../packages/nx/src/command-line/release/utils/resolve-semver-specifier.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAE5D,OAAO,EAAyB,eAAe,EAAE,MAAM,UAAU,CAAC;AAGlE,wBAAsB,6CAA6C,CACjE,IAAI,EAAE,MAAM,EACZ,YAAY,EAAE,YAAY,EAC1B,YAAY,EAAE,MAAM,EAAE,EACtB,aAAa,EAAE,eAAe,GAEhC,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,eAAe,GAAG,IAAI,CAAC,CAAC,CAa3C;AAED,wBAAsB,gCAAgC,CACpD,gBAAgB,EAAE,MAAM,EACxB,oBAAoB,EAAE,MAAM,GAC3B,OAAO,CAAC,cAAc,GAAG,MAAM,CAAC,CAwClC"}
|
|
@@ -7,11 +7,11 @@ const semver_1 = require("semver");
|
|
|
7
7
|
const git_1 = require("./git");
|
|
8
8
|
const semver_2 = require("./semver");
|
|
9
9
|
const shared_1 = require("./shared");
|
|
10
|
-
async function resolveSemverSpecifierFromConventionalCommits(from, projectGraph, projectNames,
|
|
10
|
+
async function resolveSemverSpecifierFromConventionalCommits(from, projectGraph, projectNames, releaseConfig) {
|
|
11
11
|
const commits = await (0, git_1.getGitDiff)(from);
|
|
12
12
|
const parsedCommits = (0, git_1.parseCommits)(commits);
|
|
13
|
-
const relevantCommits = await (0, shared_1.getCommitsRelevantToProjects)(projectGraph, parsedCommits, projectNames);
|
|
14
|
-
return (0, semver_2.determineSemverChange)(relevantCommits,
|
|
13
|
+
const relevantCommits = await (0, shared_1.getCommitsRelevantToProjects)(projectGraph, parsedCommits, projectNames, releaseConfig);
|
|
14
|
+
return (0, semver_2.determineSemverChange)(relevantCommits, releaseConfig.conventionalCommits);
|
|
15
15
|
}
|
|
16
16
|
async function resolveSemverSpecifierFromPrompt(selectionMessage, customVersionMessage) {
|
|
17
17
|
try {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ProjectGraph } from '../../../config/project-graph';
|
|
2
2
|
import type { ReleaseGroupWithName } from '../config/filter-release-groups';
|
|
3
3
|
import { GitCommit } from './git';
|
|
4
|
+
import { NxReleaseConfig } from '../config/config';
|
|
4
5
|
export declare const noDiffInChangelogMessage: string;
|
|
5
6
|
export type VersionData = Record<string, VersionDataEntry>;
|
|
6
7
|
export interface VersionDataEntry {
|
|
@@ -54,7 +55,7 @@ export declare function shouldSkipVersionActions(dockerOptions: {
|
|
|
54
55
|
}, projectName: string): boolean;
|
|
55
56
|
export declare function createGitTagValues(releaseGroups: ReleaseGroupWithName[], releaseGroupToFilteredProjects: Map<ReleaseGroupWithName, Set<string>>, versionData: VersionData): string[];
|
|
56
57
|
export declare function handleDuplicateGitTags(gitTagValues: string[]): void;
|
|
57
|
-
export declare function getCommitsRelevantToProjects(projectGraph: ProjectGraph, commits: GitCommit[], projects: string[]): Promise<Map<string, {
|
|
58
|
+
export declare function getCommitsRelevantToProjects(projectGraph: ProjectGraph, commits: GitCommit[], projects: string[], nxReleaseConfig: NxReleaseConfig): Promise<Map<string, {
|
|
58
59
|
commit: GitCommit;
|
|
59
60
|
isProjectScopedCommit: boolean;
|
|
60
61
|
}[]>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../../../../../packages/nx/src/command-line/release/utils/shared.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAW7D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AAC5E,OAAO,EAAE,SAAS,EAAqB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../../../../../packages/nx/src/command-line/release/utils/shared.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAW7D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;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B,CAAC,EAAE,MAAM,EAAE,CAAC;IAC7B,aAAa,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;CACnC,iBAsBA;AAED,wBAAgB,yBAAyB,CACvC,aAAa,EAAE,oBAAoB,EAAE,EACrC,8BAA8B,EAAE,GAAG,CAAC,oBAAoB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,EACtE,WAAW,EAAE,WAAW,EACxB,aAAa,EAAE,MAAM,GACpB,MAAM,EAAE,CA0GV;AAcD,wBAAgB,wCAAwC,CACtD,YAAY,EAAE,oBAAoB,GACjC,OAAO,GAAG,MAAM,CAElB;AAED,wBAAgB,wBAAwB,CACtC,aAAa,EAAE;IAAE,kBAAkB,CAAC,EAAE,MAAM,EAAE,GAAG,OAAO,CAAA;CAAE,EAC1D,WAAW,EAAE,MAAM,GAClB,OAAO,CAOT;AAED,wBAAgB,kBAAkB,CAChC,aAAa,EAAE,oBAAoB,EAAE,EACrC,8BAA8B,EAAE,GAAG,CAAC,oBAAoB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,EACtE,WAAW,EAAE,WAAW,GACvB,MAAM,EAAE,CA6FV;AAeD,wBAAgB,sBAAsB,CAAC,YAAY,EAAE,MAAM,EAAE,GAAG,IAAI,CAcnE;AA6BD,wBAAsB,4BAA4B,CAChD,YAAY,EAAE,YAAY,EAC1B,OAAO,EAAE,SAAS,EAAE,EACpB,QAAQ,EAAE,MAAM,EAAE,EAClB,eAAe,EAAE,eAAe,GAElC,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE;IAAE,MAAM,EAAE,SAAS,CAAC;IAAC,qBAAqB,EAAE,OAAO,CAAA;CAAE,EAAE,CAAC,CAAC,CA6C5E"}
|
|
@@ -268,10 +268,36 @@ function handleDuplicateGitTags(gitTagValues) {
|
|
|
268
268
|
process.exit(1);
|
|
269
269
|
}
|
|
270
270
|
}
|
|
271
|
-
|
|
271
|
+
function isAutomatedReleaseCommit(message, nxReleaseConfig) {
|
|
272
|
+
// All possible commit message patterns based on config
|
|
273
|
+
const commitMessagePatterns = [
|
|
274
|
+
nxReleaseConfig.git.commitMessage,
|
|
275
|
+
nxReleaseConfig.version.git.commitMessage,
|
|
276
|
+
nxReleaseConfig.changelog.git.commitMessage,
|
|
277
|
+
];
|
|
278
|
+
// Check if message matches any pattern
|
|
279
|
+
for (const pattern of commitMessagePatterns) {
|
|
280
|
+
if (!pattern)
|
|
281
|
+
continue;
|
|
282
|
+
// Split on {version}, escape each part for regex, then join with version pattern
|
|
283
|
+
const parts = pattern.split('{version}');
|
|
284
|
+
const escapedParts = parts.map((part) => part.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'));
|
|
285
|
+
const regexPattern = escapedParts.join('\\S+');
|
|
286
|
+
const regex = new RegExp(`^${regexPattern}$`);
|
|
287
|
+
if (regex.test(message)) {
|
|
288
|
+
return true;
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
return false;
|
|
292
|
+
}
|
|
293
|
+
async function getCommitsRelevantToProjects(projectGraph, commits, projects, nxReleaseConfig) {
|
|
272
294
|
const projectSet = new Set(projects);
|
|
273
295
|
const relevantCommits = new Map();
|
|
274
296
|
for (const commit of commits) {
|
|
297
|
+
// Filter out automated release commits
|
|
298
|
+
if (isAutomatedReleaseCommit(commit.message, nxReleaseConfig)) {
|
|
299
|
+
continue;
|
|
300
|
+
}
|
|
275
301
|
// Convert affectedFiles to FileChange[] format with proper diff computation
|
|
276
302
|
const touchedFiles = (0, file_utils_1.calculateFileChanges)(commit.affectedFiles, {
|
|
277
303
|
base: `${commit.shortHash}^`,
|
|
@@ -25,7 +25,7 @@ isPrerelease, latestMatchingGitTag, fallbackCurrentVersionResolver, preid) {
|
|
|
25
25
|
// This should never happen since the checks above should catch if the current version couldn't be resolved
|
|
26
26
|
throw new Error(`Unable to determine previous version ref for the projects ${affectedProjects.join(', ')}. This is likely a bug in Nx.`);
|
|
27
27
|
}
|
|
28
|
-
const projectToSpecifiers = await (0, resolve_semver_specifier_1.resolveSemverSpecifierFromConventionalCommits)(previousVersionRef, projectGraph, affectedProjects, nxReleaseConfig
|
|
28
|
+
const projectToSpecifiers = await (0, resolve_semver_specifier_1.resolveSemverSpecifierFromConventionalCommits)(previousVersionRef, projectGraph, affectedProjects, nxReleaseConfig);
|
|
29
29
|
const getHighestSemverChange = (semverSpecifiersItr) => {
|
|
30
30
|
const semverSpecifiers = Array.from(semverSpecifiersItr);
|
|
31
31
|
return semverSpecifiers.sort((a, b) => b - a)[0];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"report.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/command-line/report/report.ts"],"names":[],"mappings":"AAGA,OAAO,
|
|
1
|
+
{"version":3,"file":"report.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/command-line/report/report.ts"],"names":[],"mappings":"AAGA,OAAO,EAIL,cAAc,EACf,MAAM,6BAA6B,CAAC;AAErC,OAAO,EACL,WAAW,EAGZ,MAAM,0BAA0B,CAAC;AASlC,OAAO,EAAE,mBAAmB,EAAc,MAAM,sBAAsB,CAAC;AAUvE,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,SAAS,CAAC;AAYrC,eAAO,MAAM,mBAAmB,UAO/B,CAAC;AAEF,eAAO,MAAM,iCAAiC,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,CAMpE,CAAC;AAIF;;;;;;;GAOG;AACH,wBAAsB,aAAa,kBAgMlC;AAED,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,cAAc,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IACpB,UAAU,EAAE,KAAK,GAAG,IAAI,CAAC;IACzB,gBAAgB,EAAE,WAAW,EAAE,CAAC;IAChC,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,gBAAgB,EAAE,WAAW,EAAE,CAAC;IAChC,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,0BAA0B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