build: update npm dependencies (#19328)

PR Close #19328
This commit is contained in:
Olivier Combe 2017-09-22 19:51:03 +02:00 committed by Igor Minar
parent f48b343af1
commit 0f5c70d563
86 changed files with 965 additions and 1565 deletions

View File

@ -103,6 +103,7 @@ if (require.main === module) {
args.shift(); // node args.shift(); // node
args.shift(); // scriptfile.js args.shift(); // scriptfile.js
if (args.length < 2) { if (args.length < 2) {
// tslint:disable-next-line:no-console
console.log("usage: $0 outFile path/to/modules"); console.log("usage: $0 outFile path/to/modules");
process.exit(1); process.exit(1);
} }
@ -110,6 +111,7 @@ if (require.main === module) {
var directory = args.shift(); var directory = args.shift();
fs.writeFileSync(outfile, main(directory)); fs.writeFileSync(outfile, main(directory));
} catch (e) { } catch (e) {
// tslint:disable-next-line:no-console
console.log(e.message); console.log(e.message);
process.exit(1); process.exit(1);
} }

View File

@ -31,7 +31,7 @@ function $locationHashPrefixProvider($locationProvider) {
hashPrefix = prefix; hashPrefix = prefix;
} }
return hashPrefixFn(prefix); return hashPrefixFn(prefix);
} };
// Return the final hashPrefix as the value of this service // Return the final hashPrefix as the value of this service
this.$get = function() { return hashPrefix; }; this.$get = function() { return hashPrefix; };
@ -110,7 +110,7 @@ function routerFactory($q, $location, $browser, $rootScope, $injector, $routerRo
} }
} }
} };
var registry = new RouteRegistry($routerRootComponent); var registry = new RouteRegistry($routerRootComponent);
var location = new Location(); var location = new Location();

View File

@ -32,11 +32,11 @@ describe('Navigation lifecycle', function () {
registerComponent('oneCmp', { registerComponent('oneCmp', {
template: '<div>{{oneCmp.number}}</div>', template: '<div>{{oneCmp.number}}</div>',
controller: function () {this.number = 'one'} controller: function () {this.number = 'one';}
}); });
registerComponent('twoCmp', { registerComponent('twoCmp', {
template: '<div><a ng-link="[\'/Two\']">{{twoCmp.number}}</a></div>', template: '<div><a ng-link="[\'/Two\']">{{twoCmp.number}}</a></div>',
controller: function () {this.number = 'two'} controller: function () {this.number = 'two';}
}); });
}); });

View File

