浏览代码

initial commit

kroenen 6 年前
当前提交
4bcbc2b369

+ 13
- 0
.editorconfig 查看文件

@@ -0,0 +1,13 @@
1
+# Editor configuration, see http://editorconfig.org
2
+root = true
3
+
4
+[*]
5
+charset = utf-8
6
+indent_style = space
7
+indent_size = 2
8
+insert_final_newline = true
9
+trim_trailing_whitespace = true
10
+
11
+[*.md]
12
+max_line_length = off
13
+trim_trailing_whitespace = false

+ 39
- 0
.gitignore 查看文件

@@ -0,0 +1,39 @@
1
+# See http://help.github.com/ignore-files/ for more about ignoring files.
2
+
3
+# compiled output
4
+/dist
5
+/tmp
6
+/out-tsc
7
+
8
+# dependencies
9
+/node_modules
10
+
11
+# IDEs and editors
12
+/.idea
13
+.project
14
+.classpath
15
+.c9/
16
+*.launch
17
+.settings/
18
+*.sublime-workspace
19
+
20
+# IDE - VSCode
21
+.vscode/*
22
+!.vscode/settings.json
23
+!.vscode/tasks.json
24
+!.vscode/launch.json
25
+!.vscode/extensions.json
26
+
27
+# misc
28
+/.sass-cache
29
+/connect.lock
30
+/coverage
31
+/libpeerconnection.log
32
+npm-debug.log
33
+yarn-error.log
34
+testem.log
35
+/typings
36
+
37
+# System Files
38
+.DS_Store
39
+Thumbs.db

+ 27
- 0
README.md 查看文件

@@ -0,0 +1,27 @@
1
+# Angutron
2
+
3
+This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 6.2.3.
4
+
5
+## Development server
6
+
7
+Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
8
+
9
+## Code scaffolding
10
+
11
+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`.
12
+
13
+## Build
14
+
15
+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.
16
+
17
+## Running unit tests
18
+
19
+Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
20
+
21
+## Running end-to-end tests
22
+
23
+Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).
24
+
25
+## Further help
26
+
27
+To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).

+ 150
- 0
angular.json 查看文件

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

+ 28
- 0
e2e/protractor.conf.js 查看文件

@@ -0,0 +1,28 @@
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
+    './src/**/*.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
+  onPrepare() {
23
+    require('ts-node').register({
24
+      project: require('path').join(__dirname, './tsconfig.e2e.json')
25
+    });
26
+    jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
27
+  }
28
+};

+ 14
- 0
e2e/src/app.e2e-spec.ts 查看文件

@@ -0,0 +1,14 @@
1
+import { AppPage } from './app.po';
2
+
3
+describe('workspace-project App', () => {
4
+  let page: AppPage;
5
+
6
+  beforeEach(() => {
7
+    page = new AppPage();
8
+  });
9
+
10
+  it('should display welcome message', () => {
11
+    page.navigateTo();
12
+    expect(page.getParagraphText()).toEqual('Welcome to angutron!');
13
+  });
14
+});

+ 11
- 0
e2e/src/app.po.ts 查看文件

@@ -0,0 +1,11 @@
1
+import { browser, by, element } from 'protractor';
2
+
3
+export class AppPage {
4
+  navigateTo() {
5
+    return browser.get('/');
6
+  }
7
+
8
+  getParagraphText() {
9
+    return element(by.css('app-root h1')).getText();
10
+  }
11
+}

+ 13
- 0
e2e/tsconfig.e2e.json 查看文件

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

+ 48
- 0
package.json 查看文件

