44 Commits

Author SHA1 Message Date
Alan Agius
0bc15970ad refactor(@schematics/angular): use jsonc-parser instead of devkit parser 2020-11-05 08:31:02 +01:00
Charles Lyding
af1d49d18a fix(@schematics/angular): allow inlineTemplate/inlineStyle with minimal application
This change allows `inlineTemplate=false` and/or `inlineStyle=false` to be used with the `minimal` option when creating an application either by `ng new` or `ng generate application`.

Closes #17528
2020-10-17 15:59:52 +02:00
Alan Agius
ae73e44b2a feat(@schematics/angular): don't generate special package.json and no-any when using --strict
Following feedback from the community, which showed a high number of users found it hard to work with the `no-any` lint rule and also the `sideEffects` package.json file. With DevRel we decided to remove both features when generating a strict workspace and/or application.
2020-09-30 20:56:04 +02: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
Jefiozie
432fcb0d9b fix(@angular/cli): replace regex with correct project name validation
Closes #17579
2020-09-24 00:04:58 +03: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
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
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
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
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
93e253bc93 refactor: rename tsconfig.json to tsconfig.base.json 2020-05-20 12:12:33 -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
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
Christoph Guttandin
cd4822393b fix(@schematics/angular): set inlineTemplate and inlineStyle for minimal projects 2020-02-18 12:47:09 -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
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
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
Alan Agius
fce849c7d6 fix(@schematics/angular): remove lint target from minimal projects
Minimal projects are considered as throw-away projects and only a small subset of features are supported.

More context #13408 and #13354

Closes #14727
2019-06-11 09:56:42 -07:00
Filipe Silva
24f37a602c feat(@schematics/angular): default Ivy apps to AOT true
Testing on AIO with Angular master as of 28/05/2019 I got these results:
JIT ~414ms (369, 378, 408, 323, 593)
AOT using VE ~1383ms (1365, 1185, 1767, 1135, 1467)
AOT using Ivy ~517ms (600, 391, 444, 756, 394)

This is largely due to https://github.com/angular/angular/pull/29380 and https://github.com/angular/angular/pull/30238.

The second PR above was not merged to master, and thus will not be in 8.0.0. This PR should be merged to match it.
2019-06-06 14:03:00 -07:00
Alan Agius
a464c001c3 fix(@schematics/angular): fix paths when newProjectRoot is an empty string
When `newProjectRoot` the paths are prefixed with an `/` example `/project-name/tsconfig.lib.json` which results in these being marked as absolute paths, which causes build failures.

Fixes #14108
2019-04-22 16:17:39 -07:00
Charles Lyding
58f6282edf refactor(@schematics/angular): update application to use new workspace rules 2019-04-16 11:23:48 -07:00
Alan
3f6c1b5cd6 fix(@schematics/angular): minimal should not add test target
At the moment when using minimal flag, test targets are being created even though they cannot be used as test setup files are not created nor are testing dependencies
2019-04-04 09:28:19 -07:00
Alan Agius
f84abfc572 feat(@schematics/angular): remove ivy-ngcc postinstall script from new application 2019-04-01 02:54:41 -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
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
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
Alan Agius
86356a747d fix(@schematics/angular): set cortrect file extention in config when using preprocessors (#13552)
Fixes #13550
2019-02-05 21:13:03 -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
Alan Agius
a12a4e02a4 feat(@schematics/angular): consistent naming of options and arguments that do the same thing
This aligns options that do the same thing:
1) `skipSpecs` and `spec` has been deprecated in favor of `skipTests`.
2) `styleext` has been deprecated in favor of `style` since the latest is two words.

Fixes #12784
2018-12-11 11:55:54 -08:00
Alan Agius
e18b912aa7 test: use toContain instead of indexOf 2018-11-14 12:34:49 -08:00
Alan Agius
d3d433624b fix(@schematics/angular): minimal should be honored in workspace creation 2018-11-06 22:47:39 -08:00
Noël Macé
1f3e2768c2 fix(@schematics/angular): --minimal should prevent generating e2e (#12742)
* fix(@schematics/angular): --minimal should prevent generating e2e

Don't run the e2e schematic when using application or ng-new schematics
with option.minimal set to true.

fix #12739

* style: inverse logic according to feedback

* test(@schematics/angular): app and ng-new --minimal shouldn't generate e2e
2018-11-01 10:59:13 -07:00
Charles Lyding
57c049e507 test: update to support targets & architect fields 2018-09-13 16:43:31 -07:00
Filipe Silva
9720077a4b build: make resolution logic compatible with Bazel 2018-08-22 16:36:10 -07:00
Filipe Silva
307160806c feat(@schematics/angular): use targets property on new projects 2018-07-25 20:17:33 +01:00
Hans Larsen
483cbe2665 refactor: add tslint-sonarts and a lot of tslint rules
This should clean up the code a bit.

Note: at first I added the no-useless-cast rule, but after getting frustrated
with it (as it has many false positive), I decided to remove the rule but some
useless casts were removed so I let those in the PR.
2018-07-10 15:07:36 -07:00
Hans Larsen
44086c60ff build: move devkit repo back to angular-cli 2018-06-05 18:50:06 -07:00