60 Commits

Author SHA1 Message Date
Alan Agius
bb38f85202 feat(@schematics/angular): use new zone.js entry-points 2021-02-17 12:44:43 -06:00
Oleksii Potiekhin
f73a878c67 fix(@schematics/angular): adjust block comment
https://github.com/Microsoft/tslint-microsoft-contrib

ERROR: 21:1 no-single-line-block-comment Replace block comment with a single-line comment
2020-12-15 12:24:53 +00:00
cexbrayat
5a0940e62d fix(@schematics/angular): document jasmine options
Currently it can be hard to find how to configure Jasmine in the Karma config.
For example, a developer might want to reproduce a randomly failing test with a specific seed.

This commit adds some information that may be helpful to beginners.
2020-11-20 11:37:19 +00:00
cexbrayat
53193eaf77 fix(@schematics/angular): remove duplicated Karma traces
Currently, Karma is reporting a failed test and the total twice in a bare CLI project:

```
12 11 2020 13:59:46.666:INFO [launcher]: Starting browser Chrome
✔ Browser application bundle generation complete.
12 11 2020 13:59:50.457:INFO [Chrome 86.0.4240.198 (Mac OS 10.15.7)]: Connected on socket F0ehOBWL6BYFqXfbAAAA with id 69358036
Chrome 86.0.4240.198 (Mac OS 10.15.7) AppComponent should render title FAILED
	Error: Expected 'ponyracer app is running!' to contain 'other'.
	    at <Jasmine>
	    at UserContext.<anonymous> (src/app/app.component.spec.ts:29:65)
	    at ZoneDelegate.invoke (node_modules/zone.js/dist/zone-evergreen.js:364:1)
	    at ProxyZoneSpec.push.QpwO.ProxyZoneSpec.onInvoke (node_modules/zone.js/dist/zone-testing.js:292:1)
Chrome 86.0.4240.198 (Mac OS 10.15.7): Executed 2 of 3 (1 FAILED) (0 secs / 0.231 secs)
Chrome 86.0.4240.198 (Mac OS 10.15.7) AppComponent should render title FAILED
	Error: Expected 'ponyracer app is running!' to contain 'other'.
	    at <Jasmine>
	    at UserContext.<anonymous> (src/app/app.component.spec.ts:29:65)
	    at ZoneDelegate.invoke (node_modules/zone.js/dist/zone-evergreen.js:364:1)
Chrome 86.0.4240.198 (Mac OS 10.15.7): Executed 3 of 3 (1 FAILED) (0.309 secs / 0.242 secs)
TOTAL: 1 FAILED, 2 SUCCESS
TOTAL: 1 FAILED, 2 SUCCESS
```

This is a bit annoying when you have several tests failing, and tend to confuse beginners.

This commit configures the Karma HTML reporter to suppress the duplicates (both error and success), which results in only one reporter showing the failed test and total:

