chore(webui): upgrade angular cli version

This commit is contained in:
Antoine CARON 2019-02-01 16:30:06 +01:00 committed by Traefiker Bot
parent 162490dadf
commit 0561a20c06
12 changed files with 3391 additions and 2745 deletions

View file

@ -1,63 +0,0 @@
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"project": {
"name": "webui"
},
"apps": [
{
"root": "src",
"outDir": "dist",
"assets": [
"assets/images",
"favicon.ico"
],
"index": "index.html",
"main": "main.ts",
"polyfills": "polyfills.ts",
"test": "test.ts",
"tsconfig": "tsconfig.app.json",
"testTsconfig": "tsconfig.spec.json",
"prefix": "app",
"styles": [
"app.sass"
],
"scripts": [
"../node_modules/@fortawesome/fontawesome/index.js",
"../node_modules/@fortawesome/fontawesome-free-solid/index.js"
],
"environmentSource": "environments/environment.ts",
"environments": {
"dev": "environments/environment.ts",
"prod": "environments/environment.prod.ts"
}
}
],
"e2e": {
"protractor": {
"config": "./protractor.conf.js"
}
},
"lint": [
{
"project": "src/tsconfig.app.json",
"exclude": "**/node_modules/**"
},
{
"project": "src/tsconfig.spec.json",
"exclude": "**/node_modules/**"
},
{
"project": "e2e/tsconfig.e2e.json",
"exclude": "**/node_modules/**"
}
],
"test": {
"karma": {
"config": "./karma.conf.js"
}
},
"defaults": {
"styleExt": "sass",
"component": {}
}
}

138
webui/angular.json Normal file
View file

@ -0,0 +1,138 @@
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"webui": {
"root": "",
"sourceRoot": "src",
"projectType": "application",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist",
"index": "src/index.html",
"main": "src/main.ts",
"tsConfig": "src/tsconfig.app.json",
"polyfills": "src/polyfills.ts",
"assets": [
"src/assets/images",
"src/favicon.ico"
],
"styles": [
"src/app.sass"
],
"scripts": [
"node_modules/@fortawesome/fontawesome/index.js",
"node_modules/@fortawesome/fontawesome-free-solid/index.js"
]
},
"configurations": {
"production": {
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
]
}
}
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "webui:build"
},
"configurations": {
"production": {
"browserTarget": "webui:build:production"
}
}
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "webui:build"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "src/test.ts",
"karmaConfig": "./karma.conf.js",
"polyfills": "src/polyfills.ts",
"tsConfig": "src/tsconfig.spec.json",
"scripts": [
"node_modules/@fortawesome/fontawesome/index.js",
"node_modules/@fortawesome/fontawesome-free-solid/index.js"
],
"styles": [
"src/app.sass"
],
"assets": [
"src/assets/images",
"src/favicon.ico"
]
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"src/tsconfig.app.json",
"src/tsconfig.spec.json"
],
"exclude": [
"**/node_modules/**"
]
}
}
}
},
"webui-e2e": {
"root": "e2e",
"sourceRoot": "e2e",
"projectType": "application",
"architect": {
"e2e": {
"builder": "@angular-devkit/build-angular:protractor",
"options": {
"protractorConfig": "./protractor.conf.js",
"devServerTarget": "webui:serve"
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"src/tsconfig.spec.json"
],
"exclude": [
"**/node_modules/**"
]
}
}
}
}
},
"defaultProject": "webui",
"schematics": {
"@schematics/angular:component": {
"prefix": "app",
"styleext": "sass"
},
"@schematics/angular:directive": {
"prefix": "app"
}
}
}

View file

