From e23617201b374e18c4788fdb1b838eefef22c565 Mon Sep 17 00:00:00 2001 From: Foxandxss Date: Wed, 30 Mar 2016 19:26:16 +0200 Subject: [PATCH 001/147] fix: enableProdMode working again --- src/bootstrap.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bootstrap.ts b/src/bootstrap.ts index 24e54341..952b6594 100644 --- a/src/bootstrap.ts +++ b/src/bootstrap.ts @@ -5,7 +5,7 @@ import {HTTP_PROVIDERS} from 'angular2/http'; const ENV_PROVIDERS = []; // depending on the env mode, enable prod mode or add debugging modules -if (process.env.ENV === 'prod') { +if (process.env.ENV === 'build') { enableProdMode(); } else { ENV_PROVIDERS.push(ELEMENT_PROBE_PROVIDERS); From 49b7e8197c9b531cc9ee7947fc5eaa44cff6e4a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Rodr=C3=ADguez?= Date: Sun, 3 Apr 2016 21:54:59 +0200 Subject: [PATCH 002/147] chore: change polyfills yet again --- README.md | 6 +- package.json | 3 +- src/polyfills.ts | 13 ++++ src/public/index.html | 3 - src/shims/shims_for_IE.js | 130 -------------------------------------- src/vendor.ts | 6 -- webpack.config.js | 63 ++++++++---------- 7 files changed, 46 insertions(+), 178 deletions(-) create mode 100644 src/polyfills.ts delete mode 100644 src/shims/shims_for_IE.js diff --git a/README.md b/README.md index ccaa5b95..8444c9c3 100644 --- a/README.md +++ b/README.md @@ -121,7 +121,11 @@ npm run docs #### Do I need to add script / link tags into index.html ? -No, Webpack will add all the needed Javascript bundles as script tags and all the CSS files as link tags. The advantage is that you don't need to modify the index.html everytime you build your solution to update the hashes. +No, Webpack will add all the needed Javascript bundles as script tags and all the CSS files as link tags. The advantage is that you don't need to modify the index.html every time you build your solution to update the hashes. + +#### Some dependencies are not met, what's going on? + +`es6-shim` and `reflect-metadata` are dependencies of angular 2. We decided to include `core-js` as a better replacement. #### How to include external angular 2 libraries ? diff --git a/package.json b/package.json index a7966fe8..b34543a2 100644 --- a/package.json +++ b/package.json @@ -23,8 +23,7 @@ }, "dependencies": { "angular2": "2.0.0-beta.12", - "es6-shim": "^0.35.0", - "reflect-metadata": "0.1.2", + "core-js": "^2.2.1", "rxjs": "5.0.0-beta.2", "zone.js": "0.6.6" }, diff --git a/src/polyfills.ts b/src/polyfills.ts new file mode 100644 index 00000000..a8271362 --- /dev/null +++ b/src/polyfills.ts @@ -0,0 +1,13 @@ +import 'core-js'; +require('zone.js/dist/zone'); + +if (process.env.ENV === 'build') { + // Production + +} else { + // Development + + Error['stackTraceLimit'] = Infinity; + require('zone.js/dist/long-stack-trace-zone'); +} + diff --git a/src/public/index.html b/src/public/index.html index 6e5a5d0c..a3ddd37b 100644 --- a/src/public/index.html +++ b/src/public/index.html @@ -9,8 +9,5 @@ Loading... - - - diff --git a/src/shims/shims_for_IE.js b/src/shims/shims_for_IE.js deleted file mode 100644 index 9a5c1488..00000000 --- a/src/shims/shims_for_IE.js +++ /dev/null @@ -1,130 +0,0 @@ -// function.name (all IE) -/*! @source http://stackoverflow.com/questions/6903762/function-name-not-supported-in-ie*/ -if (!Object.hasOwnProperty('name')) { - Object.defineProperty(Function.prototype, 'name', { - get: function() { - var matches = this.toString().match(/^\s*function\s*(\S*)\s*\(/); - var name = matches && matches.length > 1 ? matches[1] : ""; - // For better performance only parse once, and then cache the - // result through a new accessor for repeated access. - Object.defineProperty(this, 'name', {value: name}); - return name; - } - }); -} - -// URL polyfill for SystemJS (all IE) -/*! @source https://github.com/ModuleLoader/es6-module-loader/blob/master/src/url-polyfill.js*/ -// from https://gist.github.com/Yaffle/1088850 -(function(global) { - function URLPolyfill(url, baseURL) { - if (typeof url != 'string') { - throw new TypeError('URL must be a string'); - } - var m = String(url).replace(/^\s+|\s+$/g, "").match(/^([^:\/?#]+:)?(?:\/\/(?:([^:@\/?#]*)(?::([^:@\/?#]*))?@)?(([^:\/?#]*)(?::(\d*))?))?([^?#]*)(\?[^#]*)?(#[\s\S]*)?/); - if (!m) { - throw new RangeError(); - } - var protocol = m[1] || ""; - var username = m[2] || ""; - var password = m[3] || ""; - var host = m[4] || ""; - var hostname = m[5] || ""; - var port = m[6] || ""; - var pathname = m[7] || ""; - var search = m[8] || ""; - var hash = m[9] || ""; - if (baseURL !== undefined) { - var base = baseURL instanceof URLPolyfill ? baseURL : new URLPolyfill(baseURL); - var flag = protocol === "" && host === "" && username === ""; - if (flag && pathname === "" && search === "") { - search = base.search; - } - if (flag && pathname.charAt(0) !== "/") { - pathname = (pathname !== "" ? (((base.host !== "" || base.username !== "") && base.pathname === "" ? "/" : "") + base.pathname.slice(0, base.pathname.lastIndexOf("/") + 1) + pathname) : base.pathname); - } - // dot segments removal - var output = []; - pathname.replace(/^(\.\.?(\/|$))+/, "") - .replace(/\/(\.(\/|$))+/g, "/") - .replace(/\/\.\.$/, "/../") - .replace(/\/?[^\/]*/g, function (p) { - if (p === "/..") { - output.pop(); - } else { - output.push(p); - } - }); - pathname = output.join("").replace(/^\//, pathname.charAt(0) === "/" ? "/" : ""); - if (flag) { - port = base.port; - hostname = base.hostname; - host = base.host; - password = base.password; - username = base.username; - } - if (protocol === "") { - protocol = base.protocol; - } - } - - // convert windows file URLs to use / - if (protocol == 'file:') - pathname = pathname.replace(/\\/g, '/'); - - this.origin = protocol + (protocol !== "" || host !== "" ? "//" : "") + host; - this.href = protocol + (protocol !== "" || host !== "" ? "//" : "") + (username !== "" ? username + (password !== "" ? ":" + password : "") + "@" : "") + host + pathname + search + hash; - this.protocol = protocol; - this.username = username; - this.password = password; - this.host = host; - this.hostname = hostname; - this.port = port; - this.pathname = pathname; - this.search = search; - this.hash = hash; - } -global.URLPolyfill = URLPolyfill; -})(typeof self != 'undefined' ? self : global); - -//classList (IE9) -/*! @license please refer to http://unlicense.org/ */ -/*! @author Eli Grey */ -/*! @source https://github.com/eligrey/classList.js */ -;if("document" in self&&!("classList" in document.createElement("_"))){(function(j){"use strict";if(!("Element" in j)){return}var a="classList",f="prototype",m=j.Element[f],b=Object,k=String[f].trim||function(){return this.replace(/^\s+|\s+$/g,"")},c=Array[f].indexOf||function(q){var p=0,o=this.length;for(;p Date: Mon, 4 Apr 2016 01:33:30 +0200 Subject: [PATCH 003/147] chore: swap es6-shim for tests too --- karma-shim.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/karma-shim.js b/karma-shim.js index 62df8d43..845688f7 100644 --- a/karma-shim.js +++ b/karma-shim.js @@ -1,7 +1,10 @@ Error.stackTraceLimit = Infinity; -require('es6-shim'); -require('angular2/bundles/angular2-polyfills.js'); -require('angular2/testing'); +require('core-js'); + +require('zone.js/dist/zone.js'); +require('zone.js/dist/long-stack-trace-zone.js'); +require('zone.js/dist/jasmine-patch.js'); + /* Ok, this is kinda crazy. We can use the the context method on From 4681ec4d5e4406ddf04a53b1ffce330b0124dea0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Rodr=C3=ADguez?= Date: Mon, 4 Apr 2016 01:35:39 +0200 Subject: [PATCH 004/147] chore: update typings to es6-shim --- typings.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/typings.json b/typings.json index cd022b45..bcfe15bd 100644 --- a/typings.json +++ b/typings.json @@ -3,7 +3,7 @@ "jasmine": "github:DefinitelyTyped/DefinitelyTyped/jasmine/jasmine.d.ts#7de6c3dd94feaeb21f20054b9f30d5dabc5efabd" }, "ambientDependencies": { - "es6-shim": "github:DefinitelyTyped/DefinitelyTyped/es6-shim/es6-shim.d.ts#7de6c3dd94feaeb21f20054b9f30d5dabc5efabd", + "core-js": "github:DefinitelyTyped/DefinitelyTyped/core-js/core-js.d.ts#7de6c3dd94feaeb21f20054b9f30d5dabc5efabd", "node": "github:DefinitelyTyped/DefinitelyTyped/node/node.d.ts#315f5612ceb4de6f1f81f8cf49878084ea3f364a" } } From dc753827d0e388660ff7dff6033067eeca0e936a Mon Sep 17 00:00:00 2001 From: Foxandxss Date: Mon, 4 Apr 2016 01:38:29 +0200 Subject: [PATCH 005/147] chore: remove extension from requires --- karma-shim.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/karma-shim.js b/karma-shim.js index 845688f7..b6340408 100644 --- a/karma-shim.js +++ b/karma-shim.js @@ -1,9 +1,9 @@ Error.stackTraceLimit = Infinity; require('core-js'); -require('zone.js/dist/zone.js'); -require('zone.js/dist/long-stack-trace-zone.js'); -require('zone.js/dist/jasmine-patch.js'); +require('zone.js/dist/zone'); +require('zone.js/dist/long-stack-trace-zone'); +require('zone.js/dist/jasmine-patch'); /* From ea08a34884a2e2116f02dc3d999b9441a979cf09 Mon Sep 17 00:00:00 2001 From: Foxandxss Date: Mon, 4 Apr 2016 13:35:02 +0200 Subject: [PATCH 006/147] chore: swap tsconfig-lint with tslint Fixes #70 --- package.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/package.json b/package.json index b34543a2..70da7d17 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "server": "webpack-dev-server --inline --progress --port 8080", "webdriver-update": "webdriver-manager update", "webdriver-start": "webdriver-manager start", - "lint": "tsconfig-lint", + "lint": "tslint src/**/*.ts; exit 0", "e2e": "protractor", "e2e-live": "protractor --elementExplorer", "test": "karma start", @@ -57,7 +57,6 @@ "sass-loader": "^3.1.2", "style-loader": "^0.13.0", "ts-loader": "^0.8.1", - "tsconfig-lint": "^0.5.0", "tslint": "^3.4.0", "tslint-loader": "^2.1.0", "typedoc": "^0.3.12", From e28ac8a2a9d0736a8c63b16eec561bf73462f339 Mon Sep 17 00:00:00 2001 From: Foxandxss Date: Mon, 4 Apr 2016 13:39:10 +0200 Subject: [PATCH 007/147] chore: lint some files --- src/app/app.spec.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/app/app.spec.ts b/src/app/app.spec.ts index 0fd3752d..9c833be2 100644 --- a/src/app/app.spec.ts +++ b/src/app/app.spec.ts @@ -1,13 +1,11 @@ import { it, inject, - injectAsync, - beforeEachProviders, - TestComponentBuilder, + beforeEachProviders } from 'angular2/testing'; // to use Translate Service, we need Http, and to test Http we need to mock the backend -import {BaseRequestOptions, Http, Response, ResponseOptions} from 'angular2/http'; +import {BaseRequestOptions, Http} from 'angular2/http'; import {MockBackend} from 'angular2/http/testing'; import {provide} from "angular2/core"; From 3fe84ce26c6fba9f5a82727d0d489774297f3372 Mon Sep 17 00:00:00 2001 From: Foxandxss Date: Tue, 5 Apr 2016 12:29:32 +0200 Subject: [PATCH 008/147] chore: update to Angular 2 beta 13 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 70da7d17..48d1fb76 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "postinstall": "npm run webdriver-update && typings install" }, "dependencies": { - "angular2": "2.0.0-beta.12", + "angular2": "2.0.0-beta.13", "core-js": "^2.2.1", "rxjs": "5.0.0-beta.2", "zone.js": "0.6.6" From f7b5eb03f06a4edcf5eeb60c443d9c0969bdef35 Mon Sep 17 00:00:00 2001 From: Foxandxss Date: Sat, 9 Apr 2016 00:20:11 +0200 Subject: [PATCH 009/147] chore: update to Angular 2 beta 14 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 48d1fb76..1d453e67 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "postinstall": "npm run webdriver-update && typings install" }, "dependencies": { - "angular2": "2.0.0-beta.13", + "angular2": "2.0.0-beta.14", "core-js": "^2.2.1", "rxjs": "5.0.0-beta.2", "zone.js": "0.6.6" From 7653787df1ef9380197a384d61e227570ceff01d Mon Sep 17 00:00:00 2001 From: Foxandxss Date: Sun, 10 Apr 2016 17:33:25 +0200 Subject: [PATCH 010/147] chore: remove extra pattern in karma.conf.js --- karma.conf.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/karma.conf.js b/karma.conf.js index 6a9b4068..c666dbf7 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -13,8 +13,7 @@ module.exports = function (config) { // list of files / patterns to load in the browser files: [ - {pattern: './karma-shim.js', watched: false}, - {pattern: './src/app/**/*.spec.ts', watched: true, included: false} + {pattern: './karma-shim.js', watched: false} ], // list of files to exclude From 1b8af92d15bec71c657246a90b490a52a1e79a69 Mon Sep 17 00:00:00 2001 From: Foxandxss Date: Mon, 11 Apr 2016 22:16:21 +0200 Subject: [PATCH 011/147] chore: simplify commonchunksplugin usage --- webpack.config.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/webpack.config.js b/webpack.config.js index e784eacb..7dd77ffc 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -170,8 +170,7 @@ module.exports = function makeWebpackConfig() { // Reference: https://webpack.github.io/docs/code-splitting.html // Reference: https://webpack.github.io/docs/list-of-plugins.html#commonschunkplugin new CommonsChunkPlugin({ - name: ['app', 'vendor', 'polyfills'], - minChunks: Infinity + name: ['vendor', 'polyfills'] }), // Inject script and link tags into html files From 387c3c30af90c2fef98b8d4b371fe95dd9f81059 Mon Sep 17 00:00:00 2001 From: Foxandxss Date: Tue, 12 Apr 2016 18:32:04 +0200 Subject: [PATCH 012/147] chore: yet another polyfills change --- README.md | 4 ---- karma-shim.js | 7 ------- karma.conf.js | 2 ++ package.json | 3 ++- src/polyfills.ts | 13 ------------- webpack.config.js | 2 +- 6 files changed, 5 insertions(+), 26 deletions(-) delete mode 100644 src/polyfills.ts diff --git a/README.md b/README.md index 8444c9c3..3acf6e0c 100644 --- a/README.md +++ b/README.md @@ -123,10 +123,6 @@ npm run docs No, Webpack will add all the needed Javascript bundles as script tags and all the CSS files as link tags. The advantage is that you don't need to modify the index.html every time you build your solution to update the hashes. -#### Some dependencies are not met, what's going on? - -`es6-shim` and `reflect-metadata` are dependencies of angular 2. We decided to include `core-js` as a better replacement. - #### How to include external angular 2 libraries ? It's simple, just install the lib via npm and import it in your code when you need it. Don't forget that you need to configure some external libs in the [bootstrap](https://github.com/preboot/angular2-webpack/blob/master/src/bootstrap.ts) of your application. diff --git a/karma-shim.js b/karma-shim.js index b6340408..02bd404a 100644 --- a/karma-shim.js +++ b/karma-shim.js @@ -1,10 +1,4 @@ Error.stackTraceLimit = Infinity; -require('core-js'); - -require('zone.js/dist/zone'); -require('zone.js/dist/long-stack-trace-zone'); -require('zone.js/dist/jasmine-patch'); - /* Ok, this is kinda crazy. We can use the the context method on @@ -22,7 +16,6 @@ var appContext = require.context('./src', true, /\.spec\.ts/); // loop and require those spec files here appContext.keys().forEach(appContext); - // Select BrowserDomAdapter. // see https://github.com/AngularClass/angular2-webpack-starter/issues/124 // Somewhere in the test setup diff --git a/karma.conf.js b/karma.conf.js index c666dbf7..7654bb92 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -13,6 +13,8 @@ module.exports = function (config) { // list of files / patterns to load in the browser files: [ + {pattern: 'node_modules/es6-shim/es6-shim.js', included: true, watched: false}, + {pattern: 'node_modules/angular2/bundles/angular2-polyfills.js', included: true, watched: false}, {pattern: './karma-shim.js', watched: false} ], diff --git a/package.json b/package.json index 1d453e67..cde59f29 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,8 @@ }, "dependencies": { "angular2": "2.0.0-beta.14", - "core-js": "^2.2.1", + "es6-shim": "^0.35.0", + "reflect-metadata": "0.1.2", "rxjs": "5.0.0-beta.2", "zone.js": "0.6.6" }, diff --git a/src/polyfills.ts b/src/polyfills.ts deleted file mode 100644 index a8271362..00000000 --- a/src/polyfills.ts +++ /dev/null @@ -1,13 +0,0 @@ -import 'core-js'; -require('zone.js/dist/zone'); - -if (process.env.ENV === 'build') { - // Production - -} else { - // Development - - Error['stackTraceLimit'] = Infinity; - require('zone.js/dist/long-stack-trace-zone'); -} - diff --git a/webpack.config.js b/webpack.config.js index 7dd77ffc..55069ced 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -46,7 +46,7 @@ module.exports = function makeWebpackConfig() { * Reference: http://webpack.github.io/docs/configuration.html#entry */ config.entry = isTest ? {} : { - 'polyfills': './src/polyfills.ts', + 'polyfills': 'angular2/bundles/angular2-polyfills', 'vendor': './src/vendor.ts', 'app': './src/bootstrap.ts' // our angular app }; From 011c737bbf9c62617f7e94170b77d0602a805a0b Mon Sep 17 00:00:00 2001 From: Foxandxss Date: Tue, 19 Apr 2016 11:32:12 +0200 Subject: [PATCH 013/147] chore: update to Angular 2 beta 15 --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index cde59f29..1d682ff7 100644 --- a/package.json +++ b/package.json @@ -22,11 +22,11 @@ "postinstall": "npm run webdriver-update && typings install" }, "dependencies": { - "angular2": "2.0.0-beta.14", + "angular2": "2.0.0-beta.15", "es6-shim": "^0.35.0", "reflect-metadata": "0.1.2", "rxjs": "5.0.0-beta.2", - "zone.js": "0.6.6" + "zone.js": "0.6.11" }, "devDependencies": { "angular-cli": "0.0.*", From c77dbd222fb3a27bef26094d71e42595c3dd55d1 Mon Sep 17 00:00:00 2001 From: Foxandxss Date: Tue, 19 Apr 2016 11:33:36 +0200 Subject: [PATCH 014/147] chore: revert core-js typings to es6-shim typings --- typings.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/typings.json b/typings.json index bcfe15bd..6dd9b71d 100644 --- a/typings.json +++ b/typings.json @@ -3,7 +3,7 @@ "jasmine": "github:DefinitelyTyped/DefinitelyTyped/jasmine/jasmine.d.ts#7de6c3dd94feaeb21f20054b9f30d5dabc5efabd" }, "ambientDependencies": { - "core-js": "github:DefinitelyTyped/DefinitelyTyped/core-js/core-js.d.ts#7de6c3dd94feaeb21f20054b9f30d5dabc5efabd", + "es6-shim": "registry:dt/es6-shim#0.31.2+20160317120654", "node": "github:DefinitelyTyped/DefinitelyTyped/node/node.d.ts#315f5612ceb4de6f1f81f8cf49878084ea3f364a" } } From a429ea4b0196dd56c3e2e23ce391a7a4f9a6c9c0 Mon Sep 17 00:00:00 2001 From: Foxandxss Date: Tue, 19 Apr 2016 11:35:25 +0200 Subject: [PATCH 015/147] fix: add es6-shim before polyfills --- webpack.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webpack.config.js b/webpack.config.js index 55069ced..970dec17 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -46,7 +46,7 @@ module.exports = function makeWebpackConfig() { * Reference: http://webpack.github.io/docs/configuration.html#entry */ config.entry = isTest ? {} : { - 'polyfills': 'angular2/bundles/angular2-polyfills', + 'polyfills': ['es6-shim/es6-shim.js', 'angular2/bundles/angular2-polyfills'], 'vendor': './src/vendor.ts', 'app': './src/bootstrap.ts' // our angular app }; From 1c19b91dda559cde64e5f105471029a5735d92e4 Mon Sep 17 00:00:00 2001 From: Foxandxss Date: Tue, 19 Apr 2016 17:39:06 +0200 Subject: [PATCH 016/147] chore: update typings Fix #75 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 1d682ff7..f53eb543 100644 --- a/package.json +++ b/package.json @@ -62,7 +62,7 @@ "tslint-loader": "^2.1.0", "typedoc": "^0.3.12", "typescript": "^1.8.0", - "typings": "^0.6.8", + "typings": "^0.7.12", "url-loader": "^0.5.6", "webpack": "^1.12.13", "webpack-dev-server": "^1.14.1" From d83e04e3e2a4ae79a2794608b8aacd35e4faf1c0 Mon Sep 17 00:00:00 2001 From: Foxandxss Date: Tue, 19 Apr 2016 17:41:35 +0200 Subject: [PATCH 017/147] chore: update typings to new format --- typings.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/typings.json b/typings.json index 6dd9b71d..d569d367 100644 --- a/typings.json +++ b/typings.json @@ -1,9 +1,9 @@ { "ambientDevDependencies": { - "jasmine": "github:DefinitelyTyped/DefinitelyTyped/jasmine/jasmine.d.ts#7de6c3dd94feaeb21f20054b9f30d5dabc5efabd" + "jasmine": "registry:dt/jasmine#2.2.0+20160412134438" }, "ambientDependencies": { "es6-shim": "registry:dt/es6-shim#0.31.2+20160317120654", - "node": "github:DefinitelyTyped/DefinitelyTyped/node/node.d.ts#315f5612ceb4de6f1f81f8cf49878084ea3f364a" + "node": "registry:dt/node#4.0.0+20160412142033" } } From ee2139514c3a9a3deab9554e5f562b9d2a3223b2 Mon Sep 17 00:00:00 2001 From: Foxandxss Date: Sat, 23 Apr 2016 20:21:21 +0200 Subject: [PATCH 018/147] chore: change interpolation for property binding --- src/app/app.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/app.html b/src/app/app.html index f50fc0d5..237277ea 100644 --- a/src/app/app.html +++ b/src/app/app.html @@ -13,5 +13,5 @@

