@angular/cli 14.0.2 → 14.0.5
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 +138 -140
- package/lib/init.js +4 -2
- package/package.json +11 -11
- package/src/command-builder/architect-command-module.js +8 -2
- package/src/command-builder/command-module.js +25 -2
- 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/run/cli.js +10 -0
- package/src/commands/update/cli.d.ts +1 -0
- package/src/commands/update/cli.js +23 -20
- 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",
|
|
@@ -585,14 +662,13 @@
|
|
|
585
662
|
"type": "object",
|
|
586
663
|
"properties": {
|
|
587
664
|
"$schema": {
|
|
588
|
-
"type": "string"
|
|
589
|
-
"format": "uri"
|
|
665
|
+
"type": "string"
|
|
590
666
|
},
|
|
591
667
|
"version": {
|
|
592
668
|
"$ref": "#/definitions/fileVersion"
|
|
593
669
|
},
|
|
594
670
|
"cli": {
|
|
595
|
-
"$ref": "#/definitions/
|
|
671
|
+
"$ref": "#/definitions/cliGlobalOptions"
|
|
596
672
|
},
|
|
597
673
|
"schematics": {
|
|
598
674
|
"$ref": "#/definitions/schematicOptions"
|
|
@@ -620,20 +696,17 @@
|
|
|
620
696
|
"$default": {
|
|
621
697
|
"$source": "argv",
|
|
622
698
|
"index": 0
|
|
623
|
-
}
|
|
624
|
-
"x-prompt": "What name would you like to use for the application?"
|
|
699
|
+
}
|
|
625
700
|
},
|
|
626
701
|
"inlineStyle": {
|
|
627
702
|
"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.",
|
|
628
703
|
"type": "boolean",
|
|
629
|
-
"alias": "s"
|
|
630
|
-
"x-user-analytics": 9
|
|
704
|
+
"alias": "s"
|
|
631
705
|
},
|
|
632
706
|
"inlineTemplate": {
|
|
633
707
|
"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. ",
|
|
634
708
|
"type": "boolean",
|
|
635
|
-
"alias": "t"
|
|
636
|
-
"x-user-analytics": 10
|
|
709
|
+
"alias": "t"
|
|
637
710
|
},
|
|
638
711
|
"viewEncapsulation": {
|
|
639
712
|
"description": "The view encapsulation strategy to use in the new application.",
|
|
@@ -642,15 +715,12 @@
|
|
|
642
715
|
"None",
|
|
643
716
|
"ShadowDom"
|
|
644
717
|
],
|
|
645
|
-
"type": "string"
|
|
646
|
-
"x-user-analytics": 11
|
|
718
|
+
"type": "string"
|
|
647
719
|
},
|
|
648
720
|
"routing": {
|
|
649
721
|
"type": "boolean",
|
|
650
722
|
"description": "Create a routing NgModule.",
|
|
651
|
-
"default": false
|
|
652
|
-
"x-prompt": "Would you like to add Angular routing?",
|
|
653
|
-
"x-user-analytics": 17
|
|
723
|
+
"default": false
|
|
654
724
|
},
|
|
655
725
|
"prefix": {
|
|
656
726
|
"type": "string",
|
|
@@ -668,37 +738,13 @@
|
|
|
668
738
|
"scss",
|
|
669
739
|
"sass",
|
|
670
740
|
"less"
|
|
671
|
-
]
|
|
672
|
-
"x-prompt": {
|
|
673
|
-
"message": "Which stylesheet format would you like to use?",
|
|
674
|
-
"type": "list",
|
|
675
|
-
"items": [
|
|
676
|
-
{
|
|
677
|
-
"value": "css",
|
|
678
|
-
"label": "CSS"
|
|
679
|
-
},
|
|
680
|
-
{
|
|
681
|
-
"value": "scss",
|
|
682
|
-
"label": "SCSS [ https://sass-lang.com/documentation/syntax#scss ]"
|
|
683
|
-
},
|
|
684
|
-
{
|
|
685
|
-
"value": "sass",
|
|
686
|
-
"label": "Sass [ https://sass-lang.com/documentation/syntax#the-indented-syntax ]"
|
|
687
|
-
},
|
|
688
|
-
{
|
|
689
|
-
"value": "less",
|
|
690
|
-
"label": "Less [ http://lesscss.org ]"
|
|
691
|
-
}
|
|
692
|
-
]
|
|
693
|
-
},
|
|
694
|
-
"x-user-analytics": 5
|
|
741
|
+
]
|
|
695
742
|
},
|
|
696
743
|
"skipTests": {
|
|
697
744
|
"description": "Do not create \"spec.ts\" test files for the application.",
|
|
698
745
|
"type": "boolean",
|
|
699
746
|
"default": false,
|
|
700
|
-
"alias": "S"
|
|
701
|
-
"x-user-analytics": 12
|
|
747
|
+
"alias": "S"
|
|
702
748
|
},
|
|
703
749
|
"skipPackageJson": {
|
|
704
750
|
"type": "boolean",
|
|
@@ -708,8 +754,7 @@
|
|
|
708
754
|
"minimal": {
|
|
709
755
|
"description": "Create a bare-bones project without any testing frameworks. (Use for learning purposes only.)",
|
|
710
756
|
"type": "boolean",
|
|
711
|
-
"default": false
|
|
712
|
-
"x-user-analytics": 14
|
|
757
|
+
"default": false
|
|
713
758
|
},
|
|
714
759
|
"skipInstall": {
|
|
715
760
|
"description": "Skip installing dependency packages.",
|
|
@@ -719,8 +764,7 @@
|
|
|
719
764
|
"strict": {
|
|
720
765
|
"description": "Creates an application with stricter bundle budgets settings.",
|
|
721
766
|
"type": "boolean",
|
|
722
|
-
"default": true
|
|
723
|
-
"x-user-analytics": 7
|
|
767
|
+
"default": true
|
|
724
768
|
}
|
|
725
769
|
}
|
|
726
770
|
},
|
|
@@ -736,8 +780,7 @@
|
|
|
736
780
|
"$default": {
|
|
737
781
|
"$source": "argv",
|
|
738
782
|
"index": 0
|
|
739
|
-
}
|
|
740
|
-
"x-prompt": "What name would you like to use for the class?"
|
|
783
|
+
}
|
|
741
784
|
},
|
|
742
785
|
"path": {
|
|
743
786
|
"type": "string",
|
|
@@ -758,8 +801,7 @@
|
|
|
758
801
|
"skipTests": {
|
|
759
802
|
"type": "boolean",
|
|
760
803
|
"description": "Do not create \"spec.ts\" test files for the new class.",
|
|
761
|
-
"default": false
|
|
762
|
-
"x-user-analytics": 12
|
|
804
|
+
"default": false
|
|
763
805
|
},
|
|
764
806
|
"type": {
|
|
765
807
|
"type": "string",
|
|
@@ -795,8 +837,7 @@
|
|
|
795
837
|
"$default": {
|
|
796
838
|
"$source": "argv",
|
|
797
839
|
"index": 0
|
|
798
|
-
}
|
|
799
|
-
"x-prompt": "What name would you like to use for the component?"
|
|
840
|
+
}
|
|
800
841
|
},
|
|
801
842
|
"displayBlock": {
|
|
802
843
|
"description": "Specifies if the style will contain `:host { display: block; }`.",
|
|
@@ -808,21 +849,18 @@
|
|
|
808
849
|
"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.",
|
|
809
850
|
"type": "boolean",
|
|
810
851
|
"default": false,
|
|
811
|
-
"alias": "s"
|
|
812
|
-
"x-user-analytics": 9
|
|
852
|
+
"alias": "s"
|
|
813
853
|
},
|
|
814
854
|
"inlineTemplate": {
|
|
815
855
|
"description": "Include template inline in the component.ts file. By default, an external template file is created and referenced in the component.ts file.",
|
|
816
856
|
"type": "boolean",
|
|
817
857
|
"default": false,
|
|
818
|
-
"alias": "t"
|
|
819
|
-
"x-user-analytics": 10
|
|
858
|
+
"alias": "t"
|
|
820
859
|
},
|
|
821
860
|
"standalone": {
|
|
822
861
|
"description": "Whether the generated component is standalone.",
|
|
823
862
|
"type": "boolean",
|
|
824
|
-
"default": false
|
|
825
|
-
"x-user-analytics": 15
|
|
863
|
+
"default": false
|
|
826
864
|
},
|
|
827
865
|
"viewEncapsulation": {
|
|
828
866
|
"description": "The view encapsulation strategy to use in the new component.",
|
|
@@ -832,8 +870,7 @@
|
|
|
832
870
|
"ShadowDom"
|
|
833
871
|
],
|
|
834
872
|
"type": "string",
|
|
835
|
-
"alias": "v"
|
|
836
|
-
"x-user-analytics": 11
|
|
873
|
+
"alias": "v"
|
|
837
874
|
},
|
|
838
875
|
"changeDetection": {
|
|
839
876
|
"description": "The change detection strategy to use in the new component.",
|
|
@@ -869,8 +906,7 @@
|
|
|
869
906
|
"sass",
|
|
870
907
|
"less",
|
|
871
908
|
"none"
|
|
872
|
-
]
|
|
873
|
-
"x-user-analytics": 5
|
|
909
|
+
]
|
|
874
910
|
},
|
|
875
911
|
"type": {
|
|
876
912
|
"type": "string",
|
|
@@ -880,8 +916,7 @@
|
|
|
880
916
|
"skipTests": {
|
|
881
917
|
"type": "boolean",
|
|
882
918
|
"description": "Do not create \"spec.ts\" test files for the new component.",
|
|
883
|
-
"default": false
|
|
884
|
-
"x-user-analytics": 12
|
|
919
|
+
"default": false
|
|
885
920
|
},
|
|
886
921
|
"flat": {
|
|
887
922
|
"type": "boolean",
|
|
@@ -891,8 +926,7 @@
|
|
|
891
926
|
"skipImport": {
|
|
892
927
|
"type": "boolean",
|
|
893
928
|
"description": "Do not import this component into the owning NgModule.",
|
|
894
|
-
"default": false
|
|
895
|
-
"x-user-analytics": 18
|
|
929
|
+
"default": false
|
|
896
930
|
},
|
|
897
931
|
"selector": {
|
|
898
932
|
"type": "string",
|
|
@@ -912,8 +946,7 @@
|
|
|
912
946
|
"export": {
|
|
913
947
|
"type": "boolean",
|
|
914
948
|
"default": false,
|
|
915
|
-
"description": "The declaring NgModule exports this component."
|
|
916
|
-
"x-user-analytics": 19
|
|
949
|
+
"description": "The declaring NgModule exports this component."
|
|
917
950
|
}
|
|
918
951
|
}
|
|
919
952
|
},
|
|
@@ -929,8 +962,7 @@
|
|
|
929
962
|
"$default": {
|
|
930
963
|
"$source": "argv",
|
|
931
964
|
"index": 0
|
|
932
|
-
}
|
|
933
|
-
"x-prompt": "What name would you like to use for the directive?"
|
|
965
|
+
}
|
|
934
966
|
},
|
|
935
967
|
"path": {
|
|
936
968
|
"type": "string",
|
|
@@ -965,14 +997,12 @@
|
|
|
965
997
|
"skipTests": {
|
|
966
998
|
"type": "boolean",
|
|
967
999
|
"description": "Do not create \"spec.ts\" test files for the new class.",
|
|
968
|
-
"default": false
|
|
969
|
-
"x-user-analytics": 12
|
|
1000
|
+
"default": false
|
|
970
1001
|
},
|
|
971
1002
|
"skipImport": {
|
|
972
1003
|
"type": "boolean",
|
|
973
1004
|
"description": "Do not import this directive into the owning NgModule.",
|
|
974
|
-
"default": false
|
|
975
|
-
"x-user-analytics": 18
|
|
1005
|
+
"default": false
|
|
976
1006
|
},
|
|
977
1007
|
"selector": {
|
|
978
1008
|
"type": "string",
|
|
@@ -982,8 +1012,7 @@
|
|
|
982
1012
|
"standalone": {
|
|
983
1013
|
"description": "Whether the generated directive is standalone.",
|
|
984
1014
|
"type": "boolean",
|
|
985
|
-
"default": false
|
|
986
|
-
"x-user-analytics": 15
|
|
1015
|
+
"default": false
|
|
987
1016
|
},
|
|
988
1017
|
"flat": {
|
|
989
1018
|
"type": "boolean",
|
|
@@ -998,8 +1027,7 @@
|
|
|
998
1027
|
"export": {
|
|
999
1028
|
"type": "boolean",
|
|
1000
1029
|
"default": false,
|
|
1001
|
-
"description": "The declaring NgModule exports this directive."
|
|
1002
|
-
"x-user-analytics": 19
|
|
1030
|
+
"description": "The declaring NgModule exports this directive."
|
|
1003
1031
|
}
|
|
1004
1032
|
}
|
|
1005
1033
|
},
|
|
@@ -1015,8 +1043,7 @@
|
|
|
1015
1043
|
"$default": {
|
|
1016
1044
|
"$source": "argv",
|
|
1017
1045
|
"index": 0
|
|
1018
|
-
}
|
|
1019
|
-
"x-prompt": "What name would you like to use for the enum?"
|
|
1046
|
+
}
|
|
1020
1047
|
},
|
|
1021
1048
|
"path": {
|
|
1022
1049
|
"type": "string",
|
|
@@ -1052,14 +1079,12 @@
|
|
|
1052
1079
|
"$default": {
|
|
1053
1080
|
"$source": "argv",
|
|
1054
1081
|
"index": 0
|
|
1055
|
-
}
|
|
1056
|
-
"x-prompt": "What name would you like to use for the guard?"
|
|
1082
|
+
}
|
|
1057
1083
|
},
|
|
1058
1084
|
"skipTests": {
|
|
1059
1085
|
"type": "boolean",
|
|
1060
1086
|
"description": "Do not create \"spec.ts\" test files for the new guard.",
|
|
1061
|
-
"default": false
|
|
1062
|
-
"x-user-analytics": 12
|
|
1087
|
+
"default": false
|
|
1063
1088
|
},
|
|
1064
1089
|
"flat": {
|
|
1065
1090
|
"type": "boolean",
|
|
@@ -1098,8 +1123,7 @@
|
|
|
1098
1123
|
},
|
|
1099
1124
|
"default": [
|
|
1100
1125
|
"CanActivate"
|
|
1101
|
-
]
|
|
1102
|
-
"x-prompt": "Which interfaces would you like to implement?"
|
|
1126
|
+
]
|
|
1103
1127
|
}
|
|
1104
1128
|
}
|
|
1105
1129
|
},
|
|
@@ -1115,8 +1139,7 @@
|
|
|
1115
1139
|
"$default": {
|
|
1116
1140
|
"$source": "argv",
|
|
1117
1141
|
"index": 0
|
|
1118
|
-
}
|
|
1119
|
-
"x-prompt": "What name would you like to use for the interceptor?"
|
|
1142
|
+
}
|
|
1120
1143
|
},
|
|
1121
1144
|
"path": {
|
|
1122
1145
|
"type": "string",
|
|
@@ -1142,8 +1165,7 @@
|
|
|
1142
1165
|
"skipTests": {
|
|
1143
1166
|
"type": "boolean",
|
|
1144
1167
|
"description": "Do not create \"spec.ts\" test files for the new interceptor.",
|
|
1145
|
-
"default": false
|
|
1146
|
-
"x-user-analytics": 12
|
|
1168
|
+
"default": false
|
|
1147
1169
|
}
|
|
1148
1170
|
}
|
|
1149
1171
|
},
|
|
@@ -1159,8 +1181,7 @@
|
|
|
1159
1181
|
"$default": {
|
|
1160
1182
|
"$source": "argv",
|
|
1161
1183
|
"index": 0
|
|
1162
|
-
}
|
|
1163
|
-
"x-prompt": "What name would you like to use for the interface?"
|
|
1184
|
+
}
|
|
1164
1185
|
},
|
|
1165
1186
|
"path": {
|
|
1166
1187
|
"type": "string",
|
|
@@ -1206,8 +1227,7 @@
|
|
|
1206
1227
|
"$default": {
|
|
1207
1228
|
"$source": "argv",
|
|
1208
1229
|
"index": 0
|
|
1209
|
-
}
|
|
1210
|
-
"x-prompt": "What name would you like to use for the library?"
|
|
1230
|
+
}
|
|
1211
1231
|
},
|
|
1212
1232
|
"entryFile": {
|
|
1213
1233
|
"type": "string",
|
|
@@ -1251,8 +1271,7 @@
|
|
|
1251
1271
|
"$default": {
|
|
1252
1272
|
"$source": "argv",
|
|
1253
1273
|
"index": 0
|
|
1254
|
-
}
|
|
1255
|
-
"x-prompt": "What name would you like to use for the pipe?"
|
|
1274
|
+
}
|
|
1256
1275
|
},
|
|
1257
1276
|
"path": {
|
|
1258
1277
|
"type": "string",
|
|
@@ -1278,20 +1297,17 @@
|
|
|
1278
1297
|
"skipTests": {
|
|
1279
1298
|
"type": "boolean",
|
|
1280
1299
|
"description": "Do not create \"spec.ts\" test files for the new pipe.",
|
|
1281
|
-
"default": false
|
|
1282
|
-
"x-user-analytics": 12
|
|
1300
|
+
"default": false
|
|
1283
1301
|
},
|
|
1284
1302
|
"skipImport": {
|
|
1285
1303
|
"type": "boolean",
|
|
1286
1304
|
"default": false,
|
|
1287
|
-
"description": "Do not import this pipe into the owning NgModule."
|
|
1288
|
-
"x-user-analytics": 18
|
|
1305
|
+
"description": "Do not import this pipe into the owning NgModule."
|
|
1289
1306
|
},
|
|
1290
1307
|
"standalone": {
|
|
1291
1308
|
"description": "Whether the generated pipe is standalone.",
|
|
1292
1309
|
"type": "boolean",
|
|
1293
|
-
"default": false
|
|
1294
|
-
"x-user-analytics": 15
|
|
1310
|
+
"default": false
|
|
1295
1311
|
},
|
|
1296
1312
|
"module": {
|
|
1297
1313
|
"type": "string",
|
|
@@ -1301,8 +1317,7 @@
|
|
|
1301
1317
|
"export": {
|
|
1302
1318
|
"type": "boolean",
|
|
1303
1319
|
"default": false,
|
|
1304
|
-
"description": "The declaring NgModule exports this pipe."
|
|
1305
|
-
"x-user-analytics": 19
|
|
1320
|
+
"description": "The declaring NgModule exports this pipe."
|
|
1306
1321
|
}
|
|
1307
1322
|
}
|
|
1308
1323
|
},
|
|
@@ -1322,8 +1337,7 @@
|
|
|
1322
1337
|
"$default": {
|
|
1323
1338
|
"$source": "argv",
|
|
1324
1339
|
"index": 0
|
|
1325
|
-
}
|
|
1326
|
-
"x-prompt": "What name would you like to use for the new workspace and initial project?"
|
|
1340
|
+
}
|
|
1327
1341
|
},
|
|
1328
1342
|
"skipInstall": {
|
|
1329
1343
|
"description": "Do not install dependency packages.",
|
|
@@ -1374,14 +1388,12 @@
|
|
|
1374
1388
|
"inlineStyle": {
|
|
1375
1389
|
"description": "Include styles inline in the component TS file. By default, an external styles file is created and referenced in the component TypeScript file.",
|
|
1376
1390
|
"type": "boolean",
|
|
1377
|
-
"alias": "s"
|
|
1378
|
-
"x-user-analytics": 9
|
|
1391
|
+
"alias": "s"
|
|
1379
1392
|
},
|
|
1380
1393
|
"inlineTemplate": {
|
|
1381
1394
|
"description": "Include template inline in the component TS file. By default, an external template file is created and referenced in the component TypeScript file.",
|
|
1382
1395
|
"type": "boolean",
|
|
1383
|
-
"alias": "t"
|
|
1384
|
-
"x-user-analytics": 10
|
|
1396
|
+
"alias": "t"
|
|
1385
1397
|
},
|
|
1386
1398
|
"viewEncapsulation": {
|
|
1387
1399
|
"description": "The view encapsulation strategy to use in the initial project.",
|
|
@@ -1390,8 +1402,7 @@
|
|
|
1390
1402
|
"None",
|
|
1391
1403
|
"ShadowDom"
|
|
1392
1404
|
],
|
|
1393
|
-
"type": "string"
|
|
1394
|
-
"x-user-analytics": 11
|
|
1405
|
+
"type": "string"
|
|
1395
1406
|
},
|
|
1396
1407
|
"version": {
|
|
1397
1408
|
"type": "string",
|
|
@@ -1403,8 +1414,7 @@
|
|
|
1403
1414
|
},
|
|
1404
1415
|
"routing": {
|
|
1405
1416
|
"type": "boolean",
|
|
1406
|
-
"description": "Generate a routing module for the initial project."
|
|
1407
|
-
"x-user-analytics": 17
|
|
1417
|
+
"description": "Generate a routing module for the initial project."
|
|
1408
1418
|
},
|
|
1409
1419
|
"prefix": {
|
|
1410
1420
|
"type": "string",
|
|
@@ -1422,15 +1432,13 @@
|
|
|
1422
1432
|
"scss",
|
|
1423
1433
|
"sass",
|
|
1424
1434
|
"less"
|
|
1425
|
-
]
|
|
1426
|
-
"x-user-analytics": 5
|
|
1435
|
+
]
|
|
1427
1436
|
},
|
|
1428
1437
|
"skipTests": {
|
|
1429
1438
|
"description": "Do not generate \"spec.ts\" test files for the new project.",
|
|
1430
1439
|
"type": "boolean",
|
|
1431
1440
|
"default": false,
|
|
1432
|
-
"alias": "S"
|
|
1433
|
-
"x-user-analytics": 12
|
|
1441
|
+
"alias": "S"
|
|
1434
1442
|
},
|
|
1435
1443
|
"createApplication": {
|
|
1436
1444
|
"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.",
|
|
@@ -1440,14 +1448,12 @@
|
|
|
1440
1448
|
"minimal": {
|
|
1441
1449
|
"description": "Create a workspace without any testing frameworks. (Use for learning purposes only.)",
|
|
1442
1450
|
"type": "boolean",
|
|
1443
|
-
"default": false
|
|
1444
|
-
"x-user-analytics": 14
|
|
1451
|
+
"default": false
|
|
1445
1452
|
},
|
|
1446
1453
|
"strict": {
|
|
1447
1454
|
"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",
|
|
1448
1455
|
"type": "boolean",
|
|
1449
|
-
"default": true
|
|
1450
|
-
"x-user-analytics": 7
|
|
1456
|
+
"default": true
|
|
1451
1457
|
},
|
|
1452
1458
|
"packageManager": {
|
|
1453
1459
|
"description": "The package manager used to install dependencies.",
|
|
@@ -1473,14 +1479,12 @@
|
|
|
1473
1479
|
"$default": {
|
|
1474
1480
|
"$source": "argv",
|
|
1475
1481
|
"index": 0
|
|
1476
|
-
}
|
|
1477
|
-
"x-prompt": "What name would you like to use for the resolver?"
|
|
1482
|
+
}
|
|
1478
1483
|
},
|
|
1479
1484
|
"skipTests": {
|
|
1480
1485
|
"type": "boolean",
|
|
1481
1486
|
"description": "Do not create \"spec.ts\" test files for the new resolver.",
|
|
1482
|
-
"default": false
|
|
1483
|
-
"x-user-analytics": 12
|
|
1487
|
+
"default": false
|
|
1484
1488
|
},
|
|
1485
1489
|
"flat": {
|
|
1486
1490
|
"type": "boolean",
|
|
@@ -1517,8 +1521,7 @@
|
|
|
1517
1521
|
"$default": {
|
|
1518
1522
|
"$source": "argv",
|
|
1519
1523
|
"index": 0
|
|
1520
|
-
}
|
|
1521
|
-
"x-prompt": "What name would you like to use for the service?"
|
|
1524
|
+
}
|
|
1522
1525
|
},
|
|
1523
1526
|
"path": {
|
|
1524
1527
|
"type": "string",
|
|
@@ -1543,8 +1546,7 @@
|
|
|
1543
1546
|
"skipTests": {
|
|
1544
1547
|
"type": "boolean",
|
|
1545
1548
|
"description": "Do not create \"spec.ts\" test files for the new service.",
|
|
1546
|
-
"default": false
|
|
1547
|
-
"x-user-analytics": 12
|
|
1549
|
+
"default": false
|
|
1548
1550
|
}
|
|
1549
1551
|
}
|
|
1550
1552
|
},
|
|
@@ -1576,8 +1578,7 @@
|
|
|
1576
1578
|
"$default": {
|
|
1577
1579
|
"$source": "argv",
|
|
1578
1580
|
"index": 0
|
|
1579
|
-
}
|
|
1580
|
-
"x-prompt": "What name would you like to use for the worker?"
|
|
1581
|
+
}
|
|
1581
1582
|
},
|
|
1582
1583
|
"snippet": {
|
|
1583
1584
|
"type": "boolean",
|
|
@@ -1744,7 +1745,6 @@
|
|
|
1744
1745
|
},
|
|
1745
1746
|
"optimization": {
|
|
1746
1747
|
"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.",
|
|
1747
|
-
"x-user-analytics": 16,
|
|
1748
1748
|
"default": true,
|
|
1749
1749
|
"oneOf": [
|
|
1750
1750
|
{
|
|
@@ -1827,7 +1827,6 @@
|
|
|
1827
1827
|
"aot": {
|
|
1828
1828
|
"type": "boolean",
|
|
1829
1829
|
"description": "Build using Ahead of Time compilation.",
|
|
1830
|
-
"x-user-analytics": 13,
|
|
1831
1830
|
"default": true
|
|
1832
1831
|
},
|
|
1833
1832
|
"sourceMap": {
|
|
@@ -1882,7 +1881,7 @@
|
|
|
1882
1881
|
"deployUrl": {
|
|
1883
1882
|
"type": "string",
|
|
1884
1883
|
"description": "URL where files will be deployed.",
|
|
1885
|
-
"
|
|
1884
|
+
"deprecated": true
|
|
1886
1885
|
},
|
|
1887
1886
|
"verbose": {
|
|
1888
1887
|
"type": "boolean",
|
|
@@ -2692,7 +2691,6 @@
|
|
|
2692
2691
|
},
|
|
2693
2692
|
"optimization": {
|
|
2694
2693
|
"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.",
|
|
2695
|
-
"x-user-analytics": 16,
|
|
2696
2694
|
"default": true,
|
|
2697
2695
|
"oneOf": [
|
|
2698
2696
|
{
|
|
@@ -2770,7 +2768,7 @@
|
|
|
2770
2768
|
"deployUrl": {
|
|
2771
2769
|
"type": "string",
|
|
2772
2770
|
"description": "URL where files will be deployed.",
|
|
2773
|
-
"
|
|
2771
|
+
"deprecated": true
|
|
2774
2772
|
},
|
|
2775
2773
|
"verbose": {
|
|
2776
2774
|
"type": "boolean",
|
package/lib/init.js
CHANGED
|
@@ -93,10 +93,12 @@ let forceExit = false;
|
|
|
93
93
|
// eslint-disable-next-line no-console
|
|
94
94
|
console.error('Version mismatch check skipped. Unable to compare local version: ' + error);
|
|
95
95
|
}
|
|
96
|
-
|
|
96
|
+
const rawCommandName = process.argv[2];
|
|
97
|
+
// When using the completion command, don't show the warning as otherwise this will break completion.
|
|
98
|
+
if (isGlobalGreater && rawCommandName !== 'completion') {
|
|
97
99
|
// If using the update command and the global version is greater, use the newer update command
|
|
98
100
|
// This allows improvements in update to be used in older versions that do not have bootstrapping
|
|
99
|
-
if (
|
|
101
|
+
if (rawCommandName === 'update' &&
|
|
100
102
|
cli.VERSION &&
|
|
101
103
|
cli.VERSION.major - globalVersion.major <= 1) {
|
|
102
104
|
cli = await Promise.resolve().then(() => __importStar(require('./cli')));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@angular/cli",
|
|
3
|
-
"version": "14.0.
|
|
3
|
+
"version": "14.0.5",
|
|
4
4
|
"description": "CLI tool for Angular",
|
|
5
5
|
"main": "lib/cli/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -25,10 +25,10 @@
|
|
|
25
25
|
},
|
|
26
26
|
"homepage": "https://github.com/angular/angular-cli",
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@angular-devkit/architect": "0.1400.
|
|
29
|
-
"@angular-devkit/core": "14.0.
|
|
30
|
-
"@angular-devkit/schematics": "14.0.
|
|
31
|
-
"@schematics/angular": "14.0.
|
|
28
|
+
"@angular-devkit/architect": "0.1400.5",
|
|
29
|
+
"@angular-devkit/core": "14.0.5",
|
|
30
|
+
"@angular-devkit/schematics": "14.0.5",
|
|
31
|
+
"@schematics/angular": "14.0.5",
|
|
32
32
|
"@yarnpkg/lockfile": "1.1.0",
|
|
33
33
|
"ansi-colors": "4.1.1",
|
|
34
34
|
"debug": "4.3.4",
|
|
@@ -49,12 +49,12 @@
|
|
|
49
49
|
"ng-update": {
|
|
50
50
|
"migrations": "@schematics/angular/migrations/migration-collection.json",
|
|
51
51
|
"packageGroup": {
|
|
52
|
-
"@angular/cli": "14.0.
|
|
53
|
-
"@angular-devkit/architect": "0.1400.
|
|
54
|
-
"@angular-devkit/build-angular": "14.0.
|
|
55
|
-
"@angular-devkit/build-webpack": "0.1400.
|
|
56
|
-
"@angular-devkit/core": "14.0.
|
|
57
|
-
"@angular-devkit/schematics": "14.0.
|
|
52
|
+
"@angular/cli": "14.0.5",
|
|
53
|
+
"@angular-devkit/architect": "0.1400.5",
|
|
54
|
+
"@angular-devkit/build-angular": "14.0.5",
|
|
55
|
+
"@angular-devkit/build-webpack": "0.1400.5",
|
|
56
|
+
"@angular-devkit/core": "14.0.5",
|
|
57
|
+
"@angular-devkit/schematics": "14.0.5"
|
|
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;
|
|
@@ -149,6 +149,7 @@ class CommandModule {
|
|
|
149
149
|
* **Note:** This method should be called from the command bundler method.
|
|
150
150
|
*/
|
|
151
151
|
addSchemaOptionsToCommand(localYargs, options) {
|
|
152
|
+
const booleanOptionsWithNoPrefix = new Set();
|
|
152
153
|
for (const option of options) {
|
|
153
154
|
const { default: defaultVal, positional, deprecated, description, alias, userAnalytics, type, hidden, name, choices, } = option;
|
|
154
155
|
const sharedOptions = {
|
|
@@ -160,14 +161,24 @@ class CommandModule {
|
|
|
160
161
|
// This should only be done when `--help` is used otherwise default will override options set in angular.json.
|
|
161
162
|
...(this.context.args.options.help ? { default: defaultVal } : {}),
|
|
162
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
|
+
let dashedName = core_1.strings.dasherize(name);
|
|
167
|
+
if (type === 'boolean' && dashedName.startsWith('no-')) {
|
|
168
|
+
dashedName = dashedName.slice(3);
|
|
169
|
+
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
|
+
}
|
|
163
174
|
if (positional === undefined) {
|
|
164
|
-
localYargs = localYargs.option(
|
|
175
|
+
localYargs = localYargs.option(dashedName, {
|
|
165
176
|
type,
|
|
166
177
|
...sharedOptions,
|
|
167
178
|
});
|
|
168
179
|
}
|
|
169
180
|
else {
|
|
170
|
-
localYargs = localYargs.positional(
|
|
181
|
+
localYargs = localYargs.positional(dashedName, {
|
|
171
182
|
type: type === 'array' || type === 'count' ? 'string' : type,
|
|
172
183
|
...sharedOptions,
|
|
173
184
|
});
|
|
@@ -177,6 +188,18 @@ class CommandModule {
|
|
|
177
188
|
this.optionsWithAnalytics.set(name, userAnalytics);
|
|
178
189
|
}
|
|
179
190
|
}
|
|
191
|
+
// TODO(alanagius4): remove in a major version.
|
|
192
|
+
// the below is an interim workaround to handle options which have been defined in the schema with `no` prefix.
|
|
193
|
+
if (booleanOptionsWithNoPrefix.size) {
|
|
194
|
+
localYargs.middleware((options) => {
|
|
195
|
+
for (const key of booleanOptionsWithNoPrefix) {
|
|
196
|
+
if (key in options) {
|
|
197
|
+
options[`no-${key}`] = !options[key];
|
|
198
|
+
delete options[key];
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
}, false);
|
|
202
|
+
}
|
|
180
203
|
return localYargs;
|
|
181
204
|
}
|
|
182
205
|
getWorkspaceOrThrow() {
|
|
@@ -136,7 +136,7 @@ async function runCommand(args, logger) {
|
|
|
136
136
|
'deprecated: %s': color_1.colors.yellow('deprecated:') + ' %s',
|
|
137
137
|
'Did you mean %s?': 'Unknown command. Did you mean %s?',
|
|
138
138
|
})
|
|
139
|
-
.epilogue(
|
|
139
|
+
.epilogue('For more information, see https://angular.io/cli/.\n')
|
|
140
140
|
.demandCommand(1, command_1.demandCommandFailureMessage)
|
|
141
141
|
.recommendCommands()
|
|
142
142
|
.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();
|
package/src/commands/run/cli.js
CHANGED
|
@@ -30,6 +30,16 @@ class RunCommandModule extends architect_base_command_module_1.ArchitectBaseComm
|
|
|
30
30
|
// Also, hide choices from JSON help so that we don't display them in AIO.
|
|
31
31
|
choices: (getYargsCompletions || help) && !jsonHelp ? this.getTargetChoices() : undefined,
|
|
32
32
|
})
|
|
33
|
+
.middleware((args) => {
|
|
34
|
+
// TODO: remove in version 15.
|
|
35
|
+
const { configuration, target } = args;
|
|
36
|
+
if (typeof configuration === 'string' && target) {
|
|
37
|
+
const targetWithConfig = target.split(':', 2);
|
|
38
|
+
targetWithConfig.push(configuration);
|
|
39
|
+
throw new command_module_1.CommandModuleError('Unknown argument: configuration.\n' +
|
|
40
|
+
`Provide the configuration as part of the target 'ng run ${targetWithConfig.join(':')}'.`);
|
|
41
|
+
}
|
|
42
|
+
}, true)
|
|
33
43
|
.strict();
|
|
34
44
|
const target = this.makeTargetSpecifier();
|
|
35
45
|
if (!target) {
|
|
@@ -72,8 +72,7 @@ class UpdateCommandModule extends command_module_1.CommandModule {
|
|
|
72
72
|
array: true,
|
|
73
73
|
})
|
|
74
74
|
.option('force', {
|
|
75
|
-
description: 'Ignore peer dependency version mismatches.
|
|
76
|
-
`Passes the '--force' flag to the package manager when installing packages.`,
|
|
75
|
+
description: 'Ignore peer dependency version mismatches.',
|
|
77
76
|
type: 'boolean',
|
|
78
77
|
default: false,
|
|
79
78
|
})
|
|
@@ -189,7 +188,7 @@ class UpdateCommandModule extends command_module_1.CommandModule {
|
|
|
189
188
|
logger.info(`Found ${rootDependencies.size} dependencies.`);
|
|
190
189
|
const workflow = new tools_1.NodeWorkflow(this.context.root, {
|
|
191
190
|
packageManager: packageManager.name,
|
|
192
|
-
packageManagerForce: options.
|
|
191
|
+
packageManagerForce: this.packageManagerForce(options.verbose),
|
|
193
192
|
// __dirname -> favor @schematics/update from this package
|
|
194
193
|
// Otherwise, use packages from the active workspace (migrations)
|
|
195
194
|
resolvePaths: [__dirname, this.context.root],
|
|
@@ -511,23 +510,7 @@ class UpdateCommandModule extends command_module_1.CommandModule {
|
|
|
511
510
|
});
|
|
512
511
|
}
|
|
513
512
|
catch { }
|
|
514
|
-
|
|
515
|
-
// npm 7+ can fail due to it incorrectly resolving peer dependencies that have valid SemVer
|
|
516
|
-
// ranges during an update. Update will set correct versions of dependencies within the
|
|
517
|
-
// package.json file. The force option is set to workaround these errors.
|
|
518
|
-
// Example error:
|
|
519
|
-
// npm ERR! Conflicting peer dependency: @angular/compiler-cli@14.0.0-rc.0
|
|
520
|
-
// npm ERR! node_modules/@angular/compiler-cli
|
|
521
|
-
// npm ERR! peer @angular/compiler-cli@"^14.0.0 || ^14.0.0-rc" from @angular-devkit/build-angular@14.0.0-rc.0
|
|
522
|
-
// npm ERR! node_modules/@angular-devkit/build-angular
|
|
523
|
-
// npm ERR! dev @angular-devkit/build-angular@"~14.0.0-rc.0" from the root project
|
|
524
|
-
if (this.context.packageManager.name === workspace_schema_1.PackageManager.Npm &&
|
|
525
|
-
this.context.packageManager.version &&
|
|
526
|
-
semver.gte(this.context.packageManager.version, '7.0.0', { includePrerelease: true })) {
|
|
527
|
-
logVerbose('NPM 7+ detected -- enabling force option for package installation');
|
|
528
|
-
forceInstall = true;
|
|
529
|
-
}
|
|
530
|
-
const installationSuccess = await this.context.packageManager.installAll(forceInstall ? ['--force'] : [], this.context.root);
|
|
513
|
+
const installationSuccess = await this.context.packageManager.installAll(this.packageManagerForce(options.verbose) ? ['--force'] : [], this.context.root);
|
|
531
514
|
if (!installationSuccess) {
|
|
532
515
|
return 1;
|
|
533
516
|
}
|
|
@@ -739,6 +722,26 @@ class UpdateCommandModule extends command_module_1.CommandModule {
|
|
|
739
722
|
}
|
|
740
723
|
return status !== null && status !== void 0 ? status : 0;
|
|
741
724
|
}
|
|
725
|
+
packageManagerForce(verbose) {
|
|
726
|
+
// npm 7+ can fail due to it incorrectly resolving peer dependencies that have valid SemVer
|
|
727
|
+
// ranges during an update. Update will set correct versions of dependencies within the
|
|
728
|
+
// package.json file. The force option is set to workaround these errors.
|
|
729
|
+
// Example error:
|
|
730
|
+
// npm ERR! Conflicting peer dependency: @angular/compiler-cli@14.0.0-rc.0
|
|
731
|
+
// npm ERR! node_modules/@angular/compiler-cli
|
|
732
|
+
// npm ERR! peer @angular/compiler-cli@"^14.0.0 || ^14.0.0-rc" from @angular-devkit/build-angular@14.0.0-rc.0
|
|
733
|
+
// npm ERR! node_modules/@angular-devkit/build-angular
|
|
734
|
+
// npm ERR! dev @angular-devkit/build-angular@"~14.0.0-rc.0" from the root project
|
|
735
|
+
if (this.context.packageManager.name === workspace_schema_1.PackageManager.Npm &&
|
|
736
|
+
this.context.packageManager.version &&
|
|
737
|
+
semver.gte(this.context.packageManager.version, '7.0.0', { includePrerelease: true })) {
|
|
738
|
+
if (verbose) {
|
|
739
|
+
this.context.logger.info('NPM 7+ detected -- enabling force option for package installation');
|
|
740
|
+
}
|
|
741
|
+
return true;
|
|
742
|
+
}
|
|
743
|
+
return false;
|
|
744
|
+
}
|
|
742
745
|
}
|
|
743
746
|
exports.UpdateCommandModule = UpdateCommandModule;
|
|
744
747
|
/**
|
|
@@ -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);
|