```
12 11 2020 14:01:43.002:INFO [launcher]: Starting browser Chrome
✔ Browser application bundle generation complete.
12 11 2020 14:01:58.728:INFO [Chrome 86.0.4240.198 (Mac OS 10.15.7)]: Connected on socket Pc0xPggxJPdC8E_LAAAA with id 54797430
Chrome 86.0.4240.198 (Mac OS 10.15.7) AppComponent should render title FAILED
	Error: Expected 'ponyracer app is running!' to contain 'other'.
	    at <Jasmine>
	    at UserContext.<anonymous> (src/app/app.component.spec.ts:29:65)
	    at ZoneDelegate.invoke (node_modules/zone.js/dist/zone-evergreen.js:364:1)
	    at ProxyZoneSpec.push.QpwO.ProxyZoneSpec.onInvoke (node_modules/zone.js/dist/zone-testing.js:292:1)
Chrome 86.0.4240.198 (Mac OS 10.15.7): Executed 3 of 3 (1 FAILED) (0.331 secs / 0.252 secs)
TOTAL: 1 FAILED, 2 SUCCESS
```
2020-11-13 15:53:01 -05:00
cexbrayat
8e8a51c3fa fix(@schematics/angular): remove trailing comma in karma conf
We usually don't have trailing commas in the generated code of the CLI (and this one makes the linter/formatter angry).
2020-11-12 13:16:40 -05:00
Alan Agius
5617131e7f fix(@schematics/angular) remove reference to IE10 in comment
IE 10 is no longer supported therefore we removed it from the classlist polyfill comment.
2020-10-02 15:43:26 -04:00
Charles Lyding
e64ea69cf4 fix(@schematics/angular): remove IE9/10 from browserslist for new projects
BREAKING CHANGE:
Deprecated support for IE 9-10 has been removed in Angular 11.
Only IE 9-10 support has been removed. IE 11 is officially supported in Angular 11.
Additional information can be found here: https://v10.angular.io/guide/deprecations#ie-9-10-and-mobile
2020-09-25 22:46:04 +02:00
cexbrayat
8303681123 style(@schematics/angular): fix formatting of coverage reporters 2020-09-14 12:34:33 -04:00
Alan Agius
0d7bbd82f6 refactor(@schematics/angular): remove lcov from coverage reporters
In many users will not use lcov reports, also  this reporter generates an HTML report, which we are already generating using the html reporter.\
2020-09-11 15:17:23 -04:00
Keen Yee Liau
8995e49f0b feat(@angular-devkit/build-angular): Switch to karma-coverage
This commit switches coverage tooling from karma-coverage-istanbul-reporter
to karma-coverage since it's better supported.

Closes #17757
2020-09-06 12:22:25 +02:00
Alan Agius
8b96e52d83 fix(@schematics/angular): remove solution style tsconfig from new projects
Following the issues highlighted in https://docs.google.com/document/d/1eB6cGCG_2ircfS5GzpDC9dBgikeYYcMxghVH5sDESHw/edit?usp=sharing and discussions held with the TypeScript team. The best course of action is to rollback this feature.

In future, it is not excluded that solution style tsconfigs are re-introduced..

Closes #18040 and closes #18170
2020-08-12 19:26:12 +01:00
Simon Kurtz
68c7a96f10 refactor(@schematics/angular): pluralize Safari entry in .browserslistrc 2020-07-03 22:29:14 +02:00
Alan Agius
bb2c109e7e fix(@schematics/angular): split browserslist IE entries and provide better comments
Closes #18032
2020-06-30 15:37:05 +01:00
Alan Agius
76f525cec2 fix(@schematics/angular): add links to generated tsconfig files
We now add a link to generated tsconfig.json to make is easier for users to find relevant information.
2020-06-15 08:48:14 +02:00
Alan Agius
ade3f491fe fix(@schematics/angular): remove node typings from tsconfig.spec.json 2020-05-27 14:17:05 +02:00
Alan Agius
bede23226a feat(@schematics/angular): add solutions style tsconfig structure
In version 3.9, TypeScript introduced the concept of "Solutions Style" tsconfig to improve developer experience.

More info: https://devblogs.microsoft.com/typescript/announcing-typescript-3-9-rc/#solution-style-tsconfig

Closes #17493 and closes #8138
2020-05-20 12:12:33 -07:00
Alan Agius
a723af4271 feat(@schematics/angular): evergreen new applications
By default, we now generate new applications which support only evergreen browsers, as a result differential loading is now opt-in.

A new flag `--legacy-browsers`, was added to generate applications which support non evergreen browsers such as Internet Explorer 11.