@ -4,24 +4,22 @@
module.exports = function (config) { module.exports = function (config) {
config.set({ config.set({
basePath: '', basePath: '',
frameworks: ['jasmine', '@angular/cli'], frameworks: ['jasmine', '@angular-devkit/build-angular'],
plugins: [ plugins: [
require('karma-jasmine'), require('karma-jasmine'),
require('karma-chrome-launcher'), require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'), require('karma-jasmine-html-reporter'),
require('karma-coverage-istanbul-reporter'), require('karma-coverage-istanbul-reporter'),
require('@angular/cli/plugins/karma') require('@angular-devkit/build-angular/plugins/karma')
], ],
client:{ client:{
clearContext: false // leave Jasmine Spec Runner output visible in browser clearContext: false // leave Jasmine Spec Runner output visible in browser
}, },
coverageIstanbulReporter: { coverageIstanbulReporter: {
reports: [ 'html', 'lcovonly' ], dir: require('path').join(__dirname, 'coverage'), reports: [ 'html', 'lcovonly' ],
fixWebpackSourcePaths: true fixWebpackSourcePaths: true
}, },
angularCli: {
environment: 'dev'
},
reporters: ['progress', 'kjhtml'], reporters: ['progress', 'kjhtml'],
port: 9876, port: 9876,
colors: true, colors: true,

View file

@ -16,44 +16,47 @@
"e2e": "ng e2e" "e2e": "ng e2e"
}, },
"dependencies": { "dependencies": {
"@angular/animations": "^5.2.0", "@angular/animations": "^7.2.3",
"@angular/common": "^5.2.0", "@angular/common": "^7.2.3",
"@angular/compiler": "^5.2.0", "@angular/compiler": "^7.2.3",
"@angular/core": "^5.2.0", "@angular/core": "^7.2.3",
"@angular/forms": "^5.2.0", "@angular/forms": "^7.2.3",
"@angular/http": "^5.2.0", "@angular/http": "^7.2.3",
"@angular/platform-browser": "^5.2.0", "@angular/platform-browser": "^7.2.3",
"@angular/platform-browser-dynamic": "^5.2.0", "@angular/platform-browser-dynamic": "^7.2.3",
"@angular/router": "^5.2.0", "@angular/router": "^7.2.3",
"@fortawesome/fontawesome": "^1.1.5", "@fortawesome/fontawesome": "^1.1.5",
"@fortawesome/fontawesome-free-solid": "^5.0.10", "@fortawesome/fontawesome-free-solid": "^5.0.10",
"bulma": "^0.7.0", "bulma": "^0.7.0",
"core-js": "^2.4.1", "core-js": "^2.4.1",
"d3": "^4.13.0", "d3": "^5.8.0",
"d3-format": "^1.3.0", "d3-format": "^1.3.0",
"date-fns": "^1.29.0", "date-fns": "^1.29.0",
"lodash": "^4.17.5", "lodash": "^4.17.5",
"rxjs": "^5.5.6", "rxjs": "^6.4.0",
"zone.js": "^0.8.19" "tslib": "^1.9.0",
"zone.js": "^0.8.19",
"rxjs-compat": "^6.0.0-rc.0"
}, },
"devDependencies": { "devDependencies": {
"@angular/cli": "~1.7.2", "@angular-devkit/build-angular": "~0.13.0",
"@angular/compiler-cli": "^5.2.0", "@angular/cli": "~7.3.0",
"@angular/language-service": "^5.2.0", "@angular/compiler-cli": "^7.2.3",
"@types/jasmine": "~2.8.3", "@angular/language-service": "^7.2.3",
"@types/jasmine": "~3.3.8",
"@types/jasminewd2": "~2.0.2", "@types/jasminewd2": "~2.0.2",
"@types/node": "~6.0.60", "@types/node": "~10.12.20",
"codelyzer": "^4.0.1", "codelyzer": "^4.0.1",
"jasmine-core": "~2.8.0", "jasmine-core": "~3.3.0",
"jasmine-spec-reporter": "~4.2.1", "jasmine-spec-reporter": "~4.2.1",
"karma": "~2.0.0", "karma": "~4.0.0",
"karma-chrome-launcher": "~2.2.0", "karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "^1.2.1", "karma-coverage-istanbul-reporter": "^2.0.4",
"karma-jasmine": "~1.1.0", "karma-jasmine": "~2.0.1",
"karma-jasmine-html-reporter": "^0.2.2", "karma-jasmine-html-reporter": "^1.4.0",
"protractor": "~5.1.2", "protractor": "~5.4.2",
"ts-node": "~4.1.0", "ts-node": "~8.0.2",
"tslint": "~5.9.1", "tslint": "~5.12.1",
"typescript": "~2.5.3" "typescript": "~3.2.4"
} }
} }

View file

@ -20,5 +20,4 @@ describe('AppComponent', () => {
const app = fixture.debugElement.componentInstance; const app = fixture.debugElement.componentInstance;
expect(app).toBeTruthy(); expect(app).toBeTruthy();
})); }));
}); });

