101 Commits

Author SHA1 Message Date
Pete Bacon Darwin
0491717704 feat(@schematics/angular): add enableI18nLegacyMessageIdFormat default to new projects
The ViewEngine message extraction generates a variety of legacy formats
for extracted message ids. These formats have a number of issues related
to whitespace handling and reliance upon information inside the original
HTML of a template. The new message format is more resilient to things
like whitespace changes, and can be generated directly from calls to
`$localize`, which allows messages in application code to have the same
id as identical messages in templates.

As a first step in migrating projects away from the legacy id format
for i18n messages, this commit updates newly generated projects to turn
off the legacy ids.

In the future the default will be flipped and this can be removed.
Eventually the legacy message id support will be removed altogether,
probably in sync with removal of ViewEngine.
2020-10-27 15:58:09 -04:00
Alan Agius
b8bc02d14a fix(@schematics/angular): update @types/jasmine to ~3.6.0 2020-10-26 13:29:18 -04:00
Alan Agius
9768230b4d docs: update further help section in readme 2020-10-21 14:15:24 +02:00
Charles Lyding
0bdea8ddea feat(@schematics/angular): generate E2E tests with native promise support
This change adjusts the E2E schematic to generate a protractor configuration with the selenium promise manager disabled.  It also adjusts the generated test files to use native promises and async/await to control test execution.
2020-10-05 19:06:14 -04: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
Aristeidis Bampakos
a98c71dbf2 refactor(@schematics/angular): Formatting in angular.json
Apply consistent formatting in closing brackets at the end of the `angular.json` file
2020-09-06 16:08:35 +02: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
ccfd58b0c2 fix(@schematics/angular): update karma for new workspaces to 5.2.0 2020-09-01 20:22:33 +03:00
Aristeidis Bampakos
c2294182e9 refactor(@schematics/angular): change the order of node types in package.json template
Re-arrange the node types npm package so that devDependencies are sorted in  alphabetical order
2020-08-31 11:57:26 +01:00
Alan Agius
533250112a feat(@schematics/angular): add strictInputAccessModifiers option when using strict mode
Related to https://github.com/angular/angular/issues/38400
2020-08-17 21:20:32 +02:00
timdeschryver
a0e2f28d26 fix(@schematics/angular): don't create e2e script when createApplication is false
Bugfix for the ng new --createApplication=false command.
Currently, it creates an e2e script in package.json. This change will only add the script when the application is created.

Closes #13412
2020-08-14 15:08:34 +02:00
Alan Agius
3730b3cb5c build: update karma-jasmine to version ~4.0.0 2020-08-13 10:13:47 +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
Alan Agius
702c7cbf31 fix(@schematics/angular): update codelyzer to stable version 2020-07-27 20:16:21 +02:00
Alan Agius
d65235d391 feat(@schematics/angular): generate projects using jasmine-core 3.6.x 2020-07-27 20:16:21 +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
9ebca6b8d6 build: update karma-jasmine-html-reporter to 1.5.0 2020-06-01 15:02:15 -04:00
Alan Agius
617f46fb57 build: update to karma-jasmine to 3.3.0 2020-06-01 15:02:15 -04:00
Alan Agius
f9da2d8eb2 style: format tslint.json.template 2020-06-01 14:52:54 -04:00
Cyrille Tuzi
2039527201 feat(@schematics/angular): add tslint no-any and typedef rules when in strict mode 2020-06-01 14:52:54 -04: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
56bba34d75 fix(@schematics/angular): address vulnerability in protractor
potractor <7 contains a low severity vulnerability due to one of its dependencies (yargs-parser)

See: https://npmjs.com/advisories/1500

Fixes #17642
2020-05-15 14:44:45 +01:00
Alan Agius
112e11cc9b build: generate project using karma-coverage-istanbul-reporter using 3.0.2 2020-05-11 16:37:10 -04:00
Alan Agius
0fd3c550b5 feat(@schematics/angular): update compiler options target and module settings
With this change we update the target and module settings of various compilation units.

- We replace ES5 target in protractor. Protractor runs on Node.Js which support ES2018
- For applications we now use `ES2020` instead of `ESNext` as a module to avoid unexpected changes in behaviour

This changes also adds a migration to update existing projects and also removes `module` from the Universal tsconfig as per #17352 to enable lazy loading on the server.
2020-05-06 11:42:35 -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
371e44867c fix(@schematics/angular): don't add @angular/language-service in new Angular projects
This package is no longer required since the VS code extension is already shipped with it.
2020-05-05 10:50:27 -07:00
Alan Agius
e2eed2c8f8 build: update several packages 2020-05-04 10:51:49 -07:00
mgechev
460977d76e build: update to codelyzer@6.0.0-next.1 2020-04-24 09:50:14 -07:00
Alan Agius
f0e6a69250 feat(@schematics/angular): update karma to 5.0.0
Related to: https://github.com/angular/angular-cli/pull/17435
2020-04-13 11:32:38 -07:00
Wojciech Okoński
ed90080f85 style(@schematics/angular): prevent adding redundant whitespace in generated angular.json file
Previously "ng new" was generating angular.json file containing redundant whitespace after "version" property.
When file was edited some IDEs automatically removed this whitespace making additional change in diff.
If "packageManager" option is used, whitespace is still present.
2020-03-23 14:19:12 -07:00
Alan Agius
9b788b9125 build: update jasmine-spec-reporter to version 5 2020-03-23 14:17:54 -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
Alan Agius
ab7cf8be8e feat(@schematics/angular): generate new projects with tslint 6.1.0
tslint 6.1 adds support for TypeScript 3.8 syntax

