From 27ef388a32c1610d5dc0e1e83fb3a6b25b4d15b1 Mon Sep 17 00:00:00 2001 From: Filipe Silva Date: Thu, 28 Jul 2016 17:04:56 +0100 Subject: [PATCH 01/83] chore(travis): add badge to readme (#166) --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index b70d29fa9..92ff89d6f 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ # Angular 2 QuickStart Source +[![Build Status][travis-badge]][travis-badge-url] This repository holds the TypeScript source code of the [angular.io quickstart](https://angular.io/docs/ts/latest/quickstart.html), the foundation for most of the documentation samples and potentially a good starting point for your application. @@ -148,3 +149,6 @@ A custom reporter (see `protractor.config.js`) generates a `./_test-output/prot which is easier to read; this file is excluded from source control. Shut it down manually with Ctrl-C. + +[travis-badge]: https://travis-ci.org/angular/quickstart.svg?branch=master +[travis-badge-url]: https://travis-ci.org/angular/quickstart From ff4c85d6b0db4bb2e179df11aff5731faf6a0a39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Rodr=C3=ADguez?= Date: Tue, 9 Aug 2016 20:13:43 +0200 Subject: [PATCH 02/83] chore: update to Angular 2 RC5 (#175) --- app/app.component.spec.ts | 1 - app/app.module.ts | 11 +++++++++++ app/main.ts | 6 +++--- package.json | 20 ++++++++++---------- typings.json | 2 +- 5 files changed, 25 insertions(+), 15 deletions(-) create mode 100644 app/app.module.ts diff --git a/app/app.component.spec.ts b/app/app.component.spec.ts index d1f2a8cfd..0b9c23987 100644 --- a/app/app.component.spec.ts +++ b/app/app.component.spec.ts @@ -8,7 +8,6 @@ import { TestComponentBuilder } from '@angular/core/testing'; import { By } from '@angular/platform-browser'; import { provide } from '@angular/core'; import { ViewMetadata } from '@angular/core'; -import { PromiseWrapper } from '@angular/core/src/facade/promise'; //////// SPECS ///////////// diff --git a/app/app.module.ts b/app/app.module.ts new file mode 100644 index 000000000..4f883fa15 --- /dev/null +++ b/app/app.module.ts @@ -0,0 +1,11 @@ +import { NgModule } from '@angular/core'; +import { BrowserModule } from '@angular/platform-browser'; + +import { AppComponent } from './app.component'; + +@NgModule({ + imports: [ BrowserModule ], + declarations: [ AppComponent ], + bootstrap: [ AppComponent ] +}) +export class AppModule { } diff --git a/app/main.ts b/app/main.ts index ad256f082..6af7a5b2a 100644 --- a/app/main.ts +++ b/app/main.ts @@ -1,5 +1,5 @@ -import { bootstrap } from '@angular/platform-browser-dynamic'; +import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; -import { AppComponent } from './app.component'; +import { AppModule } from './app.module'; -bootstrap(AppComponent); +platformBrowserDynamic().bootstrapModule(AppModule); diff --git a/package.json b/package.json index a8a16fe1c..de3ec0db1 100644 --- a/package.json +++ b/package.json @@ -22,16 +22,16 @@ "author": "", "license": "ISC", "dependencies": { - "@angular/common": "2.0.0-rc.4", - "@angular/compiler": "2.0.0-rc.4", - "@angular/core": "2.0.0-rc.4", - "@angular/forms": "0.2.0", - "@angular/http": "2.0.0-rc.4", - "@angular/platform-browser": "2.0.0-rc.4", - "@angular/platform-browser-dynamic": "2.0.0-rc.4", - "@angular/router": "3.0.0-beta.2", + "@angular/common": "2.0.0-rc.5", + "@angular/compiler": "2.0.0-rc.5", + "@angular/core": "2.0.0-rc.5", + "@angular/forms": "0.3.0", + "@angular/http": "2.0.0-rc.5", + "@angular/platform-browser": "2.0.0-rc.5", + "@angular/platform-browser-dynamic": "2.0.0-rc.5", + "@angular/router": "3.0.0-rc.1", "@angular/router-deprecated": "2.0.0-rc.2", - "@angular/upgrade": "2.0.0-rc.4", + "@angular/upgrade": "2.0.0-rc.5", "systemjs": "0.19.27", "core-js": "^2.4.0", @@ -39,7 +39,7 @@ "rxjs": "5.0.0-beta.6", "zone.js": "^0.6.12", - "angular2-in-memory-web-api": "0.0.14", + "angular2-in-memory-web-api": "0.0.15", "bootstrap": "^3.3.6" }, "devDependencies": { diff --git a/typings.json b/typings.json index b2c9c6cdd..57266b144 100644 --- a/typings.json +++ b/typings.json @@ -3,7 +3,7 @@ "angular-protractor": "registry:dt/angular-protractor#1.5.0+20160425143459", "core-js": "registry:dt/core-js#0.0.0+20160602141332", "jasmine": "registry:dt/jasmine#2.2.0+20160621224255", - "node": "registry:dt/node#6.0.0+20160621231320", + "node": "registry:dt/node#6.0.0+20160807145350", "selenium-webdriver": "registry:dt/selenium-webdriver#2.44.0+20160317120654" } } From c4cd6345247e12108f99312f42448ca1c74b7f01 Mon Sep 17 00:00:00 2001 From: Filipe Silva Date: Tue, 9 Aug 2016 19:15:37 +0100 Subject: [PATCH 03/83] chore: update changelog --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1fec51860..e11191d06 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ + +# 0.2.6 (2016-08-09) +* Angular 2 RC5 version +* Updated new forms, router and angular2-in-memory-web-api + # 0.2.5 (2016-06-30) * Angular 2 RC4 version From 5c41da2d3da78a3e87dda54f9986c550d7f3bd44 Mon Sep 17 00:00:00 2001 From: Filipe Silva Date: Wed, 17 Aug 2016 12:42:13 +0100 Subject: [PATCH 04/83] chore(docs): use correct comment syntax (#177) Fixes https://github.com/angular/quickstart/issues/176 --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 92ff89d6f..1461759b5 100644 --- a/README.md +++ b/README.md @@ -36,8 +36,8 @@ cd my-proj We have no intention of updating the source on `angular/quickstart`. Discard everything "git-like" by deleting the `.git` folder. ```bash -rm -rf .git // non-Windows -rd .git /S/Q // windows +rm -rf .git # non-Windows +rd .git /S/Q # windows ``` ### Create a new git repo From 6ce71a08f6356b7a68325df25944de7610090207 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Rodr=C3=ADguez?= Date: Wed, 17 Aug 2016 13:43:54 +0200 Subject: [PATCH 05/83] chore: update node and npm recommendations (#151) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1461759b5..9aa466c90 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ Node.js and npm are essential to Angular 2 development. Get it now if it's not already installed on your machine. -**Verify that you are running at least node `v5.x.x` and npm `3.x.x`** +**Verify that you are running at least node `v4.x.x` and npm `3.x.x`** by running `node -v` and `npm -v` in a terminal/console window. Older versions produce errors. From d8b3ba7ece489a8812f220fe0272260d6258640f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Rodr=C3=ADguez?= Date: Fri, 19 Aug 2016 12:26:17 +0200 Subject: [PATCH 06/83] chore: update specs to TestBed (#184) --- app/app.component.spec.ts | 38 +++++++++++++++----------------------- karma-test-shim.js | 33 +++++++++++++++------------------ karma.conf.js | 3 ++- 3 files changed, 32 insertions(+), 42 deletions(-) diff --git a/app/app.component.spec.ts b/app/app.component.spec.ts index 0b9c23987..211fadfda 100644 --- a/app/app.component.spec.ts +++ b/app/app.component.spec.ts @@ -1,13 +1,9 @@ /* tslint:disable:no-unused-variable */ import { AppComponent } from './app.component'; -import { async, inject } from '@angular/core/testing'; - -import { TestComponentBuilder } from '@angular/core/testing'; +import { TestBed } from '@angular/core/testing'; import { By } from '@angular/platform-browser'; -import { provide } from '@angular/core'; -import { ViewMetadata } from '@angular/core'; //////// SPECS ///////////// @@ -19,27 +15,23 @@ describe('Smoke test', () => { }); describe('AppComponent with TCB', function () { + beforeEach(() => { + TestBed.configureTestingModule({declarations: [AppComponent]}); + }); - it('should instantiate component', - async(inject([TestComponentBuilder], (tcb: TestComponentBuilder) => { - - tcb.createAsync(AppComponent).then(fixture => { - expect(fixture.componentInstance instanceof AppComponent).toBe(true, 'should create AppComponent'); - }); - }))); - - it('should have expected

text', - async(inject([TestComponentBuilder], (tcb: TestComponentBuilder) => { - - tcb.createAsync(AppComponent).then(fixture => { - // fixture.detectChanges(); // would need to resolve a binding but we don't have a binding + it('should instantiate component', () => { + let fixture = TestBed.createComponent(AppComponent); + expect(fixture.componentInstance instanceof AppComponent).toBe(true, 'should create AppComponent'); + }); - let h1 = fixture.debugElement.query(el => el.name === 'h1').nativeElement; // it works + it('should have expected

text', () => { + let fixture = TestBed.createComponent(AppComponent); + fixture.detectChanges(); - h1 = fixture.debugElement.query(By.css('h1')).nativeElement; // preferred + let h1 = fixture.debugElement.query(el => el.name === 'h1').nativeElement; // it works - expect(h1.innerText).toMatch(/angular 2 app/i, '

should say something about "Angular 2 App"'); - }); + h1 = fixture.debugElement.query(By.css('h1')).nativeElement; // preferred - }))); + expect(h1.innerText).toMatch(/angular 2 app/i, '

should say something about "Angular 2 App"'); + }); }); diff --git a/karma-test-shim.js b/karma-test-shim.js index ec50e1ff6..9ad166440 100644 --- a/karma-test-shim.js +++ b/karma-test-shim.js @@ -28,27 +28,24 @@ System.config({ }); System.import('systemjs.config.js') - .then(function () { - return Promise.all([ + .then(() => Promise.all([ System.import('@angular/core/testing'), System.import('@angular/platform-browser-dynamic/testing') - ]) - }) - .then(function (providers) { - var testing = providers[0]; - var testingBrowser = providers[1]; - - testing.setBaseTestProviders( - testingBrowser.TEST_BROWSER_DYNAMIC_PLATFORM_PROVIDERS, - testingBrowser.TEST_BROWSER_DYNAMIC_APPLICATION_PROVIDERS); + ])) + .then((providers) => { + var coreTesting = providers[0]; + var browserTesting = providers[1]; + coreTesting.TestBed.initTestEnvironment( + browserTesting.BrowserDynamicTestingModule, + browserTesting.platformBrowserDynamicTesting()); }) - .then(function() { - // Finally, load all spec files. - // This will run the tests directly. - return Promise.all( - allSpecFiles.map(function (moduleName) { - return System.import(moduleName); - })); + .then(function () { + // Finally, load all spec files. + // This will run the tests directly. + return Promise.all( + allSpecFiles.map(function (moduleName) { + return System.import(moduleName); + })); }) .then(__karma__.start, __karma__.error); diff --git a/karma.conf.js b/karma.conf.js index faa52df98..30228f41c 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -30,9 +30,10 @@ module.exports = function(config) { // Reflect and Zone.js 'node_modules/reflect-metadata/Reflect.js', 'node_modules/zone.js/dist/zone.js', - 'node_modules/zone.js/dist/jasmine-patch.js', 'node_modules/zone.js/dist/async-test.js', 'node_modules/zone.js/dist/fake-async-test.js', + 'node_modules/zone.js/dist/sync-test.js', + 'node_modules/zone.js/dist/proxy-zone.js', // RxJs. { pattern: 'node_modules/rxjs/**/*.js', included: false, watched: false }, From 1c78664d2fb3e9545b66c3b2a7e4b9c8d822bea9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Rodr=C3=ADguez?= Date: Mon, 22 Aug 2016 15:27:12 +0200 Subject: [PATCH 07/83] chore: update karma to new zone.js (#195) --- karma.conf.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/karma.conf.js b/karma.conf.js index 30228f41c..28c0b52d7 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -33,7 +33,7 @@ module.exports = function(config) { 'node_modules/zone.js/dist/async-test.js', 'node_modules/zone.js/dist/fake-async-test.js', 'node_modules/zone.js/dist/sync-test.js', - 'node_modules/zone.js/dist/proxy-zone.js', + 'node_modules/zone.js/dist/proxy.js', // RxJs. { pattern: 'node_modules/rxjs/**/*.js', included: false, watched: false }, From 3b7452cc444c49c139ea39523ced0468c2362c16 Mon Sep 17 00:00:00 2001 From: Filipe Silva Date: Thu, 1 Sep 2016 05:43:41 +0100 Subject: [PATCH 08/83] chore: update to rc6 (#202) chore: update to rc6 --- CHANGELOG.md | 9 +++- karma.conf.js | 6 ++- package.json | 29 ++++++------- systemjs.config.js | 106 +++++++++++++++++++++------------------------ 4 files changed, 75 insertions(+), 75 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e11191d06..3b7b09541 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,11 @@ - + +# 0.2.7 (2016-08-31) +* Angular 2 RC6 version +* Updated new forms, router, angular2-in-memory-web-api, karma, core-js, rxjs and zone.js packages +* Removed router-deprecated package +* Updated karma.conf.js and systemjs.config.js + + # 0.2.6 (2016-08-09) * Angular 2 RC5 version * Updated new forms, router and angular2-in-memory-web-api diff --git a/karma.conf.js b/karma.conf.js index 28c0b52d7..afe043f85 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -30,10 +30,12 @@ module.exports = function(config) { // Reflect and Zone.js 'node_modules/reflect-metadata/Reflect.js', 'node_modules/zone.js/dist/zone.js', + 'node_modules/zone.js/dist/long-stack-trace-zone.js', + 'node_modules/zone.js/dist/proxy.js', + 'node_modules/zone.js/dist/sync-test.js', + 'node_modules/zone.js/dist/jasmine-patch.js', 'node_modules/zone.js/dist/async-test.js', 'node_modules/zone.js/dist/fake-async-test.js', - 'node_modules/zone.js/dist/sync-test.js', - 'node_modules/zone.js/dist/proxy.js', // RxJs. { pattern: 'node_modules/rxjs/**/*.js', included: false, watched: false }, diff --git a/package.json b/package.json index de3ec0db1..bde98269b 100644 --- a/package.json +++ b/package.json @@ -22,24 +22,23 @@ "author": "", "license": "ISC", "dependencies": { - "@angular/common": "2.0.0-rc.5", - "@angular/compiler": "2.0.0-rc.5", - "@angular/core": "2.0.0-rc.5", - "@angular/forms": "0.3.0", - "@angular/http": "2.0.0-rc.5", - "@angular/platform-browser": "2.0.0-rc.5", - "@angular/platform-browser-dynamic": "2.0.0-rc.5", - "@angular/router": "3.0.0-rc.1", - "@angular/router-deprecated": "2.0.0-rc.2", - "@angular/upgrade": "2.0.0-rc.5", + "@angular/common": "2.0.0-rc.6", + "@angular/compiler": "2.0.0-rc.6", + "@angular/core": "2.0.0-rc.6", + "@angular/forms": "2.0.0-rc.6", + "@angular/http": "2.0.0-rc.6", + "@angular/platform-browser": "2.0.0-rc.6", + "@angular/platform-browser-dynamic": "2.0.0-rc.6", + "@angular/router": "3.0.0-rc.2", + "@angular/upgrade": "2.0.0-rc.6", "systemjs": "0.19.27", - "core-js": "^2.4.0", + "core-js": "^2.4.1", "reflect-metadata": "^0.1.3", - "rxjs": "5.0.0-beta.6", - "zone.js": "^0.6.12", + "rxjs": "5.0.0-beta.11", + "zone.js": "^0.6.17", - "angular2-in-memory-web-api": "0.0.15", + "angular2-in-memory-web-api": "0.0.18", "bootstrap": "^3.3.6" }, "devDependencies": { @@ -53,7 +52,7 @@ "tslint": "^3.7.4", "lodash": "^4.11.1", "jasmine-core": "~2.4.1", - "karma": "^0.13.22", + "karma": "^1.2.0", "karma-chrome-launcher": "^0.2.3", "karma-cli": "^0.1.2", "karma-htmlfile-reporter": "^0.2.2", diff --git a/systemjs.config.js b/systemjs.config.js index 22b0c210c..c2d49d605 100644 --- a/systemjs.config.js +++ b/systemjs.config.js @@ -2,61 +2,53 @@ * System configuration for Angular 2 samples * Adjust as necessary for your application needs. */ -(function(global) { - - // map tells the System loader where to look for things - var map = { - 'app': 'app', // 'dist', - - '@angular': 'node_modules/@angular', - 'angular2-in-memory-web-api': 'node_modules/angular2-in-memory-web-api', - 'rxjs': 'node_modules/rxjs' - }; - - // packages tells the System loader how to load when no filename and/or no extension - var packages = { - 'app': { main: 'main.js', defaultExtension: 'js' }, - 'rxjs': { defaultExtension: 'js' }, - 'angular2-in-memory-web-api': { main: 'index.js', defaultExtension: 'js' }, - }; - - var ngPackageNames = [ - 'common', - 'compiler', - 'core', - 'forms', - 'http', - 'platform-browser', - 'platform-browser-dynamic', - 'router', - 'router-deprecated', - 'upgrade', - ]; - - // Individual files (~300 requests): - function packIndex(pkgName) { - packages['@angular/'+pkgName] = { main: 'index.js', defaultExtension: 'js' }; - } - - // Bundled (~40 requests): - function packUmd(pkgName) { - packages['@angular/'+pkgName] = { main: '/bundles/' + pkgName + '.umd.js', defaultExtension: 'js' }; - } - - // Most environments should use UMD; some (Karma) need the individual index files - var setPackageConfig = System.packageWithIndex ? packIndex : packUmd; - - // Add package entries for angular packages - ngPackageNames.forEach(setPackageConfig); - - // No umd for router yet - packages['@angular/router'] = { main: 'index.js', defaultExtension: 'js' }; - - var config = { - map: map, - packages: packages - }; - - System.config(config); - +(function (global) { + System.config({ + paths: { + // paths serve as alias + 'npm:': 'node_modules/' + }, + // map tells the System loader where to look for things + map: { + // our app is within the app folder + app: 'app', + + // angular bundles + '@angular/core': 'npm:@angular/core/bundles/core.umd.js', + '@angular/common': 'npm:@angular/common/bundles/common.umd.js', + '@angular/compiler': 'npm:@angular/compiler/bundles/compiler.umd.js', + '@angular/platform-browser': 'npm:@angular/platform-browser/bundles/platform-browser.umd.js', + '@angular/platform-browser-dynamic': 'npm:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js', + '@angular/http': 'npm:@angular/http/bundles/http.umd.js', + '@angular/router': 'npm:@angular/router/bundles/router.umd.js', + '@angular/forms': 'npm:@angular/forms/bundles/forms.umd.js', + + // angular testing umd bundles + '@angular/core/testing': 'npm:@angular/core/bundles/core-testing.umd.js', + '@angular/common/testing': 'npm:@angular/common/bundles/common-testing.umd.js', + '@angular/compiler/testing': 'npm:@angular/compiler/bundles/compiler-testing.umd.js', + '@angular/platform-browser/testing': 'npm:@angular/platform-browser/bundles/platform-browser-testing.umd.js', + '@angular/platform-browser-dynamic/testing': 'npm:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic-testing.umd.js', + '@angular/http/testing': 'npm:@angular/http/bundles/http-testing.umd.js', + '@angular/router/testing': 'npm:@angular/router/bundles/router-testing.umd.js', + '@angular/forms/testing': 'npm:@angular/forms/bundles/forms-testing.umd.js', + + // other libraries + 'rxjs': 'npm:rxjs', + 'angular2-in-memory-web-api': 'npm:angular2-in-memory-web-api', + }, + // packages tells the System loader how to load when no filename and/or no extension + packages: { + app: { + main: './main.js', + defaultExtension: 'js' + }, + rxjs: { + defaultExtension: 'js' + }, + 'angular2-in-memory-web-api': { + defaultExtension: 'js' + } + } + }); })(this); From fa6baacc8ab8b095735f8b8f5eb9d17b1d8790b8 Mon Sep 17 00:00:00 2001 From: Filipe Silva Date: Thu, 1 Sep 2016 06:32:10 +0100 Subject: [PATCH 09/83] fix(systemjs): add missing main --- systemjs.config.js | 1 + 1 file changed, 1 insertion(+) diff --git a/systemjs.config.js b/systemjs.config.js index c2d49d605..cb9794062 100644 --- a/systemjs.config.js +++ b/systemjs.config.js @@ -47,6 +47,7 @@ defaultExtension: 'js' }, 'angular2-in-memory-web-api': { + main: 'index.js', defaultExtension: 'js' } } From 89cc3a879ab0c6f1d7dac8bf73e633a5ceff80a7 Mon Sep 17 00:00:00 2001 From: Filipe Silva Date: Thu, 1 Sep 2016 06:32:53 +0100 Subject: [PATCH 10/83] chore: make systemjs config more consistent --- systemjs.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/systemjs.config.js b/systemjs.config.js index cb9794062..41b9c83a1 100644 --- a/systemjs.config.js +++ b/systemjs.config.js @@ -47,7 +47,7 @@ defaultExtension: 'js' }, 'angular2-in-memory-web-api': { - main: 'index.js', + main: './index.js', defaultExtension: 'js' } } From c3dd14ca45ff7d4f3e1efb95390df553c3352f51 Mon Sep 17 00:00:00 2001 From: Ward Bell Date: Thu, 1 Sep 2016 17:48:26 -0700 Subject: [PATCH 11/83] chore: remove angular testing libs from systemjs and update testing shims --- CHANGELOG.md | 5 ++ karma-test-shim.js | 78 ++++++++++++++++++++-------- karma.conf.js | 33 ++++++++---- systemjs.config.js | 12 +---- wallaby.js | 124 ++++++++++++++++++++++++++++++--------------- 5 files changed, 169 insertions(+), 83 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3b7b09541..86b8c687d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ + +# 0.2.8 (2016-09-01) +* remove @angular test libraries from system.js (now in shim) +* update test related files +* wallaby doesn't completely work. Researching. # 0.2.7 (2016-08-31) * Angular 2 RC6 version diff --git a/karma-test-shim.js b/karma-test-shim.js index 9ad166440..642b29af0 100644 --- a/karma-test-shim.js +++ b/karma-test-shim.js @@ -1,20 +1,25 @@ +// #docregion // /*global jasmine, __karma__, window*/ -Error.stackTraceLimit = Infinity; +Error.stackTraceLimit = 0; // "No stacktrace"" is usually best for app testing. + +// Uncomment to get full stacktrace output. Sometimes helpful, usually not. +// Error.stackTraceLimit = Infinity; // + jasmine.DEFAULT_TIMEOUT_INTERVAL = 1000; -__karma__.loaded = function () { -}; +var builtPath = '/base/app/'; + +__karma__.loaded = function () { }; function isJsFile(path) { return path.slice(-3) == '.js'; } function isSpecFile(path) { - return /\.spec\.js$/.test(path); + return /\.spec\.(.*\.)?js$/.test(path); } function isBuiltFile(path) { - var builtPath = '/base/app/'; return isJsFile(path) && (path.substr(0, builtPath.length) == builtPath); } @@ -24,28 +29,61 @@ var allSpecFiles = Object.keys(window.__karma__.files) System.config({ baseURL: '/base', - packageWithIndex: true // sadly, we can't use umd packages (yet?) + // Extend usual application package list with test folder + packages: { 'testing': { main: 'index.js', defaultExtension: 'js' } }, + + // Assume npm: is set in `paths` in systemjs.config + // Map the angular testing umd bundles + map: { + '@angular/core/testing': 'npm:@angular/core/bundles/core-testing.umd.js', + '@angular/common/testing': 'npm:@angular/common/bundles/common-testing.umd.js', + '@angular/compiler/testing': 'npm:@angular/compiler/bundles/compiler-testing.umd.js', + '@angular/platform-browser/testing': 'npm:@angular/platform-browser/bundles/platform-browser-testing.umd.js', + '@angular/platform-browser-dynamic/testing': 'npm:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic-testing.umd.js', + '@angular/http/testing': 'npm:@angular/http/bundles/http-testing.umd.js', + '@angular/router/testing': 'npm:@angular/router/bundles/router-testing.umd.js', + '@angular/forms/testing': 'npm:@angular/forms/bundles/forms-testing.umd.js', + }, }); System.import('systemjs.config.js') - .then(() => Promise.all([ - System.import('@angular/core/testing'), - System.import('@angular/platform-browser-dynamic/testing') - ])) - .then((providers) => { - var coreTesting = providers[0]; + .then(importSystemJsExtras) + .then(initTestBed) + .then(initTesting); + +/** Optional SystemJS configuration extras. Keep going w/o it */ +function importSystemJsExtras(){ + return System.import('systemjs.config.extras.js') + .catch(function(reason) { + console.log( + 'WARNING: System.import could not load "systemjs.config.extras.js"; continuing without it.' + ); + console.log(reason); + }); +} + +function initTestBed(){ + return Promise.all([ + System.import('@angular/core/testing'), + System.import('@angular/platform-browser-dynamic/testing') + ]) + + .then(function (providers) { + var coreTesting = providers[0]; var browserTesting = providers[1]; - coreTesting.TestBed.initTestEnvironment( - browserTesting.BrowserDynamicTestingModule, - browserTesting.platformBrowserDynamicTesting()); + coreTesting.TestBed.initTestEnvironment( + browserTesting.BrowserDynamicTestingModule, + browserTesting.platformBrowserDynamicTesting()); }) - .then(function () { - // Finally, load all spec files. - // This will run the tests directly. +} + +// Import all spec files and start karma +function initTesting () { return Promise.all( allSpecFiles.map(function (moduleName) { return System.import(moduleName); - })); - }) + }) + ) .then(__karma__.start, __karma__.error); +} diff --git a/karma.conf.js b/karma.conf.js index afe043f85..0f63f12ea 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -1,7 +1,12 @@ +// #docregion module.exports = function(config) { - var appBase = 'app/'; // transpiled app JS files - var appAssets ='/base/app/'; // component assets fetched by Angular's compiler + var appBase = 'app/'; // transpiled app JS and map files + var appSrcBase = 'app/'; // app source TS files + var appAssets = '/base/app/'; // component assets fetched by Angular's compiler + + var testBase = 'testing/'; // transpiled test JS and map files + var testSrcBase = 'testing/'; // test source TS files config.set({ basePath: '', @@ -26,9 +31,9 @@ module.exports = function(config) { // Polyfills 'node_modules/core-js/client/shim.js', - - // Reflect and Zone.js 'node_modules/reflect-metadata/Reflect.js', + + // zone.js 'node_modules/zone.js/dist/zone.js', 'node_modules/zone.js/dist/long-stack-trace-zone.js', 'node_modules/zone.js/dist/proxy.js', @@ -37,31 +42,37 @@ module.exports = function(config) { 'node_modules/zone.js/dist/async-test.js', 'node_modules/zone.js/dist/fake-async-test.js', - // RxJs. + // RxJs { pattern: 'node_modules/rxjs/**/*.js', included: false, watched: false }, { pattern: 'node_modules/rxjs/**/*.js.map', included: false, watched: false }, - // Angular 2 itself and the testing library + // Paths loaded via module imports: + // Angular itself {pattern: 'node_modules/@angular/**/*.js', included: false, watched: false}, {pattern: 'node_modules/@angular/**/*.js.map', included: false, watched: false}, {pattern: 'systemjs.config.js', included: false, watched: false}, + {pattern: 'systemjs.config.extras.js', included: false, watched: false}, 'karma-test-shim.js', // transpiled application & spec code paths loaded via module imports {pattern: appBase + '**/*.js', included: false, watched: true}, + {pattern: testBase + '**/*.js', included: false, watched: true}, + - // asset (HTML & CSS) paths loaded via Angular's component compiler + // Asset (HTML & CSS) paths loaded via Angular's component compiler // (these paths need to be rewritten, see proxies section) {pattern: appBase + '**/*.html', included: false, watched: true}, {pattern: appBase + '**/*.css', included: false, watched: true}, - // paths for debugging with source maps in dev tools - {pattern: appBase + '**/*.ts', included: false, watched: false}, - {pattern: appBase + '**/*.js.map', included: false, watched: false} + // Paths for debugging with source maps in dev tools + {pattern: appSrcBase + '**/*.ts', included: false, watched: false}, + {pattern: appBase + '**/*.js.map', included: false, watched: false}, + {pattern: testSrcBase + '**/*.ts', included: false, watched: false}, + {pattern: testBase + '**/*.js.map', included: false, watched: false} ], - // proxied base paths for loading assets + // Proxied base paths for loading assets proxies: { // required for component assets fetched by Angular's compiler "/app/": appAssets diff --git a/systemjs.config.js b/systemjs.config.js index 41b9c83a1..1cb77a8f4 100644 --- a/systemjs.config.js +++ b/systemjs.config.js @@ -23,18 +23,8 @@ '@angular/router': 'npm:@angular/router/bundles/router.umd.js', '@angular/forms': 'npm:@angular/forms/bundles/forms.umd.js', - // angular testing umd bundles - '@angular/core/testing': 'npm:@angular/core/bundles/core-testing.umd.js', - '@angular/common/testing': 'npm:@angular/common/bundles/common-testing.umd.js', - '@angular/compiler/testing': 'npm:@angular/compiler/bundles/compiler-testing.umd.js', - '@angular/platform-browser/testing': 'npm:@angular/platform-browser/bundles/platform-browser-testing.umd.js', - '@angular/platform-browser-dynamic/testing': 'npm:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic-testing.umd.js', - '@angular/http/testing': 'npm:@angular/http/bundles/http-testing.umd.js', - '@angular/router/testing': 'npm:@angular/router/bundles/router-testing.umd.js', - '@angular/forms/testing': 'npm:@angular/forms/bundles/forms-testing.umd.js', - // other libraries - 'rxjs': 'npm:rxjs', + 'rxjs': 'npm:rxjs', 'angular2-in-memory-web-api': 'npm:angular2-in-memory-web-api', }, // packages tells the System loader how to load when no filename and/or no extension diff --git a/wallaby.js b/wallaby.js index 28053a11f..ba8397a7d 100644 --- a/wallaby.js +++ b/wallaby.js @@ -3,26 +3,31 @@ // Note: Wallaby is not open source and costs money module.exports = function () { - return { files: [ // System.js for module loading {pattern: 'node_modules/systemjs/dist/system.js', instrument: false}, {pattern: 'systemjs.config.js', instrument: false}, + {pattern: 'systemjs.config.extras.js', instrument: false}, // Polyfills {pattern: 'node_modules/core-js/client/shim.min.js', instrument: false}, - - // Reflect, Zone.js, and test shims - // Rx.js, Angular 2 itself, and the testing library not here because loaded by systemjs {pattern: 'node_modules/reflect-metadata/Reflect.js', instrument: false}, + + // zone.js {pattern: 'node_modules/zone.js/dist/zone.js', instrument: false}, + {pattern: 'node_modules/zone.js/dist/long-stack-trace-zone.js', instrument: false}, + {pattern: 'node_modules/zone.js/dist/proxy.js', instrument: false}, + {pattern: 'node_modules/zone.js/dist/sync-test.js', instrument: false}, {pattern: 'node_modules/zone.js/dist/jasmine-patch.js', instrument: false}, {pattern: 'node_modules/zone.js/dist/async-test.js', instrument: false}, {pattern: 'node_modules/zone.js/dist/fake-async-test.js', instrument: false}, + // application (but not specs) loaded via module imports {pattern: 'app/**/*+(ts|html|css)', load: false}, - {pattern: 'app/**/*.spec.ts', ignore: true} + {pattern: 'app/**/*.spec.ts', ignore: true}, + + {pattern: 'testing/**/*+(ts|html|css)', load: false}, ], tests: [ @@ -37,41 +42,78 @@ module.exports = function () { debug: true, - bootstrap: function (wallaby) { - wallaby.delayStart(); - - System.config({ - packageWithIndex: true // sadly, we can't use umd packages (yet?) - }); - - System.import('systemjs.config.js') - .then(function () { - return Promise.all([ - System.import('@angular/core/testing'), - System.import('@angular/platform-browser-dynamic/testing') - ]) - }) - .then(function (providers) { - var testing = providers[0]; - var testingBrowser = providers[1]; - - testing.setBaseTestProviders( - testingBrowser.TEST_BROWSER_DYNAMIC_PLATFORM_PROVIDERS, - testingBrowser.TEST_BROWSER_DYNAMIC_APPLICATION_PROVIDERS); - - // Load all spec files - return Promise.all(wallaby.tests.map(function (specFile) { - return System.import(specFile); - })); - }) - .then(function () { - wallaby.start(); - }) - .catch(function (e) { - setTimeout(function () { - throw e; - }, 0); - }); - } + bootstrap: bootstrap }; }; + +// Like karma-test-shim.js +function bootstrap (wallaby) { + wallaby.delayStart(); + + System.config({ + // Extend usual application package list with test folder + packages: { 'testing': { main: 'index.js', defaultExtension: 'js' } }, + + // Assume npm: is set in `paths` in systemjs.config + // Map the angular testing umd bundles + map: { + '@angular/core/testing': 'npm:@angular/core/bundles/core-testing.umd.js', + '@angular/common/testing': 'npm:@angular/common/bundles/common-testing.umd.js', + '@angular/compiler/testing': 'npm:@angular/compiler/bundles/compiler-testing.umd.js', + '@angular/platform-browser/testing': 'npm:@angular/platform-browser/bundles/platform-browser-testing.umd.js', + '@angular/platform-browser-dynamic/testing': 'npm:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic-testing.umd.js', + '@angular/http/testing': 'npm:@angular/http/bundles/http-testing.umd.js', + '@angular/router/testing': 'npm:@angular/router/bundles/router-testing.umd.js', + '@angular/forms/testing': 'npm:@angular/forms/bundles/forms-testing.umd.js', + }, + }); + + System.import('systemjs.config.js') + .then(importSystemJsExtras) + .then(initTestBed) + .then(initTesting); + + /** Optional SystemJS configuration extras. Keep going w/o it */ + function importSystemJsExtras(){ + return System.import('systemjs.config.extras.js') + .catch(function(reason) { + console.log( + 'WARNING: System.import could not load "systemjs.config.extras.js"; continuing without it.' + ); + console.log(reason); + }); + } + + function initTestBed(){ + return Promise.all([ + System.import('@angular/core/testing'), + System.import('@angular/platform-browser-dynamic/testing') + ]) + + .then(function (providers) { + var coreTesting = providers[0]; + var browserTesting = providers[1]; + + coreTesting.TestBed.initTestEnvironment( + browserTesting.BrowserDynamicTestingModule, + browserTesting.platformBrowserDynamicTesting()); + }) + } + + // Load all spec files and start wallaby + function initTesting () { + return Promise.all( + wallaby.tests.map(function (specFile) { + return System.import(specFile); + }) + ) + .then(function () { + wallaby.start(); + }) + .catch(function (e) { + setTimeout(function () { + throw e; + }, 0); + }); + } +} From 73f4a820f271e9463103dfb52f92989abfa9c284 Mon Sep 17 00:00:00 2001 From: Deborah Kurata Date: Fri, 2 Sep 2016 01:08:21 -0700 Subject: [PATCH 12/83] Update typings for RC 6 to match quickstart docs (#205) --- typings.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/typings.json b/typings.json index 57266b144..146c8759d 100644 --- a/typings.json +++ b/typings.json @@ -1,9 +1,9 @@ { "globalDependencies": { "angular-protractor": "registry:dt/angular-protractor#1.5.0+20160425143459", - "core-js": "registry:dt/core-js#0.0.0+20160602141332", + "core-js": "registry:dt/core-js#0.0.0+20160725163759", "jasmine": "registry:dt/jasmine#2.2.0+20160621224255", - "node": "registry:dt/node#6.0.0+20160807145350", + "node": "registry:dt/node#6.0.0+20160831021119", "selenium-webdriver": "registry:dt/selenium-webdriver#2.44.0+20160317120654" } } From 3802aeb62380c90ecbb46a018da45fa9106ef654 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Rodr=C3=ADguez?= Date: Thu, 8 Sep 2016 13:51:26 +0200 Subject: [PATCH 13/83] chore: add doctype (#183) --- index.html | 1 + 1 file changed, 1 insertion(+) diff --git a/index.html b/index.html index 64e3d56b7..5f9bba4f8 100644 --- a/index.html +++ b/index.html @@ -1,3 +1,4 @@ + Angular 2 QuickStart From def6b934bae39bed74b0247788da91ada6a3a2f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Rodr=C3=ADguez?= Date: Tue, 13 Sep 2016 12:57:44 +0200 Subject: [PATCH 14/83] chore: bump to rc7 (#214) --- package.json | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/package.json b/package.json index bde98269b..cd5e5a850 100644 --- a/package.json +++ b/package.json @@ -22,23 +22,23 @@ "author": "", "license": "ISC", "dependencies": { - "@angular/common": "2.0.0-rc.6", - "@angular/compiler": "2.0.0-rc.6", - "@angular/core": "2.0.0-rc.6", - "@angular/forms": "2.0.0-rc.6", - "@angular/http": "2.0.0-rc.6", - "@angular/platform-browser": "2.0.0-rc.6", - "@angular/platform-browser-dynamic": "2.0.0-rc.6", - "@angular/router": "3.0.0-rc.2", - "@angular/upgrade": "2.0.0-rc.6", + "@angular/common": "2.0.0-rc.7", + "@angular/compiler": "2.0.0-rc.7", + "@angular/core": "2.0.0-rc.7", + "@angular/forms": "2.0.0-rc.7", + "@angular/http": "2.0.0-rc.7", + "@angular/platform-browser": "2.0.0-rc.7", + "@angular/platform-browser-dynamic": "2.0.0-rc.7", + "@angular/router": "3.0.0-rc.3", + "@angular/upgrade": "2.0.0-rc.7", "systemjs": "0.19.27", "core-js": "^2.4.1", "reflect-metadata": "^0.1.3", - "rxjs": "5.0.0-beta.11", - "zone.js": "^0.6.17", + "rxjs": "5.0.0-beta.12", + "zone.js": "^0.6.21", - "angular2-in-memory-web-api": "0.0.18", + "angular2-in-memory-web-api": "0.0.19", "bootstrap": "^3.3.6" }, "devDependencies": { From bb9a0a2b50a2a6465b650f38863110f0d605fb73 Mon Sep 17 00:00:00 2001 From: Filipe Silva Date: Wed, 14 Sep 2016 11:10:56 +0100 Subject: [PATCH 15/83] fix(e2e): create output dir if it doesn't exist (#217) Fix #196 Fix #201 --- protractor.config.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/protractor.config.js b/protractor.config.js index fcadab644..1de69cf6a 100644 --- a/protractor.config.js +++ b/protractor.config.js @@ -129,7 +129,26 @@ function Reporter(options) { fs.appendFileSync(outputFile, output); }; + function ensureDirectoryExistence(filePath) { + var dirname = path.dirname(filePath); + if (directoryExists(dirname)) { + return true; + } + ensureDirectoryExistence(dirname); + fs.mkdirSync(dirname); + } + + function directoryExists(path) { + try { + return fs.statSync(path).isDirectory(); + } + catch (err) { + return false; + } + } + function initOutputFile(outputFile) { + ensureDirectoryExistence(outputFile); var header = "Protractor results for: " + (new Date()).toLocaleString() + "\n\n"; fs.writeFileSync(outputFile, header); } From d3a977e900f0ab25ec57e54f5be9e6184f5e44d5 Mon Sep 17 00:00:00 2001 From: Filipe Silva Date: Wed, 14 Sep 2016 18:16:59 +0100 Subject: [PATCH 16/83] chore: update to TS2.0 (#216) This PR updates TypeScript from 1.8.10 to 2.0.2. It does not replace `typings` with `@types`, that will happen in https://github.com/angular/quickstart/pull/157. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index cd5e5a850..57258810d 100644 --- a/package.json +++ b/package.json @@ -44,7 +44,7 @@ "devDependencies": { "concurrently": "^2.2.0", "lite-server": "^2.2.0", - "typescript": "^1.8.10", + "typescript": "^2.0.2", "typings": "^1.0.4", "canonical-path": "0.0.2", From f95cf4179c9ac541a94bda03719d00615ef26251 Mon Sep 17 00:00:00 2001 From: Filipe Silva Date: Thu, 15 Sep 2016 03:51:54 +0100 Subject: [PATCH 17/83] chore: update to Angular 2.0.0 (#221) --- CHANGELOG.md | 7 +++++++ package.json | 22 +++++++++++----------- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 86b8c687d..56d16ce1e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,15 @@ + +# 0.2.9 (2016-09-14) +* Angular 2.0.0 version +* Update to Typescript 2.0.2 +* Fix e2e test missing dir + # 0.2.8 (2016-09-01) * remove @angular test libraries from system.js (now in shim) * update test related files * wallaby doesn't completely work. Researching. + # 0.2.7 (2016-08-31) * Angular 2 RC6 version diff --git a/package.json b/package.json index 57258810d..d7532e3ac 100644 --- a/package.json +++ b/package.json @@ -22,23 +22,23 @@ "author": "", "license": "ISC", "dependencies": { - "@angular/common": "2.0.0-rc.7", - "@angular/compiler": "2.0.0-rc.7", - "@angular/core": "2.0.0-rc.7", - "@angular/forms": "2.0.0-rc.7", - "@angular/http": "2.0.0-rc.7", - "@angular/platform-browser": "2.0.0-rc.7", - "@angular/platform-browser-dynamic": "2.0.0-rc.7", - "@angular/router": "3.0.0-rc.3", - "@angular/upgrade": "2.0.0-rc.7", + "@angular/common": "2.0.0", + "@angular/compiler": "2.0.0", + "@angular/core": "2.0.0", + "@angular/forms": "2.0.0", + "@angular/http": "2.0.0", + "@angular/platform-browser": "2.0.0", + "@angular/platform-browser-dynamic": "2.0.0", + "@angular/router": "3.0.0", + "@angular/upgrade": "2.0.0", "systemjs": "0.19.27", "core-js": "^2.4.1", "reflect-metadata": "^0.1.3", "rxjs": "5.0.0-beta.12", - "zone.js": "^0.6.21", + "zone.js": "^0.6.23", - "angular2-in-memory-web-api": "0.0.19", + "angular2-in-memory-web-api": "0.0.20", "bootstrap": "^3.3.6" }, "devDependencies": { From 607adf63399e7cf8f1a26f28853a745cefab44d2 Mon Sep 17 00:00:00 2001 From: Ward Bell Date: Mon, 19 Sep 2016 21:14:13 -0700 Subject: [PATCH 18/83] chore: replace "angular 2" with "angular" --- CHANGELOG.md | 5 +++++ Dockerfile | 4 ++-- README.md | 6 +++--- app/app.component.spec.ts | 2 +- app/app.component.ts | 2 +- e2e/app.e2e-spec.ts | 2 +- index.html | 2 +- package.json | 2 +- protractor.config.js | 2 +- systemjs.config.js | 2 +- 10 files changed, 17 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 56d16ce1e..07e61fb9c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ + +# 0.2.10 (2016-09-19) +* All "Angular 2" references become just "Angular" +* No code changes + # 0.2.9 (2016-09-14) * Angular 2.0.0 version diff --git a/Dockerfile b/Dockerfile index 724cbf350..eb5aae757 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ # To build and run with Docker: # -# $ docker build -t ng2-quickstart . -# $ docker run -it --rm -p 3000:3000 -p 3001:3001 ng2-quickstart +# $ docker build -t ng-quickstart . +# $ docker run -it --rm -p 3000:3000 -p 3001:3001 ng-quickstart # FROM node:latest diff --git a/README.md b/README.md index 9aa466c90..9451b0f99 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Angular 2 QuickStart Source +# Angular QuickStart Source [![Build Status][travis-badge]][travis-badge-url] This repository holds the TypeScript source code of the [angular.io quickstart](https://angular.io/docs/ts/latest/quickstart.html), @@ -7,14 +7,14 @@ the foundation for most of the documentation samples and potentially a good star It's been extended with testing support so you can start writing tests immediately. **This is not the perfect arrangement for your application. It is not designed for production. -It exists primarily to get you started quickly with learning and prototyping in Angular 2** +It exists primarily to get you started quickly with learning and prototyping in Angular** We are unlikely to accept suggestions about how to grow this QuickStart into something it is not. Please keep that in mind before posting issues and PRs. ## Prerequisites -Node.js and npm are essential to Angular 2 development. +Node.js and npm are essential to Angular development. Get it now if it's not already installed on your machine. diff --git a/app/app.component.spec.ts b/app/app.component.spec.ts index 211fadfda..20f458b23 100644 --- a/app/app.component.spec.ts +++ b/app/app.component.spec.ts @@ -32,6 +32,6 @@ describe('AppComponent with TCB', function () { h1 = fixture.debugElement.query(By.css('h1')).nativeElement; // preferred - expect(h1.innerText).toMatch(/angular 2 app/i, '

should say something about "Angular 2 App"'); + expect(h1.innerText).toMatch(/angular app/i, '

should say something about "Angular App"'); }); }); diff --git a/app/app.component.ts b/app/app.component.ts index da0e1ba7a..83919ca76 100644 --- a/app/app.component.ts +++ b/app/app.component.ts @@ -2,6 +2,6 @@ import { Component } from '@angular/core'; @Component({ selector: 'my-app', - template: '

My First Angular 2 App

' + template: '

My First Angular App

' }) export class AppComponent { } diff --git a/e2e/app.e2e-spec.ts b/e2e/app.e2e-spec.ts index 54ba789f7..8db702bd4 100644 --- a/e2e/app.e2e-spec.ts +++ b/e2e/app.e2e-spec.ts @@ -1,7 +1,7 @@ describe('QuickStart E2E Tests', function () { - let expectedMsg = 'My First Angular 2 App'; + let expectedMsg = 'My First Angular App'; beforeEach(function () { diff --git a/index.html b/index.html index 5f9bba4f8..c0b1c4431 100644 --- a/index.html +++ b/index.html @@ -1,7 +1,7 @@ - Angular 2 QuickStart + Angular QuickStart diff --git a/package.json b/package.json index d7532e3ac..5891c4fb6 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "angular2-quickstart", + "name": "angular-quickstart", "version": "1.0.0", "description": "QuickStart package.json from the documentation, supplemented with testing support", "scripts": { diff --git a/protractor.config.js b/protractor.config.js index 1de69cf6a..8b2250590 100644 --- a/protractor.config.js +++ b/protractor.config.js @@ -30,7 +30,7 @@ exports.config = { specs: ['**/*e2e-spec.js' ], - // For angular2 tests + // For angular tests useAllAngular2AppRoots: true, // Base URL for application server diff --git a/systemjs.config.js b/systemjs.config.js index 1cb77a8f4..40d872491 100644 --- a/systemjs.config.js +++ b/systemjs.config.js @@ -1,5 +1,5 @@ /** - * System configuration for Angular 2 samples + * System configuration for Angular samples * Adjust as necessary for your application needs. */ (function (global) { From ea70d3a88dae6d3c104bb60fe343caf037e1bb76 Mon Sep 17 00:00:00 2001 From: Ward Bell Date: Sun, 25 Sep 2016 15:51:21 -0700 Subject: [PATCH 19/83] chore: update for "angular-in-memory-web-api" & latest testing setup --- karma-test-shim.js | 2 +- karma.conf.js | 6 ++++-- package.json | 30 +++++++++++++++++------------- systemjs.config.js | 7 ++++--- wallaby.js | 2 +- 5 files changed, 27 insertions(+), 20 deletions(-) diff --git a/karma-test-shim.js b/karma-test-shim.js index 642b29af0..19fcc89fe 100644 --- a/karma-test-shim.js +++ b/karma-test-shim.js @@ -56,7 +56,7 @@ function importSystemJsExtras(){ return System.import('systemjs.config.extras.js') .catch(function(reason) { console.log( - 'WARNING: System.import could not load "systemjs.config.extras.js"; continuing without it.' + 'Warning: System.import could not load the optional "systemjs.config.extras.js". Did you omit it by accident? Continuing without it.' ); console.log(reason); }); diff --git a/karma.conf.js b/karma.conf.js index 0f63f12ea..1e2d29372 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -14,7 +14,8 @@ module.exports = function(config) { plugins: [ require('karma-jasmine'), require('karma-chrome-launcher'), - require('karma-htmlfile-reporter') + require('karma-jasmine-html-reporter'), // click "Debug" in browser to see it + require('karma-htmlfile-reporter') // crashing w/ strange socket error ], customLaunchers: { @@ -80,7 +81,8 @@ module.exports = function(config) { exclude: [], preprocessors: {}, - reporters: ['progress', 'html'], + // disabled HtmlReporter; suddenly crashing w/ strange socket error + reporters: ['progress', 'kjhtml'],//'html'], // HtmlReporter configuration htmlReporter: { diff --git a/package.json b/package.json index 5891c4fb6..e011a241f 100644 --- a/package.json +++ b/package.json @@ -32,31 +32,35 @@ "@angular/router": "3.0.0", "@angular/upgrade": "2.0.0", - "systemjs": "0.19.27", + "systemjs": "0.19.38", "core-js": "^2.4.1", "reflect-metadata": "^0.1.3", "rxjs": "5.0.0-beta.12", "zone.js": "^0.6.23", - "angular2-in-memory-web-api": "0.0.20", + "angular-in-memory-web-api": "~0.1.0", "bootstrap": "^3.3.6" }, "devDependencies": { "concurrently": "^2.2.0", - "lite-server": "^2.2.0", - "typescript": "^2.0.2", - "typings": "^1.0.4", + "lite-server": "^2.2.2", + "typescript": "^2.0.3", + "typings": "^1.4.0", "canonical-path": "0.0.2", "http-server": "^0.9.0", - "tslint": "^3.7.4", - "lodash": "^4.11.1", - "jasmine-core": "~2.4.1", - "karma": "^1.2.0", - "karma-chrome-launcher": "^0.2.3", - "karma-cli": "^0.1.2", - "karma-htmlfile-reporter": "^0.2.2", - "karma-jasmine": "^0.3.8", + "tslint": "^3.15.1", + "lodash": "^4.16.1", + "jasmine-core": "~2.5.2", + "karma": "^1.3.0", + "karma-chrome-launcher": "^2.0.0", + "karma-cli": "^1.0.1", + "karma-htmlfile-reporter": "^0.3.4", + "karma-jasmine": "^1.0.2", + "karma-jasmine-html-reporter": "^0.2.2", + "karma-phantomjs-launcher": "^1.0.2", + "karma-sourcemap-loader": "^0.3.7", + "karma-webpack": "^1.8.0", "protractor": "^3.3.0", "rimraf": "^2.5.2" }, diff --git a/systemjs.config.js b/systemjs.config.js index 40d872491..0ea776d8f 100644 --- a/systemjs.config.js +++ b/systemjs.config.js @@ -22,10 +22,11 @@ '@angular/http': 'npm:@angular/http/bundles/http.umd.js', '@angular/router': 'npm:@angular/router/bundles/router.umd.js', '@angular/forms': 'npm:@angular/forms/bundles/forms.umd.js', + '@angular/upgrade': 'npm:@angular/upgrade/bundles/upgrade.umd.js', // other libraries - 'rxjs': 'npm:rxjs', - 'angular2-in-memory-web-api': 'npm:angular2-in-memory-web-api', + 'rxjs': 'npm:rxjs', + 'angular-in-memory-web-api': 'npm:angular-in-memory-web-api', }, // packages tells the System loader how to load when no filename and/or no extension packages: { @@ -36,7 +37,7 @@ rxjs: { defaultExtension: 'js' }, - 'angular2-in-memory-web-api': { + 'angular-in-memory-web-api': { main: './index.js', defaultExtension: 'js' } diff --git a/wallaby.js b/wallaby.js index ba8397a7d..acc34d35f 100644 --- a/wallaby.js +++ b/wallaby.js @@ -78,7 +78,7 @@ function bootstrap (wallaby) { return System.import('systemjs.config.extras.js') .catch(function(reason) { console.log( - 'WARNING: System.import could not load "systemjs.config.extras.js"; continuing without it.' + 'Warning: System.import could not load the optional "systemjs.config.extras.js". Did you omit it by accident? Continuing without it.' ); console.log(reason); }); From a742988f7629a5eb7966621c7a15ec6a8c509306 Mon Sep 17 00:00:00 2001 From: Ward Bell Date: Sun, 25 Sep 2016 21:22:15 -0700 Subject: [PATCH 20/83] chore: remove 3 unused packages from package.json In response to https://github.com/angular/quickstart/commit/ea70d3a88dae6d3c104bb60fe343caf037e1bb76#commitcomment-19166659 --- package.json | 3 --- 1 file changed, 3 deletions(-) diff --git a/package.json b/package.json index e011a241f..351e38127 100644 --- a/package.json +++ b/package.json @@ -58,9 +58,6 @@ "karma-htmlfile-reporter": "^0.3.4", "karma-jasmine": "^1.0.2", "karma-jasmine-html-reporter": "^0.2.2", - "karma-phantomjs-launcher": "^1.0.2", - "karma-sourcemap-loader": "^0.3.7", - "karma-webpack": "^1.8.0", "protractor": "^3.3.0", "rimraf": "^2.5.2" }, From 482e10343f7a615ff1bf9995e3f330b90a17191f Mon Sep 17 00:00:00 2001 From: Emerson Thompson Date: Tue, 27 Sep 2016 14:44:11 -0300 Subject: [PATCH 21/83] alignment imports s2 (#230) --- app/app.component.spec.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/app.component.spec.ts b/app/app.component.spec.ts index 20f458b23..53a68593d 100644 --- a/app/app.component.spec.ts +++ b/app/app.component.spec.ts @@ -1,9 +1,9 @@ /* tslint:disable:no-unused-variable */ import { AppComponent } from './app.component'; -import { TestBed } from '@angular/core/testing'; +import { TestBed } from '@angular/core/testing'; -import { By } from '@angular/platform-browser'; +import { By } from '@angular/platform-browser'; //////// SPECS ///////////// From c32774ae8c97a3594bc5394e5659a54fa4d425ae Mon Sep 17 00:00:00 2001 From: Ward Bell Date: Tue, 27 Sep 2016 10:45:34 -0700 Subject: [PATCH 22/83] chore: update package.json files to latest pkg versions. Use ~ for Ng. (#231) --- package.json | 35 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/package.json b/package.json index 351e38127..36e1729f5 100644 --- a/package.json +++ b/package.json @@ -22,27 +22,26 @@ "author": "", "license": "ISC", "dependencies": { - "@angular/common": "2.0.0", - "@angular/compiler": "2.0.0", - "@angular/core": "2.0.0", - "@angular/forms": "2.0.0", - "@angular/http": "2.0.0", - "@angular/platform-browser": "2.0.0", - "@angular/platform-browser-dynamic": "2.0.0", - "@angular/router": "3.0.0", - "@angular/upgrade": "2.0.0", + "@angular/common": "~2.0.1", + "@angular/compiler": "~2.0.1", + "@angular/core": "~2.0.1", + "@angular/forms": "~2.0.1", + "@angular/http": "~2.0.1", + "@angular/platform-browser": "~2.0.1", + "@angular/platform-browser-dynamic": "~2.0.1", + "@angular/router": "~3.0.1", + "@angular/upgrade": "~2.0.1", - "systemjs": "0.19.38", + "angular-in-memory-web-api": "~0.1.1", + "bootstrap": "^3.3.7", + "systemjs": "0.19.39", "core-js": "^2.4.1", - "reflect-metadata": "^0.1.3", + "reflect-metadata": "^0.1.8", "rxjs": "5.0.0-beta.12", - "zone.js": "^0.6.23", - - "angular-in-memory-web-api": "~0.1.0", - "bootstrap": "^3.3.6" + "zone.js": "^0.6.25" }, "devDependencies": { - "concurrently": "^2.2.0", + "concurrently": "^3.0.0", "lite-server": "^2.2.2", "typescript": "^2.0.3", "typings": "^1.4.0", @@ -50,7 +49,7 @@ "canonical-path": "0.0.2", "http-server": "^0.9.0", "tslint": "^3.15.1", - "lodash": "^4.16.1", + "lodash": "^4.16.2", "jasmine-core": "~2.5.2", "karma": "^1.3.0", "karma-chrome-launcher": "^2.0.0", @@ -59,7 +58,7 @@ "karma-jasmine": "^1.0.2", "karma-jasmine-html-reporter": "^0.2.2", "protractor": "^3.3.0", - "rimraf": "^2.5.2" + "rimraf": "^2.5.4" }, "repository": {} } From 6473275d70de014e66c7b76d8d41433b370aaf71 Mon Sep 17 00:00:00 2001 From: Ward Bell Date: Mon, 3 Oct 2016 13:10:08 -0700 Subject: [PATCH 23/83] chore: add systemjs.config.extras.js to source control --- systemjs.config.extras.js | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 systemjs.config.extras.js diff --git a/systemjs.config.extras.js b/systemjs.config.extras.js new file mode 100644 index 000000000..027dfe58c --- /dev/null +++ b/systemjs.config.extras.js @@ -0,0 +1,11 @@ +/** + * Add barrels and stuff + * Adjust as necessary for your application needs. + */ +// (function (global) { +// System.config({ +// packages: { +// // add packages here +// } +// }); +// })(this); From 65ca680c8333d694fa025031e4139eec6aadd11c Mon Sep 17 00:00:00 2001 From: Ward Bell Date: Mon, 3 Oct 2016 13:30:38 -0700 Subject: [PATCH 24/83] chore: remove reference to `HTML-Reporter` in README (no longer supported) --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index 9451b0f99..6a58d5d35 100644 --- a/README.md +++ b/README.md @@ -128,8 +128,6 @@ We can update our app and our tests in real-time, keeping a weather eye on the c Karma is occasionally confused and it is often necessary to shut down its browser or even shut the command down (Ctrl-C) and restart it. No worries; it's pretty quick. -The `HTML-Reporter` is also wired in. That produces a prettier output; look for it in `~_test-output/tests.html`. - ### End-to-end (E2E) Tests E2E tests are in the `e2e` directory, side by side with the `app` folder. From 163cfcde74fed1c0d7eea7e52d7021b620a38759 Mon Sep 17 00:00:00 2001 From: Ward Bell Date: Thu, 6 Oct 2016 16:37:12 -0700 Subject: [PATCH 25/83] chore: update to v.2.0.2 --- package.json | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/package.json b/package.json index 36e1729f5..362ac796b 100644 --- a/package.json +++ b/package.json @@ -20,19 +20,24 @@ }, "keywords": [], "author": "", - "license": "ISC", + "licenses": [ + { + "type": "MIT", + "url": "https://github.com/angular/angular.io/blob/master/LICENSE" + } + ], "dependencies": { - "@angular/common": "~2.0.1", - "@angular/compiler": "~2.0.1", - "@angular/core": "~2.0.1", - "@angular/forms": "~2.0.1", - "@angular/http": "~2.0.1", - "@angular/platform-browser": "~2.0.1", - "@angular/platform-browser-dynamic": "~2.0.1", - "@angular/router": "~3.0.1", - "@angular/upgrade": "~2.0.1", + "@angular/common": "~2.0.2", + "@angular/compiler": "~2.0.2", + "@angular/core": "~2.0.2", + "@angular/forms": "~2.0.2", + "@angular/http": "~2.0.2", + "@angular/platform-browser": "~2.0.2", + "@angular/platform-browser-dynamic": "~2.0.2", + "@angular/router": "~3.0.2", + "@angular/upgrade": "~2.0.2", - "angular-in-memory-web-api": "~0.1.1", + "angular-in-memory-web-api": "~0.1.5", "bootstrap": "^3.3.7", "systemjs": "0.19.39", "core-js": "^2.4.1", From caa4817b607f3e8d37fba5fa467ab36483eaed29 Mon Sep 17 00:00:00 2001 From: Ward Bell Date: Thu, 6 Oct 2016 16:50:44 -0700 Subject: [PATCH 26/83] chore: v.2.0.2 + changelog --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 07e61fb9c..938428d71 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ + +# 0.2.11 (2016-10-06) +* Angular v.2.0.2 +* License is MIT +* Current testing configuration +* No code changes + # 0.2.10 (2016-09-19) * All "Angular 2" references become just "Angular" From 639593e6b4369760c6a205538dbe5b0f6df59eb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Rodr=C3=ADguez?= Date: Thu, 13 Oct 2016 15:28:50 +0200 Subject: [PATCH 27/83] chore: release 2.1.0 (#249) --- CHANGELOG.md | 8 ++++++-- package.json | 18 +++++++++--------- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 938428d71..1845e2735 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,10 @@ - + +# 0.2.12 (2016-10-06) +* Angular v2.1.0 + + # 0.2.11 (2016-10-06) -* Angular v.2.0.2 +* Angular v2.0.2 * License is MIT * Current testing configuration * No code changes diff --git a/package.json b/package.json index 362ac796b..3312ea027 100644 --- a/package.json +++ b/package.json @@ -27,15 +27,15 @@ } ], "dependencies": { - "@angular/common": "~2.0.2", - "@angular/compiler": "~2.0.2", - "@angular/core": "~2.0.2", - "@angular/forms": "~2.0.2", - "@angular/http": "~2.0.2", - "@angular/platform-browser": "~2.0.2", - "@angular/platform-browser-dynamic": "~2.0.2", - "@angular/router": "~3.0.2", - "@angular/upgrade": "~2.0.2", + "@angular/common": "~2.1.0", + "@angular/compiler": "~2.1.0", + "@angular/core": "~2.1.0", + "@angular/forms": "~2.1.0", + "@angular/http": "~2.1.0", + "@angular/platform-browser": "~2.1.0", + "@angular/platform-browser-dynamic": "~2.1.0", + "@angular/router": "~3.1.0", + "@angular/upgrade": "~2.1.0", "angular-in-memory-web-api": "~0.1.5", "bootstrap": "^3.3.7", From 341eb5446625553eb8cc60b65ec4e21ef86f2993 Mon Sep 17 00:00:00 2001 From: Robin Janssens Date: Sun, 16 Oct 2016 17:43:29 +0100 Subject: [PATCH 28/83] chore: Update README.md (#253) removed advice about requiring admin access for npm install, start - this is incorrect and bad practise. --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index 6a58d5d35..aebaed3e0 100644 --- a/README.md +++ b/README.md @@ -64,8 +64,6 @@ git push -u origin master Install the npm packages described in the `package.json` and verify that it works: -**Attention Windows Developers: You must run all of these commands in administrator mode**. - ```bash npm install npm start From 544a2faa30a5be0e72d04dca5eb49d55357b3f2b Mon Sep 17 00:00:00 2001 From: Filipe Silva Date: Fri, 21 Oct 2016 01:10:43 +0100 Subject: [PATCH 29/83] chore: update to @types and protractor4 (#157) --- .gitignore | 2 -- Dockerfile | 2 +- README.md | 7 +------ e2e/app.e2e-spec.ts | 1 + package.json | 12 +++++++----- protractor.config.js | 12 ------------ typings.json | 9 --------- 7 files changed, 10 insertions(+), 35 deletions(-) delete mode 100644 typings.json diff --git a/.gitignore b/.gitignore index f23176b5b..f93eca8d7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ .idea -typings/** node_modules jspm_packages link-checker-results.txt @@ -14,5 +13,4 @@ _temp !karma*.js !protractor*.js !systemjs.config.js -!typings/typings.d.ts !wallaby.js diff --git a/Dockerfile b/Dockerfile index eb5aae757..7ad0f4375 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,7 +11,7 @@ RUN mkdir -p /quickstart /home/nodejs && \ chown -R nodejs:nodejs /home/nodejs WORKDIR /quickstart -COPY package.json typings.json /quickstart/ +COPY package.json /quickstart/ RUN npm install --unsafe-perm=true COPY . /quickstart diff --git a/README.md b/README.md index aebaed3e0..825e4dc12 100644 --- a/README.md +++ b/README.md @@ -69,10 +69,6 @@ npm install npm start ``` -> If the `typings` folder doesn't show up after `npm install` please install them manually with: - -> `npm run typings -- install` - The `npm start` command first compiles the application, then simultaneously re-compiles and runs the `lite-server`. Both the compiler and the server watch for file changes. @@ -92,8 +88,7 @@ We've captured many of the most useful commands in npm scripts defined in the `p [John Papa](https://github.com/johnpapa) and [Christopher Martin](https://github.com/cgmartin) with excellent support for Angular apps that use routing. -* `npm run typings` - runs the typings tool. -* `npm run postinstall` - called by *npm* automatically *after* it successfully completes package installation. This script installs the TypeScript definition files this app requires. + Here are the test related scripts: * `npm test` - compiles, runs and watches the karma unit tests * `npm run e2e` - run protractor e2e tests, written in JavaScript (*e2e-spec.js) diff --git a/e2e/app.e2e-spec.ts b/e2e/app.e2e-spec.ts index 8db702bd4..34b496c76 100644 --- a/e2e/app.e2e-spec.ts +++ b/e2e/app.e2e-spec.ts @@ -1,3 +1,4 @@ +import { browser, element, by } from 'protractor'; describe('QuickStart E2E Tests', function () { diff --git a/package.json b/package.json index 3312ea027..e9a3260d6 100644 --- a/package.json +++ b/package.json @@ -10,12 +10,10 @@ "e2e": "tsc && concurrently \"http-server -s\" \"protractor protractor.config.js\" --kill-others --success first", "lint": "tslint ./app/**/*.ts -t verbose", "lite": "lite-server", - "postinstall": "typings install", "test": "tsc && concurrently \"tsc -w\" \"karma start karma.conf.js\"", "test-once": "tsc && karma start karma.conf.js --single-run", "tsc": "tsc", "tsc:w": "tsc -w", - "typings": "typings", "webdriver:update": "webdriver-manager update" }, "keywords": [], @@ -49,7 +47,6 @@ "concurrently": "^3.0.0", "lite-server": "^2.2.2", "typescript": "^2.0.3", - "typings": "^1.4.0", "canonical-path": "0.0.2", "http-server": "^0.9.0", @@ -62,8 +59,13 @@ "karma-htmlfile-reporter": "^0.3.4", "karma-jasmine": "^1.0.2", "karma-jasmine-html-reporter": "^0.2.2", - "protractor": "^3.3.0", - "rimraf": "^2.5.4" + "protractor": "^4.0.9", + "rimraf": "^2.5.4", + + "@types/core-js": "^0.9.34", + "@types/node": "^6.0.45", + "@types/jasmine": "^2.5.35", + "@types/selenium-webdriver": "^2.53.32" }, "repository": {} } diff --git a/protractor.config.js b/protractor.config.js index 8b2250590..8314510c5 100644 --- a/protractor.config.js +++ b/protractor.config.js @@ -49,8 +49,6 @@ exports.config = { // console.log('browser.params:' + JSON.stringify(browser.params)); jasmine.getEnv().addReporter(new Reporter( browser.params )) ; - global.sendKeys = sendKeys; - // Allow changing bootstrap mode to NG1 for upgrade tests global.setProtractorToNg1Mode = function() { browser.useAllAngular2AppRoots = false; @@ -66,16 +64,6 @@ exports.config = { } }; -// Hack - because of bug with protractor send keys -function sendKeys(element, str) { - return str.split('').reduce(function (promise, char) { - return promise.then(function () { - return element.sendKeys(char); - }); - }, element.getAttribute('value')); - // better to create a resolved promise here but ... don't know how with protractor; - } - // Custom reporter function Reporter(options) { var _defaultOutputFile = path.resolve(process.cwd(), './_test-output', 'protractor-results.txt'); diff --git a/typings.json b/typings.json deleted file mode 100644 index 146c8759d..000000000 --- a/typings.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "globalDependencies": { - "angular-protractor": "registry:dt/angular-protractor#1.5.0+20160425143459", - "core-js": "registry:dt/core-js#0.0.0+20160725163759", - "jasmine": "registry:dt/jasmine#2.2.0+20160621224255", - "node": "registry:dt/node#6.0.0+20160831021119", - "selenium-webdriver": "registry:dt/selenium-webdriver#2.44.0+20160317120654" - } -} From 068ed638ce6a0aeca5aa43644975798532e91b37 Mon Sep 17 00:00:00 2001 From: Ward Bell Date: Thu, 20 Oct 2016 18:23:25 -0700 Subject: [PATCH 30/83] chore: update in-mem-web-api pkg to v.0.1.13 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e9a3260d6..d06fcb5c0 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,7 @@ "@angular/router": "~3.1.0", "@angular/upgrade": "~2.1.0", - "angular-in-memory-web-api": "~0.1.5", + "angular-in-memory-web-api": "~0.1.13", "bootstrap": "^3.3.7", "systemjs": "0.19.39", "core-js": "^2.4.1", From e33ed9a3adb1e1b9639bd16bcf27e621aba6e092 Mon Sep 17 00:00:00 2001 From: Ward Bell Date: Thu, 20 Oct 2016 21:29:53 -0700 Subject: [PATCH 31/83] chore: v.2.1.1 + move to @types (0.2.13) --- CHANGELOG.md | 6 ++++++ package.json | 22 +++++++++++----------- tsconfig.json | 11 +++++++++-- 3 files changed, 26 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1845e2735..d9bc1b9f7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ + +# 0.2.13 (2016-10-20) +* Protractor 4 +* Move from `typings` to `@types`. See `tsconfig.json` changes. +* Angular v2.1.1 + # 0.2.12 (2016-10-06) * Angular v2.1.0 diff --git a/package.json b/package.json index d06fcb5c0..2f6b6395e 100644 --- a/package.json +++ b/package.json @@ -25,15 +25,15 @@ } ], "dependencies": { - "@angular/common": "~2.1.0", - "@angular/compiler": "~2.1.0", - "@angular/core": "~2.1.0", - "@angular/forms": "~2.1.0", - "@angular/http": "~2.1.0", - "@angular/platform-browser": "~2.1.0", - "@angular/platform-browser-dynamic": "~2.1.0", - "@angular/router": "~3.1.0", - "@angular/upgrade": "~2.1.0", + "@angular/common": "~2.1.1", + "@angular/compiler": "~2.1.1", + "@angular/core": "~2.1.1", + "@angular/forms": "~2.1.1", + "@angular/http": "~2.1.1", + "@angular/platform-browser": "~2.1.1", + "@angular/platform-browser-dynamic": "~2.1.1", + "@angular/router": "~3.1.1", + "@angular/upgrade": "~2.1.1", "angular-in-memory-web-api": "~0.1.13", "bootstrap": "^3.3.7", @@ -41,10 +41,10 @@ "core-js": "^2.4.1", "reflect-metadata": "^0.1.8", "rxjs": "5.0.0-beta.12", - "zone.js": "^0.6.25" + "zone.js": "^0.6.26" }, "devDependencies": { - "concurrently": "^3.0.0", + "concurrently": "^3.1.0", "lite-server": "^2.2.2", "typescript": "^2.0.3", diff --git a/tsconfig.json b/tsconfig.json index fd1d10190..a29a7acca 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -8,6 +8,13 @@ "experimentalDecorators": true, "removeComments": false, "noImplicitAny": true, - "suppressImplicitAnyIndexErrors": true - } + "suppressImplicitAnyIndexErrors": true, + "typeRoots": [ + "./node_modules/@types/" + ] + }, + + "exclude": [ + "node_modules/*" + ] } From 2891223d450836d92c0d09bf884f3763b63fb16b Mon Sep 17 00:00:00 2001 From: Emerson Thompson Date: Fri, 21 Oct 2016 01:44:31 -0300 Subject: [PATCH 32/83] chore: standardizing of spaces in karma.conf.js (#244) --- karma.conf.js | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/karma.conf.js b/karma.conf.js index 1e2d29372..b67ba3d15 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -49,28 +49,28 @@ module.exports = function(config) { // Paths loaded via module imports: // Angular itself - {pattern: 'node_modules/@angular/**/*.js', included: false, watched: false}, - {pattern: 'node_modules/@angular/**/*.js.map', included: false, watched: false}, + { pattern: 'node_modules/@angular/**/*.js', included: false, watched: false }, + { pattern: 'node_modules/@angular/**/*.js.map', included: false, watched: false }, - {pattern: 'systemjs.config.js', included: false, watched: false}, - {pattern: 'systemjs.config.extras.js', included: false, watched: false}, + { pattern: 'systemjs.config.js', included: false, watched: false }, + { pattern: 'systemjs.config.extras.js', included: false, watched: false }, 'karma-test-shim.js', // transpiled application & spec code paths loaded via module imports - {pattern: appBase + '**/*.js', included: false, watched: true}, - {pattern: testBase + '**/*.js', included: false, watched: true}, + { pattern: appBase + '**/*.js', included: false, watched: true }, + { pattern: testBase + '**/*.js', included: false, watched: true }, // Asset (HTML & CSS) paths loaded via Angular's component compiler // (these paths need to be rewritten, see proxies section) - {pattern: appBase + '**/*.html', included: false, watched: true}, - {pattern: appBase + '**/*.css', included: false, watched: true}, + { pattern: appBase + '**/*.html', included: false, watched: true }, + { pattern: appBase + '**/*.css', included: false, watched: true }, // Paths for debugging with source maps in dev tools - {pattern: appSrcBase + '**/*.ts', included: false, watched: false}, - {pattern: appBase + '**/*.js.map', included: false, watched: false}, - {pattern: testSrcBase + '**/*.ts', included: false, watched: false}, - {pattern: testBase + '**/*.js.map', included: false, watched: false} + { pattern: appSrcBase + '**/*.ts', included: false, watched: false }, + { pattern: appBase + '**/*.js.map', included: false, watched: false }, + { pattern: testSrcBase + '**/*.ts', included: false, watched: false }, + { pattern: testBase + '**/*.js.map', included: false, watched: false } ], // Proxied base paths for loading assets From 541bdc5f634e1142860c56cace247234edfaf74b Mon Sep 17 00:00:00 2001 From: Ward Bell Date: Sun, 23 Oct 2016 00:11:56 -0700 Subject: [PATCH 33/83] chore: update systemjs.config for in-mem-web-api --- systemjs.config.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/systemjs.config.js b/systemjs.config.js index 0ea776d8f..457f040fc 100644 --- a/systemjs.config.js +++ b/systemjs.config.js @@ -26,7 +26,7 @@ // other libraries 'rxjs': 'npm:rxjs', - 'angular-in-memory-web-api': 'npm:angular-in-memory-web-api', + 'angular-in-memory-web-api': 'npm:angular-in-memory-web-api/bundles/in-memory-web-api.umd.js' }, // packages tells the System loader how to load when no filename and/or no extension packages: { @@ -36,10 +36,6 @@ }, rxjs: { defaultExtension: 'js' - }, - 'angular-in-memory-web-api': { - main: './index.js', - defaultExtension: 'js' } } }); From 80684c1d0d03d6ccb85757ba46f4a7c962aedb43 Mon Sep 17 00:00:00 2001 From: Natasha Kaweski Date: Sun, 23 Oct 2016 05:13:15 -0200 Subject: [PATCH 34/83] Updating README.md (#258) --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 825e4dc12..d26f1edfb 100644 --- a/README.md +++ b/README.md @@ -73,7 +73,7 @@ The `npm start` command first compiles the application, then simultaneously re-compiles and runs the `lite-server`. Both the compiler and the server watch for file changes. -Shut it down manually with Ctrl-C. +Shut it down manually with `Ctrl-C`. You're ready to write your application. @@ -114,11 +114,11 @@ Run it with `npm test` That command first compiles the application, then simultaneously re-compiles and runs the karma test-runner. Both the compiler and the karma watch for (different) file changes. -Shut it down manually with Ctrl-C. +Shut it down manually with `Ctrl-C`. Test-runner output appears in the terminal window. We can update our app and our tests in real-time, keeping a weather eye on the console for broken tests. -Karma is occasionally confused and it is often necessary to shut down its browser or even shut the command down (Ctrl-C) and +Karma is occasionally confused and it is often necessary to shut down its browser or even shut the command down (`Ctrl-C`) and restart it. No worries; it's pretty quick. ### End-to-end (E2E) Tests @@ -139,7 +139,7 @@ The pass/fail test results appear at the bottom of the terminal window. A custom reporter (see `protractor.config.js`) generates a `./_test-output/protractor-results.txt` file which is easier to read; this file is excluded from source control. -Shut it down manually with Ctrl-C. +Shut it down manually with `Ctrl-C`. [travis-badge]: https://travis-ci.org/angular/quickstart.svg?branch=master [travis-badge-url]: https://travis-ci.org/angular/quickstart From ccb97afdfeacc317176f4defec1f3fa8bb796829 Mon Sep 17 00:00:00 2001 From: Ward Bell Date: Sun, 23 Oct 2016 00:30:33 -0700 Subject: [PATCH 35/83] chore(tsconfig): add compileOnSave and exclude -aot.ts files --- tsconfig.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tsconfig.json b/tsconfig.json index a29a7acca..0686497d8 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -13,8 +13,9 @@ "./node_modules/@types/" ] }, - + "compileOnSave": true, "exclude": [ - "node_modules/*" + "node_modules/*", + "**/*-aot.ts" ] } From c002d0ec8da9e52a746a8e1ad8a0054514c806f0 Mon Sep 17 00:00:00 2001 From: Filipe Silva Date: Thu, 27 Oct 2016 13:59:07 +0100 Subject: [PATCH 36/83] chore(editorconfig): remove end_of_line setting (#267) Using `end_of_line` causes issues on windows machines. --- .editorconfig | 1 - 1 file changed, 1 deletion(-) diff --git a/.editorconfig b/.editorconfig index f2abacf6d..b8a6e5723 100644 --- a/.editorconfig +++ b/.editorconfig @@ -5,7 +5,6 @@ root = true charset = utf-8 indent_style = space indent_size = 2 -end_of_line = lf insert_final_newline = true trim_trailing_whitespace = true From 3ed4ad4b5304f5272c3b3f327b3b0d7bac9e6d69 Mon Sep 17 00:00:00 2001 From: Filipe Silva Date: Thu, 27 Oct 2016 14:21:50 +0100 Subject: [PATCH 37/83] fix(e2e): fix travis webdriver issue (#266) --- .travis.yml | 2 +- package.json | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index a20396221..20ff41e7d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,5 +16,5 @@ install: - npm install script: - npm run lint - - npm run test-once + - npm run test-once - npm run e2e diff --git a/package.json b/package.json index 2f6b6395e..b44cd6a27 100644 --- a/package.json +++ b/package.json @@ -59,7 +59,8 @@ "karma-htmlfile-reporter": "^0.3.4", "karma-jasmine": "^1.0.2", "karma-jasmine-html-reporter": "^0.2.2", - "protractor": "^4.0.9", + "protractor": "4.0.9", + "webdriver-manager": "10.2.5", "rimraf": "^2.5.4", "@types/core-js": "^0.9.34", From a654977e1d12930044bf495f392a0ec7af42a313 Mon Sep 17 00:00:00 2001 From: Ward Bell Date: Sat, 29 Oct 2016 10:38:18 -0700 Subject: [PATCH 38/83] chore: update to 2.1.2; remove bootstrap.css (#270) --- CHANGELOG.md | 11 +++++++++++ package.json | 33 ++++++++++++++++----------------- 2 files changed, 27 insertions(+), 17 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d9bc1b9f7..0ed90decd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,14 @@ +## Angular Documentation QuickStart Changelog +Upgraders: to be sure of a fresh start, consider running these commands +* `git clean -xdf` +* `npm install` +* `npm run webdriver:update` + + +# 0.2.14 (2016-10-29) +* Remove bootstrap.css install +* Angular v2.1.2 + # 0.2.13 (2016-10-20) * Protractor 4 diff --git a/package.json b/package.json index b44cd6a27..4cec31206 100644 --- a/package.json +++ b/package.json @@ -25,19 +25,18 @@ } ], "dependencies": { - "@angular/common": "~2.1.1", - "@angular/compiler": "~2.1.1", - "@angular/core": "~2.1.1", - "@angular/forms": "~2.1.1", - "@angular/http": "~2.1.1", - "@angular/platform-browser": "~2.1.1", - "@angular/platform-browser-dynamic": "~2.1.1", - "@angular/router": "~3.1.1", - "@angular/upgrade": "~2.1.1", + "@angular/common": "~2.1.2", + "@angular/compiler": "~2.1.2", + "@angular/core": "~2.1.2", + "@angular/forms": "~2.1.2", + "@angular/http": "~2.1.2", + "@angular/platform-browser": "~2.1.2", + "@angular/platform-browser-dynamic": "~2.1.2", + "@angular/router": "~3.1.2", + "@angular/upgrade": "~2.1.2", "angular-in-memory-web-api": "~0.1.13", - "bootstrap": "^3.3.7", - "systemjs": "0.19.39", + "systemjs": "0.19.40", "core-js": "^2.4.1", "reflect-metadata": "^0.1.8", "rxjs": "5.0.0-beta.12", @@ -51,7 +50,7 @@ "canonical-path": "0.0.2", "http-server": "^0.9.0", "tslint": "^3.15.1", - "lodash": "^4.16.2", + "lodash": "^4.16.4", "jasmine-core": "~2.5.2", "karma": "^1.3.0", "karma-chrome-launcher": "^2.0.0", @@ -59,14 +58,14 @@ "karma-htmlfile-reporter": "^0.3.4", "karma-jasmine": "^1.0.2", "karma-jasmine-html-reporter": "^0.2.2", - "protractor": "4.0.9", - "webdriver-manager": "10.2.5", + "protractor": "~4.0.10", + "webdriver-manager": "~10.2.6", "rimraf": "^2.5.4", "@types/core-js": "^0.9.34", - "@types/node": "^6.0.45", - "@types/jasmine": "^2.5.35", - "@types/selenium-webdriver": "^2.53.32" + "@types/node": "^6.0.46", + "@types/jasmine": "^2.5.36", + "@types/selenium-webdriver": "^2.53.33" }, "repository": {} } From e2d55c59402f935558f0ac9a8769732cb1c6cd18 Mon Sep 17 00:00:00 2001 From: Filipe Silva Date: Sat, 29 Oct 2016 22:31:46 +0100 Subject: [PATCH 39/83] fix(e2e): restore e2e fix (#271) See #266 --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 4cec31206..c430e8276 100644 --- a/package.json +++ b/package.json @@ -58,8 +58,8 @@ "karma-htmlfile-reporter": "^0.3.4", "karma-jasmine": "^1.0.2", "karma-jasmine-html-reporter": "^0.2.2", - "protractor": "~4.0.10", - "webdriver-manager": "~10.2.6", + "protractor": "4.0.9", + "webdriver-manager": "10.2.5", "rimraf": "^2.5.4", "@types/core-js": "^0.9.34", From cd7b566fca6ad4074c674748451181f4bcc2ddc7 Mon Sep 17 00:00:00 2001 From: Ward Bell Date: Sat, 29 Oct 2016 18:09:57 -0700 Subject: [PATCH 40/83] fix: karma shim values; update app.component.spec more like cli --- app/app.component.spec.ts | 42 +++++++++++++++++++-------------------- app/app.component.ts | 2 +- app/app.module.ts | 4 ++-- karma-test-shim.js | 2 +- karma.conf.js | 2 +- 5 files changed, 25 insertions(+), 27 deletions(-) diff --git a/app/app.component.spec.ts b/app/app.component.spec.ts index 53a68593d..fab0039cd 100644 --- a/app/app.component.spec.ts +++ b/app/app.component.spec.ts @@ -1,37 +1,35 @@ /* tslint:disable:no-unused-variable */ import { AppComponent } from './app.component'; -import { TestBed } from '@angular/core/testing'; - +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { By } from '@angular/platform-browser'; +import { DebugElement } from '@angular/core'; //////// SPECS ///////////// +describe('AppComponent', function () { + let de: DebugElement; + let comp: AppComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ AppComponent ] + }) + .compileComponents(); + })); -/// Delete this -describe('Smoke test', () => { - it('should run a passing test', () => { - expect(true).toEqual(true, 'should pass'); - }); -}); - -describe('AppComponent with TCB', function () { beforeEach(() => { - TestBed.configureTestingModule({declarations: [AppComponent]}); + fixture = TestBed.createComponent(AppComponent); + comp = fixture.componentInstance; + de = fixture.debugElement.query(By.css('h1')); }); - it('should instantiate component', () => { - let fixture = TestBed.createComponent(AppComponent); - expect(fixture.componentInstance instanceof AppComponent).toBe(true, 'should create AppComponent'); - }); + it('should create component', () => expect(comp).toBeDefined() ); it('should have expected

text', () => { - let fixture = TestBed.createComponent(AppComponent); fixture.detectChanges(); - - let h1 = fixture.debugElement.query(el => el.name === 'h1').nativeElement; // it works - - h1 = fixture.debugElement.query(By.css('h1')).nativeElement; // preferred - - expect(h1.innerText).toMatch(/angular app/i, '

should say something about "Angular App"'); + const h1 = de.nativeElement; + expect(h1.innerText).toMatch(/angular app/i, + '

should say something about "Angular App"'); }); }); diff --git a/app/app.component.ts b/app/app.component.ts index 83919ca76..b6cad8701 100644 --- a/app/app.component.ts +++ b/app/app.component.ts @@ -2,6 +2,6 @@ import { Component } from '@angular/core'; @Component({ selector: 'my-app', - template: '

My First Angular App

' + template: `

My First Angular App

` }) export class AppComponent { } diff --git a/app/app.module.ts b/app/app.module.ts index 4f883fa15..357b003a5 100644 --- a/app/app.module.ts +++ b/app/app.module.ts @@ -4,8 +4,8 @@ import { BrowserModule } from '@angular/platform-browser'; import { AppComponent } from './app.component'; @NgModule({ - imports: [ BrowserModule ], + imports: [ BrowserModule ], declarations: [ AppComponent ], - bootstrap: [ AppComponent ] + bootstrap: [ AppComponent ] }) export class AppModule { } diff --git a/karma-test-shim.js b/karma-test-shim.js index 19fcc89fe..cce63112b 100644 --- a/karma-test-shim.js +++ b/karma-test-shim.js @@ -28,7 +28,7 @@ var allSpecFiles = Object.keys(window.__karma__.files) .filter(isBuiltFile); System.config({ - baseURL: '/base', + baseURL: 'base', // Extend usual application package list with test folder packages: { 'testing': { main: 'index.js', defaultExtension: 'js' } }, diff --git a/karma.conf.js b/karma.conf.js index b67ba3d15..d842701e6 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -3,7 +3,7 @@ module.exports = function(config) { var appBase = 'app/'; // transpiled app JS and map files var appSrcBase = 'app/'; // app source TS files - var appAssets = '/base/app/'; // component assets fetched by Angular's compiler + var appAssets = 'base/app/'; // component assets fetched by Angular's compiler var testBase = 'testing/'; // transpiled test JS and map files var testSrcBase = 'testing/'; // test source TS files From f6075a1fe7dae8012040f2cfa529a91f945baa17 Mon Sep 17 00:00:00 2001 From: Ward Bell Date: Sat, 29 Oct 2016 23:50:18 -0700 Subject: [PATCH 41/83] chore(testing): revert to jasmine v.2.4.1 (#272) Bug in Jasmine v.2.5.x, reported in https://github.com/jasmine/jasmine/issues/1231 Stick with v.2.4.1 (as karma-jasmine does) until the issue is resolved Unfortunately, there is no @types/jasmine for v.2.4 but only for v.2.5. --- CHANGELOG.md | 4 ++++ package.json | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0ed90decd..68b321f71 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ Upgraders: to be sure of a fresh start, consider running these commands * `npm install` * `npm run webdriver:update` + +# 0.2.15 (2016-10-29) +* Revert to Jasmine 2.4.1 because bug in 2.5.x (see [jasmine issue #1231](https://github.com/jasmine/jasmine/issues/1231)) + # 0.2.14 (2016-10-29) * Remove bootstrap.css install diff --git a/package.json b/package.json index c430e8276..184a7f991 100644 --- a/package.json +++ b/package.json @@ -51,7 +51,7 @@ "http-server": "^0.9.0", "tslint": "^3.15.1", "lodash": "^4.16.4", - "jasmine-core": "~2.5.2", + "jasmine-core": "~2.4.1", "karma": "^1.3.0", "karma-chrome-launcher": "^2.0.0", "karma-cli": "^1.0.1", From bfd1896fd65069872dbe40f891148dde8c1df7f1 Mon Sep 17 00:00:00 2001 From: Ward Bell Date: Fri, 4 Nov 2016 11:58:32 -0700 Subject: [PATCH 42/83] chore: change message to "Hello Angular!" --- app/app.component.spec.ts | 4 ++-- app/app.component.ts | 2 +- e2e/app.e2e-spec.ts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/app.component.spec.ts b/app/app.component.spec.ts index fab0039cd..e8f364f95 100644 --- a/app/app.component.spec.ts +++ b/app/app.component.spec.ts @@ -29,7 +29,7 @@ describe('AppComponent', function () { it('should have expected

text', () => { fixture.detectChanges(); const h1 = de.nativeElement; - expect(h1.innerText).toMatch(/angular app/i, - '

should say something about "Angular App"'); + expect(h1.innerText).toMatch(/angular/i, + '

should say something about "Angular"'); }); }); diff --git a/app/app.component.ts b/app/app.component.ts index b6cad8701..541f79426 100644 --- a/app/app.component.ts +++ b/app/app.component.ts @@ -2,6 +2,6 @@ import { Component } from '@angular/core'; @Component({ selector: 'my-app', - template: `

My First Angular App

` + template: `

Hello Angular!

` }) export class AppComponent { } diff --git a/e2e/app.e2e-spec.ts b/e2e/app.e2e-spec.ts index 34b496c76..f29321d76 100644 --- a/e2e/app.e2e-spec.ts +++ b/e2e/app.e2e-spec.ts @@ -2,7 +2,7 @@ import { browser, element, by } from 'protractor'; describe('QuickStart E2E Tests', function () { - let expectedMsg = 'My First Angular App'; + let expectedMsg = 'Hello Angular!'; beforeEach(function () { From 9de879d93f5e5c4040c6ecc2a28e260f40cd9116 Mon Sep 17 00:00:00 2001 From: Ward Bell Date: Mon, 7 Nov 2016 18:23:21 -0800 Subject: [PATCH 43/83] chore: drop '!' from "Hello Angular!" --- app/app.component.ts | 2 +- e2e/app.e2e-spec.ts | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/app/app.component.ts b/app/app.component.ts index 541f79426..5a299a8ef 100644 --- a/app/app.component.ts +++ b/app/app.component.ts @@ -2,6 +2,6 @@ import { Component } from '@angular/core'; @Component({ selector: 'my-app', - template: `

Hello Angular!

` + template: `

Hello Angular

` }) export class AppComponent { } diff --git a/e2e/app.e2e-spec.ts b/e2e/app.e2e-spec.ts index f29321d76..67f5d8d6a 100644 --- a/e2e/app.e2e-spec.ts +++ b/e2e/app.e2e-spec.ts @@ -2,8 +2,7 @@ import { browser, element, by } from 'protractor'; describe('QuickStart E2E Tests', function () { - let expectedMsg = 'Hello Angular!'; - + let expectedMsg = 'Hello Angular'; beforeEach(function () { browser.get(''); From c36ac4d361cf322589fdf72a65c7742feb4b80b1 Mon Sep 17 00:00:00 2001 From: Filipe Silva Date: Mon, 14 Nov 2016 23:11:51 +0000 Subject: [PATCH 44/83] chore: update to angular 2.2.0 (#283) --- CHANGELOG.md | 4 ++++ package.json | 20 ++++++++++---------- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 68b321f71..5df8ced96 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ Upgraders: to be sure of a fresh start, consider running these commands * `npm install` * `npm run webdriver:update` + +# 0.2.16 (2016-11-14) +* Update to Angular 2.2.0 + # 0.2.15 (2016-10-29) * Revert to Jasmine 2.4.1 because bug in 2.5.x (see [jasmine issue #1231](https://github.com/jasmine/jasmine/issues/1231)) diff --git a/package.json b/package.json index 184a7f991..b64d94ff7 100644 --- a/package.json +++ b/package.json @@ -25,17 +25,17 @@ } ], "dependencies": { - "@angular/common": "~2.1.2", - "@angular/compiler": "~2.1.2", - "@angular/core": "~2.1.2", - "@angular/forms": "~2.1.2", - "@angular/http": "~2.1.2", - "@angular/platform-browser": "~2.1.2", - "@angular/platform-browser-dynamic": "~2.1.2", - "@angular/router": "~3.1.2", - "@angular/upgrade": "~2.1.2", + "@angular/common": "~2.2.0", + "@angular/compiler": "~2.2.0", + "@angular/core": "~2.2.0", + "@angular/forms": "~2.2.0", + "@angular/http": "~2.2.0", + "@angular/platform-browser": "~2.2.0", + "@angular/platform-browser-dynamic": "~2.2.0", + "@angular/router": "~3.2.0", + "@angular/upgrade": "~2.2.0", - "angular-in-memory-web-api": "~0.1.13", + "angular-in-memory-web-api": "~0.1.15", "systemjs": "0.19.40", "core-js": "^2.4.1", "reflect-metadata": "^0.1.8", From 1f9ff3ee0a832124383f39c185177af43ad738e4 Mon Sep 17 00:00:00 2001 From: Filipe Silva Date: Tue, 15 Nov 2016 09:38:00 +0000 Subject: [PATCH 45/83] Add @angular/upgrade/static to systemjs.config.js (#281) Blocked by https://github.com/angular/angular.io/pull/2781 and Angular 2.2.0. --- systemjs.config.js | 1 + 1 file changed, 1 insertion(+) diff --git a/systemjs.config.js b/systemjs.config.js index 457f040fc..61a41af20 100644 --- a/systemjs.config.js +++ b/systemjs.config.js @@ -23,6 +23,7 @@ '@angular/router': 'npm:@angular/router/bundles/router.umd.js', '@angular/forms': 'npm:@angular/forms/bundles/forms.umd.js', '@angular/upgrade': 'npm:@angular/upgrade/bundles/upgrade.umd.js', + '@angular/upgrade/static': 'npm:@angular/upgrade/bundles/upgrade-static.umd.js', // other libraries 'rxjs': 'npm:rxjs', From 801aa94c670de6d82c461882536af19d01784aa2 Mon Sep 17 00:00:00 2001 From: Filipe Silva Date: Fri, 18 Nov 2016 02:46:22 +0000 Subject: [PATCH 46/83] chore(config): add 2.2.0 router/upgrade entry point (#285) --- systemjs.config.js | 1 + 1 file changed, 1 insertion(+) diff --git a/systemjs.config.js b/systemjs.config.js index 61a41af20..0d748b9e5 100644 --- a/systemjs.config.js +++ b/systemjs.config.js @@ -21,6 +21,7 @@ '@angular/platform-browser-dynamic': 'npm:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js', '@angular/http': 'npm:@angular/http/bundles/http.umd.js', '@angular/router': 'npm:@angular/router/bundles/router.umd.js', + '@angular/router/upgrade': 'npm:@angular/router/bundles/router-upgrade.umd.js', '@angular/forms': 'npm:@angular/forms/bundles/forms.umd.js', '@angular/upgrade': 'npm:@angular/upgrade/bundles/upgrade.umd.js', '@angular/upgrade/static': 'npm:@angular/upgrade/bundles/upgrade-static.umd.js', From 755614827ae6381a6c343b861efe52d66c0aba4e Mon Sep 17 00:00:00 2001 From: Filipe Silva Date: Fri, 18 Nov 2016 08:53:06 +0000 Subject: [PATCH 47/83] chore: simplify gitignore (#68) --- .gitignore | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index f93eca8d7..96d71f074 100644 --- a/.gitignore +++ b/.gitignore @@ -1,16 +1,11 @@ .idea node_modules jspm_packages +npm-debug.* link-checker-results.txt -**/*npm-debug.log.* -*.js +app/**/*.js *.js.map e2e/**/*.js e2e/**/*.js.map _test-output _temp - -!karma*.js -!protractor*.js -!systemjs.config.js -!wallaby.js From 9f2e627cc3a4b263d1c6f750d48663bfb0269d31 Mon Sep 17 00:00:00 2001 From: Ward Bell Date: Tue, 22 Nov 2016 16:00:41 -0800 Subject: [PATCH 48/83] chore: revise to conform to QS reboot in angular.io PR #2762 (#287) --- .dockerignore | 1 - CHANGELOG.md | 11 +++- Dockerfile | 21 ------- app/app.component.ts | 6 +- index.html | 2 +- package.json | 18 ++---- styles.css | 147 ++----------------------------------------- tsconfig.json | 8 +-- wallaby.js | 119 ----------------------------------- 9 files changed, 25 insertions(+), 308 deletions(-) delete mode 100644 .dockerignore delete mode 100644 Dockerfile delete mode 100644 wallaby.js diff --git a/.dockerignore b/.dockerignore deleted file mode 100644 index c2658d7d1..000000000 --- a/.dockerignore +++ /dev/null @@ -1 +0,0 @@ -node_modules/ diff --git a/CHANGELOG.md b/CHANGELOG.md index 5df8ced96..74dd70b48 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,18 @@ ## Angular Documentation QuickStart Changelog -Upgraders: to be sure of a fresh start, consider running these commands +Upgraders: for a fresh start, consider running these commands * `git clean -xdf` * `npm install` * `npm run webdriver:update` + +# 0.2.17 (2016-11-16) +* Conform to updated QuickStart advice + * removed docker everywhere (was nice but not necessary) + * removed wallaby + * shrink styles.css + * refine tsconfig.json + * `AppComponent` uses interpolation + # 0.2.16 (2016-11-14) * Update to Angular 2.2.0 diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 7ad0f4375..000000000 --- a/Dockerfile +++ /dev/null @@ -1,21 +0,0 @@ -# To build and run with Docker: -# -# $ docker build -t ng-quickstart . -# $ docker run -it --rm -p 3000:3000 -p 3001:3001 ng-quickstart -# -FROM node:latest - -RUN mkdir -p /quickstart /home/nodejs && \ - groupadd -r nodejs && \ - useradd -r -g nodejs -d /home/nodejs -s /sbin/nologin nodejs && \ - chown -R nodejs:nodejs /home/nodejs - -WORKDIR /quickstart -COPY package.json /quickstart/ -RUN npm install --unsafe-perm=true - -COPY . /quickstart -RUN chown -R nodejs:nodejs /quickstart -USER nodejs - -CMD npm start diff --git a/app/app.component.ts b/app/app.component.ts index 5a299a8ef..7fb173cd0 100644 --- a/app/app.component.ts +++ b/app/app.component.ts @@ -1,7 +1,7 @@ import { Component } from '@angular/core'; @Component({ - selector: 'my-app', - template: `

Hello Angular

` + selector: 'my-app', + template: `

Hello {{name}}

`, }) -export class AppComponent { } +export class AppComponent { name = 'Angular'; } diff --git a/index.html b/index.html index c0b1c4431..863c3e0ba 100644 --- a/index.html +++ b/index.html @@ -20,6 +20,6 @@ - Loading... + Loading AppComponent content here ... diff --git a/package.json b/package.json index b64d94ff7..ed4741a61 100644 --- a/package.json +++ b/package.json @@ -4,26 +4,18 @@ "description": "QuickStart package.json from the documentation, supplemented with testing support", "scripts": { "start": "tsc && concurrently \"tsc -w\" \"lite-server\" ", - "docker-build": "docker build -t ng2-quickstart .", - "docker": "npm run docker-build && docker run -it --rm -p 3000:3000 -p 3001:3001 ng2-quickstart", - "pree2e": "npm run webdriver:update", "e2e": "tsc && concurrently \"http-server -s\" \"protractor protractor.config.js\" --kill-others --success first", "lint": "tslint ./app/**/*.ts -t verbose", "lite": "lite-server", + "pree2e": "webdriver-manager update", "test": "tsc && concurrently \"tsc -w\" \"karma start karma.conf.js\"", "test-once": "tsc && karma start karma.conf.js --single-run", "tsc": "tsc", - "tsc:w": "tsc -w", - "webdriver:update": "webdriver-manager update" + "tsc:w": "tsc -w" }, "keywords": [], "author": "", - "licenses": [ - { - "type": "MIT", - "url": "https://github.com/angular/angular.io/blob/master/LICENSE" - } - ], + "license": "MIT", "dependencies": { "@angular/common": "~2.2.0", "@angular/compiler": "~2.2.0", @@ -33,7 +25,6 @@ "@angular/platform-browser": "~2.2.0", "@angular/platform-browser-dynamic": "~2.2.0", "@angular/router": "~3.2.0", - "@angular/upgrade": "~2.2.0", "angular-in-memory-web-api": "~0.1.15", "systemjs": "0.19.40", @@ -45,7 +36,7 @@ "devDependencies": { "concurrently": "^3.1.0", "lite-server": "^2.2.2", - "typescript": "^2.0.3", + "typescript": "^2.0.10", "canonical-path": "0.0.2", "http-server": "^0.9.0", @@ -62,7 +53,6 @@ "webdriver-manager": "10.2.5", "rimraf": "^2.5.4", - "@types/core-js": "^0.9.34", "@types/node": "^6.0.46", "@types/jasmine": "^2.5.36", "@types/selenium-webdriver": "^2.53.33" diff --git a/styles.css b/styles.css index 054b417f6..c30a0620d 100644 --- a/styles.css +++ b/styles.css @@ -1,142 +1,5 @@ -/* Master Styles */ -h1 { - color: #369; - font-family: Arial, Helvetica, sans-serif; - font-size: 250%; -} -h2, h3 { - color: #444; - font-family: Arial, Helvetica, sans-serif; - font-weight: lighter; -} -body { - margin: 2em; -} -body, input[text], button { - color: #888; - font-family: Cambria, Georgia; -} -a { - cursor: pointer; - cursor: hand; -} -button { - font-family: Arial; - background-color: #eee; - border: none; - padding: 5px 10px; - border-radius: 4px; - cursor: pointer; - cursor: hand; -} -button:hover { - background-color: #cfd8dc; -} -button:disabled { - background-color: #eee; - color: #aaa; - cursor: auto; -} - -/* Navigation link styles */ -nav a { - padding: 5px 10px; - text-decoration: none; - margin-top: 10px; - display: inline-block; - background-color: #eee; - border-radius: 4px; -} -nav a:visited, a:link { - color: #607D8B; -} -nav a:hover { - color: #039be5; - background-color: #CFD8DC; -} -nav a.router-link-active { - color: #039be5; -} - -/* items class */ -.items { - margin: 0 0 2em 0; - list-style-type: none; - padding: 0; - width: 24em; -} -.items li { - cursor: pointer; - position: relative; - left: 0; - background-color: #EEE; - margin: .5em; - padding: .3em 0; - height: 1.6em; - border-radius: 4px; -} -.items li:hover { - color: #607D8B; - background-color: #DDD; - left: .1em; -} -.items li.selected:hover { - background-color: #BBD8DC; - color: white; -} -.items .text { - position: relative; - top: -3px; -} -.items { - margin: 0 0 2em 0; - list-style-type: none; - padding: 0; - width: 24em; -} -.items li { - cursor: pointer; - position: relative; - left: 0; - background-color: #EEE; - margin: .5em; - padding: .3em 0; - height: 1.6em; - border-radius: 4px; -} -.items li:hover { - color: #607D8B; - background-color: #DDD; - left: .1em; -} -.items li.selected { - background-color: #CFD8DC; - color: white; -} - -.items li.selected:hover { - background-color: #BBD8DC; -} -.items .text { - position: relative; - top: -3px; -} -.items .badge { - display: inline-block; - font-size: small; - color: white; - padding: 0.8em 0.7em 0 0.7em; - background-color: #607D8B; - line-height: 1em; - position: relative; - left: -1px; - top: -4px; - height: 1.8em; - margin-right: .8em; - border-radius: 4px 0 0 4px; -} - -/* everywhere else */ -* { - font-family: Arial, Helvetica, sans-serif; -} +h1 { + color: #369; + font-family: Arial, Helvetica, sans-serif; + font-size: 250%; +} diff --git a/tsconfig.json b/tsconfig.json index 0686497d8..d8cdfb44c 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -6,14 +6,10 @@ "sourceMap": true, "emitDecoratorMetadata": true, "experimentalDecorators": true, - "removeComments": false, + "lib": [ "es2015", "dom" ], "noImplicitAny": true, - "suppressImplicitAnyIndexErrors": true, - "typeRoots": [ - "./node_modules/@types/" - ] + "suppressImplicitAnyIndexErrors": true }, - "compileOnSave": true, "exclude": [ "node_modules/*", "**/*-aot.ts" diff --git a/wallaby.js b/wallaby.js deleted file mode 100644 index acc34d35f..000000000 --- a/wallaby.js +++ /dev/null @@ -1,119 +0,0 @@ -// Configuration for the Wallaby Visual Studio Code testing extension -// https://marketplace.visualstudio.com/items?itemName=WallabyJs.wallaby-vscode -// Note: Wallaby is not open source and costs money - -module.exports = function () { - return { - files: [ - // System.js for module loading - {pattern: 'node_modules/systemjs/dist/system.js', instrument: false}, - {pattern: 'systemjs.config.js', instrument: false}, - {pattern: 'systemjs.config.extras.js', instrument: false}, - - // Polyfills - {pattern: 'node_modules/core-js/client/shim.min.js', instrument: false}, - {pattern: 'node_modules/reflect-metadata/Reflect.js', instrument: false}, - - // zone.js - {pattern: 'node_modules/zone.js/dist/zone.js', instrument: false}, - {pattern: 'node_modules/zone.js/dist/long-stack-trace-zone.js', instrument: false}, - {pattern: 'node_modules/zone.js/dist/proxy.js', instrument: false}, - {pattern: 'node_modules/zone.js/dist/sync-test.js', instrument: false}, - {pattern: 'node_modules/zone.js/dist/jasmine-patch.js', instrument: false}, - {pattern: 'node_modules/zone.js/dist/async-test.js', instrument: false}, - {pattern: 'node_modules/zone.js/dist/fake-async-test.js', instrument: false}, - - // application (but not specs) loaded via module imports - {pattern: 'app/**/*+(ts|html|css)', load: false}, - {pattern: 'app/**/*.spec.ts', ignore: true}, - - {pattern: 'testing/**/*+(ts|html|css)', load: false}, - ], - - tests: [ - {pattern: 'app/**/*.spec.ts', load: false} - ], - - middleware: function (app, express) { - app.use('/node_modules', express.static(require('path').join(__dirname, 'node_modules'))); - }, - - testFramework: 'jasmine', - - debug: true, - - bootstrap: bootstrap - }; -}; - -// Like karma-test-shim.js -function bootstrap (wallaby) { - wallaby.delayStart(); - - System.config({ - // Extend usual application package list with test folder - packages: { 'testing': { main: 'index.js', defaultExtension: 'js' } }, - - // Assume npm: is set in `paths` in systemjs.config - // Map the angular testing umd bundles - map: { - '@angular/core/testing': 'npm:@angular/core/bundles/core-testing.umd.js', - '@angular/common/testing': 'npm:@angular/common/bundles/common-testing.umd.js', - '@angular/compiler/testing': 'npm:@angular/compiler/bundles/compiler-testing.umd.js', - '@angular/platform-browser/testing': 'npm:@angular/platform-browser/bundles/platform-browser-testing.umd.js', - '@angular/platform-browser-dynamic/testing': 'npm:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic-testing.umd.js', - '@angular/http/testing': 'npm:@angular/http/bundles/http-testing.umd.js', - '@angular/router/testing': 'npm:@angular/router/bundles/router-testing.umd.js', - '@angular/forms/testing': 'npm:@angular/forms/bundles/forms-testing.umd.js', - }, - }); - - System.import('systemjs.config.js') - .then(importSystemJsExtras) - .then(initTestBed) - .then(initTesting); - - /** Optional SystemJS configuration extras. Keep going w/o it */ - function importSystemJsExtras(){ - return System.import('systemjs.config.extras.js') - .catch(function(reason) { - console.log( - 'Warning: System.import could not load the optional "systemjs.config.extras.js". Did you omit it by accident? Continuing without it.' - ); - console.log(reason); - }); - } - - function initTestBed(){ - return Promise.all([ - System.import('@angular/core/testing'), - System.import('@angular/platform-browser-dynamic/testing') - ]) - - .then(function (providers) { - var coreTesting = providers[0]; - var browserTesting = providers[1]; - - coreTesting.TestBed.initTestEnvironment( - browserTesting.BrowserDynamicTestingModule, - browserTesting.platformBrowserDynamicTesting()); - }) - } - - // Load all spec files and start wallaby - function initTesting () { - return Promise.all( - wallaby.tests.map(function (specFile) { - return System.import(specFile); - }) - ) - .then(function () { - wallaby.start(); - }) - .catch(function (e) { - setTimeout(function () { - throw e; - }, 0); - }); - } -} From 6caf4ccff1f437f357f8c80fe5440dcdaf74545e Mon Sep 17 00:00:00 2001 From: Filipe Silva Date: Wed, 23 Nov 2016 00:06:13 +0000 Subject: [PATCH 49/83] Update CHANGELOG.md (#299) --- CHANGELOG.md | 1 - 1 file changed, 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 74dd70b48..548d8d4a9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,6 @@ Upgraders: for a fresh start, consider running these commands * `git clean -xdf` * `npm install` -* `npm run webdriver:update` # 0.2.17 (2016-11-16) From d68eb81fcda8119486d25ca5433c28968d937ee2 Mon Sep 17 00:00:00 2001 From: Filipe Silva Date: Thu, 24 Nov 2016 16:13:56 +0000 Subject: [PATCH 50/83] chore(config): remove upgrade package mappings The package is not listed in `package.json` and https://github.com/angular/angular.io/pull/2803 will contain instructions to add it manually. --- systemjs.config.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/systemjs.config.js b/systemjs.config.js index 0d748b9e5..5fa7e9c24 100644 --- a/systemjs.config.js +++ b/systemjs.config.js @@ -23,8 +23,6 @@ '@angular/router': 'npm:@angular/router/bundles/router.umd.js', '@angular/router/upgrade': 'npm:@angular/router/bundles/router-upgrade.umd.js', '@angular/forms': 'npm:@angular/forms/bundles/forms.umd.js', - '@angular/upgrade': 'npm:@angular/upgrade/bundles/upgrade.umd.js', - '@angular/upgrade/static': 'npm:@angular/upgrade/bundles/upgrade-static.umd.js', // other libraries 'rxjs': 'npm:rxjs', From ce8fcdcd4f0988cbadbcf4fc41bd530e3c607222 Mon Sep 17 00:00:00 2001 From: Filipe Silva Date: Wed, 23 Nov 2016 00:06:13 +0000 Subject: [PATCH 51/83] Update CHANGELOG.md (#299) --- CHANGELOG.md | 1 - 1 file changed, 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 74dd70b48..548d8d4a9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,6 @@ Upgraders: for a fresh start, consider running these commands * `git clean -xdf` * `npm install` -* `npm run webdriver:update` # 0.2.17 (2016-11-16) From 3adfdf768d94355540ee78f589d9e53bcf40a368 Mon Sep 17 00:00:00 2001 From: Ward Bell Date: Wed, 30 Nov 2016 12:33:46 -0800 Subject: [PATCH 52/83] chore: test framework improvements, remove tsconfig `exclude` clause * remove `exclude` clause from `tsconfig.json`; it was just confusing people * karma.config + karma-test-shim can handle multiple spec source paths (issue #294) * cosmetic `app.component.spec.ts` changes * cosmetic `karma.config.js` changes --- CHANGELOG.md | 7 +++++++ app/app.component.spec.ts | 4 +--- karma-test-shim.js | 12 +++++++++--- karma.conf.js | 40 +++++++++++++++++---------------------- package.json | 1 - tsconfig.json | 6 +----- 6 files changed, 35 insertions(+), 35 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 548d8d4a9..a93e4bb4e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,13 @@ Upgraders: for a fresh start, consider running these commands * `git clean -xdf` * `npm install` + +# 0.2.18 (2016-11-30) +* remove `exclude` clause from `tsconfig.json`; it was just confusing people +* karma.config + karma-test-shim can handle multiple spec source paths (issue #294) +* cosmetic `app.component.spec.ts` changes +* cosmetic `karma.config.js` changes + # 0.2.17 (2016-11-16) * Conform to updated QuickStart advice diff --git a/app/app.component.spec.ts b/app/app.component.spec.ts index e8f364f95..776902446 100644 --- a/app/app.component.spec.ts +++ b/app/app.component.spec.ts @@ -1,18 +1,16 @@ -/* tslint:disable:no-unused-variable */ import { AppComponent } from './app.component'; import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { By } from '@angular/platform-browser'; import { DebugElement } from '@angular/core'; -//////// SPECS ///////////// describe('AppComponent', function () { let de: DebugElement; let comp: AppComponent; let fixture: ComponentFixture; beforeEach(async(() => { - TestBed.configureTestingModule({ + TestBed.configureTestingModule({ declarations: [ AppComponent ] }) .compileComponents(); diff --git a/karma-test-shim.js b/karma-test-shim.js index cce63112b..de5b015fd 100644 --- a/karma-test-shim.js +++ b/karma-test-shim.js @@ -1,4 +1,3 @@ -// #docregion // /*global jasmine, __karma__, window*/ Error.stackTraceLimit = 0; // "No stacktrace"" is usually best for app testing. @@ -7,7 +6,10 @@ Error.stackTraceLimit = 0; // "No stacktrace"" is usually best for app testing. jasmine.DEFAULT_TIMEOUT_INTERVAL = 1000; -var builtPath = '/base/app/'; +// builtPaths: root paths for output ("built") files +// get from karma.config.js, then prefix with '/base/' (default is 'app/') +var builtPaths = (__karma__.config.builtPaths || ['app/']) + .map(function(p) { return '/base/'+p;}); __karma__.loaded = function () { }; @@ -19,8 +21,12 @@ function isSpecFile(path) { return /\.spec\.(.*\.)?js$/.test(path); } +// Is a "built" file if is JavaScript file in one of the "built" folders function isBuiltFile(path) { - return isJsFile(path) && (path.substr(0, builtPath.length) == builtPath); + return isJsFile(path) && + builtPaths.reduce(function(keep, bp) { + return keep || (path.substr(0, bp.length) === bp); + }, false); } var allSpecFiles = Object.keys(window.__karma__.files) diff --git a/karma.conf.js b/karma.conf.js index d842701e6..1fff89a4f 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -1,23 +1,27 @@ -// #docregion module.exports = function(config) { - var appBase = 'app/'; // transpiled app JS and map files - var appSrcBase = 'app/'; // app source TS files + var appBase = 'app/'; // transpiled app JS and map files + var appSrcBase = 'app/'; // app source TS files var appAssets = 'base/app/'; // component assets fetched by Angular's compiler - var testBase = 'testing/'; // transpiled test JS and map files - var testSrcBase = 'testing/'; // test source TS files + var testingBase = 'testing/'; // transpiled test JS and map files + var testingSrcBase = 'testing/'; // test source TS files config.set({ basePath: '', frameworks: ['jasmine'], + plugins: [ require('karma-jasmine'), require('karma-chrome-launcher'), - require('karma-jasmine-html-reporter'), // click "Debug" in browser to see it - require('karma-htmlfile-reporter') // crashing w/ strange socket error + require('karma-jasmine-html-reporter') // click "Debug" in browser to see it ], + client: { + builtPaths: [appSrcBase, testingBase], // add more spec base paths as needed + clearContext: false // leave Jasmine Spec Runner output visible in browser + }, + customLaunchers: { // From the CLI. Not used here but interesting // chrome setup for travis CI using chromium @@ -26,6 +30,7 @@ module.exports = function(config) { flags: ['--no-sandbox'] } }, + files: [ // System.js for module loading 'node_modules/systemjs/dist/system.src.js', @@ -54,11 +59,11 @@ module.exports = function(config) { { pattern: 'systemjs.config.js', included: false, watched: false }, { pattern: 'systemjs.config.extras.js', included: false, watched: false }, - 'karma-test-shim.js', + 'karma-test-shim.js', // optionally extend SystemJS mapping e.g., with barrels // transpiled application & spec code paths loaded via module imports { pattern: appBase + '**/*.js', included: false, watched: true }, - { pattern: testBase + '**/*.js', included: false, watched: true }, + { pattern: testingBase + '**/*.js', included: false, watched: true }, // Asset (HTML & CSS) paths loaded via Angular's component compiler @@ -69,8 +74,8 @@ module.exports = function(config) { // Paths for debugging with source maps in dev tools { pattern: appSrcBase + '**/*.ts', included: false, watched: false }, { pattern: appBase + '**/*.js.map', included: false, watched: false }, - { pattern: testSrcBase + '**/*.ts', included: false, watched: false }, - { pattern: testBase + '**/*.js.map', included: false, watched: false } + { pattern: testingSrcBase + '**/*.ts', included: false, watched: false }, + { pattern: testingBase + '**/*.js.map', included: false, watched: false} ], // Proxied base paths for loading assets @@ -81,18 +86,7 @@ module.exports = function(config) { exclude: [], preprocessors: {}, - // disabled HtmlReporter; suddenly crashing w/ strange socket error - reporters: ['progress', 'kjhtml'],//'html'], - - // HtmlReporter configuration - htmlReporter: { - // Open this file to see results in browser - outputFile: '_test-output/tests.html', - - // Optional - pageTitle: 'Unit Tests', - subPageTitle: __dirname - }, + reporters: ['progress', 'kjhtml'], port: 9876, colors: true, diff --git a/package.json b/package.json index ed4741a61..61b095cc9 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,6 @@ "karma": "^1.3.0", "karma-chrome-launcher": "^2.0.0", "karma-cli": "^1.0.1", - "karma-htmlfile-reporter": "^0.3.4", "karma-jasmine": "^1.0.2", "karma-jasmine-html-reporter": "^0.2.2", "protractor": "4.0.9", diff --git a/tsconfig.json b/tsconfig.json index d8cdfb44c..2c7260d1b 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -9,9 +9,5 @@ "lib": [ "es2015", "dom" ], "noImplicitAny": true, "suppressImplicitAnyIndexErrors": true - }, - "exclude": [ - "node_modules/*", - "**/*-aot.ts" - ] + } } From 2867bc166145459a7ea7e25345a19311595fc93e Mon Sep 17 00:00:00 2001 From: Ward Bell Date: Wed, 30 Nov 2016 15:33:48 -0800 Subject: [PATCH 53/83] chore: karma.conf cosmetic changes --- karma.conf.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/karma.conf.js b/karma.conf.js index 1fff89a4f..cd161c83f 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -4,6 +4,7 @@ module.exports = function(config) { var appSrcBase = 'app/'; // app source TS files var appAssets = 'base/app/'; // component assets fetched by Angular's compiler + // Testing helpers (optional) are conventionally in a folder called `testing` var testingBase = 'testing/'; // transpiled test JS and map files var testingSrcBase = 'testing/'; // test source TS files @@ -14,7 +15,7 @@ module.exports = function(config) { plugins: [ require('karma-jasmine'), require('karma-chrome-launcher'), - require('karma-jasmine-html-reporter') // click "Debug" in browser to see it + require('karma-jasmine-html-reporter') ], client: { From 9acb6303a749ff7ae449b6c0f5364b408dc82e78 Mon Sep 17 00:00:00 2001 From: Filipe Silva Date: Wed, 7 Dec 2016 23:53:45 +0000 Subject: [PATCH 54/83] chore: update to 2.3.0 (#308) chore: update to 2.3.0 --- CHANGELOG.md | 4 ++++ package.json | 24 ++++++++++++------------ 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 196cc35b5..66440908b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,10 @@ Upgraders: for a fresh start, consider running these commands * `git clean -xdf` * `npm install` + +# 0.2.20 (2016-12-07) +* Update to Angular 2.3.0 + # 0.2.19 (2016-11-30) * remove upgrade mappings from `systemjs.config.js` PR #301 diff --git a/package.json b/package.json index 61b095cc9..071ccb9f8 100644 --- a/package.json +++ b/package.json @@ -17,26 +17,26 @@ "author": "", "license": "MIT", "dependencies": { - "@angular/common": "~2.2.0", - "@angular/compiler": "~2.2.0", - "@angular/core": "~2.2.0", - "@angular/forms": "~2.2.0", - "@angular/http": "~2.2.0", - "@angular/platform-browser": "~2.2.0", - "@angular/platform-browser-dynamic": "~2.2.0", - "@angular/router": "~3.2.0", + "@angular/common": "~2.3.0", + "@angular/compiler": "~2.3.0", + "@angular/core": "~2.3.0", + "@angular/forms": "~2.3.0", + "@angular/http": "~2.3.0", + "@angular/platform-browser": "~2.3.0", + "@angular/platform-browser-dynamic": "~2.3.0", + "@angular/router": "~3.3.0", - "angular-in-memory-web-api": "~0.1.15", + "angular-in-memory-web-api": "~0.1.17", "systemjs": "0.19.40", "core-js": "^2.4.1", "reflect-metadata": "^0.1.8", - "rxjs": "5.0.0-beta.12", - "zone.js": "^0.6.26" + "rxjs": "5.0.0-rc.4", + "zone.js": "^0.7.2" }, "devDependencies": { "concurrently": "^3.1.0", "lite-server": "^2.2.2", - "typescript": "^2.0.10", + "typescript": "~2.0.10", "canonical-path": "0.0.2", "http-server": "^0.9.0", From 730682fb22f4722515d5c9f1f656525bc87b0d0b Mon Sep 17 00:00:00 2001 From: Filipe Silva Date: Mon, 12 Dec 2016 13:34:55 +0000 Subject: [PATCH 55/83] ci: update protractor (#318) --- package.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/package.json b/package.json index 071ccb9f8..7f5848009 100644 --- a/package.json +++ b/package.json @@ -48,8 +48,7 @@ "karma-cli": "^1.0.1", "karma-jasmine": "^1.0.2", "karma-jasmine-html-reporter": "^0.2.2", - "protractor": "4.0.9", - "webdriver-manager": "10.2.5", + "protractor": "~4.0.13", "rimraf": "^2.5.4", "@types/node": "^6.0.46", From 1249afd56492812f8cb5ef0e054731961f3470f2 Mon Sep 17 00:00:00 2001 From: Ward Bell Date: Mon, 12 Dec 2016 20:43:33 -0800 Subject: [PATCH 56/83] chore: update example package.json to use in-mem-web-api 0.2.0 This update ensures examples get "cold" observables from `Http` when using in-mem-web-api --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 7f5848009..d2f05dfa8 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "@angular/platform-browser-dynamic": "~2.3.0", "@angular/router": "~3.3.0", - "angular-in-memory-web-api": "~0.1.17", + "angular-in-memory-web-api": "~0.2.0", "systemjs": "0.19.40", "core-js": "^2.4.1", "reflect-metadata": "^0.1.8", From e2dc603363d588bc529acaeb7769235b12c834c9 Mon Sep 17 00:00:00 2001 From: Adriano dos Santos Fernandes Date: Tue, 13 Dec 2016 06:08:21 -0200 Subject: [PATCH 57/83] Correction for when we change tsconfig.json/outDir and karma.conf/appBase. (#314) --- karma.conf.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/karma.conf.js b/karma.conf.js index cd161c83f..aab497609 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -19,7 +19,7 @@ module.exports = function(config) { ], client: { - builtPaths: [appSrcBase, testingBase], // add more spec base paths as needed + builtPaths: [appBase, testingBase], // add more spec base paths as needed clearContext: false // leave Jasmine Spec Runner output visible in browser }, From e87fbef98e7fcc57a1c17d5c876fa6d7043d7854 Mon Sep 17 00:00:00 2001 From: Ward Bell Date: Wed, 14 Dec 2016 19:03:39 -0800 Subject: [PATCH 58/83] chore: update in-mem to v.0.2.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d2f05dfa8..ed0d2ac91 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "@angular/platform-browser-dynamic": "~2.3.0", "@angular/router": "~3.3.0", - "angular-in-memory-web-api": "~0.2.0", + "angular-in-memory-web-api": "~0.2.1", "systemjs": "0.19.40", "core-js": "^2.4.1", "reflect-metadata": "^0.1.8", From d765934b532e84c0f06ea34282f1eea58c538371 Mon Sep 17 00:00:00 2001 From: Ward Bell Date: Wed, 14 Dec 2016 19:08:23 -0800 Subject: [PATCH 59/83] chore: update changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 66440908b..44fc34c8e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,10 @@ Upgraders: for a fresh start, consider running these commands * `git clean -xdf` * `npm install` + +# 0.2.20 (2016-12-14) +* Update to in-memory-web-api v.0.2.1 + # 0.2.20 (2016-12-07) * Update to Angular 2.3.0 From d8c3cba7baa9fa2eaf3cc3f60332abfb2fbfb7f0 Mon Sep 17 00:00:00 2001 From: Filipe Silva Date: Tue, 20 Dec 2016 17:56:13 +0000 Subject: [PATCH 60/83] fix(deps): pin webdriver and zone.js (#330) When https://github.com/angular/protractor/pull/3848 is ready it should fix the webdriver types issues, and the pinning can be reverted. The zone.js problem is being tracked on https://github.com/angular/zone.js/issues/554. Fix https://github.com/angular/quickstart/issues/325 --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index ed0d2ac91..16f4ea985 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "core-js": "^2.4.1", "reflect-metadata": "^0.1.8", "rxjs": "5.0.0-rc.4", - "zone.js": "^0.7.2" + "zone.js": "0.7.2" }, "devDependencies": { "concurrently": "^3.1.0", @@ -53,7 +53,7 @@ "@types/node": "^6.0.46", "@types/jasmine": "^2.5.36", - "@types/selenium-webdriver": "^2.53.33" + "@types/selenium-webdriver": "2.53.33" }, "repository": {} } From b55d76119253df57e9dcf3557f494588f4a6dd4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Rodr=C3=ADguez?= Date: Wed, 21 Dec 2016 01:51:04 +0100 Subject: [PATCH 61/83] chore: bump to 2.4.0 (#331) --- package.json | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index 16f4ea985..3c8a46fc0 100644 --- a/package.json +++ b/package.json @@ -17,21 +17,21 @@ "author": "", "license": "MIT", "dependencies": { - "@angular/common": "~2.3.0", - "@angular/compiler": "~2.3.0", - "@angular/core": "~2.3.0", - "@angular/forms": "~2.3.0", - "@angular/http": "~2.3.0", - "@angular/platform-browser": "~2.3.0", - "@angular/platform-browser-dynamic": "~2.3.0", - "@angular/router": "~3.3.0", + "@angular/common": "~2.4.0", + "@angular/compiler": "~2.4.0", + "@angular/core": "~2.4.0", + "@angular/forms": "~2.4.0", + "@angular/http": "~2.4.0", + "@angular/platform-browser": "~2.4.0", + "@angular/platform-browser-dynamic": "~2.4.0", + "@angular/router": "~3.4.0", "angular-in-memory-web-api": "~0.2.1", "systemjs": "0.19.40", "core-js": "^2.4.1", "reflect-metadata": "^0.1.8", - "rxjs": "5.0.0-rc.4", - "zone.js": "0.7.2" + "rxjs": "5.0.1", + "zone.js": "^0.7.4" }, "devDependencies": { "concurrently": "^3.1.0", From bb064832aaa14063d84aca4e2e98711dcccdb42e Mon Sep 17 00:00:00 2001 From: Craig Date: Wed, 21 Dec 2016 01:53:40 -0800 Subject: [PATCH 62/83] fix(deps): remove selenium-webdriver typings and update protractor version (#332) --- package.json | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 3c8a46fc0..42429530d 100644 --- a/package.json +++ b/package.json @@ -48,12 +48,11 @@ "karma-cli": "^1.0.1", "karma-jasmine": "^1.0.2", "karma-jasmine-html-reporter": "^0.2.2", - "protractor": "~4.0.13", + "protractor": "~4.0.14", "rimraf": "^2.5.4", "@types/node": "^6.0.46", - "@types/jasmine": "^2.5.36", - "@types/selenium-webdriver": "2.53.33" + "@types/jasmine": "^2.5.36" }, "repository": {} } From 3150b604822768c463b4e304f840a75c1237859d Mon Sep 17 00:00:00 2001 From: Ward Bell Date: Wed, 21 Dec 2016 17:41:31 -0800 Subject: [PATCH 63/83] chore: bump to latest in-memory-web-api version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 42429530d..fea565642 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "@angular/platform-browser-dynamic": "~2.4.0", "@angular/router": "~3.4.0", - "angular-in-memory-web-api": "~0.2.1", + "angular-in-memory-web-api": "~0.2.2", "systemjs": "0.19.40", "core-js": "^2.4.1", "reflect-metadata": "^0.1.8", From b98f50fd88a5b177b93e81458cd1beebedcedfb2 Mon Sep 17 00:00:00 2001 From: Filipe Silva Date: Mon, 2 Jan 2017 21:15:36 +0000 Subject: [PATCH 64/83] chore(deps): remove reflect-metadata (#343) Blocked on https://github.com/angular/in-memory-web-api/pull/86 As per https://github.com/zloirock/core-js/issues/152, `core-js` already includes `reflect-metadata`. --- index.html | 1 - karma.conf.js | 1 - package.json | 3 +-- 3 files changed, 1 insertion(+), 4 deletions(-) diff --git a/index.html b/index.html index 863c3e0ba..17df408e4 100644 --- a/index.html +++ b/index.html @@ -10,7 +10,6 @@ - diff --git a/karma.conf.js b/karma.conf.js index aab497609..2ad1cca00 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -38,7 +38,6 @@ module.exports = function(config) { // Polyfills 'node_modules/core-js/client/shim.js', - 'node_modules/reflect-metadata/Reflect.js', // zone.js 'node_modules/zone.js/dist/zone.js', diff --git a/package.json b/package.json index fea565642..b806db2c9 100644 --- a/package.json +++ b/package.json @@ -26,10 +26,9 @@ "@angular/platform-browser-dynamic": "~2.4.0", "@angular/router": "~3.4.0", - "angular-in-memory-web-api": "~0.2.2", + "angular-in-memory-web-api": "~0.2.4", "systemjs": "0.19.40", "core-js": "^2.4.1", - "reflect-metadata": "^0.1.8", "rxjs": "5.0.1", "zone.js": "^0.7.4" }, From 588fd3c2a0ce8f8412d7ee6f0af5801b0eeda463 Mon Sep 17 00:00:00 2001 From: Ward Bell Date: Mon, 2 Jan 2017 14:43:46 -0800 Subject: [PATCH 65/83] chore(readme): npm start doesn't work in Bash for Windows --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index d26f1edfb..16fcdee24 100644 --- a/README.md +++ b/README.md @@ -69,6 +69,8 @@ npm install npm start ``` +>Doesn't work in _Bash for Windows_ which does not support servers as of January, 2017. + The `npm start` command first compiles the application, then simultaneously re-compiles and runs the `lite-server`. Both the compiler and the server watch for file changes. From eda3873cce79646296170ffa66c1fbb4e97023d3 Mon Sep 17 00:00:00 2001 From: Ward Bell Date: Thu, 5 Jan 2017 18:36:36 -0800 Subject: [PATCH 66/83] chore: add non-essential-files.txt and instrucs --- CHANGELOG.md | 6 +++++- README.md | 38 ++++++++++++++++++++++++++++++-------- non-essential-files.txt | 13 +++++++++++++ 3 files changed, 48 insertions(+), 9 deletions(-) create mode 100644 non-essential-files.txt diff --git a/CHANGELOG.md b/CHANGELOG.md index 44fc34c8e..66044b5d2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,8 +3,12 @@ Upgraders: for a fresh start, consider running these commands * `git clean -xdf` * `npm install` + +# 0.2.22 (2017-01-05) +* Add `non-essential-files.txt` and instructions to use it to README + -# 0.2.20 (2016-12-14) +# 0.2.21 (2016-12-14) * Update to in-memory-web-api v.0.2.1 diff --git a/README.md b/README.md index 16fcdee24..d86af6701 100644 --- a/README.md +++ b/README.md @@ -28,33 +28,55 @@ We recommend [nvm](https://github.com/creationix/nvm) for managing multiple vers ## Create a new project based on the QuickStart Clone this repo into new project folder (e.g., `my-proj`). -```bash -git clone https://github.com/angular/quickstart my-proj +```shell +git clone https://github.com/angular/quickstart my-proj cd my-proj ``` We have no intention of updating the source on `angular/quickstart`. -Discard everything "git-like" by deleting the `.git` folder. -```bash -rm -rf .git # non-Windows +Discard the `.git` folder.. +```shell +rm -rf .git # OS/X (bash) rd .git /S/Q # windows ``` +### Delete _non-essential_ files (optional) + +You can quickly delete the _non-essential_ files that concern testing and QuickStart repository maintenance +(***including all git-related artifacts*** such as the `.git` folder and `.gitignore`!) +by entering the following commands while in the project folder: + +##### OS/X (bash) +```shell +xargs -a non-essential-files.txt rm -rf +rm app/*.spec*.ts +rm non-essential-files.txt +``` + +##### Windows +```shell +for /f %i in (non-essential-files.txt) do del %i /F /S /Q +rd .git /s /q +rd e2e /s /q +``` ### Create a new git repo You could [start writing code](#start-development) now and throw it all away when you're done. If you'd rather preserve your work under source control, consider taking the following steps. Initialize this project as a *local git repo* and make the first commit: -```bash +```shell git init git add . git commit -m "Initial commit" ``` +>Recover the deleted `.gitignore` from the QuickStart repository +if you lost it in the _Delete non-essential files_ step. + Create a *remote repository* for this project on the service of your choice. Grab its address (e.g. *`https://github.com//my-proj.git`*) and push the *local repo* to the *remote*. -```bash +```shell git remote add origin git push -u origin master ``` @@ -64,7 +86,7 @@ git push -u origin master Install the npm packages described in the `package.json` and verify that it works: -```bash +```shell npm install npm start ``` diff --git a/non-essential-files.txt b/non-essential-files.txt new file mode 100644 index 000000000..3c9cdde9d --- /dev/null +++ b/non-essential-files.txt @@ -0,0 +1,13 @@ +.git +.gitignore +.travis.yml +*.spec*.ts +CHANGELOG.md +e2e +favicon.ico +karma.conf.js +karma-test-shim.js +LICENSE +non-essential-files.txt +protractor.config.js +README.md From 182d81a34b228cbdfd70c8c823ac045e7efd193f Mon Sep 17 00:00:00 2001 From: Ward Bell Date: Tue, 10 Jan 2017 23:47:40 -0800 Subject: [PATCH 67/83] chore: add slash to appAssets in karma.conf (#329) (#351) Add leading slash to appAssets variable closes #329 --- karma.conf.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/karma.conf.js b/karma.conf.js index 2ad1cca00..e765c4eb3 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -1,8 +1,8 @@ module.exports = function(config) { - var appBase = 'app/'; // transpiled app JS and map files - var appSrcBase = 'app/'; // app source TS files - var appAssets = 'base/app/'; // component assets fetched by Angular's compiler + var appBase = 'app/'; // transpiled app JS and map files + var appSrcBase = 'app/'; // app source TS files + var appAssets = '/base/app/'; // component assets fetched by Angular's compiler // Testing helpers (optional) are conventionally in a folder called `testing` var testingBase = 'testing/'; // transpiled test JS and map files From d0e75940f0f4a7a621a4f2da9361fdf4cebac97a Mon Sep 17 00:00:00 2001 From: Filipe Silva Date: Thu, 2 Feb 2017 18:38:49 +0000 Subject: [PATCH 68/83] chore: add src folder (#362) * chore: add src folder * incorporate Jesus's feedback * move tsconfig.json into src/e2e * add base href * ignore debug.log * remove unused npm script * some protractor changes * remove appSrcBase * explicitely list config for npm run serve * add update instructions * Add third party deps note to update section --- .gitignore | 8 ++-- .travis.yml | 2 +- README.md | 38 +++++++++++++----- bs-config.e2e.json | 14 +++++++ bs-config.json | 8 ++++ tsconfig.json => e2e/tsconfig.json | 0 karma-test-shim.js | 7 ++-- karma.conf.js | 15 ++++--- package.json | 26 +++++++----- protractor.config.js | 2 +- {app => src/app}/app.component.spec.ts | 0 {app => src/app}/app.component.ts | 0 {app => src/app}/app.module.ts | 0 favicon.ico => src/favicon.ico | Bin index.html => src/index.html | 3 +- {app => src}/main.ts | 2 +- styles.css => src/styles.css | 10 ++--- .../systemjs.config.extras.js | 0 systemjs.config.js => src/systemjs.config.js | 1 - src/tsconfig.json | 13 ++++++ 20 files changed, 105 insertions(+), 44 deletions(-) create mode 100644 bs-config.e2e.json create mode 100644 bs-config.json rename tsconfig.json => e2e/tsconfig.json (100%) rename {app => src/app}/app.component.spec.ts (100%) rename {app => src/app}/app.component.ts (100%) rename {app => src/app}/app.module.ts (100%) rename favicon.ico => src/favicon.ico (100%) rename index.html => src/index.html (86%) rename {app => src}/main.ts (74%) rename styles.css => src/styles.css (94%) rename systemjs.config.extras.js => src/systemjs.config.extras.js (100%) rename systemjs.config.js => src/systemjs.config.js (98%) create mode 100644 src/tsconfig.json diff --git a/.gitignore b/.gitignore index 96d71f074..a60a4dbce 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,11 @@ .idea node_modules jspm_packages -npm-debug.* -link-checker-results.txt -app/**/*.js +npm-debug.log +debug.log +src/**/*.js +!src/systemjs.config.extras.js +!src/systemjs.config.js *.js.map e2e/**/*.js e2e/**/*.js.map diff --git a/.travis.yml b/.travis.yml index 20ff41e7d..808bc2c4e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,5 +16,5 @@ install: - npm install script: - npm run lint - - npm run test-once + - npm run test:once - npm run e2e diff --git a/README.md b/README.md index d86af6701..a5e4eff0c 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,24 @@ It exists primarily to get you started quickly with learning and prototyping in We are unlikely to accept suggestions about how to grow this QuickStart into something it is not. Please keep that in mind before posting issues and PRs. +## Updating to a newer version of the Quickstart Repo + +From time to time the QuickStart will add be enhanced with support for new features or to reflect +changes to the [official Style Guide](https://angular.io/docs/ts/latest/guide/style-guide.html). + +You can update your existing project to an up-to-date QuickStart by following these instructions: +- Create a new project using the [instructions below](#create-a-new-project-based-on-the-quickstart) +- Copy the code you have in your project's `main.ts` file onto `src/app/main.ts` in the new project +- Copy your old `app` folder into `src/app` +- Delete `src/app/main.ts` if you have one (we now use `src/main.ts` instead) +- Copy your old `index.html`, `styles.css` and `tsconfig.json` into `src/` +- Install all your third party dependencies +- Copy your old `e2e/` folder into `e2e/` +- Copy over any other files you added to your project +- Copy your old `.git` folder into your new project's root + +Now you can continue working on the new project. + ## Prerequisites Node.js and npm are essential to Angular development. @@ -106,16 +124,16 @@ You're ready to write your application. We've captured many of the most useful commands in npm scripts defined in the `package.json`: * `npm start` - runs the compiler and a server at the same time, both in "watch mode". -* `npm run tsc` - runs the TypeScript compiler once. -* `npm run tsc:w` - runs the TypeScript compiler in watch mode; the process keeps running, awaiting changes to TypeScript files and re-compiling when it sees them. -* `npm run lite` - runs the [lite-server](https://www.npmjs.com/package/lite-server), a light-weight, static file server, written and maintained by +* `npm run build` - runs the TypeScript compiler once. +* `npm run build:w` - runs the TypeScript compiler in watch mode; the process keeps running, awaiting changes to TypeScript files and re-compiling when it sees them. +* `npm run serve` - runs the [lite-server](https://www.npmjs.com/package/lite-server), a light-weight, static file server, written and maintained by [John Papa](https://github.com/johnpapa) and [Christopher Martin](https://github.com/cgmartin) with excellent support for Angular apps that use routing. Here are the test related scripts: * `npm test` - compiles, runs and watches the karma unit tests -* `npm run e2e` - run protractor e2e tests, written in JavaScript (*e2e-spec.js) +* `npm run e2e` - compiles and run protractor e2e tests, written in Typescript (*e2e-spec.ts) ## Testing @@ -128,9 +146,9 @@ These tools are configured for specific conventions described below. We recommend that you shut down one before starting another.* ### Unit Tests -TypeScript unit-tests are usually in the `app` folder. Their filenames must end in `.spec`. +TypeScript unit-tests are usually in the `src/app` folder. Their filenames must end in `.spec.ts`. -Look for the example `app/app.component.spec.ts`. +Look for the example `src/app/app.component.spec.ts`. Add more `.spec.ts` files as you wish; we configured karma to find them. Run it with `npm test` @@ -147,17 +165,17 @@ restart it. No worries; it's pretty quick. ### End-to-end (E2E) Tests -E2E tests are in the `e2e` directory, side by side with the `app` folder. +E2E tests are in the `e2e` directory, side by side with the `src` folder. Their filenames must end in `.e2e-spec.ts`. Look for the example `e2e/app.e2e-spec.ts`. Add more `.e2e-spec.js` files as you wish (although one usually suffices for small projects); -we configured protractor to find them. +we configured Protractor to find them. Thereafter, run them with `npm run e2e`. -That command first compiles, then simultaneously starts the Http-Server at `localhost:8080` -and launches protractor. +That command first compiles, then simultaneously starts the `lite-server` at `localhost:8080` +and launches Protractor. The pass/fail test results appear at the bottom of the terminal window. A custom reporter (see `protractor.config.js`) generates a `./_test-output/protractor-results.txt` file diff --git a/bs-config.e2e.json b/bs-config.e2e.json new file mode 100644 index 000000000..24570dbcc --- /dev/null +++ b/bs-config.e2e.json @@ -0,0 +1,14 @@ +{ + "open": false, + "logLevel": "silent", + "port": 8080, + "server": { + "baseDir": "src", + "routes": { + "/node_modules": "node_modules" + }, + "middleware": { + "0": null + } + } +} diff --git a/bs-config.json b/bs-config.json new file mode 100644 index 000000000..4e5859526 --- /dev/null +++ b/bs-config.json @@ -0,0 +1,8 @@ +{ + "server": { + "baseDir": "src", + "routes": { + "/node_modules": "node_modules" + } + } +} diff --git a/tsconfig.json b/e2e/tsconfig.json similarity index 100% rename from tsconfig.json rename to e2e/tsconfig.json diff --git a/karma-test-shim.js b/karma-test-shim.js index de5b015fd..fe5aa7761 100644 --- a/karma-test-shim.js +++ b/karma-test-shim.js @@ -7,8 +7,8 @@ Error.stackTraceLimit = 0; // "No stacktrace"" is usually best for app testing. jasmine.DEFAULT_TIMEOUT_INTERVAL = 1000; // builtPaths: root paths for output ("built") files -// get from karma.config.js, then prefix with '/base/' (default is 'app/') -var builtPaths = (__karma__.config.builtPaths || ['app/']) +// get from karma.config.js, then prefix with '/base/' (default is 'src/') +var builtPaths = (__karma__.config.builtPaths || ['src/']) .map(function(p) { return '/base/'+p;}); __karma__.loaded = function () { }; @@ -34,7 +34,8 @@ var allSpecFiles = Object.keys(window.__karma__.files) .filter(isBuiltFile); System.config({ - baseURL: 'base', + // Base URL for System.js calls. 'base/' is where Karma serves files from. + baseURL: 'base/src', // Extend usual application package list with test folder packages: { 'testing': { main: 'index.js', defaultExtension: 'js' } }, diff --git a/karma.conf.js b/karma.conf.js index e765c4eb3..5a51e814f 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -1,8 +1,7 @@ module.exports = function(config) { - var appBase = 'app/'; // transpiled app JS and map files - var appSrcBase = 'app/'; // app source TS files - var appAssets = '/base/app/'; // component assets fetched by Angular's compiler + var appBase = 'src/'; // transpiled app JS and map files + var appSrcBase = appBase; // app source TS files // Testing helpers (optional) are conventionally in a folder called `testing` var testingBase = 'testing/'; // transpiled test JS and map files @@ -57,8 +56,8 @@ module.exports = function(config) { { pattern: 'node_modules/@angular/**/*.js', included: false, watched: false }, { pattern: 'node_modules/@angular/**/*.js.map', included: false, watched: false }, - { pattern: 'systemjs.config.js', included: false, watched: false }, - { pattern: 'systemjs.config.extras.js', included: false, watched: false }, + { pattern: appBase + '/systemjs.config.js', included: false, watched: false }, + { pattern: appBase + '/systemjs.config.extras.js', included: false, watched: false }, 'karma-test-shim.js', // optionally extend SystemJS mapping e.g., with barrels // transpiled application & spec code paths loaded via module imports @@ -72,7 +71,7 @@ module.exports = function(config) { { pattern: appBase + '**/*.css', included: false, watched: true }, // Paths for debugging with source maps in dev tools - { pattern: appSrcBase + '**/*.ts', included: false, watched: false }, + { pattern: appBase + '**/*.ts', included: false, watched: false }, { pattern: appBase + '**/*.js.map', included: false, watched: false }, { pattern: testingSrcBase + '**/*.ts', included: false, watched: false }, { pattern: testingBase + '**/*.js.map', included: false, watched: false} @@ -80,8 +79,8 @@ module.exports = function(config) { // Proxied base paths for loading assets proxies: { - // required for component assets fetched by Angular's compiler - "/app/": appAssets + // required for modules fetched by SystemJS + '/base/src/node_modules/': '/base/node_modules/' }, exclude: [], diff --git a/package.json b/package.json index b806db2c9..ca4da28fc 100644 --- a/package.json +++ b/package.json @@ -3,15 +3,22 @@ "version": "1.0.0", "description": "QuickStart package.json from the documentation, supplemented with testing support", "scripts": { - "start": "tsc && concurrently \"tsc -w\" \"lite-server\" ", - "e2e": "tsc && concurrently \"http-server -s\" \"protractor protractor.config.js\" --kill-others --success first", - "lint": "tslint ./app/**/*.ts -t verbose", - "lite": "lite-server", - "pree2e": "webdriver-manager update", - "test": "tsc && concurrently \"tsc -w\" \"karma start karma.conf.js\"", - "test-once": "tsc && karma start karma.conf.js --single-run", - "tsc": "tsc", - "tsc:w": "tsc -w" + "build": "tsc -p src/", + "build:watch": "tsc -p src/ -w", + "build:e2e": "tsc -p e2e/", + "serve": "lite-server -c=bs-config.json", + "serve:e2e": "lite-server -c=bs-config.e2e.json", + "prestart": "npm run build", + "start": "concurrently \"npm run build:watch\" \"npm run serve\"", + "pree2e": "npm run build:e2e", + "e2e": "concurrently \"npm run serve:e2e\" \"npm run protractor\" --kill-others --success first", + "preprotractor": "webdriver-manager update", + "protractor": "protractor protractor.config.js", + "pretest": "npm run build", + "test": "concurrently \"npm run build:watch\" \"karma start karma.conf.js\"", + "pretest:once": "npm run build", + "test:once": "karma start karma.conf.js --single-run", + "lint": "tslint ./src/**/*.ts -t verbose" }, "keywords": [], "author": "", @@ -38,7 +45,6 @@ "typescript": "~2.0.10", "canonical-path": "0.0.2", - "http-server": "^0.9.0", "tslint": "^3.15.1", "lodash": "^4.16.4", "jasmine-core": "~2.4.1", diff --git a/protractor.config.js b/protractor.config.js index 8314510c5..8d4e0416a 100644 --- a/protractor.config.js +++ b/protractor.config.js @@ -5,7 +5,7 @@ // // AND THEN EVERYTIME ... // 1. Compile with `tsc` -// 2. Make sure the test server (e.g., http-server: localhost:8080) is running. +// 2. Make sure the test server (e.g., lite-server: localhost:8080) is running. // 3. ./node_modules/.bin/protractor protractor.config.js // // To do all steps, try: `npm run e2e` diff --git a/app/app.component.spec.ts b/src/app/app.component.spec.ts similarity index 100% rename from app/app.component.spec.ts rename to src/app/app.component.spec.ts diff --git a/app/app.component.ts b/src/app/app.component.ts similarity index 100% rename from app/app.component.ts rename to src/app/app.component.ts diff --git a/app/app.module.ts b/src/app/app.module.ts similarity index 100% rename from app/app.module.ts rename to src/app/app.module.ts diff --git a/favicon.ico b/src/favicon.ico similarity index 100% rename from favicon.ico rename to src/favicon.ico diff --git a/index.html b/src/index.html similarity index 86% rename from index.html rename to src/index.html index 17df408e4..6d6e22326 100644 --- a/index.html +++ b/src/index.html @@ -4,6 +4,7 @@ Angular QuickStart + @@ -14,7 +15,7 @@ diff --git a/app/main.ts b/src/main.ts similarity index 74% rename from app/main.ts rename to src/main.ts index 6af7a5b2a..311c44b76 100644 --- a/app/main.ts +++ b/src/main.ts @@ -1,5 +1,5 @@ import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; -import { AppModule } from './app.module'; +import { AppModule } from './app/app.module'; platformBrowserDynamic().bootstrapModule(AppModule); diff --git a/styles.css b/src/styles.css similarity index 94% rename from styles.css rename to src/styles.css index c30a0620d..58e1a7d9a 100644 --- a/styles.css +++ b/src/styles.css @@ -1,5 +1,5 @@ -h1 { - color: #369; - font-family: Arial, Helvetica, sans-serif; - font-size: 250%; -} +h1 { + color: #369; + font-family: Arial, Helvetica, sans-serif; + font-size: 250%; +} diff --git a/systemjs.config.extras.js b/src/systemjs.config.extras.js similarity index 100% rename from systemjs.config.extras.js rename to src/systemjs.config.extras.js diff --git a/systemjs.config.js b/src/systemjs.config.js similarity index 98% rename from systemjs.config.js rename to src/systemjs.config.js index 68caa9f4c..e91ba9b3c 100644 --- a/systemjs.config.js +++ b/src/systemjs.config.js @@ -30,7 +30,6 @@ // packages tells the System loader how to load when no filename and/or no extension packages: { app: { - main: './main.js', defaultExtension: 'js' }, rxjs: { diff --git a/src/tsconfig.json b/src/tsconfig.json new file mode 100644 index 000000000..2c7260d1b --- /dev/null +++ b/src/tsconfig.json @@ -0,0 +1,13 @@ +{ + "compilerOptions": { + "target": "es5", + "module": "commonjs", + "moduleResolution": "node", + "sourceMap": true, + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "lib": [ "es2015", "dom" ], + "noImplicitAny": true, + "suppressImplicitAnyIndexErrors": true + } +} From 816b8bd87736de0b2874502dbd38f531a281d472 Mon Sep 17 00:00:00 2001 From: Ward Bell Date: Tue, 10 Jan 2017 23:39:26 -0800 Subject: [PATCH 69/83] chore: fix OSX instructions to remove non-essential files --- README.md | 6 +++--- non-essential-files.osx.txt | 1 + non-essential-files.txt | 1 + 3 files changed, 5 insertions(+), 3 deletions(-) create mode 100644 non-essential-files.osx.txt diff --git a/README.md b/README.md index a5e4eff0c..afbee0226 100644 --- a/README.md +++ b/README.md @@ -65,9 +65,9 @@ by entering the following commands while in the project folder: ##### OS/X (bash) ```shell -xargs -a non-essential-files.txt rm -rf -rm app/*.spec*.ts -rm non-essential-files.txt +xargs rm -rf < non-essential-files.osx.txt +rm src/app/*.spec*.ts +rm non-essential-files.osx.txt ``` ##### Windows diff --git a/non-essential-files.osx.txt b/non-essential-files.osx.txt new file mode 100644 index 000000000..39cb90587 --- /dev/null +++ b/non-essential-files.osx.txt @@ -0,0 +1 @@ +.git .gitignore .travis.yml CHANGELOG.md e2e favicon.ico karma.conf.js karma-test-shim.js LICENSE non-essential-files.txt protractor.config.js README.md \ No newline at end of file diff --git a/non-essential-files.txt b/non-essential-files.txt index 3c9cdde9d..867257a9c 100644 --- a/non-essential-files.txt +++ b/non-essential-files.txt @@ -9,5 +9,6 @@ karma.conf.js karma-test-shim.js LICENSE non-essential-files.txt +non-essential-files.osx.txt protractor.config.js README.md From df33a5b061df4c29ff5a4391bf7a3a80315c66eb Mon Sep 17 00:00:00 2001 From: Ward Bell Date: Mon, 6 Feb 2017 13:46:22 -0800 Subject: [PATCH 70/83] chore: add bs-config.e2e.json to non-essential files --- non-essential-files.osx.txt | 2 +- non-essential-files.txt | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/non-essential-files.osx.txt b/non-essential-files.osx.txt index 39cb90587..653a8db9b 100644 --- a/non-essential-files.osx.txt +++ b/non-essential-files.osx.txt @@ -1 +1 @@ -.git .gitignore .travis.yml CHANGELOG.md e2e favicon.ico karma.conf.js karma-test-shim.js LICENSE non-essential-files.txt protractor.config.js README.md \ No newline at end of file +.git .gitignore .travis.yml bs-config.e2e.json CHANGELOG.md e2e favicon.ico karma.conf.js karma-test-shim.js LICENSE non-essential-files.txt protractor.config.js README.md \ No newline at end of file diff --git a/non-essential-files.txt b/non-essential-files.txt index 867257a9c..644808a66 100644 --- a/non-essential-files.txt +++ b/non-essential-files.txt @@ -2,6 +2,7 @@ .gitignore .travis.yml *.spec*.ts +bs-config.e2e.json CHANGELOG.md e2e favicon.ico From 5dda80101a079035fabde2dde432146707c31806 Mon Sep 17 00:00:00 2001 From: Filipe Silva Date: Thu, 9 Feb 2017 11:32:33 +0000 Subject: [PATCH 71/83] build(deps): update concurrently (#379) This fixes processes being left alive in gitbash. /cc @foxandxss --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index ca4da28fc..85039335f 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "zone.js": "^0.7.4" }, "devDependencies": { - "concurrently": "^3.1.0", + "concurrently": "^3.2.0", "lite-server": "^2.2.2", "typescript": "~2.0.10", From 36de7ef7585d9186ffa82a886fbccbfef9125cba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Rodr=C3=ADguez?= Date: Sat, 11 Feb 2017 02:18:22 +0100 Subject: [PATCH 72/83] chore: lock @types jasmine (#381) --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 85039335f..7353243df 100644 --- a/package.json +++ b/package.json @@ -57,7 +57,7 @@ "rimraf": "^2.5.4", "@types/node": "^6.0.46", - "@types/jasmine": "^2.5.36" + "@types/jasmine": "2.5.36" }, "repository": {} } From 90d242f97f9df2bf195a8413f4a7f8458f8af254 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Rodr=C3=ADguez?= Date: Mon, 27 Feb 2017 10:53:59 +0100 Subject: [PATCH 73/83] chore: add base href (#368) --- src/index.html | 1 + 1 file changed, 1 insertion(+) diff --git a/src/index.html b/src/index.html index 6d6e22326..14650c53a 100644 --- a/src/index.html +++ b/src/index.html @@ -2,6 +2,7 @@ Angular QuickStart + From 6e39693658897baa56699314de6a15d4783f8e41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jozef=20Pa=C5=BEin?= Date: Tue, 28 Feb 2017 13:51:24 +0100 Subject: [PATCH 74/83] Removed secondary base href=/ element (#395) --- src/index.html | 1 - 1 file changed, 1 deletion(-) diff --git a/src/index.html b/src/index.html index 14650c53a..832743558 100644 --- a/src/index.html +++ b/src/index.html @@ -5,7 +5,6 @@ - From eaf53869d0c2f4011138fc4f311abe913006a99f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Rodr=C3=ADguez?= Date: Wed, 22 Mar 2017 18:01:22 +0100 Subject: [PATCH 75/83] chore: add moduleId removal loader (#410) --- .gitignore | 1 + CHANGELOG.md | 4 ++++ src/systemjs-angular-loader.js | 43 ++++++++++++++++++++++++++++++++++ src/systemjs.config.js | 9 +++++-- 4 files changed, 55 insertions(+), 2 deletions(-) create mode 100644 src/systemjs-angular-loader.js diff --git a/.gitignore b/.gitignore index a60a4dbce..9b3a09fc9 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ debug.log src/**/*.js !src/systemjs.config.extras.js !src/systemjs.config.js +!src/systemjs-angular-loader.js *.js.map e2e/**/*.js e2e/**/*.js.map diff --git a/CHANGELOG.md b/CHANGELOG.md index 66044b5d2..45a6965a0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,10 @@ Upgraders: for a fresh start, consider running these commands * `git clean -xdf` * `npm install` + +# 0.3.0 (2017-03-22) +* Remove moduleId with a systemjs loader. + # 0.2.22 (2017-01-05) * Add `non-essential-files.txt` and instructions to use it to README diff --git a/src/systemjs-angular-loader.js b/src/systemjs-angular-loader.js new file mode 100644 index 000000000..1d873b70c --- /dev/null +++ b/src/systemjs-angular-loader.js @@ -0,0 +1,43 @@ +var templateUrlRegex = /templateUrl\s*:(\s*['"`](.*?)['"`]\s*)/gm; +var stylesRegex = /styleUrls *:(\s*\[[^\]]*?\])/g; +var stringRegex = /(['`"])((?:[^\\]\\\1|.)*?)\1/g; + +module.exports.translate = function(load){ + + var url = new URL(load.address); + + var basePathParts = url.pathname.split('/'); + + basePathParts.pop(); + var basePath = basePathParts.join('/'); + + var baseHref = new URL(this.baseURL).pathname; + + basePath = basePath.replace(baseHref, ''); + + load.source = load.source + .replace(templateUrlRegex, function(match, quote, url){ + let resolvedUrl = url; + + if (url.startsWith('.')) { + resolvedUrl = basePath + url.substr(1); + } + + return `templateUrl: '${resolvedUrl}'`; + }) + .replace(stylesRegex, function(match, relativeUrls) { + var urls = []; + + while ((match = stringRegex.exec(relativeUrls)) !== null) { + if (match[2].startsWith('.')) { + urls.push(`'${basePath}${match[2].substr(1)}'`); + } else { + urls.push(`'${match[2]}'`); + } + } + + return "styleUrls: [" + urls.join(', ') + "]"; + }); + + return load; +}; diff --git a/src/systemjs.config.js b/src/systemjs.config.js index e91ba9b3c..129704a37 100644 --- a/src/systemjs.config.js +++ b/src/systemjs.config.js @@ -11,7 +11,7 @@ // map tells the System loader where to look for things map: { // our app is within the app folder - app: 'app', + 'app': 'app', // angular bundles '@angular/core': 'npm:@angular/core/bundles/core.umd.js', @@ -30,7 +30,12 @@ // packages tells the System loader how to load when no filename and/or no extension packages: { app: { - defaultExtension: 'js' + defaultExtension: 'js', + meta: { + './*.js': { + loader: 'systemjs-angular-loader.js' + } + } }, rxjs: { defaultExtension: 'js' From e7fd753263b92c5a9948bdc336c99cb0ebe8b8a8 Mon Sep 17 00:00:00 2001 From: Filipe Silva Date: Fri, 24 Mar 2017 01:04:11 +0000 Subject: [PATCH 76/83] build: update to Angular 4 (#413) --- CHANGELOG.md | 4 ++++ package.json | 22 +++++++++++----------- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 45a6965a0..ea8aceeeb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,10 @@ Upgraders: for a fresh start, consider running these commands * `git clean -xdf` * `npm install` + +# 0.4.0 (2017-03-24) +* Update to Angular 4.0.0 + # 0.3.0 (2017-03-22) * Remove moduleId with a systemjs loader. diff --git a/package.json b/package.json index 7353243df..df18ef0e2 100644 --- a/package.json +++ b/package.json @@ -24,25 +24,25 @@ "author": "", "license": "MIT", "dependencies": { - "@angular/common": "~2.4.0", - "@angular/compiler": "~2.4.0", - "@angular/core": "~2.4.0", - "@angular/forms": "~2.4.0", - "@angular/http": "~2.4.0", - "@angular/platform-browser": "~2.4.0", - "@angular/platform-browser-dynamic": "~2.4.0", - "@angular/router": "~3.4.0", + "@angular/common": "~4.0.0", + "@angular/compiler": "~4.0.0", + "@angular/core": "~4.0.0", + "@angular/forms": "~4.0.0", + "@angular/http": "~4.0.0", + "@angular/platform-browser": "~4.0.0", + "@angular/platform-browser-dynamic": "~4.0.0", + "@angular/router": "~4.0.0", - "angular-in-memory-web-api": "~0.2.4", + "angular-in-memory-web-api": "~0.3.0", "systemjs": "0.19.40", "core-js": "^2.4.1", "rxjs": "5.0.1", - "zone.js": "^0.7.4" + "zone.js": "^0.8.4" }, "devDependencies": { "concurrently": "^3.2.0", "lite-server": "^2.2.2", - "typescript": "~2.0.10", + "typescript": "~2.1.0", "canonical-path": "0.0.2", "tslint": "^3.15.1", From 456b849692ade45c4f58fc80c65ee23c99dc9190 Mon Sep 17 00:00:00 2001 From: Ward Bell Date: Fri, 24 Mar 2017 12:31:10 -0700 Subject: [PATCH 77/83] fix(systemjs-angular-loader): replace w/ version that works in IE --- CHANGELOG.md | 4 ++++ src/systemjs-angular-loader.js | 14 ++++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ea8aceeeb..4c991b119 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,10 @@ Upgraders: for a fresh start, consider running these commands * `git clean -xdf` * `npm install` + +# 0.4.1 (2017-03-24) +* Replace systemjs-angular-loader with version that works for IE + # 0.4.0 (2017-03-24) * Update to Angular 4.0.0 diff --git a/src/systemjs-angular-loader.js b/src/systemjs-angular-loader.js index 1d873b70c..a0f7c5453 100644 --- a/src/systemjs-angular-loader.js +++ b/src/systemjs-angular-loader.js @@ -3,15 +3,17 @@ var stylesRegex = /styleUrls *:(\s*\[[^\]]*?\])/g; var stringRegex = /(['`"])((?:[^\\]\\\1|.)*?)\1/g; module.exports.translate = function(load){ - - var url = new URL(load.address); + var url = document.createElement('a'); + url.href = load.address; var basePathParts = url.pathname.split('/'); basePathParts.pop(); var basePath = basePathParts.join('/'); - var baseHref = new URL(this.baseURL).pathname; + var baseHref = document.createElement('a'); + baseHref.href = this.baseURL; + baseHref = baseHref.pathname; basePath = basePath.replace(baseHref, ''); @@ -23,16 +25,16 @@ module.exports.translate = function(load){ resolvedUrl = basePath + url.substr(1); } - return `templateUrl: '${resolvedUrl}'`; + return 'templateUrl: "' + resolvedUrl + '"'; }) .replace(stylesRegex, function(match, relativeUrls) { var urls = []; while ((match = stringRegex.exec(relativeUrls)) !== null) { if (match[2].startsWith('.')) { - urls.push(`'${basePath}${match[2].substr(1)}'`); + urls.push('"' + basePath + match[2].substr(1) + '"'); } else { - urls.push(`'${match[2]}'`); + urls.push('"' + match[2] + '"'); } } From 16232d7d513e1796654e95a61147ac5a30085a0e Mon Sep 17 00:00:00 2001 From: Mike Reid Date: Sun, 23 Apr 2017 14:48:06 -0600 Subject: [PATCH 78/83] docs(readme): fix small typo in README.md (#441) Remove word 'add' from "Updating to a newer version of the Quickstart Repo" section of GitHub README. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index afbee0226..2d001a663 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ Please keep that in mind before posting issues and PRs. ## Updating to a newer version of the Quickstart Repo -From time to time the QuickStart will add be enhanced with support for new features or to reflect +From time to time the QuickStart will be enhanced with support for new features or to reflect changes to the [official Style Guide](https://angular.io/docs/ts/latest/guide/style-guide.html). You can update your existing project to an up-to-date QuickStart by following these instructions: From 418dc2e1d00bf8a5148e761b7c92d8bb4449046c Mon Sep 17 00:00:00 2001 From: Niels Heeren Date: Wed, 26 Apr 2017 17:49:53 +0200 Subject: [PATCH 79/83] Fix systemjs-angular-loader.js for <=IE10 (#443) "let" is ES2015 and therefore not supported by<=IE10 --- src/systemjs-angular-loader.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/systemjs-angular-loader.js b/src/systemjs-angular-loader.js index a0f7c5453..4d3e12736 100644 --- a/src/systemjs-angular-loader.js +++ b/src/systemjs-angular-loader.js @@ -19,7 +19,7 @@ module.exports.translate = function(load){ load.source = load.source .replace(templateUrlRegex, function(match, quote, url){ - let resolvedUrl = url; + var resolvedUrl = url; if (url.startsWith('.')) { resolvedUrl = basePath + url.substr(1); From 87ad8f5769c52a623b8e7df679b3960f2aa50e63 Mon Sep 17 00:00:00 2001 From: feelingsofwhite Date: Thu, 27 Apr 2017 04:16:14 -0600 Subject: [PATCH 80/83] chore: fix systemjs-angular-loader.js for external templates (#444) (#445) --- src/systemjs-angular-loader.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/systemjs-angular-loader.js b/src/systemjs-angular-loader.js index 4d3e12736..8b1005444 100644 --- a/src/systemjs-angular-loader.js +++ b/src/systemjs-angular-loader.js @@ -3,6 +3,8 @@ var stylesRegex = /styleUrls *:(\s*\[[^\]]*?\])/g; var stringRegex = /(['`"])((?:[^\\]\\\1|.)*?)\1/g; module.exports.translate = function(load){ + if (load.source.indexOf('moduleId') != -1) return load; + var url = document.createElement('a'); url.href = load.address; @@ -15,7 +17,9 @@ module.exports.translate = function(load){ baseHref.href = this.baseURL; baseHref = baseHref.pathname; - basePath = basePath.replace(baseHref, ''); + if (!baseHref.startsWith('/base/')) { // it is not karma + basePath = basePath.replace(baseHref, ''); + } load.source = load.source .replace(templateUrlRegex, function(match, quote, url){ From 47970f99f8ffa7a96c85fcb3a54d2f210e6e27b1 Mon Sep 17 00:00:00 2001 From: Alexander Kozlov Date: Mon, 14 Aug 2017 15:25:01 +0300 Subject: [PATCH 81/83] chore: update angular version from 4.0.0 to 4.3.4 (#488) --- package.json | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index df18ef0e2..25513978a 100644 --- a/package.json +++ b/package.json @@ -24,14 +24,14 @@ "author": "", "license": "MIT", "dependencies": { - "@angular/common": "~4.0.0", - "@angular/compiler": "~4.0.0", - "@angular/core": "~4.0.0", - "@angular/forms": "~4.0.0", - "@angular/http": "~4.0.0", - "@angular/platform-browser": "~4.0.0", - "@angular/platform-browser-dynamic": "~4.0.0", - "@angular/router": "~4.0.0", + "@angular/common": "~4.3.4", + "@angular/compiler": "~4.3.4", + "@angular/core": "~4.3.4", + "@angular/forms": "~4.3.4", + "@angular/http": "~4.3.4", + "@angular/platform-browser": "~4.3.4", + "@angular/platform-browser-dynamic": "~4.3.4", + "@angular/router": "~4.3.4", "angular-in-memory-web-api": "~0.3.0", "systemjs": "0.19.40", From 8af36ec82cf92f3876a943ed5ff9e21dd463b3ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Rodr=C3=ADguez?= Date: Tue, 31 Oct 2017 16:09:04 +0100 Subject: [PATCH 82/83] chore: add deprecation note to the readme --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 2d001a663..5497342ff 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,12 @@ # Angular QuickStart Source [![Build Status][travis-badge]][travis-badge-url] +**This repository is now deprecated. The Angular Quickstart project was a nice starting point for creating Angular applications. Now we recommend using the [Angular CLI](https://github.com/angular/angular-cli) to create new Angular projects.** + +**Starting from 1 November 2017, all the Angular documentation, at [angular.io](https://angular.io), is based on the Angular CLI.** + +**Let's [get started](https://angular.io/guide/quickstart)** + This repository holds the TypeScript source code of the [angular.io quickstart](https://angular.io/docs/ts/latest/quickstart.html), the foundation for most of the documentation samples and potentially a good starting point for your application. From abf848628cf02fd1899ccd7b09eb7b3ffa78aa38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Rodr=C3=ADguez?= Date: Tue, 31 Oct 2017 16:09:38 +0100 Subject: [PATCH 83/83] chore: separate deprecation not from old content --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 5497342ff..aeccb7d76 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,8 @@ **Let's [get started](https://angular.io/guide/quickstart)** +--- + This repository holds the TypeScript source code of the [angular.io quickstart](https://angular.io/docs/ts/latest/quickstart.html), the foundation for most of the documentation samples and potentially a good starting point for your application.