create-nx-workspace 20.2.2 → 20.3.0-beta.1
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.
|
@@ -3,13 +3,15 @@ import { CreateWorkspaceOptions } from '../src/create-workspace-options';
|
|
|
3
3
|
import { Preset } from '../src/utils/preset/preset';
|
|
4
4
|
interface BaseArguments extends CreateWorkspaceOptions {
|
|
5
5
|
preset: Preset;
|
|
6
|
+
linter?: 'none' | 'eslint';
|
|
7
|
+
formatter?: 'none' | 'prettier';
|
|
8
|
+
workspaces?: boolean;
|
|
6
9
|
}
|
|
7
10
|
interface NoneArguments extends BaseArguments {
|
|
8
11
|
stack: 'none';
|
|
9
12
|
workspaceType?: 'package-based' | 'integrated' | 'standalone';
|
|
10
13
|
js?: boolean;
|
|
11
14
|
appName?: string | undefined;
|
|
12
|
-
formatter?: 'none' | 'prettier';
|
|
13
15
|
}
|
|
14
16
|
interface ReactArguments extends BaseArguments {
|
|
15
17
|
stack: 'react';
|
|
@@ -21,9 +23,6 @@ interface ReactArguments extends BaseArguments {
|
|
|
21
23
|
nextAppDir: boolean;
|
|
22
24
|
nextSrcDir: boolean;
|
|
23
25
|
e2eTestRunner: 'none' | 'cypress' | 'playwright';
|
|
24
|
-
linter?: 'none' | 'eslint';
|
|
25
|
-
formatter?: 'none' | 'prettier';
|
|
26
|
-
workspaces?: boolean;
|
|
27
26
|
}
|
|
28
27
|
interface AngularArguments extends BaseArguments {
|
|
29
28
|
stack: 'angular';
|
|
@@ -571,6 +571,9 @@ async function determineVueOptions(parsedArgs) {
|
|
|
571
571
|
let style = undefined;
|
|
572
572
|
let appName;
|
|
573
573
|
let e2eTestRunner = undefined;
|
|
574
|
+
let linter;
|
|
575
|
+
let formatter;
|
|
576
|
+
const workspaces = parsedArgs.workspaces ?? false;
|
|
574
577
|
if (parsedArgs.preset && parsedArgs.preset !== preset_1.Preset.Vue) {
|
|
575
578
|
preset = parsedArgs.preset;
|
|
576
579
|
if (preset === preset_1.Preset.VueStandalone || preset === preset_1.Preset.NuxtStandalone) {
|
|
@@ -582,7 +585,9 @@ async function determineVueOptions(parsedArgs) {
|
|
|
582
585
|
}
|
|
583
586
|
else {
|
|
584
587
|
const framework = await determineVueFramework(parsedArgs);
|
|
585
|
-
const workspaceType =
|
|
588
|
+
const workspaceType = workspaces
|
|
589
|
+
? 'monorepo'
|
|
590
|
+
: await determineStandaloneOrMonorepo();
|
|
586
591
|
if (workspaceType === 'standalone') {
|
|
587
592
|
appName = parsedArgs.appName ?? parsedArgs.name;
|
|
588
593
|
}
|
|
@@ -640,7 +645,23 @@ async function determineVueOptions(parsedArgs) {
|
|
|
640
645
|
]);
|
|
641
646
|
style = reply.style;
|
|
642
647
|
}
|
|
643
|
-
|
|
648
|
+
if (workspaces) {
|
|
649
|
+
linter = await determineLinterOptions(parsedArgs);
|
|
650
|
+
formatter = await determineFormatterOptions(parsedArgs);
|
|
651
|
+
}
|
|
652
|
+
else {
|
|
653
|
+
linter = 'eslint';
|
|
654
|
+
formatter = 'prettier';
|
|
655
|
+
}
|
|
656
|
+
return {
|
|
657
|
+
preset,
|
|
658
|
+
style,
|
|
659
|
+
appName,
|
|
660
|
+
e2eTestRunner,
|
|
661
|
+
linter,
|
|
662
|
+
formatter,
|
|
663
|
+
workspaces,
|
|
664
|
+
};
|
|
644
665
|
}
|
|
645
666
|
async function determineAngularOptions(parsedArgs) {
|
|
646
667
|
let preset;
|
|
@@ -795,6 +816,9 @@ async function determineNodeOptions(parsedArgs) {
|
|
|
795
816
|
let appName;
|
|
796
817
|
let framework;
|
|
797
818
|
let docker;
|
|
819
|
+
let linter;
|
|
820
|
+
let formatter;
|
|
821
|
+
const workspaces = parsedArgs.workspaces ?? false;
|
|
798
822
|
if (parsedArgs.preset) {
|
|
799
823
|
preset = parsedArgs.preset;
|
|
800
824
|
if (preset === preset_1.Preset.Nest ||
|
|
@@ -814,7 +838,9 @@ async function determineNodeOptions(parsedArgs) {
|
|
|
814
838
|
}
|
|
815
839
|
else {
|
|
816
840
|
framework = await determineNodeFramework(parsedArgs);
|
|
817
|
-
const workspaceType =
|
|
841
|
+
const workspaceType = workspaces
|
|
842
|
+
? 'monorepo'
|
|
843
|
+
: await determineStandaloneOrMonorepo();
|
|
818
844
|
if (workspaceType === 'standalone') {
|
|
819
845
|
preset = preset_1.Preset.NodeStandalone;
|
|
820
846
|
appName = parsedArgs.name;
|
|
@@ -848,11 +874,22 @@ async function determineNodeOptions(parsedArgs) {
|
|
|
848
874
|
]);
|
|
849
875
|
docker = reply.docker === 'Yes';
|
|
850
876
|
}
|
|
877
|
+
if (workspaces) {
|
|
878
|
+
linter = await determineLinterOptions(parsedArgs);
|
|
879
|
+
formatter = await determineFormatterOptions(parsedArgs);
|
|
880
|
+
}
|
|
881
|
+
else {
|
|
882
|
+
linter = 'eslint';
|
|
883
|
+
formatter = 'prettier';
|
|
884
|
+
}
|
|
851
885
|
return {
|
|
852
886
|
preset,
|
|
853
887
|
appName,
|
|
854
888
|
framework,
|
|
855
889
|
docker,
|
|
890
|
+
linter,
|
|
891
|
+
formatter,
|
|
892
|
+
workspaces,
|
|
856
893
|
};
|
|
857
894
|
}
|
|
858
895
|
async function determinePackageBasedOrIntegratedOrStandalone() {
|