@@ -0,0 +1,48 @@
1
+{
2
+  "name": "angutron",
3
+  "version": "0.0.0",
4
+  "scripts": {
5
+    "ng": "ng",
6
+    "start": "ng serve",
7
+    "build": "ng build",
8
+    "test": "ng test",
9
+    "lint": "ng lint",
10
+    "e2e": "ng e2e"
11
+  },
12
+  "private": true,
13
+  "dependencies": {
14
+    "@angular/animations": "^6.1.0",
15
+    "@angular/common": "^6.1.0",
16
+    "@angular/compiler": "^6.1.0",
17
+    "@angular/core": "^6.1.0",
18
+    "@angular/forms": "^6.1.0",
19
+    "@angular/http": "^6.1.0",
20
+    "@angular/platform-browser": "^6.1.0",
21
+    "@angular/platform-browser-dynamic": "^6.1.0",
22
+    "@angular/router": "^6.1.0",
23
+    "core-js": "^2.5.4",
24
+    "rxjs": "~6.2.0",
25
+    "zone.js": "~0.8.26"
26
+  },
27
+  "devDependencies": {
28
+    "@angular-devkit/build-angular": "~0.8.0",
29
+    "@angular/cli": "~6.2.3",
30
+    "@angular/compiler-cli": "^6.1.0",
31
+    "@angular/language-service": "^6.1.0",
32
+    "@types/jasmine": "~2.8.8",
33
+    "@types/jasminewd2": "~2.0.3",
34
+    "@types/node": "~8.9.4",
35
+    "codelyzer": "~4.3.0",
36
+    "jasmine-core": "~2.99.1",
37
+    "jasmine-spec-reporter": "~4.2.1",
38
+    "karma": "~3.0.0",
39
+    "karma-chrome-launcher": "~2.2.0",
40
+    "karma-coverage-istanbul-reporter": "~2.0.1",
41
+    "karma-jasmine": "~1.1.2",
42
+    "karma-jasmine-html-reporter": "^0.2.2",
43
+    "protractor": "~5.4.0",
44
+    "ts-node": "~7.0.0",
45
+    "tslint": "~5.11.0",
46
+    "typescript": "~2.9.2"
47
+  }
48
+}

+ 10
- 0
src/app/app-routing.module.ts 查看文件

@@ -0,0 +1,10 @@
1
+import { NgModule } from '@angular/core';
2
+import { Routes, RouterModule } from '@angular/router';
3
+
4
+const routes: Routes = [];
5
+
6
+@NgModule({
7
+  imports: [RouterModule.forRoot(routes)],
8
+  exports: [RouterModule]
9
+})
10
+export class AppRoutingModule { }

+ 21
- 0
src/app/app.component.html 查看文件

@@ -0,0 +1,21 @@
1
+<!--The content below is only a placeholder and can be replaced.-->
2
+<div style="text-align:center">
3
+  <h1>
4
+    Welcome to {{ title }}!
5
+  </h1>
6
+  <img width="300" alt="Angular Logo" src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNTAgMjUwIj4KICAgIDxwYXRoIGZpbGw9IiNERDAwMzEiIGQ9Ik0xMjUgMzBMMzEuOSA2My4ybDE0LjIgMTIzLjFMMTI1IDIzMGw3OC45LTQzLjcgMTQuMi0xMjMuMXoiIC8+CiAgICA8cGF0aCBmaWxsPSIjQzMwMDJGIiBkPSJNMTI1IDMwdjIyLjItLjFWMjMwbDc4LjktNDMuNyAxNC4yLTEyMy4xTDEyNSAzMHoiIC8+CiAgICA8cGF0aCAgZmlsbD0iI0ZGRkZGRiIgZD0iTTEyNSA1Mi4xTDY2LjggMTgyLjZoMjEuN2wxMS43LTI5LjJoNDkuNGwxMS43IDI5LjJIMTgzTDEyNSA1Mi4xem0xNyA4My4zaC0zNGwxNy00MC45IDE3IDQwLjl6IiAvPgogIDwvc3ZnPg==">
7
+</div>
8
+<h2>Here are some links to help you start: </h2>
9
+<ul>
10
+  <li>
11
+    <h2><a target="_blank" rel="noopener" href="https://angular.io/tutorial">Tour of Heroes</a></h2>
12
+  </li>
13
+  <li>
14
+    <h2><a target="_blank" rel="noopener" href="https://github.com/angular/angular-cli/wiki">CLI Documentation</a></h2>
15
+  </li>
16
+  <li>
17
+    <h2><a target="_blank" rel="noopener" href="https://blog.angular.io/">Angular blog</a></h2>
18
+  </li>
19
+</ul>
20
+
21
+<router-outlet></router-outlet>

