create-nx-workspace 20.4.0 → 20.4.2
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/create-nx-workspace.js +19 -13
- package/package.json +1 -1
|
@@ -321,7 +321,7 @@ async function determinePresetOptions(parsedArgs) {
|
|
|
321
321
|
return parsedArgs;
|
|
322
322
|
}
|
|
323
323
|
}
|
|
324
|
-
async function determineFormatterOptions(args) {
|
|
324
|
+
async function determineFormatterOptions(args, opts) {
|
|
325
325
|
if (args.formatter)
|
|
326
326
|
return args.formatter;
|
|
327
327
|
const reply = await enquirer.prompt([
|
|
@@ -337,13 +337,13 @@ async function determineFormatterOptions(args) {
|
|
|
337
337
|
name: 'No',
|
|
338
338
|
},
|
|
339
339
|
],
|
|
340
|
-
initial: 1,
|
|
340
|
+
initial: opts?.preferPrettier ? 0 : 1,
|
|
341
341
|
skip: !args.interactive || (0, is_ci_1.isCI)(),
|
|
342
342
|
},
|
|
343
343
|
]);
|
|
344
344
|
return reply.prettier === 'Yes' ? 'prettier' : 'none';
|
|
345
345
|
}
|
|
346
|
-
async function determineLinterOptions(args) {
|
|
346
|
+
async function determineLinterOptions(args, opts) {
|
|
347
347
|
const reply = await enquirer.prompt([
|
|
348
348
|
{
|
|
349
349
|
name: 'eslint',
|
|
@@ -357,7 +357,7 @@ async function determineLinterOptions(args) {
|
|
|
357
357
|
name: 'No',
|
|
358
358
|
},
|
|
359
359
|
],
|
|
360
|
-
initial: 1,
|
|
360
|
+
initial: opts?.preferEslint ? 0 : 1,
|
|
361
361
|
skip: !args.interactive || (0, is_ci_1.isCI)(),
|
|
362
362
|
},
|
|
363
363
|
]);
|
|
@@ -565,8 +565,10 @@ async function determineReactOptions(parsedArgs) {
|
|
|
565
565
|
style = reply.style;
|
|
566
566
|
}
|
|
567
567
|
if (workspaces) {
|
|
568
|
-
linter = await determineLinterOptions(parsedArgs);
|
|
569
|
-
formatter = await determineFormatterOptions(parsedArgs
|
|
568
|
+
linter = await determineLinterOptions(parsedArgs, { preferEslint: true });
|
|
569
|
+
formatter = await determineFormatterOptions(parsedArgs, {
|
|
570
|
+
preferPrettier: true,
|
|
571
|
+
});
|
|
570
572
|
}
|
|
571
573
|
else {
|
|
572
574
|
linter = 'eslint';
|
|
@@ -670,8 +672,10 @@ async function determineVueOptions(parsedArgs) {
|
|
|
670
672
|
style = reply.style;
|
|
671
673
|
}
|
|
672
674
|
if (workspaces) {
|
|
673
|
-
linter = await determineLinterOptions(parsedArgs);
|
|
674
|
-
formatter = await determineFormatterOptions(parsedArgs
|
|
675
|
+
linter = await determineLinterOptions(parsedArgs, { preferEslint: true });
|
|
676
|
+
formatter = await determineFormatterOptions(parsedArgs, {
|
|
677
|
+
preferPrettier: true,
|
|
678
|
+
});
|
|
675
679
|
}
|
|
676
680
|
else {
|
|
677
681
|
linter = 'eslint';
|
|
@@ -907,8 +911,10 @@ async function determineNodeOptions(parsedArgs) {
|
|
|
907
911
|
exclude: 'vitest',
|
|
908
912
|
});
|
|
909
913
|
if (workspaces) {
|
|
910
|
-
linter = await determineLinterOptions(parsedArgs);
|
|
911
|
-
formatter = await determineFormatterOptions(parsedArgs
|
|
914
|
+
linter = await determineLinterOptions(parsedArgs, { preferEslint: true });
|
|
915
|
+
formatter = await determineFormatterOptions(parsedArgs, {
|
|
916
|
+
preferPrettier: true,
|
|
917
|
+
});
|
|
912
918
|
}
|
|
913
919
|
else {
|
|
914
920
|
linter = 'eslint';
|
|
@@ -1198,16 +1204,16 @@ async function determineUnitTestRunner(parsedArgs, options) {
|
|
|
1198
1204
|
.filter((t) => !options?.exclude || options.exclude !== t.name)
|
|
1199
1205
|
.sort((a, b) => {
|
|
1200
1206
|
if (a.name === 'none')
|
|
1201
|
-
return -1;
|
|
1202
|
-
if (b.name === 'none')
|
|
1203
1207
|
return 1;
|
|
1208
|
+
if (b.name === 'none')
|
|
1209
|
+
return -1;
|
|
1204
1210
|
if (options?.preferVitest && a.name === 'vitest')
|
|
1205
1211
|
return -1;
|
|
1206
1212
|
if (options?.preferVitest && b.name === 'vitest')
|
|
1207
1213
|
return 1;
|
|
1208
1214
|
return 0;
|
|
1209
1215
|
}),
|
|
1210
|
-
initial: 0,
|
|
1216
|
+
initial: 0, // This should be either vite or jest
|
|
1211
1217
|
},
|
|
1212
1218
|
]);
|
|
1213
1219
|
return reply.unitTestRunner;
|