From a654977e1d12930044bf495f392a0ec7af42a313 Mon Sep 17 00:00:00 2001 From: Ward Bell Date: Sat, 29 Oct 2016 10:38:18 -0700 Subject: [PATCH 01/46] 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 02/46] 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 03/46] 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 04/46] 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 05/46] 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 06/46] 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 07/46] 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 08/46] 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 09/46] 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 10/46] 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 11/46] 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 12/46] 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 13/46] 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 14/46] 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 15/46] 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 16/46] 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 17/46] 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 18/46] 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 19/46] 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 20/46] 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 21/46] 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 22/46] 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 23/46] 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 24/46] 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 25/46] 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 26/46] 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 27/46] 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 28/46] 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 29/46] 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 30/46] 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 31/46] 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 32/46] 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 33/46] 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 34/46] 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 35/46] 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 36/46] 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 37/46] 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 38/46] 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 39/46] 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 40/46] 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 41/46] 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 42/46] 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 43/46] 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 44/46] 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 45/46] 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 46/46] 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.