Skip to content

Commit

Permalink
build(docs-infra): upgrade @angular/cli to 8.0.0-beta.18 (angular#29926)
Browse files Browse the repository at this point in the history
This commit also changes the config files and their layout to
(reasonably closely) match what the cli would generate for a new app.

Related Jira issue: [TOOL-815](https://angular-team.atlassian.net/browse/TOOL-815)

PR Close angular#29926
  • Loading branch information
gkalpak authored and AndrewKushnir committed Apr 25, 2019
1 parent b8298f1 commit 6c1ae29
Show file tree
Hide file tree
Showing 28 changed files with 294 additions and 246 deletions.
81 changes: 33 additions & 48 deletions aio/angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,23 @@
"root": "",
"sourceRoot": "src",
"projectType": "application",
"prefix": "aio",
"schematics": {
"@schematics/angular:component": {
"inlineStyle": true,
"style": "scss"
}
},
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist",
"index": "src/index.html",
"main": "src/main.ts",
"tsConfig": "src/tsconfig.app.json",
"webWorkerTsConfig": "src/tsconfig.worker.json",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.app.json",
"webWorkerTsConfig": "tsconfig.worker.json",
"aot": true,
"optimization": true,
"buildOptimizer": true,
Expand All @@ -32,7 +40,6 @@
"extractLicenses": true,
"namedChunks": true,
"vendorChunk": false,
"polyfills": "src/polyfills.ts",
"assets": [
"src/assets",
"src/generated",
Expand Down Expand Up @@ -61,26 +68,26 @@
"next": {
"fileReplacements": [
{
"src": "src/environments/environment.ts",
"replaceWith": "src/environments/environment.next.ts"
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.next.ts"
}
],
"serviceWorker": true
},
"stable": {
"fileReplacements": [
{
"src": "src/environments/environment.ts",
"replaceWith": "src/environments/environment.stable.ts"
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.stable.ts"
}
],
"serviceWorker": true
},
"archive": {
"fileReplacements": [
{
"src": "src/environments/environment.ts",
"replaceWith": "src/environments/environment.archive.ts"
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.archive.ts"
}
],
"serviceWorker": true
Expand Down Expand Up @@ -120,14 +127,10 @@
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "src/test.ts",
"karmaConfig": "src/karma.conf.js",
"polyfills": "src/polyfills.ts",
"tsConfig": "src/tsconfig.spec.json",
"webWorkerTsConfig": "src/tsconfig.worker.json",
"scripts": [],
"styles": [
"src/styles.scss"
],
"tsConfig": "tsconfig.spec.json",
"webWorkerTsConfig": "tsconfig.worker.json",
"karmaConfig": "karma.conf.js",
"assets": [
"src/assets",
"src/generated",
Expand All @@ -143,27 +146,27 @@
"input": "node_modules/@webcomponents/custom-elements/src",
"output": "/assets/js"
}
]
],
"styles": [
"src/styles.scss"
],
"scripts": []
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"src/tsconfig.app.json",
"src/tsconfig.spec.json"
"tsconfig.app.json",
"tsconfig.spec.json",
"tsconfig.worker.json",
"tests/e2e/tsconfig.json"
],
"exclude": []
"exclude": [
"**/node_modules/**"
]
}
}
}
},
"site-e2e": {
"root": "",
"projectType": "application",
"cli": {},
"schematics": {},
"architect": {
},
"e2e": {
"builder": "@angular-devkit/build-angular:protractor",
"options": {
Expand All @@ -175,27 +178,9 @@
"devServerTarget": "site:serve:ci"
}
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"tests/e2e/tsconfig.e2e.json"
],
"exclude": []
}
}
}
}
},
"schematics": {
"@schematics/angular:component": {
"inlineStyle": true,
"prefix": "aio",
"styleext": "scss"
},
"@schematics/angular:directive": {
"prefix": "aio"
}
}
"defaultProject": "site"
}
13 changes: 13 additions & 0 deletions aio/browserslist
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
# For additional information regarding the format and rule options, please see:
# https://github.com/browserslist/browserslist#queries

# Googlebot uses an older version of Chrome
# For additional information see: https://developers.google.com/search/docs/guides/rendering

