nx 22.2.0-canary.20251121-9a6c7ad → 22.2.0-canary.20251125-7e00ec4
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/executors.json +16 -16
- package/generators.json +13 -13
- package/migrations.json +143 -143
- package/package.json +14 -11
- package/presets/npm.json +4 -4
- 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/schemas/nx-schema.json +1285 -1285
- package/schemas/project-schema.json +359 -359
- package/schemas/workspace-schema.json +165 -165
- 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/schema.json +31 -31
- 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/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/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 +53 -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/executors/noop/schema.json +8 -8
- package/src/executors/run-commands/schema.json +187 -187
- package/src/executors/run-script/schema.json +25 -25
- package/src/nx-cloud/generators/connect-to-nx-cloud/schema.json +38 -38
- 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/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
|
@@ -1,185 +1,185 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema",
|
|
3
|
+
"$id": "https://nx.dev",
|
|
4
|
+
"title": "JSON schema for Nx workspaces",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"version": {
|
|
8
|
+
"type": "number",
|
|
9
|
+
"enum": [1, 2]
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
"allOf": [
|
|
13
|
+
{
|
|
14
|
+
"if": {
|
|
15
|
+
"properties": { "version": { "const": 2 } },
|
|
16
|
+
"required": ["version"]
|
|
17
|
+
},
|
|
18
|
+
"then": {
|
|
19
|
+
"properties": {
|
|
20
|
+
"projects": {
|
|
21
|
+
"type": "object",
|
|
22
|
+
"additionalProperties": {
|
|
23
|
+
"oneOf": [
|
|
24
|
+
{
|
|
25
|
+
"type": "string"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"type": "object",
|
|
29
|
+
"properties": {
|
|
30
|
+
"targets": {
|
|
31
|
+
"type": "object",
|
|
32
|
+
"description": "Configures all the targets which define what tasks you can run against the project",
|
|
33
|
+
"additionalProperties": {
|
|
21
34
|
"type": "object",
|
|
22
|
-
"
|
|
23
|
-
|
|
35
|
+
"properties": {
|
|
36
|
+
"executor": {
|
|
37
|
+
"description": "The function that Nx will invoke when you run this target",
|
|
38
|
+
"type": "string"
|
|
39
|
+
},
|
|
40
|
+
"options": {
|
|
41
|
+
"type": "object"
|
|
42
|
+
},
|
|
43
|
+
"outputs": {
|
|
44
|
+
"type": "array",
|
|
45
|
+
"items": {
|
|
46
|
+
"type": "string"
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
"configurations": {
|
|
50
|
+
"type": "object",
|
|
51
|
+
"description": "provides extra sets of values that will be merged into the options map",
|
|
52
|
+
"additionalProperties": {
|
|
53
|
+
"type": "object"
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
"dependsOn": {
|
|
57
|
+
"type": "array",
|
|
58
|
+
"description": "Target dependency.",
|
|
59
|
+
"items": {
|
|
60
|
+
"oneOf": [
|
|
24
61
|
{
|
|
25
|
-
|
|
62
|
+
"type": "string"
|
|
26
63
|
},
|
|
27
64
|
{
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
"properties": {
|
|
36
|
-
"executor": {
|
|
37
|
-
"description": "The function that Nx will invoke when you run this target",
|
|
38
|
-
"type": "string"
|
|
39
|
-
},
|
|
40
|
-
"options": {
|
|
41
|
-
"type": "object"
|
|
42
|
-
},
|
|
43
|
-
"outputs": {
|
|
44
|
-
"type": "array",
|
|
45
|
-
"items": {
|
|
46
|
-
"type": "string"
|
|
47
|
-
}
|
|
48
|
-
},
|
|
49
|
-
"configurations": {
|
|
50
|
-
"type": "object",
|
|
51
|
-
"description": "provides extra sets of values that will be merged into the options map",
|
|
52
|
-
"additionalProperties": {
|
|
53
|
-
"type": "object"
|
|
54
|
-
}
|
|
55
|
-
},
|
|
56
|
-
"dependsOn": {
|
|
57
|
-
"type": "array",
|
|
58
|
-
"description": "Target dependency.",
|
|
59
|
-
"items": {
|
|
60
|
-
"oneOf": [
|
|
61
|
-
{
|
|
62
|
-
"type": "string"
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
"type": "object",
|
|
66
|
-
"properties": {
|
|
67
|
-
"projects": {
|
|
68
|
-
"oneOf": [
|
|
69
|
-
{
|
|
70
|
-
"type": "string",
|
|
71
|
-
"description": "A project name"
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
"type": "array",
|
|
75
|
-
"description": "An array of project names",
|
|
76
|
-
"items": {
|
|
77
|
-
"type": "string"
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
]
|
|
81
|
-
},
|
|
82
|
-
"dependencies": {
|
|
83
|
-
"type": "boolean"
|
|
84
|
-
},
|
|
85
|
-
"target": {
|
|
86
|
-
"type": "string",
|
|
87
|
-
"description": "The name of the target."
|
|
88
|
-
},
|
|
89
|
-
"params": {
|
|
90
|
-
"type": "string",
|
|
91
|
-
"description": "Configuration for params handling.",
|
|
92
|
-
"enum": ["ignore", "forward"],
|
|
93
|
-
"default": "ignore"
|
|
94
|
-
}
|
|
95
|
-
},
|
|
96
|
-
"oneOf": [
|
|
97
|
-
{
|
|
98
|
-
"required": ["projects", "target"]
|
|
99
|
-
},
|
|
100
|
-
{
|
|
101
|
-
"required": ["dependencies", "target"]
|
|
102
|
-
},
|
|
103
|
-
{
|
|
104
|
-
"required": ["target"],
|
|
105
|
-
"not": {
|
|
106
|
-
"anyOf": [
|
|
107
|
-
{ "required": ["projects"] },
|
|
108
|
-
{ "required": ["dependencies"] }
|
|
109
|
-
]
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
],
|
|
113
|
-
"additionalProperties": false
|
|
114
|
-
}
|
|
115
|
-
]
|
|
116
|
-
}
|
|
117
|
-
},
|
|
118
|
-
"command": {
|
|
119
|
-
"type": "string",
|
|
120
|
-
"description": "A shorthand for using the nx:run-commands executor"
|
|
121
|
-
},
|
|
122
|
-
"cache": {
|
|
123
|
-
"type": "boolean",
|
|
124
|
-
"description": "Specifies if the given target should be cacheable"
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
},
|
|
129
|
-
"tags": {
|
|
130
|
-
"type": "array",
|
|
131
|
-
"items": {
|
|
132
|
-
"type": "string"
|
|
133
|
-
}
|
|
65
|
+
"type": "object",
|
|
66
|
+
"properties": {
|
|
67
|
+
"projects": {
|
|
68
|
+
"oneOf": [
|
|
69
|
+
{
|
|
70
|
+
"type": "string",
|
|
71
|
+
"description": "A project name"
|
|
134
72
|
},
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
73
|
+
{
|
|
74
|
+
"type": "array",
|
|
75
|
+
"description": "An array of project names",
|
|
76
|
+
"items": {
|
|
77
|
+
"type": "string"
|
|
78
|
+
}
|
|
140
79
|
}
|
|
80
|
+
]
|
|
81
|
+
},
|
|
82
|
+
"dependencies": {
|
|
83
|
+
"type": "boolean"
|
|
84
|
+
},
|
|
85
|
+
"target": {
|
|
86
|
+
"type": "string",
|
|
87
|
+
"description": "The name of the target."
|
|
88
|
+
},
|
|
89
|
+
"params": {
|
|
90
|
+
"type": "string",
|
|
91
|
+
"description": "Configuration for params handling.",
|
|
92
|
+
"enum": ["ignore", "forward"],
|
|
93
|
+
"default": "ignore"
|
|
141
94
|
}
|
|
95
|
+
},
|
|
96
|
+
"oneOf": [
|
|
97
|
+
{
|
|
98
|
+
"required": ["projects", "target"]
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
"required": ["dependencies", "target"]
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"required": ["target"],
|
|
105
|
+
"not": {
|
|
106
|
+
"anyOf": [
|
|
107
|
+
{ "required": ["projects"] },
|
|
108
|
+
{ "required": ["dependencies"] }
|
|
109
|
+
]
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
],
|
|
113
|
+
"additionalProperties": false
|
|
142
114
|
}
|
|
143
|
-
|
|
115
|
+
]
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
"command": {
|
|
119
|
+
"type": "string",
|
|
120
|
+
"description": "A shorthand for using the nx:run-commands executor"
|
|
121
|
+
},
|
|
122
|
+
"cache": {
|
|
123
|
+
"type": "boolean",
|
|
124
|
+
"description": "Specifies if the given target should be cacheable"
|
|
125
|
+
}
|
|
144
126
|
}
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
"tags": {
|
|
130
|
+
"type": "array",
|
|
131
|
+
"items": {
|
|
132
|
+
"type": "string"
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
"implicitDependencies": {
|
|
136
|
+
"type": "array",
|
|
137
|
+
"items": {
|
|
138
|
+
"type": "string"
|
|
139
|
+
}
|
|
145
140
|
}
|
|
141
|
+
}
|
|
146
142
|
}
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
143
|
+
]
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
"else": {
|
|
149
|
+
"properties": {
|
|
150
|
+
"projects": {
|
|
151
|
+
"type": "object",
|
|
152
|
+
"additionalProperties": {
|
|
153
|
+
"type": "object",
|
|
154
|
+
"properties": {
|
|
155
|
+
"architect": {
|
|
156
|
+
"type": "object",
|
|
157
|
+
"description": "Configures all the targets which define what tasks you can run against the project",
|
|
158
|
+
"additionalProperties": {
|
|
159
|
+
"type": "object",
|
|
160
|
+
"properties": {
|
|
161
|
+
"builder": {
|
|
162
|
+
"description": "The function that Nx will invoke when you run this architect",
|
|
163
|
+
"type": "string"
|
|
164
|
+
},
|
|
165
|
+
"options": {
|
|
166
|
+
"type": "object"
|
|
167
|
+
},
|
|
168
|
+
"configurations": {
|
|
151
169
|
"type": "object",
|
|
170
|
+
"description": "provides extra sets of values that will be merged into the options map",
|
|
152
171
|
"additionalProperties": {
|
|
153
|
-
|
|
154
|
-
"properties": {
|
|
155
|
-
"architect": {
|
|
156
|
-
"type": "object",
|
|
157
|
-
"description": "Configures all the targets which define what tasks you can run against the project",
|
|
158
|
-
"additionalProperties": {
|
|
159
|
-
"type": "object",
|
|
160
|
-
"properties": {
|
|
161
|
-
"builder": {
|
|
162
|
-
"description": "The function that Nx will invoke when you run this architect",
|
|
163
|
-
"type": "string"
|
|
164
|
-
},
|
|
165
|
-
"options": {
|
|
166
|
-
"type": "object"
|
|
167
|
-
},
|
|
168
|
-
"configurations": {
|
|
169
|
-
"type": "object",
|
|
170
|
-
"description": "provides extra sets of values that will be merged into the options map",
|
|
171
|
-
"additionalProperties": {
|
|
172
|
-
"type": "object"
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
}
|
|
172
|
+
"type": "object"
|
|
179
173
|
}
|
|
174
|
+
}
|
|
180
175
|
}
|
|
176
|
+
}
|
|
181
177
|
}
|
|
178
|
+
}
|
|
182
179
|
}
|
|
180
|
+
}
|
|
183
181
|
}
|
|
184
|
-
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
]
|
|
185
185
|
}
|
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,34 +1,34 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
},
|
|
13
|
-
"writeNxCloudRules": {
|
|
14
|
-
"type": "boolean",
|
|
15
|
-
"description": "Whether to write Nx Cloud rules",
|
|
16
|
-
"default": false
|
|
17
|
-
},
|
|
18
|
-
"packageVersion": {
|
|
19
|
-
"type": "string",
|
|
20
|
-
"description": "The version of the package to use",
|
|
21
|
-
"default": "latest"
|
|
22
|
-
},
|
|
23
|
-
"agents": {
|
|
24
|
-
"type": "array",
|
|
25
|
-
"description": "The agents to setup Nx configuration for.",
|
|
26
|
-
"items": {
|
|
27
|
-
"type": "string",
|
|
28
|
-
"enum": ["claude", "gemini", "codex", "cursor", "copilot"]
|
|
29
|
-
},
|
|
30
|
-
"default": ["claude", "gemini", "codex", "cursor", "copilot"]
|
|
31
|
-
}
|
|
2
|
+
"$schema": "https://json-schema.org/schema",
|
|
3
|
+
"$id": "SetupAiAgents",
|
|
4
|
+
"title": "Set Up AI Agents",
|
|
5
|
+
"description": "Sets up the Nx MCP & rule files for common AI Agents.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"properties": {
|
|
8
|
+
"directory": {
|
|
9
|
+
"type": "string",
|
|
10
|
+
"description": "Directory where the AI agent configuration files will be generated",
|
|
11
|
+
"default": "."
|
|
32
12
|
},
|
|
33
|
-
"
|
|
13
|
+
"writeNxCloudRules": {
|
|
14
|
+
"type": "boolean",
|
|
15
|
+
"description": "Whether to write Nx Cloud rules",
|
|
16
|
+
"default": false
|
|
17
|
+
},
|
|
18
|
+
"packageVersion": {
|
|
19
|
+
"type": "string",
|
|
20
|
+
"description": "The version of the package to use",
|
|
21
|
+
"default": "latest"
|
|
22
|
+
},
|
|
23
|
+
"agents": {
|
|
24
|
+
"type": "array",
|
|
25
|
+
"description": "The agents to setup Nx configuration for.",
|
|
26
|
+
"items": {
|
|
27
|
+
"type": "string",
|
|
28
|
+
"enum": ["claude", "gemini", "codex", "cursor", "copilot"]
|
|
29
|
+
},
|
|
30
|
+
"default": ["claude", "gemini", "codex", "cursor", "copilot"]
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"required": ["directory"]
|
|
34
34
|
}
|
|
@@ -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
|
}
|
|
@@ -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 {
|