Browse Source

Update to Angular 6 (#1)

tags/v1.3.0
Manuel Friedli 1 year ago
parent
commit
23ca1ee444
24 changed files with 11095 additions and 6655 deletions
  1. 0
    57
      .angular-cli.json
  2. 0
    78
      .gitlab-ci.yml
  3. 3
    4
      README.md
  4. 127
    0
      angular.json
  5. 0
    0
      e2e/src/app.e2e-spec.ts
  6. 0
    0
      e2e/src/app.po.ts
  7. 3
    2
      e2e/tsconfig.e2e.json
  8. 0
    48
      karma.conf.js
  9. 10787
    0
      package-lock.json
  10. 29
    31
      package.json
  11. 0
    34
      protractor.conf.js
  12. 11
    0
      src/browserslist
  13. 11
    4
      src/environments/environment.ts
  14. 31
    0
      src/karma.conf.js
  15. 6
    5
      src/main.ts
  16. 32
    12
      src/polyfills.ts
  17. 6
    16
      src/test.ts
  18. 0
    2
      src/tsconfig.app.json
  19. 2
    4
      src/tsconfig.spec.json
  20. 17
    0
      src/tslint.json
  21. 0
    5
      src/typings.d.ts
  22. 3
    2
      tsconfig.json
  23. 27
    13
      tslint.json
  24. 0
    6338
      yarn.lock

+ 0
- 57
.angular-cli.json View File

@@ -1,57 +0,0 @@
1
-{
2
-  "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3
-  "project": {
4
-    "name": "convertorizr"
5
-  },
6
-  "apps": [
7
-    {
8
-      "root": "src",
9
-      "outDir": "dist",
10
-      "assets": [
11
-        "assets",
12
-        "favicon.ico"
13
-      ],
14
-      "index": "index.html",
15
-      "main": "main.ts",
16
-      "polyfills": "polyfills.ts",
17
-      "test": "test.ts",
18
-      "tsconfig": "tsconfig.app.json",
19
-      "testTsconfig": "tsconfig.spec.json",
20
-      "prefix": "app",
21
-      "styles": [
22
-        "styles.scss"
23
-      ],
24
-      "scripts": [],
25
-      "environmentSource": "environments/environment.ts",
26
-      "environments": {
27
-        "dev": "environments/environment.ts",
28
-        "prod": "environments/environment.prod.ts"
29
-      }
30
-    }
31
-  ],
32
-  "e2e": {
33
-    "protractor": {
34
-      "config": "./protractor.conf.js"
35
-    }
36
-  },
37
-  "lint": [
38
-    {
39
-      "project": "src/tsconfig.app.json"
40
-    },
41
-    {
42
-      "project": "src/tsconfig.spec.json"
43
-    },
44
-    {
45
-      "project": "e2e/tsconfig.e2e.json"
46
-    }
47
-  ],
48
-  "test": {
49
-    "karma": {
50
-      "config": "./karma.conf.js"
51
-    }
52
-  },
53
-  "defaults": {
54
-    "styleExt": "scss",
55
-    "component": {}
56
-  }
57
-}

+ 0
- 78
.gitlab-ci.yml View File

@@ -1,78 +0,0 @@
1
-stages:
2
-  - build
3
-  - cleanup_build
4
-  - deploy
5
-  - cleanup
6
-
7
-#build_job:
8
-#  stage: build
9
-#  script:
10
-#    - yarn install
11
-#    - yarn run build
12
-#    - yarn run lint
13
-#    - yarn run test
14
-#    - yarn run e2e
15
-#  tags:
16
-#    - javascript
17
-#  except:
18
-#    - tags
19
-#    - master
20
-#  artifacts:
21
-#    paths:
22
-#      - dist
23
-#    expire_in: 30 min
24
-
25
-build_job_production:
26
-  stage: build
27
-  script:
28
-    - yarn install
29
-    - yarn run build-prod
30
-    - yarn run lint
31
-#    - yarn run test
32
-#    - yarn run e2e
33
-  tags:
34
-    - javascript
35
-#  only:
36
-#    - master
37
-  artifacts:
38
-    paths:
39
-      - dist
40
-    expire_in: 30 min
41
-
42
-cleanup_build_job:
43
-  stage: cleanup_build
44
-  script:
45
-    - rm -rf node_modules
46
-    - rm -rf dist
47
-  when: on_failure
48
-
49
-pages:
50
-  stage: deploy
51
-  environment: staging
52
-  except:
53
-    - tags
54
-    - master
55
-  script:
56
-    - mv dist public
57
-  artifacts:
58
-    paths:
59
-      - public
60
-  dependencies:
61
-    - build_job_production
62
-
63
-production:
64
-  stage: deploy
65
-  environment: production
66
-  only:
67
-    - master
68
-  script:
69
-    - if [[ -z "${WWW_DEPLOY_ROOT_PRODUCTION}" ]] ; then echo "WWW_DEPLOY_ROOT_PRODUCTION is not set" ; exit 1 ; fi
70
-    - if [[ ! -d "${WWW_DEPLOY_ROOT_PRODUCTION}" ]] ; then mkdir -p "${WWW_DEPLOY_ROOT_PRODUCTION}" || die "Failed to create target directory for deployment!" ; fi
71
-    - rm -rf "${WWW_DEPLOY_ROOT_PRODUCTION}"/* || die "Failed to clean old deployment"
72
-    - cp -r dist/* "${WWW_DEPLOY_ROOT_PRODUCTION}"
73
-
74
-cleanup_job:
75
-  stage: cleanup
76
-  script:
77
-    - rm -rf node_modules
78
-  when: always

+ 3
- 4
README.md View File

@@ -10,7 +10,7 @@ Cheers!
10 10
 
11 11
 # Technical stuff
12 12
 
13
-This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 1.0.0.
13
+This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 6.1.5.
14 14
 
15 15
 ## Development server
16 16
 
@@ -18,11 +18,11 @@ Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app w
18 18
 
19 19
 ## Code scaffolding
20 20
 
21
-Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive/pipe/service/class/module`.
21
+Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.
22 22
 
23 23
 ## Build
24 24
 
25
-Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `-prod` flag for a production build.
25
+Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `--prod` flag for a production build.
26 26
 
27 27
 ## Running unit tests
28 28
 
@@ -31,7 +31,6 @@ Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.
31 31
 ## Running end-to-end tests
32 32
 
33 33
 Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).
34
-Before running the tests make sure you are serving the app via `ng serve`.
35 34
 
36 35
 ## Further help
37 36
 

+ 127
- 0
angular.json View File

@@ -0,0 +1,127 @@
1
+{
2
+  "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3
+  "version": 1,
4
+  "newProjectRoot": "projects",
5
+  "projects": {
6
+    "converter": {
7
+      "root": "",
8
+      "sourceRoot": "src",
9
+      "projectType": "application",
10
+      "prefix": "app",
11
+      "schematics": {},
12
+      "architect": {
13
+        "build": {
14
+          "builder": "@angular-devkit/build-angular:browser",
15
+          "options": {
16
+            "outputPath": "dist/converter",
17
+            "index": "src/index.html",
18
+            "main": "src/main.ts",
19
+            "polyfills": "src/polyfills.ts",
20
+            "tsConfig": "src/tsconfig.app.json",
21
+            "assets": [
22
+              "src/favicon.ico",
23
+              "src/assets"
24
+            ],
25
+            "styles": [
26
+              "src/styles.scss"
27
+            ],
28
+            "scripts": []
29
+          },
30
+          "configurations": {
31
+            "production": {
32
+              "fileReplacements": [
33
+                {
34
+                  "replace": "src/environments/environment.ts",
35
+                  "with": "src/environments/environment.prod.ts"
36
+                }
37
+              ],
38
+              "optimization": true,
39
+              "outputHashing": "all",
40
+              "sourceMap": false,
41
+              "extractCss": true,
42
+              "namedChunks": false,
43
+              "aot": true,
44
+              "extractLicenses": true,
45
+              "vendorChunk": false,
46
+              "buildOptimizer": true
47
+            }
48
+          }
49
+        },
50
+        "serve": {
51
+          "builder": "@angular-devkit/build-angular:dev-server",
52
+          "options": {
53
+            "browserTarget": "converter:build"
54
+          },
55
+          "configurations": {
56
+            "production": {
57
+              "browserTarget": "converter:build:production"
58
+            }
59
+          }
60
+        },
61
+        "extract-i18n": {
62
+          "builder": "@angular-devkit/build-angular:extract-i18n",
63
+          "options": {
64
+            "browserTarget": "converter:build"
65
+          }
66
+        },
67
+        "test": {
68
+          "builder": "@angular-devkit/build-angular:karma",
69
+          "options": {
70
+            "main": "src/test.ts",
71
+            "polyfills": "src/polyfills.ts",
72
+            "tsConfig": "src/tsconfig.spec.json",
73
+            "karmaConfig": "src/karma.conf.js",
74
+            "styles": [
75
+              "src/styles.scss"
76
+            ],
77
+            "scripts": [],
78
+            "assets": [
79
+              "src/favicon.ico",
80
+              "src/assets"
81
+            ]
82
+          }
83
+        },
84
+        "lint": {
85
+          "builder": "@angular-devkit/build-angular:tslint",
86
+          "options": {
87
+            "tsConfig": [
88
+              "src/tsconfig.app.json",
89
+              "src/tsconfig.spec.json"
90
+            ],
91
+            "exclude": [
92
+              "**/node_modules/**"
93
+            ]
94
+          }
95
+        }
96
+      }
97
+    },
98
+    "converter-e2e": {
99
+      "root": "e2e/",
100
+      "projectType": "application",
101
+      "architect": {
102
+        "e2e": {
103
+          "builder": "@angular-devkit/build-angular:protractor",
104
+          "options": {
105
+            "protractorConfig": "e2e/protractor.conf.js",
106
+            "devServerTarget": "converter:serve"
107
+          },
108
+          "configurations": {
109
+            "production": {
110
+              "devServerTarget": "converter:serve:production"
111
+            }
112
+          }
113
+        },
114
+        "lint": {
115
+          "builder": "@angular-devkit/build-angular:tslint",
116
+          "options": {
117
+            "tsConfig": "e2e/tsconfig.e2e.json",
118
+            "exclude": [
119
+              "**/node_modules/**"
120
+            ]
121
+          }
122
+        }
123
+      }
124
+    }
125
+  },
126
+  "defaultProject": "converter"
127
+}

e2e/app.e2e-spec.ts → e2e/src/app.e2e-spec.ts View File


e2e/app.po.ts → e2e/src/app.po.ts View File


+ 3
- 2
e2e/tsconfig.e2e.json View File

@@ -1,11 +1,12 @@
1 1
 {
2 2
   "extends": "../tsconfig.json",
3 3
   "compilerOptions": {
4
-    "outDir": "../out-tsc/e2e",
4
+    "outDir": "../out-tsc/app",
5 5
     "module": "commonjs",
6 6
     "target": "es5",
7
-    "types":[
7
+    "types": [
8 8
       "jasmine",
9
+      "jasminewd2",
9 10
       "node"
10 11
     ]
11 12
   }

+ 0
- 48
karma.conf.js View File

@@ -1,48 +0,0 @@
1
-// Karma configuration file, see link for more information
2
-// https://karma-runner.github.io/0.13/config/configuration-file.html
3
-
4
-module.exports = function (config) {
5
-  config.set({
6
-    basePath: '',
7
-    frameworks: ['jasmine', '@angular/cli'],
8
-    plugins: [
9
-      require('karma-jasmine'),
10
-      require('karma-nightmare'),
11
-      require('karma-jasmine-html-reporter'),
12
-      require('karma-coverage-istanbul-reporter'),
13
-      require('@angular/cli/plugins/karma')
14
-    ],
15
-    client: {
16
-      captureConsole: true,
17
-      clearContext: false // leave Jasmine Spec Runner output visible in browser
18
-    },
19
-    files: [
20
-      {
21
-        pattern: './src/test.ts',
22
-        watched: false
23
-      }
24
-    ],
25
-    preprocessors: {
26
-      './src/test.ts': ['@angular/cli']
27
-    },
28
-    mime: {
29
-      'text/x-typescript': ['ts', 'tsx']
30
-    },
31
-    coverageIstanbulReporter: {
32
-      reports: ['html', 'lcovonly'],
33
-      fixWebpackSourcePaths: true
34
-    },
35
-    angularCli: {
36
-      environment: 'dev'
37
-    },
38
-    reporters: config.angularCli && config.angularCli.codeCoverage
39
-      ? ['progress', 'coverage-istanbul']
40
-      : ['progress', 'kjhtml'],
41
-    port: 9876,
42
-    colors: true,
43
-    logLevel: config.LOG_INFO,
44
-    autoWatch: true,
45
-    browsers: ['Nightmare'],
46
-    singleRun: false
47
-  });
48
-};

+ 10787
- 0
package-lock.json
File diff suppressed because it is too large
View File


+ 29
- 31
package.json View File

@@ -1,6 +1,6 @@
1 1
 {
2 2
   "name": "convertorizr",
3
-  "version": "1.2.2-dev",
3
+  "version": "1.3.0-dev",
4 4
   "description": "Decode or encode base64, punycode, HTML entities, URI components, ...",
5 5
   "keywords": [
6 6
     "encode",
@@ -17,13 +17,13 @@
17 17
   "homepage": "https://manuel.pages.gittr.ch/dencode.org",
18 18
   "repository": {
19 19
     "type": "git",
20
-    "url": "https://gittr.ch/manuel/dencode.org.git"
20
+    "url": "https://gittr.ch/manuel/converter.git"
21 21
   },
22 22
   "scripts": {
23 23
     "ng": "ng",
24 24
     "start": "ng serve",
25 25
     "build": "ng build --delete-output-path",
26
-    "build-prod": "ng build -prod -e prod --aot --delete-output-path --build-optimizer",
26
+    "build-prod": "ng build --prod --optimization --aot --delete-output-path --build-optimizer",
27 27
     "test": "ng test --single-run",
28 28
     "test-continuous": "ng test",
29 29
     "lint": "ng lint",
@@ -32,40 +32,38 @@
32 32
   },
33 33
   "private": true,
34 34
   "dependencies": {
35
-    "@angular/common": "^5.0.0",
36
-    "@angular/compiler": "^5.0.0",
37
-    "@angular/core": "^5.0.0",
38
-    "@angular/forms": "^5.0.0",
39
-    "@angular/platform-browser": "^5.0.0",
40
-    "@angular/platform-browser-dynamic": "^5.0.0",
41
-    "@angular/router": "^5.0.0",
35
+    "@angular/common": "6.1.6",
36
+    "@angular/compiler": "6.1.6",
37
+    "@angular/core": "6.1.6",
38
+    "@angular/forms": "6.1.6",
39
+    "@angular/platform-browser": "6.1.6",
40
+    "@angular/platform-browser-dynamic": "6.1.6",
41
+    "@angular/router": "6.1.6",
42 42
     "core-js": "^2.5.1",
43 43
     "punycode": "^2.1.0",
44 44
     "quoted-printable": "^1.0.0",
45
-    "rxjs": "^5.5.2",
45
+    "rxjs": "^6.3.0",
46 46
     "utf8": "^2.1.0",
47
-    "zone.js": "^0.8.18"
47
+    "zone.js": "^0.8.26"
48 48
   },
49 49
   "devDependencies": {
50
-    "@angular/cli": "^1.5.0",
51
-    "@angular/compiler-cli": "^5.0.0",
52
-    "@types/jasmine": "^2.5.38",
53
-    "@types/node": "^8.0.50",
54
-    "codelyzer": "^4.0.1",
55
-    "jasmine-core": "^2.5.2",
56
-    "jasmine-spec-reporter": "^4.0.0",
57
-    "karma": "^1.4.1",
58
-    "karma-chrome-launcher": "^2.0.0",
59
-    "karma-cli": "^1.0.1",
60
-    "karma-coverage-istanbul-reporter": "^1.2.0",
61
-    "karma-jasmine": "^1.1.0",
50
+    "@angular-devkit/build-angular": "~0.7.0",
51
+    "@angular/cli": "6.1.5",
52
+    "@angular/compiler-cli": "6.1.6",
53
+    "@types/jasmine": "~2.8.6",
54
+    "@types/jasminewd2": "~2.0.3",
55
+    "@types/node": "~8.9.4",
56
+    "codelyzer": "~4.2.1",
57
+    "jasmine-core": "~2.99.1",
58
+    "jasmine-spec-reporter": "~4.2.1",
59
+    "karma": "~1.7.1",
60
+    "karma-chrome-launcher": "~2.2.0",
61
+    "karma-coverage-istanbul-reporter": "~2.0.0",
62
+    "karma-jasmine": "~1.1.1",
62 63
     "karma-jasmine-html-reporter": "^0.2.2",
63
-    "karma-nightmare": "^0.4.9",
64
-    "nightmare": "^2.10.0",
65
-    "protractor": "^5.1.0",
66
-    "protractor-console": "^3.0.0",
67
-    "ts-node": "^3.0.0",
68
-    "tslint": "^5.0.0",
69
-    "typescript": "^2.2.0"
64
+    "protractor": "~5.4.0",
65
+    "ts-node": "~5.0.1",
66
+    "tslint": "~5.9.1",
67
+    "typescript": "2.9.2"
70 68
   }
71 69
 }

+ 0
- 34
protractor.conf.js View File

@@ -1,34 +0,0 @@
1
-// Protractor configuration file, see link for more information
2
-// https://github.com/angular/protractor/blob/master/lib/config.ts
3
-
4
-const {SpecReporter} = require('jasmine-spec-reporter');
5
-
6
-exports.config = {
7
-  allScriptsTimeout: 11000,
8
-  specs: [
9
-    './e2e/**/*.e2e-spec.ts'
10
-  ],
11
-  capabilities: {
12
-    'browserName': 'chrome'
13
-  },
14
-  directConnect: true,
15
-  baseUrl: 'http://localhost:4200/',
16
-  framework: 'jasmine',
17
-  jasmineNodeOpts: {
18
-    showColors: true,
19
-    defaultTimeoutInterval: 30000,
20
-    print: function() {}
21
-  },
22
-  beforeLaunch: function() {
23
-    require('ts-node').register({
24
-      project: 'e2e/tsconfig.e2e.json'
25
-    });
26
-  },
27
-  onPrepare() {
28
-    jasmine.getEnv().addReporter(new SpecReporter({spec: {displayStacktrace: true}}));
29
-  },
30
-  plugins: [{
31
-    package: 'protractor-console',
32
-    logLevels: ['debug', 'info', 'warning', 'severe']
33
-  }]
34
-};