> 0.5%
last 2 versions
Firefox ESR
not dead
IE 9-11 # For IE 9-11 support.
Chrome 41 # For Googlebot support.
5 changes: 3 additions & 2 deletions aio/src/karma.conf.js → aio/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ module.exports = function (config) {
clearContext: false // leave Jasmine Spec Runner output visible in browser
},
coverageIstanbulReporter: {
dir: require('path').join(__dirname, '../coverage'),
reports: ['html', 'lcovonly'],
dir: require('path').join(__dirname, './coverage/site'),
reports: ['html', 'lcovonly', 'text-summary'],
fixWebpackSourcePaths: true
},
reporters: ['progress', 'kjhtml'],
Expand All @@ -28,5 +28,6 @@ module.exports = function (config) {
browsers: ['Chrome'],
browserNoActivityTimeout: 60000,
singleRun: false,
restartOnFileChange: true
});
};
4 changes: 3 additions & 1 deletion aio/ngsw-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"/assets/images/favicons/favicon.ico",
"/assets/js/*.js",
"/*.css",
"/*.js"
"/*.js",
"!/*-es5*.js"
],
"urls": [
"https://fonts.googleapis.com/**",
Expand All @@ -39,6 +40,7 @@
"files": [
"/assets/images/favicons/**",
"/generated/ie-polyfills.min.js",
"/*-es5*.js",
"!/**/_unused/**"
]
}
Expand Down
8 changes: 4 additions & 4 deletions aio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@
"docs-watch": "node tools/transforms/authors-package/watchr.js",
"docs-lint": "eslint --ignore-path=\"tools/transforms/.eslintignore\" tools/transforms",
"docs-test": "node tools/transforms/test.js",
"redirects-test": "jasmine-ts tests/deployment/unit/**/*.spec.ts",
"firebase-utils-test": "jasmine-ts tools/firebase-test-utils/*.spec.ts",
"redirects-test": "jasmine-ts --project=tests/deployment/unit tests/deployment/unit/**/*.spec.ts",
"firebase-utils-test": "jasmine-ts --project=tools/firebase-test-utils tools/firebase-test-utils/*.spec.ts",
"tools-lint": "tslint -c \"tools/tslint.json\" \"tools/firebase-test-utils/**/*.ts\"",
"tools-test": "./scripts/deploy-to-firebase.test.sh && yarn docs-test && yarn boilerplate:test && jasmine tools/ng-packages-installer/index.spec.js && yarn firebase-utils-test",
"preserve-and-sync": "yarn docs",
Expand Down Expand Up @@ -96,8 +96,8 @@
"zone.js": "^0.9.0"
},
"devDependencies": {
"@angular-devkit/build-angular": "0.800.0-beta.13",
"@angular/cli": "8.0.0-beta.13",
"@angular-devkit/build-angular": "0.800.0-beta.18",
"@angular/cli": "8.0.0-beta.18",
"@angular/compiler": "^8.0.0-beta.14",
"@angular/compiler-cli": "^8.0.0-beta.14",
"@angular/language-service": "^8.0.0-beta.14",
Expand Down
9 changes: 6 additions & 3 deletions aio/scripts/_payload-limits.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@
"aio": {
"master": {
"uncompressed": {
"runtime": 2972,
"main": 501350,
"polyfills": 59197
"runtime-es5": 2980,
"runtime-es2015": 2986,
"main-es5": 501356,
"main-es2015": 440336,
"polyfills-es5": 128751,
"polyfills-es2015": 59557
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion aio/src/app/search/search.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export class SearchService {
.pipe(
concatMap(() => {
// Create the worker and load the index
const worker = new Worker('./search-worker', { type: 'module' });
const worker = new Worker('./search.worker', { type: 'module' });
this.worker = WebWorkerClient.create(worker, this.zone);
return this.worker.sendMessage<boolean>('load-index');
}),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/// <reference lib="webworker" />
import { WebWorkerMessage } from '../shared/web-worker-message';
import * as lunr from 'lunr';

Expand Down
23 changes: 0 additions & 23 deletions aio/src/tsconfig.app.json

This file was deleted.

11 changes: 0 additions & 11 deletions aio/src/tsconfig.json

This file was deleted.

20 changes: 0 additions & 20 deletions aio/src/tsconfig.spec.json

This file was deleted.

8 changes: 7 additions & 1 deletion aio/tests/deployment/e2e/protractor.conf.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
// @ts-check
// Protractor configuration file, see link for more information
// https://github.com/angular/protractor/blob/master/lib/config.ts

/**
* @type { import("protractor").Config }
*/
exports.config = {
allScriptsTimeout: 11000,
suites: {
Expand All @@ -23,8 +27,10 @@ exports.config = {
legacyUrls: [],
},
beforeLaunch() {
const {join} = require('path');
const {register} = require('ts-node');
register({});

register({project: join(__dirname, './tsconfig.json')});
},
onPrepare() {
const {SpecReporter} = require('jasmine-spec-reporter');
Expand Down
9 changes: 9 additions & 0 deletions aio/tests/deployment/e2e/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extends": "../../../tsconfig.json",
"compilerOptions": {
"module": "commonjs"
},
"include": [
"**/*.ts"
]
}
9 changes: 9 additions & 0 deletions aio/tests/deployment/unit/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extends": "../../../tsconfig.json",
"compilerOptions": {
"module": "commonjs"
},
"include": [
"**/*.ts"
]
}
12 changes: 7 additions & 5 deletions aio/tests/e2e/protractor.conf.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
// @ts-check
// Protractor configuration file, see link for more information
// https://github.com/angular/protractor/blob/master/lib/config.ts

const { SpecReporter } = require('jasmine-spec-reporter');

/**
* @type { import("protractor").Config }
*/
exports.config = {
allScriptsTimeout: 11000,
specs: [
'./*.e2e-spec.ts'
'./src/**/*.e2e-spec.ts'
],
capabilities: {
browserName: 'chrome',
Expand All @@ -19,12 +23,10 @@ exports.config = {
defaultTimeoutInterval: 30000,
print: function() {}
},
beforeLaunch: function() {
onPrepare() {
require('ts-node').register({
project: 'tests/e2e/tsconfig.e2e.json'
project: require('path').join(__dirname, './tsconfig.json')
});
},
onPrepare() {
jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
}
};
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "../../out-tsc/e2e",
"baseUrl": "./",
"module": "commonjs",
"target": "es5",
"types": [
Expand Down
Loading

0 comments on commit 6c1ae29

Please sign in to comment.