Hello from {{api.title}} !

From 94d8649759e16426b1866f882b1bd14ef40f9755 Mon Sep 17 00:00:00 2001 From: Redian Date: Wed, 27 Apr 2016 08:51:52 +0100 Subject: [PATCH 019/147] Update karma.shim.js (#79) Some Documentation Update. --- karma-shim.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/karma-shim.js b/karma-shim.js index 02bd404a..430df624 100644 --- a/karma-shim.js +++ b/karma-shim.js @@ -4,9 +4,9 @@ Error.stackTraceLimit = Infinity; Ok, this is kinda crazy. We can use the the context method on require that webpack created in order to tell webpack what files we actually want to require or import. - Below, context will be an function/object with file names as keys. + Below, context will be a function/object with file names as keys. using that regex we are saying look in client/app and find - any file that ends with spec.js and get its path. By passing in true + any file that ends with '.spec.ts' and get its path. By passing in true we say do this recursively */ var appContext = require.context('./src', true, /\.spec\.ts/); From 42ed41110c6e8aa831708ebaabb5f8f985fdffb6 Mon Sep 17 00:00:00 2001 From: Foxandxss Date: Wed, 27 Apr 2016 13:37:00 +0200 Subject: [PATCH 020/147] update to Angular 2 beta 16 --- karma.conf.js | 1 + package.json | 4 ++-- src/app/components/about/about.spec.ts | 9 +++++---- src/bootstrap.ts | 3 ++- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/karma.conf.js b/karma.conf.js index 7654bb92..319afc21 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -15,6 +15,7 @@ module.exports = function (config) { files: [ {pattern: 'node_modules/es6-shim/es6-shim.js', included: true, watched: false}, {pattern: 'node_modules/angular2/bundles/angular2-polyfills.js', included: true, watched: false}, + {pattern: 'node_modules/zone.js/dist/async-test.js', included: true, watched: false}, {pattern: './karma-shim.js', watched: false} ], diff --git a/package.json b/package.json index f53eb543..37a61bf0 100644 --- a/package.json +++ b/package.json @@ -22,11 +22,11 @@ "postinstall": "npm run webdriver-update && typings install" }, "dependencies": { - "angular2": "2.0.0-beta.15", + "angular2": "2.0.0-beta.16", "es6-shim": "^0.35.0", "reflect-metadata": "0.1.2", "rxjs": "5.0.0-beta.2", - "zone.js": "0.6.11" + "zone.js": "0.6.12" }, "devDependencies": { "angular-cli": "0.0.*", diff --git a/src/app/components/about/about.spec.ts b/src/app/components/about/about.spec.ts index cdc897bf..81f8648c 100644 --- a/src/app/components/about/about.spec.ts +++ b/src/app/components/about/about.spec.ts @@ -1,7 +1,8 @@ import { it, describe, - injectAsync, + async, + inject, TestComponentBuilder, beforeEachProviders } from 'angular2/testing'; @@ -12,10 +13,10 @@ describe('About Component', () => { beforeEachProviders(() => []); - it('should ...', injectAsync([TestComponentBuilder], (tcb:TestComponentBuilder) => { - return tcb.createAsync(About).then((fixture) => { + it('should ...', async(inject([TestComponentBuilder], (tcb:TestComponentBuilder) => { + tcb.createAsync(About).then((fixture) => { fixture.detectChanges(); }); - })); + }))); }); diff --git a/src/bootstrap.ts b/src/bootstrap.ts index 952b6594..f5cd75aa 100644 --- a/src/bootstrap.ts +++ b/src/bootstrap.ts @@ -1,6 +1,7 @@ import {enableProdMode, provide} from "angular2/core"; import {bootstrap, ELEMENT_PROBE_PROVIDERS} from 'angular2/platform/browser'; -import {ROUTER_PROVIDERS, HashLocationStrategy, LocationStrategy} from 'angular2/router'; +import {ROUTER_PROVIDERS} from 'angular2/router'; +import {HashLocationStrategy, LocationStrategy} from 'angular2/platform/common'; import {HTTP_PROVIDERS} from 'angular2/http'; const ENV_PROVIDERS = []; From 22596d8d880f9108cbe6a9579bc3ad99463935cd Mon Sep 17 00:00:00 2001 From: Foxandxss Date: Sat, 30 Apr 2016 21:37:26 +0200 Subject: [PATCH 021/147] add bail to build to not swallow errors --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 37a61bf0..b69e8eb0 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "clean-install": "npm run clean && npm install", "clean-start": "npm run clean && npm start", "watch": "webpack --watch --progress --profile", - "build": "rimraf dist && webpack --progress --profile", + "build": "rimraf dist && webpack --progress --profile --bail", "server": "webpack-dev-server --inline --progress --port 8080", "webdriver-update": "webdriver-manager update", "webdriver-start": "webdriver-manager start", From dbac9fd41e34b2bf30c718f8a0a172e055dadb48 Mon Sep 17 00:00:00 2001 From: Foxandxss Date: Thu, 5 May 2016 16:28:04 +0200 Subject: [PATCH 022/147] chore: update to Angular 2 rc1 --- karma-shim.js | 14 +++++++++++--- karma.conf.js | 3 --- package.json | 10 ++++++++-- src/app/app.html | 2 +- src/app/app.spec.ts | 8 ++++---- src/app/app.ts | 6 +++--- src/app/components/about/about.spec.ts | 5 +++-- src/app/components/about/about.ts | 2 +- src/app/components/home/home.spec.ts | 2 +- src/app/components/home/home.ts | 4 ++-- src/app/services/api/api.spec.ts | 3 ++- src/app/services/api/api.ts | 2 +- src/bootstrap.ts | 13 +++++++------ src/polyfills.ts | 14 ++++++++++++++ src/public/img/angular.png | Bin 0 -> 4509 bytes src/public/img/shield-with-beta.png | Bin 21275 -> 0 bytes src/vendor.ts | 11 ++++++----- webpack.config.js | 4 ++-- 18 files changed, 66 insertions(+), 37 deletions(-) create mode 100644 src/polyfills.ts create mode 100644 src/public/img/angular.png delete mode 100644 src/public/img/shield-with-beta.png diff --git a/karma-shim.js b/karma-shim.js index 430df624..0a637238 100644 --- a/karma-shim.js +++ b/karma-shim.js @@ -1,5 +1,13 @@ Error.stackTraceLimit = Infinity; +require('es6-shim'); +require('reflect-metadata'); + +require('zone.js/dist/zone'); +require('zone.js/dist/long-stack-trace-zone'); +require('zone.js/dist/jasmine-patch'); +require('zone.js/dist/async-test'); + /* Ok, this is kinda crazy. We can use the the context method on require that webpack created in order to tell webpack @@ -19,7 +27,7 @@ appContext.keys().forEach(appContext); // Select BrowserDomAdapter. // see https://github.com/AngularClass/angular2-webpack-starter/issues/124 // Somewhere in the test setup -var testing = require('angular2/testing'); -var browser = require('angular2/platform/testing/browser'); +var testing = require('@angular/core/testing'); +var browser = require('@angular/platform-browser-dynamic/testing'); -testing.setBaseTestProviders(browser.TEST_BROWSER_PLATFORM_PROVIDERS, browser.TEST_BROWSER_APPLICATION_PROVIDERS); +testing.setBaseTestProviders(browser.TEST_BROWSER_DYNAMIC_PLATFORM_PROVIDERS, browser.TEST_BROWSER_DYNAMIC_APPLICATION_PROVIDERS); diff --git a/karma.conf.js b/karma.conf.js index 319afc21..c666dbf7 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -13,9 +13,6 @@ module.exports = function (config) { // list of files / patterns to load in the browser files: [ - {pattern: 'node_modules/es6-shim/es6-shim.js', included: true, watched: false}, - {pattern: 'node_modules/angular2/bundles/angular2-polyfills.js', included: true, watched: false}, - {pattern: 'node_modules/zone.js/dist/async-test.js', included: true, watched: false}, {pattern: './karma-shim.js', watched: false} ], diff --git a/package.json b/package.json index b69e8eb0..1771969b 100644 --- a/package.json +++ b/package.json @@ -22,10 +22,16 @@ "postinstall": "npm run webdriver-update && typings install" }, "dependencies": { - "angular2": "2.0.0-beta.16", + "@angular/common": "2.0.0-rc.1", + "@angular/compiler": "2.0.0-rc.1", + "@angular/core": "2.0.0-rc.1", + "@angular/http": "2.0.0-rc.1", + "@angular/platform-browser": "2.0.0-rc.1", + "@angular/platform-browser-dynamic": "2.0.0-rc.1", + "@angular/router-deprecated": "2.0.0-rc.1", "es6-shim": "^0.35.0", "reflect-metadata": "0.1.2", - "rxjs": "5.0.0-beta.2", + "rxjs": "5.0.0-beta.6", "zone.js": "0.6.12" }, "devDependencies": { diff --git a/src/app/app.html b/src/app/app.html index 237277ea..731e31e8 100644 --- a/src/app/app.html +++ b/src/app/app.html @@ -8,7 +8,7 @@

Hello from {{api.title}} !

- + diff --git a/src/app/app.spec.ts b/src/app/app.spec.ts index 9c833be2..0c54d9be 100644 --- a/src/app/app.spec.ts +++ b/src/app/app.spec.ts @@ -2,12 +2,12 @@ import { it, inject, beforeEachProviders -} from 'angular2/testing'; +} from '@angular/core/testing'; // to use Translate Service, we need Http, and to test Http we need to mock the backend -import {BaseRequestOptions, Http} from 'angular2/http'; -import {MockBackend} from 'angular2/http/testing'; -import {provide} from "angular2/core"; +import {BaseRequestOptions, Http} from '@angular/http'; +import {MockBackend} from '@angular/http/testing'; +import {provide} from "@angular/core"; // Load the implementations that should be tested import {Api} from './services/api/api'; diff --git a/src/app/app.ts b/src/app/app.ts index 669a4297..aaa83056 100644 --- a/src/app/app.ts +++ b/src/app/app.ts @@ -1,6 +1,6 @@ -import {Component} from 'angular2/core'; -import {RouteConfig, ROUTER_DIRECTIVES} from 'angular2/router'; -import {FORM_PROVIDERS} from 'angular2/common'; +import {Component} from '@angular/core'; +import {RouteConfig, ROUTER_DIRECTIVES} from '@angular/router-deprecated'; +import {FORM_PROVIDERS} from '@angular/common'; import '../style/app.scss'; diff --git a/src/app/components/about/about.spec.ts b/src/app/components/about/about.spec.ts index 81f8648c..4cb41ea7 100644 --- a/src/app/components/about/about.spec.ts +++ b/src/app/components/about/about.spec.ts @@ -3,9 +3,10 @@ import { describe, async, inject, - TestComponentBuilder, beforeEachProviders -} from 'angular2/testing'; +} from '@angular/core/testing'; + +import { TestComponentBuilder } from '@angular/compiler/testing'; import {About} from './about'; diff --git a/src/app/components/about/about.ts b/src/app/components/about/about.ts index 1b9863f5..5c54fe05 100644 --- a/src/app/components/about/about.ts +++ b/src/app/components/about/about.ts @@ -1,4 +1,4 @@ -import {Component, OnInit} from 'angular2/core'; +import {Component, OnInit} from '@angular/core'; @Component({ selector: 'about', diff --git a/src/app/components/home/home.spec.ts b/src/app/components/home/home.spec.ts index b36bcc1e..118d078c 100644 --- a/src/app/components/home/home.spec.ts +++ b/src/app/components/home/home.spec.ts @@ -3,7 +3,7 @@ import { inject, describe, beforeEachProviders, -} from 'angular2/testing'; +} from '@angular/core/testing'; // Load the implementations that should be tested import {Home} from './home'; diff --git a/src/app/components/home/home.ts b/src/app/components/home/home.ts index 311eecfc..e0c6e110 100644 --- a/src/app/components/home/home.ts +++ b/src/app/components/home/home.ts @@ -1,5 +1,5 @@ -import {Component, OnInit} from 'angular2/core'; -import {FORM_DIRECTIVES} from 'angular2/common'; +import {Component, OnInit} from '@angular/core'; +import {FORM_DIRECTIVES} from '@angular/common'; @Component({ selector: 'home', diff --git a/src/app/services/api/api.spec.ts b/src/app/services/api/api.spec.ts index 5ba7eacf..c066bc39 100644 --- a/src/app/services/api/api.spec.ts +++ b/src/app/services/api/api.spec.ts @@ -4,7 +4,8 @@ import { expect, inject, beforeEachProviders -} from 'angular2/testing'; +} from '@angular/core/testing'; + import {Api} from './api'; describe('Api Service', () => { diff --git a/src/app/services/api/api.ts b/src/app/services/api/api.ts index 0e58272b..9eb78b62 100644 --- a/src/app/services/api/api.ts +++ b/src/app/services/api/api.ts @@ -1,4 +1,4 @@ -import {Injectable} from 'angular2/core'; +import {Injectable} from '@angular/core'; @Injectable() export class Api { diff --git a/src/bootstrap.ts b/src/bootstrap.ts index f5cd75aa..b9dab00c 100644 --- a/src/bootstrap.ts +++ b/src/bootstrap.ts @@ -1,8 +1,9 @@ -import {enableProdMode, provide} from "angular2/core"; -import {bootstrap, ELEMENT_PROBE_PROVIDERS} from 'angular2/platform/browser'; -import {ROUTER_PROVIDERS} from 'angular2/router'; -import {HashLocationStrategy, LocationStrategy} from 'angular2/platform/common'; -import {HTTP_PROVIDERS} from 'angular2/http'; +import {enableProdMode} from "@angular/core"; +import {bootstrap} from '@angular/platform-browser-dynamic'; +import {ELEMENT_PROBE_PROVIDERS} from '@angular/platform-browser'; +import {ROUTER_PROVIDERS} from '@angular/router-deprecated'; +import {HashLocationStrategy, LocationStrategy} from '@angular/common'; +import {HTTP_PROVIDERS} from '@angular/http'; const ENV_PROVIDERS = []; // depending on the env mode, enable prod mode or add debugging modules @@ -28,7 +29,7 @@ document.addEventListener('DOMContentLoaded', function main() { ...HTTP_PROVIDERS, ...ROUTER_PROVIDERS, ...ENV_PROVIDERS, - provide(LocationStrategy, {useClass: HashLocationStrategy}) // use #/ routes, remove this for HTML5 mode + { provide: LocationStrategy, useClass: HashLocationStrategy } // use #/ routes, remove this for HTML5 mode ]) .catch(err => console.error(err)); }); diff --git a/src/polyfills.ts b/src/polyfills.ts new file mode 100644 index 00000000..edf98a38 --- /dev/null +++ b/src/polyfills.ts @@ -0,0 +1,14 @@ +import 'es6-shim'; +import 'reflect-metadata'; +require('zone.js/dist/zone'); + +if (process.env.ENV === 'build') { + // Production + +} else { + // Development + + Error['stackTraceLimit'] = Infinity; + + require('zone.js/dist/long-stack-trace-zone'); +} diff --git a/src/public/img/angular.png b/src/public/img/angular.png new file mode 100644 index 0000000000000000000000000000000000000000..a1d9790bc342c674c37a5f4183b5700c22568488 GIT binary patch literal 4509 zcma)Ac{r5a`P>Bb&89Hg@wn&7-a=K zcMd-s$ANFm{7oI;ArfMEBgER@EhOAI$dv`*;(yx}X5#DY?rP=g>=F^!>8j1b!mnq7 zLfG6LozK1OV?QX8-1q5$+vRc z%=$Qp9(O_c=qSfq-vEKCa;3s^8D3@J5>c*yr5tZuMs*MKp6&m%xc^+lU7IjR&Dth4 z&CNxek=r}-WQ7s2m%B?PZ}JMWaO54~J;H)J`kw=)$?~7$|KZL;Bk67Esqc^z^n_=O zKN(_?AYJaGFT^*pXwxpMR~$7fr4H);z4zQy*RB29?5op~D0aOW1+`CttwgisWcnKn z{epP3cvRYp6#68Af|L(>xU{hw25S1}(*5<&^s~4Gt@wPOk?fMk;%K?vH~SjtN;qU- zP`*cp&bQwD1%q`dM)LX+TnCpBRYy$pYHBv;!x616B;LjF{tU_#y=}pe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27g=TWe;oYDY9vHu&$0Sh!H64b0Xf?^%z z;|d)>9*|5BQevkS`oG=NNRHG2H_d+|d@(>=^gGEYYK#1^@84H%OLgCT6qeEsRh4Lo zuwtkb=}%8WJR13%Xx*X?!ovH(tKBAWM?UZgDT{wrJffSeZ335O70(y2wEU zI_jkeJulmUN_}fYNO45w*v48bM0&x!=I_DC z657`s0Fi^@j*c4je@&l#Sf|Wc2`GztE6mX?{j=*-8{=2g|JfdJ!Qt1VFbdv`=TtK8qXsyu&cH z1Ck;CB+I;W*xEPBMwr|_I!yK1Kd$C%fJ%1l8`gHf-QYIB5yEF$Xb-%5o$^RiyC~ug zWbh(lc7u=$@*CSYgnZ-hSZWVpsPS*&PrxapVXm2TLLML;qt}UWV6PGbAjLbjTA$l* zA7|_{dmoO@fk>^DkZ&vye96CYkvVo2RC$lPmcY%dB2e zKEkG0rZ#jM+!R};`*d&h7i~IX2o4?>SCkUNOMPujr?+uA`E}^FW}`w3iw%RsbfjH(`B_=uG1(>UL2^ix+me zcWo0sbRO7C>a$6F@($;}1_xY!4a3n~RCZrX^VO}l@Ji&mmRXK|yeewKb}JAZcq@he zoy`|RwcV0A+JG_4?1Z@VC(}m~AD*qeZ@E61po;2Kh`dml!{xArK?$`wUEn_kcsDJ( zg74lE!qUG=;R<*LB88%>1DU$%bjK^6&r`13wqdAg%i=rvX8Lgs1-Ncnv^L=kWPp*B z?_stDM};qH+e>XJzY-Xzap4oMLjO%YAAuiSV6QX|m~)7+ziuC%@+{`8I#;+fQpZ zwhtJF1XyeZe*Iq6FM`59;}Da3K%acI40cO-Uy(ppK>|o7-z+OW`}e&c`+!VPwj#KTUbmC%~2Hwx8nZ?l$XZ= literal 0 HcmV?d00001 diff --git a/src/public/img/shield-with-beta.png b/src/public/img/shield-with-beta.png deleted file mode 100644 index 41d99b17550de238bb314d62e23fcaa1f5323bae..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 21275 zcma%jXET1moJpah;I|);NXy{C_mN0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H&IE+;eIe0xLRNXmYaB%@O-nXVW6!eV1^Tc=YKA2@fjXE+V$~@Cy@J6 zvI89Cdr%%ImAG&bJKSEEIv6MjsWTJ9IrAxA=;+n4i7d!|Mo4Kgn2!p2KJUWUNIhpv zfBAR*@QXZ2_WCGE(v05`a=AR z8KTrSW7<&E-ejG)H+P9s=RBMrz)zXycr3^M1~f9jr+}OFfpM&E7}87?**<@+A}Zlx z-Nl^Ut&F9xSqx-YDfY5>uZQ%tQyYPhNL5=q#}?OG$rPVb%o2a@mzg~|DQ-Obi)DeN z6;{4){I207;&?Ojg#ViQtBw}qYjrzMER;NR%$AOljyvsJz^pwk7blNQVLIKbga$bT zny<<05jzj-#Pt2-xi3-0)03)WHGN!hX*WT3lZpw0UgqJQ349*bzu(uE+n+vMt*yA# zeF6XU@(mSW1gf+n-&P}25e>j&`2cgH9hKVr(0g2~A=f~h9{MZJ!p_S*^+%Y)C*^0u z9VJ7|(LNAOPb@_t%`NobLw-RVhNg!T<{LZFBoKEa{I=T+cph@jdQY0@FT3WNI4=} z-N2%o5PEQ^AkoYwG`8XIOd)d4XF~@<2-uh*e*-CcU2en+;X3TY7#svx^5l^B$a@{P|c~DRvyringeqmjbQM(m!pW zrusQ@N#K~WL^Uf?n|7^&%>@+1JW;{sssiCuCm@!wMc5=c9;f}#5nJ+KJvBhx@NOro zY)khLC>{QX0969G+Y$H>F;I`r9(L lPyNmRKT|*Pmm!nnKuGo0c#S#x+grc Date: Thu, 5 May 2016 16:32:41 +0200 Subject: [PATCH 023/147] chore: update node typings --- typings.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/typings.json b/typings.json index d569d367..f78946be 100644 --- a/typings.json +++ b/typings.json @@ -4,6 +4,6 @@ }, "ambientDependencies": { "es6-shim": "registry:dt/es6-shim#0.31.2+20160317120654", - "node": "registry:dt/node#4.0.0+20160412142033" + "node": "registry:dt/node#4.0.0+20160501135006" } } From bcfbafc21ed1a5329564ea9e2f710365219ea40a Mon Sep 17 00:00:00 2001 From: Foxandxss Date: Thu, 5 May 2016 16:48:30 +0200 Subject: [PATCH 024/147] chore: improve build size with ts-helpers --- karma-shim.js | 2 ++ package.json | 1 + src/polyfills.ts | 2 ++ tsconfig.json | 2 +- 4 files changed, 6 insertions(+), 1 deletion(-) diff --git a/karma-shim.js b/karma-shim.js index 0a637238..6ae04adc 100644 --- a/karma-shim.js +++ b/karma-shim.js @@ -3,6 +3,8 @@ Error.stackTraceLimit = Infinity; require('es6-shim'); require('reflect-metadata'); +require('ts-helpers'); + require('zone.js/dist/zone'); require('zone.js/dist/long-stack-trace-zone'); require('zone.js/dist/jasmine-patch'); diff --git a/package.json b/package.json index 1771969b..46f1e3ad 100644 --- a/package.json +++ b/package.json @@ -63,6 +63,7 @@ "rimraf": "^2.5.1", "sass-loader": "^3.1.2", "style-loader": "^0.13.0", + "ts-helpers": "^1.1.1", "ts-loader": "^0.8.1", "tslint": "^3.4.0", "tslint-loader": "^2.1.0", diff --git a/src/polyfills.ts b/src/polyfills.ts index edf98a38..02c74ac8 100644 --- a/src/polyfills.ts +++ b/src/polyfills.ts @@ -2,6 +2,8 @@ import 'es6-shim'; import 'reflect-metadata'; require('zone.js/dist/zone'); +import 'ts-helpers'; + if (process.env.ENV === 'build') { // Production diff --git a/tsconfig.json b/tsconfig.json index b6b75ef6..57fb3a40 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -5,7 +5,7 @@ "emitDecoratorMetadata": true, "experimentalDecorators": true, "sourceMap": true, - "moduleResolution": "node" + "noEmitHelpers": true }, "exclude": [ "node_modules", From 25ffd6effc24ef351300139a9ec81e28cd05faf9 Mon Sep 17 00:00:00 2001 From: Foxandxss Date: Fri, 6 May 2016 14:40:48 +0200 Subject: [PATCH 025/147] add codelyzer and angular2 rules --- package.json | 1 + src/app/app.spec.ts | 8 ++--- src/app/app.ts | 4 +-- tslint.json | 77 ++++++++++++++++++++++++++++++++++++++++----- 4 files changed, 77 insertions(+), 13 deletions(-) diff --git a/package.json b/package.json index 46f1e3ad..30534805 100644 --- a/package.json +++ b/package.json @@ -37,6 +37,7 @@ "devDependencies": { "angular-cli": "0.0.*", "autoprefixer": "^6.3.2", + "codelyzer": "0.0.19", "copy-webpack-plugin": "^1.1.1", "css-loader": "^0.23.0", "extract-text-webpack-plugin": "^1.0.1", diff --git a/src/app/app.spec.ts b/src/app/app.spec.ts index 0c54d9be..fbc37c9b 100644 --- a/src/app/app.spec.ts +++ b/src/app/app.spec.ts @@ -7,16 +7,16 @@ import { // to use Translate Service, we need Http, and to test Http we need to mock the backend import {BaseRequestOptions, Http} from '@angular/http'; import {MockBackend} from '@angular/http/testing'; -import {provide} from "@angular/core"; +import {provide} from '@angular/core'; // Load the implementations that should be tested import {Api} from './services/api/api'; -import {App} from './app'; +import {AppComponent} from './app'; describe('App', () => { // provide our implementations or mocks to the dependency injector beforeEachProviders(() => [ - App, + AppComponent, Api, BaseRequestOptions, MockBackend, @@ -29,7 +29,7 @@ describe('App', () => { }) ]); - it('should have an url', inject([App], (app: App) => { + it('should have an url', inject([AppComponent], (app: AppComponent) => { expect(app.url).toEqual('https://github.com/preboot/angular2-webpack'); })); diff --git a/src/app/app.ts b/src/app/app.ts index aaa83056..00ef2b65 100644 --- a/src/app/app.ts +++ b/src/app/app.ts @@ -6,7 +6,7 @@ import '../style/app.scss'; import {Api} from './services/api/api'; import {Home} from './components/home/home'; -import {About} from "./components/about/about"; +import {About} from './components/about/about'; /* * App Component @@ -24,7 +24,7 @@ import {About} from "./components/about/about"; {path: '/', component: Home, name: 'Home'}, {path: '/About', component: About, name: 'About'} ]) -export class App { +export class AppComponent { url: string = 'https://github.com/preboot/angular2-webpack'; constructor(public api: Api) { diff --git a/tslint.json b/tslint.json index d5898d29..7b13bd17 100644 --- a/tslint.json +++ b/tslint.json @@ -1,27 +1,59 @@ { + "rulesDirectory": [ + "node_modules/codelyzer" + ], "rules": { "class-name": true, + "comment-format": [ + true, + "check-space" + ], "curly": true, "eofline": true, - "indent": "spaces", - "max-line-length": false, + "forin": true, + "indent": [ + true, + "spaces" + ], + "label-position": true, + "label-undefined": true, + "max-line-length": [ + true, + 140 + ], + "member-access": false, "member-ordering": [ true, - "public-before-private", "static-before-instance", "variables-before-functions" ], "no-arg": true, + "no-bitwise": true, + "no-console": [ + true, + "debug", + "info", + "time", + "timeEnd", + "trace" + ], "no-construct": true, + "no-debugger": true, "no-duplicate-key": true, "no-duplicate-variable": true, - "no-empty": true, + "no-empty": false, "no-eval": true, + "no-inferrable-types": true, + "no-shadowed-variable": true, + "no-string-literal": false, + "no-switch-case-fall-through": true, "no-trailing-whitespace": true, "no-unused-expression": true, "no-unused-variable": true, "no-unreachable": true, "no-use-before-declare": true, + "no-var-keyword": true, + "object-literal-sort-keys": false, "one-line": [ true, "check-open-brace", @@ -29,19 +61,50 @@ "check-else", "check-whitespace" ], - "quotemark": false, - "semicolon": true, + "quotemark": [ + true, + "single" + ], + "radix": true, + "semicolon": [ + "always" + ], "triple-equals": [ true, "allow-null-check" ], + "typedef-whitespace": [ + true, + { + "call-signature": "nospace", + "index-signature": "nospace", + "parameter": "nospace", + "property-declaration": "nospace", + "variable-declaration": "nospace" + } + ], "variable-name": false, "whitespace": [ true, + "check-branch", "check-decl", "check-operator", "check-separator", "check-type" - ] + ], + + "directive-selector-name": [true, "camelCase"], + "component-selector-name": [true, "kebab-case"], + "directive-selector-type": [true, "attribute"], + "component-selector-type": [true, "element"], + "use-input-property-decorator": true, + "use-output-property-decorator": true, + "use-host-property-decorator": true, + "no-input-rename": true, + "no-output-rename": true, + "use-life-cycle-interface": true, + "use-pipe-transform-interface": true, + "component-class-suffix": true, + "directive-class-suffix": true } } From 137af71fca7ac1fbe0be7374585200ee21777e7b Mon Sep 17 00:00:00 2001 From: Foxandxss Date: Fri, 6 May 2016 15:16:27 +0200 Subject: [PATCH 026/147] second step for angular 2 conventions --- package.json | 2 +- src/app/app.ts | 8 ++++---- src/app/components/about/about.spec.ts | 6 +++--- src/app/components/about/about.ts | 2 +- src/app/components/home/home.spec.ts | 6 +++--- src/app/components/home/home.ts | 2 +- src/app/services/api/api.spec.ts | 2 +- src/bootstrap.ts | 6 +++--- 8 files changed, 17 insertions(+), 17 deletions(-) diff --git a/package.json b/package.json index 30534805..43a86678 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "server": "webpack-dev-server --inline --progress --port 8080", "webdriver-update": "webdriver-manager update", "webdriver-start": "webdriver-manager start", - "lint": "tslint src/**/*.ts; exit 0", + "lint": "tslint 'src/**/*.ts'; exit 0", "e2e": "protractor", "e2e-live": "protractor --elementExplorer", "test": "karma start", diff --git a/src/app/app.ts b/src/app/app.ts index 00ef2b65..6998ed60 100644 --- a/src/app/app.ts +++ b/src/app/app.ts @@ -5,8 +5,8 @@ import {FORM_PROVIDERS} from '@angular/common'; import '../style/app.scss'; import {Api} from './services/api/api'; -import {Home} from './components/home/home'; -import {About} from './components/about/about'; +import {HomeComponent} from './components/home/home'; +import {AboutComponent} from './components/about/about'; /* * App Component @@ -21,8 +21,8 @@ import {About} from './components/about/about'; template: require('./app.html') }) @RouteConfig([ - {path: '/', component: Home, name: 'Home'}, - {path: '/About', component: About, name: 'About'} + {path: '/', component: HomeComponent, name: 'Home'}, + {path: '/About', component: AboutComponent, name: 'About'} ]) export class AppComponent { url: string = 'https://github.com/preboot/angular2-webpack'; diff --git a/src/app/components/about/about.spec.ts b/src/app/components/about/about.spec.ts index 4cb41ea7..b17b83b9 100644 --- a/src/app/components/about/about.spec.ts +++ b/src/app/components/about/about.spec.ts @@ -8,14 +8,14 @@ import { import { TestComponentBuilder } from '@angular/compiler/testing'; -import {About} from './about'; +import {AboutComponent} from './about'; describe('About Component', () => { beforeEachProviders(() => []); - it('should ...', async(inject([TestComponentBuilder], (tcb:TestComponentBuilder) => { - tcb.createAsync(About).then((fixture) => { + it('should ...', async(inject([TestComponentBuilder], (tcb: TestComponentBuilder) => { + tcb.createAsync(AboutComponent).then((fixture) => { fixture.detectChanges(); }); }))); diff --git a/src/app/components/about/about.ts b/src/app/components/about/about.ts index 5c54fe05..c816814e 100644 --- a/src/app/components/about/about.ts +++ b/src/app/components/about/about.ts @@ -8,7 +8,7 @@ import {Component, OnInit} from '@angular/core'; directives: [], pipes: [] }) -export class About implements OnInit { +export class AboutComponent implements OnInit { constructor() { // Do stuff diff --git a/src/app/components/home/home.spec.ts b/src/app/components/home/home.spec.ts index 118d078c..c0ffd3cb 100644 --- a/src/app/components/home/home.spec.ts +++ b/src/app/components/home/home.spec.ts @@ -6,15 +6,15 @@ import { } from '@angular/core/testing'; // Load the implementations that should be tested -import {Home} from './home'; +import {HomeComponent} from './home'; describe('Home', () => { // provide our implementations or mocks to the dependency injector beforeEachProviders(() => [ - Home + HomeComponent ]); - it('should log ngOnInit', inject([Home], (home) => { + it('should log ngOnInit', inject([HomeComponent], (home) => { spyOn(console, 'log'); expect(console.log).not.toHaveBeenCalled(); diff --git a/src/app/components/home/home.ts b/src/app/components/home/home.ts index e0c6e110..779430a1 100644 --- a/src/app/components/home/home.ts +++ b/src/app/components/home/home.ts @@ -8,7 +8,7 @@ import {FORM_DIRECTIVES} from '@angular/common'; styles: [require('./home.scss')], template: require('./home.html') }) -export class Home implements OnInit { +export class HomeComponent implements OnInit { constructor() { // Do stuff diff --git a/src/app/services/api/api.spec.ts b/src/app/services/api/api.spec.ts index c066bc39..3fe301cb 100644 --- a/src/app/services/api/api.spec.ts +++ b/src/app/services/api/api.spec.ts @@ -12,7 +12,7 @@ describe('Api Service', () => { beforeEachProviders(() => [Api]); - it('should ...', inject([Api], (api:Api) => { + it('should ...', inject([Api], (api: Api) => { expect(api.title).toBe('Angular 2'); })); diff --git a/src/bootstrap.ts b/src/bootstrap.ts index b9dab00c..dc251ab7 100644 --- a/src/bootstrap.ts +++ b/src/bootstrap.ts @@ -1,4 +1,4 @@ -import {enableProdMode} from "@angular/core"; +import {enableProdMode} from '@angular/core'; import {bootstrap} from '@angular/platform-browser-dynamic'; import {ELEMENT_PROBE_PROVIDERS} from '@angular/platform-browser'; import {ROUTER_PROVIDERS} from '@angular/router-deprecated'; @@ -17,14 +17,14 @@ if (process.env.ENV === 'build') { * App Component * our top level component that holds all of our components */ -import {App} from './app/app'; +import {AppComponent} from './app/app'; /* * Bootstrap our Angular app with a top level component `App` and inject * our Services and Providers into Angular's dependency injection */ document.addEventListener('DOMContentLoaded', function main() { - return bootstrap(App, [ + return bootstrap(AppComponent, [ // These are dependencies of our App ...HTTP_PROVIDERS, ...ROUTER_PROVIDERS, From 25c46771eceda6faa5a04f4b7be4dff0096bfc6b Mon Sep 17 00:00:00 2001 From: Foxandxss Date: Fri, 6 May 2016 16:55:15 +0200 Subject: [PATCH 027/147] convert structure to style-guide --- .../about.component.html} | 0 .../about.component.scss} | 0 .../about.component.spec.ts} | 2 +- .../about.ts => +about/about.component.ts} | 8 ++--- src/app/+about/index.ts | 1 + .../home.component.e2e.js} | 4 +-- .../home.html => +home/home.component.html} | 0 .../home.scss => +home/home.component.scss} | 0 .../home.component.spec.ts} | 2 +- src/app/+home/home.component.ts | 21 ++++++++++++ src/app/+home/index.ts | 1 + src/app/{app.e2e.js => app.component.e2e.js} | 0 src/app/{app.html => app.component.html} | 0 src/app/{app.scss => app.component.scss} | 0 .../{app.spec.ts => app.component.spec.ts} | 12 +++---- src/app/app.component.ts | 32 +++++++++++++++++++ src/app/app.ts | 32 ------------------- src/app/components/home/home.ts | 21 ------------ src/app/services/api/api.ts | 6 ---- .../api/api.service.spec.ts} | 6 ++-- src/app/shared/api/api.service.ts | 6 ++++ src/app/shared/api/index.ts | 1 + src/{bootstrap.ts => main.ts} | 2 +- src/public/index.html | 2 +- tslint.json | 5 ++- webpack.config.js | 2 +- 26 files changed, 86 insertions(+), 80 deletions(-) rename src/app/{components/about/about.html => +about/about.component.html} (100%) rename src/app/{components/about/about.scss => +about/about.component.scss} (100%) rename src/app/{components/about/about.spec.ts => +about/about.component.spec.ts} (89%) rename src/app/{components/about/about.ts => +about/about.component.ts} (54%) create mode 100644 src/app/+about/index.ts rename src/app/{components/home/home.e2e.js => +home/home.component.e2e.js} (68%) rename src/app/{components/home/home.html => +home/home.component.html} (100%) rename src/app/{components/home/home.scss => +home/home.component.scss} (100%) rename src/app/{components/home/home.spec.ts => +home/home.component.spec.ts} (91%) create mode 100644 src/app/+home/home.component.ts create mode 100644 src/app/+home/index.ts rename src/app/{app.e2e.js => app.component.e2e.js} (100%) rename src/app/{app.html => app.component.html} (100%) rename src/app/{app.scss => app.component.scss} (100%) rename src/app/{app.spec.ts => app.component.spec.ts} (75%) create mode 100644 src/app/app.component.ts delete mode 100644 src/app/app.ts delete mode 100644 src/app/components/home/home.ts delete mode 100644 src/app/services/api/api.ts rename src/app/{services/api/api.spec.ts => shared/api/api.service.spec.ts} (55%) create mode 100644 src/app/shared/api/api.service.ts create mode 100644 src/app/shared/api/index.ts rename src/{bootstrap.ts => main.ts} (95%) diff --git a/src/app/components/about/about.html b/src/app/+about/about.component.html similarity index 100% rename from src/app/components/about/about.html rename to src/app/+about/about.component.html diff --git a/src/app/components/about/about.scss b/src/app/+about/about.component.scss similarity index 100% rename from src/app/components/about/about.scss rename to src/app/+about/about.component.scss diff --git a/src/app/components/about/about.spec.ts b/src/app/+about/about.component.spec.ts similarity index 89% rename from src/app/components/about/about.spec.ts rename to src/app/+about/about.component.spec.ts index b17b83b9..ffcb5ef0 100644 --- a/src/app/components/about/about.spec.ts +++ b/src/app/+about/about.component.spec.ts @@ -8,7 +8,7 @@ import { import { TestComponentBuilder } from '@angular/compiler/testing'; -import {AboutComponent} from './about'; +import { AboutComponent } from './about.component'; describe('About Component', () => { diff --git a/src/app/components/about/about.ts b/src/app/+about/about.component.ts similarity index 54% rename from src/app/components/about/about.ts rename to src/app/+about/about.component.ts index c816814e..9cae0ae7 100644 --- a/src/app/components/about/about.ts +++ b/src/app/+about/about.component.ts @@ -1,9 +1,9 @@ -import {Component, OnInit} from '@angular/core'; +import { Component, OnInit } from '@angular/core'; @Component({ - selector: 'about', - template: require('./about.html'), - styles: [require('./about.scss')], + selector: 'my-about', + template: require('./about.component.html'), + styles: [require('./about.component.scss')], providers: [], directives: [], pipes: [] diff --git a/src/app/+about/index.ts b/src/app/+about/index.ts new file mode 100644 index 00000000..b7cb92ae --- /dev/null +++ b/src/app/+about/index.ts @@ -0,0 +1 @@ +export * from './about.component'; diff --git a/src/app/components/home/home.e2e.js b/src/app/+home/home.component.e2e.js similarity index 68% rename from src/app/components/home/home.e2e.js rename to src/app/+home/home.component.e2e.js index 2dc873e3..0510057d 100644 --- a/src/app/components/home/home.e2e.js +++ b/src/app/+home/home.component.e2e.js @@ -4,8 +4,8 @@ describe('Home', function () { browser.get('/'); }); - it('should have ', function () { - var home = element(by.css('app home')); + it('should have ', function () { + var home = element(by.css('app my-home')); expect(home.isPresent()).toEqual(true); expect(home.getText()).toEqual("Home Works!"); }); diff --git a/src/app/components/home/home.html b/src/app/+home/home.component.html similarity index 100% rename from src/app/components/home/home.html rename to src/app/+home/home.component.html diff --git a/src/app/components/home/home.scss b/src/app/+home/home.component.scss similarity index 100% rename from src/app/components/home/home.scss rename to src/app/+home/home.component.scss diff --git a/src/app/components/home/home.spec.ts b/src/app/+home/home.component.spec.ts similarity index 91% rename from src/app/components/home/home.spec.ts rename to src/app/+home/home.component.spec.ts index c0ffd3cb..36a45618 100644 --- a/src/app/components/home/home.spec.ts +++ b/src/app/+home/home.component.spec.ts @@ -6,7 +6,7 @@ import { } from '@angular/core/testing'; // Load the implementations that should be tested -import {HomeComponent} from './home'; +import { HomeComponent } from './home.component'; describe('Home', () => { // provide our implementations or mocks to the dependency injector diff --git a/src/app/+home/home.component.ts b/src/app/+home/home.component.ts new file mode 100644 index 00000000..3c6a9b83 --- /dev/null +++ b/src/app/+home/home.component.ts @@ -0,0 +1,21 @@ +import { Component, OnInit } from '@angular/core'; +import { FORM_DIRECTIVES } from '@angular/common'; + +@Component({ + selector: 'my-home', + directives: [...FORM_DIRECTIVES], + pipes: [], + styles: [require('./home.component.scss')], + template: require('./home.component.html') +}) +export class HomeComponent implements OnInit { + + constructor() { + // Do stuff + } + + ngOnInit() { + console.log('Hello Home'); + } + +} diff --git a/src/app/+home/index.ts b/src/app/+home/index.ts new file mode 100644 index 00000000..ab5a522c --- /dev/null +++ b/src/app/+home/index.ts @@ -0,0 +1 @@ +export * from './home.component'; diff --git a/src/app/app.e2e.js b/src/app/app.component.e2e.js similarity index 100% rename from src/app/app.e2e.js rename to src/app/app.component.e2e.js diff --git a/src/app/app.html b/src/app/app.component.html similarity index 100% rename from src/app/app.html rename to src/app/app.component.html diff --git a/src/app/app.scss b/src/app/app.component.scss similarity index 100% rename from src/app/app.scss rename to src/app/app.component.scss diff --git a/src/app/app.spec.ts b/src/app/app.component.spec.ts similarity index 75% rename from src/app/app.spec.ts rename to src/app/app.component.spec.ts index fbc37c9b..d1841998 100644 --- a/src/app/app.spec.ts +++ b/src/app/app.component.spec.ts @@ -5,19 +5,19 @@ import { } from '@angular/core/testing'; // to use Translate Service, we need Http, and to test Http we need to mock the backend -import {BaseRequestOptions, Http} from '@angular/http'; -import {MockBackend} from '@angular/http/testing'; -import {provide} from '@angular/core'; +import { BaseRequestOptions, Http } from '@angular/http'; +import { MockBackend } from '@angular/http/testing'; +import { provide } from '@angular/core'; // Load the implementations that should be tested -import {Api} from './services/api/api'; -import {AppComponent} from './app'; +import { ApiService } from './shared/api'; +import { AppComponent } from './app.component'; describe('App', () => { // provide our implementations or mocks to the dependency injector beforeEachProviders(() => [ AppComponent, - Api, + ApiService, BaseRequestOptions, MockBackend, // Provide a mocked (fake) backend for Http diff --git a/src/app/app.component.ts b/src/app/app.component.ts new file mode 100644 index 00000000..dc8e6f7b --- /dev/null +++ b/src/app/app.component.ts @@ -0,0 +1,32 @@ +import { Component } from '@angular/core'; +import { RouteConfig, ROUTER_DIRECTIVES } from '@angular/router-deprecated'; +import { FORM_PROVIDERS } from '@angular/common'; + +import { ApiService } from './shared/api'; +import { HomeComponent } from './+home'; +import { AboutComponent } from './+about'; + +import '../style/app.scss'; + +/* + * App Component + * Top Level Component + */ +@Component({ + selector: 'my-app', // + providers: [...FORM_PROVIDERS, ApiService], + directives: [...ROUTER_DIRECTIVES], + pipes: [], + styles: [require('./app.component.scss')], + template: require('./app.component.html') +}) +@RouteConfig([ + {path: '/', component: HomeComponent, name: 'Home'}, + {path: '/About', component: AboutComponent, name: 'About'} +]) +export class AppComponent { + url = 'https://github.com/preboot/angular2-webpack'; + + constructor(private api: ApiService) { + } +} diff --git a/src/app/app.ts b/src/app/app.ts deleted file mode 100644 index 6998ed60..00000000 --- a/src/app/app.ts +++ /dev/null @@ -1,32 +0,0 @@ -import {Component} from '@angular/core'; -import {RouteConfig, ROUTER_DIRECTIVES} from '@angular/router-deprecated'; -import {FORM_PROVIDERS} from '@angular/common'; - -import '../style/app.scss'; - -import {Api} from './services/api/api'; -import {HomeComponent} from './components/home/home'; -import {AboutComponent} from './components/about/about'; - -/* - * App Component - * Top Level Component - */ -@Component({ - selector: 'app', // - providers: [...FORM_PROVIDERS, Api], - directives: [...ROUTER_DIRECTIVES], - pipes: [], - styles: [require('./app.scss')], - template: require('./app.html') -}) -@RouteConfig([ - {path: '/', component: HomeComponent, name: 'Home'}, - {path: '/About', component: AboutComponent, name: 'About'} -]) -export class AppComponent { - url: string = 'https://github.com/preboot/angular2-webpack'; - - constructor(public api: Api) { - } -} diff --git a/src/app/components/home/home.ts b/src/app/components/home/home.ts deleted file mode 100644 index 779430a1..00000000 --- a/src/app/components/home/home.ts +++ /dev/null @@ -1,21 +0,0 @@ -import {Component, OnInit} from '@angular/core'; -import {FORM_DIRECTIVES} from '@angular/common'; - -@Component({ - selector: 'home', - directives: [...FORM_DIRECTIVES], - pipes: [], - styles: [require('./home.scss')], - template: require('./home.html') -}) -export class HomeComponent implements OnInit { - - constructor() { - // Do stuff - } - - ngOnInit() { - console.log('Hello Home'); - } - -} diff --git a/src/app/services/api/api.ts b/src/app/services/api/api.ts deleted file mode 100644 index 9eb78b62..00000000 --- a/src/app/services/api/api.ts +++ /dev/null @@ -1,6 +0,0 @@ -import {Injectable} from '@angular/core'; - -@Injectable() -export class Api { - title: string = 'Angular 2'; -} diff --git a/src/app/services/api/api.spec.ts b/src/app/shared/api/api.service.spec.ts similarity index 55% rename from src/app/services/api/api.spec.ts rename to src/app/shared/api/api.service.spec.ts index 3fe301cb..4f98e70f 100644 --- a/src/app/services/api/api.spec.ts +++ b/src/app/shared/api/api.service.spec.ts @@ -6,13 +6,13 @@ import { beforeEachProviders } from '@angular/core/testing'; -import {Api} from './api'; +import { ApiService } from './api.service'; describe('Api Service', () => { - beforeEachProviders(() => [Api]); + beforeEachProviders(() => [ApiService]); - it('should ...', inject([Api], (api: Api) => { + it('should ...', inject([ApiService], (api: ApiService) => { expect(api.title).toBe('Angular 2'); })); diff --git a/src/app/shared/api/api.service.ts b/src/app/shared/api/api.service.ts new file mode 100644 index 00000000..a69d91ea --- /dev/null +++ b/src/app/shared/api/api.service.ts @@ -0,0 +1,6 @@ +import { Injectable } from '@angular/core'; + +@Injectable() +export class ApiService { + title = 'Angular 2'; +} diff --git a/src/app/shared/api/index.ts b/src/app/shared/api/index.ts new file mode 100644 index 00000000..68fada65 --- /dev/null +++ b/src/app/shared/api/index.ts @@ -0,0 +1 @@ +export * from './api.service'; diff --git a/src/bootstrap.ts b/src/main.ts similarity index 95% rename from src/bootstrap.ts rename to src/main.ts index dc251ab7..b7590229 100644 --- a/src/bootstrap.ts +++ b/src/main.ts @@ -17,7 +17,7 @@ if (process.env.ENV === 'build') { * App Component * our top level component that holds all of our components */ -import {AppComponent} from './app/app'; +import {AppComponent} from './app/app.component'; /* * Bootstrap our Angular app with a top level component `App` and inject diff --git a/src/public/index.html b/src/public/index.html index a3ddd37b..700e36be 100644 --- a/src/public/index.html +++ b/src/public/index.html @@ -8,6 +8,6 @@ - Loading... + Loading... diff --git a/tslint.json b/tslint.json index 7b13bd17..41c6c0e1 100644 --- a/tslint.json +++ b/tslint.json @@ -105,6 +105,9 @@ "use-life-cycle-interface": true, "use-pipe-transform-interface": true, "component-class-suffix": true, - "directive-class-suffix": true + "directive-class-suffix": true, + "directive-selector-prefix": [true, "my"], + "component-selector-prefix": [true, "my"], + "pipe-naming": [true, "camelCase", "my"] } } diff --git a/webpack.config.js b/webpack.config.js index 98263e89..e5af1c21 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -48,7 +48,7 @@ module.exports = function makeWebpackConfig() { config.entry = isTest ? {} : { 'polyfills': './src/polyfills.ts', 'vendor': './src/vendor.ts', - 'app': './src/bootstrap.ts' // our angular app + 'app': './src/main.ts' // our angular app }; /** From f6640fdf1c15b9ee0ba13c3d066c05f472f3ee3b Mon Sep 17 00:00:00 2001 From: Foxandxss Date: Fri, 6 May 2016 16:58:03 +0200 Subject: [PATCH 028/147] update e2e tests --- src/app/+home/home.component.e2e.js | 2 +- src/app/app.component.e2e.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/app/+home/home.component.e2e.js b/src/app/+home/home.component.e2e.js index 0510057d..1b2f5e27 100644 --- a/src/app/+home/home.component.e2e.js +++ b/src/app/+home/home.component.e2e.js @@ -5,7 +5,7 @@ describe('Home', function () { }); it('should have ', function () { - var home = element(by.css('app my-home')); + var home = element(by.css('my-app my-home')); expect(home.isPresent()).toEqual(true); expect(home.getText()).toEqual("Home Works!"); }); diff --git a/src/app/app.component.e2e.js b/src/app/app.component.e2e.js index 782244cf..92a7004d 100644 --- a/src/app/app.component.e2e.js +++ b/src/app/app.component.e2e.js @@ -9,11 +9,11 @@ describe('App', function () { }); it('should have
', function () { - expect(element(by.css('app header')).isPresent()).toEqual(true); + expect(element(by.css('my-app header')).isPresent()).toEqual(true); }); it('should have
', function () { - expect(element(by.css('app main')).isPresent()).toEqual(true); + expect(element(by.css('my-app main')).isPresent()).toEqual(true); }); it('should have a main title', function () { @@ -21,7 +21,7 @@ describe('App', function () { }); it('should have
', function () { - expect(element(by.css('app footer')).getText()).toEqual("Webpack Angular 2 Starter"); + expect(element(by.css('my-app footer')).getText()).toEqual("Webpack Angular 2 Starter"); }); }); From ec68904cc1d0e31bde41a913a3f5ca749244d9ea Mon Sep 17 00:00:00 2001 From: Foxandxss Date: Fri, 6 May 2016 17:02:04 +0200 Subject: [PATCH 029/147] update main.ts imports --- src/main.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main.ts b/src/main.ts index b7590229..46593fa6 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,9 +1,9 @@ -import {enableProdMode} from '@angular/core'; -import {bootstrap} from '@angular/platform-browser-dynamic'; -import {ELEMENT_PROBE_PROVIDERS} from '@angular/platform-browser'; -import {ROUTER_PROVIDERS} from '@angular/router-deprecated'; -import {HashLocationStrategy, LocationStrategy} from '@angular/common'; -import {HTTP_PROVIDERS} from '@angular/http'; +import { enableProdMode } from '@angular/core'; +import { bootstrap } from '@angular/platform-browser-dynamic'; +import { ELEMENT_PROBE_PROVIDERS } from '@angular/platform-browser'; +import { ROUTER_PROVIDERS } from '@angular/router-deprecated'; +import { HashLocationStrategy, LocationStrategy } from '@angular/common'; +import { HTTP_PROVIDERS } from '@angular/http'; const ENV_PROVIDERS = []; // depending on the env mode, enable prod mode or add debugging modules From 8e60de7f9dd1887430812f36d97ddc1d63e66e83 Mon Sep 17 00:00:00 2001 From: Foxandxss Date: Fri, 6 May 2016 17:08:00 +0200 Subject: [PATCH 030/147] simplify code --- src/app/+about/about.component.ts | 5 +---- src/app/+home/home.component.ts | 7 ++----- src/app/app.component.ts | 6 ++---- 3 files changed, 5 insertions(+), 13 deletions(-) diff --git a/src/app/+about/about.component.ts b/src/app/+about/about.component.ts index 9cae0ae7..85dab66a 100644 --- a/src/app/+about/about.component.ts +++ b/src/app/+about/about.component.ts @@ -3,10 +3,7 @@ import { Component, OnInit } from '@angular/core'; @Component({ selector: 'my-about', template: require('./about.component.html'), - styles: [require('./about.component.scss')], - providers: [], - directives: [], - pipes: [] + styles: [require('./about.component.scss')] }) export class AboutComponent implements OnInit { diff --git a/src/app/+home/home.component.ts b/src/app/+home/home.component.ts index 3c6a9b83..9043761e 100644 --- a/src/app/+home/home.component.ts +++ b/src/app/+home/home.component.ts @@ -1,12 +1,9 @@ import { Component, OnInit } from '@angular/core'; -import { FORM_DIRECTIVES } from '@angular/common'; @Component({ selector: 'my-home', - directives: [...FORM_DIRECTIVES], - pipes: [], - styles: [require('./home.component.scss')], - template: require('./home.component.html') + template: require('./home.component.html'), + styles: [require('./home.component.scss')] }) export class HomeComponent implements OnInit { diff --git a/src/app/app.component.ts b/src/app/app.component.ts index dc8e6f7b..122bb89f 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -1,6 +1,5 @@ import { Component } from '@angular/core'; import { RouteConfig, ROUTER_DIRECTIVES } from '@angular/router-deprecated'; -import { FORM_PROVIDERS } from '@angular/common'; import { ApiService } from './shared/api'; import { HomeComponent } from './+home'; @@ -13,10 +12,9 @@ import '../style/app.scss'; * Top Level Component */ @Component({ - selector: 'my-app', // - providers: [...FORM_PROVIDERS, ApiService], + selector: 'my-app', // + providers: [ApiService], directives: [...ROUTER_DIRECTIVES], - pipes: [], styles: [require('./app.component.scss')], template: require('./app.component.html') }) From 3a8cf2c9d6837dd6ed9520dcebe1e19731b71945 Mon Sep 17 00:00:00 2001 From: Foxandxss Date: Fri, 6 May 2016 17:08:48 +0200 Subject: [PATCH 031/147] remove message to bootstrap stuff at bootstrap --- src/main.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main.ts b/src/main.ts index 46593fa6..0af34ace 100644 --- a/src/main.ts +++ b/src/main.ts @@ -20,8 +20,7 @@ if (process.env.ENV === 'build') { import {AppComponent} from './app/app.component'; /* - * Bootstrap our Angular app with a top level component `App` and inject - * our Services and Providers into Angular's dependency injection + * Bootstrap our Angular app with a top level component `App` */ document.addEventListener('DOMContentLoaded', function main() { return bootstrap(AppComponent, [ From 12926cc5c6c64f501eda09b2f902611aeec98a8e Mon Sep 17 00:00:00 2001 From: Foxandxss Date: Fri, 6 May 2016 17:15:14 +0200 Subject: [PATCH 032/147] remove DOM event, not needed --- src/main.ts | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/src/main.ts b/src/main.ts index 0af34ace..407dccfe 100644 --- a/src/main.ts +++ b/src/main.ts @@ -5,6 +5,8 @@ import { ROUTER_PROVIDERS } from '@angular/router-deprecated'; import { HashLocationStrategy, LocationStrategy } from '@angular/common'; import { HTTP_PROVIDERS } from '@angular/http'; +import {AppComponent} from './app/app.component'; + const ENV_PROVIDERS = []; // depending on the env mode, enable prod mode or add debugging modules if (process.env.ENV === 'build') { @@ -13,17 +15,7 @@ if (process.env.ENV === 'build') { ENV_PROVIDERS.push(ELEMENT_PROBE_PROVIDERS); } -/* - * App Component - * our top level component that holds all of our components - */ -import {AppComponent} from './app/app.component'; - -/* - * Bootstrap our Angular app with a top level component `App` - */ -document.addEventListener('DOMContentLoaded', function main() { - return bootstrap(AppComponent, [ +bootstrap(AppComponent, [ // These are dependencies of our App ...HTTP_PROVIDERS, ...ROUTER_PROVIDERS, @@ -31,4 +23,3 @@ document.addEventListener('DOMContentLoaded', function main() { { provide: LocationStrategy, useClass: HashLocationStrategy } // use #/ routes, remove this for HTML5 mode ]) .catch(err => console.error(err)); -}); From 0422a7d35a8d527daf649361b4eaac77a4b3d8c0 Mon Sep 17 00:00:00 2001 From: Foxandxss Date: Fri, 6 May 2016 17:18:24 +0200 Subject: [PATCH 033/147] add note about CLI support --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 3acf6e0c..6687d7c1 100644 --- a/README.md +++ b/README.md @@ -80,6 +80,8 @@ It will start a local server using `webpack-dev-server` which will watch, build ### Add new components, services, pipes with Angular 2 cli +**ANGULAR CLI IS EVOLVING REALLY FAST SO THE CLI SUPPORT HERE IS BROKEN, WILL UPDATE SOON.** + * `npm install -g angular-cli` to install Angular 2 cli * Add a new component with: `ng generate component my-new-component` * Add a new service with: `ng generate service my-new-service` From ac2ab59b08b9ce6162a3e90de755d4cdbb64323f Mon Sep 17 00:00:00 2001 From: "Pedro J. Molina" Date: Fri, 6 May 2016 18:00:12 +0200 Subject: [PATCH 034/147] Fix: npm run docs (#85) Fix entrypoint file name to point to `src/app/app.component.ts` --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 43a86678..d8683673 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "test": "karma start", "test-watch": "karma start --no-single-run --auto-watch", "ci": "npm run e2e && npm run test", - "docs": "typedoc --options typedoc.json src/app/app.ts", + "docs": "typedoc --options typedoc.json src/app/app.component.ts", "start": "npm run server", "postinstall": "npm run webdriver-update && typings install" }, From fad2b13143ac982c118456475312bd9dd496c68f Mon Sep 17 00:00:00 2001 From: Foxandxss Date: Fri, 6 May 2016 19:27:20 +0200 Subject: [PATCH 035/147] add template before style --- src/app/app.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 122bb89f..37b31097 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -15,8 +15,8 @@ import '../style/app.scss'; selector: 'my-app', // providers: [ApiService], directives: [...ROUTER_DIRECTIVES], + template: require('./app.component.html'), styles: [require('./app.component.scss')], - template: require('./app.component.html') }) @RouteConfig([ {path: '/', component: HomeComponent, name: 'Home'}, From db653a1c0fdfc0955284ffef8ae8ebe66b66f7b4 Mon Sep 17 00:00:00 2001 From: Foxandxss Date: Fri, 6 May 2016 19:29:30 +0200 Subject: [PATCH 036/147] rename e2e files --- protractor.conf.js | 2 +- .../+home/{home.component.e2e.js => home.component.e2e-spec.js} | 0 src/app/{app.component.e2e.js => app.component.e2e-spec.js} | 0 3 files changed, 1 insertion(+), 1 deletion(-) rename src/app/+home/{home.component.e2e.js => home.component.e2e-spec.js} (100%) rename src/app/{app.component.e2e.js => app.component.e2e-spec.js} (100%) diff --git a/protractor.conf.js b/protractor.conf.js index 9a129fa5..12b68e5d 100644 --- a/protractor.conf.js +++ b/protractor.conf.js @@ -2,7 +2,7 @@ exports.config = { baseUrl: 'http://localhost:8080/', specs: [ - 'src/**/*.e2e.js' + 'src/**/*.e2e-spec.js' ], exclude: [], diff --git a/src/app/+home/home.component.e2e.js b/src/app/+home/home.component.e2e-spec.js similarity index 100% rename from src/app/+home/home.component.e2e.js rename to src/app/+home/home.component.e2e-spec.js diff --git a/src/app/app.component.e2e.js b/src/app/app.component.e2e-spec.js similarity index 100% rename from src/app/app.component.e2e.js rename to src/app/app.component.e2e-spec.js From c7e38c0a99dbca54cc449d4a70099d8459e73b8d Mon Sep 17 00:00:00 2001 From: Foxandxss Date: Fri, 6 May 2016 19:55:24 +0200 Subject: [PATCH 037/147] use mocha reporter karma --- karma.conf.js | 4 ++-- package.json | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/karma.conf.js b/karma.conf.js index c666dbf7..3865999e 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -46,9 +46,9 @@ module.exports = function (config) { }, // test results reporter to use - // possible values: 'dots', 'progress' + // possible values: 'dots', 'progress', 'mocha' // available reporters: https://npmjs.org/browse/keyword/karma-reporter - reporters: ['progress', 'coverage'], + reporters: ['mocha', 'coverage'], // web server port port: 9876, diff --git a/package.json b/package.json index d8683673..fc9df267 100644 --- a/package.json +++ b/package.json @@ -52,6 +52,7 @@ "karma-chrome-launcher": "^0.2.1", "karma-coverage": "^0.5.2", "karma-jasmine": "^0.3.7", + "karma-mocha-reporter": "^2.0.3", "karma-phantomjs-launcher": "^1.0.0", "karma-sourcemap-loader": "^0.3.7", "karma-webpack": "1.7.0", From 78d8e25e98238319fd3e4680d9702a3dfd16173f Mon Sep 17 00:00:00 2001 From: Foxandxss Date: Fri, 6 May 2016 21:40:39 +0200 Subject: [PATCH 038/147] services doesnt need a folder in shared --- src/app/app.component.spec.ts | 2 +- src/app/app.component.ts | 2 +- src/app/shared/{api => }/api.service.spec.ts | 0 src/app/shared/{api => }/api.service.ts | 0 src/app/shared/{api => }/index.ts | 0 5 files changed, 2 insertions(+), 2 deletions(-) rename src/app/shared/{api => }/api.service.spec.ts (100%) rename src/app/shared/{api => }/api.service.ts (100%) rename src/app/shared/{api => }/index.ts (100%) diff --git a/src/app/app.component.spec.ts b/src/app/app.component.spec.ts index d1841998..5c765905 100644 --- a/src/app/app.component.spec.ts +++ b/src/app/app.component.spec.ts @@ -10,7 +10,7 @@ import { MockBackend } from '@angular/http/testing'; import { provide } from '@angular/core'; // Load the implementations that should be tested -import { ApiService } from './shared/api'; +import { ApiService } from './shared'; import { AppComponent } from './app.component'; describe('App', () => { diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 37b31097..50693ebd 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -1,7 +1,7 @@ import { Component } from '@angular/core'; import { RouteConfig, ROUTER_DIRECTIVES } from '@angular/router-deprecated'; -import { ApiService } from './shared/api'; +import { ApiService } from './shared'; import { HomeComponent } from './+home'; import { AboutComponent } from './+about'; diff --git a/src/app/shared/api/api.service.spec.ts b/src/app/shared/api.service.spec.ts similarity index 100% rename from src/app/shared/api/api.service.spec.ts rename to src/app/shared/api.service.spec.ts diff --git a/src/app/shared/api/api.service.ts b/src/app/shared/api.service.ts similarity index 100% rename from src/app/shared/api/api.service.ts rename to src/app/shared/api.service.ts diff --git a/src/app/shared/api/index.ts b/src/app/shared/index.ts similarity index 100% rename from src/app/shared/api/index.ts rename to src/app/shared/index.ts From 14c1239e030718d969c9ab22f00576ad1703955c Mon Sep 17 00:00:00 2001 From: Foxandxss Date: Sat, 7 May 2016 00:08:00 +0200 Subject: [PATCH 039/147] update devDependencies --- package.json | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index fc9df267..abd2f9c0 100644 --- a/package.json +++ b/package.json @@ -38,20 +38,20 @@ "angular-cli": "0.0.*", "autoprefixer": "^6.3.2", "codelyzer": "0.0.19", - "copy-webpack-plugin": "^1.1.1", + "copy-webpack-plugin": "^2.1.3", "css-loader": "^0.23.0", "extract-text-webpack-plugin": "^1.0.1", "file-loader": "^0.8.4", "html-loader": "^0.4.0", "html-webpack-plugin": "^2.8.1", - "istanbul-instrumenter-loader": "^0.1.3", + "istanbul-instrumenter-loader": "^0.2.0", "jasmine-core": "^2.3.4", "jasmine-spec-reporter": "^2.4.0", "json-loader": "^0.5.3", - "karma": "0.13.19", - "karma-chrome-launcher": "^0.2.1", - "karma-coverage": "^0.5.2", - "karma-jasmine": "^0.3.7", + "karma": "0.13.22", + "karma-chrome-launcher": "^1.0.1", + "karma-coverage": "^1.0.0", + "karma-jasmine": "^1.0.2", "karma-mocha-reporter": "^2.0.3", "karma-phantomjs-launcher": "^1.0.0", "karma-sourcemap-loader": "^0.3.7", @@ -59,7 +59,7 @@ "node-sass": "^3.4.2", "null-loader": "git+https://github.com/webpack/null-loader.git", "phantomjs-prebuilt": "^2.1.4", - "postcss-loader": "^0.8.0", + "postcss-loader": "^0.9.1", "protractor": "^3.1.1", "raw-loader": "0.5.1", "rimraf": "^2.5.1", @@ -71,7 +71,7 @@ "tslint-loader": "^2.1.0", "typedoc": "^0.3.12", "typescript": "^1.8.0", - "typings": "^0.7.12", + "typings": "^0.8.1", "url-loader": "^0.5.6", "webpack": "^1.12.13", "webpack-dev-server": "^1.14.1" From c4e4ce366b0c0c5514ced6344b04f22d2c9742f4 Mon Sep 17 00:00:00 2001 From: Foxandxss Date: Sat, 7 May 2016 00:10:39 +0200 Subject: [PATCH 040/147] don't use git directly for null-loader --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index abd2f9c0..c2447b74 100644 --- a/package.json +++ b/package.json @@ -57,7 +57,7 @@ "karma-sourcemap-loader": "^0.3.7", "karma-webpack": "1.7.0", "node-sass": "^3.4.2", - "null-loader": "git+https://github.com/webpack/null-loader.git", + "null-loader": "0.1.1", "phantomjs-prebuilt": "^2.1.4", "postcss-loader": "^0.9.1", "protractor": "^3.1.1", From 065fa1602e1b5146e607ce28a59a5a08fefe8648 Mon Sep 17 00:00:00 2001 From: Foxandxss Date: Sat, 7 May 2016 00:11:18 +0200 Subject: [PATCH 041/147] do a clean-install instead of just clean for clean-start Fixes #77 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c2447b74..f476086e 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "scripts": { "clean": "rimraf node_modules doc dist && npm cache clean", "clean-install": "npm run clean && npm install", - "clean-start": "npm run clean && npm start", + "clean-start": "npm run clean-install && npm start", "watch": "webpack --watch --progress --profile", "build": "rimraf dist && webpack --progress --profile --bail", "server": "webpack-dev-server --inline --progress --port 8080", From 0c70705ee52ebcdbe388eb5e1954f9518c625061 Mon Sep 17 00:00:00 2001 From: Foxandxss Date: Sun, 8 May 2016 12:21:27 +0200 Subject: [PATCH 042/147] update README.md --- README.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 6687d7c1..08639239 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,8 @@ [![Dependency Status](https://david-dm.org/preboot/angular2-webpack/status.svg)](https://david-dm.org/preboot/angular2-webpack#info=dependencies) [![devDependency Status](https://david-dm.org/preboot/angular2-webpack/dev-status.svg)](https://david-dm.org/preboot/angular2-webpack#info=devDependencies) +**Note: This guide is following the Angular's [Style Guide](angular.io/styleguide) so I will be changing conventions here and there eventually. You are free to use your own conventions with this starter.** + A complete, yet simple, starter for Angular 2 using Webpack. This seed repo serves as an Angular 2 starter for anyone looking to get up and running with Angular 2 and TypeScript fast. Using [Webpack](http://webpack.github.io/) for building our files and assisting with boilerplate. We're also using Protractor for our end-to-end story and Karma for our unit tests. @@ -12,7 +14,7 @@ This seed repo serves as an Angular 2 starter for anyone looking to get up and r * Coverage with [Istanbul](https://github.com/gotwarlost/istanbul) * End-to-end Angular 2 code using [Protractor](https://angular.github.io/protractor/). * Stylesheets with [SASS](http://sass-lang.com/) (not required, it supports regular css too). -* Error reported with [TSLint](http://palantir.github.io/tslint/). +* Error reported with [TSLint](http://palantir.github.io/tslint/) and [Codelyzer](https://github.com/mgechev/codelyzer). * Documentation with [TypeDoc](http://typedoc.io/). >Warning: Make sure you're using the latest version of Node.js and NPM @@ -21,7 +23,7 @@ This seed repo serves as an Angular 2 starter for anyone looking to get up and r ### Quick start -> Clone/Download the repo then edit `app.ts` inside [`/src/app/app.ts`](/src/app/app.ts) +> Clone/Download the repo then edit `app.ts` inside [`/src/app/app.component.ts`](/src/app/app.component.ts) ```bash # clone our repo @@ -58,7 +60,7 @@ go to [http://localhost:8080](http://localhost:8080) in your browser. What you need to run this app: * `node` and `npm` (Use [NVM](https://github.com/creationix/nvm)) -* Ensure you're running Node (`v4.1.x`+) and NPM (`2.14.x`+) +* Ensure you're running Node (`v5.x.x`+) and NPM (`3.x.x`+) ## Installing From 8f60a43415bd621c7d2f3c91222d09bc1ddb2445 Mon Sep 17 00:00:00 2001 From: Foxandxss Date: Sun, 8 May 2016 12:23:39 +0200 Subject: [PATCH 043/147] remove +folder until we have lazy routing --- src/app/{+about => about}/about.component.html | 0 src/app/{+about => about}/about.component.scss | 0 src/app/{+about => about}/about.component.spec.ts | 0 src/app/{+about => about}/about.component.ts | 0 src/app/{+about => about}/index.ts | 0 src/app/app.component.ts | 4 ++-- src/app/{+home => home}/home.component.e2e-spec.js | 0 src/app/{+home => home}/home.component.html | 0 src/app/{+home => home}/home.component.scss | 0 src/app/{+home => home}/home.component.spec.ts | 0 src/app/{+home => home}/home.component.ts | 0 src/app/{+home => home}/index.ts | 0 12 files changed, 2 insertions(+), 2 deletions(-) rename src/app/{+about => about}/about.component.html (100%) rename src/app/{+about => about}/about.component.scss (100%) rename src/app/{+about => about}/about.component.spec.ts (100%) rename src/app/{+about => about}/about.component.ts (100%) rename src/app/{+about => about}/index.ts (100%) rename src/app/{+home => home}/home.component.e2e-spec.js (100%) rename src/app/{+home => home}/home.component.html (100%) rename src/app/{+home => home}/home.component.scss (100%) rename src/app/{+home => home}/home.component.spec.ts (100%) rename src/app/{+home => home}/home.component.ts (100%) rename src/app/{+home => home}/index.ts (100%) diff --git a/src/app/+about/about.component.html b/src/app/about/about.component.html similarity index 100% rename from src/app/+about/about.component.html rename to src/app/about/about.component.html diff --git a/src/app/+about/about.component.scss b/src/app/about/about.component.scss similarity index 100% rename from src/app/+about/about.component.scss rename to src/app/about/about.component.scss diff --git a/src/app/+about/about.component.spec.ts b/src/app/about/about.component.spec.ts similarity index 100% rename from src/app/+about/about.component.spec.ts rename to src/app/about/about.component.spec.ts diff --git a/src/app/+about/about.component.ts b/src/app/about/about.component.ts similarity index 100% rename from src/app/+about/about.component.ts rename to src/app/about/about.component.ts diff --git a/src/app/+about/index.ts b/src/app/about/index.ts similarity index 100% rename from src/app/+about/index.ts rename to src/app/about/index.ts diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 50693ebd..a012dba9 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -2,8 +2,8 @@ import { Component } from '@angular/core'; import { RouteConfig, ROUTER_DIRECTIVES } from '@angular/router-deprecated'; import { ApiService } from './shared'; -import { HomeComponent } from './+home'; -import { AboutComponent } from './+about'; +import { HomeComponent } from './home'; +import { AboutComponent } from './about'; import '../style/app.scss'; diff --git a/src/app/+home/home.component.e2e-spec.js b/src/app/home/home.component.e2e-spec.js similarity index 100% rename from src/app/+home/home.component.e2e-spec.js rename to src/app/home/home.component.e2e-spec.js diff --git a/src/app/+home/home.component.html b/src/app/home/home.component.html similarity index 100% rename from src/app/+home/home.component.html rename to src/app/home/home.component.html diff --git a/src/app/+home/home.component.scss b/src/app/home/home.component.scss similarity index 100% rename from src/app/+home/home.component.scss rename to src/app/home/home.component.scss diff --git a/src/app/+home/home.component.spec.ts b/src/app/home/home.component.spec.ts similarity index 100% rename from src/app/+home/home.component.spec.ts rename to src/app/home/home.component.spec.ts diff --git a/src/app/+home/home.component.ts b/src/app/home/home.component.ts similarity index 100% rename from src/app/+home/home.component.ts rename to src/app/home/home.component.ts diff --git a/src/app/+home/index.ts b/src/app/home/index.ts similarity index 100% rename from src/app/+home/index.ts rename to src/app/home/index.ts From 31660d6aba62e758559997627479fbd278620468 Mon Sep 17 00:00:00 2001 From: Foxandxss Date: Sun, 8 May 2016 16:12:07 +0200 Subject: [PATCH 044/147] lint before test --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index f476086e..0c5984de 100644 --- a/package.json +++ b/package.json @@ -14,6 +14,7 @@ "lint": "tslint 'src/**/*.ts'; exit 0", "e2e": "protractor", "e2e-live": "protractor --elementExplorer", + "pretest": "npm run lint", "test": "karma start", "test-watch": "karma start --no-single-run --auto-watch", "ci": "npm run e2e && npm run test", From c3cf7f55886508bd9c321b1d25c28bcdb421c930 Mon Sep 17 00:00:00 2001 From: Foxandxss Date: Wed, 11 May 2016 19:28:35 +0200 Subject: [PATCH 045/147] fix link to styleguide --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 08639239..c5d01bb2 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Dependency Status](https://david-dm.org/preboot/angular2-webpack/status.svg)](https://david-dm.org/preboot/angular2-webpack#info=dependencies) [![devDependency Status](https://david-dm.org/preboot/angular2-webpack/dev-status.svg)](https://david-dm.org/preboot/angular2-webpack#info=devDependencies) -**Note: This guide is following the Angular's [Style Guide](angular.io/styleguide) so I will be changing conventions here and there eventually. You are free to use your own conventions with this starter.** +**Note: This guide is following the Angular's [Style Guide](http://angular.io/styleguide) so I will be changing conventions here and there eventually. You are free to use your own conventions with this starter.** A complete, yet simple, starter for Angular 2 using Webpack. From 172237342f3fda09b0789b7948e5365bc8b7843a Mon Sep 17 00:00:00 2001 From: Foxandxss Date: Thu, 12 May 2016 02:39:17 +0200 Subject: [PATCH 046/147] remove CLI support, won't work anymore --- README.md | 12 ------------ package.json | 1 - 2 files changed, 13 deletions(-) diff --git a/README.md b/README.md index c5d01bb2..b28f22dc 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,6 @@ go to [http://localhost:8080](http://localhost:8080) in your browser. * [Installing](#installing) * [Running the app](#running-the-app) * [Developing](#developing) - * [Add new components with Angular 2 cli](#add-new-components-services-pipes-with-angular-2-cli) * [Testing](#testing) * [Documentation](#documentation) * [Frequently asked questions](#faq) @@ -80,17 +79,6 @@ It will start a local server using `webpack-dev-server` which will watch, build ## Developing -### Add new components, services, pipes with Angular 2 cli - -**ANGULAR CLI IS EVOLVING REALLY FAST SO THE CLI SUPPORT HERE IS BROKEN, WILL UPDATE SOON.** - -* `npm install -g angular-cli` to install Angular 2 cli -* Add a new component with: `ng generate component my-new-component` -* Add a new service with: `ng generate service my-new-service` -* Add a new pipe with: `ng generate pipe my-new-pipe` - -Read more at [angular-cli github](https://github.com/angular/angular-cli). - ### Build files * single run: `npm run build` diff --git a/package.json b/package.json index 0c5984de..748a1e55 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,6 @@ "zone.js": "0.6.12" }, "devDependencies": { - "angular-cli": "0.0.*", "autoprefixer": "^6.3.2", "codelyzer": "0.0.19", "copy-webpack-plugin": "^2.1.3", From 2419a493bf1c77c5fb3222d21359d640da23e408 Mon Sep 17 00:00:00 2001 From: Felix Itzenplitz Date: Sat, 14 May 2016 12:10:08 +0200 Subject: [PATCH 047/147] simplify HtmlWebpackPlugin options (#94) --- webpack.config.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/webpack.config.js b/webpack.config.js index e5af1c21..ec74f1ee 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -177,8 +177,7 @@ module.exports = function makeWebpackConfig() { // Reference: https://github.com/ampedandwired/html-webpack-plugin new HtmlWebpackPlugin({ template: './src/public/index.html', - inject: 'body', - chunksSortMode: packageSort(['polyfills', 'vendor', 'app']) + chunksSortMode: 'dependency' }), // Extract css files From 42d4ee71706b8b63139194752fdc8d173ae9d9bb Mon Sep 17 00:00:00 2001 From: PatrickJS Date: Fri, 13 May 2016 16:37:15 -0700 Subject: [PATCH 048/147] chore(webpack.config): use dependency remove old code Closes #98 --- webpack.config.js | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/webpack.config.js b/webpack.config.js index ec74f1ee..364e3267 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -262,31 +262,3 @@ function root(args) { args = Array.prototype.slice.call(arguments, 0); return path.join.apply(path, [__dirname].concat(args)); } - -function rootNode(args) { - args = Array.prototype.slice.call(arguments, 0); - return root.apply(path, ['node_modules'].concat(args)); -} - -function packageSort(packages) { - // packages = ['polyfills', 'vendor', 'app'] - var len = packages.length - 1; - var first = packages[0]; - var last = packages[len]; - return function sort(a, b) { - // polyfills always first - if (a.names[0] === first) { - return -1; - } - // main always last - if (a.names[0] === last) { - return 1; - } - // vendor before app - if (a.names[0] !== first && b.names[0] === last) { - return -1; - } else { - return 1; - } - } -} From 96dd68dec4a6d3237cdf7ae9084a449de40d97fb Mon Sep 17 00:00:00 2001 From: Foxandxss Date: Sat, 14 May 2016 12:20:17 +0200 Subject: [PATCH 049/147] typo in html --- src/app/app.component.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/app.component.html b/src/app/app.component.html index 731e31e8..577009a4 100644 --- a/src/app/app.component.html +++ b/src/app/app.component.html @@ -5,7 +5,7 @@
-

Hello from {{api.title}} !

+

Hello from {{api.title}}!

From e2e4aec0068623367b76b447bff5dc642db521ce Mon Sep 17 00:00:00 2001 From: Foxandxss Date: Tue, 17 May 2016 22:05:49 +0200 Subject: [PATCH 050/147] update copy-webpack-plugin --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 748a1e55..a1e0b6c5 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,7 @@ "devDependencies": { "autoprefixer": "^6.3.2", "codelyzer": "0.0.19", - "copy-webpack-plugin": "^2.1.3", + "copy-webpack-plugin": "^3.0.0", "css-loader": "^0.23.0", "extract-text-webpack-plugin": "^1.0.1", "file-loader": "^0.8.4", From 430d51656b409543d6d6cc076a80b8db54a7cd57 Mon Sep 17 00:00:00 2001 From: Sam Jones Date: Wed, 18 May 2016 09:59:01 -0400 Subject: [PATCH 051/147] Remove CLI bullet in README for now (#100) Potentially misleading, since we don't know when these two can play together in the future. --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index b28f22dc..2bd53ed7 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,6 @@ A complete, yet simple, starter for Angular 2 using Webpack. This seed repo serves as an Angular 2 starter for anyone looking to get up and running with Angular 2 and TypeScript fast. Using [Webpack](http://webpack.github.io/) for building our files and assisting with boilerplate. We're also using Protractor for our end-to-end story and Karma for our unit tests. * Best practices in file and application organization for [Angular 2](https://angular.io/). * Ready to go build system using [Webpack](https://webpack.github.io/docs/) for working with [TypeScript](http://www.typescriptlang.org/). -* Easily add new components using [Angular 2 cli](https://github.com/angular/angular-cli). * Testing Angular 2 code with [Jasmine](http://jasmine.github.io/) and [Karma](http://karma-runner.github.io/). * Coverage with [Istanbul](https://github.com/gotwarlost/istanbul) * End-to-end Angular 2 code using [Protractor](https://angular.github.io/protractor/). From 08719962ad380ddc672c550a78cea8742fa1f23b Mon Sep 17 00:00:00 2001 From: Foxandxss Date: Fri, 27 May 2016 10:03:55 +0200 Subject: [PATCH 052/147] Update to typings 1.x Delete your typings folder and install typings again. --- package.json | 2 +- tsconfig.json | 5 ----- typings.json | 4 ++-- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index a1e0b6c5..513ca142 100644 --- a/package.json +++ b/package.json @@ -71,7 +71,7 @@ "tslint-loader": "^2.1.0", "typedoc": "^0.3.12", "typescript": "^1.8.0", - "typings": "^0.8.1", + "typings": "^1.0.4", "url-loader": "^0.5.6", "webpack": "^1.12.13", "webpack-dev-server": "^1.14.1" diff --git a/tsconfig.json b/tsconfig.json index 57fb3a40..816f4934 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -7,11 +7,6 @@ "sourceMap": true, "noEmitHelpers": true }, - "exclude": [ - "node_modules", - "typings/main", - "typings/main.d.ts" - ], "compileOnSave": false, "buildOnSave": false } diff --git a/typings.json b/typings.json index f78946be..a12608f1 100644 --- a/typings.json +++ b/typings.json @@ -1,8 +1,8 @@ { - "ambientDevDependencies": { + "globalDevDependencies": { "jasmine": "registry:dt/jasmine#2.2.0+20160412134438" }, - "ambientDependencies": { + "globalDependencies": { "es6-shim": "registry:dt/es6-shim#0.31.2+20160317120654", "node": "registry:dt/node#4.0.0+20160501135006" } From 4461e32f15f8d9927b39b10b8593693e0116fff6 Mon Sep 17 00:00:00 2001 From: Robert Hutzel Date: Thu, 2 Jun 2016 15:26:57 -0400 Subject: [PATCH 053/147] Cross-platform tslint successful exit status and glob quoting. (#108) --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 513ca142..239c2328 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "server": "webpack-dev-server --inline --progress --port 8080", "webdriver-update": "webdriver-manager update", "webdriver-start": "webdriver-manager start", - "lint": "tslint 'src/**/*.ts'; exit 0", + "lint": "tslint --force \"src/**/*.ts\"", "e2e": "protractor", "e2e-live": "protractor --elementExplorer", "pretest": "npm run lint", From 449c05274fc8e9b961f904a04eab6b4210471481 Mon Sep 17 00:00:00 2001 From: Foxandxss Date: Thu, 2 Jun 2016 21:28:39 +0200 Subject: [PATCH 054/147] Add more options to editorconfig and simplify a bit --- .editorconfig | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/.editorconfig b/.editorconfig index 802ae913..87a8c212 100644 --- a/.editorconfig +++ b/.editorconfig @@ -5,20 +5,9 @@ root = true # Unix-style newlines with a newline ending every file [*] -end_of_line = lf -insert_final_newline = true - -# Matches multiple files with brace expansion notation -# Set default charset -[*.{js,css,scss,html}] charset = utf-8 - -# 4 space indentation -[*.{js,css,scss,html}] -indent_style = space -indent_size = 2 - -# Matches the exact files either package.json or .travis.yml -[{package.json,.travis.yml,bower.json}] indent_style = space indent_size = 2 +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true \ No newline at end of file From fd5a321055eb5bc823e76c718d64a4a81b41e6bb Mon Sep 17 00:00:00 2001 From: Abner Oliveira Date: Thu, 26 May 2016 06:28:52 -0300 Subject: [PATCH 055/147] add proper typescript coverage --- karma.conf.js | 26 ++++++++++++++++++++------ package.json | 3 +++ webpack.config.js | 19 +++++++++++++------ 3 files changed, 36 insertions(+), 12 deletions(-) diff --git a/karma.conf.js b/karma.conf.js index 3865999e..5b654613 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -1,4 +1,5 @@ var path = require('path'); + var webpackConfig = require('./webpack.config'); module.exports = function (config) { @@ -13,7 +14,7 @@ module.exports = function (config) { // list of files / patterns to load in the browser files: [ - {pattern: './karma-shim.js', watched: false} + { pattern: './karma-shim.js', watched: false } ], // list of files to exclude @@ -35,10 +36,23 @@ module.exports = function (config) { coverageReporter: { dir: 'coverage/', - reporters: [ - {type: 'text-summary'}, - {type: 'html'} - ] + reporters: [{ + type: 'json', + dir: 'coverage', + subdir: 'json', + file: 'coverage-final.json' + }] + }, + + remapIstanbulReporter: { + src: 'coverage/json/coverage-final.json', + reports: { + lcovonly: 'coverage/json/lcov.info', + html: 'coverage/html', + 'text': null + }, + timeoutNotCreated: 1000, // default value + timeoutNoMoreFiles: 1000 // default value }, webpackServer: { @@ -48,7 +62,7 @@ module.exports = function (config) { // test results reporter to use // possible values: 'dots', 'progress', 'mocha' // available reporters: https://npmjs.org/browse/keyword/karma-reporter - reporters: ['mocha', 'coverage'], + reporters: ["mocha", "coverage", "karma-remap-istanbul"], // web server port port: 9876, diff --git a/package.json b/package.json index 239c2328..8919dd09 100644 --- a/package.json +++ b/package.json @@ -54,6 +54,7 @@ "karma-jasmine": "^1.0.2", "karma-mocha-reporter": "^2.0.3", "karma-phantomjs-launcher": "^1.0.0", + "karma-remap-istanbul": "0.0.6", "karma-sourcemap-loader": "^0.3.7", "karma-webpack": "1.7.0", "node-sass": "^3.4.2", @@ -62,8 +63,10 @@ "postcss-loader": "^0.9.1", "protractor": "^3.1.1", "raw-loader": "0.5.1", + "remap-istanbul": "^0.6.4", "rimraf": "^2.5.1", "sass-loader": "^3.1.2", + "shelljs": "^0.7.0", "style-loader": "^0.13.0", "ts-helpers": "^1.1.1", "ts-loader": "^0.8.1", diff --git a/webpack.config.js b/webpack.config.js index 364e3267..adfd270a 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -30,9 +30,7 @@ module.exports = function makeWebpackConfig() { * Reference: http://webpack.github.io/docs/configuration.html#devtool * Type of sourcemap to use per build type */ - if (isTest) { - config.devtool = 'inline-source-map'; - } else if (isProd) { + if (isProd) { config.devtool = 'source-map'; } else { config.devtool = 'eval-source-map'; @@ -139,13 +137,22 @@ module.exports = function makeWebpackConfig() { }; if (isTest) { - // instrument only testing sources with Istanbul, covers js compiled files for now :-/ + // instrument only testing sources with Istanbul, covers ts files config.module.postLoaders.push({ - test: /\.(js|ts)$/, + test: /\.ts$/, include: path.resolve('src'), loader: 'istanbul-instrumenter-loader', exclude: [/\.spec\.ts$/, /\.e2e\.ts$/, /node_modules/] - }) + }); + + // needed for remap-instanbul + config.ts = { + compilerOptions: { + sourceMap: false, + sourceRoot: './src', + inlineSourceMap: true + } + }; } /** From 031c8b0a37ce860f4b7c86d658e2ecd8bcd20f2e Mon Sep 17 00:00:00 2001 From: Michael Date: Fri, 3 Jun 2016 11:48:53 +0200 Subject: [PATCH 056/147] Link to the bootstrap of the app is broken (#110) The link to https://github.com/preboot/angular2-webpack/blob/master/src/bootstrap.ts was broken since it was deleted/replaced (most of it) by the https://github.com/preboot/angular2-webpack/blob/master/src/main.ts file --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2bd53ed7..5df8f53e 100644 --- a/README.md +++ b/README.md @@ -116,7 +116,7 @@ No, Webpack will add all the needed Javascript bundles as script tags and all th #### How to include external angular 2 libraries ? -It's simple, just install the lib via npm and import it in your code when you need it. Don't forget that you need to configure some external libs in the [bootstrap](https://github.com/preboot/angular2-webpack/blob/master/src/bootstrap.ts) of your application. +It's simple, just install the lib via npm and import it in your code when you need it. Don't forget that you need to configure some external libs in the [bootstrap](https://github.com/preboot/angular2-webpack/blob/master/src/main.ts) of your application. ### How to include external css files such as bootstrap.css ? From a54a3d411c8f512d68bf4836b4d6fec9e6ab9571 Mon Sep 17 00:00:00 2001 From: Foxandxss Date: Fri, 3 Jun 2016 15:00:00 +0300 Subject: [PATCH 057/147] change base href --- src/public/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/public/index.html b/src/public/index.html index 700e36be..82c23544 100644 --- a/src/public/index.html +++ b/src/public/index.html @@ -5,7 +5,7 @@ Angular 2 App | ng2-webpack - + Loading... From 7fab658dfc6cf2aaf8eca0cac87de4d2f4819212 Mon Sep 17 00:00:00 2001 From: Foxandxss Date: Mon, 6 Jun 2016 17:00:00 +0200 Subject: [PATCH 058/147] remove mangle --- webpack.config.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/webpack.config.js b/webpack.config.js index adfd270a..cd254f4c 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -207,11 +207,7 @@ module.exports = function makeWebpackConfig() { // Reference: http://webpack.github.io/docs/list-of-plugins.html#uglifyjsplugin // Minify all javascript, switch loaders to minimizing mode - new webpack.optimize.UglifyJsPlugin({ - // Angular 2 is broken again, disabling mangle until beta 6 that should fix the thing - // Todo: remove this with beta 6 - mangle: false - }), + new webpack.optimize.UglifyJsPlugin(), // Copy assets from the public folder // Reference: https://github.com/kevlened/copy-webpack-plugin From 5d8af6592f2ec56f8fbd24ed7eb391d585d079ff Mon Sep 17 00:00:00 2001 From: Foxandxss Date: Sun, 12 Jun 2016 20:38:04 +0200 Subject: [PATCH 059/147] add fake-async-test --- karma-shim.js | 1 + 1 file changed, 1 insertion(+) diff --git a/karma-shim.js b/karma-shim.js index 6ae04adc..2a5e5e09 100644 --- a/karma-shim.js +++ b/karma-shim.js @@ -9,6 +9,7 @@ require('zone.js/dist/zone'); require('zone.js/dist/long-stack-trace-zone'); require('zone.js/dist/jasmine-patch'); require('zone.js/dist/async-test'); +require('zone.js/dist/fake-async-test'); /* Ok, this is kinda crazy. We can use the the context method on From edead3d91638cccc57c5bcd42689632847be7f14 Mon Sep 17 00:00:00 2001 From: Foxandxss Date: Fri, 17 Jun 2016 23:42:25 +0200 Subject: [PATCH 060/147] step 1 on RC2 update --- package.json | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index 8919dd09..01c456ff 100644 --- a/package.json +++ b/package.json @@ -23,15 +23,15 @@ "postinstall": "npm run webdriver-update && typings install" }, "dependencies": { - "@angular/common": "2.0.0-rc.1", - "@angular/compiler": "2.0.0-rc.1", - "@angular/core": "2.0.0-rc.1", - "@angular/http": "2.0.0-rc.1", - "@angular/platform-browser": "2.0.0-rc.1", - "@angular/platform-browser-dynamic": "2.0.0-rc.1", - "@angular/router-deprecated": "2.0.0-rc.1", + "@angular/common": "2.0.0-rc.2", + "@angular/compiler": "2.0.0-rc.2", + "@angular/core": "2.0.0-rc.2", + "@angular/http": "2.0.0-rc.2", + "@angular/platform-browser": "2.0.0-rc.2", + "@angular/platform-browser-dynamic": "2.0.0-rc.2", + "@angular/router-deprecated": "2.0.0-rc.2", "es6-shim": "^0.35.0", - "reflect-metadata": "0.1.2", + "reflect-metadata": "0.1.3", "rxjs": "5.0.0-beta.6", "zone.js": "0.6.12" }, From 68596666a05e1208bf4bc3f6ab392f950737ad18 Mon Sep 17 00:00:00 2001 From: Foxandxss Date: Sat, 18 Jun 2016 20:00:00 +0300 Subject: [PATCH 061/147] add new router --- package.json | 2 +- src/app/app.component.html | 4 ++-- src/app/app.component.ts | 8 +------- src/app/app.routes.ts | 13 +++++++++++++ src/main.ts | 6 +++--- 5 files changed, 20 insertions(+), 13 deletions(-) create mode 100644 src/app/app.routes.ts diff --git a/package.json b/package.json index 01c456ff..f9c6ca14 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ "@angular/http": "2.0.0-rc.2", "@angular/platform-browser": "2.0.0-rc.2", "@angular/platform-browser-dynamic": "2.0.0-rc.2", - "@angular/router-deprecated": "2.0.0-rc.2", + "@angular/router": "3.0.0-alpha.7", "es6-shim": "^0.35.0", "reflect-metadata": "0.1.3", "rxjs": "5.0.0-beta.6", diff --git a/src/app/app.component.html b/src/app/app.component.html index 577009a4..d00c5cf8 100644 --- a/src/app/app.component.html +++ b/src/app/app.component.html @@ -1,7 +1,7 @@
diff --git a/src/app/app.component.ts b/src/app/app.component.ts index a012dba9..8e8d1c33 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -1,9 +1,7 @@ import { Component } from '@angular/core'; -import { RouteConfig, ROUTER_DIRECTIVES } from '@angular/router-deprecated'; +import { ROUTER_DIRECTIVES } from '@angular/router'; import { ApiService } from './shared'; -import { HomeComponent } from './home'; -import { AboutComponent } from './about'; import '../style/app.scss'; @@ -18,10 +16,6 @@ import '../style/app.scss'; template: require('./app.component.html'), styles: [require('./app.component.scss')], }) -@RouteConfig([ - {path: '/', component: HomeComponent, name: 'Home'}, - {path: '/About', component: AboutComponent, name: 'About'} -]) export class AppComponent { url = 'https://github.com/preboot/angular2-webpack'; diff --git a/src/app/app.routes.ts b/src/app/app.routes.ts new file mode 100644 index 00000000..9168ea18 --- /dev/null +++ b/src/app/app.routes.ts @@ -0,0 +1,13 @@ +import { provideRouter, RouterConfig } from '@angular/router'; + +import { HomeComponent } from './home'; +import { AboutComponent } from './about'; + +export const routes: RouterConfig = [ + { path: '', component: HomeComponent }, + { path: 'about', component: AboutComponent} +]; + +export const APP_ROUTER_PROVIDERS = [ + provideRouter(routes) +]; diff --git a/src/main.ts b/src/main.ts index 407dccfe..1b253fa6 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,11 +1,11 @@ import { enableProdMode } from '@angular/core'; import { bootstrap } from '@angular/platform-browser-dynamic'; import { ELEMENT_PROBE_PROVIDERS } from '@angular/platform-browser'; -import { ROUTER_PROVIDERS } from '@angular/router-deprecated'; import { HashLocationStrategy, LocationStrategy } from '@angular/common'; import { HTTP_PROVIDERS } from '@angular/http'; -import {AppComponent} from './app/app.component'; +import { AppComponent } from './app/app.component'; +import { APP_ROUTER_PROVIDERS } from './app/app.routes'; const ENV_PROVIDERS = []; // depending on the env mode, enable prod mode or add debugging modules @@ -18,7 +18,7 @@ if (process.env.ENV === 'build') { bootstrap(AppComponent, [ // These are dependencies of our App ...HTTP_PROVIDERS, - ...ROUTER_PROVIDERS, + ...APP_ROUTER_PROVIDERS, ...ENV_PROVIDERS, { provide: LocationStrategy, useClass: HashLocationStrategy } // use #/ routes, remove this for HTML5 mode ]) From bed1d4218427a7b323da1d065639f357f1e07310 Mon Sep 17 00:00:00 2001 From: Adam Gordon Date: Tue, 21 Jun 2016 16:18:01 -0600 Subject: [PATCH 062/147] fix(router): update router import to latest (#115) * update router reference to remove deprecated use --- src/vendor.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vendor.ts b/src/vendor.ts index f0791c06..145acab1 100644 --- a/src/vendor.ts +++ b/src/vendor.ts @@ -4,7 +4,7 @@ import '@angular/platform-browser-dynamic'; import '@angular/core'; import '@angular/common'; import '@angular/http'; -import '@angular/router-deprecated'; +import '@angular/router'; // RxJS import 'rxjs'; From face812d2ce51bcb84aa62f280ab9c1686a2732d Mon Sep 17 00:00:00 2001 From: Foxandxss Date: Fri, 24 Jun 2016 15:10:25 +0200 Subject: [PATCH 063/147] use angular2-template-loader to avoid requires --- CHANGELOG.md | 5 +++++ package.json | 1 + src/app/about/about.component.ts | 4 ++-- src/app/app.component.ts | 4 ++-- src/app/home/home.component.ts | 4 ++-- webpack.config.js | 11 +---------- 6 files changed, 13 insertions(+), 16 deletions(-) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 00000000..3b9b9b09 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,5 @@ +# Changelog + +## 24 June 2016 + +- Be able to import Component's templates and styles without using require. diff --git a/package.json b/package.json index f9c6ca14..1ceb6c12 100644 --- a/package.json +++ b/package.json @@ -36,6 +36,7 @@ "zone.js": "0.6.12" }, "devDependencies": { + "angular2-template-loader": "^0.4.0", "autoprefixer": "^6.3.2", "codelyzer": "0.0.19", "copy-webpack-plugin": "^3.0.0", diff --git a/src/app/about/about.component.ts b/src/app/about/about.component.ts index 85dab66a..a2e4ad51 100644 --- a/src/app/about/about.component.ts +++ b/src/app/about/about.component.ts @@ -2,8 +2,8 @@ import { Component, OnInit } from '@angular/core'; @Component({ selector: 'my-about', - template: require('./about.component.html'), - styles: [require('./about.component.scss')] + templateUrl: './about.component.html', + styleUrls: ['./about.component.scss'] }) export class AboutComponent implements OnInit { diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 8e8d1c33..a4c195a0 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -13,8 +13,8 @@ import '../style/app.scss'; selector: 'my-app', // providers: [ApiService], directives: [...ROUTER_DIRECTIVES], - template: require('./app.component.html'), - styles: [require('./app.component.scss')], + templateUrl: './app.component.html', + styleUrls: ['./app.component.scss'], }) export class AppComponent { url = 'https://github.com/preboot/angular2-webpack'; diff --git a/src/app/home/home.component.ts b/src/app/home/home.component.ts index 9043761e..6bce6ebe 100644 --- a/src/app/home/home.component.ts +++ b/src/app/home/home.component.ts @@ -2,8 +2,8 @@ import { Component, OnInit } from '@angular/core'; @Component({ selector: 'my-home', - template: require('./home.component.html'), - styles: [require('./home.component.scss')] + templateUrl: './home.component.html', + styleUrls: ['./home.component.scss'] }) export class HomeComponent implements OnInit { diff --git a/webpack.config.js b/webpack.config.js index cd254f4c..ae533a16 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -87,16 +87,7 @@ module.exports = function makeWebpackConfig() { // Support for .ts files. { test: /\.ts$/, - loader: 'ts', - query: { - 'ignoreDiagnostics': [ - 2403, // 2403 -> Subsequent variable declarations - 2300, // 2300 -> Duplicate identifier - 2374, // 2374 -> Duplicate number index signature - 2375, // 2375 -> Duplicate string index signature - 2502 // 2502 -> Referenced directly or indirectly - ] - }, + loaders: ['ts', 'angular2-template-loader'], exclude: [isTest ? /\.(e2e)\.ts$/ : /\.(spec|e2e)\.ts$/, /node_modules\/(?!(ng2-.+))/] }, From 26811ef8cc32240dca1504719f5086c7df1dacbc Mon Sep 17 00:00:00 2001 From: Foxandxss Date: Sat, 2 Jul 2016 13:56:00 +0200 Subject: [PATCH 064/147] chore: update to Angular RC4 --- package.json | 15 ++++++++------- src/main.ts | 9 ++------- 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/package.json b/package.json index 1ceb6c12..36b0d917 100644 --- a/package.json +++ b/package.json @@ -23,13 +23,14 @@ "postinstall": "npm run webdriver-update && typings install" }, "dependencies": { - "@angular/common": "2.0.0-rc.2", - "@angular/compiler": "2.0.0-rc.2", - "@angular/core": "2.0.0-rc.2", - "@angular/http": "2.0.0-rc.2", - "@angular/platform-browser": "2.0.0-rc.2", - "@angular/platform-browser-dynamic": "2.0.0-rc.2", - "@angular/router": "3.0.0-alpha.7", + "@angular/common": "2.0.0-rc.4", + "@angular/compiler": "2.0.0-rc.4", + "@angular/core": "2.0.0-rc.4", + "@angular/forms": "0.2.0", + "@angular/http": "2.0.0-rc.4", + "@angular/platform-browser": "2.0.0-rc.4", + "@angular/platform-browser-dynamic": "2.0.0-rc.4", + "@angular/router": "3.0.0-beta.2", "es6-shim": "^0.35.0", "reflect-metadata": "0.1.3", "rxjs": "5.0.0-beta.6", diff --git a/src/main.ts b/src/main.ts index 1b253fa6..a49a1da5 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,25 +1,20 @@ import { enableProdMode } from '@angular/core'; import { bootstrap } from '@angular/platform-browser-dynamic'; -import { ELEMENT_PROBE_PROVIDERS } from '@angular/platform-browser'; import { HashLocationStrategy, LocationStrategy } from '@angular/common'; import { HTTP_PROVIDERS } from '@angular/http'; import { AppComponent } from './app/app.component'; import { APP_ROUTER_PROVIDERS } from './app/app.routes'; -const ENV_PROVIDERS = []; // depending on the env mode, enable prod mode or add debugging modules if (process.env.ENV === 'build') { enableProdMode(); -} else { - ENV_PROVIDERS.push(ELEMENT_PROBE_PROVIDERS); } bootstrap(AppComponent, [ // These are dependencies of our App - ...HTTP_PROVIDERS, - ...APP_ROUTER_PROVIDERS, - ...ENV_PROVIDERS, + HTTP_PROVIDERS, + APP_ROUTER_PROVIDERS, { provide: LocationStrategy, useClass: HashLocationStrategy } // use #/ routes, remove this for HTML5 mode ]) .catch(err => console.error(err)); From adc2a61d912f966da5fd9d076de5ec1d8440d98a Mon Sep 17 00:00:00 2001 From: Foxandxss Date: Sun, 3 Jul 2016 23:53:42 +0200 Subject: [PATCH 065/147] chore: switch to HTML5 Mode --- CHANGELOG.md | 4 ++++ src/main.ts | 4 +--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3b9b9b09..ef4ca1e1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 3 July 2016 + +- Use html5mode instead of hash navigation. + ## 24 June 2016 - Be able to import Component's templates and styles without using require. diff --git a/src/main.ts b/src/main.ts index a49a1da5..922d594f 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,6 +1,5 @@ import { enableProdMode } from '@angular/core'; import { bootstrap } from '@angular/platform-browser-dynamic'; -import { HashLocationStrategy, LocationStrategy } from '@angular/common'; import { HTTP_PROVIDERS } from '@angular/http'; import { AppComponent } from './app/app.component'; @@ -14,7 +13,6 @@ if (process.env.ENV === 'build') { bootstrap(AppComponent, [ // These are dependencies of our App HTTP_PROVIDERS, - APP_ROUTER_PROVIDERS, - { provide: LocationStrategy, useClass: HashLocationStrategy } // use #/ routes, remove this for HTML5 mode + APP_ROUTER_PROVIDERS ]) .catch(err => console.error(err)); From 6b4a5c65dd1acb01aafb5a9c2efae15682d18cff Mon Sep 17 00:00:00 2001 From: Damian Date: Fri, 8 Jul 2016 14:48:35 +0200 Subject: [PATCH 066/147] update tests for RC4 --- src/app/about/about.component.spec.ts | 9 ++++---- src/app/app.component.spec.ts | 33 ++++++++++++++------------- src/app/home/home.component.spec.ts | 10 ++++---- src/app/shared/api.service.spec.ts | 11 ++++----- 4 files changed, 29 insertions(+), 34 deletions(-) diff --git a/src/app/about/about.component.spec.ts b/src/app/about/about.component.spec.ts index ffcb5ef0..dc6be7e2 100644 --- a/src/app/about/about.component.spec.ts +++ b/src/app/about/about.component.spec.ts @@ -1,9 +1,7 @@ import { - it, - describe, async, inject, - beforeEachProviders + addProviders } from '@angular/core/testing'; import { TestComponentBuilder } from '@angular/compiler/testing'; @@ -11,8 +9,9 @@ import { TestComponentBuilder } from '@angular/compiler/testing'; import { AboutComponent } from './about.component'; describe('About Component', () => { - - beforeEachProviders(() => []); + beforeEach(() => { + addProviders([]); + }); it('should ...', async(inject([TestComponentBuilder], (tcb: TestComponentBuilder) => { tcb.createAsync(AboutComponent).then((fixture) => { diff --git a/src/app/app.component.spec.ts b/src/app/app.component.spec.ts index 5c765905..3e8c2705 100644 --- a/src/app/app.component.spec.ts +++ b/src/app/app.component.spec.ts @@ -1,13 +1,11 @@ import { - it, inject, - beforeEachProviders + addProviders } from '@angular/core/testing'; // to use Translate Service, we need Http, and to test Http we need to mock the backend import { BaseRequestOptions, Http } from '@angular/http'; import { MockBackend } from '@angular/http/testing'; -import { provide } from '@angular/core'; // Load the implementations that should be tested import { ApiService } from './shared'; @@ -15,19 +13,22 @@ import { AppComponent } from './app.component'; describe('App', () => { // provide our implementations or mocks to the dependency injector - beforeEachProviders(() => [ - AppComponent, - ApiService, - BaseRequestOptions, - MockBackend, - // Provide a mocked (fake) backend for Http - provide(Http, { - useFactory: function useFactory(backend, defaultOptions) { - return new Http(backend, defaultOptions); - }, - deps: [MockBackend, BaseRequestOptions] - }) - ]); + beforeEach(() => { + addProviders([ + AppComponent, + ApiService, + BaseRequestOptions, + MockBackend, + // Provide a mocked (fake) backend for Http + { + provide: Http, + deps: [MockBackend, BaseRequestOptions], + useFactory: function useFactory(backend, defaultOptions) { + return new Http(backend, defaultOptions); + } + } + ]); + }); it('should have an url', inject([AppComponent], (app: AppComponent) => { expect(app.url).toEqual('https://github.com/preboot/angular2-webpack'); diff --git a/src/app/home/home.component.spec.ts b/src/app/home/home.component.spec.ts index 36a45618..2c05325c 100644 --- a/src/app/home/home.component.spec.ts +++ b/src/app/home/home.component.spec.ts @@ -1,8 +1,6 @@ import { - it, inject, - describe, - beforeEachProviders, + addProviders, } from '@angular/core/testing'; // Load the implementations that should be tested @@ -10,9 +8,9 @@ import { HomeComponent } from './home.component'; describe('Home', () => { // provide our implementations or mocks to the dependency injector - beforeEachProviders(() => [ - HomeComponent - ]); + beforeEach(() => { + addProviders([HomeComponent]); + }); it('should log ngOnInit', inject([HomeComponent], (home) => { spyOn(console, 'log'); diff --git a/src/app/shared/api.service.spec.ts b/src/app/shared/api.service.spec.ts index 4f98e70f..7763ab7e 100644 --- a/src/app/shared/api.service.spec.ts +++ b/src/app/shared/api.service.spec.ts @@ -1,19 +1,16 @@ import { - it, - describe, - expect, inject, - beforeEachProviders + addProviders } from '@angular/core/testing'; import { ApiService } from './api.service'; describe('Api Service', () => { - - beforeEachProviders(() => [ApiService]); + beforeEach(() => { + addProviders([ApiService]); + }); it('should ...', inject([ApiService], (api: ApiService) => { expect(api.title).toBe('Angular 2'); })); - }); From b96e63acb3032f2e0b59fa2d3a98347630ecfe6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jesu=CC=81s=20Rodri=CC=81guez?= Date: Mon, 25 Jul 2016 19:43:03 +0200 Subject: [PATCH 067/147] chore: update devDependencies --- package.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 36b0d917..0fe164ea 100644 --- a/package.json +++ b/package.json @@ -39,24 +39,24 @@ "devDependencies": { "angular2-template-loader": "^0.4.0", "autoprefixer": "^6.3.2", - "codelyzer": "0.0.19", + "codelyzer": "0.0.26", "copy-webpack-plugin": "^3.0.0", "css-loader": "^0.23.0", "extract-text-webpack-plugin": "^1.0.1", - "file-loader": "^0.8.4", + "file-loader": "^0.9.0", "html-loader": "^0.4.0", "html-webpack-plugin": "^2.8.1", "istanbul-instrumenter-loader": "^0.2.0", "jasmine-core": "^2.3.4", "jasmine-spec-reporter": "^2.4.0", "json-loader": "^0.5.3", - "karma": "0.13.22", + "karma": "1.1.1", "karma-chrome-launcher": "^1.0.1", "karma-coverage": "^1.0.0", "karma-jasmine": "^1.0.2", "karma-mocha-reporter": "^2.0.3", "karma-phantomjs-launcher": "^1.0.0", - "karma-remap-istanbul": "0.0.6", + "karma-remap-istanbul": "0.1.1", "karma-sourcemap-loader": "^0.3.7", "karma-webpack": "1.7.0", "node-sass": "^3.4.2", @@ -67,14 +67,14 @@ "raw-loader": "0.5.1", "remap-istanbul": "^0.6.4", "rimraf": "^2.5.1", - "sass-loader": "^3.1.2", + "sass-loader": "^4.0.0", "shelljs": "^0.7.0", "style-loader": "^0.13.0", "ts-helpers": "^1.1.1", "ts-loader": "^0.8.1", "tslint": "^3.4.0", "tslint-loader": "^2.1.0", - "typedoc": "^0.3.12", + "typedoc": "^0.4.4", "typescript": "^1.8.0", "typings": "^1.0.4", "url-loader": "^0.5.6", From 9be698107229f037b9dc51b652baaa060ac6ad38 Mon Sep 17 00:00:00 2001 From: Luis Aviles Date: Sat, 30 Jul 2016 04:47:59 -0400 Subject: [PATCH 068/147] Fixing expectation into e2e test (#128) --- src/app/app.component.e2e-spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/app.component.e2e-spec.js b/src/app/app.component.e2e-spec.js index 92a7004d..c6176ecd 100644 --- a/src/app/app.component.e2e-spec.js +++ b/src/app/app.component.e2e-spec.js @@ -17,7 +17,7 @@ describe('App', function () { }); it('should have a main title', function () { - expect(element(by.css('main .title')).getText()).toEqual('Hello from Angular 2 !'); + expect(element(by.css('main .title')).getText()).toEqual('Hello from Angular 2!'); }); it('should have