From 7e04bbf78c388e597cbb661afd4fde0ff40904b9 Mon Sep 17 00:00:00 2001 From: rschoene <rene.schoene@tu-dresden.de> Date: Wed, 27 Jan 2021 17:51:27 +0100 Subject: [PATCH] Changes by @johannes.mey in https://git-st.inf.tu-dresden.de/jastadd/ifm for this repo --- .angular-cli.json | 10 +-- .gitignore | 4 +- angular.json | 139 +++++++++++++++++++++++++++++++++++++++ browserslist | 12 ++++ karma.conf.js | 14 ++-- package.json | 57 ++++++++-------- src/app/app.component.ts | 2 +- src/polyfills.ts | 1 - src/tsconfig.app.json | 10 +-- src/tsconfig.spec.json | 5 +- tsconfig.json | 5 +- tslint.json | 23 +++++-- 12 files changed, 222 insertions(+), 60 deletions(-) create mode 100644 angular.json create mode 100644 browserslist diff --git a/.angular-cli.json b/.angular-cli.json index 9bb6f94..309825c 100644 --- a/.angular-cli.json +++ b/.angular-cli.json @@ -1,14 +1,13 @@ { "$schema": "./node_modules/@angular/cli/lib/config/schema.json", "project": { - "name": "rd-view" + "name": "RAGdoc View" }, "apps": [ { "root": "src", "outDir": "dist", "assets": [ - "data", "assets", "favicon.ico" ], @@ -20,12 +19,9 @@ "testTsconfig": "tsconfig.spec.json", "prefix": "app", "styles": [ - "styles.css", - "../node_modules/codemirror/lib/codemirror.css", - "../node_modules/codemirror/theme/mbo.css" - ], - "scripts": [ + "styles.css" ], + "scripts": [], "environmentSource": "environments/environment.ts", "environments": { "dev": "environments/environment.ts", diff --git a/.gitignore b/.gitignore index 5198bf6..f42e906 100644 --- a/.gitignore +++ b/.gitignore @@ -1,11 +1,13 @@ # See http://help.github.com/ignore-files/ for more about ignoring files. -/src/data/ +!/src/data +/src/data/* # compiled output /dist /tmp /out-tsc +/build # dependencies /node_modules diff --git a/angular.json b/angular.json new file mode 100644 index 0000000..94a5f6d --- /dev/null +++ b/angular.json @@ -0,0 +1,139 @@ +{ + "$schema": "./node_modules/@angular/cli/lib/config/schema.json", + "version": 1, + "newProjectRoot": "projects", + "projects": { + "rd-view": { + "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/data", + "src/assets", + "src/favicon.ico" + ], + "styles": [ + "src/styles.css", + "node_modules/codemirror/lib/codemirror.css", + "node_modules/codemirror/theme/mbo.css" + ], + "scripts": [], + "aot": true + }, + "configurations": { + "production": { + "optimization": true, + "outputHashing": "all", + "sourceMap": false, + "namedChunks": false, + "extractLicenses": true, + "vendorChunk": false, + "buildOptimizer": true, + "fileReplacements": [ + { + "replace": "src/environments/environment.ts", + "with": "src/environments/environment.prod.ts" + } + ], + "budgets": [ + { + "type": "anyComponentStyle", + "maximumWarning": "6kb" + } + ] + } + } + }, + "serve": { + "builder": "@angular-devkit/build-angular:dev-server", + "options": { + "browserTarget": "rd-view:build" + }, + "configurations": { + "production": { + "browserTarget": "rd-view:build:production" + } + } + }, + "extract-i18n": { + "builder": "@angular-devkit/build-angular:extract-i18n", + "options": { + "browserTarget": "rd-view: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": [], + "styles": [ + "src/styles.css", + "node_modules/codemirror/lib/codemirror.css", + "node_modules/codemirror/theme/mbo.css" + ], + "assets": [ + "src/data", + "src/assets", + "src/favicon.ico" + ] + } + }, + "lint": { + "builder": "@angular-devkit/build-angular:tslint", + "options": { + "tsConfig": [ + "src/tsconfig.app.json", + "src/tsconfig.spec.json" + ], + "exclude": [] + } + } + } + }, + "rd-view-e2e": { + "root": "e2e", + "sourceRoot": "e2e", + "projectType": "application", + "architect": { + "e2e": { + "builder": "@angular-devkit/build-angular:protractor", + "options": { + "protractorConfig": "./protractor.conf.js", + "devServerTarget": "rd-view:serve" + } + }, + "lint": { + "builder": "@angular-devkit/build-angular:tslint", + "options": { + "tsConfig": [ + "e2e/tsconfig.e2e.json" + ], + "exclude": [] + } + } + } + } + }, + "defaultProject": "rd-view", + "schematics": { + "@schematics/angular:component": { + "prefix": "app", + "style": "css" + }, + "@schematics/angular:directive": { + "prefix": "app" + } + } +} \ No newline at end of file diff --git a/browserslist b/browserslist new file mode 100644 index 0000000..8084853 --- /dev/null +++ b/browserslist @@ -0,0 +1,12 @@ +# 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 + +# You can see what browsers were selected by your queries by running: +# npx browserslist + +> 0.5% +last 2 versions +Firefox ESR +not dead +not IE 9-11 # For IE 9-11 support, remove 'not'. \ No newline at end of file diff --git a/karma.conf.js b/karma.conf.js index 84b4cd5..c3b7640 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -4,33 +4,31 @@ 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 }, files: [ - { pattern: './src/test.ts', watched: false } + ], preprocessors: { - './src/test.ts': ['@angular/cli'] + }, mime: { 'text/x-typescript': ['ts','tsx'] }, coverageIstanbulReporter: { - reports: [ 'html', 'lcovonly' ], + dir: require('path').join(__dirname, 'coverage'), reports: [ 'html', 'lcovonly' ], fixWebpackSourcePaths: true }, - angularCli: { - environment: 'dev' - }, + reporters: config.angularCli && config.angularCli.codeCoverage ? ['progress', 'coverage-istanbul'] : ['progress', 'kjhtml'], diff --git a/package.json b/package.json index a595603..c29f3d3 100644 --- a/package.json +++ b/package.json @@ -5,43 +5,46 @@ "scripts": { "ng": "ng", "start": "ng serve", - "build": "ng build", + "build": "ng build --base-href \"./\" ", "test": "ng test", "lint": "ng lint", "e2e": "ng e2e" }, "private": true, "dependencies": { - "@angular/common": "^4.0.0", - "@angular/compiler": "^4.0.0", - "@angular/core": "^4.0.0", - "@angular/forms": "^4.0.0", - "@angular/http": "^4.0.0", - "@angular/platform-browser": "^4.0.0", - "@angular/platform-browser-dynamic": "^4.0.0", - "@angular/router": "^4.0.0", + "@angular/common": "^11.1.0", + "@angular/compiler": "^11.1.0", + "@angular/core": "^11.1.0", + "@angular/forms": "^11.1.0", + "@angular/http": "^7.2.16", + "@angular/platform-browser": "^11.1.0", + "@angular/platform-browser-dynamic": "^11.1.0", + "@angular/router": "^11.1.0", + "codemirror": "5.25.2", "core-js": "^2.4.1", - "rxjs": "^5.1.0", - "zone.js": "^0.8.4", - "codemirror": "5.25.2" + "rxjs": "^6.6.3", + "rxjs-compat": "^6.6.3", + "tslib": "^2.0.0", + "zone.js": "~0.11.3" }, "devDependencies": { - "@angular/cli": "^1.7.3", - "@angular/compiler-cli": "^4.0.0", - "@types/jasmine": "2.5.38", - "@types/node": "~6.0.60", - "codelyzer": "~2.0.0", - "jasmine-core": "~2.5.2", - "jasmine-spec-reporter": "~3.2.0", - "karma": "~1.4.1", - "karma-chrome-launcher": "~2.0.0", + "@angular-devkit/build-angular": "~0.1101.0", + "@angular/cli": "^11.1.0", + "@angular/compiler-cli": "^11.1.0", + "@types/jasmine": "~3.6.0", + "@types/node": "^12.11.1", + "codelyzer": "^5.1.2", + "jasmine-core": "~3.6.0", + "jasmine-spec-reporter": "~5.0.0", + "karma": "~5.2.3", + "karma-chrome-launcher": "~3.1.0", "karma-cli": "~1.0.1", - "karma-coverage-istanbul-reporter": "^0.2.0", - "karma-jasmine": "~1.1.0", - "karma-jasmine-html-reporter": "^0.2.2", - "protractor": "~5.1.0", + "karma-coverage-istanbul-reporter": "~3.0.2", + "karma-jasmine": "~4.0.0", + "karma-jasmine-html-reporter": "^1.5.0", + "protractor": "~7.0.0", "ts-node": "~2.0.0", - "tslint": "~4.5.0", - "typescript": "~2.2.0" + "tslint": "~6.1.0", + "typescript": "~4.1.3" } } diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 9ec8c9c..846f223 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -52,7 +52,7 @@ import { Location } from '@angular/common'; ], }) export class AppComponent implements OnInit { - title = 'OpenLicht Eraser Documentation'; + title = 'Documentation'; showMenu = false; packages : Package[]; filter = ''; diff --git a/src/polyfills.ts b/src/polyfills.ts index 53bdaf1..a961087 100644 --- a/src/polyfills.ts +++ b/src/polyfills.ts @@ -42,7 +42,6 @@ /** Evergreen browsers require these. **/ import 'core-js/es6/reflect'; -import 'core-js/es7/reflect'; /** ALL Firefox browsers require the following to support `@angular/animation`. **/ diff --git a/src/tsconfig.app.json b/src/tsconfig.app.json index 5e2507d..26227d8 100644 --- a/src/tsconfig.app.json +++ b/src/tsconfig.app.json @@ -2,12 +2,14 @@ "extends": "../tsconfig.json", "compilerOptions": { "outDir": "../out-tsc/app", - "module": "es2015", "baseUrl": "", "types": [] }, - "exclude": [ - "test.ts", - "**/*.spec.ts" + "files": [ + "main.ts", + "polyfills.ts" + ], + "include": [ + "src/**/*.d.ts" ] } diff --git a/src/tsconfig.spec.json b/src/tsconfig.spec.json index 510e3f1..9c56a51 100644 --- a/src/tsconfig.spec.json +++ b/src/tsconfig.spec.json @@ -2,8 +2,6 @@ "extends": "../tsconfig.json", "compilerOptions": { "outDir": "../out-tsc/spec", - "module": "commonjs", - "target": "es5", "baseUrl": "", "types": [ "jasmine", @@ -11,7 +9,8 @@ ] }, "files": [ - "test.ts" + "test.ts", + "polyfills.ts" ], "include": [ "**/*.spec.ts", diff --git a/tsconfig.json b/tsconfig.json index a35a8ee..04e86c1 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -3,12 +3,15 @@ "compilerOptions": { "outDir": "./dist/out-tsc", "baseUrl": "src", + "downlevelIteration": true, "sourceMap": true, "declaration": false, + "importHelpers": true, "moduleResolution": "node", + "module": "esnext", "emitDecoratorMetadata": true, "experimentalDecorators": true, - "target": "es5", + "target": "es2015", "typeRoots": [ "node_modules/@types" ], diff --git a/tslint.json b/tslint.json index 9113f13..0bda650 100644 --- a/tslint.json +++ b/tslint.json @@ -12,7 +12,12 @@ "curly": true, "eofline": true, "forin": true, - "import-blacklist": [true, "rxjs"], + "deprecation": { + "severity": "warning" + }, + "import-blacklist": [ + true + ], "import-spacing": true, "indent": [ true, @@ -52,9 +57,11 @@ "no-string-throw": true, "no-switch-case-fall-through": true, "no-trailing-whitespace": true, + "no-host-metadata-property": true, "no-unused-expression": true, - "no-use-before-declare": true, + "no-inputs-metadata-property": true, "no-var-keyword": true, + "no-outputs-metadata-property": true, "object-literal-sort-keys": false, "one-line": [ true, @@ -99,15 +106,17 @@ ], "directive-selector": [true, "attribute", "app", "camelCase"], - "component-selector": [true, "element", "app", "kebab-case"], - "use-input-property-decorator": true, - "use-output-property-decorator": true, - "use-host-property-decorator": true, + "component-selector": [ + true, + "element", + "app", + "kebab-case" + ], "no-input-rename": true, "no-output-rename": true, - "use-life-cycle-interface": true, "use-pipe-transform-interface": true, "component-class-suffix": true, + "use-lifecycle-interface": true, "directive-class-suffix": true, "no-access-missing-member": true, "templates-use-public": true, -- GitLab