From 5eb60c11ad7ad6361295c1f256f14678f1fbdc55 Mon Sep 17 00:00:00 2001 From: thomaswoehlke <thomas.woehlke@gmail.com> Date: Fri, 12 Feb 2021 20:18:47 +0100 Subject: [PATCH] * Fixed #123 split RkiBundeslaenderService into two Services, one for bundeslaender and one for landkreise * Fixed #128 add fields from csv to RkiLandkreiseImport * Fixed #139 refactor RkiBundeslaenderServiceDownload to new method scheme introduced 07.02.2021 * Fixed #140 move WhoImport to RKI in: rk_service_import.py * Fixed #125 implement RkiLandkreise * Fixed #126 implement RkiBundeslaenderImport --- src/covid19/static/.markdownlint.json | 4 + src/covid19/static/.prettierrc.json | 19 ++++ src/covid19/static/.pug-lintrc.json | 6 ++ src/covid19/static/angular.json | 126 ++++++++++++++++++++++++++ src/covid19/static/browserslist | 5 + src/covid19/static/karma.conf.js | 32 +++++++ src/covid19/static/nginx.conf | 52 +++++++++++ src/covid19/static/tsconfig.app.json | 19 ++++ src/covid19/static/tsconfig.json | 48 ++++++++++ src/covid19/static/tsconfig.spec.json | 18 ++++ src/covid19/static/tslint.json | 116 ++++++++++++++++++++++++ 11 files changed, 445 insertions(+) create mode 100644 src/covid19/static/.markdownlint.json create mode 100644 src/covid19/static/.prettierrc.json create mode 100644 src/covid19/static/.pug-lintrc.json create mode 100644 src/covid19/static/angular.json create mode 100644 src/covid19/static/browserslist create mode 100644 src/covid19/static/karma.conf.js create mode 100644 src/covid19/static/nginx.conf create mode 100644 src/covid19/static/tsconfig.app.json create mode 100644 src/covid19/static/tsconfig.json create mode 100644 src/covid19/static/tsconfig.spec.json create mode 100644 src/covid19/static/tslint.json diff --git a/src/covid19/static/.markdownlint.json b/src/covid19/static/.markdownlint.json new file mode 100644 index 00000000..c171e76c --- /dev/null +++ b/src/covid19/static/.markdownlint.json @@ -0,0 +1,4 @@ +{ + "no-duplicate-heading": { "siblings_only": true}, + "line-length": { "line_length": 140 } +} diff --git a/src/covid19/static/.prettierrc.json b/src/covid19/static/.prettierrc.json new file mode 100644 index 00000000..399dadf2 --- /dev/null +++ b/src/covid19/static/.prettierrc.json @@ -0,0 +1,19 @@ +{ + "arrowParens": "avoid", + "endOfLine": "lf", + "overrides": [ + { + "files": "*.pug", + "options": { + "attributeSeparator": "always", + "parser": "pug" + } + } + ], + "printWidth": 100, + "proseWrap": "preserve", + "semi": true, + "singleQuote": true, + "tabWidth": 4, + "trailingComma": "es5" +} \ No newline at end of file diff --git a/src/covid19/static/.pug-lintrc.json b/src/covid19/static/.pug-lintrc.json new file mode 100644 index 00000000..9b8960da --- /dev/null +++ b/src/covid19/static/.pug-lintrc.json @@ -0,0 +1,6 @@ +{ + "validateAttributeSeparator": { + "multiLineSeparator": ",\n ", + "separator": ", " + } +} \ No newline at end of file diff --git a/src/covid19/static/angular.json b/src/covid19/static/angular.json new file mode 100644 index 00000000..f0116b78 --- /dev/null +++ b/src/covid19/static/angular.json @@ -0,0 +1,126 @@ +{ + "$schema": "./node_modules/@angular/cli/lib/config/schema.json", + "cli": { + "analytics": "e25388e7-a5bd-458f-8a66-fe724da49322" + }, + "version": 1, + "newProjectRoot": "projects", + "projects": { + "covid19python-thomaswoehlke": { + "projectType": "application", + "schematics": { + "@schematics/angular:component": { + "style": "scss" + } + }, + "root": "", + "sourceRoot": "src", + "prefix": "sb", + "architect": { + "build": { + "builder": "@angular-devkit/build-angular:browser", + "options": { + "outputPath": "dist/covid19python-thomaswoehlke", + "index": "src/index.html", + "main": "src/main.ts", + "polyfills": "src/polyfills.ts", + "tsConfig": "tsconfig.app.json", + "aot": false, + "assets": ["src/favicon.png", "src/assets"], + "styles": ["src/styles/styles.scss"], + "stylePreprocessorOptions": { + "includePaths": ["src", "./node_modules"] + }, + "scripts": [] + }, + "configurations": { + "production": { + "fileReplacements": [ + { + "replace": "src/environments/environment.ts", + "with": "src/environments/environment.prod.ts" + } + ], + "optimization": true, + "outputHashing": "all", + "sourceMap": false, + "namedChunks": false, + "aot": true, + "extractLicenses": true, + "vendorChunk": false, + "buildOptimizer": true, + "budgets": [ + { + "type": "initial", + "maximumWarning": "2mb", + "maximumError": "5mb" + }, + { + "type": "anyComponentStyle", + "maximumWarning": "6kb", + "maximumError": "10kb" + } + ] + } + } + }, + "serve": { + "builder": "@angular-devkit/build-angular:dev-server", + "options": { + "browserTarget": "covid19python-thomaswoehlke:build" + }, + "configurations": { + "production": { + "browserTarget": "covid19python-thomaswoehlke:build:production" + } + } + }, + "extract-i18n": { + "builder": "@angular-devkit/build-angular:extract-i18n", + "options": { + "browserTarget": "covid19python-thomaswoehlke:build" + } + }, + "test": { + "builder": "@angular-devkit/build-angular:karma", + "options": { + "main": "src/test.ts", + "polyfills": "src/polyfills.ts", + "tsConfig": "tsconfig.spec.json", + "karmaConfig": "karma.conf.js", + "assets": ["src/favicon.png", "src/assets"], + "styles": ["src/styles/styles.scss"], + "stylePreprocessorOptions": { + "includePaths": ["src", "./node_modules"] + }, + "scripts": [] + } + }, + "lint": { + "builder": "@angular-devkit/build-angular:tslint", + "options": { + "tsConfig": [ + "tsconfig.app.json", + "tsconfig.spec.json", + "e2e/tsconfig.json" + ], + "exclude": ["**/node_modules/**"] + } + }, + "e2e": { + "builder": "@angular-devkit/build-angular:protractor", + "options": { + "protractorConfig": "e2e/protractor.conf.js", + "devServerTarget": "covid19python-thomaswoehlke:serve" + }, + "configurations": { + "production": { + "devServerTarget": "covid19python-thomaswoehlke:serve:production" + } + } + } + } + } + }, + "defaultProject": "covid19python-thomaswoehlke" +} diff --git a/src/covid19/static/browserslist b/src/covid19/static/browserslist new file mode 100644 index 00000000..6de098d0 --- /dev/null +++ b/src/covid19/static/browserslist @@ -0,0 +1,5 @@ +> 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/src/covid19/static/karma.conf.js b/src/covid19/static/karma.conf.js new file mode 100644 index 00000000..1a64e16d --- /dev/null +++ b/src/covid19/static/karma.conf.js @@ -0,0 +1,32 @@ +// Karma configuration file, see link for more information +// https://karma-runner.github.io/1.0/config/configuration-file.html + +module.exports = function(config) { + config.set({ + basePath: '', + 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-devkit/build-angular/plugins/karma'), + ], + client: { + clearContext: false, // leave Jasmine Spec Runner output visible in browser + }, + coverageIstanbulReporter: { + dir: require('path').join(__dirname, './coverage/sb-admin-angular'), + reports: ['html', 'lcovonly', 'text-summary'], + fixWebpackSourcePaths: true, + }, + reporters: ['progress', 'kjhtml'], + port: 9876, + colors: true, + logLevel: config.LOG_INFO, + autoWatch: true, + browsers: ['Chrome'], + singleRun: false, + restartOnFileChange: true, + }); +}; diff --git a/src/covid19/static/nginx.conf b/src/covid19/static/nginx.conf new file mode 100644 index 00000000..ed1a13ee --- /dev/null +++ b/src/covid19/static/nginx.conf @@ -0,0 +1,52 @@ +user nginx; +worker_processes 1; + +error_log /var/log/nginx/error.log warn; +pid /var/run/nginx.pid; + +events { + worker_connections 1024; +} + +http { + include /etc/nginx/mime.types; + default_type application/octet-stream; + + log_format main '$remote_addr - $remote_user [$time_local] "$request" ' + '$status $body_bytes_sent "$http_referer" ' + '"$http_user_agent" "$http_x_forwarded_for"'; + + access_log /var/log/nginx/access.log main; + + keepalive_timeout 65; + sendfile on; + gzip on; + + server { + listen 80; + server_name localhost; + + add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; + + root /usr/share/nginx/html; + + location /_health { + access_log off; + return 200; + } + + location / { + location ~ / { + add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; + + try_files $uri /index.html =404; + } + } + + error_page 500 502 503 504 /50x.html; + location = /50x.html { + root /usr/share/nginx/html; + } + + } +} diff --git a/src/covid19/static/tsconfig.app.json b/src/covid19/static/tsconfig.app.json new file mode 100644 index 00000000..94709294 --- /dev/null +++ b/src/covid19/static/tsconfig.app.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "outDir": "./out-tsc/app", + "types": [ + ] + }, + "exclude": [ + "src/test.ts", + "src/**/*.spec.ts" + ], + "extends": "./tsconfig.json", + "files": [ + "src/main.ts", + "src/polyfills.ts" + ], + "include": [ + "src/**/*.d.ts" + ] +} \ No newline at end of file diff --git a/src/covid19/static/tsconfig.json b/src/covid19/static/tsconfig.json new file mode 100644 index 00000000..6d677333 --- /dev/null +++ b/src/covid19/static/tsconfig.json @@ -0,0 +1,48 @@ +{ + "angularCompilerOptions": { + "enableIvy": false, + "fullTemplateTypeCheck": true, + "preserveWhitespaces": false, + "strictInjectionParameters": true + }, + "compileOnSave": false, + "compilerOptions": { + "baseUrl": "src", + "declaration": false, + "downlevelIteration": true, + "emitDecoratorMetadata": true, + "esModuleInterop": true, + "experimentalDecorators": true, + "importHelpers": true, + "lib": [ + "es2018", + "dom" + ], + "module": "esnext", + "moduleResolution": "node", + "noImplicitAny": true, + "outDir": "./dist/out-tsc", + "paths": { + "@app/*": [ + "app/*" + ], + "@common/*": [ + "modules/app-common/*" + ], + "@modules/*": [ + "modules/*" + ], + "@testing/*": [ + "testing/*" + ] + }, + "resolveJsonModule": true, + "sourceMap": true, + "strict": true, + "target": "es2015", + "typeRoots": [ + "node_modules/@types", + "src/typings" + ] + } +} \ No newline at end of file diff --git a/src/covid19/static/tsconfig.spec.json b/src/covid19/static/tsconfig.spec.json new file mode 100644 index 00000000..d44af88e --- /dev/null +++ b/src/covid19/static/tsconfig.spec.json @@ -0,0 +1,18 @@ +{ + "compilerOptions": { + "outDir": "./out-tsc/spec", + "types": [ + "jasmine", + "node" + ] + }, + "extends": "./tsconfig.json", + "files": [ + "src/test.ts", + "src/polyfills.ts" + ], + "include": [ + "src/**/*.spec.ts", + "src/**/*.d.ts" + ] +} \ No newline at end of file diff --git a/src/covid19/static/tslint.json b/src/covid19/static/tslint.json new file mode 100644 index 00000000..0bcf68d1 --- /dev/null +++ b/src/covid19/static/tslint.json @@ -0,0 +1,116 @@ +{ + "extends": [ + "tslint:recommended", + "tslint-plugin-prettier" + ], + "rules": { + "array-type": false, + "arrow-parens": false, + "component-class-suffix": true, + "component-selector": [ + true, + "element", + [ + "app", + "sb" + ], + "kebab-case" + ], + "contextual-lifecycle": true, + "deprecation": { + "severity": "warning" + }, + "directive-class-suffix": true, + "directive-selector": [ + true, + "attribute", + [ + "app", + "sb" + ], + "camelCase" + ], + "import-blacklist": [ + true, + "rxjs/Rx" + ], + "interface-name": false, + "max-classes-per-file": false, + "max-line-length": [ + true, + 140 + ], + "member-access": false, + "member-ordering": [ + true, + { + "order": [ + "static-field", + "instance-field", + "static-method", + "instance-method" + ] + } + ], + "no-angle-bracket-type-assertion": true, + "no-conflicting-lifecycle": true, + "no-consecutive-blank-lines": false, + "no-console": [ + true, + "debug", + "info", + "time", + "timeEnd", + "trace" + ], + "no-duplicate-imports": true, + "no-empty": false, + "no-host-metadata-property": true, + "no-inferrable-types": [ + true, + "ignore-params" + ], + "no-input-rename": true, + "no-inputs-metadata-property": true, + "no-non-null-assertion": true, + "no-output-native": true, + "no-output-on-prefix": true, + "no-output-rename": true, + "no-outputs-metadata-property": true, + "no-redundant-jsdoc": true, + "no-switch-case-fall-through": true, + "no-var-requires": false, + "object-literal-key-quotes": [ + true, + "as-needed" + ], + "object-literal-sort-keys": false, + "ordered-imports": [ + true, + { + "grouped-imports": true + } + ], + "prettier": true, + "quotemark": [ + true, + "single" + ], + "template-banana-in-box": true, + "template-no-negated-async": true, + "trailing-comma": false, + "use-lifecycle-interface": true, + "use-pipe-transform-interface": true, + "variable-name": { + "options": [ + "ban-keywords", + "check-format", + "allow-leading-underscore", + "allow-pascal-case" + ] + } + }, + "rulesDirectory": [ + "codelyzer" + ] +} \ No newline at end of file -- GitLab