nx 22.1.1 → 22.2.0-canary.20251121-9a6c7ad
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/bin/init-local.d.ts.map +1 -1
- package/bin/init-local.js +40 -2
- package/executors.json +16 -16
- package/generators.json +13 -13
- package/migrations.json +143 -143
- package/package.json +11 -14
- package/presets/npm.json +4 -4
- package/schemas/nx-schema.json +1286 -1286
- package/schemas/project-schema.json +359 -359
- package/schemas/workspace-schema.json +165 -165
- package/src/ai/set-up-ai-agents/schema.json +31 -31
- package/src/daemon/client/client.d.ts +3 -0
- package/src/daemon/client/client.d.ts.map +1 -1
- package/src/daemon/client/client.js +14 -0
- package/src/daemon/message-types/nx-console.d.ts +18 -0
- package/src/daemon/message-types/nx-console.d.ts.map +1 -0
- package/src/daemon/message-types/nx-console.js +19 -0
- package/src/daemon/server/handle-nx-console.d.ts +4 -0
- package/src/daemon/server/handle-nx-console.d.ts.map +1 -0
- package/src/daemon/server/handle-nx-console.js +54 -0
- package/src/daemon/server/nx-console-operations.d.ts +31 -0
- package/src/daemon/server/nx-console-operations.d.ts.map +1 -0
- package/src/daemon/server/nx-console-operations.js +135 -0
- package/src/daemon/server/server.d.ts.map +1 -1
- package/src/daemon/server/server.js +12 -0
- package/src/daemon/server/shutdown-utils.d.ts.map +1 -1
- package/src/daemon/server/shutdown-utils.js +3 -0
- package/src/devkit-internals.d.ts +1 -1
- package/src/devkit-internals.d.ts.map +1 -1
- package/src/devkit-internals.js +2 -1
- 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/utils/package-json.d.ts +4 -0
- package/src/utils/package-json.d.ts.map +1 -1
- package/src/utils/package-json.js +45 -11
|
@@ -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
|
-
|
|
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": {
|
|
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": {
|
|
34
21
|
"type": "object",
|
|
35
|
-
"
|
|
36
|
-
|
|
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": [
|
|
22
|
+
"additionalProperties": {
|
|
23
|
+
"oneOf": [
|
|
61
24
|
{
|
|
62
|
-
|
|
25
|
+
"type": "string"
|
|
63
26
|
},
|
|
64
27
|
{
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
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": {
|
|
34
|
+
"type": "object",
|
|
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
|
+
}
|
|
72
134
|
},
|
|
73
|
-
{
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
}
|
|
135
|
+
"implicitDependencies": {
|
|
136
|
+
"type": "array",
|
|
137
|
+
"items": {
|
|
138
|
+
"type": "string"
|
|
139
|
+
}
|
|
79
140
|
}
|
|
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
141
|
}
|
|
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
142
|
}
|
|
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
|
-
}
|
|
143
|
+
]
|
|
126
144
|
}
|
|
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
|
-
}
|
|
140
145
|
}
|
|
141
|
-
}
|
|
142
146
|
}
|
|
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": {
|
|
147
|
+
},
|
|
148
|
+
"else": {
|
|
149
|
+
"properties": {
|
|
150
|
+
"projects": {
|
|
169
151
|
"type": "object",
|
|
170
|
-
"description": "provides extra sets of values that will be merged into the options map",
|
|
171
152
|
"additionalProperties": {
|
|
172
|
-
|
|
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": {
|
|
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
|
+
}
|
|
173
179
|
}
|
|
174
|
-
}
|
|
175
180
|
}
|
|
176
|
-
}
|
|
177
181
|
}
|
|
178
|
-
}
|
|
179
182
|
}
|
|
180
|
-
}
|
|
181
183
|
}
|
|
182
|
-
|
|
183
|
-
}
|
|
184
|
-
]
|
|
184
|
+
]
|
|
185
185
|
}
|
|
@@ -1,34 +1,34 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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": "."
|
|
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
|
+
}
|
|
12
32
|
},
|
|
13
|
-
"
|
|
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"]
|
|
33
|
+
"required": ["directory"]
|
|
34
34
|
}
|
|
@@ -6,6 +6,7 @@ import { ConfigurationSourceMaps } from '../../project-graph/utils/project-confi
|
|
|
6
6
|
import { NxWorkspaceFiles, TaskRun, TaskTarget } from '../../native';
|
|
7
7
|
import type { FlushSyncGeneratorChangesResult, SyncGeneratorRunResult } from '../../utils/sync-generators';
|
|
8
8
|
import { PostTasksExecutionContext, PreTasksExecutionContext } from '../../project-graph/plugins/public-api';
|
|
9
|
+
import { type NxConsoleStatusResponse, type SetNxConsolePreferenceAndInstallResponse } from '../message-types/nx-console';
|
|
9
10
|
export type UnregisterCallback = () => void;
|
|
10
11
|
export type ChangedFile = {
|
|
11
12
|
path: string;
|
|
@@ -69,6 +70,8 @@ export declare class DaemonClient {
|
|
|
69
70
|
updateWorkspaceContext(createdFiles: string[], updatedFiles: string[], deletedFiles: string[]): Promise<void>;
|
|
70
71
|
runPreTasksExecution(context: PreTasksExecutionContext): Promise<NodeJS.ProcessEnv[]>;
|
|
71
72
|
runPostTasksExecution(context: PostTasksExecutionContext): Promise<void>;
|
|
73
|
+
getNxConsoleStatus(): Promise<NxConsoleStatusResponse>;
|
|
74
|
+
setNxConsolePreferenceAndInstall(preference: boolean): Promise<SetNxConsolePreferenceAndInstallResponse>;
|
|
72
75
|
isServerAvailable(): Promise<boolean>;
|
|
73
76
|
private sendToDaemonViaQueue;
|
|
74
77
|
private setUpConnection;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/daemon/client/client.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAS,MAAM,eAAe,CAAC;AAoBpD,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAUpE,OAAO,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAChD,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,uBAAuB,EAAE,MAAM,uDAAuD,CAAC;AAKhG,OAAO,EAAW,gBAAgB,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAoC9E,OAAO,KAAK,EACV,+BAA+B,EAC/B,sBAAsB,EACvB,MAAM,6BAA6B,CAAC;AAcrC,OAAO,EACL,yBAAyB,EACzB,wBAAwB,EACzB,MAAM,wCAAwC,CAAC;
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/daemon/client/client.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAS,MAAM,eAAe,CAAC;AAoBpD,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAUpE,OAAO,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAChD,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,uBAAuB,EAAE,MAAM,uDAAu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zB,OAAO,EAAE,yBAAyB,GACjC,OAAO,CAAC,IAAI,CAAC;IAQhB,kBAAkB,IAAI,OAAO,CAAC,uBAAuB,CAAC;IAOtD,gCAAgC,CAC9B,UAAU,EAAE,OAAO,GAClB,OAAO,CAAC,wCAAwC,CAAC;IAQ9C,iBAAiB,IAAI,OAAO,CAAC,OAAO,CAAC;YAgB7B,oBAAoB;IASlC,OAAO,CAAC,eAAe;YAoDT,mBAAmB;YAuCnB,uCAAuC;IAiBrD,OAAO,CAAC,gCAAgC;IAyBxC,OAAO,CAAC,aAAa;IAmDf,iBAAiB,IAAI,OAAO,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;IAwDjD,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAkB5B;AAED,eAAO,MAAM,YAAY,cAAqB,CAAC;AAE/C,wBAAgB,eAAe,YAE9B"}
|
|
@@ -32,6 +32,7 @@ const flush_sync_generator_changes_to_disk_1 = require("../message-types/flush-s
|
|
|
32
32
|
const delayed_spinner_1 = require("../../utils/delayed-spinner");
|
|
33
33
|
const run_tasks_execution_hooks_1 = require("../message-types/run-tasks-execution-hooks");
|
|
34
34
|
const register_project_graph_listener_1 = require("../message-types/register-project-graph-listener");
|
|
35
|
+
const nx_console_1 = require("../message-types/nx-console");
|
|
35
36
|
const node_v8_1 = require("node:v8");
|
|
36
37
|
const consume_messages_from_socket_1 = require("../../utils/consume-messages-from-socket");
|
|
37
38
|
const project_graph_1 = require("../../project-graph/project-graph");
|
|
@@ -359,6 +360,19 @@ class DaemonClient {
|
|
|
359
360
|
};
|
|
360
361
|
return this.sendToDaemonViaQueue(message);
|
|
361
362
|
}
|
|
363
|
+
getNxConsoleStatus() {
|
|
364
|
+
const message = {
|
|
365
|
+
type: nx_console_1.GET_NX_CONSOLE_STATUS,
|
|
366
|
+
};
|
|
367
|
+
return this.sendToDaemonViaQueue(message);
|
|
368
|
+
}
|
|
369
|
+
setNxConsolePreferenceAndInstall(preference) {
|
|
370
|
+
const message = {
|
|
371
|
+
type: nx_console_1.SET_NX_CONSOLE_PREFERENCE_AND_INSTALL,
|
|
372
|
+
preference,
|
|
373
|
+
};
|
|
374
|
+
return this.sendToDaemonViaQueue(message);
|
|
375
|
+
}
|
|
362
376
|
async isServerAvailable() {
|
|
363
377
|
return new Promise((resolve) => {
|
|
364
378
|
try {
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export declare const GET_NX_CONSOLE_STATUS: "GET_NX_CONSOLE_STATUS";
|
|
2
|
+
export declare const SET_NX_CONSOLE_PREFERENCE_AND_INSTALL: "SET_NX_CONSOLE_PREFERENCE_AND_INSTALL";
|
|
3
|
+
export type HandleGetNxConsoleStatusMessage = {
|
|
4
|
+
type: typeof GET_NX_CONSOLE_STATUS;
|
|
5
|
+
};
|
|
6
|
+
export type NxConsoleStatusResponse = {
|
|
7
|
+
shouldPrompt: boolean;
|
|
8
|
+
};
|
|
9
|
+
export type HandleSetNxConsolePreferenceAndInstallMessage = {
|
|
10
|
+
type: typeof SET_NX_CONSOLE_PREFERENCE_AND_INSTALL;
|
|
11
|
+
preference: boolean;
|
|
12
|
+
};
|
|
13
|
+
export type SetNxConsolePreferenceAndInstallResponse = {
|
|
14
|
+
installed: boolean;
|
|
15
|
+
};
|
|
16
|
+
export declare function isHandleGetNxConsoleStatusMessage(message: unknown): message is HandleGetNxConsoleStatusMessage;
|
|
17
|
+
export declare function isHandleSetNxConsolePreferenceAndInstallMessage(message: unknown): message is HandleSetNxConsolePreferenceAndInstallMessage;
|
|
18
|
+
//# sourceMappingURL=nx-console.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nx-console.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/daemon/message-types/nx-console.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,qBAAqB,EAAG,uBAAgC,CAAC;AACtE,eAAO,MAAM,qCAAqC,EAChD,uCAAgD,CAAC;AAEnD,MAAM,MAAM,+BAA+B,GAAG;IAC5C,IAAI,EAAE,OAAO,qBAAqB,CAAC;CACpC,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG;IACpC,YAAY,EAAE,OAAO,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,6CAA6C,GAAG;IAC1D,IAAI,EAAE,OAAO,qCAAqC,CAAC;IACnD,UAAU,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,wCAAwC,GAAG;IACrD,SAAS,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,wBAAgB,iCAAiC,CAC/C,OAAO,EAAE,OAAO,GACf,OAAO,IAAI,+BAA+B,CAO5C;AAED,wBAAgB,+CAA+C,CAC7D,OAAO,EAAE,OAAO,GACf,OAAO,IAAI,6CAA6C,CAO1D"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SET_NX_CONSOLE_PREFERENCE_AND_INSTALL = exports.GET_NX_CONSOLE_STATUS = void 0;
|
|
4
|
+
exports.isHandleGetNxConsoleStatusMessage = isHandleGetNxConsoleStatusMessage;
|
|
5
|
+
exports.isHandleSetNxConsolePreferenceAndInstallMessage = isHandleSetNxConsolePreferenceAndInstallMessage;
|
|
6
|
+
exports.GET_NX_CONSOLE_STATUS = 'GET_NX_CONSOLE_STATUS';
|
|
7
|
+
exports.SET_NX_CONSOLE_PREFERENCE_AND_INSTALL = 'SET_NX_CONSOLE_PREFERENCE_AND_INSTALL';
|
|
8
|
+
function isHandleGetNxConsoleStatusMessage(message) {
|
|
9
|
+
return (typeof message === 'object' &&
|
|
10
|
+
message !== null &&
|
|
11
|
+
'type' in message &&
|
|
12
|
+
message['type'] === exports.GET_NX_CONSOLE_STATUS);
|
|
13
|
+
}
|
|
14
|
+
function isHandleSetNxConsolePreferenceAndInstallMessage(message) {
|
|
15
|
+
return (typeof message === 'object' &&
|
|
16
|
+
message !== null &&
|
|
17
|
+
'type' in message &&
|
|
18
|
+
message['type'] === exports.SET_NX_CONSOLE_PREFERENCE_AND_INSTALL);
|
|
19
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { HandlerResult } from './server';
|
|
2
|
+
export declare function handleGetNxConsoleStatus(): Promise<HandlerResult>;
|
|
3
|
+
export declare function handleSetNxConsolePreferenceAndInstall(preference: boolean): Promise<HandlerResult>;
|
|
4
|
+
//# sourceMappingURL=handle-nx-console.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handle-nx-console.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/daemon/server/handle-nx-console.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAU9C,wBAAsB,wBAAwB,IAAI,OAAO,CAAC,aAAa,CAAC,CAmCvE;AAED,wBAAsB,sCAAsC,CAC1D,UAAU,EAAE,OAAO,GAClB,OAAO,CAAC,aAAa,CAAC,CAexB"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.handleGetNxConsoleStatus = handleGetNxConsoleStatus;
|
|
4
|
+
exports.handleSetNxConsolePreferenceAndInstall = handleSetNxConsolePreferenceAndInstall;
|
|
5
|
+
const nx_console_operations_1 = require("./nx-console-operations");
|
|
6
|
+
// Module-level state for caching
|
|
7
|
+
let cachedShouldPrompt = null;
|
|
8
|
+
let isComputing = false;
|
|
9
|
+
async function handleGetNxConsoleStatus() {
|
|
10
|
+
// Return cached result if available
|
|
11
|
+
if (cachedShouldPrompt !== null) {
|
|
12
|
+
const response = {
|
|
13
|
+
shouldPrompt: cachedShouldPrompt,
|
|
14
|
+
};
|
|
15
|
+
return {
|
|
16
|
+
response,
|
|
17
|
+
description: 'handleGetNxConsoleStatus',
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
// Kick off background computation if not already running
|
|
21
|
+
if (!isComputing) {
|
|
22
|
+
isComputing = true;
|
|
23
|
+
(0, nx_console_operations_1.getNxConsoleStatus)()
|
|
24
|
+
.then((result) => {
|
|
25
|
+
cachedShouldPrompt = result;
|
|
26
|
+
isComputing = false;
|
|
27
|
+
})
|
|
28
|
+
.catch(() => {
|
|
29
|
+
cachedShouldPrompt = null;
|
|
30
|
+
isComputing = false;
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
// Return false for shouldPrompt if cache not ready (main process will noop)
|
|
34
|
+
const response = {
|
|
35
|
+
shouldPrompt: false,
|
|
36
|
+
};
|
|
37
|
+
return {
|
|
38
|
+
response,
|
|
39
|
+
description: 'handleGetNxConsoleStatus',
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
async function handleSetNxConsolePreferenceAndInstall(preference) {
|
|
43
|
+
// Immediately update cache - we know the answer now!
|
|
44
|
+
// User answered the prompt, so we won't prompt again
|
|
45
|
+
cachedShouldPrompt = false;
|
|
46
|
+
const result = await (0, nx_console_operations_1.handleNxConsolePreferenceAndInstall)({ preference });
|
|
47
|
+
const response = {
|
|
48
|
+
installed: result.installed,
|
|
49
|
+
};
|
|
50
|
+
return {
|
|
51
|
+
response,
|
|
52
|
+
description: 'handleSetNxConsolePreferenceAndInstall',
|
|
53
|
+
};
|
|
54
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Gets the Nx Console status (whether we should prompt the user to install).
|
|
3
|
+
* Uses latest Nx version if available, falls back to local implementation.
|
|
4
|
+
*
|
|
5
|
+
* @returns boolean indicating whether we should prompt the user
|
|
6
|
+
*/
|
|
7
|
+
export declare function getNxConsoleStatus({ inner, }?: {
|
|
8
|
+
inner?: boolean;
|
|
9
|
+
}): Promise<boolean>;
|
|
10
|
+
/**
|
|
11
|
+
* Handles user preference submission and installs Nx Console if requested.
|
|
12
|
+
* Uses latest Nx version if available, falls back to local implementation.
|
|
13
|
+
*
|
|
14
|
+
* @param preference - whether the user wants to install Nx Console
|
|
15
|
+
* @returns object indicating whether installation succeeded
|
|
16
|
+
*/
|
|
17
|
+
export declare function handleNxConsolePreferenceAndInstall({ preference, inner, }: {
|
|
18
|
+
preference: boolean;
|
|
19
|
+
inner?: boolean;
|
|
20
|
+
}): Promise<{
|
|
21
|
+
installed: boolean;
|
|
22
|
+
}>;
|
|
23
|
+
/**
|
|
24
|
+
* Clean up the latest Nx installation on daemon shutdown.
|
|
25
|
+
*/
|
|
26
|
+
export declare function cleanupLatestNxInstallation(): void;
|
|
27
|
+
export declare function getNxConsoleStatusImpl(): Promise<boolean>;
|
|
28
|
+
export declare function handleNxConsolePreferenceAndInstallImpl(preference: boolean): Promise<{
|
|
29
|
+
installed: boolean;
|
|
30
|
+
}>;
|
|
31
|
+
//# sourceMappingURL=nx-console-operations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nx-console-operations.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/daemon/server/nx-console-operations.ts"],"names":[],"mappings":"AAiBA;;;;;GAKG;AACH,wBAAsB,kBAAkB,CAAC,EACvC,KAAK,GACN,GAAE;IACD,KAAK,CAAC,EAAE,OAAO,CAAC;CACZ,GAAG,OAAO,CAAC,OAAO,CAAC,CAwCxB;AAED;;;;;;GAMG;AACH,wBAAsB,mCAAmC,CAAC,EACxD,UAAU,EACV,KAAK,GACN,EAAE;IACD,UAAU,EAAE,OAAO,CAAC;IACpB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,GAAG,OAAO,CAAC;IAAE,SAAS,EAAE,OAAO,CAAA;CAAE,CAAC,CAgDlC;AAED;;GAEG;AACH,wBAAgB,2BAA2B,IAAI,IAAI,CAOlD;AAED,wBAAsB,sBAAsB,IAAI,OAAO,CAAC,OAAO,CAAC,CAsB/D;AAED,wBAAsB,uCAAuC,CAC3D,UAAU,EAAE,OAAO,GAClB,OAAO,CAAC;IAAE,SAAS,EAAE,OAAO,CAAA;CAAE,CAAC,CAUjC"}
|