+ 0
- 0
src/app/app.component.scss 查看文件


+ 10
- 0
src/app/app.component.ts 查看文件

@@ -0,0 +1,10 @@
1
+import { Component } from '@angular/core';
2
+
3
+@Component({
4
+  selector: 'app-root',
5
+  templateUrl: './app.component.html',
6
+  styleUrls: ['./app.component.scss']
7
+})
8
+export class AppComponent {
9
+  title = 'angutron';
10
+}

+ 18
- 0
src/app/app.module.ts 查看文件

@@ -0,0 +1,18 @@
1
+import { BrowserModule } from '@angular/platform-browser';
2
+import { NgModule } from '@angular/core';
3
+
4
+import { AppRoutingModule } from './app-routing.module';
5
+import { AppComponent } from './app.component';
6
+
7
+@NgModule({
8
+  declarations: [
9
+    AppComponent
10
+  ],
11
+  imports: [
12
+    BrowserModule,
13
+    AppRoutingModule
14
+  ],
15
+  providers: [],
16
+  bootstrap: [AppComponent]
17
+})
18
+export class AppModule { }

+ 0
- 0
src/assets/.gitkeep 查看文件


+ 11
- 0
src/browserslist 查看文件

@@ -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

+ 3
- 0
src/environments/environment.prod.ts 查看文件

@@ -0,0 +1,3 @@
1
+export const environment = {
2
+  production: true
3
+};

+ 16
- 0
src/environments/environment.ts 查看文件

@@ -0,0 +1,16 @@
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`.
4
+
5
+export const environment = {
6
+  production: false
7
+};
8
+
9
+/*
10
+ * For easier debugging in development mode, you can import the following file
11
+ * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`.
12
+ *
13
+ * This import should be commented out in production mode because it will have a negative impact
14
+ * on performance if an error is thrown.
15
+ */
16
+// import 'zone.js/dist/zone-error';  // Included with Angular CLI.

二进制
src/favicon.ico 查看文件


+ 14
- 0
src/index.html 查看文件

@@ -0,0 +1,14 @@
1
+<!doctype html>
2
+<html lang="en">
3
+<head>
4
+  <meta charset="utf-8">
5
+  <title>Angutron</title>
6
+  <base href="/">
7
+
8
+  <meta name="viewport" content="width=device-width, initial-scale=1">
9
+  <link rel="icon" type="image/x-icon" href="favicon.ico">
10
+</head>
11
+<body>
12
+  <app-root></app-root>
13
+</body>
14
+</html>

+ 31
- 0
src/karma.conf.js 查看文件

@@ -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
+};

+ 13
- 0
src/main.ts 查看文件

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

+ 80
- 0
src/polyfills.ts 查看文件

