23 Commits

Author SHA1 Message Date
Alan Agius
81129e12d0 feat(@schematics/angular): update several TypeScript compilation target (Syntax)
With this change we update the TypeScript target of server compilation unit for new projects.

- E2E target has been update from `es2018` to `es2019`
- Browser target has been update from `es2015` to `es2017`
- Server target has been update from `es2016` to `es2019`
2021-03-15 20:31:25 +01:00
tim_frijters
b07fc6fafd fix(@schematics/angular): Alphabetized named imports 2020-12-01 10:05:02 +01: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
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
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
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
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
9b788b9125 build: update jasmine-spec-reporter to version 5 2020-03-23 14:17:54 -07:00
Cyrille Tuzi
ee589d9116 fix(@schematics/angular): add compliance with no-any lint rule 2020-01-29 10:19:36 -08:00
Cyrille Tuzi
76d2656fe5 fix(@schematics/angular): add compliance with call-signature lint rule 2020-01-27 11:28:59 -08:00
Alan Agius
5d9b20b49c refactor(@schematics/angular): remove redundant quotes from protractor options 2019-10-14 13:41:58 -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
Will
63d64472b5 feat(@schematics/angular): add type checking for protractor.conf.js file
Fixes #13958
2019-03-22 07:14:14 -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 Agius
edfc155f35 feat(@schematics/angular): rename tsconfig.e2e.json to tsconfig.json
This will help IDEs as they only pick up the standard name
2019-03-04 09:33:12 -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
cexbrayat
2848964707 fix(@schematics/angular): e2e test fails strict TS config
If using `strictFunctionTypes: true` in `tsconfig.json`, the default e2e test is failing compilation with:

```
error TS2345: Argument of type 'ObjectContaining<{ level: Level; }>' is not assignable to parameter of type 'Expected<Entry>'.
  Type 'ObjectContaining<{ level: Level; }>' is not assignable to type 'ObjectContaining<Entry>'.
    Type 'Partial<{ level: Level; }>' is not assignable to type 'Partial<Entry>'.
     Type '{ level: Level; }' is not assignable to type 'Entry'.
```

Explictely using `as logging.Entry` fixes the issue.
2019-02-08 16:07:50 -08:00
Logan Mzz
8a6e497687 fix(@schematics/angular): use baseUrl for default e2e test
replace usage of `'/'` for default end-to-end test by `browser.baseUrl`
to take into account any accesspath and rely on provided setting.
2019-01-30 11:39:44 -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
Keen Yee Liau
63748ab6fc fix(@schematics/angular): Add types to AppPage in e2e
When app.po.ts is compiled under Bazel with Typescript 3.2,
AppPage produces the following error:

e2e/src/app.po.ts:4:3 - error TS2742: The inferred type of 'navigateTo' cannot be named without a reference to '../../external/npm/node_modules/@types/selenium-webdriver/index'. This is likely not portable. A type annotation is necessary.

4   navigateTo() {
    ~~~~~~~~~~
e2e/src/app.po.ts:8:3 - error TS2742: The inferred type of 'getTitleText' cannot be named without a reference to '../../external/npm/node_modules/@types/selenium-webdriver/index'. This is likely not portable. A type annotation is necessary.

8   getTitleText() {
    ~~~~~~~~~~~~
2019-01-11 15:35:07 -08:00
Keen Yee Liau
1e97eb124f fix(@schematics/angular): assert no error logs in e2e
This commit adds an assertion to the e2e test to make sure there are
no error logs emitted by the browser.
2018-12-20 11:34:05 -08:00
Emmanuel Demey
62511a5209 fix(@schematics/angular): rename e2e PO utility function 2018-11-14 12:33:27 -08:00
Hans Larsen
44086c60ff build: move devkit repo back to angular-cli 2018-06-05 18:50:06 -07:00