From 311961c9c04a33dee9334ba5890518c4e5238c19 Mon Sep 17 00:00:00 2001 From: Meligy Date: Tue, 27 Dec 2016 19:48:11 +1100 Subject: [PATCH] chore: upgrade to Angular CLI beta.24 --- .gitignore | 9 +++++++-- .vscode/settings.json | 3 +++ README.md | 2 +- angular-cli.json | 2 +- package.json | 35 +++++++++++++++++------------------ protractor.conf.js | 2 +- src/app/app.component.spec.ts | 5 +++++ src/app/index.ts | 2 -- src/main.ts | 2 +- src/test.ts | 2 +- tslint.json | 13 +++---------- 11 files changed, 40 insertions(+), 37 deletions(-) create mode 100644 .vscode/settings.json delete mode 100644 src/app/index.ts diff --git a/.gitignore b/.gitignore index ce200cb..fe6f8a7 100644 --- a/.gitignore +++ b/.gitignore @@ -6,17 +6,22 @@ # dependencies /node_modules -/bower_components # IDEs and editors /.idea -/.vscode .project .classpath .c9/ *.launch .settings/ +# IDE - VSCode +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json + # misc /.sass-cache /connect.lock diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..c7c1623 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "typescript.tsdk": "./node_modules/typescript/lib" +} \ No newline at end of file diff --git a/README.md b/README.md index d026797..938eab8 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ The project shows a simple website, showing a `bundled` route loaded in the main ## Standard Angular CLI Docs -The project was generated with [angular-cli](https://github.com/angular/angular-cli) version 1.0.0-beta.21. +The project was generated with [angular-cli](https://github.com/angular/angular-cli) version 1.0.0-beta.24. The commands below have been modified to ensure you are using the locally installed `angular-cli` package. diff --git a/angular-cli.json b/angular-cli.json index 2e9fd22..f31cc9e 100644 --- a/angular-cli.json +++ b/angular-cli.json @@ -1,6 +1,6 @@ { "project": { - "version": "1.0.0-beta.21", + "version": "1.0.0-beta.24", "name": "routing-angular-cli" }, "apps": [ diff --git a/package.json b/package.json index e1a4848..7386467 100644 --- a/package.json +++ b/package.json @@ -9,30 +9,30 @@ "start": "ng serve", "lint": "tslint \"src/**/*.ts\"", "test": "ng test", - "pree2e": "webdriver-manager update", + "pree2e": "webdriver-manager update --standalone false --gecko false", "e2e": "protractor" }, "private": true, "dependencies": { - "@angular/common": "2.2.1", - "@angular/compiler": "2.2.1", - "@angular/core": "2.2.1", - "@angular/forms": "2.2.1", - "@angular/http": "2.2.1", - "@angular/platform-browser": "2.2.1", - "@angular/platform-browser-dynamic": "2.2.1", - "@angular/router": "3.2.1", + "@angular/common": "^2.3.1", + "@angular/compiler": "^2.3.1", + "@angular/core": "^2.3.1", + "@angular/forms": "^2.3.1", + "@angular/http": "^2.3.1", + "@angular/platform-browser": "^2.3.1", + "@angular/platform-browser-dynamic": "^2.3.1", + "@angular/router": "^3.3.1", "core-js": "^2.4.1", - "rxjs": "5.0.0-beta.12", + "rxjs": "^5.0.1", "ts-helpers": "^1.1.1", - "zone.js": "^0.6.23" + "zone.js": "^0.7.2" }, "devDependencies": { - "@angular/compiler-cli": "2.2.1", + "@angular/compiler-cli": "^2.3.1", "@types/jasmine": "2.5.38", "@types/node": "^6.0.42", - "angular-cli": "1.0.0-beta.21", - "codelyzer": "~1.0.0-beta.3", + "angular-cli": "1.0.0-beta.24", + "codelyzer": "~2.0.0-beta.1", "jasmine-core": "2.5.2", "jasmine-spec-reporter": "2.5.0", "karma": "1.2.0", @@ -40,10 +40,9 @@ "karma-cli": "^1.0.1", "karma-jasmine": "^1.0.2", "karma-remap-istanbul": "^0.2.1", - "protractor": "4.0.9", + "protractor": "~4.0.13", "ts-node": "1.2.1", - "tslint": "3.13.0", - "typescript": "~2.0.3", - "webdriver-manager": "10.2.5" + "tslint": "^4.0.2", + "typescript": "~2.0.3" } } diff --git a/protractor.conf.js b/protractor.conf.js index 169743b..ffded70 100644 --- a/protractor.conf.js +++ b/protractor.conf.js @@ -1,5 +1,5 @@ // Protractor configuration file, see link for more information -// https://github.com/angular/protractor/blob/master/docs/referenceConf.js +// https://github.com/angular/protractor/blob/master/lib/config.ts /*global jasmine */ var SpecReporter = require('jasmine-spec-reporter'); diff --git a/src/app/app.component.spec.ts b/src/app/app.component.spec.ts index f1e6bed..c4a8181 100644 --- a/src/app/app.component.spec.ts +++ b/src/app/app.component.spec.ts @@ -1,15 +1,20 @@ /* tslint:disable:no-unused-variable */ import { TestBed, async } from '@angular/core/testing'; +import { RouterTestingModule } from '@angular/router/testing'; import { AppComponent } from './app.component'; describe('AppComponent', () => { beforeEach(() => { TestBed.configureTestingModule({ + imports: [ + RouterTestingModule + ], declarations: [ AppComponent ], }); + TestBed.compileComponents(); }); it('should create the app', async(() => { diff --git a/src/app/index.ts b/src/app/index.ts deleted file mode 100644 index 875bdb2..0000000 --- a/src/app/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './app.component'; -export * from './app.module'; diff --git a/src/main.ts b/src/main.ts index 5c3c520..ac78a71 100644 --- a/src/main.ts +++ b/src/main.ts @@ -3,7 +3,7 @@ import './polyfills.ts'; import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; import { enableProdMode } from '@angular/core'; import { environment } from './environments/environment'; -import { AppModule } from './app/'; +import { AppModule } from './app/app.module'; if (environment.production) { enableProdMode(); diff --git a/src/test.ts b/src/test.ts index 81af890..be44dc5 100644 --- a/src/test.ts +++ b/src/test.ts @@ -25,7 +25,7 @@ getTestBed().initTestEnvironment( platformBrowserDynamicTesting() ); // Then we find all the tests. -let context = require.context('./', true, /\.spec\.ts/); +let context = require.context('./', true, /\.spec\.ts$/); // And load the modules. context.keys().map(context); // Finally, start Karma to run the tests. diff --git a/tslint.json b/tslint.json index ad0093e..640d02c 100644 --- a/tslint.json +++ b/tslint.json @@ -16,7 +16,6 @@ "spaces" ], "label-position": true, - "label-undefined": true, "max-line-length": [ true, 140 @@ -39,7 +38,6 @@ ], "no-construct": true, "no-debugger": true, - "no-duplicate-key": true, "no-duplicate-variable": true, "no-empty": false, "no-eval": true, @@ -49,8 +47,6 @@ "no-switch-case-fall-through": true, "no-trailing-whitespace": true, "no-unused-expression": true, - "no-unused-variable": true, - "no-unreachable": true, "no-use-before-declare": true, "no-var-keyword": true, "object-literal-sort-keys": false, @@ -93,12 +89,8 @@ "check-type" ], - "directive-selector-prefix": [true, "app"], - "component-selector-prefix": [true, "app"], - "directive-selector-name": [true, "camelCase"], - "component-selector-name": [true, "kebab-case"], - "directive-selector-type": [true, "attribute"], - "component-selector-type": [true, "element"], + "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, @@ -108,6 +100,7 @@ "use-pipe-transform-interface": true, "component-class-suffix": true, "directive-class-suffix": true, + "no-access-missing-member": true, "templates-use-public": true, "invoke-injectable": true }