nx 22.6.0-beta.11 → 22.6.0-beta.13
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/nx.d.ts +1 -1
- package/bin/nx.d.ts.map +1 -1
- package/bin/nx.js +1 -1
- package/package.json +11 -11
- package/src/analytics/analytics.d.ts +1 -1
- package/src/analytics/analytics.d.ts.map +1 -1
- package/src/analytics/analytics.js +23 -130
- package/src/analytics/index.d.ts +1 -1
- package/src/analytics/index.d.ts.map +1 -1
- package/src/analytics/index.js +2 -2
- package/src/command-line/init/implementation/dot-nx/nxw.js +8 -2
- package/src/command-line/migrate/migrate.d.ts.map +1 -1
- package/src/command-line/migrate/migrate.js +4 -14
- package/src/command-line/nx-commands.d.ts.map +1 -1
- package/src/command-line/nx-commands.js +3 -1
- package/src/command-line/show/command-object.d.ts.map +1 -1
- package/src/command-line/show/command-object.js +6 -0
- package/src/core/graph/main.js +1 -1
- package/src/core/graph/styles.css +1 -1
- package/src/daemon/server/project-graph-incremental-recomputation.d.ts +1 -0
- package/src/daemon/server/project-graph-incremental-recomputation.d.ts.map +1 -1
- package/src/daemon/server/project-graph-incremental-recomputation.js +3 -1
- package/src/daemon/server/server.d.ts +1 -0
- package/src/daemon/server/server.d.ts.map +1 -1
- package/src/daemon/server/server.js +1 -9
- package/src/hasher/hash-task.d.ts +1 -1
- package/src/hasher/hash-task.d.ts.map +1 -1
- package/src/hasher/hash-task.js +2 -2
- package/src/native/index.d.ts +607 -0
- package/src/native/nx.wasm32-wasi.debug.wasm +0 -0
- package/src/native/nx.wasm32-wasi.wasm +0 -0
- package/src/project-graph/build-project-graph.d.ts.map +1 -1
- package/src/project-graph/build-project-graph.js +2 -1
- package/src/project-graph/plugins/isolation/plugin-worker.d.ts +1 -1
- package/src/project-graph/plugins/isolation/plugin-worker.d.ts.map +1 -1
- package/src/project-graph/plugins/isolation/plugin-worker.js +3 -3
- package/src/project-graph/plugins/loaded-nx-plugin.d.ts.map +1 -1
- package/src/project-graph/plugins/loaded-nx-plugin.js +2 -1
- package/src/project-graph/project-graph.d.ts.map +1 -1
- package/src/project-graph/project-graph.js +23 -12
- package/src/tasks-runner/life-cycle.d.ts +2 -0
- package/src/tasks-runner/life-cycle.d.ts.map +1 -1
- package/src/tasks-runner/life-cycle.js +7 -0
- package/src/tasks-runner/task-graph-utils.d.ts +5 -0
- package/src/tasks-runner/task-graph-utils.d.ts.map +1 -1
- package/src/tasks-runner/task-graph-utils.js +28 -0
- package/src/tasks-runner/task-orchestrator.d.ts +9 -3
- package/src/tasks-runner/task-orchestrator.d.ts.map +1 -1
- package/src/tasks-runner/task-orchestrator.js +96 -115
- package/src/utils/analytics-prompt.d.ts.map +1 -1
- package/src/utils/analytics-prompt.js +3 -12
- package/src/utils/perf-logging.d.ts +4 -1
- package/src/utils/perf-logging.d.ts.map +1 -1
- package/src/utils/perf-logging.js +28 -2
- package/src/utils/write-formatted-json-file.d.ts +7 -0
- package/src/utils/write-formatted-json-file.d.ts.map +1 -0
- package/src/utils/write-formatted-json-file.js +23 -0
package/bin/nx.d.ts
CHANGED
package/bin/nx.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nx.d.ts","sourceRoot":"","sources":["../../../../packages/nx/bin/nx.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"nx.d.ts","sourceRoot":"","sources":["../../../../packages/nx/bin/nx.ts"],"names":[],"mappings":";AAiCA,OAAO,2BAA2B,CAAC"}
|
package/bin/nx.js
CHANGED
|
@@ -25,6 +25,7 @@ const client_1 = require("../src/daemon/client/client");
|
|
|
25
25
|
const db_connection_1 = require("../src/utils/db-connection");
|
|
26
26
|
const analytics_prompt_1 = require("../src/utils/analytics-prompt");
|
|
27
27
|
const analytics_1 = require("../src/analytics");
|
|
28
|
+
require("../src/utils/perf-logging");
|
|
28
29
|
async function main() {
|
|
29
30
|
if (process.argv[2] !== 'report' &&
|
|
30
31
|
process.argv[2] !== '--version' &&
|
|
@@ -32,7 +33,6 @@ async function main() {
|
|
|
32
33
|
process.argv[2] !== 'reset') {
|
|
33
34
|
(0, assert_supported_platform_1.assertSupportedPlatform)();
|
|
34
35
|
}
|
|
35
|
-
require('nx/src/utils/perf-logging');
|
|
36
36
|
const workspace = (0, find_workspace_root_1.findWorkspaceRoot)(process.cwd());
|
|
37
37
|
if (workspace) {
|
|
38
38
|
perf_hooks_1.performance.mark('loading dotenv files:start');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nx",
|
|
3
|
-
"version": "22.6.0-beta.
|
|
3
|
+
"version": "22.6.0-beta.13",
|
|
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": {
|
|
@@ -85,16 +85,16 @@
|
|
|
85
85
|
}
|
|
86
86
|
},
|
|
87
87
|
"optionalDependencies": {
|
|
88
|
-
"@nx/nx-darwin-arm64": "22.6.0-beta.
|
|
89
|
-
"@nx/nx-darwin-x64": "22.6.0-beta.
|
|
90
|
-
"@nx/nx-freebsd-x64": "22.6.0-beta.
|
|
91
|
-
"@nx/nx-linux-arm-gnueabihf": "22.6.0-beta.
|
|
92
|
-
"@nx/nx-linux-arm64-gnu": "22.6.0-beta.
|
|
93
|
-
"@nx/nx-linux-arm64-musl": "22.6.0-beta.
|
|
94
|
-
"@nx/nx-linux-x64-gnu": "22.6.0-beta.
|
|
95
|
-
"@nx/nx-linux-x64-musl": "22.6.0-beta.
|
|
96
|
-
"@nx/nx-win32-arm64-msvc": "22.6.0-beta.
|
|
97
|
-
"@nx/nx-win32-x64-msvc": "22.6.0-beta.
|
|
88
|
+
"@nx/nx-darwin-arm64": "22.6.0-beta.13",
|
|
89
|
+
"@nx/nx-darwin-x64": "22.6.0-beta.13",
|
|
90
|
+
"@nx/nx-freebsd-x64": "22.6.0-beta.13",
|
|
91
|
+
"@nx/nx-linux-arm-gnueabihf": "22.6.0-beta.13",
|
|
92
|
+
"@nx/nx-linux-arm64-gnu": "22.6.0-beta.13",
|
|
93
|
+
"@nx/nx-linux-arm64-musl": "22.6.0-beta.13",
|
|
94
|
+
"@nx/nx-linux-x64-gnu": "22.6.0-beta.13",
|
|
95
|
+
"@nx/nx-linux-x64-musl": "22.6.0-beta.13",
|
|
96
|
+
"@nx/nx-win32-arm64-msvc": "22.6.0-beta.13",
|
|
97
|
+
"@nx/nx-win32-x64-msvc": "22.6.0-beta.13"
|
|
98
98
|
},
|
|
99
99
|
"nx-migrations": {
|
|
100
100
|
"migrations": "./migrations.json",
|
|
@@ -2,7 +2,7 @@ export declare function startAnalytics(): Promise<void>;
|
|
|
2
2
|
export declare function reportNxAddCommand(packageName: string, version: string): void;
|
|
3
3
|
export declare function reportNxGenerateCommand(generator: string): void;
|
|
4
4
|
export declare function reportCommandRunEvent(command: string, parameters?: Record<string, any>, args?: Record<string, any>): void;
|
|
5
|
-
export declare function
|
|
5
|
+
export declare function reportPerfEvent(name: string, duration: number): void;
|
|
6
6
|
export declare function argsToQueryString(args: Record<string, any>): string;
|
|
7
7
|
export declare function flushAnalytics(): void;
|
|
8
8
|
//# sourceMappingURL=analytics.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"analytics.d.ts","sourceRoot":"","sources":["../../../../../packages/nx/src/analytics/analytics.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"analytics.d.ts","sourceRoot":"","sources":["../../../../../packages/nx/src/analytics/analytics.ts"],"names":[],"mappings":"AA2CA,wBAAsB,cAAc,kBAuDnC;AAED,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,QAKtE;AAED,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,MAAM,QAIxD;AAED,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,MAAM,EACf,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAChC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,QAW3B;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,QAI7D;AAsBD,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAcnE;AAmDD,wBAAgB,cAAc,SAW7B"}
|
|
@@ -4,7 +4,7 @@ exports.startAnalytics = startAnalytics;
|
|
|
4
4
|
exports.reportNxAddCommand = reportNxAddCommand;
|
|
5
5
|
exports.reportNxGenerateCommand = reportNxGenerateCommand;
|
|
6
6
|
exports.reportCommandRunEvent = reportCommandRunEvent;
|
|
7
|
-
exports.
|
|
7
|
+
exports.reportPerfEvent = reportPerfEvent;
|
|
8
8
|
exports.argsToQueryString = argsToQueryString;
|
|
9
9
|
exports.flushAnalytics = flushAnalytics;
|
|
10
10
|
const nx_json_1 = require("../config/nx-json");
|
|
@@ -17,6 +17,7 @@ const os = require("os");
|
|
|
17
17
|
const machine_id_cache_1 = require("../utils/machine-id-cache");
|
|
18
18
|
const is_ci_1 = require("../utils/is-ci");
|
|
19
19
|
const analytics_prompt_1 = require("../utils/analytics-prompt");
|
|
20
|
+
const db_connection_1 = require("../utils/db-connection");
|
|
20
21
|
// Conditionally import telemetry functions only on non-WASM platforms
|
|
21
22
|
let initializeTelemetry;
|
|
22
23
|
let flushTelemetry;
|
|
@@ -55,7 +56,8 @@ async function startAnalytics() {
|
|
|
55
56
|
? `${nodeVersion.major}.${nodeVersion.minor}.${nodeVersion.patch}`
|
|
56
57
|
: 'unknown';
|
|
57
58
|
try {
|
|
58
|
-
|
|
59
|
+
const dbConnection = (0, db_connection_1.getDbConnection)();
|
|
60
|
+
initializeTelemetry(dbConnection, workspaceId, userId, versions_1.nxVersion, packageManagerInfo.name, packageManagerInfo.version, nodeVersionString, os.arch(), os.platform(), os.release(), !!(0, is_ci_1.isCI)(), isNxCloud);
|
|
59
61
|
_telemetryInitialized = true;
|
|
60
62
|
// Flush analytics automatically on process exit so every code path
|
|
61
63
|
// is covered without needing explicit exitAndFlushAnalytics() calls.
|
|
@@ -92,152 +94,43 @@ function reportCommandRunEvent(command, parameters, args) {
|
|
|
92
94
|
}
|
|
93
95
|
trackPageView(command, pageLocation, parameters);
|
|
94
96
|
}
|
|
95
|
-
function
|
|
96
|
-
trackEvent(
|
|
97
|
+
function reportPerfEvent(name, duration) {
|
|
98
|
+
trackEvent(name, {
|
|
97
99
|
[customDimensions.duration]: duration,
|
|
98
100
|
});
|
|
99
101
|
}
|
|
100
|
-
const
|
|
102
|
+
const SKIP_ARGS_KEYS = new Set([
|
|
101
103
|
'$0',
|
|
102
104
|
'_',
|
|
103
105
|
'__overrides_unparsed__',
|
|
104
106
|
'__overrides__',
|
|
105
107
|
]);
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
'
|
|
110
|
-
'
|
|
111
|
-
'
|
|
112
|
-
'exclude',
|
|
113
|
-
'groups',
|
|
114
|
-
'group',
|
|
115
|
-
'appProject',
|
|
116
|
-
'e2eProject',
|
|
117
|
-
'backendProject',
|
|
118
|
-
'name',
|
|
119
|
-
// File paths — could reveal usernames, directory structure, client names
|
|
120
|
-
'file',
|
|
121
|
-
'files',
|
|
122
|
-
'cwd',
|
|
123
|
-
'envFile',
|
|
124
|
-
'outputPath',
|
|
125
|
-
'tsConfig',
|
|
126
|
-
'directory',
|
|
127
|
-
'source',
|
|
128
|
-
'destination',
|
|
129
|
-
'sourceDirectory',
|
|
130
|
-
'destinationDirectory',
|
|
131
|
-
'main',
|
|
132
|
-
'index',
|
|
133
|
-
'polyfills',
|
|
134
|
-
'config',
|
|
135
|
-
'configFile',
|
|
136
|
-
'webpackConfig',
|
|
137
|
-
'rspackConfig',
|
|
138
|
-
'viteConfig',
|
|
139
|
-
'jestConfig',
|
|
140
|
-
'cypressConfig',
|
|
141
|
-
'entryFile',
|
|
142
|
-
'coverageDirectory',
|
|
143
|
-
'projectRoot',
|
|
144
|
-
'sourceRoot',
|
|
145
|
-
'workspaceRoot',
|
|
146
|
-
'input',
|
|
147
|
-
'output',
|
|
148
|
-
// URLs and hosts — could expose internal infrastructure
|
|
149
|
-
'host',
|
|
150
|
-
'baseUrl',
|
|
151
|
-
'baseHref',
|
|
152
|
-
'deployUrl',
|
|
153
|
-
'publicUrl',
|
|
154
|
-
'publicPath',
|
|
155
|
-
'url',
|
|
156
|
-
'remote',
|
|
157
|
-
'registry',
|
|
158
|
-
'sourceRepository',
|
|
159
|
-
// Package/module names — could reveal private packages
|
|
160
|
-
'importPath',
|
|
161
|
-
'npmScope',
|
|
162
|
-
'packageName',
|
|
163
|
-
'moduleName',
|
|
164
|
-
'packageSpecifier',
|
|
165
|
-
'packageAndVersion',
|
|
166
|
-
'generator',
|
|
167
|
-
'collection',
|
|
168
|
-
'plugin',
|
|
169
|
-
'bundleName',
|
|
170
|
-
'entryName',
|
|
171
|
-
'outputFileName',
|
|
172
|
-
// Free-form text — could contain anything
|
|
173
|
-
'message',
|
|
174
|
-
'commitPrefix',
|
|
175
|
-
'gitCommitMessage',
|
|
176
|
-
'gitTagMessage',
|
|
177
|
-
'gitCommitArgs',
|
|
178
|
-
'gitTagArgs',
|
|
179
|
-
'gitPushArgs',
|
|
180
|
-
'command',
|
|
181
|
-
'commands',
|
|
182
|
-
'script',
|
|
183
|
-
'description',
|
|
184
|
-
'prefix',
|
|
185
|
-
'displayName',
|
|
186
|
-
'tags',
|
|
187
|
-
'title',
|
|
188
|
-
'label',
|
|
189
|
-
'scope',
|
|
190
|
-
'tag',
|
|
191
|
-
// Credentials and auth
|
|
192
|
-
'otp',
|
|
193
|
-
'key',
|
|
108
|
+
// String args with fixed enum values that are safe to include in analytics.
|
|
109
|
+
// All boolean and number args are included automatically.
|
|
110
|
+
const ALLOWED_STRING_ARGS = new Set([
|
|
111
|
+
'outputStyle',
|
|
112
|
+
'type',
|
|
113
|
+
'view',
|
|
194
114
|
'access',
|
|
195
|
-
'
|
|
196
|
-
|
|
197
|
-
'
|
|
198
|
-
'
|
|
199
|
-
'ref',
|
|
200
|
-
'from',
|
|
201
|
-
'to',
|
|
202
|
-
// Keys that can be string paths (not just booleans)
|
|
203
|
-
'runMigrations',
|
|
204
|
-
'graph',
|
|
115
|
+
'preset',
|
|
116
|
+
'interactive',
|
|
117
|
+
'printConfig',
|
|
118
|
+
'resolveVersionPlans',
|
|
205
119
|
]);
|
|
206
|
-
function isSensitiveKey(key) {
|
|
207
|
-
if (SENSITIVE_ARGS_KEYS.has(key))
|
|
208
|
-
return true;
|
|
209
|
-
// Normalize kebab-case to camelCase and re-check
|
|
210
|
-
if (key.includes('-')) {
|
|
211
|
-
const camelKey = key.replace(/-(.)/g, (_, c) => c.toUpperCase());
|
|
212
|
-
return SENSITIVE_ARGS_KEYS.has(camelKey);
|
|
213
|
-
}
|
|
214
|
-
return false;
|
|
215
|
-
}
|
|
216
|
-
function sanitizeValue(value) {
|
|
217
|
-
// Preserve booleans — we still want to know true vs false
|
|
218
|
-
if (typeof value === 'boolean') {
|
|
219
|
-
return String(value);
|
|
220
|
-
}
|
|
221
|
-
return '<redacted>';
|
|
222
|
-
}
|
|
223
120
|
function argsToQueryString(args) {
|
|
224
121
|
const params = new URLSearchParams();
|
|
225
122
|
for (const [key, value] of Object.entries(args)) {
|
|
226
|
-
if (
|
|
123
|
+
if (SKIP_ARGS_KEYS.has(key))
|
|
227
124
|
continue;
|
|
228
125
|
if (value === undefined || value === null)
|
|
229
126
|
continue;
|
|
230
|
-
if (typeof value === '
|
|
231
|
-
|
|
232
|
-
const sensitive = isSensitiveKey(key);
|
|
233
|
-
if (Array.isArray(value)) {
|
|
234
|
-
for (const item of value) {
|
|
235
|
-
params.append(key, sensitive ? sanitizeValue(item) : String(item));
|
|
236
|
-
}
|
|
127
|
+
if (typeof value === 'boolean' || typeof value === 'number') {
|
|
128
|
+
params.append(key, String(value));
|
|
237
129
|
}
|
|
238
|
-
else {
|
|
239
|
-
params.append(key,
|
|
130
|
+
else if (typeof value === 'string' && ALLOWED_STRING_ARGS.has(key)) {
|
|
131
|
+
params.append(key, value);
|
|
240
132
|
}
|
|
133
|
+
// All other types (strings, arrays, objects) are dropped
|
|
241
134
|
}
|
|
242
135
|
return params.toString();
|
|
243
136
|
}
|
package/src/analytics/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { startAnalytics, reportNxAddCommand, reportNxGenerateCommand, reportCommandRunEvent,
|
|
1
|
+
export { startAnalytics, reportNxAddCommand, reportNxGenerateCommand, reportCommandRunEvent, reportPerfEvent, flushAnalytics, } from './analytics';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../packages/nx/src/analytics/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,uBAAuB,EACvB,qBAAqB,EACrB
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../packages/nx/src/analytics/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,uBAAuB,EACvB,qBAAqB,EACrB,eAAe,EACf,cAAc,GACf,MAAM,aAAa,CAAC"}
|
package/src/analytics/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.flushAnalytics = exports.
|
|
3
|
+
exports.flushAnalytics = exports.reportPerfEvent = exports.reportCommandRunEvent = exports.reportNxGenerateCommand = exports.reportNxAddCommand = exports.startAnalytics = void 0;
|
|
4
4
|
var analytics_1 = require("./analytics");
|
|
5
5
|
Object.defineProperty(exports, "startAnalytics", { enumerable: true, get: function () { return analytics_1.startAnalytics; } });
|
|
6
6
|
Object.defineProperty(exports, "reportNxAddCommand", { enumerable: true, get: function () { return analytics_1.reportNxAddCommand; } });
|
|
7
7
|
Object.defineProperty(exports, "reportNxGenerateCommand", { enumerable: true, get: function () { return analytics_1.reportNxGenerateCommand; } });
|
|
8
8
|
Object.defineProperty(exports, "reportCommandRunEvent", { enumerable: true, get: function () { return analytics_1.reportCommandRunEvent; } });
|
|
9
|
-
Object.defineProperty(exports, "
|
|
9
|
+
Object.defineProperty(exports, "reportPerfEvent", { enumerable: true, get: function () { return analytics_1.reportPerfEvent; } });
|
|
10
10
|
Object.defineProperty(exports, "flushAnalytics", { enumerable: true, get: function () { return analytics_1.flushAnalytics; } });
|
|
@@ -83,8 +83,14 @@ function ensureUpToDateInstallation() {
|
|
|
83
83
|
process.exit(1);
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
|
-
catch {
|
|
87
|
-
|
|
86
|
+
catch (e) {
|
|
87
|
+
if (e instanceof Error &&
|
|
88
|
+
e.code === 'MODULE_NOT_FOUND') {
|
|
89
|
+
console.error('[NX]: The "nx.json" file is required when running the nx wrapper. See https://nx.dev/recipes/installation/install-non-javascript');
|
|
90
|
+
}
|
|
91
|
+
else {
|
|
92
|
+
console.error(`[NX]: Failed to parse "nx.json": ${e instanceof Error ? e.message : e}. See https://nx.dev/recipes/installation/install-non-javascript`);
|
|
93
|
+
}
|
|
88
94
|
process.exit(1);
|
|
89
95
|
}
|
|
90
96
|
try {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migrate.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/command-line/migrate/migrate.ts"],"names":[],"mappings":"AAkBA,OAAO,EACL,cAAc,EAEd,2BAA2B,IAAI,aAAa,EAE7C,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EACL,UAAU,EAIX,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"migrate.d.ts","sourceRoot":"","sources":["../../../../../../packages/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M,GAAG,GAAG,CAAA;CAAE,EAC1B,OAAO,EAAE,MAAM,EAAE,mBAmBlB;AAED,wBAAsB,YAAY,kBAgCjC;AAED,wBAAgB,uBAAuB,CAAC,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM;;;EAWxE;AAED,wBAAgB,qBAAqB,CACnC,UAAU,EAAE,cAAc,EAC1B,cAAc,EAAE,MAAM,EACtB,IAAI,EAAE,MAAM,GACX;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAyBpC;AAED,wBAAsB,SAAS,CAAC,eAAe,CAAC,EAAE,MAAM,mBAoEvD"}
|
|
@@ -19,6 +19,7 @@ const node_url_1 = require("node:url");
|
|
|
19
19
|
const util_1 = require("util");
|
|
20
20
|
const tree_1 = require("../../generators/tree");
|
|
21
21
|
const fileutils_1 = require("../../utils/fileutils");
|
|
22
|
+
const write_formatted_json_file_1 = require("../../utils/write-formatted-json-file");
|
|
22
23
|
const logger_1 = require("../../utils/logger");
|
|
23
24
|
const git_utils_1 = require("../../utils/git-utils");
|
|
24
25
|
const package_json_1 = require("../../utils/package-json");
|
|
@@ -728,7 +729,7 @@ function readPackageMigrationConfig(packageName, dir) {
|
|
|
728
729
|
}
|
|
729
730
|
}
|
|
730
731
|
async function createMigrationsFile(root, migrations) {
|
|
731
|
-
await writeFormattedJsonFile((0, path_1.join)(root, 'migrations.json'), { migrations });
|
|
732
|
+
await (0, write_formatted_json_file_1.writeFormattedJsonFile)((0, path_1.join)(root, 'migrations.json'), { migrations });
|
|
732
733
|
}
|
|
733
734
|
async function updatePackageJson(root, updatedPackages) {
|
|
734
735
|
const packageJsonPath = (0, path_1.join)(root, 'package.json');
|
|
@@ -766,7 +767,7 @@ async function updatePackageJson(root, updatedPackages) {
|
|
|
766
767
|
json[dependencyType][p] = updatedPackages[p].version;
|
|
767
768
|
}
|
|
768
769
|
});
|
|
769
|
-
await writeFormattedJsonFile(packageJsonPath, json, {
|
|
770
|
+
await (0, write_formatted_json_file_1.writeFormattedJsonFile)(packageJsonPath, json, {
|
|
770
771
|
appendNewLine: parseOptions.endsWithNewline,
|
|
771
772
|
});
|
|
772
773
|
// Update catalog definitions
|
|
@@ -812,7 +813,7 @@ async function updateInstallationDetails(root, updatedPackages) {
|
|
|
812
813
|
}
|
|
813
814
|
}
|
|
814
815
|
}
|
|
815
|
-
await writeFormattedJsonFile(nxJsonPath, nxJson, {
|
|
816
|
+
await (0, write_formatted_json_file_1.writeFormattedJsonFile)(nxJsonPath, nxJson, {
|
|
816
817
|
appendNewLine: parseOptions.endsWithNewline,
|
|
817
818
|
});
|
|
818
819
|
}
|
|
@@ -931,17 +932,6 @@ async function generateMigrationsJsonAndUpdatePackageJson(root, opts) {
|
|
|
931
932
|
throw e;
|
|
932
933
|
}
|
|
933
934
|
}
|
|
934
|
-
async function writeFormattedJsonFile(filePath, content, options) {
|
|
935
|
-
const formattedContent = await (0, format_changed_files_with_prettier_if_available_1.formatFilesWithPrettierIfAvailable)([{ path: filePath, content: JSON.stringify(content) }], workspace_root_1.workspaceRoot, { silent: true });
|
|
936
|
-
if (formattedContent.has(filePath)) {
|
|
937
|
-
(0, fs_1.writeFileSync)(filePath, formattedContent.get(filePath), {
|
|
938
|
-
encoding: 'utf-8',
|
|
939
|
-
});
|
|
940
|
-
}
|
|
941
|
-
else {
|
|
942
|
-
(0, fileutils_1.writeJsonFile)(filePath, content, options);
|
|
943
|
-
}
|
|
944
|
-
}
|
|
945
935
|
function addSplitConfigurationMigrationIfAvailable(from, packageJson) {
|
|
946
936
|
if (!packageJson['@nrwl/workspace'])
|
|
947
937
|
return [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nx-commands.d.ts","sourceRoot":"","sources":["../../../../../packages/nx/src/command-line/nx-commands.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AA8D/B,eAAO,MAAM,mBAAmB,EAAE,OAAO,CAAC,KAAK,CAAC,0BAA0B,CAEzE,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,cAAc,
|
|
1
|
+
{"version":3,"file":"nx-commands.d.ts","sourceRoot":"","sources":["../../../../../packages/nx/src/command-line/nx-commands.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AA8D/B,eAAO,MAAM,mBAAmB,EAAE,OAAO,CAAC,KAAK,CAAC,0BAA0B,CAEzE,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,cAAc,qBAkEf,CAAC"}
|
|
@@ -107,7 +107,9 @@ exports.commandsObject = yargs
|
|
|
107
107
|
.command(resolveConformanceCheckCommandObject())
|
|
108
108
|
.scriptName('nx')
|
|
109
109
|
.middleware((args) => {
|
|
110
|
-
const
|
|
110
|
+
const context = exports.commandsObject.getInternalMethods().getContext();
|
|
111
|
+
const command = (context.commands ?? []).join(' ') ||
|
|
112
|
+
(args._ ?? []).slice(0, 1).join(' ');
|
|
111
113
|
if (command) {
|
|
112
114
|
(0, analytics_1.reportCommandRunEvent)(command, undefined, args);
|
|
113
115
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-object.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/command-line/show/command-object.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAY,MAAM,OAAO,CAAC;AAChD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"command-object.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/command-line/show/command-object.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAY,MAAM,OAAO,CAAC;AAChD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AAS1E,MAAM,WAAW,UAAU;IACzB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,MAAM,MAAM,mBAAmB,GAAG,UAAU,GAAG;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,CAAC,EACvB,UAAU,CA+CX,CAAC"}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.yargsShowCommand = void 0;
|
|
4
4
|
const yargs_1 = require("yargs");
|
|
5
|
+
const native_1 = require("../../native");
|
|
5
6
|
const handle_errors_1 = require("../../utils/handle-errors");
|
|
6
7
|
const shared_options_1 = require("../yargs-utils/shared-options");
|
|
7
8
|
exports.yargsShowCommand = {
|
|
@@ -15,6 +16,11 @@ exports.yargsShowCommand = {
|
|
|
15
16
|
.option('json', {
|
|
16
17
|
type: 'boolean',
|
|
17
18
|
description: 'Output JSON.',
|
|
19
|
+
})
|
|
20
|
+
.middleware((args) => {
|
|
21
|
+
if (args.json == null && (0, native_1.isAiAgent)()) {
|
|
22
|
+
args.json = true;
|
|
23
|
+
}
|
|
18
24
|
})
|
|
19
25
|
.example('$0 show projects', 'Show a list of all projects in the workspace')
|
|
20
26
|
.example('$0 show projects --with-target serve', 'Show a list of all projects in the workspace that have a "serve" target')
|