+ 11
- 0
src/browserslist View File

@@ -0,0 +1,11 @@
1
+# This file is currently used by autoprefixer to adjust CSS to support the below specified browsers
2
+# For additional information regarding the format and rule options, please see:
3
+# https://github.com/browserslist/browserslist#queries
4
+#
5
+# For IE 9-11 support, please remove 'not' from the last line of the file and adjust as needed
6
+
7
+> 0.5%
8
+last 2 versions
9
+Firefox ESR
10
+not dead
11
+not IE 9-11

+ 11
- 4
src/environments/environment.ts View File

@@ -1,8 +1,15 @@
1
-// The file contents for the current environment will overwrite these during build.
2
-// The build system defaults to the dev environment which uses `environment.ts`, but if you do
3
-// `ng build --env=prod` then `environment.prod.ts` will be used instead.
4
-// The list of which env maps to which file can be found in `.angular-cli.json`.
1
+// This file can be replaced during build by using the `fileReplacements` array.
2
+// `ng build ---prod` replaces `environment.ts` with `environment.prod.ts`.
3
+// The list of file replacements can be found in `angular.json`.
5 4
 
6 5
 export const environment = {
7 6
   production: false
8 7
 };
8
+
9
+/*
10
+ * In development mode, for easier debugging, you can ignore zone related error
11
+ * stack frames such as `zone.run`/`zoneDelegate.invokeTask` by importing the
12
+ * below file. Don't forget to comment it out in production mode
13
+ * because it will have a performance impact when errors are thrown
14
+ */
15
+// import 'zone.js/dist/zone-error';  // Included with Angular CLI.

