From aa1d696d0afd64aec1c108be4b60a8b9f345357c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adolfo=20G=C3=B3mez=20Garc=C3=ADa?= Date: Thu, 30 Aug 2018 06:01:26 +0200 Subject: [PATCH] migrated to angular 6 --- .angular-cli.json | 83 ---------------------- angular.json | 155 +++++++++++++++++++++++++++++++++++++++++ karma.conf.js | 10 ++- package.json | 34 ++++----- src/tsconfig.spec.json | 3 +- tsconfig.json | 6 +- tslint.json | 1 - 7 files changed, 183 insertions(+), 109 deletions(-) delete mode 100644 .angular-cli.json create mode 100644 angular.json diff --git a/.angular-cli.json b/.angular-cli.json deleted file mode 100644 index 05a9989..0000000 --- a/.angular-cli.json +++ /dev/null @@ -1,83 +0,0 @@ -{ - "$schema": "./node_modules/@angular/cli/lib/config/schema.json", - "project": { - "name": "uds" - }, - "apps": [ - { - "root": "src", - "outDir": "dist", - "assets": [ - "static", - "server", - "favicon.ico" - ], - "index": "index.html", - "main": "main.ts", - "polyfills": "polyfills.ts", - "test": "test.ts", - "tsconfig": "tsconfig.app.json", - "testTsconfig": "tsconfig.spec.json", - "prefix": "uds", - "styles": [ - "styles.css" - ], - "scripts": [ - "../node_modules/cookieconsent/build/cookieconsent.min.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": "css", - "class": { - "spec": false - }, - "component": { - "spec": false - }, - "directive": { - "spec": false - }, - "guard": { - "spec": false - }, - "module": { - "spec": false - }, - "pipe": { - "spec": false - }, - "service": { - "spec": false - } - } -} diff --git a/angular.json b/angular.json new file mode 100644 index 0000000..029bda4 --- /dev/null +++ b/angular.json @@ -0,0 +1,155 @@ +{ + "$schema": "./node_modules/@angular/cli/lib/config/schema.json", + "version": 1, + "newProjectRoot": "projects", + "projects": { + "uds": { + "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/static", + "src/server", + "src/favicon.ico" + ], + "styles": [ + "src/styles.css" + ], + "scripts": [ + "node_modules/cookieconsent/build/cookieconsent.min.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": "uds:build" + }, + "configurations": { + "production": { + "browserTarget": "uds:build:production" + } + } + }, + "extract-i18n": { + "builder": "@angular-devkit/build-angular:extract-i18n", + "options": { + "browserTarget": "uds: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/cookieconsent/build/cookieconsent.min.js" + ], + "styles": [ + "src/styles.css" + ], + "assets": [ + "src/static", + "src/server", + "src/favicon.ico" + ] + } + }, + "lint": { + "builder": "@angular-devkit/build-angular:tslint", + "options": { + "tsConfig": [ + "src/tsconfig.app.json", + "src/tsconfig.spec.json" + ], + "exclude": [ + "**/node_modules/**" + ] + } + } + } + }, + "uds-e2e": { + "root": "e2e", + "sourceRoot": "e2e", + "projectType": "application", + "architect": { + "e2e": { + "builder": "@angular-devkit/build-angular:protractor", + "options": { + "protractorConfig": "./protractor.conf.js", + "devServerTarget": "uds:serve" + } + }, + "lint": { + "builder": "@angular-devkit/build-angular:tslint", + "options": { + "tsConfig": [ + "e2e/tsconfig.e2e.json" + ], + "exclude": [ + "**/node_modules/**" + ] + } + } + } + } + }, + "defaultProject": "uds", + "schematics": { + "@schematics/angular:class": { + "spec": false + }, + "@schematics/angular:component": { + "spec": false, + "prefix": "uds", + "styleext": "css" + }, + "@schematics/angular:directive": { + "spec": false, + "prefix": "uds" + }, + "@schematics/angular:guard": { + "spec": false + }, + "@schematics/angular:module": { + "spec": false + }, + "@schematics/angular:pipe": { + "spec": false + }, + "@schematics/angular:service": { + "spec": false + } + } +} \ No newline at end of file diff --git a/karma.conf.js b/karma.conf.js index af139fa..0840f6c 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -4,24 +4,22 @@ module.exports = function (config) { config.set({ basePath: '', - frameworks: ['jasmine', '@angular/cli'], + frameworks: ['jasmine', '@angular-devkit/build-angular'], plugins: [ require('karma-jasmine'), require('karma-chrome-launcher'), require('karma-jasmine-html-reporter'), require('karma-coverage-istanbul-reporter'), - require('@angular/cli/plugins/karma') + require('@angular-devkit/build-angular/plugins/karma') ], client:{ clearContext: false // leave Jasmine Spec Runner output visible in browser }, coverageIstanbulReporter: { - reports: [ 'html', 'lcovonly' ], + dir: require('path').join(__dirname, 'coverage'), reports: [ 'html', 'lcovonly' ], fixWebpackSourcePaths: true }, - angularCli: { - environment: 'dev' - }, + reporters: ['progress', 'kjhtml'], port: 9876, colors: true, diff --git a/package.json b/package.json index fc9b8e0..09bfd88 100644 --- a/package.json +++ b/package.json @@ -13,27 +13,29 @@ }, "private": true, "dependencies": { - "@angular/animations": "^5.2.0", - "@angular/common": "^5.2.0", - "@angular/compiler": "^5.2.0", - "@angular/core": "^5.2.0", - "@angular/forms": "^5.2.0", - "@angular/http": "^5.2.0", - "@angular/platform-browser": "^5.2.0", - "@angular/platform-browser-dynamic": "^5.2.0", - "@angular/router": "^5.2.0", + "@angular/animations": "^6.1.6", + "@angular/common": "^6.1.6", + "@angular/compiler": "^6.1.6", + "@angular/core": "^6.1.6", + "@angular/forms": "^6.1.6", + "@angular/http": "^6.1.6", + "@angular/platform-browser": "^6.1.6", + "@angular/platform-browser-dynamic": "^6.1.6", + "@angular/router": "^6.1.6", "@ng-bootstrap/ng-bootstrap": "^1.0.0", "bootstrap": "^4.1.1", "cookieconsent": "^3.0.6", "core-js": "^2.4.1", "font-awesome": "^4.7.0", - "rxjs": "^5.5.6", - "zone.js": "^0.8.19" + "rxjs": "^6.2.2", + "zone.js": "^0.8.19", + "rxjs-compat": "^6.0.0-rc.0" }, "devDependencies": { - "@angular/cli": "~1.7.4", - "@angular/compiler-cli": "^5.2.0", - "@angular/language-service": "^5.2.0", + "@angular-devkit/build-angular": "~0.7.0", + "@angular/cli": "^6.1.5", + "@angular/compiler-cli": "^6.1.6", + "@angular/language-service": "^6.1.6", "@types/jasmine": "~2.8.3", "@types/jasminewd2": "~2.0.2", "@types/node": "~6.0.60", @@ -48,6 +50,6 @@ "protractor": "~5.1.2", "ts-node": "~4.1.0", "tslint": "~5.9.1", - "typescript": "~2.6.2" + "typescript": "~2.9.2" } -} +} \ No newline at end of file diff --git a/src/tsconfig.spec.json b/src/tsconfig.spec.json index ac22a29..1a18e6d 100644 --- a/src/tsconfig.spec.json +++ b/src/tsconfig.spec.json @@ -10,7 +10,8 @@ ] }, "files": [ - "test.ts" + "test.ts", + "polyfills.ts" ], "include": [ "**/*.spec.ts", diff --git a/tsconfig.json b/tsconfig.json index a6c016b..7168743 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -14,6 +14,8 @@ "lib": [ "es2017", "dom" - ] + ], + "module": "es2015", + "baseUrl": "./" } -} +} \ No newline at end of file diff --git a/tslint.json b/tslint.json index 5b8519a..176276b 100644 --- a/tslint.json +++ b/tslint.json @@ -18,7 +18,6 @@ "forin": true, "import-blacklist": [ true, - "rxjs", "rxjs/Rx" ], "import-spacing": true,