@@ -123,20 +123,6 @@ public void processOpts() {
123
123
additionalProperties .put (NG_PACKAGR , true );
124
124
}
125
125
126
- // Set the typescript version compatible to the Angular version
127
- if (ngVersion .atLeast ("8.0.0" )) {
128
- additionalProperties .put ("tsVersion" , ">=3.4.0 <3.6.0" );
129
- } else if (ngVersion .atLeast ("7.0.0" )) {
130
- additionalProperties .put ("tsVersion" , ">=3.1.1 <3.2.0" );
131
- } else if (ngVersion .atLeast ("6.0.0" )) {
132
- additionalProperties .put ("tsVersion" , ">=2.7.2 and <2.10.0" );
133
- } else if (ngVersion .atLeast ("5.0.0" )) {
134
- additionalProperties .put ("tsVersion" , ">=2.1.5 <2.7.0" );
135
- } else {
136
- // Angular v2-v4 requires typescript ">=2.1.5 <2.8"
137
- additionalProperties .put ("tsVersion" , ">=2.1.5 <2.8.0" );
138
- }
139
-
140
126
// Set the rxJS version compatible to the Angular version
141
127
if (ngVersion .atLeast ("8.0.0" )) {
142
128
additionalProperties .put ("rxjsVersion" , "6.5.0" );
@@ -154,7 +140,7 @@ public void processOpts() {
154
140
if (!ngVersion .atLeast ("4.3.0" )) {
155
141
supportingFiles .add (new SupportingFile ("rxjs-operators.mustache" , getIndexDirectory (), "rxjs-operators.ts" ));
156
142
}
157
-
143
+
158
144
// Version after Angular 10 require ModuleWithProviders to be generic. Compatible from version 7.
159
145
if (ngVersion .atLeast ("7.0.0" )) {
160
146
additionalProperties .put ("genericModuleWithProviders" , true );
@@ -174,50 +160,6 @@ public void processOpts() {
174
160
// Libraries generated with v2.x of ng-packagr will ship with AoT metadata in v4, which is intended for Angular v5 (and Angular v6).
175
161
additionalProperties .put ("useOldNgPackagr" , !ngVersion .atLeast ("5.0.0" ));
176
162
177
- // Specific ng-packagr configuration
178
- if (ngVersion .atLeast ("8.0.0" )) {
179
- additionalProperties .put ("ngPackagrVersion" , "5.4.0" );
180
- additionalProperties .put ("tsickleVersion" , "0.35.0" );
181
- } else if (ngVersion .atLeast ("7.0.0" )) {
182
- // compatible versions with typescript version
183
- additionalProperties .put ("ngPackagrVersion" , "5.1.0" );
184
- additionalProperties .put ("tsickleVersion" , "0.34.0" );
185
- } else if (ngVersion .atLeast ("6.0.0" )) {
186
- // compatible versions with typescript version
187
- additionalProperties .put ("ngPackagrVersion" , "3.0.6" );
188
- additionalProperties .put ("tsickleVersion" , "0.32.1" );
189
- } else if (ngVersion .atLeast ("5.0.0" )) {
190
- // compatible versions with typescript version
191
- additionalProperties .put ("ngPackagrVersion" , "2.4.5" );
192
- additionalProperties .put ("tsickleVersion" , "0.27.5" );
193
- } else {
194
- // Angular versions prior to v5
195
- additionalProperties .put ("ngPackagrVersion" , "1.6.0" );
196
- }
197
-
198
- // set zone.js version
199
- if (ngVersion .atLeast ("8.0.0" )) {
200
- additionalProperties .put ("zonejsVersion" , "0.9.1" );
201
- } else if (ngVersion .atLeast ("5.0.0" )) {
202
- // compatible versions to Angular 5+
203
- additionalProperties .put ("zonejsVersion" , "0.8.26" );
204
- } else {
205
- // Angular versions prior to v5
206
- additionalProperties .put ("zonejsVersion" , "0.7.6" );
207
- }
208
-
209
- // set http client usage
210
- if (ngVersion .atLeast ("8.0.0" )) {
211
- additionalProperties .put ("useHttpClient" , true );
212
- additionalProperties .put ("useHttpClientPackage" , false );
213
- } else if (ngVersion .atLeast ("4.3.0" )) {
214
- additionalProperties .put ("useHttpClient" , true );
215
- additionalProperties .put ("useHttpClientPackage" , true );
216
- } else {
217
- additionalProperties .put ("useHttpClient" , false );
218
- additionalProperties .put ("useHttpClientPackage" , false );
219
- }
220
-
221
163
if (additionalProperties .containsKey (PROVIDED_IN_ROOT ) && !ngVersion .atLeast ("6.0.0" )) {
222
164
additionalProperties .put (PROVIDED_IN_ROOT ,false );
223
165
}
@@ -226,7 +168,7 @@ public void processOpts() {
226
168
additionalProperties .put ("injectionTokenTyped" , ngVersion .atLeast ("4.0.0" ));
227
169
228
170
if (additionalProperties .containsKey (NPM_NAME )) {
229
- addNpmPackageGeneration ();
171
+ addNpmPackageGeneration (ngVersion );
230
172
}
231
173
232
174
if (additionalProperties .containsKey (WITH_INTERFACES )) {
@@ -252,7 +194,7 @@ private SemVer determineNgVersion() {
252
194
return ngVersion ;
253
195
}
254
196
255
- private void addNpmPackageGeneration () {
197
+ private void addNpmPackageGeneration (SemVer ngVersion ) {
256
198
if (additionalProperties .containsKey (NPM_NAME )) {
257
199
this .setNpmName (additionalProperties .get (NPM_NAME ).toString ());
258
200
}
@@ -271,6 +213,60 @@ private void addNpmPackageGeneration() {
271
213
this .setNpmRepository (additionalProperties .get (NPM_REPOSITORY ).toString ());
272
214
}
273
215
216
+ additionalProperties .put ("useRxJS6" , true );
217
+ additionalProperties .put ("useHttpClient" , true );
218
+ additionalProperties .put ("useHttpClientPackage" , false );
219
+ if (ngVersion .atLeast ("11.0.0" )) {
220
+ additionalProperties .put ("tsVersion" , ">=4.0.0 <4.1.0" );
221
+ additionalProperties .put ("rxjsVersion" , "6.6.0" );
222
+ additionalProperties .put ("ngPackagrVersion" , "11.0.2" );
223
+ additionalProperties .put ("tsickleVersion" , "0.39.1" );
224
+ additionalProperties .put ("zonejsVersion" , "0.11.3" );
225
+ } else if (ngVersion .atLeast ("10.0.0" )) {
226
+ additionalProperties .put ("tsVersion" , ">=3.9.2 <4.0.0" );
227
+ additionalProperties .put ("rxjsVersion" , "6.6.0" );
228
+ additionalProperties .put ("ngPackagrVersion" , "10.0.3" );
229
+ additionalProperties .put ("tsickleVersion" , "0.39.1" );
230
+ additionalProperties .put ("zonejsVersion" , "0.10.2" );
231
+ } else if (ngVersion .atLeast ("9.0.0" )) {
232
+ additionalProperties .put ("tsVersion" , ">=3.6.0 <3.8.0" );
233
+ additionalProperties .put ("rxjsVersion" , "6.5.3" );
234
+ additionalProperties .put ("ngPackagrVersion" , "9.0.1" );
235
+ additionalProperties .put ("tsickleVersion" , "0.38.0" );
236
+ additionalProperties .put ("zonejsVersion" , "0.10.2" );
237
+ } else if (ngVersion .atLeast ("8.0.0" )) {
238
+ additionalProperties .put ("tsVersion" , ">=3.4.0 <3.6.0" );
239
+ additionalProperties .put ("rxjsVersion" , "6.5.0" );
240
+ additionalProperties .put ("ngPackagrVersion" , "5.4.0" );
241
+ additionalProperties .put ("tsickleVersion" , "0.35.0" );
242
+ additionalProperties .put ("zonejsVersion" , "0.9.1" );
243
+ } else if (ngVersion .atLeast ("7.0.0" )) {
244
+ additionalProperties .put ("tsVersion" , ">=3.1.1 <3.2.0" );
245
+ additionalProperties .put ("rxjsVersion" , "6.3.0" );
246
+ additionalProperties .put ("ngPackagrVersion" , "5.1.0" );
247
+ additionalProperties .put ("tsickleVersion" , "0.34.0" );
248
+ additionalProperties .put ("zonejsVersion" , "0.8.26" );
249
+
250
+ additionalProperties .put ("useHttpClientPackage" , true );
251
+ } else if (ngVersion .atLeast ("6.0.0" )) {
252
+ additionalProperties .put ("tsVersion" , ">=2.7.2 and <2.10.0" );
253
+ additionalProperties .put ("rxjsVersion" , "6.1.0" );
254
+ additionalProperties .put ("ngPackagrVersion" , "3.0.6" );
255
+ additionalProperties .put ("tsickleVersion" , "0.32.1" );
256
+ additionalProperties .put ("zonejsVersion" , "0.8.26" );
257
+
258
+ additionalProperties .put ("useHttpClientPackage" , true );
259
+ } else {
260
+ additionalProperties .put ("tsVersion" , ">=2.1.5 and <2.8" );
261
+ additionalProperties .put ("rxjsVersion" , "6.1.0" );
262
+ additionalProperties .put ("ngPackagrVersion" , "3.0.6" );
263
+ additionalProperties .put ("tsickleVersion" , "0.32.1" );
264
+ additionalProperties .put ("zonejsVersion" , "0.8.26" );
265
+
266
+ additionalProperties .put ("useRxJS6" , false );
267
+ additionalProperties .put ("useHttpClientPackage" , true );
268
+ }
269
+
274
270
//Files for building our lib
275
271
supportingFiles .add (new SupportingFile ("README.mustache" , getIndexDirectory (), "README.md" ));
276
272
supportingFiles .add (new SupportingFile ("package.mustache" , getIndexDirectory (), "package.json" ));
0 commit comments