View file

@ -25,7 +25,7 @@ describe('BarChartComponent', () => {
}); });
it('should initially go to loading state', () => { it('should initially go to loading state', () => {
expect(component.loading).toBeTruthy() expect(component.loading).toBeTruthy();
}); });
}); });

View file

@ -6,6 +6,9 @@ import 'rxjs/add/operator/catch';
import 'rxjs/add/operator/map'; import 'rxjs/add/operator/map';
import 'rxjs/add/operator/retry'; import 'rxjs/add/operator/retry';
import { Observable } from 'rxjs/Observable'; import { Observable } from 'rxjs/Observable';
import { empty } from 'rxjs';
import {catchError, retry} from "rxjs/internal/operators";
export interface ProviderType { export interface ProviderType {
[provider: string]: { [provider: string]: {
@ -29,7 +32,7 @@ export class ApiService {
.retry(4) .retry(4)
.catch((err: HttpErrorResponse) => { .catch((err: HttpErrorResponse) => {
console.error(`[version] returned code ${err.status}, body was: ${err.error}`); console.error(`[version] returned code ${err.status}, body was: ${err.error}`);
return Observable.empty<any>(); return Observable.empty();
}); });
} }
@ -38,7 +41,7 @@ export class ApiService {
.retry(2) .retry(2)
.catch((err: HttpErrorResponse) => { .catch((err: HttpErrorResponse) => {
console.error(`[health] returned code ${err.status}, body was: ${err.error}`); console.error(`[health] returned code ${err.status}, body was: ${err.error}`);
return Observable.empty<any>(); return Observable.empty();
}); });
} }

View file

@ -1,49 +1,4 @@
/**
* This file includes polyfills needed by Angular and is loaded before the app.
* You can add your own extra polyfills to this file.
*
* This file is divided into 2 sections:
* 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers.
* 2. Application imports. Files imported after ZoneJS that should be loaded before your main
* file.
*
* The current setup is for so-called "evergreen" browsers; the last versions of browsers that
* automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera),
* Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile.
*
* Learn more in https://angular.io/docs/ts/latest/guide/browser-support.html
*/
/***************************************************************************************************
* BROWSER POLYFILLS
*/
/** IE9, IE10 and IE11 requires all of the following polyfills. **/
// import 'core-js/es6/symbol';
// import 'core-js/es6/object';
// import 'core-js/es6/function';
// import 'core-js/es6/parse-int';
// import 'core-js/es6/parse-float';
// import 'core-js/es6/number';
// import 'core-js/es6/math';
// import 'core-js/es6/string';
// import 'core-js/es6/date';
// import 'core-js/es6/array';
// import 'core-js/es6/regexp';
// import 'core-js/es6/map';
// import 'core-js/es6/weak-map';
// import 'core-js/es6/set';
/** IE10 and IE11 requires the following for NgClass support on SVG elements */
// import 'classlist.js'; // Run `npm install --save classlist.js`.
/** IE10 and IE11 requires the following for the Reflect API. */
// import 'core-js/es6/reflect';
/** Evergreen browsers require these. **/
// Used for reflect-metadata in JIT. If you use AOT (and only Angular decorators), you can remove.
import 'core-js/es7/reflect';
/** /**

View file

@ -10,7 +10,8 @@
] ]
}, },
"files": [ "files": [
"test.ts" "test.ts",
"polyfills.ts"
], ],
"include": [ "include": [
"**/*.spec.ts", "**/*.spec.ts",

View file

@ -1,6 +1,7 @@
{ {
"compileOnSave": false, "compileOnSave": false,
"compilerOptions": { "compilerOptions": {
"importHelpers": true,
"outDir": "./dist/out-tsc", "outDir": "./dist/out-tsc",
"sourceMap": true, "sourceMap": true,
"declaration": false, "declaration": false,
@ -14,6 +15,8 @@
"lib": [ "lib": [
"es2017", "es2017",
"dom" "dom"
] ],
"module": "es2015",
"baseUrl": "./"
} }
} }

View file

@ -18,7 +18,6 @@
"forin": true, "forin": true,
"import-blacklist": [ "import-blacklist": [
true, true,
"rxjs",
"rxjs/Rx" "rxjs/Rx"
], ],
"import-spacing": true, "import-spacing": true,

File diff suppressed because it is too large Load diff