Skip to content
This repository was archived by the owner on May 7, 2018. It is now read-only.

Commit c5b382a

Browse files
authored
feat: migrate and upgrade to angular 6 (#87)
1 parent 1c4ae91 commit c5b382a

File tree

7 files changed

+1794
-2022
lines changed

7 files changed

+1794
-2022
lines changed

.angular-cli.json

Lines changed: 0 additions & 60 deletions
This file was deleted.

angular.json

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

karma.conf.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,20 @@
44
module.exports = function (config) {
55
config.set({
66
basePath: '',
7-
frameworks: ['jasmine', '@angular/cli'],
7+
frameworks: ['jasmine', '@angular-devkit/build-angular'],
88
plugins: [
99
require('karma-jasmine'),
1010
require('karma-chrome-launcher'),
1111
require('karma-jasmine-html-reporter'),
1212
require('karma-coverage-istanbul-reporter'),
1313
require('karma-mocha-reporter'),
14-
require('@angular/cli/plugins/karma')
14+
require('@angular-devkit/build-angular/plugins/karma')
1515
],
1616
client:{
1717
clearContext: false // leave Jasmine Spec Runner output visible in browser
1818
},
1919
coverageIstanbulReporter: {
20-
reports: [ 'html', 'lcovonly' ],
20+
dir: require('path').join(__dirname, 'coverage'), reports: [ 'html', 'lcovonly' ],
2121
fixWebpackSourcePaths: true
2222
},
2323
angularCli: {

package.json

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,35 +6,37 @@
66
"ng": "ng",
77
"jsonserver:start": "forever start e2e/mocks/json-server.js",
88
"jsonserver:stop": "forever stop e2e/mocks/json-server.js",
9-
"start": "ng serve --proxy-conf proxy.conf.json",
9+
"start": "ng serve",
1010
"build": "ng build",
1111
"test": "ng test",
1212
"lint": "ng lint",
1313
"pree2e": "yarn jsonserver:start",
14-
"e2e": "ng e2e --proxy-conf proxy.conf.json --aot --prod",
14+
"e2e": "ng e2e",
1515
"poste2e": "yarn jsonserver:stop",
1616
"ci:test": "ng test --single-run --code-coverage",
1717
"ci:e2e": "yarn e2e"
1818
},
1919
"private": true,
2020
"dependencies": {
21-
"@angular/animations": "^5.0.0",
22-
"@angular/common": "^5.0.0",
23-
"@angular/compiler": "^5.0.0",
24-
"@angular/core": "^5.0.0",
25-
"@angular/forms": "^5.0.0",
26-
"@angular/http": "^5.0.0",
27-
"@angular/platform-browser": "^5.0.0",
28-
"@angular/platform-browser-dynamic": "^5.0.0",
29-
"@angular/router": "^5.0.0",
21+
"@angular/animations": "6.0.0",
22+
"@angular/common": "6.0.0",
23+
"@angular/compiler": "6.0.0",
24+
"@angular/core": "6.0.0",
25+
"@angular/forms": "6.0.0",
26+
"@angular/http": "6.0.0",
27+
"@angular/platform-browser": "6.0.0",
28+
"@angular/platform-browser-dynamic": "6.0.0",
29+
"@angular/router": "6.0.0",
3030
"core-js": "^2.4.1",
31-
"rxjs": "^5.4.2",
32-
"zone.js": "^0.8.14"
31+
"rxjs": "^6.1.0",
32+
"rxjs-compat": "^6.1.0",
33+
"zone.js": "^0.8.26"
3334
},
3435
"devDependencies": {
35-
"@angular/cli": "~1.7.0",
36-
"@angular/compiler-cli": "^5.0.0",
37-
"@angular/language-service": "^5.0.0",
36+
"@angular-devkit/build-angular": "~0.6.0",
37+
"@angular/cli": "6.0.0",
38+
"@angular/compiler-cli": "6.0.0",
39+
"@angular/language-service": "6.0.0",
3840
"@types/chai": "^4.0.1",
3941
"@types/cucumber": "^4.0.0",
4042
"@types/jasmine": "~2.8.0",
@@ -59,6 +61,6 @@
5961
"protractor-cucumber-framework": "^5.0.0",
6062
"ts-node": "~5.0.0",
6163
"tslint": "~5.9.0",
62-
"typescript": "~2.7.1"
64+
"typescript": "2.7.2"
6365
}
6466
}

src/tsconfig.spec.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
]
1212
},
1313
"files": [
14-
"test.ts"
14+
"test.ts",
15+
"polyfills.ts"
1516
],
1617
"include": [
1718
"**/*.spec.ts",

tslint.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@
1414
"eofline": true,
1515
"forin": true,
1616
"import-blacklist": [
17-
true,
18-
"rxjs"
17+
true
1918
],
2019
"import-spacing": true,
2120
"indent": [

0 commit comments

Comments
 (0)