@@ -0,0 +1,80 @@
1
+/**
2
+ * This file includes polyfills needed by Angular and is loaded before the app.
3
+ * You can add your own extra polyfills to this file.
4
+ *
5
+ * This file is divided into 2 sections:
6
+ *   1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers.
7
+ *   2. Application imports. Files imported after ZoneJS that should be loaded before your main
8
+ *      file.
9
+ *
10
+ * The current setup is for so-called "evergreen" browsers; the last versions of browsers that
11
+ * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera),
12
+ * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile.
13
+ *
14
+ * Learn more in https://angular.io/docs/ts/latest/guide/browser-support.html
15
+ */
16
+
17
+/***************************************************************************************************
18
+ * BROWSER POLYFILLS
19
+ */
20
+
21
+/** IE9, IE10 and IE11 requires all of the following polyfills. **/
22
+// import 'core-js/es6/symbol';
23
+// import 'core-js/es6/object';
24
+// import 'core-js/es6/function';
25
+// import 'core-js/es6/parse-int';
26
+// import 'core-js/es6/parse-float';
27
+// import 'core-js/es6/number';
28
+// import 'core-js/es6/math';
29
+// import 'core-js/es6/string';
30
+// import 'core-js/es6/date';
31
+// import 'core-js/es6/array';
32
+// import 'core-js/es6/regexp';
33
+// import 'core-js/es6/map';
34
+// import 'core-js/es6/weak-map';
35
+// import 'core-js/es6/set';
36
+
37
+/** IE10 and IE11 requires the following for NgClass support on SVG elements */
38
+// import 'classlist.js';  // Run `npm install --save classlist.js`.
39
+
40
+/** IE10 and IE11 requires the following for the Reflect API. */
41
+// import 'core-js/es6/reflect';
42
+
43
+
44
+/** Evergreen browsers require these. **/
45
+// Used for reflect-metadata in JIT. If you use AOT (and only Angular decorators), you can remove.
46
+import 'core-js/es7/reflect';
47
+
48
+
49
+/**
50
+ * Web Animations `@angular/platform-browser/animations`
51
+ * Only required if AnimationBuilder is used within the application and using IE/Edge or Safari.
52
+ * Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0).
53
+ **/
54
+// import 'web-animations-js';  // Run `npm install --save web-animations-js`.
55
+
56
+/**
57
+ * By default, zone.js will patch all possible macroTask and DomEvents
58
+ * user can disable parts of macroTask/DomEvents patch by setting following flags
59
+ */
60
+
61
+ // (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame
62
+ // (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick
63
+ // (window as any).__zone_symbol__BLACK_LISTED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames
64
+
65
+ /*
66
+ * in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js
67
+ * with the following flag, it will bypass `zone.js` patch for IE/Edge
68
+ */
69
+// (window as any).__Zone_enable_cross_context_check = true;
70
+
71
+/***************************************************************************************************
72
+ * Zone JS is required by default for Angular itself.
73
+ */
74
+import 'zone.js/dist/zone';  // Included with Angular CLI.
75
+
76
+
77
+
78
+/***************************************************************************************************
79
+ * APPLICATION IMPORTS
80
+ */

+ 1
- 0
src/styles.scss 查看文件

@@ -0,0 +1 @@
1
+/* You can add global styles to this file, and also import other style files */

+ 20
- 0
src/test.ts 查看文件

@@ -0,0 +1,20 @@
1
+// This file is required by karma.conf.js and loads recursively all the .spec and framework files
2
+
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';
9
+
10
+declare const require: any;
11
+
12
+// First, initialize the Angular testing environment.
13
+getTestBed().initTestEnvironment(
14
+  BrowserDynamicTestingModule,
15
+  platformBrowserDynamicTesting()
16
+);
17
+// Then we find all the tests.
18
+const context = require.context('./', true, /\.spec\.ts$/);
19
+// And load the modules.
20
+context.keys().map(context);

+ 11
- 0
src/tsconfig.app.json 查看文件

@@ -0,0 +1,11 @@
1
+{
2
+  "extends": "../tsconfig.json",
3
+  "compilerOptions": {
4
+    "outDir": "../out-tsc/app",
5
+    "types": []
6
+  },
7
+  "exclude": [
8
+    "test.ts",
9
+    "**/*.spec.ts"
10
+  ]
11
+}

+ 18
- 0
src/tsconfig.spec.json 查看文件

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

+ 17
- 0
src/tslint.json 查看文件

@@ -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
+}

+ 21
- 0
tsconfig.json 查看文件

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

+ 131
- 0
tslint.json 查看文件