+ 31
- 0
src/karma.conf.js View File

@@ -0,0 +1,31 @@
1
+// Karma configuration file, see link for more information
2
+// https://karma-runner.github.io/1.0/config/configuration-file.html
3
+
4
+module.exports = function (config) {
5
+  config.set({
6
+    basePath: '',
7
+    frameworks: ['jasmine', '@angular-devkit/build-angular'],
8
+    plugins: [
9
+      require('karma-jasmine'),
10
+      require('karma-chrome-launcher'),
11
+      require('karma-jasmine-html-reporter'),
12
+      require('karma-coverage-istanbul-reporter'),
13
+      require('@angular-devkit/build-angular/plugins/karma')
14
+    ],
15
+    client: {
16
+      clearContext: false // leave Jasmine Spec Runner output visible in browser
17
+    },
18
+    coverageIstanbulReporter: {
19
+      dir: require('path').join(__dirname, '../coverage'),
20
+      reports: ['html', 'lcovonly'],
21
+      fixWebpackSourcePaths: true
22
+    },
23
+    reporters: ['progress', 'kjhtml'],
24
+    port: 9876,
25
+    colors: true,
26
+    logLevel: config.LOG_INFO,
27
+    autoWatch: true,
28
+    browsers: ['Chrome'],
29
+    singleRun: false
30
+  });
31
+};

