build(docs-infra): update docs examples to Angular v11.0.1 (#39818)

This commit updates the docs examples to Angular v11.0.1. In addition to
updating the dependencies versions, it also updates the project's
structure and config to more closely match what a new v11 CLI app would
look like. See, also, the [diff][1] between a basic v10.1.3 CLI app and a
v11.0.2 one.

NOTE:
I refrained from disabling the Selenium Promise Manager (as seen
[here][2]) and switching all e2e tests to `async/await`, because that is
a big change and should be done in a separate commit/PR.

[1]: https://github.com/cexbrayat/angular-cli-diff/compare/10.1.3..11.0.2
[2]:
https://github.com/cexbrayat/angular-cli-diff/compare/10.1.3...11.0.2#diff-dbd675d74087d57cd084d6dd6ae24ae2eeff2ff0122680e12916052f8a843a29

PR Close #39818
This commit is contained in:
George Kalpakas 2020-11-23 20:16:57 +02:00 committed by Andrew Kushnir
parent 8758006acc
commit 3d2c2c40d8
25 changed files with 1416 additions and 1396 deletions

View File

@ -1,14 +1,14 @@
import { TestBed, async } from '@angular/core/testing';
import { TestBed } from '@angular/core/testing';
import { AppComponent } from './app.component';
describe('AppComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [
AppComponent
],
}).compileComponents();
}));
});
it('should create the app', () => {
const fixture = TestBed.createComponent(AppComponent);

View File

@ -1,4 +1,4 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { ComponentOverviewComponent } from './component-overview.component';
@ -6,14 +6,12 @@ describe('ComponentOverviewComponent', () => {
let component: ComponentOverviewComponent;
let fixture: ComponentFixture<ComponentOverviewComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ ComponentOverviewComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(ComponentOverviewComponent);
component = fixture.componentInstance;
fixture.detectChanges();

View File

@ -144,7 +144,7 @@ describe('demo (with TestBed):', () => {
);
});
describe('using async(inject) within beforeEach', () => {
describe('using waitForAsync(inject) within beforeEach', () => {
let serviceValue: string;
beforeEach(() => {

View File

@ -43,8 +43,6 @@
]
}
],
// TODO(gkalpak): Fix the code and enable this.
// "no-any": true,
"no-console": [
true,
"debug",

View File

@ -30,8 +30,8 @@ Any necessary changes to boilerplate files will be done automatically through mi
yarn install
# Migrate project to new versions.
yarn ng update @angular/cli --migrate-only --from=<previous-cli-version>
yarn ng update @angular/core --migrate-only --from=<previous-core-version>
yarn ng update @angular/cli --allow-dirty --migrate-only --from=<previous-cli-version>
yarn ng update @angular/core --allow-dirty --migrate-only --from=<previous-core-version>
```
> NOTE:

View File

@ -13,14 +13,14 @@
},
"private": true,
"dependencies": {
"@angular/animations": "~10.1.3",
"@angular/common": "~10.1.3",
"@angular/compiler": "~10.1.3",
"@angular/core": "~10.1.3",
"@angular/forms": "~10.1.3",
"@angular/platform-browser": "~10.1.3",
"@angular/platform-browser-dynamic": "~10.1.3",
"@angular/router": "~10.1.3",
"@angular/animations": "~11.0.1",
"@angular/common": "~11.0.1",
"@angular/compiler": "~11.0.1",
"@angular/core": "~11.0.1",
"@angular/forms": "~11.0.1",
"@angular/platform-browser": "~11.0.1",
"@angular/platform-browser-dynamic": "~11.0.1",
"@angular/router": "~11.0.1",
"angular": "1.8.0",
"angular-in-memory-web-api": "~0.11.0",
"angular-route": "1.8.0",
@ -29,21 +29,21 @@
"zone.js": "~0.10.3"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.1001.3",
"@angular/cli": "~10.1.3",
"@angular/compiler-cli": "~10.1.3",
"@angular-devkit/build-angular": "~0.1100.2",
"@angular/cli": "~11.0.2",
"@angular/compiler-cli": "~11.0.1",
"@types/angular": "1.7.3",
"@types/angular-route": "1.7.1",
"@types/jasmine": "~3.5.0",
"@types/jasmine": "~3.6.0",
"@types/jasminewd2": "~2.0.3",
"@types/node": "^12.11.1",
"codelyzer": "^6.0.0",
"jasmine-core": "~3.6.0",
"jasmine-marbles": "~0.6.0",
"jasmine-spec-reporter": "~5.0.0",
"karma": "~5.0.0",
"karma": "~5.1.0",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage-istanbul-reporter": "~3.0.2",
"karma-coverage": "~2.0.3",
"karma-jasmine": "~4.0.0",
"karma-jasmine-html-reporter": "^1.5.0",
"protractor": "~7.0.0",

View File

@ -43,7 +43,6 @@
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"extractLicenses": true,
"vendorChunk": false,

View File

@ -1,11 +1,11 @@
import { browser, by, element } from 'protractor';
export class AppPage {
navigateTo(): Promise<unknown> {
return browser.get(browser.baseUrl) as Promise<unknown>;
async navigateTo(): Promise<unknown> {
return browser.get(browser.baseUrl);
}
getTitleText(): Promise<string> {
return element(by.css('app-root h1')).getText() as Promise<string>;
async getTitleText(): Promise<string> {
return element(by.css('app-root h1')).getText();
}
}

View File

@ -9,16 +9,22 @@ module.exports = function (config) {
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-coverage-istanbul-reporter'),
require('karma-coverage'),
require('@angular-devkit/build-angular/plugins/karma')
],
client: {
clearContext: false // leave Jasmine Spec Runner output visible in browser
},
coverageIstanbulReporter: {
jasmineHtmlReporter: {
suppressAll: true // removes the duplicated traces
},
coverageReporter: {
dir: require('path').join(__dirname, './coverage/angular.io-example'),
reports: ['html', 'lcovonly', 'text-summary'],
fixWebpackSourcePaths: true
subdir: '.',
reporters: [
{ type: 'html' },
{ type: 'text-summary' }
]
},
reporters: ['progress', 'kjhtml'],
port: 9876,

View File

@ -13,33 +13,33 @@
},
"private": true,
"dependencies": {
"@angular/animations": "~10.1.3",
"@angular/common": "~10.1.3",
"@angular/compiler": "~10.1.3",
"@angular/core": "~10.1.3",
"@angular/forms": "~10.1.3",
"@angular/platform-browser": "~10.1.3",
"@angular/platform-browser-dynamic": "~10.1.3",
"@angular/router": "~10.1.3",
"@angular/animations": "~11.0.1",
"@angular/common": "~11.0.1",
"@angular/compiler": "~11.0.1",
"@angular/core": "~11.0.1",
"@angular/forms": "~11.0.1",
"@angular/platform-browser": "~11.0.1",
"@angular/platform-browser-dynamic": "~11.0.1",
"@angular/router": "~11.0.1",
"angular-in-memory-web-api": "~0.11.0",
"rxjs": "~6.6.0",
"tslib": "^2.0.0",
"zone.js": "~0.10.3"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.1001.3",
"@angular/cli": "~10.1.3",
"@angular/compiler-cli": "~10.1.3",
"@types/jasmine": "~3.5.0",
"@angular-devkit/build-angular": "~0.1100.2",
"@angular/cli": "~11.0.2",
"@angular/compiler-cli": "~11.0.1",
"@types/jasmine": "~3.6.0",
"@types/jasminewd2": "~2.0.3",
"@types/node": "^12.11.1",
"codelyzer": "^6.0.0",
"jasmine-core": "~3.6.0",
"jasmine-marbles": "~0.6.0",
"jasmine-spec-reporter": "~5.0.0",
"karma": "~5.0.0",
"karma": "~5.1.0",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage-istanbul-reporter": "~3.0.2",
"karma-coverage": "~2.0.3",
"karma-jasmine": "~4.0.0",
"karma-jasmine-html-reporter": "^1.5.0",
"protractor": "~7.0.0",

View File

@ -1,9 +0,0 @@
{
"name": "angular.io-example",
"private": true,
"description_1": "This is a special package.json file that is not used by package managers.",
"description_2": "It is used to tell the tools and bundlers whether the code under this directory is free of code with non-local side-effect. Any code that does have non-local side-effects can't be well optimized (tree-shaken) and will result in unnecessary increased payload size.",
"description_3": "It should be safe to set this option to 'false' for new applications, but existing code bases could be broken when built with the production config if the application code does contain non-local side-effects that the application depends on.",
"description_4": "To learn more about this file see: https://angular.io/config/app-package-json.",
"sideEffects": false
}

View File

@ -43,8 +43,6 @@
]
}
],
// TODO(gkalpak): Fix the code and enable this.
// "no-any": true,
"no-console": [
true,
"debug",

View File

@ -13,15 +13,15 @@
},
"private": true,
"dependencies": {
"@angular/animations": "~10.1.3",
"@angular/common": "~10.1.3",
"@angular/compiler": "~10.1.3",
"@angular/core": "~10.1.3",
"@angular/elements": "~10.1.3",
"@angular/forms": "~10.1.3",
"@angular/platform-browser": "~10.1.3",
"@angular/platform-browser-dynamic": "~10.1.3",
"@angular/router": "~10.1.3",
"@angular/animations": "~11.0.1",
"@angular/common": "~11.0.1",
"@angular/compiler": "~11.0.1",
"@angular/core": "~11.0.1",
"@angular/elements": "~11.0.1",
"@angular/forms": "~11.0.1",
"@angular/platform-browser": "~11.0.1",
"@angular/platform-browser-dynamic": "~11.0.1",
"@angular/router": "~11.0.1",
"@webcomponents/custom-elements": "^1.4.2",
"angular-in-memory-web-api": "~0.11.0",
"rxjs": "~6.6.0",
@ -29,19 +29,19 @@
"zone.js": "~0.10.3"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.1001.3",
"@angular/cli": "~10.1.3",
"@angular/compiler-cli": "~10.1.3",
"@types/jasmine": "~3.5.0",
"@angular-devkit/build-angular": "~0.1100.2",
"@angular/cli": "~11.0.2",
"@angular/compiler-cli": "~11.0.1",
"@types/jasmine": "~3.6.0",
"@types/jasminewd2": "~2.0.3",
"@types/node": "^12.11.1",
"codelyzer": "^6.0.0",
"jasmine-core": "~3.6.0",
"jasmine-marbles": "~0.6.0",
"jasmine-spec-reporter": "~5.0.0",
"karma": "~5.0.0",
"karma": "~5.1.0",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage-istanbul-reporter": "~3.0.2",
"karma-coverage": "~2.0.3",
"karma-jasmine": "~4.0.0",
"karma-jasmine-html-reporter": "^1.5.0",
"protractor": "~7.0.0",

View File

@ -50,7 +50,6 @@
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"extractLicenses": true,
"vendorChunk": false,

View File

@ -16,34 +16,34 @@
},
"private": true,
"dependencies": {
"@angular/animations": "~10.1.3",
"@angular/common": "~10.1.3",
"@angular/compiler": "~10.1.3",
"@angular/core": "~10.1.3",
"@angular/forms": "~10.1.3",
"@angular/localize": "~10.1.3",
"@angular/platform-browser": "~10.1.3",
"@angular/platform-browser-dynamic": "~10.1.3",
"@angular/router": "~10.1.3",
"@angular/animations": "~11.0.1",
"@angular/common": "~11.0.1",
"@angular/compiler": "~11.0.1",
"@angular/core": "~11.0.1",
"@angular/forms": "~11.0.1",
"@angular/localize": "~11.0.1",
"@angular/platform-browser": "~11.0.1",
"@angular/platform-browser-dynamic": "~11.0.1",
"@angular/router": "~11.0.1",
"angular-in-memory-web-api": "~0.11.0",
"rxjs": "~6.6.0",
"tslib": "^2.0.0",
"zone.js": "~0.10.3"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.1001.3",
"@angular/cli": "~10.1.3",
"@angular/compiler-cli": "~10.1.3",
"@types/jasmine": "~3.5.0",
"@angular-devkit/build-angular": "~0.1100.2",
"@angular/cli": "~11.0.2",
"@angular/compiler-cli": "~11.0.1",
"@types/jasmine": "~3.6.0",
"@types/jasminewd2": "~2.0.3",
"@types/node": "^12.11.1",
"codelyzer": "^6.0.0",
"jasmine-core": "~3.6.0",
"jasmine-marbles": "~0.6.0",
"jasmine-spec-reporter": "~5.0.0",
"karma": "~5.0.0",
"karma": "~5.1.0",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage-istanbul-reporter": "~3.0.2",
"karma-coverage": "~2.0.3",
"karma-jasmine": "~4.0.0",
"karma-jasmine-html-reporter": "^1.5.0",
"protractor": "~7.0.0",

View File

@ -43,7 +43,6 @@
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"extractLicenses": true,
"vendorChunk": false,

View File

@ -43,7 +43,6 @@
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"extractLicenses": true,
"vendorChunk": false,

View File

@ -13,34 +13,34 @@
},
"private": true,
"dependencies": {
"@angular/animations": "~10.1.3",
"@angular/common": "~10.1.3",
"@angular/compiler": "~10.1.3",
"@angular/core": "~10.1.3",
"@angular/forms": "~10.1.3",
"@angular/platform-browser": "~10.1.3",
"@angular/platform-browser-dynamic": "~10.1.3",
"@angular/router": "~10.1.3",
"@angular/service-worker": "~10.1.3",
"@angular/animations": "~11.0.1",
"@angular/common": "~11.0.1",
"@angular/compiler": "~11.0.1",
"@angular/core": "~11.0.1",
"@angular/forms": "~11.0.1",
"@angular/platform-browser": "~11.0.1",
"@angular/platform-browser-dynamic": "~11.0.1",
"@angular/router": "~11.0.1",
"@angular/service-worker": "~11.0.1",
"angular-in-memory-web-api": "~0.11.0",
"rxjs": "~6.6.0",
"tslib": "^2.0.0",
"zone.js": "~0.10.3"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.1001.3",
"@angular/cli": "~10.1.3",
"@angular/compiler-cli": "~10.1.3",
"@types/jasmine": "~3.5.0",
"@angular-devkit/build-angular": "~0.1100.2",
"@angular/cli": "~11.0.2",
"@angular/compiler-cli": "~11.0.1",
"@types/jasmine": "~3.6.0",
"@types/jasminewd2": "~2.0.3",
"@types/node": "^12.11.1",
"codelyzer": "^6.0.0",
"jasmine-core": "~3.6.0",
"jasmine-marbles": "~0.6.0",
"jasmine-spec-reporter": "~5.0.0",
"karma": "~5.0.0",
"karma": "~5.1.0",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage-istanbul-reporter": "~3.0.2",
"karma-coverage": "~2.0.3",
"karma-jasmine": "~4.0.0",
"karma-jasmine-html-reporter": "^1.5.0",
"protractor": "~7.0.0",

View File

@ -27,34 +27,34 @@
},
"private": true,
"dependencies": {
"@angular/animations": "~10.1.3",
"@angular/common": "~10.1.3",
"@angular/compiler": "~10.1.3",
"@angular/core": "~10.1.3",
"@angular/forms": "~10.1.3",
"@angular/platform-browser": "~10.1.3",
"@angular/platform-browser-dynamic": "~10.1.3",
"@angular/router": "~10.1.3",
"@angular/upgrade": "~10.1.3",
"@angular/animations": "~11.0.1",
"@angular/common": "~11.0.1",
"@angular/compiler": "~11.0.1",
"@angular/core": "~11.0.1",
"@angular/forms": "~11.0.1",
"@angular/platform-browser": "~11.0.1",
"@angular/platform-browser-dynamic": "~11.0.1",
"@angular/router": "~11.0.1",
"@angular/upgrade": "~11.0.1",
"core-js": "^2.5.4",
"rxjs": "~6.6.0",
"tslib": "^2.0.0",
"zone.js": "~0.10.3"
},
"devDependencies": {
"@angular/compiler-cli": "~10.1.3",
"@angular/compiler-cli": "~11.0.1",
"@types/angular": "1.7.3",
"@types/angular-animate": "1.5.10",
"@types/angular-mocks": "1.7.0",
"@types/angular-resource": "1.5.16",
"@types/angular-route": "1.7.1",
"@types/jasmine": "~3.5.0",
"@types/jasmine": "~3.6.0",
"@types/jasminewd2": "~2.0.3",
"@types/node": "^12.11.1",
"concurrently": "^5.0.1",
"http-server": "^0.12.0",
"jasmine-core": "~3.6.0",
"karma": "~5.0.0",
"karma": "~5.1.0",
"karma-chrome-launcher": "~3.1.0",
"karma-jasmine": "~4.0.0",
"karma-jasmine-html-reporter": "^1.5.0",

View File

@ -43,8 +43,6 @@
]
}
],
// TODO(gkalpak): Fix the code and enable this.
// "no-any": true,
"no-console": [
true,
"debug",

View File

@ -44,7 +44,6 @@
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"extractLicenses": true,
"vendorChunk": false,

View File

@ -43,7 +43,6 @@
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"extractLicenses": true,
"vendorChunk": false,

View File

@ -17,16 +17,16 @@
},
"private": true,
"dependencies": {
"@angular/animations": "~10.1.3",
"@angular/common": "~10.1.3",
"@angular/compiler": "~10.1.3",
"@angular/core": "~10.1.3",
"@angular/forms": "~10.1.3",
"@angular/platform-browser": "~10.1.3",
"@angular/platform-browser-dynamic": "~10.1.3",
"@angular/platform-server": "~10.1.3",
"@angular/router": "~10.1.3",
"@nguniversal/express-engine": "~10.1.0",
"@angular/animations": "~11.0.1",
"@angular/common": "~11.0.1",
"@angular/compiler": "~11.0.1",
"@angular/core": "~11.0.1",
"@angular/forms": "~11.0.1",
"@angular/platform-browser": "~11.0.1",
"@angular/platform-browser-dynamic": "~11.0.1",
"@angular/platform-server": "~11.0.1",
"@angular/router": "~11.0.1",
"@nguniversal/express-engine": "^11.0.0",
"angular-in-memory-web-api": "~0.11.0",
"express": "^4.15.2",
"rxjs": "~6.6.0",
@ -34,21 +34,21 @@
"zone.js": "~0.10.3"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.1001.3",
"@angular/cli": "~10.1.3",
"@angular/compiler-cli": "~10.1.3",
"@nguniversal/builders": "~10.1.0",
"@angular-devkit/build-angular": "~0.1100.2",
"@angular/cli": "~11.0.2",
"@angular/compiler-cli": "~11.0.1",
"@nguniversal/builders": "^11.0.0",
"@types/express": "^4.17.8",
"@types/jasmine": "~3.5.0",
"@types/jasmine": "~3.6.0",
"@types/jasminewd2": "~2.0.3",
"@types/node": "^12.11.1",
"codelyzer": "^6.0.0",
"jasmine-core": "~3.6.0",
"jasmine-marbles": "~0.6.0",
"jasmine-spec-reporter": "~5.0.0",
"karma": "~5.0.0",
"karma": "~5.1.0",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage-istanbul-reporter": "~3.0.2",
"karma-coverage": "~2.0.3",
"karma-jasmine": "~4.0.0",
"karma-jasmine-html-reporter": "^1.5.0",
"protractor": "~7.0.0",

View File

@ -21,20 +21,20 @@
"license": "MIT",
"repository": {},
"dependencies": {
"@angular/animations": "~10.1.3",
"@angular/common": "~10.1.3",
"@angular/compiler": "~10.1.3",
"@angular/core": "~10.1.3",
"@angular/elements": "~10.1.3",
"@angular/forms": "~10.1.3",
"@angular/localize": "~10.1.3",
"@angular/platform-browser": "~10.1.3",
"@angular/platform-browser-dynamic": "~10.1.3",
"@angular/platform-server": "~10.1.3",
"@angular/router": "~10.1.3",
"@angular/service-worker": "~10.1.3",
"@angular/upgrade": "~10.1.3",
"@nguniversal/express-engine": "~10.1.0",
"@angular/animations": "~11.0.1",
"@angular/common": "~11.0.1",
"@angular/compiler": "~11.0.1",
"@angular/core": "~11.0.1",
"@angular/elements": "~11.0.1",
"@angular/forms": "~11.0.1",
"@angular/localize": "~11.0.1",
"@angular/platform-browser": "~11.0.1",
"@angular/platform-browser-dynamic": "~11.0.1",
"@angular/platform-server": "~11.0.1",
"@angular/router": "~11.0.1",
"@angular/service-worker": "~11.0.1",
"@angular/upgrade": "~11.0.1",
"@nguniversal/express-engine": "^11.0.0",
"@webcomponents/custom-elements": "^1.4.2",
"angular": "1.8.0",
"angular-in-memory-web-api": "~0.11.0",
@ -47,17 +47,17 @@
"zone.js": "~0.10.3"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.1001.3",
"@angular/cli": "~10.1.3",
"@angular/compiler-cli": "~10.1.3",
"@nguniversal/builders": "~10.1.0",
"@angular-devkit/build-angular": "~0.1100.2",
"@angular/cli": "~11.0.2",
"@angular/compiler-cli": "~11.0.1",
"@nguniversal/builders": "^11.0.0",
"@types/angular": "1.7.3",
"@types/angular-animate": "1.5.10",
"@types/angular-mocks": "1.7.0",
"@types/angular-resource": "1.5.16",
"@types/angular-route": "1.7.1",
"@types/express": "^4.17.8",
"@types/jasmine": "~3.5.0",
"@types/jasmine": "~3.6.0",
"@types/jasminewd2": "~2.0.3",
"@types/jquery": "3.5.1",
"@types/node": "^12.11.1",
@ -68,9 +68,9 @@
"jasmine-core": "~3.6.0",
"jasmine-marbles": "~0.6.0",
"jasmine-spec-reporter": "~5.0.0",
"karma": "~5.0.0",
"karma": "~5.1.0",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage-istanbul-reporter": "~3.0.2",
"karma-coverage": "~2.0.3",
"karma-jasmine": "~4.0.0",
"karma-jasmine-html-reporter": "^1.5.0",
"lite-server": "^2.2.2",

File diff suppressed because it is too large Load Diff