@angular/cli 14.1.0-next.2 → 14.1.0-rc.0
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/lib/config/schema.json +139 -144
- package/lib/init.js +9 -9
- package/package.json +14 -14
- package/src/command-builder/architect-command-module.js +8 -2
- package/src/command-builder/command-module.js +2 -7
- package/src/command-builder/command-runner.js +1 -1
- package/src/commands/config/cli.js +2 -17
- package/src/commands/new/cli.js +1 -1
- package/src/commands/update/cli.d.ts +1 -0
- package/src/commands/update/cli.js +23 -20
- package/src/utilities/color.js +0 -1
- package/src/utilities/config.d.ts +1 -1
- package/src/utilities/config.js +9 -2
package/lib/config/schema.json
CHANGED
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"defaultProject": {
|
|
24
24
|
"type": "string",
|
|
25
25
|
"description": "Default project name used in commands.",
|
|
26
|
-
"
|
|
26
|
+
"deprecated": true
|
|
27
27
|
},
|
|
28
28
|
"projects": {
|
|
29
29
|
"type": "object",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"defaultCollection": {
|
|
47
47
|
"description": "The default schematics collection to use.",
|
|
48
48
|
"type": "string",
|
|
49
|
-
"
|
|
49
|
+
"deprecated": true
|
|
50
50
|
},
|
|
51
51
|
"schematicCollections": {
|
|
52
52
|
"type": "array",
|
|
@@ -74,7 +74,8 @@
|
|
|
74
74
|
"description": "Show a warning when the global version is newer than the local one.",
|
|
75
75
|
"type": "boolean"
|
|
76
76
|
}
|
|
77
|
-
}
|
|
77
|
+
},
|
|
78
|
+
"additionalProperties": false
|
|
78
79
|
},
|
|
79
80
|
"analytics": {
|
|
80
81
|
"type": [
|
|
@@ -96,7 +97,8 @@
|
|
|
96
97
|
"type": "string",
|
|
97
98
|
"format": "uuid"
|
|
98
99
|
}
|
|
99
|
-
}
|
|
100
|
+
},
|
|
101
|
+
"additionalProperties": false
|
|
100
102
|
},
|
|
101
103
|
"cache": {
|
|
102
104
|
"description": "Control disk cache.",
|
|
@@ -119,7 +121,82 @@
|
|
|
119
121
|
"description": "Cache base path.",
|
|
120
122
|
"type": "string"
|
|
121
123
|
}
|
|
124
|
+
},
|
|
125
|
+
"additionalProperties": false
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
"additionalProperties": false
|
|
129
|
+
},
|
|
130
|
+
"cliGlobalOptions": {
|
|
131
|
+
"type": "object",
|
|
132
|
+
"properties": {
|
|
133
|
+
"defaultCollection": {
|
|
134
|
+
"description": "The default schematics collection to use.",
|
|
135
|
+
"type": "string",
|
|
136
|
+
"deprecated": true
|
|
137
|
+
},
|
|
138
|
+
"schematicCollections": {
|
|
139
|
+
"type": "array",
|
|
140
|
+
"description": "The list of schematic collections to use.",
|
|
141
|
+
"items": {
|
|
142
|
+
"type": "string",
|
|
143
|
+
"uniqueItems": true
|
|
122
144
|
}
|
|
145
|
+
},
|
|
146
|
+
"packageManager": {
|
|
147
|
+
"description": "Specify which package manager tool to use.",
|
|
148
|
+
"type": "string",
|
|
149
|
+
"enum": [
|
|
150
|
+
"npm",
|
|
151
|
+
"cnpm",
|
|
152
|
+
"yarn",
|
|
153
|
+
"pnpm"
|
|
154
|
+
]
|
|
155
|
+
},
|
|
156
|
+
"warnings": {
|
|
157
|
+
"description": "Control CLI specific console warnings",
|
|
158
|
+
"type": "object",
|
|
159
|
+
"properties": {
|
|
160
|
+
"versionMismatch": {
|
|
161
|
+
"description": "Show a warning when the global version is newer than the local one.",
|
|
162
|
+
"type": "boolean"
|
|
163
|
+
}
|
|
164
|
+
},
|
|
165
|
+
"additionalProperties": false
|
|
166
|
+
},
|
|
167
|
+
"analytics": {
|
|
168
|
+
"type": [
|
|
169
|
+
"boolean",
|
|
170
|
+
"string"
|
|
171
|
+
],
|
|
172
|
+
"description": "Share anonymous usage data with the Angular Team at Google."
|
|
173
|
+
},
|
|
174
|
+
"analyticsSharing": {
|
|
175
|
+
"type": "object",
|
|
176
|
+
"properties": {
|
|
177
|
+
"tracking": {
|
|
178
|
+
"description": "Analytics sharing info tracking ID.",
|
|
179
|
+
"type": "string",
|
|
180
|
+
"pattern": "^(GA|UA)?-\\d+-\\d+$"
|
|
181
|
+
},
|
|
182
|
+
"uuid": {
|
|
183
|
+
"description": "Analytics sharing info universally unique identifier.",
|
|
184
|
+
"type": "string",
|
|
185
|
+
"format": "uuid"
|
|
186
|
+
}
|
|
187
|
+
},
|
|
188
|
+
"additionalProperties": false
|
|
189
|
+
},
|
|
190
|
+
"completion": {
|
|
191
|
+
"type": "object",
|
|
192
|
+
"description": "Angular CLI completion settings.",
|
|
193
|
+
"properties": {
|
|
194
|
+
"prompted": {
|
|
195
|
+
"type": "boolean",
|
|
196
|
+
"description": "Whether the user has been prompted to add completion command prompt."
|
|
197
|
+
}
|
|
198
|
+
},
|
|
199
|
+
"additionalProperties": false
|
|
123
200
|
}
|
|
124
201
|
},
|
|
125
202
|
"additionalProperties": false
|
|
@@ -186,7 +263,7 @@
|
|
|
186
263
|
"defaultCollection": {
|
|
187
264
|
"description": "The default schematics collection to use.",
|
|
188
265
|
"type": "string",
|
|
189
|
-
"
|
|
266
|
+
"deprecated": true
|
|
190
267
|
},
|
|
191
268
|
"schematicCollections": {
|
|
192
269
|
"type": "array",
|
|
@@ -608,14 +685,13 @@
|
|
|
608
685
|
"type": "object",
|
|
609
686
|
"properties": {
|
|
610
687
|
"$schema": {
|
|
611
|
-
"type": "string"
|
|
612
|
-
"format": "uri"
|
|
688
|
+
"type": "string"
|
|
613
689
|
},
|
|
614
690
|
"version": {
|
|
615
691
|
"$ref": "#/definitions/fileVersion"
|
|
616
692
|
},
|
|
617
693
|
"cli": {
|
|
618
|
-
"$ref": "#/definitions/
|
|
694
|
+
"$ref": "#/definitions/cliGlobalOptions"
|
|
619
695
|
},
|
|
620
696
|
"schematics": {
|
|
621
697
|
"$ref": "#/definitions/schematicOptions"
|
|
@@ -643,20 +719,17 @@
|
|
|
643
719
|
"$default": {
|
|
644
720
|
"$source": "argv",
|
|
645
721
|
"index": 0
|
|
646
|
-
}
|
|
647
|
-
"x-prompt": "What name would you like to use for the application?"
|
|
722
|
+
}
|
|
648
723
|
},
|
|
649
724
|
"inlineStyle": {
|
|
650
725
|
"description": "Include styles inline in the root component.ts file. Only CSS styles can be included inline. Default is false, meaning that an external styles file is created and referenced in the root component.ts file.",
|
|
651
726
|
"type": "boolean",
|
|
652
|
-
"alias": "s"
|
|
653
|
-
"x-user-analytics": 9
|
|
727
|
+
"alias": "s"
|
|
654
728
|
},
|
|
655
729
|
"inlineTemplate": {
|
|
656
730
|
"description": "Include template inline in the root component.ts file. Default is false, meaning that an external template file is created and referenced in the root component.ts file. ",
|
|
657
731
|
"type": "boolean",
|
|
658
|
-
"alias": "t"
|
|
659
|
-
"x-user-analytics": 10
|
|
732
|
+
"alias": "t"
|
|
660
733
|
},
|
|
661
734
|
"viewEncapsulation": {
|
|
662
735
|
"description": "The view encapsulation strategy to use in the new application.",
|
|
@@ -665,15 +738,12 @@
|
|
|
665
738
|
"None",
|
|
666
739
|
"ShadowDom"
|
|
667
740
|
],
|
|
668
|
-
"type": "string"
|
|
669
|
-
"x-user-analytics": 11
|
|
741
|
+
"type": "string"
|
|
670
742
|
},
|
|
671
743
|
"routing": {
|
|
672
744
|
"type": "boolean",
|
|
673
745
|
"description": "Create a routing NgModule.",
|
|
674
|
-
"default": false
|
|
675
|
-
"x-prompt": "Would you like to add Angular routing?",
|
|
676
|
-
"x-user-analytics": 17
|
|
746
|
+
"default": false
|
|
677
747
|
},
|
|
678
748
|
"prefix": {
|
|
679
749
|
"type": "string",
|
|
@@ -691,37 +761,13 @@
|
|
|
691
761
|
"scss",
|
|
692
762
|
"sass",
|
|
693
763
|
"less"
|
|
694
|
-
]
|
|
695
|
-
"x-prompt": {
|
|
696
|
-
"message": "Which stylesheet format would you like to use?",
|
|
697
|
-
"type": "list",
|
|
698
|
-
"items": [
|
|
699
|
-
{
|
|
700
|
-
"value": "css",
|
|
701
|
-
"label": "CSS"
|
|
702
|
-
},
|
|
703
|
-
{
|
|
704
|
-
"value": "scss",
|
|
705
|
-
"label": "SCSS [ https://sass-lang.com/documentation/syntax#scss ]"
|
|
706
|
-
},
|
|
707
|
-
{
|
|
708
|
-
"value": "sass",
|
|
709
|
-
"label": "Sass [ https://sass-lang.com/documentation/syntax#the-indented-syntax ]"
|
|
710
|
-
},
|
|
711
|
-
{
|
|
712
|
-
"value": "less",
|
|
713
|
-
"label": "Less [ http://lesscss.org ]"
|
|
714
|
-
}
|
|
715
|
-
]
|
|
716
|
-
},
|
|
717
|
-
"x-user-analytics": 5
|
|
764
|
+
]
|
|
718
765
|
},
|
|
719
766
|
"skipTests": {
|
|
720
767
|
"description": "Do not create \"spec.ts\" test files for the application.",
|
|
721
768
|
"type": "boolean",
|
|
722
769
|
"default": false,
|
|
723
|
-
"alias": "S"
|
|
724
|
-
"x-user-analytics": 12
|
|
770
|
+
"alias": "S"
|
|
725
771
|
},
|
|
726
772
|
"skipPackageJson": {
|
|
727
773
|
"type": "boolean",
|
|
@@ -731,8 +777,7 @@
|
|
|
731
777
|
"minimal": {
|
|
732
778
|
"description": "Create a bare-bones project without any testing frameworks. (Use for learning purposes only.)",
|
|
733
779
|
"type": "boolean",
|
|
734
|
-
"default": false
|
|
735
|
-
"x-user-analytics": 14
|
|
780
|
+
"default": false
|
|
736
781
|
},
|
|
737
782
|
"skipInstall": {
|
|
738
783
|
"description": "Skip installing dependency packages.",
|
|
@@ -742,8 +787,7 @@
|
|
|
742
787
|
"strict": {
|
|
743
788
|
"description": "Creates an application with stricter bundle budgets settings.",
|
|
744
789
|
"type": "boolean",
|
|
745
|
-
"default": true
|
|
746
|
-
"x-user-analytics": 7
|
|
790
|
+
"default": true
|
|
747
791
|
}
|
|
748
792
|
}
|
|
749
793
|
},
|
|
@@ -759,8 +803,7 @@
|
|
|
759
803
|
"$default": {
|
|
760
804
|
"$source": "argv",
|
|
761
805
|
"index": 0
|
|
762
|
-
}
|
|
763
|
-
"x-prompt": "What name would you like to use for the class?"
|
|
806
|
+
}
|
|
764
807
|
},
|
|
765
808
|
"path": {
|
|
766
809
|
"type": "string",
|
|
@@ -781,8 +824,7 @@
|
|
|
781
824
|
"skipTests": {
|
|
782
825
|
"type": "boolean",
|
|
783
826
|
"description": "Do not create \"spec.ts\" test files for the new class.",
|
|
784
|
-
"default": false
|
|
785
|
-
"x-user-analytics": 12
|
|
827
|
+
"default": false
|
|
786
828
|
},
|
|
787
829
|
"type": {
|
|
788
830
|
"type": "string",
|
|
@@ -818,8 +860,7 @@
|
|
|
818
860
|
"$default": {
|
|
819
861
|
"$source": "argv",
|
|
820
862
|
"index": 0
|
|
821
|
-
}
|
|
822
|
-
"x-prompt": "What name would you like to use for the component?"
|
|
863
|
+
}
|
|
823
864
|
},
|
|
824
865
|
"displayBlock": {
|
|
825
866
|
"description": "Specifies if the style will contain `:host { display: block; }`.",
|
|
@@ -831,21 +872,18 @@
|
|
|
831
872
|
"description": "Include styles inline in the component.ts file. Only CSS styles can be included inline. By default, an external styles file is created and referenced in the component.ts file.",
|
|
832
873
|
"type": "boolean",
|
|
833
874
|
"default": false,
|
|
834
|
-
"alias": "s"
|
|
835
|
-
"x-user-analytics": 9
|
|
875
|
+
"alias": "s"
|
|
836
876
|
},
|
|
837
877
|
"inlineTemplate": {
|
|
838
878
|
"description": "Include template inline in the component.ts file. By default, an external template file is created and referenced in the component.ts file.",
|
|
839
879
|
"type": "boolean",
|
|
840
880
|
"default": false,
|
|
841
|
-
"alias": "t"
|
|
842
|
-
"x-user-analytics": 10
|
|
881
|
+
"alias": "t"
|
|
843
882
|
},
|
|
844
883
|
"standalone": {
|
|
845
884
|
"description": "Whether the generated component is standalone.",
|
|
846
885
|
"type": "boolean",
|
|
847
|
-
"default": false
|
|
848
|
-
"x-user-analytics": 15
|
|
886
|
+
"default": false
|
|
849
887
|
},
|
|
850
888
|
"viewEncapsulation": {
|
|
851
889
|
"description": "The view encapsulation strategy to use in the new component.",
|
|
@@ -855,8 +893,7 @@
|
|
|
855
893
|
"ShadowDom"
|
|
856
894
|
],
|
|
857
895
|
"type": "string",
|
|
858
|
-
"alias": "v"
|
|
859
|
-
"x-user-analytics": 11
|
|
896
|
+
"alias": "v"
|
|
860
897
|
},
|
|
861
898
|
"changeDetection": {
|
|
862
899
|
"description": "The change detection strategy to use in the new component.",
|
|
@@ -892,8 +929,7 @@
|
|
|
892
929
|
"sass",
|
|
893
930
|
"less",
|
|
894
931
|
"none"
|
|
895
|
-
]
|
|
896
|
-
"x-user-analytics": 5
|
|
932
|
+
]
|
|
897
933
|
},
|
|
898
934
|
"type": {
|
|
899
935
|
"type": "string",
|
|
@@ -903,8 +939,7 @@
|
|
|
903
939
|
"skipTests": {
|
|
904
940
|
"type": "boolean",
|
|
905
941
|
"description": "Do not create \"spec.ts\" test files for the new component.",
|
|
906
|
-
"default": false
|
|
907
|
-
"x-user-analytics": 12
|
|
942
|
+
"default": false
|
|
908
943
|
},
|
|
909
944
|
"flat": {
|
|
910
945
|
"type": "boolean",
|
|
@@ -914,8 +949,7 @@
|
|
|
914
949
|
"skipImport": {
|
|
915
950
|
"type": "boolean",
|
|
916
951
|
"description": "Do not import this component into the owning NgModule.",
|
|
917
|
-
"default": false
|
|
918
|
-
"x-user-analytics": 18
|
|
952
|
+
"default": false
|
|
919
953
|
},
|
|
920
954
|
"selector": {
|
|
921
955
|
"type": "string",
|
|
@@ -935,8 +969,7 @@
|
|
|
935
969
|
"export": {
|
|
936
970
|
"type": "boolean",
|
|
937
971
|
"default": false,
|
|
938
|
-
"description": "The declaring NgModule exports this component."
|
|
939
|
-
"x-user-analytics": 19
|
|
972
|
+
"description": "The declaring NgModule exports this component."
|
|
940
973
|
}
|
|
941
974
|
}
|
|
942
975
|
},
|
|
@@ -952,8 +985,7 @@
|
|
|
952
985
|
"$default": {
|
|
953
986
|
"$source": "argv",
|
|
954
987
|
"index": 0
|
|
955
|
-
}
|
|
956
|
-
"x-prompt": "What name would you like to use for the directive?"
|
|
988
|
+
}
|
|
957
989
|
},
|
|
958
990
|
"path": {
|
|
959
991
|
"type": "string",
|
|
@@ -988,14 +1020,12 @@
|
|
|
988
1020
|
"skipTests": {
|
|
989
1021
|
"type": "boolean",
|
|
990
1022
|
"description": "Do not create \"spec.ts\" test files for the new class.",
|
|
991
|
-
"default": false
|
|
992
|
-
"x-user-analytics": 12
|
|
1023
|
+
"default": false
|
|
993
1024
|
},
|
|
994
1025
|
"skipImport": {
|
|
995
1026
|
"type": "boolean",
|
|
996
1027
|
"description": "Do not import this directive into the owning NgModule.",
|
|
997
|
-
"default": false
|
|
998
|
-
"x-user-analytics": 18
|
|
1028
|
+
"default": false
|
|
999
1029
|
},
|
|
1000
1030
|
"selector": {
|
|
1001
1031
|
"type": "string",
|
|
@@ -1005,8 +1035,7 @@
|
|
|
1005
1035
|
"standalone": {
|
|
1006
1036
|
"description": "Whether the generated directive is standalone.",
|
|
1007
1037
|
"type": "boolean",
|
|
1008
|
-
"default": false
|
|
1009
|
-
"x-user-analytics": 15
|
|
1038
|
+
"default": false
|
|
1010
1039
|
},
|
|
1011
1040
|
"flat": {
|
|
1012
1041
|
"type": "boolean",
|
|
@@ -1021,8 +1050,7 @@
|
|
|
1021
1050
|
"export": {
|
|
1022
1051
|
"type": "boolean",
|
|
1023
1052
|
"default": false,
|
|
1024
|
-
"description": "The declaring NgModule exports this directive."
|
|
1025
|
-
"x-user-analytics": 19
|
|
1053
|
+
"description": "The declaring NgModule exports this directive."
|
|
1026
1054
|
}
|
|
1027
1055
|
}
|
|
1028
1056
|
},
|
|
@@ -1038,8 +1066,7 @@
|
|
|
1038
1066
|
"$default": {
|
|
1039
1067
|
"$source": "argv",
|
|
1040
1068
|
"index": 0
|
|
1041
|
-
}
|
|
1042
|
-
"x-prompt": "What name would you like to use for the enum?"
|
|
1069
|
+
}
|
|
1043
1070
|
},
|
|
1044
1071
|
"path": {
|
|
1045
1072
|
"type": "string",
|
|
@@ -1075,14 +1102,12 @@
|
|
|
1075
1102
|
"$default": {
|
|
1076
1103
|
"$source": "argv",
|
|
1077
1104
|
"index": 0
|
|
1078
|
-
}
|
|
1079
|
-
"x-prompt": "What name would you like to use for the guard?"
|
|
1105
|
+
}
|
|
1080
1106
|
},
|
|
1081
1107
|
"skipTests": {
|
|
1082
1108
|
"type": "boolean",
|
|
1083
1109
|
"description": "Do not create \"spec.ts\" test files for the new guard.",
|
|
1084
|
-
"default": false
|
|
1085
|
-
"x-user-analytics": 12
|
|
1110
|
+
"default": false
|
|
1086
1111
|
},
|
|
1087
1112
|
"flat": {
|
|
1088
1113
|
"type": "boolean",
|
|
@@ -1121,8 +1146,7 @@
|
|
|
1121
1146
|
},
|
|
1122
1147
|
"default": [
|
|
1123
1148
|
"CanActivate"
|
|
1124
|
-
]
|
|
1125
|
-
"x-prompt": "Which interfaces would you like to implement?"
|
|
1149
|
+
]
|
|
1126
1150
|
}
|
|
1127
1151
|
}
|
|
1128
1152
|
},
|
|
@@ -1138,8 +1162,7 @@
|
|
|
1138
1162
|
"$default": {
|
|
1139
1163
|
"$source": "argv",
|
|
1140
1164
|
"index": 0
|
|
1141
|
-
}
|
|
1142
|
-
"x-prompt": "What name would you like to use for the interceptor?"
|
|
1165
|
+
}
|
|
1143
1166
|
},
|
|
1144
1167
|
"path": {
|
|
1145
1168
|
"type": "string",
|
|
@@ -1165,8 +1188,7 @@
|
|
|
1165
1188
|
"skipTests": {
|
|
1166
1189
|
"type": "boolean",
|
|
1167
1190
|
"description": "Do not create \"spec.ts\" test files for the new interceptor.",
|
|
1168
|
-
"default": false
|
|
1169
|
-
"x-user-analytics": 12
|
|
1191
|
+
"default": false
|
|
1170
1192
|
}
|
|
1171
1193
|
}
|
|
1172
1194
|
},
|
|
@@ -1182,8 +1204,7 @@
|
|
|
1182
1204
|
"$default": {
|
|
1183
1205
|
"$source": "argv",
|
|
1184
1206
|
"index": 0
|
|
1185
|
-
}
|
|
1186
|
-
"x-prompt": "What name would you like to use for the interface?"
|
|
1207
|
+
}
|
|
1187
1208
|
},
|
|
1188
1209
|
"path": {
|
|
1189
1210
|
"type": "string",
|
|
@@ -1219,7 +1240,6 @@
|
|
|
1219
1240
|
"title": "Library Options Schema",
|
|
1220
1241
|
"type": "object",
|
|
1221
1242
|
"description": "Creates a new, generic library project in the current workspace.",
|
|
1222
|
-
"long-description": "./library-long.md",
|
|
1223
1243
|
"additionalProperties": false,
|
|
1224
1244
|
"properties": {
|
|
1225
1245
|
"name": {
|
|
@@ -1229,8 +1249,7 @@
|
|
|
1229
1249
|
"$default": {
|
|
1230
1250
|
"$source": "argv",
|
|
1231
1251
|
"index": 0
|
|
1232
|
-
}
|
|
1233
|
-
"x-prompt": "What name would you like to use for the library?"
|
|
1252
|
+
}
|
|
1234
1253
|
},
|
|
1235
1254
|
"entryFile": {
|
|
1236
1255
|
"type": "string",
|
|
@@ -1274,8 +1293,7 @@
|
|
|
1274
1293
|
"$default": {
|
|
1275
1294
|
"$source": "argv",
|
|
1276
1295
|
"index": 0
|
|
1277
|
-
}
|
|
1278
|
-
"x-prompt": "What name would you like to use for the pipe?"
|
|
1296
|
+
}
|
|
1279
1297
|
},
|
|
1280
1298
|
"path": {
|
|
1281
1299
|
"type": "string",
|
|
@@ -1301,20 +1319,17 @@
|
|
|
1301
1319
|
"skipTests": {
|
|
1302
1320
|
"type": "boolean",
|
|
1303
1321
|
"description": "Do not create \"spec.ts\" test files for the new pipe.",
|
|
1304
|
-
"default": false
|
|
1305
|
-
"x-user-analytics": 12
|
|
1322
|
+
"default": false
|
|
1306
1323
|
},
|
|
1307
1324
|
"skipImport": {
|
|
1308
1325
|
"type": "boolean",
|
|
1309
1326
|
"default": false,
|
|
1310
|
-
"description": "Do not import this pipe into the owning NgModule."
|
|
1311
|
-
"x-user-analytics": 18
|
|
1327
|
+
"description": "Do not import this pipe into the owning NgModule."
|
|
1312
1328
|
},
|
|
1313
1329
|
"standalone": {
|
|
1314
1330
|
"description": "Whether the generated pipe is standalone.",
|
|
1315
1331
|
"type": "boolean",
|
|
1316
|
-
"default": false
|
|
1317
|
-
"x-user-analytics": 15
|
|
1332
|
+
"default": false
|
|
1318
1333
|
},
|
|
1319
1334
|
"module": {
|
|
1320
1335
|
"type": "string",
|
|
@@ -1324,8 +1339,7 @@
|
|
|
1324
1339
|
"export": {
|
|
1325
1340
|
"type": "boolean",
|
|
1326
1341
|
"default": false,
|
|
1327
|
-
"description": "The declaring NgModule exports this pipe."
|
|
1328
|
-
"x-user-analytics": 19
|
|
1342
|
+
"description": "The declaring NgModule exports this pipe."
|
|
1329
1343
|
}
|
|
1330
1344
|
}
|
|
1331
1345
|
},
|
|
@@ -1345,8 +1359,7 @@
|
|
|
1345
1359
|
"$default": {
|
|
1346
1360
|
"$source": "argv",
|
|
1347
1361
|
"index": 0
|
|
1348
|
-
}
|
|
1349
|
-
"x-prompt": "What name would you like to use for the new workspace and initial project?"
|
|
1362
|
+
}
|
|
1350
1363
|
},
|
|
1351
1364
|
"skipInstall": {
|
|
1352
1365
|
"description": "Do not install dependency packages.",
|
|
@@ -1397,14 +1410,12 @@
|
|
|
1397
1410
|
"inlineStyle": {
|
|
1398
1411
|
"description": "Include styles inline in the component TS file. By default, an external styles file is created and referenced in the component TypeScript file.",
|
|
1399
1412
|
"type": "boolean",
|
|
1400
|
-
"alias": "s"
|
|
1401
|
-
"x-user-analytics": 9
|
|
1413
|
+
"alias": "s"
|
|
1402
1414
|
},
|
|
1403
1415
|
"inlineTemplate": {
|
|
1404
1416
|
"description": "Include template inline in the component TS file. By default, an external template file is created and referenced in the component TypeScript file.",
|
|
1405
1417
|
"type": "boolean",
|
|
1406
|
-
"alias": "t"
|
|
1407
|
-
"x-user-analytics": 10
|
|
1418
|
+
"alias": "t"
|
|
1408
1419
|
},
|
|
1409
1420
|
"viewEncapsulation": {
|
|
1410
1421
|
"description": "The view encapsulation strategy to use in the initial project.",
|
|
@@ -1413,8 +1424,7 @@
|
|
|
1413
1424
|
"None",
|
|
1414
1425
|
"ShadowDom"
|
|
1415
1426
|
],
|
|
1416
|
-
"type": "string"
|
|
1417
|
-
"x-user-analytics": 11
|
|
1427
|
+
"type": "string"
|
|
1418
1428
|
},
|
|
1419
1429
|
"version": {
|
|
1420
1430
|
"type": "string",
|
|
@@ -1426,8 +1436,7 @@
|
|
|
1426
1436
|
},
|
|
1427
1437
|
"routing": {
|
|
1428
1438
|
"type": "boolean",
|
|
1429
|
-
"description": "Generate a routing module for the initial project."
|
|
1430
|
-
"x-user-analytics": 17
|
|
1439
|
+
"description": "Generate a routing module for the initial project."
|
|
1431
1440
|
},
|
|
1432
1441
|
"prefix": {
|
|
1433
1442
|
"type": "string",
|
|
@@ -1445,15 +1454,13 @@
|
|
|
1445
1454
|
"scss",
|
|
1446
1455
|
"sass",
|
|
1447
1456
|
"less"
|
|
1448
|
-
]
|
|
1449
|
-
"x-user-analytics": 5
|
|
1457
|
+
]
|
|
1450
1458
|
},
|
|
1451
1459
|
"skipTests": {
|
|
1452
1460
|
"description": "Do not generate \"spec.ts\" test files for the new project.",
|
|
1453
1461
|
"type": "boolean",
|
|
1454
1462
|
"default": false,
|
|
1455
|
-
"alias": "S"
|
|
1456
|
-
"x-user-analytics": 12
|
|
1463
|
+
"alias": "S"
|
|
1457
1464
|
},
|
|
1458
1465
|
"createApplication": {
|
|
1459
1466
|
"description": "Create a new initial application project in the 'src' folder of the new workspace. When false, creates an empty workspace with no initial application. You can then use the generate application command so that all applications are created in the projects folder.",
|
|
@@ -1463,14 +1470,12 @@
|
|
|
1463
1470
|
"minimal": {
|
|
1464
1471
|
"description": "Create a workspace without any testing frameworks. (Use for learning purposes only.)",
|
|
1465
1472
|
"type": "boolean",
|
|
1466
|
-
"default": false
|
|
1467
|
-
"x-user-analytics": 14
|
|
1473
|
+
"default": false
|
|
1468
1474
|
},
|
|
1469
1475
|
"strict": {
|
|
1470
1476
|
"description": "Creates a workspace with stricter type checking and stricter bundle budgets settings. This setting helps improve maintainability and catch bugs ahead of time. For more information, see https://angular.io/guide/strict-mode",
|
|
1471
1477
|
"type": "boolean",
|
|
1472
|
-
"default": true
|
|
1473
|
-
"x-user-analytics": 7
|
|
1478
|
+
"default": true
|
|
1474
1479
|
},
|
|
1475
1480
|
"packageManager": {
|
|
1476
1481
|
"description": "The package manager used to install dependencies.",
|
|
@@ -1496,14 +1501,12 @@
|
|
|
1496
1501
|
"$default": {
|
|
1497
1502
|
"$source": "argv",
|
|
1498
1503
|
"index": 0
|
|
1499
|
-
}
|
|
1500
|
-
"x-prompt": "What name would you like to use for the resolver?"
|
|
1504
|
+
}
|
|
1501
1505
|
},
|
|
1502
1506
|
"skipTests": {
|
|
1503
1507
|
"type": "boolean",
|
|
1504
1508
|
"description": "Do not create \"spec.ts\" test files for the new resolver.",
|
|
1505
|
-
"default": false
|
|
1506
|
-
"x-user-analytics": 12
|
|
1509
|
+
"default": false
|
|
1507
1510
|
},
|
|
1508
1511
|
"flat": {
|
|
1509
1512
|
"type": "boolean",
|
|
@@ -1540,8 +1543,7 @@
|
|
|
1540
1543
|
"$default": {
|
|
1541
1544
|
"$source": "argv",
|
|
1542
1545
|
"index": 0
|
|
1543
|
-
}
|
|
1544
|
-
"x-prompt": "What name would you like to use for the service?"
|
|
1546
|
+
}
|
|
1545
1547
|
},
|
|
1546
1548
|
"path": {
|
|
1547
1549
|
"type": "string",
|
|
@@ -1566,8 +1568,7 @@
|
|
|
1566
1568
|
"skipTests": {
|
|
1567
1569
|
"type": "boolean",
|
|
1568
1570
|
"description": "Do not create \"spec.ts\" test files for the new service.",
|
|
1569
|
-
"default": false
|
|
1570
|
-
"x-user-analytics": 12
|
|
1571
|
+
"default": false
|
|
1571
1572
|
}
|
|
1572
1573
|
}
|
|
1573
1574
|
},
|
|
@@ -1599,8 +1600,7 @@
|
|
|
1599
1600
|
"$default": {
|
|
1600
1601
|
"$source": "argv",
|
|
1601
1602
|
"index": 0
|
|
1602
|
-
}
|
|
1603
|
-
"x-prompt": "What name would you like to use for the worker?"
|
|
1603
|
+
}
|
|
1604
1604
|
},
|
|
1605
1605
|
"snippet": {
|
|
1606
1606
|
"type": "boolean",
|
|
@@ -1767,7 +1767,6 @@
|
|
|
1767
1767
|
},
|
|
1768
1768
|
"optimization": {
|
|
1769
1769
|
"description": "Enables optimization of the build output. Including minification of scripts and styles, tree-shaking, dead-code elimination, inlining of critical CSS and fonts inlining. For more information, see https://angular.io/guide/workspace-config#optimization-configuration.",
|
|
1770
|
-
"x-user-analytics": 16,
|
|
1771
1770
|
"default": true,
|
|
1772
1771
|
"oneOf": [
|
|
1773
1772
|
{
|
|
@@ -1850,7 +1849,6 @@
|
|
|
1850
1849
|
"aot": {
|
|
1851
1850
|
"type": "boolean",
|
|
1852
1851
|
"description": "Build using Ahead of Time compilation.",
|
|
1853
|
-
"x-user-analytics": 13,
|
|
1854
1852
|
"default": true
|
|
1855
1853
|
},
|
|
1856
1854
|
"sourceMap": {
|
|
@@ -1905,7 +1903,7 @@
|
|
|
1905
1903
|
"deployUrl": {
|
|
1906
1904
|
"type": "string",
|
|
1907
1905
|
"description": "URL where files will be deployed.",
|
|
1908
|
-
"
|
|
1906
|
+
"deprecated": true
|
|
1909
1907
|
},
|
|
1910
1908
|
"verbose": {
|
|
1911
1909
|
"type": "boolean",
|
|
@@ -2330,7 +2328,6 @@
|
|
|
2330
2328
|
},
|
|
2331
2329
|
"optimization": {
|
|
2332
2330
|
"description": "Enables optimization of the build output. Including minification of scripts and styles, tree-shaking, dead-code elimination, inlining of critical CSS and fonts inlining. For more information, see https://angular.io/guide/workspace-config#optimization-configuration.",
|
|
2333
|
-
"x-user-analytics": 16,
|
|
2334
2331
|
"default": true,
|
|
2335
2332
|
"oneOf": [
|
|
2336
2333
|
{
|
|
@@ -2413,7 +2410,6 @@
|
|
|
2413
2410
|
"aot": {
|
|
2414
2411
|
"type": "boolean",
|
|
2415
2412
|
"description": "Build using Ahead of Time compilation.",
|
|
2416
|
-
"x-user-analytics": 13,
|
|
2417
2413
|
"default": true
|
|
2418
2414
|
},
|
|
2419
2415
|
"sourceMap": {
|
|
@@ -2468,7 +2464,7 @@
|
|
|
2468
2464
|
"deployUrl": {
|
|
2469
2465
|
"type": "string",
|
|
2470
2466
|
"description": "URL where files will be deployed.",
|
|
2471
|
-
"
|
|
2467
|
+
"deprecated": true
|
|
2472
2468
|
},
|
|
2473
2469
|
"verbose": {
|
|
2474
2470
|
"type": "boolean",
|
|
@@ -3278,7 +3274,6 @@
|
|
|
3278
3274
|
},
|
|
3279
3275
|
"optimization": {
|
|
3280
3276
|
"description": "Enables optimization of the build output. Including minification of scripts and styles, tree-shaking and dead-code elimination. For more information, see https://angular.io/guide/workspace-config#optimization-configuration.",
|
|
3281
|
-
"x-user-analytics": 16,
|
|
3282
3277
|
"default": true,
|
|
3283
3278
|
"oneOf": [
|
|
3284
3279
|
{
|
|
@@ -3356,7 +3351,7 @@
|
|
|
3356
3351
|
"deployUrl": {
|
|
3357
3352
|
"type": "string",
|
|
3358
3353
|
"description": "URL where files will be deployed.",
|
|
3359
|
-
"
|
|
3354
|
+
"deprecated": true
|
|
3360
3355
|
},
|
|
3361
3356
|
"verbose": {
|
|
3362
3357
|
"type": "boolean",
|
package/lib/init.js
CHANGED
|
@@ -63,6 +63,7 @@ let forceExit = false;
|
|
|
63
63
|
return (await Promise.resolve().then(() => __importStar(require('./cli')))).default;
|
|
64
64
|
}
|
|
65
65
|
let cli;
|
|
66
|
+
const rawCommandName = process.argv[2];
|
|
66
67
|
try {
|
|
67
68
|
// No error implies a projectLocalCli, which will load whatever
|
|
68
69
|
// version of ng-cli you have installed in a local package.json
|
|
@@ -84,6 +85,10 @@ let forceExit = false;
|
|
|
84
85
|
// Ensure older versions of the CLI fully exit
|
|
85
86
|
if ((0, semver_1.major)(localVersion) < 14) {
|
|
86
87
|
forceExit = true;
|
|
88
|
+
// Versions prior to 14 didn't implement completion command.
|
|
89
|
+
if (rawCommandName === 'completion') {
|
|
90
|
+
return null;
|
|
91
|
+
}
|
|
87
92
|
}
|
|
88
93
|
let isGlobalGreater = false;
|
|
89
94
|
try {
|
|
@@ -93,7 +98,6 @@ let forceExit = false;
|
|
|
93
98
|
// eslint-disable-next-line no-console
|
|
94
99
|
console.error('Version mismatch check skipped. Unable to compare local version: ' + error);
|
|
95
100
|
}
|
|
96
|
-
const rawCommandName = process.argv[2];
|
|
97
101
|
// When using the completion command, don't show the warning as otherwise this will break completion.
|
|
98
102
|
if (isGlobalGreater && rawCommandName !== 'completion') {
|
|
99
103
|
// If using the update command and the global version is greater, use the newer update command
|
|
@@ -125,14 +129,10 @@ let forceExit = false;
|
|
|
125
129
|
}
|
|
126
130
|
return cli;
|
|
127
131
|
})()
|
|
128
|
-
.then((cli) => {
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
outputStream: process.stdout,
|
|
133
|
-
});
|
|
134
|
-
})
|
|
135
|
-
.then((exitCode) => {
|
|
132
|
+
.then((cli) => cli === null || cli === void 0 ? void 0 : cli({
|
|
133
|
+
cliArgs: process.argv.slice(2),
|
|
134
|
+
}))
|
|
135
|
+
.then((exitCode = 0) => {
|
|
136
136
|
if (forceExit) {
|
|
137
137
|
process.exit(exitCode);
|
|
138
138
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@angular/cli",
|
|
3
|
-
"version": "14.1.0-
|
|
3
|
+
"version": "14.1.0-rc.0",
|
|
4
4
|
"description": "CLI tool for Angular",
|
|
5
5
|
"main": "lib/cli/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -25,22 +25,22 @@
|
|
|
25
25
|
},
|
|
26
26
|
"homepage": "https://github.com/angular/angular-cli",
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@angular-devkit/architect": "0.1401.0-
|
|
29
|
-
"@angular-devkit/core": "14.1.0-
|
|
30
|
-
"@angular-devkit/schematics": "14.1.0-
|
|
31
|
-
"@schematics/angular": "14.1.0-
|
|
28
|
+
"@angular-devkit/architect": "0.1401.0-rc.0",
|
|
29
|
+
"@angular-devkit/core": "14.1.0-rc.0",
|
|
30
|
+
"@angular-devkit/schematics": "14.1.0-rc.0",
|
|
31
|
+
"@schematics/angular": "14.1.0-rc.0",
|
|
32
32
|
"@yarnpkg/lockfile": "1.1.0",
|
|
33
33
|
"ansi-colors": "4.1.3",
|
|
34
34
|
"debug": "4.3.4",
|
|
35
35
|
"ini": "3.0.0",
|
|
36
36
|
"inquirer": "8.2.4",
|
|
37
37
|
"jsonc-parser": "3.0.0",
|
|
38
|
-
"npm-package-arg": "9.0
|
|
38
|
+
"npm-package-arg": "9.1.0",
|
|
39
39
|
"npm-pick-manifest": "7.0.1",
|
|
40
40
|
"open": "8.4.0",
|
|
41
41
|
"ora": "5.4.1",
|
|
42
|
-
"pacote": "13.6.
|
|
43
|
-
"resolve": "1.22.
|
|
42
|
+
"pacote": "13.6.1",
|
|
43
|
+
"resolve": "1.22.1",
|
|
44
44
|
"semver": "7.3.7",
|
|
45
45
|
"symbol-observable": "4.0.0",
|
|
46
46
|
"uuid": "8.3.2",
|
|
@@ -49,12 +49,12 @@
|
|
|
49
49
|
"ng-update": {
|
|
50
50
|
"migrations": "@schematics/angular/migrations/migration-collection.json",
|
|
51
51
|
"packageGroup": {
|
|
52
|
-
"@angular/cli": "14.1.0-
|
|
53
|
-
"@angular-devkit/architect": "0.1401.0-
|
|
54
|
-
"@angular-devkit/build-angular": "14.1.0-
|
|
55
|
-
"@angular-devkit/build-webpack": "0.1401.0-
|
|
56
|
-
"@angular-devkit/core": "14.1.0-
|
|
57
|
-
"@angular-devkit/schematics": "14.1.0-
|
|
52
|
+
"@angular/cli": "14.1.0-rc.0",
|
|
53
|
+
"@angular-devkit/architect": "0.1401.0-rc.0",
|
|
54
|
+
"@angular-devkit/build-angular": "14.1.0-rc.0",
|
|
55
|
+
"@angular-devkit/build-webpack": "0.1401.0-rc.0",
|
|
56
|
+
"@angular-devkit/core": "14.1.0-rc.0",
|
|
57
|
+
"@angular-devkit/schematics": "14.1.0-rc.0"
|
|
58
58
|
}
|
|
59
59
|
},
|
|
60
60
|
"engines": {
|
|
@@ -113,8 +113,14 @@ class ArchitectCommandModule extends architect_base_command_module_1.ArchitectBa
|
|
|
113
113
|
const { getYargsCompletions, help } = this.context.args.options;
|
|
114
114
|
if (!getYargsCompletions && !help) {
|
|
115
115
|
// Only issue the below error when not in help / completion mode.
|
|
116
|
-
throw new command_module_1.CommandModuleError('Cannot determine project for command
|
|
117
|
-
'
|
|
116
|
+
throw new command_module_1.CommandModuleError('Cannot determine project for command.\n' +
|
|
117
|
+
'This is a multi-project workspace and more than one project supports this command. ' +
|
|
118
|
+
`Run "ng ${this.command}" to execute the command for a specific project or change the current ` +
|
|
119
|
+
'working directory to a project directory.\n\n' +
|
|
120
|
+
`Available projects are:\n${allProjectsForTargetName
|
|
121
|
+
.sort()
|
|
122
|
+
.map((p) => `- ${p}`)
|
|
123
|
+
.join('\n')}`);
|
|
118
124
|
}
|
|
119
125
|
}
|
|
120
126
|
return undefined;
|
|
@@ -161,15 +161,11 @@ class CommandModule {
|
|
|
161
161
|
// This should only be done when `--help` is used otherwise default will override options set in angular.json.
|
|
162
162
|
...(this.context.args.options.help ? { default: defaultVal } : {}),
|
|
163
163
|
};
|
|
164
|
-
// TODO(alanagius4): remove in a major version.
|
|
165
|
-
// the below is an interim workaround to handle options which have been defined in the schema with `no` prefix.
|
|
166
164
|
let dashedName = core_1.strings.dasherize(name);
|
|
165
|
+
// Handle options which have been defined in the schema with `no` prefix.
|
|
167
166
|
if (type === 'boolean' && dashedName.startsWith('no-')) {
|
|
168
167
|
dashedName = dashedName.slice(3);
|
|
169
168
|
booleanOptionsWithNoPrefix.add(dashedName);
|
|
170
|
-
// eslint-disable-next-line no-console
|
|
171
|
-
console.warn(`Warning: '${name}' option has been declared with a 'no' prefix in the schema.` +
|
|
172
|
-
'Please file an issue with the author of this package.');
|
|
173
169
|
}
|
|
174
170
|
if (positional === undefined) {
|
|
175
171
|
localYargs = localYargs.option(dashedName, {
|
|
@@ -188,8 +184,7 @@ class CommandModule {
|
|
|
188
184
|
this.optionsWithAnalytics.set(name, userAnalytics);
|
|
189
185
|
}
|
|
190
186
|
}
|
|
191
|
-
//
|
|
192
|
-
// the below is an interim workaround to handle options which have been defined in the schema with `no` prefix.
|
|
187
|
+
// Handle options which have been defined in the schema with `no` prefix.
|
|
193
188
|
if (booleanOptionsWithNoPrefix.size) {
|
|
194
189
|
localYargs.middleware((options) => {
|
|
195
190
|
for (const key of booleanOptionsWithNoPrefix) {
|
|
@@ -138,7 +138,7 @@ async function runCommand(args, logger) {
|
|
|
138
138
|
'deprecated: %s': color_1.colors.yellow('deprecated:') + ' %s',
|
|
139
139
|
'Did you mean %s?': 'Unknown command. Did you mean %s?',
|
|
140
140
|
})
|
|
141
|
-
.epilogue(
|
|
141
|
+
.epilogue('For more information, see https://angular.io/cli/.\n')
|
|
142
142
|
.demandCommand(1, command_1.demandCommandFailureMessage)
|
|
143
143
|
.recommendCommands()
|
|
144
144
|
.middleware(normalize_options_middleware_1.normalizeOptionsMiddleware)
|
|
@@ -71,25 +71,10 @@ class ConfigCommandModule extends command_module_1.CommandModule {
|
|
|
71
71
|
return 0;
|
|
72
72
|
}
|
|
73
73
|
async set(options) {
|
|
74
|
-
var _a;
|
|
74
|
+
var _a, _b;
|
|
75
75
|
if (!((_a = options.jsonPath) === null || _a === void 0 ? void 0 : _a.trim())) {
|
|
76
76
|
throw new command_module_1.CommandModuleError('Invalid Path.');
|
|
77
77
|
}
|
|
78
|
-
const validGlobalCliPaths = new Set([
|
|
79
|
-
'cli.warnings.versionMismatch',
|
|
80
|
-
'cli.defaultCollection',
|
|
81
|
-
'cli.schematicCollections',
|
|
82
|
-
'cli.packageManager',
|
|
83
|
-
'cli.analytics',
|
|
84
|
-
'cli.analyticsSharing.tracking',
|
|
85
|
-
'cli.analyticsSharing.uuid',
|
|
86
|
-
'cli.completion.prompted',
|
|
87
|
-
]);
|
|
88
|
-
if (options.global &&
|
|
89
|
-
!options.jsonPath.startsWith('schematics.') &&
|
|
90
|
-
!validGlobalCliPaths.has(options.jsonPath)) {
|
|
91
|
-
throw new command_module_1.CommandModuleError('Invalid Path.');
|
|
92
|
-
}
|
|
93
78
|
const [config, configPath] = await (0, config_1.getWorkspaceRaw)(options.global ? 'global' : 'local');
|
|
94
79
|
const { logger } = this.context;
|
|
95
80
|
if (!config || !configPath) {
|
|
@@ -104,7 +89,7 @@ class ConfigCommandModule extends command_module_1.CommandModule {
|
|
|
104
89
|
logger.error('Value cannot be found.');
|
|
105
90
|
return 1;
|
|
106
91
|
}
|
|
107
|
-
await (0, config_1.validateWorkspace)((0, json_file_1.parseJson)(config.content));
|
|
92
|
+
await (0, config_1.validateWorkspace)((0, json_file_1.parseJson)(config.content), (_b = options.global) !== null && _b !== void 0 ? _b : false);
|
|
108
93
|
config.save();
|
|
109
94
|
return 0;
|
|
110
95
|
}
|
package/src/commands/new/cli.js
CHANGED
|
@@ -27,7 +27,7 @@ class NewCommandModule extends schematics_command_module_1.SchematicsCommandModu
|
|
|
27
27
|
describe: 'A collection of schematics to use in generating the initial application.',
|
|
28
28
|
type: 'string',
|
|
29
29
|
});
|
|
30
|
-
const { options: { collectionNameFromArgs }, } = this.context.args;
|
|
30
|
+
const { options: { collection: collectionNameFromArgs }, } = this.context.args;
|
|
31
31
|
const collectionName = typeof collectionNameFromArgs === 'string'
|
|
32
32
|
? collectionNameFromArgs
|
|
33
33
|
: await this.getCollectionFromConfig();
|
|
@@ -73,8 +73,7 @@ class UpdateCommandModule extends command_module_1.CommandModule {
|
|
|
73
73
|
array: true,
|
|
74
74
|
})
|
|
75
75
|
.option('force', {
|
|
76
|
-
description: 'Ignore peer dependency version mismatches.
|
|
77
|
-
`Passes the '--force' flag to the package manager when installing packages.`,
|
|
76
|
+
description: 'Ignore peer dependency version mismatches.',
|
|
78
77
|
type: 'boolean',
|
|
79
78
|
default: false,
|
|
80
79
|
})
|
|
@@ -191,7 +190,7 @@ class UpdateCommandModule extends command_module_1.CommandModule {
|
|
|
191
190
|
logger.info(`Found ${rootDependencies.size} dependencies.`);
|
|
192
191
|
const workflow = new tools_1.NodeWorkflow(this.context.root, {
|
|
193
192
|
packageManager: packageManager.name,
|
|
194
|
-
packageManagerForce: options.
|
|
193
|
+
packageManagerForce: this.packageManagerForce(options.verbose),
|
|
195
194
|
// __dirname -> favor @schematics/update from this package
|
|
196
195
|
// Otherwise, use packages from the active workspace (migrations)
|
|
197
196
|
resolvePaths: [__dirname, this.context.root],
|
|
@@ -518,23 +517,7 @@ class UpdateCommandModule extends command_module_1.CommandModule {
|
|
|
518
517
|
});
|
|
519
518
|
}
|
|
520
519
|
catch { }
|
|
521
|
-
|
|
522
|
-
// npm 7+ can fail due to it incorrectly resolving peer dependencies that have valid SemVer
|
|
523
|
-
// ranges during an update. Update will set correct versions of dependencies within the
|
|
524
|
-
// package.json file. The force option is set to workaround these errors.
|
|
525
|
-
// Example error:
|
|
526
|
-
// npm ERR! Conflicting peer dependency: @angular/compiler-cli@14.0.0-rc.0
|
|
527
|
-
// npm ERR! node_modules/@angular/compiler-cli
|
|
528
|
-
// npm ERR! peer @angular/compiler-cli@"^14.0.0 || ^14.0.0-rc" from @angular-devkit/build-angular@14.0.0-rc.0
|
|
529
|
-
// npm ERR! node_modules/@angular-devkit/build-angular
|
|
530
|
-
// npm ERR! dev @angular-devkit/build-angular@"~14.0.0-rc.0" from the root project
|
|
531
|
-
if (this.context.packageManager.name === workspace_schema_1.PackageManager.Npm &&
|
|
532
|
-
this.context.packageManager.version &&
|
|
533
|
-
semver.gte(this.context.packageManager.version, '7.0.0', { includePrerelease: true })) {
|
|
534
|
-
logVerbose('NPM 7+ detected -- enabling force option for package installation');
|
|
535
|
-
forceInstall = true;
|
|
536
|
-
}
|
|
537
|
-
const installationSuccess = await this.context.packageManager.installAll(forceInstall ? ['--force'] : [], this.context.root);
|
|
520
|
+
const installationSuccess = await this.context.packageManager.installAll(this.packageManagerForce(options.verbose) ? ['--force'] : [], this.context.root);
|
|
538
521
|
if (!installationSuccess) {
|
|
539
522
|
return 1;
|
|
540
523
|
}
|
|
@@ -749,6 +732,26 @@ class UpdateCommandModule extends command_module_1.CommandModule {
|
|
|
749
732
|
}
|
|
750
733
|
return status !== null && status !== void 0 ? status : 0;
|
|
751
734
|
}
|
|
735
|
+
packageManagerForce(verbose) {
|
|
736
|
+
// npm 7+ can fail due to it incorrectly resolving peer dependencies that have valid SemVer
|
|
737
|
+
// ranges during an update. Update will set correct versions of dependencies within the
|
|
738
|
+
// package.json file. The force option is set to workaround these errors.
|
|
739
|
+
// Example error:
|
|
740
|
+
// npm ERR! Conflicting peer dependency: @angular/compiler-cli@14.0.0-rc.0
|
|
741
|
+
// npm ERR! node_modules/@angular/compiler-cli
|
|
742
|
+
// npm ERR! peer @angular/compiler-cli@"^14.0.0 || ^14.0.0-rc" from @angular-devkit/build-angular@14.0.0-rc.0
|
|
743
|
+
// npm ERR! node_modules/@angular-devkit/build-angular
|
|
744
|
+
// npm ERR! dev @angular-devkit/build-angular@"~14.0.0-rc.0" from the root project
|
|
745
|
+
if (this.context.packageManager.name === workspace_schema_1.PackageManager.Npm &&
|
|
746
|
+
this.context.packageManager.version &&
|
|
747
|
+
semver.gte(this.context.packageManager.version, '7.0.0', { includePrerelease: true })) {
|
|
748
|
+
if (verbose) {
|
|
749
|
+
this.context.logger.info('NPM 7+ detected -- enabling force option for package installation');
|
|
750
|
+
}
|
|
751
|
+
return true;
|
|
752
|
+
}
|
|
753
|
+
return false;
|
|
754
|
+
}
|
|
752
755
|
}
|
|
753
756
|
exports.UpdateCommandModule = UpdateCommandModule;
|
|
754
757
|
/**
|
package/src/utilities/color.js
CHANGED
|
@@ -64,7 +64,6 @@ function removeColor(text) {
|
|
|
64
64
|
}
|
|
65
65
|
exports.removeColor = removeColor;
|
|
66
66
|
// Create a separate instance to prevent unintended global changes to the color configuration
|
|
67
|
-
// Create function is not defined in the typings. See: https://github.com/doowb/ansi-colors/pull/44
|
|
68
67
|
const colors = ansiColors.create();
|
|
69
68
|
exports.colors = colors;
|
|
70
69
|
colors.enabled = supportColor();
|
|
@@ -31,7 +31,7 @@ export declare function getWorkspace(level: 'local' | 'global'): Promise<Angular
|
|
|
31
31
|
* NB: This method is intended to be used only for `ng config`.
|
|
32
32
|
*/
|
|
33
33
|
export declare function getWorkspaceRaw(level?: 'local' | 'global'): Promise<[JSONFile | null, string | null]>;
|
|
34
|
-
export declare function validateWorkspace(data: json.JsonObject): Promise<void>;
|
|
34
|
+
export declare function validateWorkspace(data: json.JsonObject, isGlobal: boolean): Promise<void>;
|
|
35
35
|
export declare function getProjectByCwd(workspace: AngularWorkspace): string | null;
|
|
36
36
|
export declare function getConfiguredPackageManager(): Promise<PackageManager | null>;
|
|
37
37
|
export declare function getSchematicDefaults(collection: string, schematic: string, project?: string | null): Promise<{}>;
|
package/src/utilities/config.js
CHANGED
|
@@ -200,11 +200,18 @@ async function getWorkspaceRaw(level = 'local') {
|
|
|
200
200
|
return [new json_file_1.JSONFile(configPath), configPath];
|
|
201
201
|
}
|
|
202
202
|
exports.getWorkspaceRaw = getWorkspaceRaw;
|
|
203
|
-
async function validateWorkspace(data) {
|
|
203
|
+
async function validateWorkspace(data, isGlobal) {
|
|
204
204
|
const schema = (0, json_file_1.readAndParseJson)(exports.workspaceSchemaPath);
|
|
205
|
+
// We should eventually have a dedicated global config schema and use that to validate.
|
|
206
|
+
const schemaToValidate = isGlobal
|
|
207
|
+
? {
|
|
208
|
+
'$ref': '#/definitions/global',
|
|
209
|
+
definitions: schema['definitions'],
|
|
210
|
+
}
|
|
211
|
+
: schema;
|
|
205
212
|
const { formats } = await Promise.resolve().then(() => __importStar(require('@angular-devkit/schematics')));
|
|
206
213
|
const registry = new core_1.json.schema.CoreSchemaRegistry(formats.standardFormats);
|
|
207
|
-
const validator = await registry.compile(
|
|
214
|
+
const validator = await registry.compile(schemaToValidate).toPromise();
|
|
208
215
|
const { success, errors } = await validator(data).toPromise();
|
|
209
216
|
if (!success) {
|
|
210
217
|
throw new core_1.json.schema.SchemaValidationException(errors);
|