+ 6
- 5
src/main.ts View File

@@ -1,11 +1,12 @@
1
-import {enableProdMode} from '@angular/core';
2
-import {platformBrowserDynamic} from '@angular/platform-browser-dynamic';
1
+import { enableProdMode } from '@angular/core';
2
+import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
3 3
 
4
-import {AppModule} from './app/app.module';
5
-import {environment} from './environments/environment';
4
+import { AppModule } from './app/app.module';
5
+import { environment } from './environments/environment';
6 6
 
7 7
 if (environment.production) {
8 8
   enableProdMode();
9 9
 }
10 10
 
11
-platformBrowserDynamic().bootstrapModule(AppModule);
11
+platformBrowserDynamic().bootstrapModule(AppModule)
12
+  .catch(err => console.log(err));

+ 32
- 12
src/polyfills.ts View File

@@ -13,9 +13,11 @@
13 13
  *
14 14
  * Learn more in https://angular.io/docs/ts/latest/guide/browser-support.html
15 15
  */
16
+
16 17
 /***************************************************************************************************
17 18
  * BROWSER POLYFILLS
18 19
  */
20
+
19 21
 /** IE9, IE10 and IE11 requires all of the following polyfills. **/
20 22
 // import 'core-js/es6/symbol';
21 23
 // import 'core-js/es6/object';