@ -37,15 +37,15 @@ describe('navigation', function () {
}); });
registerDirective('oneCmp', { registerDirective('oneCmp', {
template: '<div>{{oneCmp.number}}</div>', template: '<div>{{oneCmp.number}}</div>',
controller: function () {this.number = 'one'} controller: function () {this.number = 'one';}
}); });
registerDirective('twoCmp', { registerDirective('twoCmp', {
template: '<div>{{twoCmp.number}}</div>', template: '<div>{{twoCmp.number}}</div>',
controller: function () {this.number = 'two'} controller: function () {this.number = 'two';}
}); });
registerComponent('threeCmp', { registerComponent('threeCmp', {
template: '<div>{{$ctrl.number}}</div>', template: '<div>{{$ctrl.number}}</div>',
controller: function () {this.number = 'three'} controller: function () {this.number = 'three';}
}); });
registerComponent('getParams', { registerComponent('getParams', {
template: '<div>{{$ctrl.params.x}}</div>', template: '<div>{{$ctrl.params.x}}</div>',
@ -54,7 +54,7 @@ describe('navigation', function () {
this.params = next.params; this.params = next.params;
}; };
} }
}) });
}); });
it('should work in a simple case', function () { it('should work in a simple case', function () {
@ -331,7 +331,7 @@ describe('navigation', function () {
var definition = { var definition = {
template: options.template || '', template: options.template || '',
controller: getController(options), controller: getController(options),
} };
applyStaticProperties(definition.controller, options); applyStaticProperties(definition.controller, options);
$compileProvider.component(name, definition); $compileProvider.component(name, definition);
} }

View File

@ -68,7 +68,7 @@ describe('router', function () {
expect(homeElement.text()).toBe('Home'); expect(homeElement.text()).toBe('Home');
expect(homeElement.isolateScope().$ctrl.$router).toBeDefined(); expect(homeElement.isolateScope().$ctrl.$router).toBeDefined();
expect(router).toBeDefined(); expect(router).toBeDefined();
}) });
}); });
it('should work when an async route is provided route data', function() { it('should work when an async route is provided route data', function() {
@ -126,7 +126,7 @@ describe('router', function () {
var homeElement = elt.find('home-cmp'); var homeElement = elt.find('home-cmp');
expect(homeElement.text()).toBe('Home'); expect(homeElement.text()).toBe('Home');
expect($routerOnActivate).toHaveBeenCalled(); expect($routerOnActivate).toHaveBeenCalled();
}) });
}); });
it('should provide the current instruction', function() { it('should provide the current instruction', function() {

View File

@ -64,7 +64,7 @@ describe('ngLink', function () {
it('should allow params in routerLink directive', function () { it('should allow params in routerLink directive', function () {
setup({baseHref: baseHref, html5Mode: html5Mode, hashPrefix: hashPrefix}); setup({baseHref: baseHref, html5Mode: html5Mode, hashPrefix: hashPrefix});
registerComponent('twoLinkCmp', '<div><a ng-link="[\'/Two\', {param: \'lol\'}]">{{twoLinkCmp.number}}</a></div>', function () {this.number = 'two'}); registerComponent('twoLinkCmp', '<div><a ng-link="[\'/Two\', {param: \'lol\'}]">{{twoLinkCmp.number}}</a></div>', function () {this.number = 'two';});
configureRouter([ configureRouter([
{ path: '/a', component: 'twoLinkCmp' }, { path: '/a', component: 'twoLinkCmp' },
{ path: '/b/:param', component: 'twoCmp', name: 'Two' } { path: '/b/:param', component: 'twoCmp', name: 'Two' }
@ -78,7 +78,7 @@ describe('ngLink', function () {
it('should update the href of links with bound params', function () { it('should update the href of links with bound params', function () {
setup({baseHref: baseHref, html5Mode: html5Mode, hashPrefix: hashPrefix}); setup({baseHref: baseHref, html5Mode: html5Mode, hashPrefix: hashPrefix});
registerComponent('twoLinkCmp', '<div><a ng-link="[\'/Two\', {param: $ctrl.number}]">{{$ctrl.number}}</a></div>', function () {this.number = 43}); registerComponent('twoLinkCmp', '<div><a ng-link="[\'/Two\', {param: $ctrl.number}]">{{$ctrl.number}}</a></div>', function () {this.number = 43;});
configureRouter([ configureRouter([
{ path: '/a', component: 'twoLinkCmp' }, { path: '/a', component: 'twoLinkCmp' },
{ path: '/b/:param', component: 'twoCmp', name: 'Two' } { path: '/b/:param', component: 'twoCmp', name: 'Two' }
@ -184,8 +184,8 @@ describe('ngLink', function () {
$locationProvider.hashPrefix(config.hashPrefix); $locationProvider.hashPrefix(config.hashPrefix);
}); });
registerComponent('userCmp', '<div>hello {{$ctrl.$routeParams.name}}</div>', function () {}); registerComponent('userCmp', '<div>hello {{$ctrl.$routeParams.name}}</div>', function () {});
registerComponent('oneCmp', '<div>{{$ctrl.number}}</div>', function () {this.number = 'one'}); registerComponent('oneCmp', '<div>{{$ctrl.number}}</div>', function () {this.number = 'one';});
registerComponent('twoCmp', '<div><a ng-link="[\'/Two\']">{{$ctrl.number}}</a></div>', function () {this.number = 'two'}); registerComponent('twoCmp', '<div><a ng-link="[\'/Two\']">{{$ctrl.number}}</a></div>', function () {this.number = 'two';});
} }
function configureRouter(routeConfig) { function configureRouter(routeConfig) {

View File

@ -83,6 +83,6 @@ function provideHelpers(fn, preInject) {
$rootRouter: $rootRouter, $rootRouter: $rootRouter,
put: put, put: put,
compile: compile compile: compile
}) });
} };
} }

View File

@ -7,7 +7,6 @@
*/ */
export {verifyNoBrowserErrors} from './e2e_util'; export {verifyNoBrowserErrors} from './e2e_util';
const yargs = require('yargs');
const nodeUuid = require('node-uuid'); const nodeUuid = require('node-uuid');
import * as fs from 'fs-extra'; import * as fs from 'fs-extra';

View File

@ -43,7 +43,7 @@ class AsyncApplication {
multiTimeoutId: any = null; multiTimeoutId: any = null;
intervalId: any = null; intervalId: any = null;
increment(): void { this.val1++; }; increment(): void { this.val1++; }
delayedIncrement(): void { delayedIncrement(): void {
this.cancelDelayedIncrement(); this.cancelDelayedIncrement();
@ -51,7 +51,7 @@ class AsyncApplication {
this.val2++; this.val2++;
this.timeoutId = null; this.timeoutId = null;
}, 2000); }, 2000);
}; }
multiDelayedIncrements(i: number): void { multiDelayedIncrements(i: number): void {
this.cancelMultiDelayedIncrements(); this.cancelMultiDelayedIncrements();
@ -69,33 +69,33 @@ class AsyncApplication {
}, 500); }, 500);
} }
helper(i); helper(i);
}; }
periodicIncrement(): void { periodicIncrement(): void {
this.cancelPeriodicIncrement(); this.cancelPeriodicIncrement();
this.intervalId = setInterval(() => this.val4++, 2000); this.intervalId = setInterval(() => this.val4++, 2000);
}; }
cancelDelayedIncrement(): void { cancelDelayedIncrement(): void {
if (this.timeoutId != null) { if (this.timeoutId != null) {
clearTimeout(this.timeoutId); clearTimeout(this.timeoutId);
this.timeoutId = null; this.timeoutId = null;
} }
}; }
cancelMultiDelayedIncrements(): void { cancelMultiDelayedIncrements(): void {
if (this.multiTimeoutId != null) { if (this.multiTimeoutId != null) {
clearTimeout(this.multiTimeoutId); clearTimeout(this.multiTimeoutId);
this.multiTimeoutId = null; this.multiTimeoutId = null;
} }
}; }
cancelPeriodicIncrement(): void { cancelPeriodicIncrement(): void {
if (this.intervalId != null) { if (this.intervalId != null) {
clearInterval(this.intervalId); clearInterval(this.intervalId);
this.intervalId = null; this.intervalId = null;
} }
}; }
} }
@NgModule( @NgModule(

View File

@ -39,4 +39,4 @@ export default {
rollupNG2(), rollupNG2(),
nodeResolve({ jsnext: true, main: true }), nodeResolve({ jsnext: true, main: true }),
] ]
} };

View File

@ -29,51 +29,49 @@
"zone.js": "^0.8.12" "zone.js": "^0.8.12"
}, },
"optionalDependencies": { "optionalDependencies": {
"fsevents": "1.0.17" "fsevents": "1.1.2"
}, },
"devDependencies": { "devDependencies": {
"@bazel/typescript": "0.1.x", "@bazel/typescript": "0.1.x",
"@types/angularjs": "1.5.13-alpha", "@types/angularjs": "1.5.14-alpha",
"@types/base64-js": "1.2.5", "@types/base64-js": "1.2.5",
"@types/chokidar": "1.7.3", "@types/chokidar": "1.7.3",
"@types/fs-extra": "0.0.22-alpha", "@types/fs-extra": "4.0.2",
"@types/hammerjs": "2.0.33", "@types/hammerjs": "2.0.35",
"@types/jasmine": "2.2.22-alpha", "@types/jasmine": "2.2.22-alpha",
"@types/node": "6.0.88", "@types/node": "6.0.88",
"@types/selenium-webdriver": "3.0.6", "@types/selenium-webdriver": "3.0.7",
"@types/systemjs": "0.19.32", "@types/systemjs": "0.19.32",
"angular": "1.5.0", "angular": "1.5.0",
"angular-animate": "1.5.0", "angular-animate": "1.5.0",
"angular-mocks": "1.5.0", "angular-mocks": "1.5.0",
"base64-js": "1.2.0", "base64-js": "1.2.1",
"bower": "1.7.2", "bower": "1.8.2",
"browserstacktunnel-wrapper": "1.4.2", "browserstacktunnel-wrapper": "2.0.1",
"canonical-path": "0.0.2", "canonical-path": "0.0.2",
"chokidar": "1.4.2", "chokidar": "1.7.0",
"clang-format": "1.0.41", "clang-format": "1.0.41",
"cldr": "4.5.0", "cldr": "4.5.0",
"cldr-data-downloader": "0.3.2", "cldr-data-downloader": "0.3.2",
"cldrjs": "0.5.0", "cldrjs": "0.5.0",
"conventional-changelog": "1.1.0", "conventional-changelog": "1.1.0",
"cors": "2.7.1", "cors": "2.8.4",
"dgeni": "0.4.2",
"dgeni-packages": "0.16.5",
"domino": "1.0.29", "domino": "1.0.29",
"entities": "1.1.1", "entities": "1.1.1",
"firebase-tools": "3.9.2", "firebase-tools": "3.12.0",
"firefox-profile": "0.3.11", "firefox-profile": "1.0.3",
"fs-extra": "0.26.3", "fs-extra": "4.0.2",
"glob": "4.5.3", "glob": "7.1.2",
"gulp": "3.9.1", "gulp": "3.9.1",
"gulp-clang-format": "1.0.23", "gulp-clang-format": "1.0.23",
"gulp-connect": "2.3.1", "gulp-connect": "5.0.0",
"gulp-conventional-changelog": "1.1.0", "gulp-conventional-changelog": "1.1.0",
"gulp-tslint": "7.0.1", "gulp-tslint": "8.1.2",
"hammerjs": "2.0.8", "hammerjs": "2.0.8",
"incremental-dom": "0.4.1", "incremental-dom": "0.4.1",
"jasmine": "2.4.1", "jasmine": "2.4.1",
"jasmine-core": "2.4.1", "jasmine-core": "2.4.1",
"jpm": "1.0.0", "jpm": "1.3.1",
"karma": "0.13.20", "karma": "0.13.20",
"karma-browserstack-launcher": "0.1.9", "karma-browserstack-launcher": "0.1.9",
"karma-chrome-launcher": "0.2.0", "karma-chrome-launcher": "0.2.0",
@ -82,34 +80,30 @@
"karma-sourcemap-loader": "0.3.6", "karma-sourcemap-loader": "0.3.6",
"madge": "0.5.0", "madge": "0.5.0",
"minimist": "1.2.0", "minimist": "1.2.0",
"nan": "2.4.0",
"node-uuid": "1.4.8", "node-uuid": "1.4.8",
"protractor": "5.1.2", "protractor": "5.1.2",
"react": "0.14.9",
"rewire": "2.5.2", "rewire": "2.5.2",
"rho": "0.3.0",
"rollup": "0.47.4", "rollup": "0.47.4",
"rollup-plugin-commonjs": "8.1.0", "rollup-plugin-commonjs": "8.1.0",
"rollup-plugin-node-resolve": "3.0.0", "rollup-plugin-node-resolve": "3.0.0",
"rollup-plugin-sourcemaps": "0.4.2", "rollup-plugin-sourcemaps": "0.4.2",
"selenium-webdriver": "3.0.x", "selenium-webdriver": "3.5.0",
"semver": "5.1.0", "semver": "5.4.1",
"sorcery": "0.10.0", "source-map": "0.5.7",
"source-map": "0.5.6", "source-map-support": "0.4.18",
"source-map-support": "0.4.2",
"systemjs": "0.18.10", "systemjs": "0.18.10",
"ts-api-guardian": "0.2.2", "ts-api-guardian": "0.2.2",
"tsickle": "0.24.x", "tsickle": "0.24.x",
"tslint": "4.1.1", "tslint": "5.7.0",
"tslint-eslint-rules": "3.1.0", "tslint-eslint-rules": "4.1.1",
"typescript": "2.4.2", "typescript": "2.4.2",
"uglify-js": "2.8.29", "uglify-js": "2.8.29",
"universal-analytics": "0.3.10", "universal-analytics": "0.4.15",
"vlq": "0.2.2", "vlq": "0.2.2",
"vrsource-tslint-rules": "4.0.0", "vrsource-tslint-rules": "5.1.1",
"webpack": "1.12.9", "webpack": "1.12.9",
"xhr2": "0.1.4", "xhr2": "0.1.4",
"yargs": "3.31.0", "yargs": "9.0.1",
"yarn": "1.0.2" "yarn": "1.0.2"
} }
} }

View File

@ -53,7 +53,7 @@ class Profiler {
function forceGC() { function forceGC() {
Cu.forceGC(); Cu.forceGC();
os.notifyObservers(null, 'child-gc-request', null); os.notifyObservers(null, 'child-gc-request', null);
}; }
const mod = require('sdk/page-mod'); const mod = require('sdk/page-mod');
const data = require('sdk/self').data; const data = require('sdk/self').data;

View File

@ -28,7 +28,7 @@ exports.getFirefoxProfile = function(extensionPath: string) {
const firefoxProfile = new FirefoxProfile(); const firefoxProfile = new FirefoxProfile();
firefoxProfile.addExtensions([extensionPath], () => { firefoxProfile.addExtensions([extensionPath], () => {
firefoxProfile.encoded((encodedProfile: any) => { firefoxProfile.encoded((err: any, encodedProfile: string) => {
const multiCapabilities = [{browserName: 'firefox', firefox_profile: encodedProfile}]; const multiCapabilities = [{browserName: 'firefox', firefox_profile: encodedProfile}];
deferred.resolve(multiCapabilities); deferred.resolve(multiCapabilities);
}); });

View File

@ -17,7 +17,7 @@ function assertEventsEqual(actualEvents: any[], expectedEvents: any[]) {
expect(actualEvent[key]).toEqual(expectedEvent[key]); expect(actualEvent[key]).toEqual(expectedEvent[key]);
} }
} }
}; }
export function main() { export function main() {
describe('convertPerfProfileToEvents', function() { describe('convertPerfProfileToEvents', function() {
@ -97,4 +97,4 @@ export function main() {
assertEventsEqual(perfEvents, [{ph: 'X', ts: 1, name: 'script'}]); assertEventsEqual(perfEvents, [{ph: 'X', ts: 1, name: 'script'}]);
}); });
}); });
}; }

