From 5dda80101a079035fabde2dde432146707c31806 Mon Sep 17 00:00:00 2001 From: Filipe Silva Date: Thu, 9 Feb 2017 11:32:33 +0000 Subject: [PATCH 01/13] 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 02/13] 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 03/13] 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 04/13] 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 05/13] 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 06/13] 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 07/13] 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 08/13] 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 09/13] 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 10/13] 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 11/13] 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 12/13] 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 13/13] 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.