@@ -29,28 +31,46 @@
29 31
 // import 'core-js/es6/array';
30 32
 // import 'core-js/es6/regexp';
31 33
 // import 'core-js/es6/map';
34
+// import 'core-js/es6/weak-map';
32 35
 // import 'core-js/es6/set';
36
+
33 37
 /** IE10 and IE11 requires the following for NgClass support on SVG elements */
34 38
 // import 'classlist.js';  // Run `npm install --save classlist.js`.
35
-/** IE10 and IE11 requires the following to support `@angular/animation`. */
36
-// import 'web-animations-js';  // Run `npm install --save web-animations-js`.
37
-/** Evergreen browsers require these. **/
39
+
40
+/** IE10 and IE11 requires the following for the Reflect API. */
38 41
 import 'core-js/es6/reflect';
42
+/** Evergreen browsers require these. **/
43
+// Used for reflect-metadata in JIT. If you use AOT (and only Angular decorators), you can remove.
39 44
 import 'core-js/es7/reflect';
40
-/** ALL Firefox browsers require the following to support `@angular/animation`. **/
41
-// import 'web-animations-js';  // Run `npm install --save web-animations-js`.
42 45
 /***************************************************************************************************
43
- * Zone JS is required by Angular itself.
46
+ * Zone JS is required by default for Angular itself.
44 47
  */
