nx 23.1.0-beta.5 → 23.1.0-beta.7
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/dist/src/command-line/init/init-v2.js +1 -1
- package/dist/src/command-line/nx-cloud/connect/connect-to-nx-cloud.d.ts +1 -1
- package/dist/src/command-line/nx-cloud/connect/connect-to-nx-cloud.js +28 -21
- package/dist/src/core/graph/main.js +1 -1
- package/dist/src/native/index.d.ts +6 -0
- package/dist/src/native/nx.wasm32-wasi.debug.wasm +0 -0
- package/dist/src/native/nx.wasm32-wasi.wasm +0 -0
- package/dist/src/plugins/js/lock-file/bun-parser.js +61 -38
- package/dist/src/plugins/package-json/create-nodes.js +5 -3
- package/dist/src/project-graph/operators.d.ts +0 -1
- package/dist/src/project-graph/operators.js +0 -44
- package/dist/src/project-graph/project-graph-builder.js +26 -10
- package/dist/src/project-graph/utils/project-configuration-utils.js +28 -28
- package/dist/src/tasks-runner/batch/run-batch.js +3 -0
- package/dist/src/tasks-runner/life-cycle.d.ts +7 -0
- package/dist/src/tasks-runner/life-cycle.js +7 -0
- package/dist/src/tasks-runner/life-cycles/performance-report.js +5 -5
- package/dist/src/tasks-runner/run-command.js +12 -4
- package/dist/src/tasks-runner/utils.d.ts +1 -0
- package/dist/src/tasks-runner/utils.js +10 -2
- package/dist/src/utils/ab-testing.d.ts +4 -4
- package/dist/src/utils/ab-testing.js +5 -5
- package/package.json +11 -11
|
@@ -348,7 +348,7 @@ async function runInit(options, baseMeta) {
|
|
|
348
348
|
}
|
|
349
349
|
else {
|
|
350
350
|
nxCloudChoice = options.interactive
|
|
351
|
-
? await (0, connect_to_nx_cloud_1.connectExistingRepoToNxCloudPrompt)()
|
|
351
|
+
? await (0, connect_to_nx_cloud_1.connectExistingRepoToNxCloudPrompt)('init', 'setupNxCloud', false)
|
|
352
352
|
: 'skip';
|
|
353
353
|
}
|
|
354
354
|
if (nxCloudChoice === 'yes') {
|
|
@@ -9,5 +9,5 @@ export declare function connectToNxCloudCommand(options: {
|
|
|
9
9
|
generateToken?: boolean;
|
|
10
10
|
checkRemote?: boolean;
|
|
11
11
|
}, command?: string): Promise<boolean>;
|
|
12
|
-
export declare function connectExistingRepoToNxCloudPrompt(command?: string, key?: MessageKey): Promise<MessageOptionKey>;
|
|
12
|
+
export declare function connectExistingRepoToNxCloudPrompt(command?: string, key?: MessageKey, recordCompletion?: boolean): Promise<MessageOptionKey>;
|
|
13
13
|
export declare function connectToNxCloudWithPrompt(command: string): Promise<void>;
|
|
@@ -180,27 +180,34 @@ async function runConnectToNxCloud(options, command) {
|
|
|
180
180
|
function sleep(ms) {
|
|
181
181
|
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
182
182
|
}
|
|
183
|
-
async function connectExistingRepoToNxCloudPrompt(command = 'init', key = 'setupNxCloud') {
|
|
184
|
-
const res = await nxCloudPrompt(key,
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
183
|
+
async function connectExistingRepoToNxCloudPrompt(command = 'init', key = 'setupNxCloud', recordCompletion = true) {
|
|
184
|
+
const res = await nxCloudPrompt(key, utmContentForCommand(command));
|
|
185
|
+
// TODO: once legacy init-v1 (the NX_ADD_PLUGINS=false / useInferencePlugins:false path) is
|
|
186
|
+
// removed, drop this recordStat and the recordCompletion flag entirely - init-v2 records its
|
|
187
|
+
// own complete, and view-logs should record its own stat, so this shared helper won't record.
|
|
188
|
+
// init-v2 records its own init "complete" stat, so it opts out here to avoid double-counting.
|
|
189
|
+
// Other callers (e.g. view-logs, legacy init-v1) rely on this as their only completion event.
|
|
190
|
+
if (recordCompletion) {
|
|
191
|
+
await (0, ab_testing_1.recordStat)({
|
|
192
|
+
command,
|
|
193
|
+
nxVersion: versions_1.nxVersion,
|
|
194
|
+
useCloud: res === 'yes',
|
|
195
|
+
meta: {
|
|
196
|
+
type: 'complete',
|
|
197
|
+
setupCloudPrompt: ab_testing_1.messages.codeOfSelectedPromptMessage(key) || '',
|
|
198
|
+
nxCloudArg: res,
|
|
199
|
+
nodeVersion: process.versions.node,
|
|
200
|
+
os: process.platform,
|
|
201
|
+
packageManager: (0, package_manager_1.detectPackageManager)(),
|
|
202
|
+
aiAgent: (0, native_1.isAiAgent)(),
|
|
203
|
+
isCI: (0, is_ci_1.isCI)(),
|
|
204
|
+
},
|
|
205
|
+
});
|
|
206
|
+
}
|
|
200
207
|
return res;
|
|
201
208
|
}
|
|
202
209
|
async function connectToNxCloudWithPrompt(command) {
|
|
203
|
-
const setNxCloud = await nxCloudPrompt('setupNxCloud',
|
|
210
|
+
const setNxCloud = await nxCloudPrompt('setupNxCloud', utmContentForCommand(command));
|
|
204
211
|
let useCloud = false;
|
|
205
212
|
if (setNxCloud === 'yes') {
|
|
206
213
|
useCloud = await connectToNxCloudCommand({ generateToken: false }, command);
|
|
@@ -229,7 +236,7 @@ async function connectToNxCloudWithPrompt(command) {
|
|
|
229
236
|
},
|
|
230
237
|
});
|
|
231
238
|
}
|
|
232
|
-
function
|
|
239
|
+
function utmContentForCommand(command) {
|
|
233
240
|
switch (command) {
|
|
234
241
|
case 'migrate':
|
|
235
242
|
return 'nx-migrate';
|
|
@@ -239,7 +246,7 @@ function utmMediumForCommand(command) {
|
|
|
239
246
|
return 'nx-init';
|
|
240
247
|
}
|
|
241
248
|
}
|
|
242
|
-
async function nxCloudPrompt(key,
|
|
249
|
+
async function nxCloudPrompt(key, utmContent) {
|
|
243
250
|
const { message, choices, initial, footer, hint } = ab_testing_1.messages.getPrompt(key);
|
|
244
251
|
const promptConfig = {
|
|
245
252
|
name: 'NxCloud',
|
|
@@ -249,7 +256,7 @@ async function nxCloudPrompt(key, utmMedium) {
|
|
|
249
256
|
initial,
|
|
250
257
|
}; // meeroslav: types in enquirer are not up to date
|
|
251
258
|
if (footer) {
|
|
252
|
-
promptConfig.footer = () => pc.dim(`${footer} ${(0, ab_testing_1.nxCloudHyperlink)(
|
|
259
|
+
promptConfig.footer = () => pc.dim(`${footer} ${(0, ab_testing_1.nxCloudHyperlink)(utmContent)}`);
|
|
253
260
|
}
|
|
254
261
|
if (hint) {
|
|
255
262
|
promptConfig.hint = () => pc.dim(hint);
|