212 Commits

Author SHA1 Message Date
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
Alan Agius
5125db38f8 fix(@schematics/angular): differential loading migration should run only for projects using @angular-devkit/build-angular:browser
Differential loading migration should run only when the project is using `@angular-devkit/build-angular:browser` as it's browser builder. Otherwise we might break applications that are using different builders.

Fixes #14389
2019-05-13 15:57:26 -07:00
Alan Agius
04b854956c fix(@schematics/angular): remove old GoogleBot browserslist setting
GoogleBot is now evergreen, we don't need to specialcase it: https://webmasters.googleblog.com/2019/05/the-new-evergreen-googlebot.html?m=1

Fixes #14364
2019-05-09 10:08:52 -07:00
Alan Agius
c1e65294e7 fix(@schematics/angular): older projects are not migrated to support differential loading
Fixes #14321
2019-05-07 16:14:50 -06:00
Charles Lyding
01e242487b fix(@schematics/angular): avoid tslint overhead for lazy module migration
By using a pure schematic based implementation the overhead of running tslint can be removed.  This also has the benefit of allowing direct control over the files loaded and to modify files only within the schematic tree context.
For a hello world application, there was a ~20% performance improvement for the CLI migration from 7.0 to 8.0 as well as a ~10% reduction in memory usage.
2019-05-07 15:47:37 -06:00
clydin
537bf5e2fa fix(@schematics/angular): reduce package installs for 8.0 migrations (#14324)
This provides a ~30% performance improvement for a hello world project.
2019-05-07 12:42:46 -06:00
Charles Lyding
f189596414 test(@schematics/angular): set CLI 8.0 codelyzer migration version to ^5.0.1 2019-04-26 12:13:44 -07:00
Charles Lyding
bd14306521 fix(@schematics/angular): set CLI 8.0 codelyzer migration version to ^5.0.1 2019-04-26 10:45:56 -07:00
Charles Lyding
72dc96bb04 fix(@schematics/angular): update zone.js version during CLI 8.0 migration
Fixes #14281
2019-04-26 10:28:56 -07:00
Charles Lyding
2acded4bdd fix(@schematics/angular): normalize differing TS AST versions in lazy module migration 2019-04-26 10:27:55 -07:00
Charles Lyding
576577784c fix(@schematics/angular): remove tsquery peer dependency warning
Replaces the usage of the tsquery package with a conditional based on TypeScript helper functions.  Since a TypeScript-subset is vendored within the package, a TypeScript peer dependency cannot be met even though the functionality is present.

Fixes #14270
2019-04-25 09:27:22 -07:00
Charles Lyding
74af88bf06 fix(@schematics/angular): avoid double header/comments in es6 polyfill migration
If a polyfills file is original, then replace completely with latest version of the file.  This removes the need to deeply analyze the file as well as ensuring all comments are up to date.  Also skips analysis if there is no mention of `core-js` of any form in the file.
The header re-addition check is also reduced in scope to account for varying versions of the header content.
2019-04-24 07:15:05 -10:00
Filipe Silva
785b4b1049 fix(@schematics/angular): workaround bug in recorder/update 2019-04-23 11:42:50 -07:00
Alan Agius
0a6df3e824 fix(@schematics/angular): move and update existing src/browserslist
Older projects have their `browserslist` file under the `src` folder.

Fixes #14232
2019-04-23 10:31:18 -04:00
Emilio Martinez
5f44e642ee fix(@schematics/angular): align differential loading migration to browserslist template
Modifies differential loading migration script to align with the changes in 4d7581d to support Googlebot in browserslist by default.
2019-04-23 10:29:41 -04:00
Filipe Silva
fea7117bd2 feat(@schematics/angular): drop @angular/http from dependencies 2019-04-23 10:28:00 -04:00
Charles Lyding
c80a92ac67 fix(@schematics/angular): skip E2E projects when migrating browserslist 2019-04-22 13:29:05 -07:00
Charles Lyding
9b5653b13e fix(@schematics/angular): ensure Angular builders are migrated to latest versions
The package group format required to automatically update the builder packages was not supported until CLI 7.2.  For older CLI versions performing the update, this new migration will update the builders instead.  Once the CLI is updated to at least 7.2, the update algorithm itself will handle the update.
2019-04-22 13:29:05 -07:00
Charles Lyding
458ba75e37 fix(@schematics/angular): migrate TS module type to esnext 2019-04-22 08:16:17 -07:00
Alan
b95933a57d fix(@schematics/angular): handle polyfill migration in non root applications 2019-04-18 11:48:47 -07:00
Craig Spence
77f99b535d feat(@schematics/angular): add lazy module path fixer 2019-04-16 09:38:55 -07:00
Alan Agius
359d4f97cc feat(@schematics/angular): migrate existing ES5 projects to support differential loading
With this change, differential loading will be enabled as we add an non ever green browser and change the tsconfig script target to es2015.
2019-04-15 11:30:20 -07:00
Alan Agius
f67d976e1a fix(@schematics/angular): set version 8 migration to execute for beta versions 2019-04-08 11:40:16 -07:00
Alan Agius
19cb35473f refactor: don't drop zone.js from polyfills
We don't know yet if we are going to separate zone.js in a separate file. Hence, we should remove this for the time being and include it only when we remove zone.js from the main polyfills files
2019-04-03 16:28:37 +02:00
Minko Gechev
a355e7d693 feat(@schematics/angular): drop es6 from modern polyfills
1. Remove imports of es6 polyfills introduced by the CLI.
2. Refactor the migrations for version 8 by moving the codelyzer and
polyfill transforms into different files.

The PR drops all `core-js/es6` polyfills that we've introduced with the
CLI, except the commented ones. We do not remove commented imports,
since they are not part of the internal es6 polyfills.

The migration automatically drops the
associated comments with the removed imports since they are part of the node - under its
`jsDoc` property.
2019-03-29 18:06:01 -07:00
Minko Gechev
4b89fe21f4 feat(@schematics/angular): tslint migration for 8
Migration of the `tslint.json` and `package.json` files required by the refactoring of
codelyzer. For more information check this PR
https://github.com/mgechev/codelyzer/pull/754.
2019-03-27 12:24:21 -07:00
Alex Eagle
bf1c069f73 refactor(@schematics/angular): drop dependency on TypeScript package
instead, vendor in the two files we actually need.
This reduces our install footprint by 5MB
2019-03-06 11:27:48 -08:00
Alex Eagle
4a093e5e38 Revert "feat(@angular/cli): Add VsCode extension recommendations"
This reverts commit d9166b04fccc708bc3856a6b243a8752120f312d.
2019-02-28 10:25:28 -08:00
Alex Eagle
71428bd9cb Revert "feat(@angular/cli): Add VsCode recommendation for Angular Console"
This reverts commit 3d6ae631788b600a1b80132ae407f15ad3dc65aa.
2019-02-28 10:24:46 -08:00
Alex Eagle
242ebd932f Revert "feat(@schematics/angular): recommend plugins that John Papa recommends"
This reverts commit 3a68b8cf9696e678308da65ca59b53329981c94f.
2019-02-28 10:24:44 -08:00
Alex Eagle
3a68b8cf96 feat(@schematics/angular): recommend plugins that John Papa recommends
This list comes from https://marketplace.visualstudio.com/items?itemName=johnpapa.angular-essentials
But we don't write a .prettier.json config file so we don't include the Prettier plugin yet
2019-02-27 10:10:18 -08:00
mrmeku
3d6ae63178 feat(@angular/cli): Add VsCode recommendation for Angular Console 2019-02-26 08:45:12 -08:00
Charles Lyding
be5e2fbfe5 fix(@angular/cli): remove redundant typescript/compiler-cli compatibility check
Angular 5.0+ has a full peer dependencies setup (with 6.0+ also having a configurable runtime error check) to ensure that an appropriate version of typescript is available for compilation.  Angular CLI 8.0+ does not support Angular versions prior to these and therefore the warning is redundant.  For the case where the developer wishes to use an unsupported TypeScript version, the developer would need to adjust two similar but differently name settings in two different configuration files.
2019-02-20 10:36:52 -08:00
mrmeku
d9166b04fc feat(@angular/cli): Add VsCode extension recommendations 2019-02-14 09:32:09 -08:00
Alan Agius
d832c8791d fix(@schematics/angular): remove leading comments when removing core-js/es7/reflect (#13528)
Fixes #13491
2019-01-30 11:38:11 -08:00
Alan Agius
58ca30b1e7 fix(@schematics/angular): update @angular-devkit/build-ng-packagr when migrating
Closes #12642
2018-11-01 08:30:20 -07:00
Charles Lyding
2d4332f0ca fix(@schematics/angular): migrate build-angular for 7.0 RC users
Fixes #12647
2018-10-31 14:56:27 -07:00
Alan Agius
0b4e91bb97 feat(@schematics/angular): enable typescript helpers in workspace 2018-10-23 10:22:16 -07:00
Charles Lyding
74c799a82c fix(@schematics/angular): avoid using 6.2+ only features in migrations 2018-10-17 11:37:24 -07:00
Jason Jean
6e7f4d961f fix(@schematics/angular): fix polyfill path resolution 2018-10-16 22:25:51 -07:00
clydin
b8eee02205 fix(@schematics/angular): migrate existing packages for 7.0 (#12518)
Fixes: #12458
2018-10-10 12:10:56 -07:00
Alan Agius
2d5c6eba23 fix(@schematics/angular): codeCoverage exclude is not being migrated (#12513)
Fixes #10936
2018-10-10 12:09:57 -07:00
Hans Larsen
27715292fd feat(@schematics/angular): new 7.0.0 migration to remove polyfills
See PR https://github.com/angular/angular-cli/pull/12346 for more information. This
PR migrates current CLI projects to the new polyfills introduced in that PR.
2018-09-25 10:08:42 -07:00
Charles Lyding
57c049e507 test: update to support targets & architect fields 2018-09-13 16:43:31 -07:00
Charles Lyding
f107d2de11 fix(@schematics/angular): use 'architect' instead of 'targets' until deprecated 2018-09-13 16:43:31 -07:00
Alan Agius
432fe97d89 fix(@schematics/angular): use app root to set server paths in options 2018-09-07 13:00:37 -07:00
Alan Agius
36f8cd77ba fix(@schematics/angular): fix path for ngswConfigPath during migration
`/` will cause an error during lookup `Error: Expected to find an `ngsw-config.json` configuration file
2018-09-06 10:58:33 -07:00