45 48
 import 'zone.js/dist/zone'; // Included with Angular CLI.
46 49
 
47 50
 
48
-/***************************************************************************************************
49
- * APPLICATION IMPORTS
50
- */
51
+/**
52
+ * Web Animations `@angular/platform-browser/animations`
53
+ * Only required if AnimationBuilder is used within the application and using IE/Edge or Safari.
54
+ * Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0).
55
+ **/
56
+// import 'web-animations-js';  // Run `npm install --save web-animations-js`.
51 57
 
52 58
 /**
53
- * Date, currency, decimal and percent pipes.
54
- * Needed for: All but Chrome, Firefox, Edge, IE11 and Safari 10
59
+ * By default, zone.js will patch all possible macroTask and DomEvents
60
+ * user can disable parts of macroTask/DomEvents patch by setting following flags
61
+ */
62
+
63
+// (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame
64
+// (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick
65
+// (window as any).__zone_symbol__BLACK_LISTED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames
66
+
67
+/*
68
+* in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js
69
+* with the following flag, it will bypass `zone.js` patch for IE/Edge
70
+*/
71
+// (window as any).__Zone_enable_cross_context_check = true;
72
+
73
+
74
+/***************************************************************************************************
75
+ * APPLICATION IMPORTS
55 76
  */