See: https://github.com/palantir/tslint/blob/master/CHANGELOG.md#v610
2020-03-16 21:41:48 -07:00
mgechev
032e2be28a refactor(@schematics/angular): remove redundant typeRoots
By default TypeScript will look up in this directory (see [docs](https://www.typescriptlang.org/docs/handbook/tsconfig-json.html#types-typeroots-and-types)).
2020-03-04 12:56:29 -08:00
Jonathan Chase
3e713a9075 feat(@schematics/angular): set quote_type = single in .editorconfig 2020-02-27 11:22:03 -08:00
Alan Agius
67fd5f52ef fix(@schematics/angular): update protractor version for new projects
New projects will now be created with `~5.4.3`
2020-01-29 10:21:17 -08:00
Alan Agius
9c9d2de6bc revert: "fix(@schematics/angular): add skipLibCheck to workspace tsconfig"
This reverts commit a8c60cb8b976d50c898607a5a5bf4fe84f0b2bfb.

Closes: #16696
2020-01-29 10:20:50 -08:00
Daniele Morosinotto
3aacf41057 fix(@schematics/angular): regression tsconfig.json #16708 (#16709)
* fix(@schematics/angular): regression tsconfig.json

fix(@schematics/angular): regression tsconfig.json  …
Unverified
0e318ae
Regression in tsconfig.json set `"outDir": "./dist/out-tsc"` for problems in VSCode TS(2307) when building library referred in tsconfig "paths" 
 
Closes: #16708

* fix(@schematics/angular): regression tsconfig.json

Improve paths in root tsconfig.json for better DX experience when using auto imports in IDE's.

Closes #16709

* fix(@schematics/angular): regression tsconfig.json

Improve paths in root tsconfig.json for better DX experience when using auto imports in IDE's.
Fix code lint.

Closes #16709

* fix(@schematics/angular): regression tsconfig.json

Improve paths in root tsconfig.json for better DX experience when using auto imports in IDE's.
Fix test code to conform new behaviour.

Closes #16709
2020-01-23 17:58:38 -08:00
Alan Agius
a8c60cb8b9 fix(@schematics/angular): add skipLibCheck to workspace tsconfig
Add skipLibCheck to speed up TypeScript analysis and prevent compilation errors caused by incompatible declaration files which were generated with older/new TS versions
2020-01-16 14:48:23 -08:00
Alan Agius
63957ae127 feat(@schematics/angular): update karma and karma-jasmine 2020-01-07 10:29:23 -08:00
Alan Agius
be1bcbaead fix(@schematics/angular): improve paths and exclude options
Currently the library schematic doesn't support adding a secondary entry-point and having deep imports is not recommanded.

It's best if paths are more stricter when having a secondary entry-point instead of a wildcard.

Instead of :
```
"lib/*": [
  "dist/lib/*"
]
```

Users should configure:
```
"lib/secondary": [
  "dist/lib/secondary"
]
```

This would allow a better DX experience when using auto imports in IDE's.

Closes: #15952
2019-12-03 12:37:07 -08:00
Alan Agius
b1fba1e0c1 fix(@schematics/angular): update @types/jasmine to 3.5 to match version of jasmine-core 2019-12-02 10:17:01 -08:00
Filipe Silva
5f8e8083b2 fix(@schematics/angular): remove ngcc postinstall hook
Partially addresses #16017
2019-11-11 09:14:24 -08:00
Amadou Sall
0e3d8e4a64 feat(@schematics/angular): add packageManager option
closes #15875
2019-10-25 09:53:12 -07:00
Alan Agius
0074abfbe8 feat(@schematics/angular): update to TypeScript 3.6 2019-10-21 09:37:29 -07:00
Filipe Silva
940276f554 fix(@schematics/angular): update ngcc postinstall command 2019-10-15 19:19:05 -07:00
Filipe Silva
318396345a feat(@schematics/angular): use ngcc on postinstall (#15801)
* build: use FW 9.0.0-next.10

* feat(@schematics/angular): use ngcc on postinstall

This should improve the time first builds take.

Part of https://github.com/angular/angular/pull/32999

Blocked on an Angular release that includes https://github.com/angular/angular/pull/33049
2019-10-10 12:39:10 -07:00
Alan Agius
35edccf4b4 Update several dependencies (#15797)
* feat(@schematics/schematics): update serveral dependencies of blank projects

* feat(@schematics/angular): update serveral dependencies of new workspaces
2019-10-09 11:04:25 -07:00
mgechev
5393041747 fix(@schematics/angular): drop deprecated tslint rule
>no-use-before-declare is deprecated. Since TypeScript 2.9. Please use the built-in compiler checks instead.
2019-09-27 14:40:05 -07:00
mgechev
e2e7dee752 feat(@schematics/angular): use codelyzer@5.1.2 2019-09-27 14:39:50 -07:00