136 Commits

Author SHA1 Message Date
Alan Agius
dd260185a1 refactor(@angular-devkit/build-angular): deprecate extractCss browser builder option
BREAKING CHANGE:

Browser builder `extractCss` option default value has been changed from `false` to `true`. This is to reflect the default behaviour when this deprecated option is removed.
2020-08-31 11:54:23 +01: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
Alan Agius
05588fcee1 refactor: clean up unused code and imports 2020-07-24 08:01:52 +02:00
Amit Bublil
f4f5e0bf8c fix(@schematics/angular): remove reference to tsconfig.spec.json in tsconfig.json when minimal=true 2020-07-20 11:49:25 +01:00
Charles Lyding
f463c84035 fix(@schematics/angular): remove async test helper function from component schematic 2020-07-15 12:36:48 -04:00
cexbrayat
ef3bee6e7d fix(@schematics/angular): keep tslint rules ordered
The schematics recently siwtcher to `jsonc-parser` as the JSOn parser, and that introduced a small regression in the tslint.json file where the rules order is not the same as previously.

See https://github.com/cexbrayat/angular-cli-diff/compare/10.0.2...10.1.0-next.0

This commit should fix the issue by providing the insertion index when merging the tslint files.
A test has also been added to avoid further regressions.
2020-07-13 15:54:08 -04:00
Alan Agius
cc87202710 fix(@schematics/angular): don't add e2e tsconfig reference in solution tsconfig
Since the tsconfig for e2e’s is named tsconfig.json there is no reason why it should be included in the solutions typescript configuration file.

Closes #18190
2020-07-13 12:17:24 -04:00
Alan Agius
d1623c6b0c refactor(@schematics/angular): refactor some schematics to use the new JSON parser 2020-07-07 08:45:17 +02: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
1559ad6ffb fix(@schematics/angular): only generate package.json under app in strict applications 2020-06-16 21:08:25 +02:00
Alan Agius
5b5a37ad54 fix(@schematics/angular): add links to generated app package.json files
We now add a link to generated app package.json to make is easier for users to find relevant information.
2020-06-15 08:48:14 +02: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
3efda814f7 fix(@schematics/angular): add strict setting to angular.json
With this change we add the `strict` setting to the schematics settings in the angular.json, so that when creating a strict application and/or workspace all future applications will be strict by default
2020-06-10 19:47:11 +01: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
93e253bc93 refactor: rename tsconfig.json to tsconfig.base.json 2020-05-20 12:12:33 -07:00
Alan Agius
a7cf22cabd feat(@schematics/angular): add stricter bundle budgets when using the --strict option
When using the strict option `anyComponentStyle` and `initial` budgets are more strict.
2020-05-05 11:44:19 -07:00
Alan Agius
cbf0feb005 feat(@schematics/angular): enable stricter type checking and optimization effective coding rules
With this change we enable stricter type checking and optimization effective coding rules when using the `--strict` option.

Changes in schematics
- `ng-new`: A prompt for the `--strict` option was added. This option is a proxy and will be passed to the application and workspace schematics.
- `application`: A `package.json` was added in the `app` folder, to tell the bundlers whether the application is free from side-effect code. When `strict` is `true`. the `sideEffects` will be set `false`.
- `workspace` When `strict` is true, we add stricter TypeScript and Angular type-checking options.

Note: AIO is already using these strict TypeScript compiler settings. PR to enable `strictTemplates`  https://github.com/angular/angular/pull/36391

Reference: TOOL-1366
2020-05-05 11:44:19 -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
e851d4f930 fix(@schematics/angular): invalid rgba color in app.component.html
Closes #17411
2020-04-07 19:43:13 -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
df4382f082 feat(@schematics/angular): update default tslint.json rules
In tslint version 6, several recommanded rules have been removed in the following PRs:
https://github.com/palantir/tslint/pull/4871 https://github.com/palantir/tslint/pull/4312

