diff --git a/.editorconfig b/.editorconfig
index f1cc3ad329c5..e0f1dae3a7d9 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -6,7 +6,6 @@ root = true
charset = utf-8
indent_style = space
indent_size = 2
-end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 0e45dc6f5a47..43bf0bbb9fc1 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,20 @@
+
+# [1.0.0-beta.19](https://github.com/angular/angular-cli/compare/v1.0.0-beta.18...v1.0.0-beta.19) (2016-10-28)
+
+
+### Bug Fixes
+
+* **appveyor:** add workaround for webdriver bug ([#2862](https://github.com/angular/angular-cli/issues/2862)) ([2b17b46](https://github.com/angular/angular-cli/commit/2b17b46))
+* **compiler:** update codegen API ([#2919](https://github.com/angular/angular-cli/issues/2919)) ([b50c121](https://github.com/angular/angular-cli/commit/b50c121)), closes [#2917](https://github.com/angular/angular-cli/issues/2917)
+* **e2e:** fix travis e2e ([#2914](https://github.com/angular/angular-cli/issues/2914)) ([b62b996](https://github.com/angular/angular-cli/commit/b62b996))
+
+
+### Features
+
+* **test:** make code coverage and lint optional ([#2840](https://github.com/angular/angular-cli/issues/2840)) ([8944d04](https://github.com/angular/angular-cli/commit/8944d04)), closes [#1799](https://github.com/angular/angular-cli/issues/1799)
+
+
+
# [1.0.0-beta.18](https://github.com/angular/angular-cli/compare/v1.0.0-beta.17...v1.0.0-beta.18) (2016-10-20)
diff --git a/README.md b/README.md
index b1956aee2b8e..d6d0cad1c12f 100644
--- a/README.md
+++ b/README.md
@@ -470,6 +470,6 @@ MIT
[david-badge]: https://david-dm.org/angular/angular-cli.svg
[david-badge-url]: https://david-dm.org/angular/angular-cli
[david-dev-badge]: https://david-dm.org/angular/angular-cli/dev-status.svg
-[david-dev-badge-url]: https://david-dm.org/angular/angular-cli#info=devDependencies
+[david-dev-badge-url]: https://david-dm.org/angular/angular-cli?type=dev
[npm-badge]: https://img.shields.io/npm/v/angular-cli.svg
[npm-badge-url]: https://www.npmjs.com/package/angular-cli
diff --git a/package.json b/package.json
index e64eaf95eb4a..2b7e390c35fa 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "angular-cli",
- "version": "1.0.0-beta.18",
+ "version": "1.0.0-beta.19",
"description": "CLI tool for Angular",
"main": "packages/angular-cli/lib/cli/index.js",
"trackingCode": "UA-8594346-19",
diff --git a/packages/angular-cli/blueprints/directive/index.js b/packages/angular-cli/blueprints/directive/index.js
index 790c34890acf..ba53e7e95442 100644
--- a/packages/angular-cli/blueprints/directive/index.js
+++ b/packages/angular-cli/blueprints/directive/index.js
@@ -85,8 +85,10 @@ module.exports = {
const returns = [];
const className = stringUtils.classify(`${options.entity.name}Directive`);
const fileName = stringUtils.dasherize(`${options.entity.name}.directive`);
- const componentDir = path.relative(this.dynamicPath.appRoot, this.generatePath);
- const importPath = componentDir ? `./${componentDir}/${fileName}` : `./${fileName}`;
+ const fullGeneratePath = path.join(this.project.root, this.generatePath);
+ const moduleDir = path.parse(this.pathToModule).dir;
+ const relativeDir = path.relative(moduleDir, fullGeneratePath);
+ const importPath = relativeDir ? `./${relativeDir}/${fileName}` : `./${fileName}`;
if (!options['skip-import']) {
returns.push(
diff --git a/packages/angular-cli/blueprints/ng2/files/.editorconfig b/packages/angular-cli/blueprints/ng2/files/.editorconfig
index f3526162d642..06dde115f57e 100644
--- a/packages/angular-cli/blueprints/ng2/files/.editorconfig
+++ b/packages/angular-cli/blueprints/ng2/files/.editorconfig
@@ -5,7 +5,6 @@ root = true
charset = utf-8
indent_style = space
indent_size = 2
-end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
diff --git a/packages/angular-cli/blueprints/ng2/files/karma.conf.js b/packages/angular-cli/blueprints/ng2/files/karma.conf.js
index 5c349bd00abd..1ed9667c0dc6 100644
--- a/packages/angular-cli/blueprints/ng2/files/karma.conf.js
+++ b/packages/angular-cli/blueprints/ng2/files/karma.conf.js
@@ -27,7 +27,9 @@ module.exports = function (config) {
config: './angular-cli.json',
environment: 'dev'
},
- reporters: ['progress', 'karma-remap-istanbul'],
+ reporters: config.angularCli && config.angularCli.codeCoverage
+ ? ['progress', 'karma-remap-istanbul']
+ : ['progress'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
diff --git a/packages/angular-cli/blueprints/ng2/files/package.json b/packages/angular-cli/blueprints/ng2/files/package.json
index 0dc640bdc147..211607633967 100644
--- a/packages/angular-cli/blueprints/ng2/files/package.json
+++ b/packages/angular-cli/blueprints/ng2/files/package.json
@@ -47,6 +47,7 @@
"protractor": "4.0.9",
"ts-node": "1.2.1",
"tslint": "3.13.0",
- "typescript": "~2.0.3"
+ "typescript": "~2.0.3",
+ "webdriver-manager": "10.2.5"
}
}
diff --git a/packages/angular-cli/blueprints/pipe/index.js b/packages/angular-cli/blueprints/pipe/index.js
index d4a65b158641..12f957add718 100644
--- a/packages/angular-cli/blueprints/pipe/index.js
+++ b/packages/angular-cli/blueprints/pipe/index.js
@@ -73,8 +73,10 @@ module.exports = {
const returns = [];
const className = stringUtils.classify(`${options.entity.name}Pipe`);
const fileName = stringUtils.dasherize(`${options.entity.name}.pipe`);
- const componentDir = path.relative(this.dynamicPath.appRoot, this.generatePath);
- const importPath = componentDir ? `./${componentDir}/${fileName}` : `./${fileName}`;
+ const fullGeneratePath = path.join(this.project.root, this.generatePath);
+ const moduleDir = path.parse(this.pathToModule).dir;
+ const relativeDir = path.relative(moduleDir, fullGeneratePath);
+ const importPath = relativeDir ? `./${relativeDir}/${fileName}` : `./${fileName}`;
if (!options['skip-import']) {
returns.push(
diff --git a/packages/angular-cli/commands/test.ts b/packages/angular-cli/commands/test.ts
index 74049b943c1c..2ac4f304d9c7 100644
--- a/packages/angular-cli/commands/test.ts
+++ b/packages/angular-cli/commands/test.ts
@@ -5,6 +5,8 @@ import {CliConfig} from '../models/config';
const NgCliTestCommand = TestCommand.extend({
availableOptions: [
{ name: 'watch', type: Boolean, default: true, aliases: ['w'] },
+ { name: 'code-coverage', type: Boolean, default: false, aliases: ['cc'] },
+ { name: 'lint', type: Boolean, default: false, aliases: ['l'] },
{ name: 'browsers', type: String },
{ name: 'colors', type: Boolean },
{ name: 'log-level', type: String },
diff --git a/packages/angular-cli/models/webpack-build-development.ts b/packages/angular-cli/models/webpack-build-development.ts
index ed5305df709f..f1bfd7ff6b24 100644
--- a/packages/angular-cli/models/webpack-build-development.ts
+++ b/packages/angular-cli/models/webpack-build-development.ts
@@ -2,7 +2,7 @@ const path = require('path');
export const getWebpackDevConfigPartial = function(projectRoot: string, appConfig: any) {
return {
- devtool: 'cheap-module-source-map',
+ devtool: 'source-map',
output: {
path: path.resolve(projectRoot, appConfig.outDir),
filename: '[name].bundle.js',
diff --git a/packages/angular-cli/models/webpack-build-test.js b/packages/angular-cli/models/webpack-build-test.js
index 9d3262f30138..c23801c3c3f0 100644
--- a/packages/angular-cli/models/webpack-build-test.js
+++ b/packages/angular-cli/models/webpack-build-test.js
@@ -4,9 +4,43 @@ const path = require('path');
const webpack = require('webpack');
const atl = require('awesome-typescript-loader');
-const getWebpackTestConfig = function (projectRoot, environment, appConfig) {
+const getWebpackTestConfig = function (projectRoot, environment, appConfig, testConfig) {
const appRoot = path.resolve(projectRoot, appConfig.root);
+ const extraRules = [];
+ const extraPlugins = [];
+
+ if (testConfig.codeCoverage) {
+ extraRules.push({
+ test: /\.(js|ts)$/, loader: 'sourcemap-istanbul-instrumenter-loader',
+ enforce: 'post',
+ exclude: [
+ /\.(e2e|spec)\.ts$/,
+ /node_modules/
+ ],
+ query: { 'force-sourcemap': true }
+ });
+ }
+
+ if (testConfig.lint) {
+ extraRules.push({
+ test: /\.ts$/,
+ enforce: 'pre',
+ loader: 'tslint-loader',
+ exclude: [
+ path.resolve(projectRoot, 'node_modules')
+ ]
+ });
+ extraPlugins.push(new webpack.LoaderOptionsPlugin({
+ options: {
+ tslint: {
+ emitErrors: false,
+ failOnHint: false,
+ resourcePath: `./${appConfig.root}`
+ }
+ }
+ }))
+ }
return {
devtool: 'inline-source-map',
@@ -28,21 +62,12 @@ const getWebpackTestConfig = function (projectRoot, environment, appConfig) {
},
module: {
rules: [
- {
- test: /\.ts$/,
- enforce: 'pre',
- loader: 'tslint-loader',
- exclude: [
- path.resolve(projectRoot, 'node_modules')
- ]
- },
{
test: /\.js$/,
enforce: 'pre',
loader: 'source-map-loader',
exclude: [
- path.resolve(projectRoot, 'node_modules/rxjs'),
- path.resolve(projectRoot, 'node_modules/@angular')
+ /node_modules/
]
},
{
@@ -63,23 +88,14 @@ const getWebpackTestConfig = function (projectRoot, environment, appConfig) {
],
exclude: [/\.e2e\.ts$/]
},
- {
- test: /\.(js|ts)$/, loader: 'sourcemap-istanbul-instrumenter-loader',
- enforce: 'post',
- exclude: [
- /\.(e2e|spec)\.ts$/,
- /node_modules/
- ],
- query: { 'force-sourcemap': true }
- },
{ test: /\.json$/, loader: 'json-loader' },
- { test: /\.css$/, loaders: ['raw-loader', 'postcss-loader'] },
+ { test: /\.css$/, loaders: ['raw-loader', 'postcss-loader'] },
{ test: /\.styl$/, loaders: ['raw-loader', 'postcss-loader', 'stylus-loader'] },
{ test: /\.less$/, loaders: ['raw-loader', 'postcss-loader', 'less-loader'] },
{ test: /\.scss$|\.sass$/, loaders: ['raw-loader', 'postcss-loader', 'sass-loader'] },
{ test: /\.(jpg|png)$/, loader: 'url-loader?limit=128000' },
{ test: /\.html$/, loader: 'raw-loader', exclude: [path.resolve(appRoot, appConfig.index)] }
- ]
+ ].concat(extraRules)
},
plugins: [
new webpack.SourceMapDevToolPlugin({
@@ -94,20 +110,11 @@ const getWebpackTestConfig = function (projectRoot, environment, appConfig) {
.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, '\\$&')),
path.resolve(appRoot, appConfig.environments[environment])
),
- new webpack.LoaderOptionsPlugin({
- options: {
- tslint: {
- emitErrors: false,
- failOnHint: false,
- resourcePath: `./${appConfig.root}`
- }
- }
- }),
new webpack.ContextReplacementPlugin(
/angular(\\|\/)core(\\|\/)(esm(\\|\/)src|src)(\\|\/)linker/,
appRoot
)
- ],
+ ].concat(extraPlugins),
node: {
fs: 'empty',
global: true,
diff --git a/packages/angular-cli/package.json b/packages/angular-cli/package.json
index 2389600d7f14..ec0688fd3532 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.18",
+ "version": "1.0.0-beta.19",
"description": "CLI tool for Angular",
"main": "lib/cli/index.js",
"trackingCode": "UA-8594346-19",
diff --git a/packages/angular-cli/plugins/karma.js b/packages/angular-cli/plugins/karma.js
index 69bf559031be..983157f3fdca 100644
--- a/packages/angular-cli/plugins/karma.js
+++ b/packages/angular-cli/plugins/karma.js
@@ -3,7 +3,6 @@ const getWebpackTestConfig = require('../models/webpack-build-test').getWebpackT
const CliConfig = require('../models/config').CliConfig;
const init = (config) => {
-
// load Angular CLI config
if (!config.angularCli || !config.angularCli.config) {
throw new Error('Missing \'angularCli.config\' entry in Karma config');
@@ -11,9 +10,13 @@ const init = (config) => {
const angularCliConfig = require(path.join(config.basePath, config.angularCli.config));
const appConfig = angularCliConfig.apps[0];
const environment = config.angularCli.environment || 'dev';
+ const testConfig = {
+ codeCoverage: config.angularCli.codeCoverage || false,
+ lint: config.angularCli.lint || false
+ }
// add webpack config
- const webpackConfig = getWebpackTestConfig(config.basePath, environment, appConfig);
+ const webpackConfig = getWebpackTestConfig(config.basePath, environment, appConfig, testConfig);
const webpackMiddlewareConfig = {
noInfo: true, // Hide webpack output because its noisy.
stats: { // Also prevent chunk and module display output, cleaner look. Only emit errors.
@@ -40,11 +43,11 @@ const init = (config) => {
.map((arr) => arr.splice(arr.indexOf('angular-cli'), 1, 'webpack', 'sourcemap'));
}
-init.$inject = ['config']
+init.$inject = ['config'];
// dummy preprocessor, just to keep karma from showing a warning
const preprocessor = () => (content, file, done) => done(null, content);
-preprocessor.$inject = []
+preprocessor.$inject = [];
// also export karma-webpack and karma-sourcemap-loader
module.exports = Object.assign({
diff --git a/packages/angular-cli/tasks/test.ts b/packages/angular-cli/tasks/test.ts
index d406df43e0c3..e539c075199a 100644
--- a/packages/angular-cli/tasks/test.ts
+++ b/packages/angular-cli/tasks/test.ts
@@ -20,6 +20,11 @@ export default Task.extend({
options.browsers = options.browsers.split(',');
}
+ options.angularCli = {
+ codeCoverage: options.codeCoverage,
+ lint: options.lint,
+ };
+
// Assign additional karmaConfig options to the local ngapp config
options.configFile = karmaConfig;
diff --git a/packages/ast-tools/package.json b/packages/ast-tools/package.json
index 6396f0275feb..87c6a22cac04 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.5",
+ "version": "1.0.6",
"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 89cb40dee0ab..f946b1b9456f 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.4",
+ "version": "1.0.5",
"description": "Base HREF Webpack plugin",
"main": "./src/index.js",
"keywords": [
diff --git a/packages/webpack/package.json b/packages/webpack/package.json
index 9043f98a3b89..27d4b5dae042 100644
--- a/packages/webpack/package.json
+++ b/packages/webpack/package.json
@@ -1,6 +1,6 @@
{
"name": "@ngtools/webpack",
- "version": "1.1.2",
+ "version": "1.1.3",
"description": "",
"main": "./src/index.js",
"repository": {
diff --git a/packages/webpack/src/plugin.ts b/packages/webpack/src/plugin.ts
index f01ae0fe7952..ed6f78c849c9 100644
--- a/packages/webpack/src/plugin.ts
+++ b/packages/webpack/src/plugin.ts
@@ -207,7 +207,7 @@ export class AotPlugin {
// We need to temporarily patch the CodeGenerator until either it's patched or allows us
// to pass in our own ReflectorHost.
patchReflectorHost(codeGenerator);
- this._donePromise = codeGenerator.codegen()
+ this._donePromise = codeGenerator.codegen({transitiveModules: true})
.then(() => {
// Create a new Program, based on the old one. This will trigger a resolution of all
// transitive modules, which include files that might just have been generated.
@@ -239,7 +239,7 @@ export class AotPlugin {
return lazyRoutes;
}, {});
})
- .then(() => cb(), (err) => cb(err));
+ .then(() => cb(), (err: any) => cb(err));
}
private _resolveModule(module: ModuleRoute, containingFile: string) {
diff --git a/tests/e2e/assets/webpack/test-app/package.json b/tests/e2e/assets/webpack/test-app/package.json
index ce591fa78450..3c53508c260d 100644
--- a/tests/e2e/assets/webpack/test-app/package.json
+++ b/tests/e2e/assets/webpack/test-app/package.json
@@ -4,7 +4,7 @@
"dependencies": {
"@angular/common": "~2.1.0",
"@angular/compiler": "~2.1.0",
- "@angular/compiler-cli": "0.6.2",
+ "@angular/compiler-cli": "~2.1.0",
"@angular/core": "~2.1.0",
"@angular/http": "~2.1.0",
"@angular/platform-browser": "~2.1.0",
diff --git a/tests/e2e/tests/misc/coverage.ts b/tests/e2e/tests/misc/coverage.ts
index 42d4f6e1d805..11af7537a7fb 100644
--- a/tests/e2e/tests/misc/coverage.ts
+++ b/tests/e2e/tests/misc/coverage.ts
@@ -3,7 +3,7 @@ import {ng} from '../../utils/process';
export default function() {
- return ng('test', '--watch=false')
+ return ng('test', '--watch=false', '--code-coverage')
.then(() => expectFileToExist('coverage/src/app'))
.then(() => expectFileToExist('coverage/coverage.lcov'));
}