View File

@ -68,4 +68,4 @@ export default {
}, },
banner: banner, banner: banner,
plugins: [{resolveId: resolve}, commonjs()] plugins: [{resolveId: resolve}, commonjs()]
} };

View File

@ -6,7 +6,6 @@
* Use of this source code is governed by an MIT-style license that can be * Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license * found in the LICENSE file at https://angular.io/license
*/ */
/* tslint:disable:no-console */
// Must be imported first, because Angular decorators throw on load. // Must be imported first, because Angular decorators throw on load.
import 'reflect-metadata'; import 'reflect-metadata';
@ -18,6 +17,7 @@ import {__NGTOOLS_PRIVATE_API_2, readConfiguration} from '@angular/compiler-cli'
const glob = require('glob'); const glob = require('glob');
/* tslint:disable:no-console */
/** /**
* Main method. * Main method.
* Standalone program that executes codegen using the ngtools API and tests that files were * Standalone program that executes codegen using the ngtools API and tests that files were

View File

@ -6,7 +6,6 @@
* Use of this source code is governed by an MIT-style license that can be * Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license * found in the LICENSE file at https://angular.io/license
*/ */
/* tslint:disable:no-console */
// Must be imported first, because Angular decorators throw on load. // Must be imported first, because Angular decorators throw on load.
import 'reflect-metadata'; import 'reflect-metadata';
@ -16,6 +15,7 @@ import * as ts from 'typescript';
import * as assert from 'assert'; import * as assert from 'assert';
import {CompilerOptions, CodeGenerator, CompilerHostContext, NodeCompilerHostContext, readConfiguration} from '@angular/compiler-cli'; import {CompilerOptions, CodeGenerator, CompilerHostContext, NodeCompilerHostContext, readConfiguration} from '@angular/compiler-cli';
/* tslint:disable:no-console */
/** /**
* Main method. * Main method.
* Standalone program that executes the real codegen and tests that * Standalone program that executes the real codegen and tests that

View File

@ -329,7 +329,7 @@ export class CompilerHost extends BaseAotCompilerHost<CompilerHostContext> {
this.moduleFileNames.set(key, result); this.moduleFileNames.set(key, result);
} }
return result; return result;
}; }
/** /**
* We want a moduleId that will appear in import statements in the generated code. * We want a moduleId that will appear in import statements in the generated code.
@ -401,7 +401,7 @@ export class CompilerHost extends BaseAotCompilerHost<CompilerHostContext> {
private rewriteGenDirPath(filepath: string) { private rewriteGenDirPath(filepath: string) {
const nodeModulesIndex = filepath.indexOf(NODE_MODULES); const nodeModulesIndex = filepath.indexOf(NODE_MODULES);
if (nodeModulesIndex !== -1) { if (nodeModulesIndex !== -1) {
// If we are in node_modulse, transplant them into `genDir`. // If we are in node_modules, transplant them into `genDir`.
return path.join(this.genDir, filepath.substring(nodeModulesIndex)); return path.join(this.genDir, filepath.substring(nodeModulesIndex));
} else { } else {
// pretend that containing file is on top of the `genDir` to normalize the paths. // pretend that containing file is on top of the `genDir` to normalize the paths.

View File

@ -401,7 +401,7 @@ export class TsCompilerAotCompilerTypeCheckHostAdapter extends
readFile = (fileName: string) => this.context.readFile(fileName); readFile = (fileName: string) => this.context.readFile(fileName);
getDefaultLibFileName = (options: ts.CompilerOptions) => getDefaultLibFileName = (options: ts.CompilerOptions) =>
this.context.getDefaultLibFileName(options); this.context.getDefaultLibFileName(options)
getCurrentDirectory = () => this.context.getCurrentDirectory(); getCurrentDirectory = () => this.context.getCurrentDirectory();
getCanonicalFileName = (fileName: string) => this.context.getCanonicalFileName(fileName); getCanonicalFileName = (fileName: string) => this.context.getCanonicalFileName(fileName);
useCaseSensitiveFileNames = () => this.context.useCaseSensitiveFileNames(); useCaseSensitiveFileNames = () => this.context.useCaseSensitiveFileNames();

View File

@ -317,7 +317,6 @@ class _NodeEmitterVisitor implements StatementVisitor, ExpressionVisitor {
ts.createConditional( ts.createConditional(
expr.condition.visitExpression(this, null), expr.trueCase.visitExpression(this, null), expr.condition.visitExpression(this, null), expr.trueCase.visitExpression(this, null),
expr.falseCase !.visitExpression(this, null))); expr.falseCase !.visitExpression(this, null)));
;
} }
visitNotExpr(expr: NotExpr): RecordedNode<ts.PrefixUnaryExpression> { visitNotExpr(expr: NotExpr): RecordedNode<ts.PrefixUnaryExpression> {

View File

@ -131,7 +131,7 @@ class MockWatchHost {
reportDiagnostics(diags: ng.Diagnostics) { this.diagnostics.push(...diags); } reportDiagnostics(diags: ng.Diagnostics) { this.diagnostics.push(...diags); }
readConfiguration() { return this.config; } readConfiguration() { return this.config; }
createCompilerHost(options: ng.CompilerOptions) { return ng.createCompilerHost({options}); }; createCompilerHost(options: ng.CompilerOptions) { return ng.createCompilerHost({options}); }
createEmitCallback() { return undefined; } createEmitCallback() { return undefined; }
onFileChange( onFileChange(
options: ng.CompilerOptions, listener: (event: FileChangeEvent, fileName: string) => void, options: ng.CompilerOptions, listener: (event: FileChangeEvent, fileName: string) => void,

View File

@ -165,7 +165,7 @@ function convert(annotatedSource: string) {
} }
}, undefined, undefined, transformers); }, undefined, undefined, transformers);
return normalizeResult(result); return normalizeResult(result);
}; }
function findNode(node: ts.Node, start: number, length: number): ts.Node|undefined { function findNode(node: ts.Node, start: number, length: number): ts.Node|undefined {
function find(node: ts.Node): ts.Node|undefined { function find(node: ts.Node): ts.Node|undefined {

View File

@ -384,7 +384,7 @@ export class AotCompiler {
const summaryJson = new GeneratedFile(srcFileName, summaryFileName(srcFileName), json); const summaryJson = new GeneratedFile(srcFileName, summaryFileName(srcFileName), json);
if (this.options.enableSummariesForJit) { if (this.options.enableSummariesForJit) {
return [summaryJson, this._codegenSourceModule(srcFileName, forJitOutputCtx)]; return [summaryJson, this._codegenSourceModule(srcFileName, forJitOutputCtx)];
}; }
return [summaryJson]; return [summaryJson];
} }

View File

@ -137,7 +137,7 @@ export class CloneVisitor implements Visitor {
// Visit all the nodes recursively // Visit all the nodes recursively
export class RecurseVisitor implements Visitor { export class RecurseVisitor implements Visitor {
visitText(text: Text, context?: any): any{}; visitText(text: Text, context?: any): any {}
visitContainer(container: Container, context?: any): any { visitContainer(container: Container, context?: any): any {
container.children.forEach(child => child.visit(this)); container.children.forEach(child => child.visit(this));
@ -151,7 +151,7 @@ export class RecurseVisitor implements Visitor {
ph.children.forEach(child => child.visit(this)); ph.children.forEach(child => child.visit(this));
} }
visitPlaceholder(ph: Placeholder, context?: any): any{}; visitPlaceholder(ph: Placeholder, context?: any): any {}
visitIcuPlaceholder(ph: IcuPlaceholder, context?: any): any{}; visitIcuPlaceholder(ph: IcuPlaceholder, context?: any): any {}
} }

View File

@ -62,7 +62,7 @@ export class Declaration implements Node {
} }
export class Doctype implements Node { export class Doctype implements Node {
constructor(public rootTag: string, public dtd: string){}; constructor(public rootTag: string, public dtd: string) {}
visit(visitor: IVisitor): any { return visitor.visitDoctype(this); } visit(visitor: IVisitor): any { return visitor.visitDoctype(this); }
} }
@ -83,7 +83,7 @@ export class Tag implements Node {
export class Text implements Node { export class Text implements Node {
value: string; value: string;
constructor(unescapedValue: string) { this.value = _escapeXml(unescapedValue); }; constructor(unescapedValue: string) { this.value = _escapeXml(unescapedValue); }
visit(visitor: IVisitor): any { return visitor.visitText(this); } visit(visitor: IVisitor): any { return visitor.visitText(this); }
} }

View File

@ -18,7 +18,7 @@ export class InterpolationConfig {
return new InterpolationConfig(markers[0], markers[1]); return new InterpolationConfig(markers[0], markers[1]);
} }
constructor(public start: string, public end: string){}; constructor(public start: string, public end: string) {}
} }
export const DEFAULT_INTERPOLATION_CONFIG: InterpolationConfig = export const DEFAULT_INTERPOLATION_CONFIG: InterpolationConfig =

View File

@ -482,7 +482,7 @@ class SafeSelector {
this.index++; this.index++;
return pseudo + replaceBy; return pseudo + replaceBy;
}); });
}; }
restore(content: string): string { restore(content: string): string {
return content.replace(/__ph-(\d+)__/g, (ph, index) => this.placeholders[+index]); return content.replace(/__ph-(\d+)__/g, (ph, index) => this.placeholders[+index]);

View File

@ -27,13 +27,13 @@ export abstract class SummaryResolver<T> {
export class JitSummaryResolver implements SummaryResolver<Type> { export class JitSummaryResolver implements SummaryResolver<Type> {
private _summaries = new Map<Type, Summary<Type>>(); private _summaries = new Map<Type, Summary<Type>>();
isLibraryFile(): boolean { return false; }; isLibraryFile(): boolean { return false; }
toSummaryFileName(fileName: string): string { return fileName; } toSummaryFileName(fileName: string): string { return fileName; }
fromSummaryFileName(fileName: string): string { return fileName; } fromSummaryFileName(fileName: string): string { return fileName; }
resolveSummary(reference: Type): Summary<Type>|null { resolveSummary(reference: Type): Summary<Type>|null {
return this._summaries.get(reference) || null; return this._summaries.get(reference) || null;
}; }
getSymbolsOf(): Type[] { return []; } getSymbolsOf(): Type[] { return []; }
getImportAs(reference: Type): Type { return reference; } getImportAs(reference: Type): Type { return reference; }
addSummary(summary: Summary<Type>) { this._summaries.set(summary.symbol, summary); }; addSummary(summary: Summary<Type>) { this._summaries.set(summary.symbol, summary); }
} }

View File

@ -381,10 +381,10 @@ export class MockSummaryResolver implements SummaryResolver<StaticSymbol> {
symbol: StaticSymbol, symbol: StaticSymbol,
importAs: StaticSymbol importAs: StaticSymbol
}[] = []) {} }[] = []) {}
addSummary(summary: Summary<StaticSymbol>) { this.summaries.push(summary); }; addSummary(summary: Summary<StaticSymbol>) { this.summaries.push(summary); }
resolveSummary(reference: StaticSymbol): Summary<StaticSymbol> { resolveSummary(reference: StaticSymbol): Summary<StaticSymbol> {
return this.summaries.find(summary => summary.symbol === reference); return this.summaries.find(summary => summary.symbol === reference);
}; }
getSymbolsOf(filePath: string): StaticSymbol[]|null { getSymbolsOf(filePath: string): StaticSymbol[]|null {
const symbols = this.summaries.filter(summary => summary.symbol.filePath === filePath) const symbols = this.summaries.filter(summary => summary.symbol.filePath === filePath)
.map(summary => summary.symbol); .map(summary => summary.symbol);

View File

@ -37,7 +37,7 @@ class _Humanizer implements html.Visitor {
result: any[] = []; result: any[] = [];
elDepth: number = 0; elDepth: number = 0;
constructor(private includeSourceSpan: boolean){}; constructor(private includeSourceSpan: boolean) {}
visitElement(element: html.Element, context: any): any { visitElement(element: html.Element, context: any): any {
const res = this._appendContext(element, [html.Element, element.name, this.elDepth++]); const res = this._appendContext(element, [html.Element, element.name, this.elDepth++]);

View File

@ -2197,7 +2197,7 @@ class TemplateHumanizer implements TemplateAstVisitor {
constructor( constructor(
private includeSourceSpan: boolean, private includeSourceSpan: boolean,
private interpolationConfig: InterpolationConfig = DEFAULT_INTERPOLATION_CONFIG){}; private interpolationConfig: InterpolationConfig = DEFAULT_INTERPOLATION_CONFIG) {}
visitNgContent(ast: NgContentAst, context: any): any { visitNgContent(ast: NgContentAst, context: any): any {
const res = [NgContentAst]; const res = [NgContentAst];

View File

@ -9,7 +9,9 @@
import {Injector} from '../di'; import {Injector} from '../di';
import {DebugContext} from '../view/index'; import {DebugContext} from '../view/index';
export class EventListener { constructor(public name: string, public callback: Function){}; } export class EventListener {
constructor(public name: string, public callback: Function) {}
}
/** /**
* @experimental All debugging apis are currently experimental. * @experimental All debugging apis are currently experimental.

View File

@ -167,7 +167,7 @@ class ViewContainerRef_ implements ViewContainerData {
return null; return null;
} }
get length(): number { return this._embeddedViews.length; }; get length(): number { return this._embeddedViews.length; }
createEmbeddedView<C>(templateRef: TemplateRef<C>, context?: C, index?: number): createEmbeddedView<C>(templateRef: TemplateRef<C>, context?: C, index?: number):
EmbeddedViewRef<C> { EmbeddedViewRef<C> {

View File

@ -43,7 +43,6 @@ export interface NgModuleDefinition extends Definition<NgModuleDefinitionFactory
} }
export interface NgModuleDefinitionFactory extends DefinitionFactory<NgModuleDefinition> {} export interface NgModuleDefinitionFactory extends DefinitionFactory<NgModuleDefinition> {}
;
export interface ViewDefinition extends Definition<ViewDefinitionFactory> { export interface ViewDefinition extends Definition<ViewDefinitionFactory> {
flags: ViewFlags; flags: ViewFlags;

View File

@ -2052,7 +2052,9 @@ export function main() {
exp2: any = false; exp2: any = false;
event1: AnimationEvent; event1: AnimationEvent;
event2: AnimationEvent; event2: AnimationEvent;
// tslint:disable:semicolon
callback1 = (event: any) => { this.event1 = event; }; callback1 = (event: any) => { this.event1 = event; };
// tslint:disable:semicolon
callback2 = (event: any) => { this.event2 = event; }; callback2 = (event: any) => { this.event2 = event; };
} }
@ -2161,7 +2163,7 @@ export function main() {
exp: any = false; exp: any = false;
@HostListener('@myAnimation2.start', ['$event']) @HostListener('@myAnimation2.start', ['$event'])
callback = (event: any) => { this.event = event; }; callback = (event: any) => { this.event = event; }
} }
TestBed.configureTestingModule({declarations: [Cmp]}); TestBed.configureTestingModule({declarations: [Cmp]});

View File

@ -13,7 +13,7 @@ export function main() {
it('should provide correct function.name ', () => { it('should provide correct function.name ', () => {
const functionWithoutName = identity(() => function(_: any /** TODO #9100 */) {}); const functionWithoutName = identity(() => function(_: any /** TODO #9100 */) {});
function foo(_: any /** TODO #9100 */){}; function foo(_: any /** TODO #9100 */) {}
expect((<any>functionWithoutName).name).toBeFalsy(); expect((<any>functionWithoutName).name).toBeFalsy();
expect((<any>foo).name).toEqual('foo'); expect((<any>foo).name).toEqual('foo');

