108 Commits

Author SHA1 Message Date
Alan Agius
d585f99a3e fix(@schematics/angular): blank root leads to wrong tsconfig.lib.prod.json path
Closes: #16444
2019-12-17 11:17:59 -08:00
Charles Lyding
922be51746 fix(@schematics/angular): workaround schematic/json AST issues in 9.0 i18n migration 2019-12-12 14:02:25 -08:00
Charles Lyding
7abaf391b3 refactor(@schematics/angular): separate i18n workspace 9.0 migration 2019-12-12 14:02:25 -08:00
Charles Lyding
347667432e fix(@schematics/angular): improve i18n output path option migration
Output paths that use the locale within a locale specific configuration will now be automatically removed.  This will prevent the potential for the migrated configuration to generate an output path with double locale segments.
2019-12-11 10:51:06 -08:00
Charles Lyding
97c0d57be8 fix(@schematics/angular): improve i18n baseHref migration support for direct localize usage 2019-12-04 08:14:16 -08:00
Charles Lyding
df4c035315 fix(@schematics/angular): migrate localized base HREF options for 9.0 2019-12-04 08:14:16 -08:00
Charles Lyding
b1106360ac fix(@schematics/angular): when migrating do not set base localize option for builder
This can cause unnecesary rebuild time increases and is unneeded when using the new multi-locale builds.
2019-11-26 13:05:30 -08:00
Alan Agius
8b23e64972 fix(@schematics/angular): migrate project to use new i18n options 2019-11-19 11:40:51 -08:00
Alan Agius
e9551f9624 fix(@schematics/angular): only remove tslib from package.json when it's not a dependency
Fixes: #16191
2019-11-14 11:10:19 -08:00
Alan Agius
1db57d44dd fix(@schematics/angular): return undefined instead of throw when file is not found
Follow up on https://github.com/angular/angular-cli/pull/16063
2019-11-11 09:13:20 -08:00
Alan Agius
bd840b2ea5 fix(@schematics/angular): improve cli migration name and description (#16093) 2019-11-07 16:41:56 -08:00
Alan Agius
449c51f87e fix(@schematics/angular): only show ngsw-config.json file not find warning when ngswConfigPath is defined 2019-11-07 10:09:20 -08:00
Alan Agius
bcd6d059b3 fix(@schematics/angular): migrate module compiler option
This migration coverts the TypeScript `module` compiler option to `esnext` or `commonjs` which is required when using `import()`.

Fixes: #16094
2019-11-07 10:08:51 -08:00
Alan Agius
9ba78050bb fix(@schematics/angular): warn when target references a missing tsconfig
Fixes #16019
2019-11-05 16:37:18 -08:00
Alan Agius
d13387db4d fix(@schematics/angular): tsconfig creates invalid file references
Fixes: #16035
2019-11-04 13:27:32 -08:00
Alan Agius
afae476b51 fix(@schematics/angular): replace '**/*.ts file inclusion with **/*.d.ts
This fixes warnings such as the below;
```
WARNING in /test-update/src/environments/environment.prod.ts is part of the TypeScript compilation but it's unused.
Add only entry points to the 'files' or 'include' properties in your tsconfig.
```

When the previous generated add was in VE.
2019-11-04 13:27:32 -08:00
Charles Lyding
77714cc630 fix(@schematics/angular): disable i18n migrations 2019-10-30 12:00:18 -07:00
Filipe Silva
3fc4c91fff feat(@schematics/angular): update @types/node for version 9
Angular will only support TS 3.6+ on version 9, and older versions of `@types/node` are incompatible with it and will cause all builds to fail.

Related to https://github.com/angular/angular/pull/33250
2019-10-21 09:37:29 -07:00
Alan Agius
a7f977f05d feat(@schematics/angular): remove @angular/pwa from depedencies
`@angular/pwa` is not needed as a dependency. This is because the pwa package is a schematic and is only used once when adding pwa capabilities to your application. After that, this package is not used anymore.

Closes #15764
2019-10-14 13:40:31 -07:00
Alan Agius
750baf92d6 feat(@schematics/angular): add migration to add new i18n options for Ivy
This migration will update current projects by adding the `i18n` project level option and add `localize` option in the server and browser builder configurations when both `i18nLocale` and `i18nFile` are defined.
2019-10-14 09:55:49 -07:00
Alan Agius
08bc4df4c6 feat(@schematics/angular): add migration ensure that tslib is installed (#15800)
Related to: https://github.com/angular/angular/pull/32167
2019-10-09 11:03:43 -07:00
mgechev
e2e7dee752 feat(@schematics/angular): use codelyzer@5.1.2 2019-09-27 14:39:50 -07:00
Alan Agius
8ea892cb7e feat(@schematics/angular): enable scripts optimization for server bundle
The optimizations are suggested to;
1) disables ngDevMode via terser
2) helps with cold server starts the same way as client by lowering JS parse times
2019-09-23 10:38:48 -07:00
Alan Agius
745670fa6a feat(@schematics/angular): remove dependency on tsickle (#15603)
With this change we remove the requirement  to add tsickle as a dependency when having a workspace library.

Since the CTOR downlevel transformer which was previously provided via tsickle  is now in ng-packagr version 5.5.1+ We migrate existing libraries to remove the need for tsickle.
2019-09-18 14:50:29 +01:00
Alan Agius
600e5d08b0 feat(@schematics/angular): add migration to add missing exports in main server file
Update the `main.server.ts` file by adding exports to `renderModule` and `renderModuleFactory` which are now required for Universal and App-Shell for Ivy and `bundleDependencies`.
2019-09-10 10:01:50 -07:00
Alan Agius
b68eec20ef feat(@schematics/angular): run lazy loading migration for version 9
Closes #15539
2019-09-09 14:10:28 -07:00
Alan Agius
b26d6baf8f refactor: create readJsonFileAsAstObject utility 2019-09-05 00:26:07 +05:30
Alan Agius
4203294d53 feat(@schematics/angular): add migration for applications tsconfigs
This migration updates the current tsconfig for the applications in two ways.

1) removes `enableIvy: true` option since it's by default true.
2) Amends the files/exclude/include options to only include files that are needed in the compilation.
2019-09-05 00:26:07 +05:30
Alan
f4691a545a feat(@schematics/angular): add migration to enable AOT by default
With this change we enable the AOT option for the browser builder when an application will use Ivy as rendering engine.
2019-08-30 00:08:52 +05:30
Alan Agius
578b196936 feat(@schematics/angular): add migration for ngsw-config.json (#15443) 2019-08-27 10:25:34 -07:00
Alan Agius
aeaa97c283 feat(@schematics/angular): add migration for dependencies (#15421) 2019-08-23 10:01:59 -07:00
Alan Agius
f7f5f5bdd1 fix(@schematics/angular): handle existence of un-referenced library prod tsconfig 2019-08-16 11:59:05 -07:00
Alan Agius
46274df62c refactor: workspace config migration to use helper methods 2019-08-16 09:31:18 -07:00
Alan Agius
23217fad08 feat(@schematics/angular): ivy library migration
Add a migration to migrate existing libraries to the new library layout considering it will be the default in version 9.
2019-08-16 09:31:18 -07:00
Charles Lyding
5a7b823b28 test: remove use of deprecated synchronous test helper runSchematic 2019-08-08 08:27:31 -07:00
Alan Agius
15ef15e94a style: remove redundant max-line-length disables and fix other lint issues 2019-07-24 19:06:21 -07:00
Alan Agius
19b120947d feat(@schematics/angular): add migration to add anyComponentStyle bundle budget 2019-07-24 19:05:00 -07:00
Alan Agius
d8bdf86d07 fix(@schematics/update): update @angular/pwa when migrating to 8
Related to https://github.com/angular/angular-cli/issues/14589#issuecomment-508026441
2019-07-10 04:14:31 +08:00
Alan
040e3ea789 feat(@schematics/angular): add migration from lazy option to inject 2019-07-02 11:05:51 -07:00
Alan
6416629a42 fix(@schematics/angular): replace forked web-animations-js with latest version
Closes #14518
2019-06-25 13:35:50 -07:00
Alan
aed4228d6f style: disable tslint rule no-big-function 2019-06-25 13:30:28 -07:00
Alan
01930d685d test: file override should happen before migration being run 2019-06-25 13:30:28 -07:00
Alan Agius
c6fb34a092 fix(@schematics/angular): enable tsc downlevelIteration
We by default now use ES2015. Users can use ES2015 iterations however the ES5 build will fail.

Fixes #14697
2019-06-07 13:00:28 -07:00
Alan Agius
0531242f4b fix(@schematics/angular): move browserslist even when no sourceRoot is available
```
Using package manager: 'npm'
Collecting installed dependencies...
Found 36 dependencies.
    ** Executing migrations for package '@angular/cli' **
RENAME src/browserslist => /browserslist
UPDATE tslint.json (2800 bytes)
UPDATE package.json (1396 bytes)
UPDATE tsconfig.json (460 bytes)
UPDATE tsconfig.app.json (282 bytes)
UPDATE tsconfig.spec.json (256 bytes)
```

Fixes #14660
2019-06-06 14:31:32 -07:00
Alan
50c974a583 fix(@schematics/angular): add '@angular-devkit/build-webpack' package to the version 8 migration 2019-06-06 14:16:51 -07:00
Alan
89a122cd5c fix(@schematics/angular): update ng-packagr and tsickle when migrating to version 8 2019-06-06 14:16:51 -07:00
Alan Agius
576119f2ca fix(@schematics/angular): TypeScript related migrations should cater for BOM
In the CLI `UpdateRecorder` methods such as `insertLeft`, `remove` etc.. accepts positions which are not offset by a BOM. This is because when a file has a BOM a different recorder will be used https://github.com/angular/angular-cli/blob/master/packages/angular_devkit/schematics/src/tree/recorder.ts#L72 which caters for an addition offset/delta.

The main reason for this is that when a developer is writing a schematic they shouldn't need to compute the offset based if a file has a BOM or not and is handled out of the box.

Example
```ts
recorder.insertLeft(5, 'true');
```

However this is unfortunate in the case if a ts SourceFile is used and one uses `getWidth` and `getStart` method they will already be offset by 1, which at the end it results in a double offset and hence the problem.

Fixes #14551
2019-05-30 10:21:49 -07:00
Alan Agius
3afdab21a0 fix(@schematics/angular): add migration to update web-animations-js polyfill
Previous versions rely on `this` which breaks differential loading since it's `undefined` when using script tags with type module.

Fixes #14518
2019-05-28 13:32:53 -07:00
Alan Agius
4e693ef694 fix(@schematics/angular): update or add module and target to non extended tsconfig
Fixes #14436
2019-05-21 09:00:38 -04:00
Alan Agius
c81adbdad3 fix(@schematics/angular): polyfills migration leaving broken code in windows
Replacment of line endings should only happen to increase the hash matches as otherwise the recorder will fail to update the correct positions

Fixes #14443
2019-05-17 11:27:12 -07:00