With this change, we bring back these rules in the CLI.
2020-03-16 21:41:48 -07:00
Sachin Grover
8543bf7f8c fix(@schematics/angular): scroll issue on new app after adding Material
Fixes #16966
2020-02-18 12:49:59 -08:00
Christoph Guttandin
cd4822393b fix(@schematics/angular): set inlineTemplate and inlineStyle for minimal projects 2020-02-18 12:47:09 -08: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
cexbrayat
3ec4f61357 fix(@schematics/angular): remove unneeded debugElement in test
The generate tests in `app.component.spec.ts` are using `fixture.debugElement.componentInstance` whereas we can directly use `fixture.componentInstance`. This fixes the generated test to show a better example to users discovering unit tests.
2019-10-21 09:38:16 -07:00
Muhammad Umair Khan
bcbbc19293 fix(@schematics/angular): scroll issue on new app (#15714)
Subtracting the top space from image vh(viewport height) to remove scroll

Closes #15596
2019-10-07 09:15:08 -07:00
FG-33
9de282ca32 feat(@schematics/angular): add generator for interceptor
Rework.
2019-09-26 09:58:00 -07:00
Elvis Begovic
b2e74d119c feat(@schematics/angular): minimal=true should not create tests files when using ng generate command
Before this commit:
`--minimal=true` create project without any testing frameworks and disable e2e, lint, test targets.
But, if in this minimal project we try command `ng generate class|component|directive|guard|module|pipe|service`, it will always create `*_spec.ts` files.

After this commit:
`--minimal=true` override `@schematics/angular` in `angular.json` to not create `*_spec.ts` files when using `ng generate *` commands.
2019-09-09 14:10:50 -07:00
Christian Liebel
8527206d6e feat(@schematics/angular): feature PWA in CLI app
Feature PWA support via `@angular/pwa` directly in the new CLI app.
2019-09-04 02:30:15 +05:30
Alan Agius
8866f1d964 refactor(@schematics/angular): remove redundant aot option for production 2019-08-30 00:08:52 +05:30
Alan Agius
a35d9084ce refactor(@schematics/angular): remove classes from twitter icon as it breaks Ivy in IE11
https://github.com/angular/angular/issues/32192
2019-08-28 22:54:52 +05:30
vikerman
860d5925e6 fix(@schematics/angular): open twitter link in new tab (#15446)
Change the default application to open the twitter link in a new tab
instead of in the current tab. This is consistent with all the other
external links in the page.
2019-08-26 11:49:35 -07:00
Stefanie Fluin
a05148e9f5 fix(@schematics/angular): add twitter link icon (#15385)
* fix(@schematics/angular): add twitter link icon

* fix(@schematics/angular): remove height unit
2019-08-21 10:34:00 -07: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
Minko Gechev
26f66fe366
fix(@schematics/angular): handle the inlineTemplate case for ng new (#15324)
Update the template of `app.component.ts` when using `--inlineTemplate`.
2019-08-14 10:22:09 -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
Charles Lyding
5a7b823b28 test: remove use of deprecated synchronous test helper runSchematic 2019-08-08 08:27:31 -07:00
Alan Agius
d7b9650b5f refactor(@schematics/angular): remove hardcoded default values
Defaults in code are no longer required as the root issue was solved by https://github.com/angular/angular-cli/pull/15222
2019-08-08 08:25:50 -07:00
Amadou Sall
c4a3262ee2 fix(@schematics/angular): the ng-new schematic should not prompt for style
closes #13383
2019-08-02 13:34:26 -07:00
Amadou Sall
a9ac221c40 fix(@schematics/angular): application schematic should prompt for --routing and --style
This is the first step towards solving issue related to #13383

closes #14705
2019-07-29 10:44:48 -07:00
vikerman
07780b9272 style: clean up existing lint errors 2019-07-24 23:28:49 -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
2a0dc39de3 feat(@schematics/angular): add anyComponentStyle to the applications bundle budget 2019-07-24 19:05:00 -07:00
Amadou Sall
d25879f9fc fix(@schematics/angular): the required 'alt' attribute is missing in the root component's template
When you generate an application with `--minimal` flag, the image in the
HTML template of the root component doesn't have the 'alt' attribute
2019-07-24 19:02:47 -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