56
-// import 'intl';  // Run `npm install --save intl`.

+ 6
- 16
src/test.ts View File

@@ -1,22 +1,14 @@
1 1
 // This file is required by karma.conf.js and loads recursively all the .spec and framework files
2 2
 
3
-import 'zone.js/dist/long-stack-trace-zone';
4
-import 'zone.js/dist/proxy.js';
5
-import 'zone.js/dist/sync-test';
6
-import 'zone.js/dist/jasmine-patch';
7
-import 'zone.js/dist/async-test';
8
-import 'zone.js/dist/fake-async-test';
9
-import {getTestBed} from '@angular/core/testing';
10
-import {BrowserDynamicTestingModule, platformBrowserDynamicTesting} from '@angular/platform-browser-dynamic/testing';
3
+import 'zone.js/dist/zone-testing';
4
+import { getTestBed } from '@angular/core/testing';
5
+import {
6
+  BrowserDynamicTestingModule,
7
+  platformBrowserDynamicTesting
8
+} from '@angular/platform-browser-dynamic/testing';
11 9
 
12
-// Unfortunately there's no typing for the `__karma__` variable. Just declare it as any.
13
-declare const __karma__: any;
14 10
 declare const require: any;
15 11
 
16
-// Prevent Karma from running prematurely.
17
-__karma__.loaded = function () {
18
-};
19
-
20 12
 // First, initialize the Angular testing environment.
