From 8f574e4ea829f1266d2e611aae747b89108a7872 Mon Sep 17 00:00:00 2001 From: Hans Date: Wed, 16 Nov 2016 08:30:10 +0100 Subject: [PATCH 01/13] fix(angular-cli): add necessary dependencies. (#3152) Fixes #3148. --- package.json | 4 ---- packages/angular-cli/package.json | 3 +++ packages/webpack/package.json | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index e0e87c9f9c44..82fbace4747a 100644 --- a/package.json +++ b/package.json @@ -34,10 +34,6 @@ "npm": ">= 3.0.0" }, "author": "Angular Authors", - "contributors": [ - "Rody Haddad (http://rodyhaddad.com/)", - "Igor Minar " - ], "license": "MIT", "bugs": { "url": "https://github.com/angular/angular-cli/issues" diff --git a/packages/angular-cli/package.json b/packages/angular-cli/package.json index 8235fe502dc3..99699a940ab9 100644 --- a/packages/angular-cli/package.json +++ b/packages/angular-cli/package.json @@ -27,6 +27,8 @@ "dependencies": { "@angular-cli/ast-tools": "^1.0.1", "@angular-cli/base-href-webpack": "^1.0.0", + "@angular/compiler-cli": "^2.1.0", + "@angular/core": "^2.1.0", "@ngtools/webpack": "latest", "angular2-template-loader": "^0.5.0", "awesome-typescript-loader": "^2.2.3", @@ -82,6 +84,7 @@ "quick-temp": "0.1.5", "raw-loader": "^0.5.1", "readline2": "0.1.1", + "reflect-metadata": "^0.1.8", "remap-istanbul": "^0.6.4", "resolve": "^1.1.7", "rimraf": "^2.5.3", diff --git a/packages/webpack/package.json b/packages/webpack/package.json index 4e21df1d1106..8f5b6be28264 100644 --- a/packages/webpack/package.json +++ b/packages/webpack/package.json @@ -30,7 +30,7 @@ "peerDependencies": { "typescript": "^2.0.2", "@angular/compiler-cli": "^2.1.0", - "@angular/core": "^2.0.0", + "@angular/core": "^2.1.0", "reflect-metadata": "^0.1.8" } } From f7704b02abb4bc9764460972397bf289a9088035 Mon Sep 17 00:00:00 2001 From: Hans Larsen Date: Tue, 15 Nov 2016 23:39:18 -0800 Subject: [PATCH 02/13] fix(angular-cli): add necessary dependency. --- packages/angular-cli/package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/angular-cli/package.json b/packages/angular-cli/package.json index 99699a940ab9..c5f77235bdc2 100644 --- a/packages/angular-cli/package.json +++ b/packages/angular-cli/package.json @@ -27,6 +27,7 @@ "dependencies": { "@angular-cli/ast-tools": "^1.0.1", "@angular-cli/base-href-webpack": "^1.0.0", + "@angular/compiler": "^2.1.0", "@angular/compiler-cli": "^2.1.0", "@angular/core": "^2.1.0", "@ngtools/webpack": "latest", From 07e96ea4ffd1d2371d43f335f15ec8ff9aa5bb4e Mon Sep 17 00:00:00 2001 From: Hans Larsen Date: Tue, 15 Nov 2016 23:51:35 -0800 Subject: [PATCH 03/13] fix(angular-cli): change version of webpack plugin. --- packages/angular-cli/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/angular-cli/package.json b/packages/angular-cli/package.json index c5f77235bdc2..abf9d7a0ceeb 100644 --- a/packages/angular-cli/package.json +++ b/packages/angular-cli/package.json @@ -30,7 +30,7 @@ "@angular/compiler": "^2.1.0", "@angular/compiler-cli": "^2.1.0", "@angular/core": "^2.1.0", - "@ngtools/webpack": "latest", + "@ngtools/webpack": "^1.0.0", "angular2-template-loader": "^0.5.0", "awesome-typescript-loader": "^2.2.3", "chalk": "^1.1.3", From 7c8b7f0063d20086b5df7bc3b3ab14b50fd2c547 Mon Sep 17 00:00:00 2001 From: Mike Brocchi Date: Wed, 16 Nov 2016 10:03:15 -0800 Subject: [PATCH 04/13] bug(generate): skip-import flag not being respected (#3147) Fixes #2973 --- packages/angular-cli/blueprints/component/index.js | 11 +++++++---- packages/angular-cli/blueprints/directive/index.js | 11 +++++++---- packages/angular-cli/blueprints/pipe/index.js | 11 +++++++---- 3 files changed, 21 insertions(+), 12 deletions(-) diff --git a/packages/angular-cli/blueprints/component/index.js b/packages/angular-cli/blueprints/component/index.js index 523427fc2226..b5c529fe9774 100644 --- a/packages/angular-cli/blueprints/component/index.js +++ b/packages/angular-cli/blueprints/component/index.js @@ -18,14 +18,17 @@ module.exports = { { name: 'prefix', type: Boolean, default: true }, { name: 'spec', type: Boolean }, { name: 'view-encapsulation', type: String, aliases: ['ve'] }, - { name: 'change-detection', type: String, aliases: ['cd'] } + { name: 'change-detection', type: String, aliases: ['cd'] }, + { name: 'skip-import', type: Boolean, default: false } ], - beforeInstall: function() { + beforeInstall: function(options) { try { this.pathToModule = findParentModule(this.project, this.dynamicPath.dir); } catch(e) { - throw `Error locating module for declaration\n\t${e}`; + if (!options.skipImport) { + throw `Error locating module for declaration\n\t${e}`; + } } }, @@ -139,7 +142,7 @@ module.exports = { const componentDir = path.relative(path.dirname(this.pathToModule), this.generatePath); const importPath = componentDir ? `./${componentDir}/${fileName}` : `./${fileName}`; - if (!options['skip-import']) { + if (!options.skipImport) { returns.push( astUtils.addDeclarationToModule(this.pathToModule, className, importPath) .then(change => change.apply(NodeHost))); diff --git a/packages/angular-cli/blueprints/directive/index.js b/packages/angular-cli/blueprints/directive/index.js index edf0af1548c3..216e115a79f6 100644 --- a/packages/angular-cli/blueprints/directive/index.js +++ b/packages/angular-cli/blueprints/directive/index.js @@ -13,14 +13,17 @@ module.exports = { availableOptions: [ { name: 'flat', type: Boolean, default: true }, { name: 'prefix', type: Boolean, default: true }, - { name: 'spec', type: Boolean } + { name: 'spec', type: Boolean }, + { name: 'skip-import', type: Boolean, default: false } ], - beforeInstall: function() { + beforeInstall: function(options) { try { this.pathToModule = findParentModule(this.project, this.dynamicPath.dir); } catch(e) { - throw `Error locating module for declaration\n\t${e}`; + if (!options.skipImport) { + throw `Error locating module for declaration\n\t${e}`; + } } }, @@ -90,7 +93,7 @@ module.exports = { const relativeDir = path.relative(moduleDir, fullGeneratePath); const importPath = relativeDir ? `./${relativeDir}/${fileName}` : `./${fileName}`; - if (!options['skip-import']) { + if (!options.skipImport) { returns.push( astUtils.addDeclarationToModule(this.pathToModule, className, importPath) .then(change => change.apply(NodeHost))); diff --git a/packages/angular-cli/blueprints/pipe/index.js b/packages/angular-cli/blueprints/pipe/index.js index 2fa51ddad727..e4d80411732e 100644 --- a/packages/angular-cli/blueprints/pipe/index.js +++ b/packages/angular-cli/blueprints/pipe/index.js @@ -12,14 +12,17 @@ module.exports = { availableOptions: [ { name: 'flat', type: Boolean, default: true }, - { name: 'spec', type: Boolean } + { name: 'spec', type: Boolean }, + { name: 'skip-import', type: Boolean, default: false } ], - beforeInstall: function() { + beforeInstall: function(options) { try { this.pathToModule = findParentModule(this.project, this.dynamicPath.dir); } catch(e) { - throw `Error locating module for declaration\n\t${e}`; + if (!options.skipImport) { + throw `Error locating module for declaration\n\t${e}`; + } } }, @@ -78,7 +81,7 @@ module.exports = { const relativeDir = path.relative(moduleDir, fullGeneratePath); const importPath = relativeDir ? `./${relativeDir}/${fileName}` : `./${fileName}`; - if (!options['skip-import']) { + if (!options.skipImport) { returns.push( astUtils.addDeclarationToModule(this.pathToModule, className, importPath) .then(change => change.apply(NodeHost))); From a4313892c1712241423fa04000dccc496312fa85 Mon Sep 17 00:00:00 2001 From: Wenchen Li Date: Wed, 16 Nov 2016 13:03:55 -0500 Subject: [PATCH 05/13] fix(github-pages-deploy): Show more accurate url (#3160) --- packages/angular-cli/commands/github-pages-deploy.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/angular-cli/commands/github-pages-deploy.ts b/packages/angular-cli/commands/github-pages-deploy.ts index 6eb35fc73e37..eb4f806e4f32 100644 --- a/packages/angular-cli/commands/github-pages-deploy.ts +++ b/packages/angular-cli/commands/github-pages-deploy.ts @@ -240,7 +240,7 @@ const githubPagesDeployCommand = Command.extend({ .then((stdout) => { let match = stdout.match(/origin\s+(?:https:\/\/|git@)github\.com(?:\:|\/)([^\/]+)/m); let userName = match[1].toLowerCase(); - let url = `https://${userName}.github.io/${options.userPage ? '' : (projectName + '/')}`; + let url = `https://${userName}.github.io/${options.userPage ? '' : (baseHref + '/')}`; ui.writeLine(chalk.green(`Deployed! Visit ${url}`)); ui.writeLine('Github pages might take a few minutes to show the deployed site.'); }); From 633ece007efe5aa55dfb009687544546adc6bcf2 Mon Sep 17 00:00:00 2001 From: Mike Brocchi Date: Wed, 16 Nov 2016 11:34:45 -0800 Subject: [PATCH 06/13] chore: remove ember specific blueprints (#3165) --- .../angular-cli/blueprints/component-test/index.js | 13 ------------- packages/angular-cli/blueprints/route-test/index.js | 13 ------------- packages/angular-cli/blueprints/route/index.js | 7 ------- .../angular-cli/blueprints/service-test/index.js | 13 ------------- 4 files changed, 46 deletions(-) delete mode 100644 packages/angular-cli/blueprints/component-test/index.js delete mode 100644 packages/angular-cli/blueprints/route-test/index.js delete mode 100644 packages/angular-cli/blueprints/route/index.js delete mode 100644 packages/angular-cli/blueprints/service-test/index.js diff --git a/packages/angular-cli/blueprints/component-test/index.js b/packages/angular-cli/blueprints/component-test/index.js deleted file mode 100644 index 50992809f319..000000000000 --- a/packages/angular-cli/blueprints/component-test/index.js +++ /dev/null @@ -1,13 +0,0 @@ -module.exports = { - description: '', - - // ****************************************************** - // ****************************************************** - // LEAVE THIS HERE - // Must override install to prevent ember's component tests - // ****************************************************** - // ****************************************************** - - install: function () { - } -}; diff --git a/packages/angular-cli/blueprints/route-test/index.js b/packages/angular-cli/blueprints/route-test/index.js deleted file mode 100644 index 0fbcb7230a14..000000000000 --- a/packages/angular-cli/blueprints/route-test/index.js +++ /dev/null @@ -1,13 +0,0 @@ -module.exports = { - description: '', - - // ****************************************************** - // ****************************************************** - // LEAVE THIS HERE - // Must override install to prevent ember's route tests - // ****************************************************** - // ****************************************************** - - install: function () { - } -}; diff --git a/packages/angular-cli/blueprints/route/index.js b/packages/angular-cli/blueprints/route/index.js deleted file mode 100644 index 9b3d9554bb67..000000000000 --- a/packages/angular-cli/blueprints/route/index.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - description: '', - - install: function () { - throw 'Due to changes in the router, route generation has been temporarily disabled. You can find more information about the new router here: http://victorsavkin.com/post/145672529346/angular-router'; - } -}; diff --git a/packages/angular-cli/blueprints/service-test/index.js b/packages/angular-cli/blueprints/service-test/index.js deleted file mode 100644 index d0dfac69a3ab..000000000000 --- a/packages/angular-cli/blueprints/service-test/index.js +++ /dev/null @@ -1,13 +0,0 @@ -module.exports = { - description: '', - - // ****************************************************** - // ****************************************************** - // LEAVE THIS HERE - // Must override install to prevent ember's service tests - // ****************************************************** - // ****************************************************** - - install: function () { - } -}; From 71bf855e3fabced7d674698f291d7dab47ebb6cd Mon Sep 17 00:00:00 2001 From: "Meligy, GuruStop.NET" Date: Thu, 17 Nov 2016 22:25:42 +1100 Subject: [PATCH 07/13] fix(generate): revert change to component dir in generate module, as it caused component declaration to go to parent module (#3158) --- packages/angular-cli/blueprints/module/index.js | 8 ++++++-- tests/e2e/tests/generate/module/module-basic.ts | 3 ++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/packages/angular-cli/blueprints/module/index.js b/packages/angular-cli/blueprints/module/index.js index 3cd3b5646119..1ee4be43aea8 100644 --- a/packages/angular-cli/blueprints/module/index.js +++ b/packages/angular-cli/blueprints/module/index.js @@ -58,8 +58,12 @@ module.exports = { }, afterInstall: function (options) { - options.entity.name = path.relative(this.dynamicPath.appRoot, this.generatePath); - options.flat = false; + // Note that `this.generatePath` already contains `this.dasherizedModuleName` + // So, the path will end like `name/name`, + // which is correct for `name.component.ts` created in module `name` + var componentPath = path.join(this.generatePath, this.dasherizedModuleName); + options.entity.name = path.relative(this.dynamicPath.appRoot, componentPath); + options.flat = true; options.route = false; options.inlineTemplate = false; options.inlineStyle = false; diff --git a/tests/e2e/tests/generate/module/module-basic.ts b/tests/e2e/tests/generate/module/module-basic.ts index 2ba3dfc06313..071c20f3bea7 100644 --- a/tests/e2e/tests/generate/module/module-basic.ts +++ b/tests/e2e/tests/generate/module/module-basic.ts @@ -1,6 +1,6 @@ import {join} from 'path'; import {ng} from '../../../utils/process'; -import {expectFileToExist} from '../../../utils/fs'; +import {expectFileToExist, expectFileToMatch} from '../../../utils/fs'; import {expectToFail} from '../../../utils/utils'; @@ -15,6 +15,7 @@ export default function() { .then(() => expectFileToExist(join(moduleDir, 'test-module.component.spec.ts'))) .then(() => expectFileToExist(join(moduleDir, 'test-module.component.html'))) .then(() => expectFileToExist(join(moduleDir, 'test-module.component.css'))) + .then(() => expectFileToMatch(join(moduleDir, 'test-module.module.ts'), 'TestModuleComponent')) // Try to run the unit tests. .then(() => ng('test', '--single-run')); From 6f9d2c1b18b81335de8ccd16e27c85efad788757 Mon Sep 17 00:00:00 2001 From: Filipe Silva Date: Thu, 17 Nov 2016 14:47:52 +0000 Subject: [PATCH 08/13] feat(build): add sourcemap option (#3113) Add `--no-sourcemap` option to `ng build/serve/test`. Disabling sourcemaps can help with build speeds. My tests on a medium project shoul a 11.5% improvement on initial builds, and a 37% improvement on rebuilds. Disabling sourcemaps will make debugging harder, since it makes line information very innacurate. Partially address #1980 --- packages/angular-cli/commands/build.ts | 4 +++- packages/angular-cli/commands/serve.ts | 2 ++ packages/angular-cli/commands/test.ts | 20 +++++++++++++++++-- .../models/webpack-build-common.ts | 9 ++++++--- .../models/webpack-build-development.ts | 3 +-- .../models/webpack-build-production.ts | 1 - .../angular-cli/models/webpack-build-test.js | 2 +- packages/angular-cli/models/webpack-config.ts | 6 ++++-- packages/angular-cli/plugins/karma.js | 3 ++- .../angular-cli/tasks/build-webpack-watch.ts | 3 ++- packages/angular-cli/tasks/build-webpack.ts | 3 ++- packages/angular-cli/tasks/serve-webpack.ts | 3 ++- packages/angular-cli/tasks/test.ts | 14 ++++++++----- tests/e2e/tests/build/sourcemap.ts | 11 ++++++++++ 14 files changed, 63 insertions(+), 21 deletions(-) create mode 100644 tests/e2e/tests/build/sourcemap.ts diff --git a/packages/angular-cli/commands/build.ts b/packages/angular-cli/commands/build.ts index a9ed8c3ee9cf..843fa466f79d 100644 --- a/packages/angular-cli/commands/build.ts +++ b/packages/angular-cli/commands/build.ts @@ -11,6 +11,7 @@ export interface BuildOptions { supressSizes: boolean; baseHref?: string; aot?: boolean; + sourcemap?: boolean; } const BuildCommand = Command.extend({ @@ -31,7 +32,8 @@ const BuildCommand = Command.extend({ { name: 'watcher', type: String }, { name: 'suppress-sizes', type: Boolean, default: false }, { name: 'base-href', type: String, default: null, aliases: ['bh'] }, - { name: 'aot', type: Boolean, default: false } + { name: 'aot', type: Boolean, default: false }, + { name: 'sourcemap', type: Boolean, default: true, aliases: ['sm'] } ], run: function (commandOptions: BuildOptions) { diff --git a/packages/angular-cli/commands/serve.ts b/packages/angular-cli/commands/serve.ts index fc7d6ded01ff..4b19b651edb1 100644 --- a/packages/angular-cli/commands/serve.ts +++ b/packages/angular-cli/commands/serve.ts @@ -26,6 +26,7 @@ export interface ServeTaskOptions { sslKey?: string; sslCert?: string; aot?: boolean; + sourcemap?: boolean; open?: boolean; } @@ -81,6 +82,7 @@ const ServeCommand = Command.extend({ { name: 'ssl-key', type: String, default: 'ssl/server.key' }, { name: 'ssl-cert', type: String, default: 'ssl/server.crt' }, { name: 'aot', type: Boolean, default: false }, + { name: 'sourcemap', type: Boolean, default: true, aliases: ['sm'] }, { name: 'open', type: Boolean, diff --git a/packages/angular-cli/commands/test.ts b/packages/angular-cli/commands/test.ts index 957618d48058..cd4e23c87e21 100644 --- a/packages/angular-cli/commands/test.ts +++ b/packages/angular-cli/commands/test.ts @@ -2,6 +2,21 @@ const TestCommand = require('../ember-cli/lib/commands/test'); import TestTask from '../tasks/test'; import {CliConfig} from '../models/config'; +export interface TestOptions { + watch?: boolean; + codeCoverage?: boolean; + lint?: boolean; + singleRun?: boolean; + browsers?: string; + colors?: boolean; + log?: string; + port?: number; + reporters?: string; + build?: boolean; + sourcemap?: boolean; +} + + const NgCliTestCommand = TestCommand.extend({ availableOptions: [ { name: 'watch', type: Boolean, default: true, aliases: ['w'] }, @@ -13,10 +28,11 @@ const NgCliTestCommand = TestCommand.extend({ { name: 'log-level', type: String }, { name: 'port', type: Number }, { name: 'reporters', type: String }, - { name: 'build', type: Boolean, default: true } + { name: 'build', type: Boolean, default: true }, + { name: 'sourcemap', type: Boolean, default: true, aliases: ['sm'] } ], - run: function(commandOptions: any) { + run: function(commandOptions: TestOptions) { this.project.ngConfig = this.project.ngConfig || CliConfig.fromProject(); const testTask = new TestTask({ diff --git a/packages/angular-cli/models/webpack-build-common.ts b/packages/angular-cli/models/webpack-build-common.ts index 6d1bbe01c76f..5642e7ced8b7 100644 --- a/packages/angular-cli/models/webpack-build-common.ts +++ b/packages/angular-cli/models/webpack-build-common.ts @@ -11,7 +11,8 @@ export function getWebpackCommonConfig( projectRoot: string, environment: string, appConfig: any, - baseHref: string + baseHref: string, + sourcemap: boolean ) { const appRoot = path.resolve(projectRoot, appConfig.root); @@ -32,7 +33,7 @@ export function getWebpackCommonConfig( if (appConfig.scripts.length > 0) { entry['scripts'] = scripts; } return { - devtool: 'source-map', + devtool: sourcemap ? 'source-map' : 'eval', resolve: { extensions: ['.ts', '.js'], modules: [path.resolve(projectRoot, 'node_modules')] @@ -41,7 +42,9 @@ export function getWebpackCommonConfig( entry: entry, output: { path: path.resolve(projectRoot, appConfig.outDir), - filename: '[name].bundle.js' + filename: '[name].bundle.js', + sourceMapFilename: '[name].bundle.map', + chunkFilename: '[id].chunk.js' }, module: { rules: [ diff --git a/packages/angular-cli/models/webpack-build-development.ts b/packages/angular-cli/models/webpack-build-development.ts index c36760fab3bc..d38748abdf2a 100644 --- a/packages/angular-cli/models/webpack-build-development.ts +++ b/packages/angular-cli/models/webpack-build-development.ts @@ -7,11 +7,10 @@ export const getWebpackDevConfigPartial = function(projectRoot: string, appConfi : []; const cssLoaders = ['style-loader', 'css-loader?sourcemap', 'postcss-loader']; return { - devtool: 'source-map', output: { path: path.resolve(projectRoot, appConfig.outDir), filename: '[name].bundle.js', - sourceMapFilename: '[name].map', + sourceMapFilename: '[name].bundle.map', chunkFilename: '[id].chunk.js' }, module: { diff --git a/packages/angular-cli/models/webpack-build-production.ts b/packages/angular-cli/models/webpack-build-production.ts index e925035a7395..0d52a86a4678 100644 --- a/packages/angular-cli/models/webpack-build-production.ts +++ b/packages/angular-cli/models/webpack-build-production.ts @@ -21,7 +21,6 @@ export const getWebpackProdConfigPartial = function(projectRoot: string, appConf : []; const cssLoaders = ['css-loader?sourcemap&minimize', 'postcss-loader']; return { - devtool: 'source-map', output: { path: path.resolve(projectRoot, appConfig.outDir), filename: '[name].[chunkhash].bundle.js', diff --git a/packages/angular-cli/models/webpack-build-test.js b/packages/angular-cli/models/webpack-build-test.js index b0b2aae4bf63..8361c87a00b4 100644 --- a/packages/angular-cli/models/webpack-build-test.js +++ b/packages/angular-cli/models/webpack-build-test.js @@ -43,7 +43,7 @@ const getWebpackTestConfig = function (projectRoot, environment, appConfig, test } return { - devtool: 'inline-source-map', + devtool: testConfig.sourcemap ? 'inline-source-map' : 'eval', context: path.resolve(__dirname, './'), resolve: { extensions: ['.ts', '.js'], diff --git a/packages/angular-cli/models/webpack-config.ts b/packages/angular-cli/models/webpack-config.ts index 6317fef937a3..a6c42a8ba407 100644 --- a/packages/angular-cli/models/webpack-config.ts +++ b/packages/angular-cli/models/webpack-config.ts @@ -23,7 +23,8 @@ export class NgCliWebpackConfig { public environment: string, outputDir?: string, baseHref?: string, - isAoT = false + isAoT = false, + sourcemap = true, ) { const config: CliConfig = CliConfig.fromProject(); const appConfig = config.config.apps[0]; @@ -34,7 +35,8 @@ export class NgCliWebpackConfig { this.ngCliProject.root, environment, appConfig, - baseHref + baseHref, + sourcemap ); let targetConfigPartial = this.getTargetConfig(this.ngCliProject.root, appConfig); const typescriptConfigPartial = isAoT diff --git a/packages/angular-cli/plugins/karma.js b/packages/angular-cli/plugins/karma.js index 983157f3fdca..4f8ff7088ac9 100644 --- a/packages/angular-cli/plugins/karma.js +++ b/packages/angular-cli/plugins/karma.js @@ -12,7 +12,8 @@ const init = (config) => { const environment = config.angularCli.environment || 'dev'; const testConfig = { codeCoverage: config.angularCli.codeCoverage || false, - lint: config.angularCli.lint || false + lint: config.angularCli.lint || false, + sourcemap: config.angularCli.sourcemap } // add webpack config diff --git a/packages/angular-cli/tasks/build-webpack-watch.ts b/packages/angular-cli/tasks/build-webpack-watch.ts index 45a1f6e55a55..ab7498b3dc00 100644 --- a/packages/angular-cli/tasks/build-webpack-watch.ts +++ b/packages/angular-cli/tasks/build-webpack-watch.ts @@ -24,7 +24,8 @@ export default Task.extend({ runTaskOptions.environment, outputDir, runTaskOptions.baseHref, - runTaskOptions.aot + runTaskOptions.aot, + runTaskOptions.sourcemap ).config; const webpackCompiler: any = webpack(config); diff --git a/packages/angular-cli/tasks/build-webpack.ts b/packages/angular-cli/tasks/build-webpack.ts index e47564863eeb..a2bd60c5c608 100644 --- a/packages/angular-cli/tasks/build-webpack.ts +++ b/packages/angular-cli/tasks/build-webpack.ts @@ -23,7 +23,8 @@ export default Task.extend({ runTaskOptions.environment, outputDir, runTaskOptions.baseHref, - runTaskOptions.aot + runTaskOptions.aot, + runTaskOptions.sourcemap ).config; const webpackCompiler: any = webpack(config); diff --git a/packages/angular-cli/tasks/serve-webpack.ts b/packages/angular-cli/tasks/serve-webpack.ts index 798d4e38f69a..5f8a98980966 100644 --- a/packages/angular-cli/tasks/serve-webpack.ts +++ b/packages/angular-cli/tasks/serve-webpack.ts @@ -26,7 +26,8 @@ export default Task.extend({ commandOptions.environment, undefined, undefined, - commandOptions.aot + commandOptions.aot, + commandOptions.sourcemap ).config; // This allows for live reload of page when changes are made to repo. diff --git a/packages/angular-cli/tasks/test.ts b/packages/angular-cli/tasks/test.ts index 56ba9e1c1d87..6714cf0e7601 100644 --- a/packages/angular-cli/tasks/test.ts +++ b/packages/angular-cli/tasks/test.ts @@ -1,4 +1,5 @@ const Task = require('../ember-cli/lib/models/task'); +import { TestOptions } from '../commands/test'; import * as path from 'path'; // require dependencies within the target project @@ -9,27 +10,30 @@ function requireDependency(root: string, moduleName: string) { } export default Task.extend({ - run: function (options: any) { + run: function (options: TestOptions) { const projectRoot = this.project.root; return new Promise((resolve) => { const karma = requireDependency(projectRoot, 'karma'); const karmaConfig = path.join(projectRoot, this.project.ngConfig.config.test.karma.config); + let karmaOptions: any = Object.assign({}, options); + // Convert browsers from a string to an array if (options.browsers) { - options.browsers = options.browsers.split(','); + karmaOptions.browsers = options.browsers.split(','); } - options.angularCli = { + karmaOptions.angularCli = { codeCoverage: options.codeCoverage, lint: options.lint, + sourcemap: options.sourcemap }; // Assign additional karmaConfig options to the local ngapp config - options.configFile = karmaConfig; + karmaOptions.configFile = karmaConfig; // :shipit: - const karmaServer = new karma.Server(options, resolve); + const karmaServer = new karma.Server(karmaOptions, resolve); karmaServer.start(); }); } diff --git a/tests/e2e/tests/build/sourcemap.ts b/tests/e2e/tests/build/sourcemap.ts new file mode 100644 index 000000000000..7029ff872f24 --- /dev/null +++ b/tests/e2e/tests/build/sourcemap.ts @@ -0,0 +1,11 @@ +import {ng} from '../../utils/process'; +import {expectFileToExist} from '../../utils/fs'; +import {expectToFail} from '../../utils/utils'; + + +export default function() { + return ng('build') + .then(() => expectFileToExist('dist/main.bundle.map')) + .then(() => ng('build', '--no-sourcemap')) + .then(() => expectToFail(() => expectFileToExist('dist/main.bundle.map'))); +} From 52f912083afbed4bc9f89837c6c83515c73e1651 Mon Sep 17 00:00:00 2001 From: Johannes Hoppe Date: Tue, 22 Nov 2016 23:00:12 +0100 Subject: [PATCH 09/13] chore(version): jasmine types and jasmine-core are out of sync (#3229) --- packages/angular-cli/blueprints/ng2/files/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/angular-cli/blueprints/ng2/files/package.json b/packages/angular-cli/blueprints/ng2/files/package.json index c3e7995715a3..c32501f8c134 100644 --- a/packages/angular-cli/blueprints/ng2/files/package.json +++ b/packages/angular-cli/blueprints/ng2/files/package.json @@ -34,11 +34,11 @@ "preboot": "2.1.2", "parse5": "1.5.1",<% } %> "@angular/compiler-cli": "^2.1.0", - "@types/jasmine": "^2.2.30", + "@types/jasmine": "2.5.38", "@types/node": "^6.0.42", "angular-cli": "<%= version %>", "codelyzer": "~1.0.0-beta.3", - "jasmine-core": "2.4.1", + "jasmine-core": "2.5.2", "jasmine-spec-reporter": "2.5.0", "karma": "1.2.0", "karma-chrome-launcher": "^2.0.0", From 9484a1013188a684ff9b27253d0c861dd453ff6d Mon Sep 17 00:00:00 2001 From: Diogo Franco Date: Wed, 23 Nov 2016 07:00:40 +0900 Subject: [PATCH 10/13] chore(webpack): add missing -loader suffix (#3187) --- packages/angular-cli/models/webpack-build-common.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/angular-cli/models/webpack-build-common.ts b/packages/angular-cli/models/webpack-build-common.ts index 5642e7ced8b7..d81e3c44ebb1 100644 --- a/packages/angular-cli/models/webpack-build-common.ts +++ b/packages/angular-cli/models/webpack-build-common.ts @@ -83,7 +83,7 @@ export function getWebpackCommonConfig(        { test: /\.(jpg|png|gif)$/, loader: 'url-loader?limit=10000' },        { test: /\.html$/, loader: 'raw-loader' }, - { test: /\.(otf|ttf|woff|woff2)$/, loader: 'url?limit=10000' }, + { test: /\.(otf|ttf|woff|woff2)$/, loader: 'url-loader?limit=10000' }, { test: /\.(eot|svg)$/, loader: 'file-loader' } ] }, From f833d257fa8698d3d468f9a13943a7b3559804fb Mon Sep 17 00:00:00 2001 From: Scott Cooper Date: Tue, 22 Nov 2016 14:04:42 -0800 Subject: [PATCH 11/13] fix(editorconfig): use off instead of 0 for max line length (#3186) see https://github.com/editorconfig/editorconfig/wiki/EditorConfig-Properties#max_line_length --- packages/angular-cli/blueprints/ng2/files/.editorconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/angular-cli/blueprints/ng2/files/.editorconfig b/packages/angular-cli/blueprints/ng2/files/.editorconfig index 06dde115f57e..6e87a003da89 100644 --- a/packages/angular-cli/blueprints/ng2/files/.editorconfig +++ b/packages/angular-cli/blueprints/ng2/files/.editorconfig @@ -9,5 +9,5 @@ insert_final_newline = true trim_trailing_whitespace = true [*.md] -max_line_length = 0 +max_line_length = off trim_trailing_whitespace = false From 6e8a848074baacd1c28e9cba0b14669243f80b1d Mon Sep 17 00:00:00 2001 From: Hans Date: Tue, 22 Nov 2016 20:09:23 -0500 Subject: [PATCH 12/13] fix(aot): lock the angular version to 2.2.1. (#3242) --- package.json | 8 ++++---- .../blueprints/ng2/files/package.json | 20 +++++++++---------- packages/angular-cli/package.json | 6 +++--- packages/webpack/package.json | 4 ++-- .../e2e/assets/webpack/test-app/package.json | 18 ++++++++--------- 5 files changed, 28 insertions(+), 28 deletions(-) diff --git a/package.json b/package.json index 82fbace4747a..6651119baa71 100644 --- a/package.json +++ b/package.json @@ -41,10 +41,10 @@ "homepage": "https://github.com/angular/angular-cli", "dependencies": { "@angular-cli/ast-tools": "^1.0.0", - "@angular/compiler": "^2.1.0", - "@angular/compiler-cli": "^2.1.0", - "@angular/core": "^2.1.0", - "@angular/tsc-wrapped": "^0.3.0", + "@angular/compiler": "2.2.1", + "@angular/compiler-cli": "2.2.1", + "@angular/core": "2.2.1", + "@angular/tsc-wrapped": "0.4.0", "angular2-template-loader": "^0.5.0", "autoprefixer": "^6.5.3", "awesome-typescript-loader": "^2.2.3", diff --git a/packages/angular-cli/blueprints/ng2/files/package.json b/packages/angular-cli/blueprints/ng2/files/package.json index c32501f8c134..464ed3361e0a 100644 --- a/packages/angular-cli/blueprints/ng2/files/package.json +++ b/packages/angular-cli/blueprints/ng2/files/package.json @@ -12,28 +12,28 @@ }, "private": true, "dependencies": { - "@angular/common": "^2.1.0", - "@angular/compiler": "^2.1.0", - "@angular/core": "^2.1.0", - "@angular/forms": "^2.1.0", - "@angular/http": "^2.1.0", - "@angular/platform-browser": "^2.1.0", - "@angular/platform-browser-dynamic": "^2.1.0", - "@angular/router": "^3.1.0", + "@angular/common": "2.2.1", + "@angular/compiler": "2.2.1", + "@angular/core": "2.2.1", + "@angular/forms": "2.2.1", + "@angular/http": "2.2.1", + "@angular/platform-browser": "2.2.1", + "@angular/platform-browser-dynamic": "2.2.1", + "@angular/router": "3.2.1", "core-js": "^2.4.1", "rxjs": "5.0.0-beta.12", "ts-helpers": "^1.1.1", "zone.js": "^0.6.23" }, "devDependencies": {<% if(isMobile) { %> - "@angular/platform-server": "~2.1.0", + "@angular/platform-server": "2.2.1", "@angular/service-worker": "0.2.0", "@angular/app-shell": "0.0.0", "angular2-universal":"0.104.5", "angular2-universal-polyfills": "0.4.1", "preboot": "2.1.2", "parse5": "1.5.1",<% } %> - "@angular/compiler-cli": "^2.1.0", + "@angular/compiler-cli": "2.2.1", "@types/jasmine": "2.5.38", "@types/node": "^6.0.42", "angular-cli": "<%= version %>", diff --git a/packages/angular-cli/package.json b/packages/angular-cli/package.json index abf9d7a0ceeb..07f7e22f18a7 100644 --- a/packages/angular-cli/package.json +++ b/packages/angular-cli/package.json @@ -27,9 +27,9 @@ "dependencies": { "@angular-cli/ast-tools": "^1.0.1", "@angular-cli/base-href-webpack": "^1.0.0", - "@angular/compiler": "^2.1.0", - "@angular/compiler-cli": "^2.1.0", - "@angular/core": "^2.1.0", + "@angular/compiler": "2.2.1", + "@angular/compiler-cli": "2.2.1", + "@angular/core": "2.2.1", "@ngtools/webpack": "^1.0.0", "angular2-template-loader": "^0.5.0", "awesome-typescript-loader": "^2.2.3", diff --git a/packages/webpack/package.json b/packages/webpack/package.json index 8f5b6be28264..03915982790d 100644 --- a/packages/webpack/package.json +++ b/packages/webpack/package.json @@ -29,8 +29,8 @@ }, "peerDependencies": { "typescript": "^2.0.2", - "@angular/compiler-cli": "^2.1.0", - "@angular/core": "^2.1.0", + "@angular/compiler-cli": "2.2.1", + "@angular/core": "2.2.1", "reflect-metadata": "^0.1.8" } } diff --git a/tests/e2e/assets/webpack/test-app/package.json b/tests/e2e/assets/webpack/test-app/package.json index 3c53508c260d..3820b8170840 100644 --- a/tests/e2e/assets/webpack/test-app/package.json +++ b/tests/e2e/assets/webpack/test-app/package.json @@ -2,15 +2,15 @@ "name": "test", "license": "MIT", "dependencies": { - "@angular/common": "~2.1.0", - "@angular/compiler": "~2.1.0", - "@angular/compiler-cli": "~2.1.0", - "@angular/core": "~2.1.0", - "@angular/http": "~2.1.0", - "@angular/platform-browser": "~2.1.0", - "@angular/platform-browser-dynamic": "~2.1.0", - "@angular/platform-server": "~2.1.0", - "@angular/router": "~3.1.0", + "@angular/common": "2.2.1", + "@angular/compiler": "2.2.1", + "@angular/compiler-cli": "2.2.1", + "@angular/core": "2.2.1", + "@angular/http": "2.2.1", + "@angular/platform-browser": "2.2.1", + "@angular/platform-browser-dynamic": "2.2.1", + "@angular/platform-server": "2.2.1", + "@angular/router": "3.2.1", "core-js": "^2.4.1", "rxjs": "^5.0.0-beta.12", "zone.js": "^0.6.21" From c1eb4bffb24ee9e6790dd8935f0c3e3cab09eba3 Mon Sep 17 00:00:00 2001 From: Alex Rickabaugh Date: Tue, 22 Nov 2016 17:52:04 -0800 Subject: [PATCH 13/13] v1.0.0-beta.21 --- CHANGELOG.md | 21 +++++++++++++++++++++ package.json | 2 +- packages/angular-cli/package.json | 2 +- packages/ast-tools/package.json | 2 +- packages/base-href-webpack/package.json | 2 +- packages/webpack/package.json | 2 +- 6 files changed, 26 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b8eea58c067e..19f28a72021d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,24 @@ + +# [1.0.0-beta.21](https://github.com/angular/angular-cli/compare/v1.0.0-beta.20-1...v1.0.0-beta.21) (2016-11-23) + + +### Bug Fixes + +* **angular-cli:** add necessary dependencies. ([#3152](https://github.com/angular/angular-cli/issues/3152)) ([8f574e4](https://github.com/angular/angular-cli/commit/8f574e4)), closes [#3148](https://github.com/angular/angular-cli/issues/3148) +* **angular-cli:** add necessary dependency. ([f7704b0](https://github.com/angular/angular-cli/commit/f7704b0)) +* **angular-cli:** change version of webpack plugin. ([07e96ea](https://github.com/angular/angular-cli/commit/07e96ea)) +* **aot:** lock the angular version to 2.2.1. ([#3242](https://github.com/angular/angular-cli/issues/3242)) ([6e8a848](https://github.com/angular/angular-cli/commit/6e8a848)) +* **editorconfig:** use off instead of 0 for max line length ([#3186](https://github.com/angular/angular-cli/issues/3186)) ([f833d25](https://github.com/angular/angular-cli/commit/f833d25)) +* **generate:** revert change to component dir in generate module, as it caused component declaration to go to parent module ([#3158](https://github.com/angular/angular-cli/issues/3158)) ([71bf855](https://github.com/angular/angular-cli/commit/71bf855)) +* **github-pages-deploy:** Show more accurate url ([#3160](https://github.com/angular/angular-cli/issues/3160)) ([a431389](https://github.com/angular/angular-cli/commit/a431389)) + + +### Features + +* **build:** add sourcemap option ([#3113](https://github.com/angular/angular-cli/issues/3113)) ([6f9d2c1](https://github.com/angular/angular-cli/commit/6f9d2c1)) + + + # [1.0.0-beta.20](https://github.com/angular/angular-cli/compare/v1.0.0-beta.19...v1.0.0-beta.20-1) (2016-11-16) diff --git a/package.json b/package.json index 6651119baa71..917dbb35b21d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "angular-cli", - "version": "1.0.0-beta.20-1", + "version": "1.0.0-beta.21", "description": "CLI tool for Angular", "main": "packages/angular-cli/lib/cli/index.js", "trackingCode": "UA-8594346-19", diff --git a/packages/angular-cli/package.json b/packages/angular-cli/package.json index 07f7e22f18a7..b31db9bbde02 100644 --- a/packages/angular-cli/package.json +++ b/packages/angular-cli/package.json @@ -1,6 +1,6 @@ { "name": "angular-cli", - "version": "1.0.0-beta.20-1", + "version": "1.0.0-beta.21", "description": "CLI tool for Angular", "main": "lib/cli/index.js", "trackingCode": "UA-8594346-19", diff --git a/packages/ast-tools/package.json b/packages/ast-tools/package.json index 962c5df2fc57..e58bfe70ff1a 100644 --- a/packages/ast-tools/package.json +++ b/packages/ast-tools/package.json @@ -1,6 +1,6 @@ { "name": "@angular-cli/ast-tools", - "version": "1.0.7", + "version": "1.0.8", "description": "CLI tool for Angular", "main": "./src/index.js", "keywords": [ diff --git a/packages/base-href-webpack/package.json b/packages/base-href-webpack/package.json index aa13615244cf..1a3c29a6a901 100644 --- a/packages/base-href-webpack/package.json +++ b/packages/base-href-webpack/package.json @@ -1,6 +1,6 @@ { "name": "@angular-cli/base-href-webpack", - "version": "1.0.6", + "version": "1.0.7", "description": "Base HREF Webpack plugin", "main": "./src/index.js", "keywords": [ diff --git a/packages/webpack/package.json b/packages/webpack/package.json index 03915982790d..169124176242 100644 --- a/packages/webpack/package.json +++ b/packages/webpack/package.json @@ -1,6 +1,6 @@ { "name": "@ngtools/webpack", - "version": "1.1.4", + "version": "1.1.5", "description": "Webpack plugin that AoT compiles your Angular components and modules.", "main": "./src/index.js", "typings": "src/index.d.ts",