View File

@ -1539,13 +1539,13 @@ class DirectiveLog {
@Pipe({name: 'countingPipe'}) @Pipe({name: 'countingPipe'})
class CountingPipe implements PipeTransform { class CountingPipe implements PipeTransform {
state: number = 0; state: number = 0;
transform(value: any) { return `${value} state:${this.state ++}`; } transform(value: any) { return `${value} state:${this.state++}`; }
} }
@Pipe({name: 'countingImpurePipe', pure: false}) @Pipe({name: 'countingImpurePipe', pure: false})
class CountingImpurePipe implements PipeTransform { class CountingImpurePipe implements PipeTransform {
state: number = 0; state: number = 0;
transform(value: any) { return `${value} state:${this.state ++}`; } transform(value: any) { return `${value} state:${this.state++}`; }
} }
@Pipe({name: 'pipeWithOnDestroy'}) @Pipe({name: 'pipeWithOnDestroy'})

View File

@ -53,4 +53,4 @@ export function main() {
}); });
})); }));
}); });
}; }

View File

@ -383,7 +383,7 @@ export function main() {
class ChildWithCtor extends Parent { class ChildWithCtor extends Parent {
static ctorParameters = static ctorParameters =
() => [{type: C, decorators: [{type: ParamDecorator, args: ['c']}]}, ]; () => [{type: C, decorators: [{type: ParamDecorator, args: ['c']}]}, ]
constructor() { super(); } constructor() { super(); }
} }

View File

@ -275,7 +275,7 @@ export function main() {
class AComp {} class AComp {}
class ChildProvider { class ChildProvider {
ngOnDestroy() { log.push('ngOnDestroy'); }; ngOnDestroy() { log.push('ngOnDestroy'); }
} }
const {view, rootNodes} = createAndGetRootNodes(compViewDef([ const {view, rootNodes} = createAndGetRootNodes(compViewDef([

View File

@ -171,7 +171,7 @@ export function main() {
const log: string[] = []; const log: string[] = [];
class ChildProvider { class ChildProvider {
ngOnDestroy() { log.push('ngOnDestroy'); }; ngOnDestroy() { log.push('ngOnDestroy'); }
} }
const {view: parentView} = createAndGetRootNodes(compViewDef([ const {view: parentView} = createAndGetRootNodes(compViewDef([

View File

@ -37,7 +37,7 @@ export class TestingCompiler extends Compiler {
* Allows to pass the compile summary from AOT compilation to the JIT compiler, * Allows to pass the compile summary from AOT compilation to the JIT compiler,
* so that it can use the code generated by AOT. * so that it can use the code generated by AOT.
*/ */
loadAotSummaries(summaries: () => any[]) { throw unimplemented(); }; loadAotSummaries(summaries: () => any[]) { throw unimplemented(); }
/** /**
* Gets the component factory for the given component. * Gets the component factory for the given component.

View File

@ -6,7 +6,7 @@
* found in the LICENSE file at https://angular.io/license * found in the LICENSE file at https://angular.io/license
*/ */
import {browser, by, element, protractor} from 'protractor'; import {$, browser, by, element, protractor} from 'protractor';
import {verifyNoBrowserErrors} from '../../../../_common/e2e_util'; import {verifyNoBrowserErrors} from '../../../../_common/e2e_util';

View File

@ -8,7 +8,7 @@
import {Attribute, Component, Directive, Pipe} from '@angular/core'; import {Attribute, Component, Directive, Pipe} from '@angular/core';
class CustomDirective {}; class CustomDirective {}
// #docregion component // #docregion component
@Component({selector: 'greet', template: 'Hello {{name}}!'}) @Component({selector: 'greet', template: 'Hello {{name}}!'})

View File

@ -1137,7 +1137,7 @@ class FormControlSelectNgValue {
}) })
class FormControlSelectWithCompareFn { class FormControlSelectWithCompareFn {
compareFn: compareFn:
(o1: any, o2: any) => boolean = (o1: any, o2: any) => o1 && o2? o1.id === o2.id: o1 === o2; (o1: any, o2: any) => boolean = (o1: any, o2: any) => o1 && o2? o1.id === o2.id: o1 === o2
cities = [{id: 1, name: 'SF'}, {id: 2, name: 'NY'}]; cities = [{id: 1, name: 'SF'}, {id: 2, name: 'NY'}];
form = new FormGroup({city: new FormControl({id: 1, name: 'SF'})}); form = new FormGroup({city: new FormControl({id: 1, name: 'SF'})});
} }
@ -1181,7 +1181,7 @@ class FormControlSelectMultipleNgValue {
}) })
class FormControlSelectMultipleWithCompareFn { class FormControlSelectMultipleWithCompareFn {
compareFn: compareFn:
(o1: any, o2: any) => boolean = (o1: any, o2: any) => o1 && o2? o1.id === o2.id: o1 === o2; (o1: any, o2: any) => boolean = (o1: any, o2: any) => o1 && o2? o1.id === o2.id: o1 === o2
cities = [{id: 1, name: 'SF'}, {id: 2, name: 'NY'}]; cities = [{id: 1, name: 'SF'}, {id: 2, name: 'NY'}];
form = new FormGroup({city: new FormControl([{id: 1, name: 'SF'}])}); form = new FormGroup({city: new FormControl([{id: 1, name: 'SF'}])});
} }
@ -1224,7 +1224,7 @@ class NgModelSelectWithNullForm {
}) })
class NgModelSelectWithCustomCompareFnForm { class NgModelSelectWithCustomCompareFnForm {
compareFn: compareFn:
(o1: any, o2: any) => boolean = (o1: any, o2: any) => o1 && o2? o1.id === o2.id: o1 === o2; (o1: any, o2: any) => boolean = (o1: any, o2: any) => o1 && o2? o1.id === o2.id: o1 === o2
selectedCity: any = {}; selectedCity: any = {};
cities: any[] = []; cities: any[] = [];
} }
@ -1240,7 +1240,7 @@ class NgModelSelectWithCustomCompareFnForm {
}) })
class NgModelSelectMultipleWithCustomCompareFnForm { class NgModelSelectMultipleWithCustomCompareFnForm {
compareFn: compareFn:
(o1: any, o2: any) => boolean = (o1: any, o2: any) => o1 && o2? o1.id === o2.id: o1 === o2; (o1: any, o2: any) => boolean = (o1: any, o2: any) => o1 && o2? o1.id === o2.id: o1 === o2
selectedCities: any[] = []; selectedCities: any[] = [];
cities: any[] = []; cities: any[] = [];
} }

View File

@ -78,4 +78,4 @@ export default {
}, },
banner: banner, banner: banner,
plugins: [{resolveId: resolve}, commonjs(), sourcemaps()] plugins: [{resolveId: resolve}, commonjs(), sourcemaps()]
} };

View File

@ -14,7 +14,7 @@ import {BrowserTestingModule} from '@angular/platform-browser/testing';
import {DOMTestComponentRenderer} from './dom_test_component_renderer'; import {DOMTestComponentRenderer} from './dom_test_component_renderer';
import {platformCoreDynamicTesting} from './platform_core_dynamic_testing'; import {platformCoreDynamicTesting} from './platform_core_dynamic_testing';
export * from './private_export_testing' export * from './private_export_testing';
/** /**
* @stable * @stable

View File

@ -47,8 +47,8 @@ export abstract class DomAdapter {
* Maps attribute names to their corresponding property names for cases * Maps attribute names to their corresponding property names for cases
* where attribute name doesn't match property name. * where attribute name doesn't match property name.
*/ */
get attrToPropMap(): {[key: string]: string} { return this._attrToPropMap; }; get attrToPropMap(): {[key: string]: string} { return this._attrToPropMap; }
set attrToPropMap(value: {[key: string]: string}) { this._attrToPropMap = value; }; set attrToPropMap(value: {[key: string]: string}) { this._attrToPropMap = value; }
/** @internal */ /** @internal */
_attrToPropMap: {[key: string]: string}; _attrToPropMap: {[key: string]: string};

View File

@ -65,7 +65,7 @@ export class DomRendererFactory2 implements RendererFactory2 {
constructor(private eventManager: EventManager, private sharedStylesHost: DomSharedStylesHost) { constructor(private eventManager: EventManager, private sharedStylesHost: DomSharedStylesHost) {
this.defaultRenderer = new DefaultDomRenderer2(eventManager); this.defaultRenderer = new DefaultDomRenderer2(eventManager);
}; }
createRenderer(element: any, type: RendererType2|null): Renderer2 { createRenderer(element: any, type: RendererType2|null): Renderer2 {
if (!element || !type) { if (!element || !type) {

View File

@ -75,5 +75,5 @@ export abstract class EventManagerPlugin {
throw new Error(`Unsupported event target ${target} for event ${eventName}`); throw new Error(`Unsupported event target ${target} for event ${eventName}`);
} }
return this.addEventListener(target, eventName, handler); return this.addEventListener(target, eventName, handler);
}; }
} }

View File

@ -39,8 +39,10 @@ export class DominoAdapter extends BrowserDomAdapter {
logError(error: string) { console.error(error); } logError(error: string) { console.error(error); }
log(error: string) {
// tslint:disable-next-line:no-console // tslint:disable-next-line:no-console
log(error: string) { console.log(error); } console.log(error);
}
logGroup(error: string) { console.error(error); } logGroup(error: string) { console.error(error); }

View File

@ -22,7 +22,7 @@ export class ServerRendererFactory2 implements RendererFactory2 {
private ngZone: NgZone, @Inject(DOCUMENT) private document: any, private ngZone: NgZone, @Inject(DOCUMENT) private document: any,
private sharedStylesHost: SharedStylesHost) { private sharedStylesHost: SharedStylesHost) {
this.defaultRenderer = new DefaultServerRenderer2(document, ngZone, this.schema); this.defaultRenderer = new DefaultServerRenderer2(document, ngZone, this.schema);
}; }
createRenderer(element: any, type: RendererType2|null): Renderer2 { createRenderer(element: any, type: RendererType2|null): Renderer2 {
if (!element || !type) { if (!element || !type) {

View File

@ -25,8 +25,10 @@ export class WorkerDomAdapter extends DomAdapter {
} }
} }
log(error: any) {
// tslint:disable-next-line:no-console // tslint:disable-next-line:no-console
log(error: any) { console.log(error); } console.log(error);
}
logGroup(error: any) { logGroup(error: any) {
if (console.group) { if (console.group) {

View File

@ -25,4 +25,4 @@ export {UrlHandlingStrategy} from './url_handling_strategy';
export {DefaultUrlSerializer, UrlSegment, UrlSegmentGroup, UrlSerializer, UrlTree} from './url_tree'; export {DefaultUrlSerializer, UrlSegment, UrlSegmentGroup, UrlSerializer, UrlTree} from './url_tree';
export {VERSION} from './version'; export {VERSION} from './version';
export * from './private_export' export * from './private_export';

View File

@ -84,7 +84,7 @@ export class RouterPreloader implements OnDestroy {
const onEndLoad = (r: Route) => router.triggerEvent(new RouteConfigLoadEnd(r)); const onEndLoad = (r: Route) => router.triggerEvent(new RouteConfigLoadEnd(r));
this.loader = new RouterConfigLoader(moduleLoader, compiler, onStartLoad, onEndLoad); this.loader = new RouterConfigLoader(moduleLoader, compiler, onStartLoad, onEndLoad);
}; }
setUpPreloading(): void { setUpPreloading(): void {
const navigations$ = filter.call(this.router.events, (e: Event) => e instanceof NavigationEnd); const navigations$ = filter.call(this.router.events, (e: Event) => e instanceof NavigationEnd);

View File

@ -25,7 +25,7 @@ export function provideTokenLogger(token: string, returnValue = true) {
useFactory: (logger: Logger) => () => (logger.add(token), returnValue), useFactory: (logger: Logger) => () => (logger.add(token), returnValue),
deps: [Logger] deps: [Logger]
}; };
}; }
export declare type ARSArgs = { export declare type ARSArgs = {
url?: UrlSegment[], url?: UrlSegment[],

View File

@ -61,7 +61,7 @@ export class UpgradeNg1ComponentAdapterBuilder {
} }
ngOnDestroy() { /* needs to be here for ng2 to properly detect it */ ngOnDestroy() { /* needs to be here for ng2 to properly detect it */
} }
}; }
this.type = MyClass; this.type = MyClass;
} }

View File

@ -85,25 +85,25 @@ export function main() {
let element: angular.IAugmentedJQuery; let element: angular.IAugmentedJQuery;
class mockScope implements angular.IScope { class mockScope implements angular.IScope {
$new() { return this; }; $new() { return this; }
$watch(exp: angular.Ng1Expression, fn?: (a1?: any, a2?: any) => void) { $watch(exp: angular.Ng1Expression, fn?: (a1?: any, a2?: any) => void) {
return () => {}; return () => {};
}; }
$on(event: string, fn?: (event?: any, ...args: any[]) => void) { $on(event: string, fn?: (event?: any, ...args: any[]) => void) {
return () => {}; return () => {};
}; }
$destroy() { $destroy() {
return () => {}; return () => {};
}; }
$apply(exp?: angular.Ng1Expression) { $apply(exp?: angular.Ng1Expression) {
return () => {}; return () => {};
}; }
$digest() { $digest() {
return () => {}; return () => {};
}; }
$evalAsync(exp: angular.Ng1Expression, locals?: any) { $evalAsync(exp: angular.Ng1Expression, locals?: any) {
return () => {}; return () => {};
}; }
$$childTail: angular.IScope; $$childTail: angular.IScope;
$$childHead: angular.IScope; $$childHead: angular.IScope;
$$nextSibling: angular.IScope; $$nextSibling: angular.IScope;
@ -155,7 +155,7 @@ export function main() {
return new DowngradeComponentAdapter( return new DowngradeComponentAdapter(
element, attrs, scope, ngModel, parentInjector, $injector, $compile, $parse, element, attrs, scope, ngModel, parentInjector, $injector, $compile, $parse,
componentFactory, wrapCallback); componentFactory, wrapCallback);
}; }
beforeEach((inject([Compiler], (inject_compiler: Compiler) => { beforeEach((inject([Compiler], (inject_compiler: Compiler) => {
compiler = inject_compiler; compiler = inject_compiler;
@ -190,4 +190,4 @@ export function main() {
}); });
}); });
}; }

View File

@ -597,7 +597,7 @@ export function main() {
@Component({selector: 'ng2', template: 'test'}) @Component({selector: 'ng2', template: 'test'})
class Ng2 { class Ng2 {
}; }
@NgModule({ @NgModule({
declarations: [Ng2], declarations: [Ng2],
@ -2746,7 +2746,7 @@ export function main() {
it('should export ng1 instance to ng2', async(() => { it('should export ng1 instance to ng2', async(() => {
@NgModule({imports: [BrowserModule]}) @NgModule({imports: [BrowserModule]})
class MyNg2Module { class MyNg2Module {
}; }
const adapter: UpgradeAdapter = new UpgradeAdapter(MyNg2Module); const adapter: UpgradeAdapter = new UpgradeAdapter(MyNg2Module);
const module = angular.module('myExample', []); const module = angular.module('myExample', []);

View File

@ -105,7 +105,7 @@ export function main() {
default: default:
throw new Error('Called too many times! ' + JSON.stringify(changes)); throw new Error('Called too many times! ' + JSON.stringify(changes));
} }
}; }
} }
ng1Module.directive('ng2', downgradeComponent({ ng1Module.directive('ng2', downgradeComponent({
@ -576,7 +576,7 @@ export function main() {
@Component({template: ''}) @Component({template: ''})
class LazyLoadedComponent { class LazyLoadedComponent {
constructor(public module: NgModuleRef<any>){}; constructor(public module: NgModuleRef<any>) {}
} }
@NgModule({ @NgModule({

View File

@ -1 +1,9 @@
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
System.import('index').catch(console.error.bind(console)); System.import('index').catch(console.error.bind(console));

View File

@ -34,7 +34,7 @@ function watch(globs, opts, tasks) {
} catch (e) { } catch (e) {
return tasksDone(e); return tasksDone(e);
} }
} };
} }
var events = opts.events = opts.events || ['add', 'change', 'unlink']; var events = opts.events = opts.events || ['add', 'change', 'unlink'];
@ -51,8 +51,7 @@ function watch(globs, opts, tasks) {
var watcher = var watcher =
chokidar.watch(globs, opts).on('all', handleEvent).on('error', function(err) { throw err; }); chokidar.watch(globs, opts).on('all', handleEvent).on('error', function(err) { throw err; });
var log = var log = function watchLogger(triggerCount) {
function watchLogger(triggerCount) {
// Don't report change for initial event // Don't report change for initial event
if (!ignoreInitial && !--triggerCount) return; if (!ignoreInitial && !--triggerCount) return;
@ -68,10 +67,10 @@ function watch(globs, opts, tasks) {
var now = new Date(); var now = new Date();
return now.toLocaleDateString() + ' at ' + now.toLocaleTimeString(); return now.toLocaleDateString() + ' at ' + now.toLocaleTimeString();
} }
} };
if (opts.log !== undefined && !opts.log) { if (opts.log !== undefined && !opts.log) {
log = function noopLog(triggerCount) {} log = function noopLog(triggerCount) {};
} }
var close = watcher.close.bind(watcher); var close = watcher.close.bind(watcher);
@ -116,6 +115,7 @@ function watch(globs, opts, tasks) {
timeoutId = null; timeoutId = null;
} }
if (!useRunSequence && err) { if (!useRunSequence && err) {
// tslint:disable-next-line:no-console
console.log('Watch task error:', err.toString()); console.log('Watch task error:', err.toString());
} }
} }

View File

@ -84,8 +84,7 @@ function checkEnvironment(reqs) {
} else if (!semver.satisfies(foundYarnVersion, reqs.requiredYarnVersion)) { } else if (!semver.satisfies(foundYarnVersion, reqs.requiredYarnVersion)) {
issues.push( issues.push(
'You are running an unsupported yarn version. Found: ' + foundYarnVersion + 'You are running an unsupported yarn version. Found: ' + foundYarnVersion +
' Expected: ' + reqs.requiredYarnVersion + ' Expected: ' + reqs.requiredYarnVersion + '. This is required because we use yarn to ' +
'. This is required because we use yarn to ' +
'ensure that we all use the exact same npm dependencies. Installation instructions: ' + 'ensure that we all use the exact same npm dependencies. Installation instructions: ' +
'https://yarnpkg.com/lang/en/docs/install/'); 'https://yarnpkg.com/lang/en/docs/install/');
} }

View File

@ -1,3 +1,10 @@
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
module.exports = { module.exports = {
// build everything and generate bundles // build everything and generate bundles

View File

@ -1,3 +1,11 @@
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
module.exports = (gulp) => () => { module.exports = (gulp) => () => {
const conventionalChangelog = require('gulp-conventional-changelog'); const conventionalChangelog = require('gulp-conventional-changelog');
return gulp.src('CHANGELOG.md') return gulp.src('CHANGELOG.md')

View File

@ -1,3 +1,12 @@
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
// tslint:disable:no-console
module.exports = (gulp) => (done) => { module.exports = (gulp) => (done) => {
const madge = require('madge'); const madge = require('madge');

View File

@ -29,6 +29,7 @@ module.exports = {
closure: gulp => done => { closure: gulp => done => {
const {RELATIVE_I18N_DATA_FOLDER} = require('./cldr/extract'); const {RELATIVE_I18N_DATA_FOLDER} = require('./cldr/extract');
// tslint:disable-next-line:no-console
console.log(RELATIVE_I18N_DATA_FOLDER, fs.existsSync(RELATIVE_I18N_DATA_FOLDER)); console.log(RELATIVE_I18N_DATA_FOLDER, fs.existsSync(RELATIVE_I18N_DATA_FOLDER));
if (!fs.existsSync(RELATIVE_I18N_DATA_FOLDER)) { if (!fs.existsSync(RELATIVE_I18N_DATA_FOLDER)) {
throw new Error( throw new Error(

View File

@ -1,3 +1,5 @@
// tslint:disable:file-header
/** /**
* Npm module for Unicode CLDR JSON data * Npm module for Unicode CLDR JSON data
* *

View File

@ -11,6 +11,7 @@ const yargs = require('yargs').argv;
const {I18N_DATA_FOLDER, RELATIVE_I18N_DATA_FOLDER, HEADER} = require('./extract'); const {I18N_DATA_FOLDER, RELATIVE_I18N_DATA_FOLDER, HEADER} = require('./extract');
const OUTPUT_NAME = `closure-locale.ts`; const OUTPUT_NAME = `closure-locale.ts`;
// tslint:disable:no-console
module.exports = (gulp, done) => { module.exports = (gulp, done) => {
// the locales used by closure that will be used to generate the closure-locale file // the locales used by closure that will be used to generate the closure-locale file
// extracted from: // extracted from:

View File

@ -36,6 +36,7 @@ const HEADER = `/**
// See angular/tools/gulp-tasks/cldr/extract.js // See angular/tools/gulp-tasks/cldr/extract.js
`; `;
// tslint:disable:no-console
module.exports = (gulp, done) => { module.exports = (gulp, done) => {
const cldrData = require('./cldr-data'); const cldrData = require('./cldr-data');
const LOCALES = cldrData.availableLocales; const LOCALES = cldrData.availableLocales;
@ -292,7 +293,7 @@ function getDateTimeFormats(localeData) {
data.medium._value || data.medium, data.medium._value || data.medium,
data.long._value || data.long, data.long._value || data.long,
data.full._value || data.full data.full._value || data.full
]) ]);
} }
const dateFormats = localeData.main('dates/calendars/gregorian/dateFormats'); const dateFormats = localeData.main('dates/calendars/gregorian/dateFormats');
@ -318,9 +319,9 @@ function getDayPeriodRules(localeData) {
if (dayPeriodRules[key]._at) { if (dayPeriodRules[key]._at) {
rules[key] = dayPeriodRules[key]._at; rules[key] = dayPeriodRules[key]._at;
} else { } else {
rules[key] = [dayPeriodRules[key]._from, dayPeriodRules[key]._before] rules[key] = [dayPeriodRules[key]._from, dayPeriodRules[key]._before];
} }
}) });
} }
return rules; return rules;
@ -417,7 +418,7 @@ function getCurrencySettings(locale, localeData) {
if (currency[key]._from && !currency[key]._to) { if (currency[key]._from && !currency[key]._to) {
return currentCurrency = key; return currentCurrency = key;
} }
}) });
}); });
if (!currentCurrency) { if (!currentCurrency) {
@ -483,7 +484,7 @@ function objectValues(obj) {
* Like JSON.stringify, but without double quotes around keys, and already formatted for readability * Like JSON.stringify, but without double quotes around keys, and already formatted for readability
*/ */
function stringify(obj) { function stringify(obj) {
return util.inspect(obj, {depth: null, maxArrayLength: null}) return util.inspect(obj, {depth: null, maxArrayLength: null});
} }
/** /**

View File

@ -1,29 +1,45 @@
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
// Check the coding standards and programming errors // Check the coding standards and programming errors
module.exports = (gulp) => () => { module.exports = (gulp) => () => {
const tslint = require('gulp-tslint'); const tslint = require('gulp-tslint');
// Built-in rules are at // Built-in rules are at https://palantir.github.io/tslint/rules/
// https://palantir.github.io/tslint/rules/ const path = require('path');
const tslintConfig = require('../../tslint.json');
return gulp return gulp
.src([ .src([
// todo(vicb): add .js files when supported // todo(vicb): add .js files when supported
// see https://github.com/palantir/tslint/pull/1515 // see https://github.com/palantir/tslint/pull/1515
'./modules/**/*.ts', './modules/**/*.ts',
'./modules/**/*.js',
'./packages/**/*.ts', './packages/**/*.ts',
'./packages/**/*.js',
'./tools/**/*.ts', './tools/**/*.ts',
'./tools/**/*.js',
'./*.ts', './*.ts',
// Ignore node_modules directories // Ignore node_modules directories
'!**/node_modules/**', '!**/node_modules/**',
// Ignore built files directories
'!**/built/**',
'!**/dist/**',
// Ignore special files
'!**/*.externs.js',
// Ignore generated files due to lack of copyright header // Ignore generated files due to lack of copyright header
// todo(alfaproject): make generated files lintable // todo(alfaproject): make generated files lintable
'!**/*.d.ts', '!**/*.d.ts',
'!**/*.ngfactory.ts', '!**/*.ngfactory.ts',
]) ])
.pipe(tslint({ .pipe(tslint({
tslint: require('tslint').default, configuration: path.resolve(__dirname, '../../tslint.json'),
configuration: tslintConfig,
formatter: 'prose', formatter: 'prose',
})) }))
.pipe(tslint.report({emitError: true})); .pipe(tslint.report({emitError: true}));

View File

@ -1,3 +1,10 @@
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
// returns the script path for the current platform // returns the script path for the current platform
module.exports = function platformScriptPath(path) { module.exports = function platformScriptPath(path) {

View File

@ -1,3 +1,11 @@
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
const entrypoints = [ const entrypoints = [
'dist/packages-dist/core/core.d.ts', 'dist/packages-dist/core/testing.d.ts', 'dist/packages-dist/core/core.d.ts', 'dist/packages-dist/core/testing.d.ts',
'dist/packages-dist/common/common.d.ts', 'dist/packages-dist/common/testing.d.ts', 'dist/packages-dist/common/common.d.ts', 'dist/packages-dist/common/testing.d.ts',

View File

@ -1,3 +1,11 @@
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
module.exports = { module.exports = {
// Serve the built files // Serve the built files

View File

@ -1,3 +1,11 @@
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
const fs = require('fs'); const fs = require('fs');
const path = require('path'); const path = require('path');
const sourceMapTest = require('../source-map-test'); const sourceMapTest = require('../source-map-test');
@ -16,6 +24,7 @@ module.exports = (gulp) => () => {
}); });
if (!packages.length) { if (!packages.length) {
// tslint:disable-next-line:no-console
console.log('No packages found in packages-dist. Unable to run source map test.'); console.log('No packages found in packages-dist. Unable to run source map test.');
process.exit(1); process.exit(1);
} }

View File

@ -1,3 +1,11 @@
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
function tsc(projectPath, done) { function tsc(projectPath, done) {
const path = require('path'); const path = require('path');
const platformScriptPath = require('./platform-script-path'); const platformScriptPath = require('./platform-script-path');

View File

@ -1,3 +1,12 @@
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
// tslint:disable:no-console
module.exports = (gulp) => () => { module.exports = (gulp) => () => {
const validateCommitMessage = require('../validate-commit-message'); const validateCommitMessage = require('../validate-commit-message');
const childProcess = require('child_process'); const childProcess = require('child_process');

View File

@ -11,7 +11,7 @@ var DotsReporter = require('karma/lib/reporters/dots_color');
var createErrorFormatter = function(basePath, emitter, SourceMapConsumer) { var createErrorFormatter = function(basePath, emitter, SourceMapConsumer) {
var lastServedFiles = []; var lastServedFiles = [];
emitter.on('file_list_modified', function(files) { lastServedFiles = files.served }); emitter.on('file_list_modified', function(files) { lastServedFiles = files.served; });
function findFile(path) { return lastServedFiles.filter(_ => _.path === path)[0]; } function findFile(path) { return lastServedFiles.filter(_ => _.path === path)[0]; }
var URL_REGEXP = new RegExp( var URL_REGEXP = new RegExp(
@ -48,16 +48,16 @@ var createErrorFormatter = function(basePath, emitter, SourceMapConsumer) {
// indent every line // indent every line
if (indentation) { if (indentation) {
msg = indentation + msg.replace(/\n/g, '\n' + indentation) msg = indentation + msg.replace(/\n/g, '\n' + indentation);
} }
return msg + '\n'; return msg + '\n';
} };
}; };
var InternalAngularReporter = function(config, emitter) { var InternalAngularReporter = function(config, emitter) {
var formatter = createErrorFormatter(config.basePath, emitter, SourceMapConsumer); var formatter = createErrorFormatter(config.basePath, emitter, SourceMapConsumer);
DotsReporter.call(this, formatter, false, config.colors) DotsReporter.call(this, formatter, false, config.colors);
}; };
InternalAngularReporter.$inject = ['config', 'emitter']; InternalAngularReporter.$inject = ['config', 'emitter'];

View File

@ -14,7 +14,7 @@ var childProcess = require('child_process');
var PROJECT_ROOT = path.join(__dirname, '../../'); var PROJECT_ROOT = path.join(__dirname, '../../');
// tslint:disable:no-console
function checkNodeModules(logOutput, purgeIfStale) { function checkNodeModules(logOutput, purgeIfStale) {
var yarnCheck = childProcess.spawnSync( var yarnCheck = childProcess.spawnSync(
'./node_modules/.bin/yarn check --integrity', './node_modules/.bin/yarn check --integrity',

View File

@ -1,5 +1,13 @@
#!/usr/bin/env node #!/usr/bin/env node
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
const path = require('path'); const path = require('path');
const getMappings = require('./parseMap'); const getMappings = require('./parseMap');
@ -18,6 +26,7 @@ const STRIP_PREFIX_REGEX = /ɵ/g;
const STRIP_SUFFIX_REGEX = /([^$]+)(\$)+\d/g; const STRIP_SUFFIX_REGEX = /([^$]+)(\$)+\d/g;
const SYNTHETIC_REGEX = /ɵ[0-9]/; const SYNTHETIC_REGEX = /ɵ[0-9]/;
// tslint:disable:no-console
module.exports = function sourceMapTest(package) { module.exports = function sourceMapTest(package) {
const mappings = const mappings =
getMappings(getBundlePath(package)).filter(mapping => shouldCheckMapping(mapping.sourceText)); getMappings(getBundlePath(package)).filter(mapping => shouldCheckMapping(mapping.sourceText));
@ -27,7 +36,7 @@ module.exports = function sourceMapTest(package) {
const failures = mappings.filter(mapping => { const failures = mappings.filter(mapping => {
if (SYNTHETIC_REGEX.test(mapping.sourceText)) return false; if (SYNTHETIC_REGEX.test(mapping.sourceText)) return false;
if (cleanSource(mapping.sourceText) !== cleanGen(mapping.genText)) { if (cleanSource(mapping.sourceText) !== cleanGen(mapping.genText)) {
console.log('source:', cleanSource(mapping.sourceText), 'gen:', cleanGen(mapping.genText)) console.log('source:', cleanSource(mapping.sourceText), 'gen:', cleanGen(mapping.genText));
} }
return cleanSource(mapping.sourceText) !== cleanGen(mapping.genText); return cleanSource(mapping.sourceText) !== cleanGen(mapping.genText);
}); });
@ -58,6 +67,7 @@ function cleanGen(gen) {
.replace(AFTER_EQUALS_REGEX, '$1='); .replace(AFTER_EQUALS_REGEX, '$1=');
} }
// tslint:disable:no-console
function logResults(failures) { function logResults(failures) {
if (failures.length) { if (failures.length) {
console.error(`... and source maps appear to be broken: ${failures.length} failures.`); console.error(`... and source maps appear to be broken: ${failures.length} failures.`);

View File

@ -1,11 +1,18 @@
#!/usr/bin/env node #!/usr/bin/env node
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
const vlq = require('vlq'); const vlq = require('vlq');
const fs = require('fs'); const fs = require('fs');
const path = require('path'); const path = require('path');
module.exports = module.exports = function getMappings(bundlePath) {
function getMappings(bundlePath) {
const sourceMap = JSON.parse(getFile(`${bundlePath}.map`)); const sourceMap = JSON.parse(getFile(`${bundlePath}.map`));
const sourcesContent = sourceMap.sourcesContent.map(file => file.split('\n')); const sourcesContent = sourceMap.sourcesContent.map(file => file.split('\n'));
const bundleLines = getFile(bundlePath).split('\n'); const bundleLines = getFile(bundlePath).split('\n');
@ -45,7 +52,7 @@ module.exports =
return matchData; return matchData;
}, []); }, []);
} };
function getFile(filePath) { function getFile(filePath) {
return fs.readFileSync(path.resolve(process.cwd(), filePath), 'UTF-8'); return fs.readFileSync(path.resolve(process.cwd(), filePath), 'UTF-8');

View File

@ -6,12 +6,13 @@
* found in the LICENSE file at https://angular.io/license * found in the LICENSE file at https://angular.io/license
*/ */
// tslint:disable:no-console
module.exports = function travisFoldStart(name) { module.exports = function travisFoldStart(name) {
if (process.env.TRAVIS) console.log('travis_fold:start:' + encode(name)); if (process.env.TRAVIS) console.log('travis_fold:start:' + encode(name));
return function travisFoldEnd() { return function travisFoldEnd() {
if (process.env.TRAVIS) console.log('travis_fold:end:' + encode(name)); if (process.env.TRAVIS) console.log('travis_fold:end:' + encode(name));
} };
}; };

View File

@ -1,4 +1,10 @@
'use strict'; /**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
describe('validate-commit-message.js', function() { describe('validate-commit-message.js', function() {
var validateMessage = require('./validate-commit-message'); var validateMessage = require('./validate-commit-message');

View File

@ -15,5 +15,16 @@
"semicolon": [true], "semicolon": [true],
"variable-name": [true, "ban-keywords"], "variable-name": [true, "ban-keywords"],
"no-inner-declarations": [true, "function"] "no-inner-declarations": [true, "function"]
},
"jsRules": {
"file-header": [true, "Copyright Google Inc\\."],
"no-console": [true, "log"],
"no-duplicate-imports": true,
"no-duplicate-variable": true,
"no-jasmine-focus": true,
"require-internal-with-underscore": true,
"semicolon": [true],
"variable-name": [true, "ban-keywords"],
"no-inner-declarations": [true, "function"]
} }
} }

2067
yarn.lock

File diff suppressed because it is too large Load Diff