**Note**: After an application is generated opting in and out of differential loading is still possible through the supported browsers configuration in the browserslist configuration file  defaulted to `.browserslistrc`.
2020-05-04 10:53:48 -07:00
Alan Agius
10e7eb2c24 test: change browserslist file name to .browserslistrc 2020-04-06 09:58:42 -07:00
Alan Agius
b7a612f14a feat(@schematics/angular): change browserslist file name to .browserslistrc
Closes: #15961
2020-04-06 09:58:42 -07:00
Alan Agius
2335c1f3bf fix(@schematics/angular) remove file extension from zone flags comment 2020-02-12 12:01:08 -08:00
Cyrille Tuzi
ee589d9116 fix(@schematics/angular): add compliance with no-any lint rule 2020-01-29 10:19:36 -08:00
Alan
ba8a6ea599 feat(@schematics/angular): remove enableIvy option
With this change we remove the enableIvy option as now we only support generating Ivy application. Users who want to create a VE applications should follow the opt-out guide
2019-08-16 09:31:02 -07:00
Stefanie Fluin
40601c46e7 feat(@schematics/angular): cli app redesign (#14403)
* feat(@angular/cli): cli app redesign

* add template comment code and fix rocket ship smoke image placement

* correct tests verbiage

* fix tests copy of PR 14484

* move styles to template and remove unused icons font ref

* move font references to template

* remove external font references

* remove body styles and simplify css

* add comment block and remove old comments

* fix end of placeholder comment
2019-08-12 13:54:09 -07:00
Alan Agius
0551360035 fix(@schematics/angular): exclusively list the files in tsconfigs (#15030)
* test: update tests to work with new stricter tsconfig file inclusions

* fix(@schematics/angular): exclusively list the files in tsconfigs

With the omission of `includes` or `files` in tsconfig files tsc will pick up all the files under the rootDir and make them as part of the compilation. In certain cases, redundant files will be picked up which will cause a slower compilations.

Related to: TOOL-949
2019-07-16 11:04:29 -07:00
Cédric Exbrayat
9d4d5742bb feat(@schematics/angular): enable ivy in tests (#15044)
If a project is generated with `enableIvy`, this commit adds the necessary configuration to `tsconfig.spec.json` to then run the tests with Ivy. Note that the CLI already does the correct work (runs `ngcc` and then runs the tests).
2019-07-15 09:50:16 -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
Minko Gechev
4d7581d60b feat(@schematics/angular): enable support for Chrome 41
We want apps to be SEO friendly by default.
2019-04-19 10:49:03 -07:00
cexbrayat
0ce98ceeb3 docs(@schematics/angular): mention npx browserslist in browserslist
Running `npx browserslist` allows to see what browsers are actually selected with the configuration,
which is very handy and not very known.
2019-04-17 15:47:39 -07:00
Alan Agius
413a35bd56 feat(@schematics/angular): add more information and browsers in browserlist 2019-04-15 11:30:34 -07:00
JiaLiPassion
888bb27815 refactor: rename Zone 'BLACK_LISTED_EVENTS' to 'UNPATCHED_EVENTS' 2019-04-01 00:48:24 -07:00
Alan
a7d095d916 feat(@schematics/angular): change layout for root applications
This change aligns the file layout of applications generated with `ng new` and `ng generate`

Ref: TOOL-686
2019-03-06 11:28:26 -08:00
Alan
08c4cb748f fix(@schematics/angular): reintroduce .sass as a supported file extention
Sass Indented (.sass) is fully supported by the Sass team and we should still offer and support it.

Fixes #13739
2019-03-04 10:26:09 -08:00
Alan Agius
9e18cf240e fix(@schematics/angular): kebab case prefix causes lint errors in new directives
`Component` selectors are always kekabed while `Directive` selectors are always camelized. This updates the lint rules to convert the prefix to the appropiate case

Fixes #13796
2019-03-04 09:35:22 -08:00
Alan
026ae8cefc feat(@schematics/angular): change layout of e2e files
With this change E2E files will be relocated inside an existing application instead of creating a seperate E2E project. This will also remove a lot of extra boilerplating inside the workspace configuration file.

File layout:
```
│   browserslist
│   karma.conf.js
│   tsconfig.app.json
│   tsconfig.spec.json
│   tslint.json
│
├───e2e
│   │   protractor.conf.js
│   │   tsconfig.e2e.json
│   │
│   └───src
│           app.e2e-spec.ts
│           app.po.ts
│
└───src
    │   favicon.ico
    │   index.html
    │   main.po.ts
    │   main.ts
    │   polyfills.ts
    │   styles.css
    │   test.ts
    │
    ├───app
    │       app.component.css
    │       app.component.html
    │       app.component.spec.ts
    │       app.component.ts
    │       app.module.ts
    │
    ├───assets
    │       .gitkeep
    │
    └───environments
            environment.prod.ts
            environment.ts
```

Ref: TOOL-699
2019-03-04 09:33:12 -08:00
Filipe Silva
05966646e7 feat(@schematics/angular): rename experimentalIvy to enableIvy
Followup to https://github.com/angular/angular/pull/28569#discussion_r259558085
2019-02-26 10:49:58 -08:00
Filipe Silva
becd2f53d5 fix(@schematics/angular): use enableIvy as true
Blocked on https://github.com/angular/angular/pull/28616
2019-02-22 15:52:58 -08:00
Alan Agius
89797900db fix(@schematics/angular): fixes issue that ViewEncapsulation is not being configured when provided
Fixes #13689
2019-02-19 13:57:05 -08:00
Luis Confraria
1f9c84f98c fix(@schematics/angular): set restartOnFileChange to true in karma.conf templates
Fix #13542
2019-02-08 16:12:19 -08:00
Alan
4718de4dae feat(@schematics/angular): only support known style extentions
Fixes #13149
2019-01-18 11:56:19 -08:00
Alan Agius
36eba0c9fc refactor: use .template suffix for all schematic files
Currently when using `ivy-ngcc` it will print out a warning

```
Failed to read entry point info from //node_modules/@schematics/angular/workspace/files/package.json with error SyntaxError: Unexpected token < in JSON at position 1121.
```

Fixes #13378
2019-01-16 10:29:56 -08:00
Charles Lyding
cdb99bc324 fix(@schematics/angular): remove redundant ES2015 polyfills 2019-01-15 14:17:55 -08:00
Amadou Sall
f01c156d00 fix(@schematics/angular): apps code coverage should resides in their own folder 2019-01-14 10:57:51 -08:00
Alan Agius
f94576b232 feat(@schematics/angular): experimentalIvy should generates backwards compatible solution
Usage:
```
ng new foo --experimentalIvy
```

Users will need to use `ngcc` so to process code coming from NPM and produce the equivalent Ivy version. This needs to be done once after installing the node packages.

```
node_modules/.bin/ivy-ngcc
```

`ngtsc` compilter will then be used when building using the `--aot` or `--prod` flag.

Fixes #13024
2019-01-11 14:04:01 -08:00
cexbrayat
32c96d6158 style(@schematics/angular): format jsdoc in polyfills.ts
This line makes the `jsdoc-format` tslint rule fails if activated as it is not a correct JSDoc formating.
2018-12-18 09:12:59 -08:00
mhartington
601134d2a6 docs(@schematics/angular): add note about older chrome in polyfills
Add note about polyfills being required in older chrome environments.
Addresses confusion seen in Ionic projects that are loaded in an Android
5 emulator, but has chrome 37.
2018-12-13 14:11:28 -08:00
JiaLiPassion
c83be5e555 fix(@schematics/angular): import zone related flags in other files
fix #12886
2018-12-11 11:56:58 -08:00
Alan Agius
4cca3a10e8 feat(@schematics/angular): add text-summary to code coverage reporters
Fixes #3602
2018-10-23 10:16:44 -07:00
Charles Lyding
64d1524649 refactor(@schematics/angular): cleanup application polyfill comments 2018-10-03 17:38:51 -07:00
Alan Agius
8d81c4f5c6 style(@schematics/angular): remove extra whitespace in EOF
Closes #12426
2018-10-03 17:34:53 -07:00
Masahiko Sakakibara
4d46c4ac49 fix(@schematics/angular): support Fetch as Google(Google bot) (#11815) 2018-09-27 13:39:34 -04:00