21 13
 getTestBed().initTestEnvironment(
22 14
   BrowserDynamicTestingModule,
@@ -26,5 +18,3 @@ getTestBed().initTestEnvironment(
26 18
 const context = require.context('./', true, /\.spec\.ts$/);
27 19
 // And load the modules.
28 20
 context.keys().map(context);
29
-// Finally, start Karma to run the tests.
30
-__karma__.start();

+ 0
- 2
src/tsconfig.app.json View File

@@ -2,8 +2,6 @@
2 2
   "extends": "../tsconfig.json",
3 3
   "compilerOptions": {
4 4
     "outDir": "../out-tsc/app",
5
-    "module": "es2015",
6
-    "baseUrl": "",
7 5
     "types": []
8 6
   },
9 7
   "exclude": [

+ 2
- 4
src/tsconfig.spec.json View File

@@ -2,16 +2,14 @@
2 2
   "extends": "../tsconfig.json",
3 3
   "compilerOptions": {
4 4
     "outDir": "../out-tsc/spec",
5
-    "module": "commonjs",
6
-    "target": "es5",
7
-    "baseUrl": "",
8 5
     "types": [
9 6
       "jasmine",
10 7
       "node"
11 8
     ]
12 9
   },
13 10
   "files": [
14
-    "test.ts"
11
+    "test.ts",
12
+    "polyfills.ts"
15 13
   ],
16 14
   "include": [
17 15
     "**/*.spec.ts",

+ 17
- 0
src/tslint.json View File

@@ -0,0 +1,17 @@
1
+{
2
+    "extends": "../tslint.json",
3
+    "rules": {
4
+        "directive-selector": [
5
+            true,
6
+            "attribute",
7
+            "app",
8
+            "camelCase"
9
+        ],
10
+        "component-selector": [
11
+            true,
12
+            "element",
13
+            "app",
14
+            "kebab-case"
15
+        ]
16
+    }
17
+}

+ 0
- 5
src/typings.d.ts View File

@@ -1,5 +0,0 @@
1
-/* SystemJS module definition */
2
-declare var module: NodeModule;
3
-interface NodeModule {
4
-  id: string;
5
-}

+ 3
- 2
tsconfig.json View File

@@ -1,10 +1,11 @@
1 1
 {
2 2
   "compileOnSave": false,
3 3
   "compilerOptions": {
4
+    "baseUrl": "./",
4 5
     "outDir": "./dist/out-tsc",
5
-    "baseUrl": "src",
6 6
     "sourceMap": true,
7 7
     "declaration": false,
8
+    "module": "es2015",
8 9
     "moduleResolution": "node",
9 10
     "emitDecoratorMetadata": true,
10 11
     "experimentalDecorators": true,
@@ -13,7 +14,7 @@
13 14
       "node_modules/@types"
14 15
     ],
15 16
     "lib": [
16
-      "es2016",
17
+      "es2017",
17 18
       "dom"
18 19
     ]
19 20
   }

+ 27
- 13
tslint.json View File

@@ -3,6 +3,7 @@
3 3
     "node_modules/codelyzer"
4 4
   ],
5 5
   "rules": {
6
+    "arrow-return-shorthand": true,
6 7
     "callable-types": true,
7 8
     "class-name": true,
8 9
     "comment-format": [
@@ -10,9 +11,15 @@
10 11
       "check-space"
11 12
     ],
12 13
     "curly": true,
14
+    "deprecation": {
15
+      "severity": "warn"
16
+    },
13 17
     "eofline": true,
14 18
     "forin": true,
15
-    "import-blacklist": [true, "rxjs"],
19
+    "import-blacklist": [
20
+      true,
21
+      "rxjs/Rx"
22
+    ],
16 23
     "import-spacing": true,
17 24
     "indent": [
18 25
       true,
@@ -27,8 +34,14 @@
27 34
     "member-access": false,
28 35
     "member-ordering": [
29 36
       true,
30
-      "static-before-instance",
31
-      "variables-before-functions"
37
+      {
38
+        "order": [
39
+          "static-field",
40
+          "instance-field",
41
+          "static-method",
42
+          "instance-method"
43
+        ]
44
+      }
32 45
     ],
33 46
     "no-arg": true,
34 47
     "no-bitwise": true,
@@ -42,16 +55,22 @@
42 55
     ],
43 56
     "no-construct": true,
44 57
     "no-debugger": true,
45
-    "no-duplicate-variable": true,
58
+    "no-duplicate-super": true,
46 59
     "no-empty": false,
47 60
     "no-empty-interface": true,
48 61
     "no-eval": true,
49
-    "no-inferrable-types": [true, "ignore-params"],
62
+    "no-inferrable-types": [
63
+      true,
64
+      "ignore-params"
65
+    ],
66
+    "no-misused-new": true,
67
+    "no-non-null-assertion": true,
50 68
     "no-shadowed-variable": true,
51 69
     "no-string-literal": false,
52 70
     "no-string-throw": true,
53 71
     "no-switch-case-fall-through": true,
54 72
     "no-trailing-whitespace": true,
73
+    "no-unnecessary-initializer": true,
55 74
     "no-unused-expression": true,
56 75
     "no-use-before-declare": true,
57 76
     "no-var-keyword": true,
@@ -70,6 +89,7 @@
70 89
     ],
71 90
     "radix": true,
72 91
     "semicolon": [
92
+      true,
73 93
       "always"
74 94
     ],
75 95
     "triple-equals": [
@@ -86,7 +106,6 @@
86 106
         "variable-declaration": "nospace"
87 107
       }
88 108
     ],
89
-    "typeof-compare": true,
90 109
     "unified-signatures": true,
91 110
     "variable-name": false,
92 111
     "whitespace": [
@@ -97,9 +116,7 @@
97 116
       "check-separator",
98 117
       "check-type"
99 118
     ],
100
-
101
-    "directive-selector": [true, "attribute", "app", "camelCase"],
102
-    "component-selector": [true, "element", "app", "kebab-case"],
119
+    "no-output-on-prefix": true,
103 120
     "use-input-property-decorator": true,
104 121
     "use-output-property-decorator": true,
105 122
     "use-host-property-decorator": true,
@@ -108,9 +125,6 @@
108 125
     "use-life-cycle-interface": true,
109 126
     "use-pipe-transform-interface": true,
110 127
     "component-class-suffix": true,
111
-    "directive-class-suffix": true,
112
-    "no-access-missing-member": true,
113
-    "templates-use-public": true,
114
-    "invoke-injectable": true
128
+    "directive-class-suffix": true
115 129
   }
116 130
 }

+ 0
- 6338
yarn.lock
File diff suppressed because it is too large
View File


Loading…
Cancel
Save