@@ -0,0 +1,131 @@
1
+{
2
+  "rulesDirectory": [
3
+    "node_modules/codelyzer"
4
+  ],
5
+  "rules": {
6
+    "arrow-return-shorthand": true,
7
+    "callable-types": true,
8
+    "class-name": true,
9
+    "comment-format": [
10
+      true,
11
+      "check-space"
12
+    ],
13
+    "curly": true,
14
+    "deprecation": {
15
+      "severity": "warn"
16
+    },
17
+    "eofline": true,
18
+    "forin": true,
19
+    "import-blacklist": [
20
+      true,
21
+      "rxjs/Rx"
22
+    ],
23
+    "import-spacing": true,
24
+    "indent": [
25
+      true,
26
+      "spaces"
27
+    ],
28
+    "interface-over-type-literal": true,
29
+    "label-position": true,
30
+    "max-line-length": [
31
+      true,
32
+      140
33
+    ],
34
+    "member-access": false,
35
+    "member-ordering": [
36
+      true,
37
+      {
38
+        "order": [
39
+          "static-field",
40
+          "instance-field",
41
+          "static-method",
42
+          "instance-method"
43
+        ]
44
+      }
45
+    ],
46
+    "no-arg": true,
47
+    "no-bitwise": true,
48
+    "no-console": [
49
+      true,
50
+      "debug",
51
+      "info",
52
+      "time",
53
+      "timeEnd",
54
+      "trace"
55
+    ],
56
+    "no-construct": true,
57
+    "no-debugger": true,
58
+    "no-duplicate-super": true,
59
+    "no-empty": false,
60
+    "no-empty-interface": true,
61
+    "no-eval": true,
62
+    "no-inferrable-types": [
63
+      true,
64
+      "ignore-params"
65
+    ],
66
+    "no-misused-new": true,
67
+    "no-non-null-assertion": true,
68
+    "no-redundant-jsdoc": true,
69
+    "no-shadowed-variable": true,
70
+    "no-string-literal": false,
71
+    "no-string-throw": true,
72
+    "no-switch-case-fall-through": true,
73
+    "no-trailing-whitespace": true,
74
+    "no-unnecessary-initializer": true,
75
+    "no-unused-expression": true,
76
+    "no-use-before-declare": true,
77
+    "no-var-keyword": true,
78
+    "object-literal-sort-keys": false,
79
+    "one-line": [
80
+      true,
81
+      "check-open-brace",
82
+      "check-catch",
83
+      "check-else",
84
+      "check-whitespace"
85
+    ],
86
+    "prefer-const": true,
87
+    "quotemark": [
88
+      true,
89
+      "single"
90
+    ],
91
+    "radix": true,
92
+    "semicolon": [
93
+      true,
94
+      "always"
95
+    ],
96
+    "triple-equals": [
97
+      true,
98
+      "allow-null-check"
99
+    ],
100
+    "typedef-whitespace": [
101
+      true,
102
+      {
103
+        "call-signature": "nospace",
104
+        "index-signature": "nospace",
105
+        "parameter": "nospace",
106
+        "property-declaration": "nospace",
107
+        "variable-declaration": "nospace"
108
+      }
109
+    ],
110
+    "unified-signatures": true,
111
+    "variable-name": false,
112
+    "whitespace": [
113
+      true,
114
+      "check-branch",
115
+      "check-decl",
116
+      "check-operator",
117
+      "check-separator",
118
+      "check-type"
119
+    ],
120
+    "no-output-on-prefix": true,
121
+    "use-input-property-decorator": true,
122
+    "use-output-property-decorator": true,
123
+    "use-host-property-decorator": true,
124
+    "no-input-rename": true,
125
+    "no-output-rename": true,
126
+    "use-life-cycle-interface": true,
127
+    "use-pipe-transform-interface": true,
128
+    "component-class-suffix": true,
129
+    "directive-class-suffix": true
130
+  }
131
+}