refactor: add license header to JS files & format files (#12035)

This commit is contained in:
Victor Berchet 2016-10-04 13:15:49 -07:00 committed by Chuck Jazdzewski
parent b64b5ece65
commit 8310c91823
73 changed files with 1174 additions and 948 deletions

View File

@ -1,242 +1,98 @@
// Unique place to configure the browsers which are used in the different CI jobs in Sauce Labs (SL) and BrowserStack (BS). /**
* @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
*/
// Unique place to configure the browsers which are used in the different CI jobs in Sauce Labs (SL)
// and BrowserStack (BS).
// If the target is set to null, then the browser is not run anywhere during CI. // If the target is set to null, then the browser is not run anywhere during CI.
// If a category becomes empty (e.g. BS and required), then the corresponding job must be commented out in Travis configuration. // If a category becomes empty (e.g. BS and required), then the corresponding job must be commented
// out in Travis configuration.
var CIconfiguration = { var CIconfiguration = {
'Chrome': { unitTest: {target: 'SL', required: true}, e2e: {target: null, required: true}}, 'Chrome': {unitTest: {target: 'SL', required: true}, e2e: {target: null, required: true}},
'Firefox': { unitTest: {target: 'SL', required: true}, e2e: {target: null, required: true}}, 'Firefox': {unitTest: {target: 'SL', required: true}, e2e: {target: null, required: true}},
// FirefoxBeta and ChromeBeta should be target:'BS' or target:'SL', and required:true // FirefoxBeta and ChromeBeta should be target:'BS' or target:'SL', and required:true
// Currently deactivated due to https://github.com/angular/angular/issues/7560 // Currently deactivated due to https://github.com/angular/angular/issues/7560
'ChromeBeta': { unitTest: {target: null, required: true}, e2e: {target: null, required: false}}, 'ChromeBeta': {unitTest: {target: null, required: true}, e2e: {target: null, required: false}},
'FirefoxBeta': { unitTest: {target: null, required: false}, e2e: {target: null, required: false}}, 'FirefoxBeta': {unitTest: {target: null, required: false}, e2e: {target: null, required: false}},
'ChromeDev': { unitTest: {target: null, required: true}, e2e: {target: null, required: true}}, 'ChromeDev': {unitTest: {target: null, required: true}, e2e: {target: null, required: true}},
'FirefoxDev': { unitTest: {target: null, required: true}, e2e: {target: null, required: true}}, 'FirefoxDev': {unitTest: {target: null, required: true}, e2e: {target: null, required: true}},
'IE9': { unitTest: {target: 'SL', required: false}, e2e: {target: null, required: true}}, 'IE9': {unitTest: {target: 'SL', required: false}, e2e: {target: null, required: true}},
'IE10': { unitTest: {target: 'SL', required: true}, e2e: {target: null, required: true}}, 'IE10': {unitTest: {target: 'SL', required: true}, e2e: {target: null, required: true}},
'IE11': { unitTest: {target: 'SL', required: true}, e2e: {target: null, required: true}}, 'IE11': {unitTest: {target: 'SL', required: true}, e2e: {target: null, required: true}},
'Edge': { unitTest: {target: 'BS', required: false}, e2e: {target: null, required: true}}, 'Edge': {unitTest: {target: 'BS', required: false}, e2e: {target: null, required: true}},
'Android4.1': { unitTest: {target: 'SL', required: false}, e2e: {target: null, required: true}}, 'Android4.1': {unitTest: {target: 'SL', required: false}, e2e: {target: null, required: true}},
'Android4.2': { unitTest: {target: 'SL', required: false}, e2e: {target: null, required: true}}, 'Android4.2': {unitTest: {target: 'SL', required: false}, e2e: {target: null, required: true}},
'Android4.3': { unitTest: {target: 'SL', required: false}, e2e: {target: null, required: true}}, 'Android4.3': {unitTest: {target: 'SL', required: false}, e2e: {target: null, required: true}},
'Android4.4': { unitTest: {target: 'SL', required: false}, e2e: {target: null, required: true}}, 'Android4.4': {unitTest: {target: 'SL', required: false}, e2e: {target: null, required: true}},
'Android5': { unitTest: {target: 'SL', required: false}, e2e: {target: null, required: true}}, 'Android5': {unitTest: {target: 'SL', required: false}, e2e: {target: null, required: true}},
'Safari7': { unitTest: {target: 'BS', required: false}, e2e: {target: null, required: true}}, 'Safari7': {unitTest: {target: 'BS', required: false}, e2e: {target: null, required: true}},
'Safari8': { unitTest: {target: 'BS', required: false}, e2e: {target: null, required: true}}, 'Safari8': {unitTest: {target: 'BS', required: false}, e2e: {target: null, required: true}},
'Safari9': { unitTest: {target: 'BS', required: false}, e2e: {target: null, required: true}}, 'Safari9': {unitTest: {target: 'BS', required: false}, e2e: {target: null, required: true}},
'Safari10': { unitTest: {target: 'BS', required: false}, e2e: {target: null, required: true}}, 'Safari10': {unitTest: {target: 'BS', required: false}, e2e: {target: null, required: true}},
'iOS7': { unitTest: {target: 'BS', required: true}, e2e: {target: null, required: true}}, 'iOS7': {unitTest: {target: 'BS', required: true}, e2e: {target: null, required: true}},
'iOS8': { unitTest: {target: 'BS', required: false}, e2e: {target: null, required: true}}, 'iOS8': {unitTest: {target: 'BS', required: false}, e2e: {target: null, required: true}},
'iOS9': { unitTest: {target: 'BS', required: false}, e2e: {target: null, required: true}}, 'iOS9': {unitTest: {target: 'BS', required: false}, e2e: {target: null, required: true}},
'iOS10': { unitTest: {target: 'BS', required: false}, e2e: {target: null, required: true}}, 'iOS10': {unitTest: {target: 'BS', required: false}, e2e: {target: null, required: true}},
'WindowsPhone': { unitTest: {target: 'BS', required: false}, e2e: {target: null, required: true}} 'WindowsPhone': {unitTest: {target: 'BS', required: false}, e2e: {target: null, required: true}}
}; };
var customLaunchers = { var customLaunchers = {
'DartiumWithWebPlatform': { 'DartiumWithWebPlatform':
base: 'Dartium', {base: 'Dartium', flags: ['--enable-experimental-web-platform-features']},
flags: ['--enable-experimental-web-platform-features'] }, 'ChromeNoSandbox': {base: 'Chrome', flags: ['--no-sandbox']},
'ChromeNoSandbox': { 'SL_CHROME': {base: 'SauceLabs', browserName: 'chrome', version: '52'},
base: 'Chrome', 'SL_CHROMEBETA': {base: 'SauceLabs', browserName: 'chrome', version: 'beta'},
flags: ['--no-sandbox'] }, 'SL_CHROMEDEV': {base: 'SauceLabs', browserName: 'chrome', version: 'dev'},
'SL_CHROME': { 'SL_FIREFOX': {base: 'SauceLabs', browserName: 'firefox', version: '46'},
base: 'SauceLabs', 'SL_FIREFOXBETA': {base: 'SauceLabs', browserName: 'firefox', version: 'beta'},
browserName: 'chrome', 'SL_FIREFOXDEV': {base: 'SauceLabs', browserName: 'firefox', version: 'dev'},
version: '52' 'SL_SAFARI7': {base: 'SauceLabs', browserName: 'safari', platform: 'OS X 10.9', version: '7.0'},
}, 'SL_SAFARI8': {base: 'SauceLabs', browserName: 'safari', platform: 'OS X 10.10', version: '8.0'},
'SL_CHROMEBETA': { 'SL_SAFARI9': {base: 'SauceLabs', browserName: 'safari', platform: 'OS X 10.11', version: '9.0'},
base: 'SauceLabs', 'SL_SAFARI10':
browserName: 'chrome', {base: 'SauceLabs', browserName: 'safari', platform: 'OS X 10.12', version: '10.0'},
version: 'beta' 'SL_IOS7': {base: 'SauceLabs', browserName: 'iphone', platform: 'OS X 10.10', version: '7.1'},
}, 'SL_IOS8': {base: 'SauceLabs', browserName: 'iphone', platform: 'OS X 10.10', version: '8.4'},
'SL_CHROMEDEV': { 'SL_IOS9': {base: 'SauceLabs', browserName: 'iphone', platform: 'OS X 10.10', version: '9.3'},
base: 'SauceLabs', 'SL_IOS10': {base: 'SauceLabs', browserName: 'iphone', platform: 'OS X 10.10', version: '10.0'},
browserName: 'chrome', 'SL_IE9':
version: 'dev' {base: 'SauceLabs', browserName: 'internet explorer', platform: 'Windows 2008', version: '9'},
},
'SL_FIREFOX': {
base: 'SauceLabs',
browserName: 'firefox',
version: '46'
},
'SL_FIREFOXBETA': {
base: 'SauceLabs',
browserName: 'firefox',
version: 'beta'
},
'SL_FIREFOXDEV': {
base: 'SauceLabs',
browserName: 'firefox',
version: 'dev'
},
'SL_SAFARI7': {
base: 'SauceLabs',
browserName: 'safari',
platform: 'OS X 10.9',
version: '7.0'
},
'SL_SAFARI8': {
base: 'SauceLabs',
browserName: 'safari',
platform: 'OS X 10.10',
version: '8.0'
},
'SL_SAFARI9': {
base: 'SauceLabs',
browserName: 'safari',
platform: 'OS X 10.11',
version: '9.0'
},
'SL_SAFARI10': {
base: 'SauceLabs',
browserName: 'safari',
platform: 'OS X 10.12',
version: '10.0'
},
'SL_IOS7': {
base: 'SauceLabs',
browserName: 'iphone',
platform: 'OS X 10.10',
version: '7.1'
},
'SL_IOS8': {
base: 'SauceLabs',
browserName: 'iphone',
platform: 'OS X 10.10',
version: '8.4'
},
'SL_IOS9': {
base: 'SauceLabs',
browserName: 'iphone',
platform: 'OS X 10.10',
version: '9.3'
},
'SL_IOS10': {
base: 'SauceLabs',
browserName: 'iphone',
platform: 'OS X 10.10',
version: '10.0'
},
'SL_IE9': {
base: 'SauceLabs',
browserName: 'internet explorer',
platform: 'Windows 2008',
version: '9'
},
'SL_IE10': { 'SL_IE10': {
base: 'SauceLabs', base: 'SauceLabs',
browserName: 'internet explorer', browserName: 'internet explorer',
platform: 'Windows 2012', platform: 'Windows 2012',
version: '10' version: '10'
}, },
'SL_IE11': { 'SL_IE11':
base: 'SauceLabs', {base: 'SauceLabs', browserName: 'internet explorer', platform: 'Windows 8.1', version: '11'},
browserName: 'internet explorer',
platform: 'Windows 8.1',
version: '11'
},
'SL_EDGE': { 'SL_EDGE': {
base: 'SauceLabs', base: 'SauceLabs',
browserName: 'MicrosoftEdge', browserName: 'MicrosoftEdge',
platform: 'Windows 10', platform: 'Windows 10',
version: '13.10586' version: '13.10586'
}, },
'SL_ANDROID4.1': { 'SL_ANDROID4.1': {base: 'SauceLabs', browserName: 'android', platform: 'Linux', version: '4.1'},
base: 'SauceLabs', 'SL_ANDROID4.2': {base: 'SauceLabs', browserName: 'android', platform: 'Linux', version: '4.2'},
browserName: 'android', 'SL_ANDROID4.3': {base: 'SauceLabs', browserName: 'android', platform: 'Linux', version: '4.3'},
platform: 'Linux', 'SL_ANDROID4.4': {base: 'SauceLabs', browserName: 'android', platform: 'Linux', version: '4.4'},
version: '4.1' 'SL_ANDROID5': {base: 'SauceLabs', browserName: 'android', platform: 'Linux', version: '5.1'},
},
'SL_ANDROID4.2': {
base: 'SauceLabs',
browserName: 'android',
platform: 'Linux',
version: '4.2'
},
'SL_ANDROID4.3': {
base: 'SauceLabs',
browserName: 'android',
platform: 'Linux',
version: '4.3'
},
'SL_ANDROID4.4': {
base: 'SauceLabs',
browserName: 'android',
platform: 'Linux',
version: '4.4'
},
'SL_ANDROID5': {
base: 'SauceLabs',
browserName: 'android',
platform: 'Linux',
version: '5.1'
},
'BS_CHROME': { 'BS_CHROME': {base: 'BrowserStack', browser: 'chrome', os: 'OS X', os_version: 'Yosemite'},
base: 'BrowserStack', 'BS_FIREFOX': {base: 'BrowserStack', browser: 'firefox', os: 'Windows', os_version: '10'},
browser: 'chrome', 'BS_SAFARI7': {base: 'BrowserStack', browser: 'safari', os: 'OS X', os_version: 'Mavericks'},
os: 'OS X', 'BS_SAFARI8': {base: 'BrowserStack', browser: 'safari', os: 'OS X', os_version: 'Yosemite'},
os_version: 'Yosemite' 'BS_SAFARI9': {base: 'BrowserStack', browser: 'safari', os: 'OS X', os_version: 'El Capitan'},
}, 'BS_SAFARI10': {base: 'BrowserStack', browser: 'safari', os: 'OS X', os_version: 'Sierra'},
'BS_FIREFOX': { 'BS_IOS7': {base: 'BrowserStack', device: 'iPhone 5S', os: 'ios', os_version: '7.0'},
base: 'BrowserStack', 'BS_IOS8': {base: 'BrowserStack', device: 'iPhone 6', os: 'ios', os_version: '8.3'},
browser: 'firefox', 'BS_IOS9': {base: 'BrowserStack', device: 'iPhone 6S', os: 'ios', os_version: '9.1'},
os: 'Windows', 'BS_IOS10': {base: 'BrowserStack', device: 'iPhone SE', os: 'ios', os_version: '10.0'},
os_version: '10' 'BS_IE9':
}, {base: 'BrowserStack', browser: 'ie', browser_version: '9.0', os: 'Windows', os_version: '7'},
'BS_SAFARI7': {
base: 'BrowserStack',
browser: 'safari',
os: 'OS X',
os_version: 'Mavericks'
},
'BS_SAFARI8': {
base: 'BrowserStack',
browser: 'safari',
os: 'OS X',
os_version: 'Yosemite'
},
'BS_SAFARI9': {
base: 'BrowserStack',
browser: 'safari',
os: 'OS X',
os_version: 'El Capitan'
},
'BS_SAFARI10': {
base: 'BrowserStack',
browser: 'safari',
os: 'OS X',
os_version: 'Sierra'
},
'BS_IOS7': {
base: 'BrowserStack',
device: 'iPhone 5S',
os: 'ios',
os_version: '7.0'
},
'BS_IOS8': {
base: 'BrowserStack',
device: 'iPhone 6',
os: 'ios',
os_version: '8.3'
},
'BS_IOS9': {
base: 'BrowserStack',
device: 'iPhone 6S',
os: 'ios',
os_version: '9.1'
},
'BS_IOS10': {
base: 'BrowserStack',
device: 'iPhone SE',
os: 'ios',
os_version: '10.0'
},
'BS_IE9': {
base: 'BrowserStack',
browser: 'ie',
browser_version: '9.0',
os: 'Windows',
os_version: '7'
},
'BS_IE10': { 'BS_IE10': {
base: 'BrowserStack', base: 'BrowserStack',
browser: 'ie', browser: 'ie',
@ -251,54 +107,31 @@ var customLaunchers = {
os: 'Windows', os: 'Windows',
os_version: '10' os_version: '10'
}, },
'BS_EDGE': { 'BS_EDGE': {base: 'BrowserStack', browser: 'edge', os: 'Windows', os_version: '10'},
base: 'BrowserStack', 'BS_WINDOWSPHONE':
browser: 'edge', {base: 'BrowserStack', device: 'Nokia Lumia 930', os: 'winphone', os_version: '8.1'},
os: 'Windows', 'BS_ANDROID5': {base: 'BrowserStack', device: 'Google Nexus 5', os: 'android', os_version: '5.0'},
os_version: '10' 'BS_ANDROID4.4': {base: 'BrowserStack', device: 'HTC One M8', os: 'android', os_version: '4.4'},
}, 'BS_ANDROID4.3':
'BS_WINDOWSPHONE' : { {base: 'BrowserStack', device: 'Samsung Galaxy S4', os: 'android', os_version: '4.3'},
base: 'BrowserStack', 'BS_ANDROID4.2':
device: 'Nokia Lumia 930', {base: 'BrowserStack', device: 'Google Nexus 4', os: 'android', os_version: '4.2'},
os: 'winphone', 'BS_ANDROID4.1':
os_version: '8.1' {base: 'BrowserStack', device: 'Google Nexus 7', os: 'android', os_version: '4.1'}
},
'BS_ANDROID5': {
base: 'BrowserStack',
device: 'Google Nexus 5',
os: 'android',
os_version: '5.0'
},
'BS_ANDROID4.4': {
base: 'BrowserStack',
device: 'HTC One M8',
os: 'android',
os_version: '4.4'
},
'BS_ANDROID4.3': {
base: 'BrowserStack',
device: 'Samsung Galaxy S4',
os: 'android',
os_version: '4.3'
},
'BS_ANDROID4.2': {
base: 'BrowserStack',
device: 'Google Nexus 4',
os: 'android',
os_version: '4.2'
},
'BS_ANDROID4.1': {
base: 'BrowserStack',
device: 'Google Nexus 7',
os: 'android',
os_version: '4.1'
}
}; };
var sauceAliases = { var sauceAliases = {
'ALL': Object.keys(customLaunchers).filter(function(item) {return customLaunchers[item].base == 'SauceLabs';}), 'ALL': Object.keys(customLaunchers).filter(function(item) {
'DESKTOP': ['SL_CHROME', 'SL_FIREFOX', 'SL_IE9', 'SL_IE10', 'SL_IE11', 'SL_EDGE', 'SL_SAFARI7', 'SL_SAFARI8', 'SL_SAFARI9', 'SL_SAFARI10'], return customLaunchers[item].base == 'SauceLabs';
'MOBILE': ['SL_ANDROID4.1', 'SL_ANDROID4.2', 'SL_ANDROID4.3', 'SL_ANDROID4.4', 'SL_ANDROID5', 'SL_IOS7', 'SL_IOS8', 'SL_IOS9', 'SL_IOS10'], }),
'DESKTOP': [
'SL_CHROME', 'SL_FIREFOX', 'SL_IE9', 'SL_IE10', 'SL_IE11', 'SL_EDGE', 'SL_SAFARI7',
'SL_SAFARI8', 'SL_SAFARI9', 'SL_SAFARI10'
],
'MOBILE': [
'SL_ANDROID4.1', 'SL_ANDROID4.2', 'SL_ANDROID4.3', 'SL_ANDROID4.4', 'SL_ANDROID5', 'SL_IOS7',
'SL_IOS8', 'SL_IOS9', 'SL_IOS10'
],
'ANDROID': ['SL_ANDROID4.1', 'SL_ANDROID4.2', 'SL_ANDROID4.3', 'SL_ANDROID4.4', 'SL_ANDROID5'], 'ANDROID': ['SL_ANDROID4.1', 'SL_ANDROID4.2', 'SL_ANDROID4.3', 'SL_ANDROID4.4', 'SL_ANDROID5'],
'IE': ['SL_IE9', 'SL_IE10', 'SL_IE11'], 'IE': ['SL_IE9', 'SL_IE10', 'SL_IE11'],
'IOS': ['SL_IOS7', 'SL_IOS8', 'SL_IOS9', 'SL_IOS10'], 'IOS': ['SL_IOS7', 'SL_IOS8', 'SL_IOS9', 'SL_IOS10'],
@ -310,9 +143,16 @@ var sauceAliases = {
}; };
var browserstackAliases = { var browserstackAliases = {
'ALL': Object.keys(customLaunchers).filter(function(item) {return customLaunchers[item].base == 'BrowserStack';}), 'ALL': Object.keys(customLaunchers).filter(function(item) {
'DESKTOP': ['BS_CHROME', 'BS_FIREFOX', 'BS_IE9', 'BS_IE10', 'BS_IE11', 'BS_EDGE', 'BS_SAFARI7', 'BS_SAFARI8', 'BS_SAFARI9', 'BS_SAFARI10'], return customLaunchers[item].base == 'BrowserStack';
'MOBILE': ['BS_ANDROID4.3', 'BS_ANDROID4.4', 'BS_IOS7', 'BS_IOS8', 'BS_IOS9', 'BS_IOS10', 'BS_WINDOWSPHONE'], }),
'DESKTOP': [
'BS_CHROME', 'BS_FIREFOX', 'BS_IE9', 'BS_IE10', 'BS_IE11', 'BS_EDGE', 'BS_SAFARI7',
'BS_SAFARI8', 'BS_SAFARI9', 'BS_SAFARI10'
],
'MOBILE': [
'BS_ANDROID4.3', 'BS_ANDROID4.4', 'BS_IOS7', 'BS_IOS8', 'BS_IOS9', 'BS_IOS10', 'BS_WINDOWSPHONE'
],
'ANDROID': ['BS_ANDROID4.3', 'BS_ANDROID4.4'], 'ANDROID': ['BS_ANDROID4.3', 'BS_ANDROID4.4'],
'IE': ['BS_IE9', 'BS_IE10', 'BS_IE11'], 'IE': ['BS_IE9', 'BS_IE10', 'BS_IE11'],
'IOS': ['BS_IOS7', 'BS_IOS8', 'BS_IOS9', 'BS_IOS10'], 'IOS': ['BS_IOS7', 'BS_IOS8', 'BS_IOS9', 'BS_IOS10'],
@ -329,11 +169,9 @@ module.exports = {
function buildConfiguration(type, target, required) { function buildConfiguration(type, target, required) {
return Object.keys(CIconfiguration) return Object.keys(CIconfiguration)
.filter((item) => { .filter((item) => {
var conf = CIconfiguration[item][type]; var conf = CIconfiguration[item][type];
return conf.required === required && conf.target === target; return conf.required === required && conf.target === target;
}) })
.map((item) => { .map((item) => target + '_' + item.toUpperCase());
return target + '_' + item.toUpperCase();
});
} }

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
*/
'use strict'; 'use strict';
// THIS CHECK SHOULD BE THE FIRST THING IN THIS FILE // THIS CHECK SHOULD BE THE FIRST THING IN THIS FILE
@ -13,12 +21,13 @@ const os = require('os');
// clang-format entry points // clang-format entry points
const srcsToFmt = [ const srcsToFmt = [
'modules/@angular/**/*.ts', 'modules/@angular/**/*.{js,ts}',
'modules/benchmarks/**/*.ts', 'modules/benchmarks/**/*.{js,ts}',
'modules/e2e_util/**/*.ts', 'modules/e2e_util/**/*.{js,ts}',
'modules/playground/**/*.ts', 'modules/playground/**/*.{js,ts}',
'tools/**/*.ts', 'tools/**/*.{js,ts}',
'!tools/public_api_guard/**/*.d.ts', '!tools/public_api_guard/**/*.d.ts',
'./*.{js,ts}',
]; ];
// Check source code for formatting errors (clang-format) // Check source code for formatting errors (clang-format)
@ -26,15 +35,16 @@ gulp.task('format:enforce', () => {
const format = require('gulp-clang-format'); const format = require('gulp-clang-format');
const clangFormat = require('clang-format'); const clangFormat = require('clang-format');
return gulp.src(srcsToFmt).pipe( return gulp.src(srcsToFmt).pipe(
format.checkFormat('file', clangFormat, {verbose: true, fail: true})); format.checkFormat('file', clangFormat, {verbose: true, fail: true}));
}); });
// Format the source code with clang-format (see .clang-format) // Format the source code with clang-format (see .clang-format)
gulp.task('format', () => { gulp.task('format', () => {
const format = require('gulp-clang-format'); const format = require('gulp-clang-format');
const clangFormat = require('clang-format'); const clangFormat = require('clang-format');
return gulp.src(srcsToFmt, { base: '.' }).pipe( return gulp.src(srcsToFmt, {base: '.'})
format.format('file', clangFormat)).pipe(gulp.dest('.')); .pipe(format.format('file', clangFormat))
.pipe(gulp.dest('.'));
}); });
const entrypoints = [ const entrypoints = [
@ -62,12 +72,18 @@ const entrypoints = [
]; ];
const publicApiDir = path.normalize('tools/public_api_guard'); const publicApiDir = path.normalize('tools/public_api_guard');
const publicApiArgs = [ const publicApiArgs = [
'--rootDir', 'dist/packages-dist', '--rootDir',
'--stripExportPattern', '^__', 'dist/packages-dist',
'--allowModuleIdentifiers', 'jasmine', '--stripExportPattern',
'--allowModuleIdentifiers', 'protractor', '^__',
'--allowModuleIdentifiers', 'angular', '--allowModuleIdentifiers',
'--onStabilityMissing', 'error', 'jasmine',
'--allowModuleIdentifiers',
'protractor',
'--allowModuleIdentifiers',
'angular',
'--onStabilityMissing',
'error',
].concat(entrypoints); ].concat(entrypoints);
// Build angular // Build angular
@ -83,17 +99,17 @@ gulp.task('public-api:enforce', (done) => {
const childProcess = require('child_process'); const childProcess = require('child_process');
childProcess childProcess
.spawn( .spawn(
path.join(__dirname, platformScriptPath(`/node_modules/.bin/ts-api-guardian`)), path.join(__dirname, platformScriptPath(`/node_modules/.bin/ts-api-guardian`)),
['--verifyDir', publicApiDir].concat(publicApiArgs), {stdio: 'inherit'}) ['--verifyDir', publicApiDir].concat(publicApiArgs), {stdio: 'inherit'})
.on('close', (errorCode) => { .on('close', (errorCode) => {
if (errorCode !== 0) { if (errorCode !== 0) {
done(new Error( done(new Error(
'Public API differs from golden file. Please run `gulp public-api:update`.')); 'Public API differs from golden file. Please run `gulp public-api:update`.'));
} else { } else {
done(); done();
} }
}); });
}); });
// Generate the public API golden files // Generate the public API golden files
@ -101,20 +117,24 @@ gulp.task('public-api:update', ['build.sh'], (done) => {
const childProcess = require('child_process'); const childProcess = require('child_process');
childProcess childProcess
.spawn( .spawn(
path.join(__dirname, platformScriptPath(`/node_modules/.bin/ts-api-guardian`)), path.join(__dirname, platformScriptPath(`/node_modules/.bin/ts-api-guardian`)),
['--outDir', publicApiDir].concat(publicApiArgs), {stdio: 'inherit'}) ['--outDir', publicApiDir].concat(publicApiArgs), {stdio: 'inherit'})
.on('close', done); .on('close', done);
}); });
// Checks tests for presence of ddescribe, fdescribe, fit, iit and fails the build if one of the focused tests is found. // Checks tests for presence of ddescribe, fdescribe, fit, iit and fails the build if one of the
// Currently xdescribe and xit are _not_ reported as errors since there are a couple of excluded tests in our code base. // focused tests is found.
// Currently xdescribe and xit are _not_ reported as errors since there are a couple of excluded
// tests in our code base.
gulp.task('check-tests', function() { gulp.task('check-tests', function() {
const ddescribeIit = require('gulp-ddescribe-iit'); const ddescribeIit = require('gulp-ddescribe-iit');
return gulp.src([ return gulp
'modules/**/*.spec.ts', .src([
'modules/**/*_spec.ts', 'modules/**/*.spec.ts',
]).pipe(ddescribeIit({allowDisabledTests: true})); 'modules/**/*_spec.ts',
])
.pipe(ddescribeIit({allowDisabledTests: true}));
}); });
// Check the coding standards and programming errors // Check the coding standards and programming errors
@ -123,14 +143,21 @@ gulp.task('lint', ['check-tests', 'format:enforce', 'tools:build'], () => {
// Built-in rules are at // Built-in rules are at
// https://github.com/palantir/tslint#supported-rules // https://github.com/palantir/tslint#supported-rules
const tslintConfig = require('./tslint.json'); const tslintConfig = require('./tslint.json');
return gulp.src(['modules/@angular/**/*.ts', 'modules/benchpress/**/*.ts']) return gulp
.pipe(tslint({ .src([
tslint: require('tslint').default, // todo(vicb): add .js files when supported
configuration: tslintConfig, // see https://github.com/palantir/tslint/pull/1515
rulesDirectory: 'dist/tools/tslint', 'modules/@angular/**/*.ts',
formatter: 'prose', 'modules/benchpress/**/*.ts',
})) './*.ts',
.pipe(tslint.report({emitError: true})); ])
.pipe(tslint({
tslint: require('tslint').default,
configuration: tslintConfig,
rulesDirectory: 'dist/tools/tslint',
formatter: 'prose',
}))
.pipe(tslint.report({emitError: true}));
}); });
gulp.task('tools:build', (done) => { tsc('tools/', done); }); gulp.task('tools:build', (done) => { tsc('tools/', done); });
@ -142,7 +169,7 @@ gulp.task('check-cycle', (done) => {
const dependencyObject = madge(['dist/all/'], { const dependencyObject = madge(['dist/all/'], {
format: 'cjs', format: 'cjs',
extensions: ['.js'], extensions: ['.js'],
onParseFile: function(data) { data.src = data.src.replace(/\/\* circular \*\//g, "//"); } onParseFile: function(data) { data.src = data.src.replace(/\/\* circular \*\//g, '//'); }
}); });
const circularDependencies = dependencyObject.circular().getArray(); const circularDependencies = dependencyObject.circular().getArray();
if (circularDependencies.length > 0) { if (circularDependencies.length > 0) {
@ -173,11 +200,11 @@ gulp.task('serve-examples', () => {
const cors = require('cors'); const cors = require('cors');
connect.server({ connect.server({
root: `${__dirname}/dist/examples`, root: `${__dirname}/dist/examples`,
port: 8001, port: 8001,
livereload: false, livereload: false,
open: false, open: false,
middleware: (connect, opt) => [cors()], middleware: (connect, opt) => [cors()],
}); });
}); });
@ -187,16 +214,13 @@ gulp.task('changelog', () => {
const conventionalChangelog = require('gulp-conventional-changelog'); const conventionalChangelog = require('gulp-conventional-changelog');
return gulp.src('CHANGELOG.md') return gulp.src('CHANGELOG.md')
.pipe(conventionalChangelog({ .pipe(conventionalChangelog({preset: 'angular', releaseCount: 1}, {
preset: 'angular', // Conventional Changelog Context
releaseCount: 1 // We have to manually set version number so it doesn't get prefixed with `v`
}, { // See https://github.com/conventional-changelog/conventional-changelog-core/issues/10
// Conventional Changelog Context currentTag: require('./package.json').version
// We have to manually set version number so it doesn't get prefixed with `v` }))
// See https://github.com/conventional-changelog/conventional-changelog-core/issues/10 .pipe(gulp.dest('./'));
currentTag: require('./package.json').version
}))
.pipe(gulp.dest('./'));
}); });
function tsc(projectPath, done) { function tsc(projectPath, done) {
@ -205,8 +229,7 @@ function tsc(projectPath, done) {
childProcess childProcess
.spawn( .spawn(
path.normalize(platformScriptPath(`${__dirname}/node_modules/.bin/tsc`)), path.normalize(platformScriptPath(`${__dirname}/node_modules/.bin/tsc`)),
['-p', path.join(__dirname, projectPath)], ['-p', path.join(__dirname, projectPath)], {stdio: 'inherit'})
{stdio: 'inherit'})
.on('close', done); .on('close', done);
} }

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
*/
var browserProvidersConf = require('./browser-providers.conf.js'); var browserProvidersConf = require('./browser-providers.conf.js');
var internalAngularReporter = require('./tools/karma/reporter.js'); var internalAngularReporter = require('./tools/karma/reporter.js');
@ -17,24 +25,25 @@ module.exports = function(config) {
// include Angular v1 for upgrade module testing // include Angular v1 for upgrade module testing
'node_modules/angular/angular.min.js', 'node_modules/angular/angular.min.js',
'node_modules/zone.js/dist/zone.js', 'node_modules/zone.js/dist/zone.js', 'node_modules/zone.js/dist/long-stack-trace-zone.js',
'node_modules/zone.js/dist/long-stack-trace-zone.js', 'node_modules/zone.js/dist/proxy.js', 'node_modules/zone.js/dist/sync-test.js',
'node_modules/zone.js/dist/proxy.js', 'node_modules/zone.js/dist/jasmine-patch.js', 'node_modules/zone.js/dist/async-test.js',
'node_modules/zone.js/dist/sync-test.js',
'node_modules/zone.js/dist/jasmine-patch.js',
'node_modules/zone.js/dist/async-test.js',
'node_modules/zone.js/dist/fake-async-test.js', 'node_modules/zone.js/dist/fake-async-test.js',
// Including systemjs because it defines `__eval`, which produces correct stack traces. // Including systemjs because it defines `__eval`, which produces correct stack traces.
'shims_for_IE.js', 'shims_for_IE.js', 'node_modules/systemjs/dist/system.src.js',
'node_modules/systemjs/dist/system.src.js',
{pattern: 'node_modules/rxjs/**', included: false, watched: false, served: true}, {pattern: 'node_modules/rxjs/**', included: false, watched: false, served: true},
'node_modules/reflect-metadata/Reflect.js', 'node_modules/reflect-metadata/Reflect.js', 'tools/build/file2modulename.js', 'test-main.js',
'tools/build/file2modulename.js', {pattern: 'dist/all/empty.*', included: false, watched: false}, {
'test-main.js', pattern: 'modules/@angular/platform-browser/test/static_assets/**',
{pattern: 'dist/all/empty.*', included: false, watched: false}, included: false,
{pattern: 'modules/@angular/platform-browser/test/static_assets/**', included: false, watched: false}, watched: false
{pattern: 'modules/@angular/platform-browser/test/browser/static_assets/**', included: false, watched: false} },
{
pattern: 'modules/@angular/platform-browser/test/browser/static_assets/**',
included: false,
watched: false,
}
], ],
exclude: [ exclude: [
@ -44,7 +53,7 @@ module.exports = function(config) {
'dist/all/@angular/benchpress/**', 'dist/all/@angular/benchpress/**',
'dist/all/angular1_router.js', 'dist/all/angular1_router.js',
'dist/all/@angular/platform-browser/testing/e2e_util.js', 'dist/all/@angular/platform-browser/testing/e2e_util.js',
'dist/examples/**/e2e_test/**' 'dist/examples/**/e2e_test/**',
], ],
customLaunchers: browserProvidersConf.customLaunchers, customLaunchers: browserProvidersConf.customLaunchers,
@ -55,11 +64,11 @@ module.exports = function(config) {
'karma-sauce-launcher', 'karma-sauce-launcher',
'karma-chrome-launcher', 'karma-chrome-launcher',
'karma-sourcemap-loader', 'karma-sourcemap-loader',
internalAngularReporter internalAngularReporter,
], ],
preprocessors: { preprocessors: {
'**/*.js': ['sourcemap'] '**/*.js': ['sourcemap'],
}, },
reporters: ['internal-angular'], reporters: ['internal-angular'],
@ -73,7 +82,7 @@ module.exports = function(config) {
'selenium-version': '2.53.0', 'selenium-version': '2.53.0',
'command-timeout': 600, 'command-timeout': 600,
'idle-timeout': 600, 'idle-timeout': 600,
'max-duration': 5400 'max-duration': 5400,
} }
}, },
@ -82,20 +91,21 @@ module.exports = function(config) {
startTunnel: false, startTunnel: false,
retryLimit: 3, retryLimit: 3,
timeout: 600, timeout: 600,
pollingTimeout: 10000 pollingTimeout: 10000,
}, },
browsers: ['Chrome'], browsers: ['Chrome'],
port: 9876, port: 9876,
captureTimeout: 60000, captureTimeout: 60000,
browserDisconnectTimeout : 60000, browserDisconnectTimeout: 60000,
browserDisconnectTolerance : 3, browserDisconnectTolerance: 3,
browserNoActivityTimeout : 60000, browserNoActivityTimeout: 60000,
}); });
if (process.env.TRAVIS) { if (process.env.TRAVIS) {
var buildId = 'TRAVIS #' + process.env.TRAVIS_BUILD_NUMBER + ' (' + process.env.TRAVIS_BUILD_ID + ')'; var buildId =
'TRAVIS #' + process.env.TRAVIS_BUILD_NUMBER + ' (' + process.env.TRAVIS_BUILD_ID + ')';
if (process.env.CI_MODE.startsWith('saucelabs')) { if (process.env.CI_MODE.startsWith('saucelabs')) {
config.sauceLabs.build = buildId; config.sauceLabs.build = buildId;
config.sauceLabs.tunnelIdentifier = process.env.TRAVIS_JOB_NUMBER; config.sauceLabs.tunnelIdentifier = process.env.TRAVIS_JOB_NUMBER;

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
*/
export default { export default {
entry: '../../../dist/packages-dist/common/testing/index.js', entry: '../../../dist/packages-dist/common/testing/index.js',
@ -10,4 +17,4 @@ export default {
'rxjs/Observable': 'Rx', 'rxjs/Observable': 'Rx',
'rxjs/Subject': 'Rx' 'rxjs/Subject': 'Rx'
} }
} };

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
*/
export default { export default {
entry: '../../../dist/packages-dist/common/index.js', entry: '../../../dist/packages-dist/common/index.js',
@ -7,6 +14,6 @@ export default {
globals: { globals: {
'@angular/core': 'ng.core', '@angular/core': 'ng.core',
'rxjs/Observable': 'Rx', 'rxjs/Observable': 'Rx',
'rxjs/Subject': 'Rx' 'rxjs/Subject': 'Rx',
} }
} };

View File

@ -1,10 +1,14 @@
/**
* @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 = {
target: 'node', target: 'node',
entry: './test/all_spec.js', entry: './test/all_spec.js',
output: { output: {filename: './all_spec.js'},
filename: './all_spec.js' resolve: {extensions: ['.js']},
},
resolve: {
extensions: ['.js']
},
}; };

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
*/
export default { export default {
entry: '../../../dist/packages-dist/compiler/testing/index.js', entry: '../../../dist/packages-dist/compiler/testing/index.js',
@ -11,4 +18,4 @@ export default {
'rxjs/Observable': 'Rx', 'rxjs/Observable': 'Rx',
'rxjs/Subject': 'Rx' 'rxjs/Subject': 'Rx'
} }
} };

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
*/
export default { export default {
entry: '../../../dist/packages-dist/compiler/index.js', entry: '../../../dist/packages-dist/compiler/index.js',
@ -7,9 +14,9 @@ export default {
globals: { globals: {
'@angular/core': 'ng.core', '@angular/core': 'ng.core',
'rxjs/Observable': 'Rx', 'rxjs/Observable': 'Rx',
'rxjs/Subject': 'Rx' 'rxjs/Subject': 'Rx',
}, },
plugins: [ plugins: [
// nodeResolve({ jsnext: true, main: true }), // nodeResolve({ jsnext: true, main: 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
*/
export default { export default {
entry: '../../../dist/packages-dist/core/testing/index.js', entry: '../../../dist/packages-dist/core/testing/index.js',
@ -7,7 +14,6 @@ export default {
globals: { globals: {
'@angular/core': 'ng.core', '@angular/core': 'ng.core',
'rxjs/Observable': 'Rx', 'rxjs/Observable': 'Rx',
'rxjs/Subject': 'Rx' 'rxjs/Subject': 'Rx',
} }
} };

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
*/
export default { export default {
entry: '../../../dist/packages-dist/core/index.js', entry: '../../../dist/packages-dist/core/index.js',
@ -6,7 +13,6 @@ export default {
moduleName: 'ng.core', moduleName: 'ng.core',
globals: { globals: {
'rxjs/Observable': 'Rx', 'rxjs/Observable': 'Rx',
'rxjs/Subject': 'Rx' 'rxjs/Subject': 'Rx',
} }
} };

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
*/
export default { export default {
entry: '../../../dist/packages-dist/forms/index.js', entry: '../../../dist/packages-dist/forms/index.js',
@ -13,4 +20,4 @@ export default {
'rxjs/observable/fromPromise': 'Rx.Observable', 'rxjs/observable/fromPromise': 'Rx.Observable',
'rxjs/operator/toPromise': 'Rx.Observable.prototype' 'rxjs/operator/toPromise': 'Rx.Observable.prototype'
} }
} };

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
*/
export default { export default {
entry: '../../../dist/packages-dist/http/testing/index.js', entry: '../../../dist/packages-dist/http/testing/index.js',
@ -14,4 +21,4 @@ export default {
'rxjs/Subject': 'Rx', 'rxjs/Subject': 'Rx',
'rxjs/operator/take': 'Rx.Observable.prototype' 'rxjs/operator/take': 'Rx.Observable.prototype'
} }
} };

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
*/
export default { export default {
entry: '../../../dist/packages-dist/http/index.js', entry: '../../../dist/packages-dist/http/index.js',
@ -11,4 +18,4 @@ export default {
'rxjs/Observable': 'Rx', 'rxjs/Observable': 'Rx',
'rxjs/Subject': 'Rx' 'rxjs/Subject': 'Rx'
} }
} };

View File

@ -1,6 +1,15 @@
/**
* @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
*/
export default { export default {
entry: '../../../dist/packages-dist/platform-browser-dynamic/testing/index.js', entry: '../../../dist/packages-dist/platform-browser-dynamic/testing/index.js',
dest: '../../../dist/packages-dist/platform-browser-dynamic/bundles/platform-browser-dynamic-testing.umd.js', dest:
'../../../dist/packages-dist/platform-browser-dynamic/bundles/platform-browser-dynamic-testing.umd.js',
format: 'umd', format: 'umd',
moduleName: 'ng.platformBrowserDynamic.testing', moduleName: 'ng.platformBrowserDynamic.testing',
globals: { globals: {
@ -13,4 +22,4 @@ export default {
'@angular/platform-browser/testing': 'ng.platformBrowser.testing', '@angular/platform-browser/testing': 'ng.platformBrowser.testing',
'@angular/platform-browser-dynamic': 'ng.platformBrowserDynamic' '@angular/platform-browser-dynamic': 'ng.platformBrowserDynamic'
} }
} };

View File

@ -1,12 +1,21 @@
/**
* @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
*/
export default { export default {
entry: '../../../dist/packages-dist/platform-browser-dynamic/index.js', entry: '../../../dist/packages-dist/platform-browser-dynamic/index.js',
dest: '../../../dist/packages-dist/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js', dest:
'../../../dist/packages-dist/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js',
format: 'umd', format: 'umd',
moduleName: 'ng.platformBrowserDynamic', moduleName: 'ng.platformBrowserDynamic',
globals: { globals: {
'@angular/core': 'ng.core', '@angular/core': 'ng.core',
'@angular/common': 'ng.common', '@angular/common': 'ng.common',
'@angular/compiler': 'ng.compiler', '@angular/compiler': 'ng.compiler',
'@angular/platform-browser': 'ng.platformBrowser' '@angular/platform-browser': 'ng.platformBrowser',
} }
} };

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
*/
export default { export default {
entry: '../../../dist/packages-dist/platform-browser/testing/index.js', entry: '../../../dist/packages-dist/platform-browser/testing/index.js',
@ -9,4 +16,4 @@ export default {
'@angular/common': 'ng.common', '@angular/common': 'ng.common',
'@angular/platform-browser': 'ng.platformBrowser' '@angular/platform-browser': 'ng.platformBrowser'
} }
} };

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
*/
export default { export default {
entry: '../../../dist/packages-dist/platform-browser/index.js', entry: '../../../dist/packages-dist/platform-browser/index.js',
@ -6,6 +13,6 @@ export default {
moduleName: 'ng.platformBrowser', moduleName: 'ng.platformBrowser',
globals: { globals: {
'@angular/core': 'ng.core', '@angular/core': 'ng.core',
'@angular/common': 'ng.common' '@angular/common': 'ng.common',
} }
} };

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
*/
export default { export default {
entry: '../../../dist/packages-dist/platform-server/testing/index.js', entry: '../../../dist/packages-dist/platform-server/testing/index.js',
@ -13,4 +20,4 @@ export default {
'@angular/platform-server': 'ng.platformServer', '@angular/platform-server': 'ng.platformServer',
'@angular/platform-browser-dynamic/testing': 'ng.platformBrowserDynamic.testing' '@angular/platform-browser-dynamic/testing': 'ng.platformBrowserDynamic.testing'
} }
} };

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
*/
export default { export default {
entry: '../../../dist/packages-dist/platform-server/index.js', entry: '../../../dist/packages-dist/platform-server/index.js',
@ -10,4 +17,4 @@ export default {
'@angular/compiler': 'ng.compiler', '@angular/compiler': 'ng.compiler',
'@angular/platform-browser': 'ng.platformBrowser' '@angular/platform-browser': 'ng.platformBrowser'
} }
} };

View File

@ -1,6 +1,15 @@
/**
* @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
*/
export default { export default {
entry: '../../../dist/packages-dist/platform-webworker-dynamic/index.js', entry: '../../../dist/packages-dist/platform-webworker-dynamic/index.js',
dest: '../../../dist/packages-dist/platform-webworker-dynamic/bundles/platform-webworker-dynamic.umd.js', dest:
'../../../dist/packages-dist/platform-webworker-dynamic/bundles/platform-webworker-dynamic.umd.js',
format: 'umd', format: 'umd',
moduleName: 'ng.platformWebworkerDynamic', moduleName: 'ng.platformWebworkerDynamic',
globals: { globals: {
@ -9,6 +18,6 @@ export default {
'@angular/compiler': 'ng.compiler', '@angular/compiler': 'ng.compiler',
'@angular/platform-browser': 'ng.platformBrowser', '@angular/platform-browser': 'ng.platformBrowser',
'@angular/platform-browser-dynamic': 'ng.platformBrowserDynamic', '@angular/platform-browser-dynamic': 'ng.platformBrowserDynamic',
'@angular/platform-webworker': 'ng.platformWebworker' '@angular/platform-webworker': 'ng.platformWebworker',
} }
} };

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
*/
export default { export default {
entry: '../../../dist/packages-dist/platform-webworker/index.js', entry: '../../../dist/packages-dist/platform-webworker/index.js',
@ -11,4 +18,4 @@ export default {
'rxjs/Observable': 'Rx', 'rxjs/Observable': 'Rx',
'rxjs/Subject': 'Rx' 'rxjs/Subject': 'Rx'
} }
} };

View File

@ -1,9 +1,16 @@
/**
* @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
*/
/*global jasmine, __karma__, window*/ /*global jasmine, __karma__, window*/
Error.stackTraceLimit = 5; Error.stackTraceLimit = 5;
jasmine.DEFAULT_TIMEOUT_INTERVAL = 10000; jasmine.DEFAULT_TIMEOUT_INTERVAL = 10000;
__karma__.loaded = function () { __karma__.loaded = function() {};
};
function isJsFile(path) { function isJsFile(path) {
return path.slice(-3) == '.js'; return path.slice(-3) == '.js';
@ -18,93 +25,50 @@ function isBuiltFile(path) {
return isJsFile(path) && (path.substr(0, builtPath.length) == builtPath); return isJsFile(path) && (path.substr(0, builtPath.length) == builtPath);
} }
var allSpecFiles = Object.keys(window.__karma__.files) var allSpecFiles = Object.keys(window.__karma__.files).filter(isSpecFile).filter(isBuiltFile);
.filter(isSpecFile)
.filter(isBuiltFile);
// Load our SystemJS configuration. // Load our SystemJS configuration.
System.config({ System.config({
baseURL: '/base' baseURL: '/base',
}); });
System.config( System.config({
{ map: {'rxjs': 'node_modules/rxjs', '@angular': 'dist/all/@angular'},
map: { packages: {
'rxjs': 'node_modules/rxjs', '@angular/core/testing': {main: 'index.js', defaultExtension: 'js'},
'@angular': 'dist/all/@angular' '@angular/core': {main: 'index.js', defaultExtension: 'js'},
}, '@angular/compiler/testing': {main: 'index.js', defaultExtension: 'js'},
packages: { '@angular/compiler': {main: 'index.js', defaultExtension: 'js'},
'@angular/core/testing': { '@angular/common/testing': {main: 'index.js', defaultExtension: 'js'},
main: 'index.js', '@angular/common': {main: 'index.js', defaultExtension: 'js'},
defaultExtension: 'js' '@angular/platform-browser/testing': {main: 'index.js', defaultExtension: 'js'},
}, '@angular/platform-browser': {main: 'index.js', defaultExtension: 'js'},
'@angular/core': { '@angular/platform-browser-dynamic/testing': {main: 'index.js', defaultExtension: 'js'},
main: 'index.js', '@angular/platform-browser-dynamic': {main: 'index.js', defaultExtension: 'js'},
defaultExtension: 'js' '@angular/router/testing': {main: 'index.js', defaultExtension: 'js'},
}, '@angular/router': {main: 'index.js', defaultExtension: 'js'},
'@angular/compiler/testing': { 'rxjs': {main: 'Rx.js', defaultExtension: 'js'},
main: 'index.js', }
defaultExtension: 'js' });
},
'@angular/compiler': {
main: 'index.js',
defaultExtension: 'js'
},
'@angular/common/testing': {
main: 'index.js',
defaultExtension: 'js'
},
'@angular/common': {
main: 'index.js',
defaultExtension: 'js'
},
'@angular/platform-browser/testing': {
main: 'index.js',
defaultExtension: 'js'
},
'@angular/platform-browser': {
main: 'index.js',
defaultExtension: 'js'
},
'@angular/platform-browser-dynamic/testing': {
main: 'index.js',
defaultExtension: 'js'
},
'@angular/platform-browser-dynamic': {
main: 'index.js',
defaultExtension: 'js'
},
'@angular/router/testing': {
main: 'index.js',
defaultExtension: 'js'
},
'@angular/router': {
main: 'index.js',
defaultExtension: 'js'
},
'rxjs': {
main: 'Rx.js',
defaultExtension: 'js'
}
}
});
Promise.all([ Promise
System.import('@angular/core/testing'), .all([
System.import('@angular/platform-browser-dynamic/testing') System.import('@angular/core/testing'),
]).then(function (providers) { System.import('@angular/platform-browser-dynamic/testing')
var testing = providers[0]; ])
var testingBrowser = providers[1]; .then(function(providers) {
var testing = providers[0];
var testingBrowser = providers[1];
testing.TestBed.initTestEnvironment( testing.TestBed.initTestEnvironment(
testingBrowser.BrowserDynamicTestingModule, testingBrowser.BrowserDynamicTestingModule,
testingBrowser.platformBrowserDynamicTesting()); testingBrowser.platformBrowserDynamicTesting());
}).then(function() { })
// Finally, load all spec files. .then(function() {
// This will run the tests directly. // Finally, load all spec files.
return Promise.all( // This will run the tests directly.
allSpecFiles.map(function (moduleName) { return Promise.all(
return System.import(moduleName); allSpecFiles.map(function(moduleName) { return System.import(moduleName); }));
})); })
}).then(__karma__.start, __karma__.error); .then(__karma__.start, __karma__.error);

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
*/
var browserProvidersConf = require('../../../browser-providers.conf.js'); var browserProvidersConf = require('../../../browser-providers.conf.js');
// Karma configuration // Karma configuration
@ -28,11 +36,11 @@ module.exports = function(config) {
'node_modules/zone.js/dist/fake-async-test.js', 'node_modules/zone.js/dist/fake-async-test.js',
// RxJs. // RxJs.
{ pattern: 'node_modules/rxjs/**/*.js', included: false, watched: false }, {pattern: 'node_modules/rxjs/**/*.js', included: false, watched: false},
{ pattern: 'node_modules/rxjs/**/*.js.map', included: false, watched: false }, {pattern: 'node_modules/rxjs/**/*.js.map', included: false, watched: false},
// shim // shim
{pattern: 'modules/@angular/router/karma-test-shim.js', included: true, watched: true }, {pattern: 'modules/@angular/router/karma-test-shim.js', included: true, watched: true},
// Angular modules // Angular modules
{pattern: 'dist/all/@angular/core/*.js', included: false, watched: false}, {pattern: 'dist/all/@angular/core/*.js', included: false, watched: false},
@ -49,11 +57,23 @@ module.exports = function(config) {
{pattern: 'dist/all/@angular/platform-browser/*.js', included: false, watched: false}, {pattern: 'dist/all/@angular/platform-browser/*.js', included: false, watched: false},
{pattern: 'dist/all/@angular/platform-browser/src/**/*.js', included: false, watched: false}, {pattern: 'dist/all/@angular/platform-browser/src/**/*.js', included: false, watched: false},
{pattern: 'dist/all/@angular/platform-browser/testing/**/*.js', included: false, watched: false}, {
pattern: 'dist/all/@angular/platform-browser/testing/**/*.js',
included: false,
watched: false,
},
{pattern: 'dist/all/@angular/platform-browser-dynamic/*.js', included: false, watched: false}, {pattern: 'dist/all/@angular/platform-browser-dynamic/*.js', included: false, watched: false},
{pattern: 'dist/all/@angular/platform-browser-dynamic/src/**/*.js', included: false, watched: false}, {
{pattern: 'dist/all/@angular/platform-browser-dynamic/testing/**/*.js', included: false, watched: false}, pattern: 'dist/all/@angular/platform-browser-dynamic/src/**/*.js',
included: false,
watched: false,
},
{
pattern: 'dist/all/@angular/platform-browser-dynamic/testing/**/*.js',
included: false,
watched: false,
},
// Router // Router
{pattern: 'dist/all/@angular/router/**/*.js', included: false, watched: true} {pattern: 'dist/all/@angular/router/**/*.js', included: false, watched: true}
@ -66,11 +86,11 @@ module.exports = function(config) {
'karma-browserstack-launcher', 'karma-browserstack-launcher',
'karma-sauce-launcher', 'karma-sauce-launcher',
'karma-chrome-launcher', 'karma-chrome-launcher',
'karma-sourcemap-loader' 'karma-sourcemap-loader',
], ],
preprocessors: { preprocessors: {
'**/*.js': ['sourcemap'] '**/*.js': ['sourcemap'],
}, },
reporters: ['dots'], reporters: ['dots'],
@ -81,8 +101,8 @@ module.exports = function(config) {
browsers: ['Chrome'], browsers: ['Chrome'],
singleRun: false, singleRun: false,
captureTimeout: 60000, captureTimeout: 60000,
browserDisconnectTimeout : 60000, browserDisconnectTimeout: 60000,
browserDisconnectTolerance : 3, browserDisconnectTolerance: 3,
browserNoActivityTimeout : 60000 browserNoActivityTimeout: 60000,
}); });
}; };

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
*/
export default { export default {
entry: '../../../dist/packages-dist/router/testing/index.js', entry: '../../../dist/packages-dist/router/testing/index.js',
dest: '../../../dist/packages-dist/router/bundles/router-testing.umd.js', dest: '../../../dist/packages-dist/router/bundles/router-testing.umd.js',
@ -10,4 +18,4 @@ export default {
'@angular/platform-browser': 'ng.platformBrowser', '@angular/platform-browser': 'ng.platformBrowser',
'@angular/router': 'ng.router' '@angular/router': 'ng.router'
} }
} };

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
*/
export default { export default {
entry: '../../../dist/packages-dist/router/index.js', entry: '../../../dist/packages-dist/router/index.js',
dest: '../../../dist/packages-dist/router/bundles/router.umd.js', dest: '../../../dist/packages-dist/router/bundles/router.umd.js',
@ -28,8 +36,7 @@ export default {
'rxjs/operator/every': 'Rx.Observable.prototype', 'rxjs/operator/every': 'Rx.Observable.prototype',
'rxjs/operator/first': 'Rx.Observable.prototype', 'rxjs/operator/first': 'Rx.Observable.prototype',
'rxjs/operator/catch': 'Rx.Observable.prototype', 'rxjs/operator/catch': 'Rx.Observable.prototype',
'rxjs/operator/last': 'Rx.Observable.prototype' 'rxjs/operator/last': 'Rx.Observable.prototype',
}, },
plugins: [ plugins: []
] };
}

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
*/
export default { export default {
entry: '../../../dist/packages-dist/upgrade/index.js', entry: '../../../dist/packages-dist/upgrade/index.js',
@ -11,8 +18,9 @@ export default {
'@angular/platform-browser': 'ng.platformBrowser', '@angular/platform-browser': 'ng.platformBrowser',
'@angular/platform-browser-dynamic': 'ng.platformBrowserDynamic', '@angular/platform-browser-dynamic': 'ng.platformBrowserDynamic',
'rxjs/Subject': 'Rx', 'rxjs/Subject': 'Rx',
'rxjs/observable/PromiseObservable': 'Rx', // this is wrong, but this stuff has changed in rxjs b.6 so we need to fix it when we update. 'rxjs/observable/PromiseObservable': 'Rx', // this is wrong, but this stuff has changed in rxjs
// b.6 so we need to fix it when we update.
'rxjs/operator/toPromise': 'Rx.Observable.prototype', 'rxjs/operator/toPromise': 'Rx.Observable.prototype',
'rxjs/Observable': 'Rx' 'rxjs/Observable': 'Rx',
} }
} };

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
*/
'use strict'; 'use strict';
var fs = require('fs'); var fs = require('fs');

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
*/
'use strict'; 'use strict';
var browserProvidersConf = require('../../browser-providers.conf.js'); var browserProvidersConf = require('../../browser-providers.conf.js');

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
*/
angular.module('ngComponentRouter'). angular.module('ngComponentRouter').
value('$route', null). // can be overloaded with ngRouteShim value('$route', null). // can be overloaded with ngRouteShim

View File

@ -1,4 +1,11 @@
/** @license Copyright 2014-2016 Google, Inc. http://github.com/angular/angular/LICENSE */ /**
* @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 () { (function () {
'use strict'; 'use strict';
@ -282,8 +289,8 @@
var href = element.attr(hrefAttrName); var href = element.attr(hrefAttrName);
var target = element.attr('target'); var target = element.attr('target');
var isExternal = (['_blank', '_parent', '_self', '_top'].indexOf(target) > -1); var isExternal = (['_blank', '_parent', '_self', '_top'].indexOf(target) > -1);
if (href && $rootRouter.recognize(href) && !isExternal) { if (href && $rootRouter.recognize(href) && !isExternal) {
$rootRouter.navigateByUrl(href); $rootRouter.navigateByUrl(href);
event.preventDefault(); event.preventDefault();

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
*/
'use strict'; 'use strict';
describe('ngOutlet animations', function () { describe('ngOutlet animations', function () {

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
*/
'use strict'; 'use strict';
describe('Navigation lifecycle', function () { describe('Navigation lifecycle', function () {

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
*/
'use strict'; 'use strict';
describe('navigation', function () { describe('navigation', function () {

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
*/
'use strict'; 'use strict';
describe('router', function () { describe('router', function () {

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
*/
'use strict'; 'use strict';
describe('ngRoute shim', function () { describe('ngRoute shim', function () {

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
*/
'use strict'; 'use strict';
describe('ngLink', function () { describe('ngLink', function () {

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
*/
/* /*
* Helpers to keep tests DRY * Helpers to keep tests DRY
*/ */

View File

@ -1,3 +1,4 @@
// clang-format off
var lookup = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; var lookup = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
;(function (exports) { ;(function (exports) {

View File

@ -68,7 +68,7 @@ Bitmap.prototype.subsample =
function gamma(v) { return sample(Math.pow(v, .45455)); } function gamma(v) { return sample(Math.pow(v, .45455)); }
function row(pixel, width, y) { function row(pixel, width, y) {
var data = "\0"; var data = '\0';
for (var x = 0; x < width; x++) { for (var x = 0; x < width; x++) {
var r = pixel[x][y]; var r = pixel[x][y];
data += String.fromCharCode(gamma(r[0]), gamma(r[1]), gamma(r[2]), sample(r[3])); data += String.fromCharCode(gamma(r[0]), gamma(r[1]), gamma(r[2]), sample(r[3]));
@ -77,7 +77,7 @@ Bitmap.prototype.subsample =
} }
function rows(pixel, width, height) { function rows(pixel, width, height) {
var data = ""; var data = '';
for (var y = 0; y < height; y++) data += row(pixel, width, y); for (var y = 0; y < height; y++) data += row(pixel, width, y);
return data; return data;
} }
@ -95,8 +95,8 @@ Bitmap.prototype.subsample =
function deflate(data) { function deflate(data) {
var len = data.length; var len = data.length;
return "\170\1\1" + String.fromCharCode(len & 255, len >>> 8, ~len & 255, (~len >>> 8) & 255) + return '\170\1\1' + String.fromCharCode(len & 255, len >>> 8, ~len & 255, (~len >>> 8) & 255) +
data + hton(adler(data)); data + hton(adler(data));
} }
function crc32(data) { function crc32(data) {
@ -110,18 +110,18 @@ Bitmap.prototype.subsample =
function chunk(type, data) { return hton(data.length) + type + data + hton(crc32(type + data)); } function chunk(type, data) { return hton(data.length) + type + data + hton(crc32(type + data)); }
function base64(data) { function base64(data) {
enc = ""; enc = '';
for (var i = 5, n = data.length * 8 + 5; i < n; i += 6) for (var i = 5, n = data.length * 8 + 5; i < n; i += 6)
enc += "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" enc += 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
[(data.charCodeAt(~~(i / 8) - 1) << 8 | data.charCodeAt(~~(i / 8))) >> 7 - i % 8 & 63]; [(data.charCodeAt(~~(i / 8) - 1) << 8 | data.charCodeAt(~~(i / 8))) >> 7 - i % 8 & 63];
for (; enc.length % 4; enc += "=") for (; enc.length % 4; enc += '=')
; ;
return enc; return enc;
} }
var png = "\211PNG\r\n\32\n" + var png = '\211PNG\r\n\32\n' +
chunk("IHDR", hton(this.width) + hton(this.height) + "\10\6\0\0\0") + chunk('IHDR', hton(this.width) + hton(this.height) + '\10\6\0\0\0') +
chunk("IDAT", deflate(rows(this.pixel, this.width, this.height))) + chunk("IEND", ""); chunk('IDAT', deflate(rows(this.pixel, this.width, this.height))) + chunk('IEND', '');
return "data:image/png;base64," + base64(png); return 'data:image/png;base64,' + base64(png);
} }

View File

@ -1,9 +1,15 @@
importScripts("../../../vendor/core.js", /**
"../../../vendor/zone.js", * @license
"../../../vendor/long-stack-trace-zone.js", * Copyright Google Inc. All Rights Reserved.
"../../../vendor/system.src.js", *
"../../../vendor/Reflect.js", * Use of this source code is governed by an MIT-style license that can be
"b64.js"); * found in the LICENSE file at https://angular.io/license
*/
importScripts(
'../../../vendor/core.js', '../../../vendor/zone.js',
'../../../vendor/long-stack-trace-zone.js', '../../../vendor/system.src.js',
'../../../vendor/Reflect.js', 'b64.js');
System.config({ System.config({
@ -19,21 +25,19 @@ System.config({
'@angular/platform-webworker': {main: 'index.js', defaultExtension: 'js'}, '@angular/platform-webworker': {main: 'index.js', defaultExtension: 'js'},
'@angular/platform-webworker-dynamic': {main: 'index.js', defaultExtension: 'js'}, '@angular/platform-webworker-dynamic': {main: 'index.js', defaultExtension: 'js'},
'@angular/router': {main: 'index.js', defaultExtension: 'js'}, '@angular/router': {main: 'index.js', defaultExtension: 'js'},
'rxjs': { 'rxjs': {defaultExtension: 'js'},
defaultExtension: 'js'
}
}, },
defaultJSExtensions: true defaultJSExtensions: true
}); });
System.import("playground/src/web_workers/images/background_index") System.import('playground/src/web_workers/images/background_index')
.then( .then(
function(m) { function(m) {
try { try {
m.main(); m.main();
} catch (e) { } catch (e) {
console.error(e); console.error(e);
} }
}, },
function(error) { console.error("error loading background", error); }); function(error) { console.error('error loading background', error); });

View File

@ -1,8 +1,15 @@
importScripts("../../../vendor/core.js", /**
"../../../vendor/zone.js", * @license
"../../../vendor/long-stack-trace-zone.js", * Copyright Google Inc. All Rights Reserved.
"../../../vendor/system.src.js", *
"../../../vendor/Reflect.js"); * 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
*/
importScripts(
'../../../vendor/core.js', '../../../vendor/zone.js',
'../../../vendor/long-stack-trace-zone.js', '../../../vendor/system.src.js',
'../../../vendor/Reflect.js');
System.config({ System.config({
@ -18,21 +25,19 @@ System.config({
'@angular/platform-browser-dynamic': {main: 'index.js', defaultExtension: 'js'}, '@angular/platform-browser-dynamic': {main: 'index.js', defaultExtension: 'js'},
'@angular/platform-webworker': {main: 'index.js', defaultExtension: 'js'}, '@angular/platform-webworker': {main: 'index.js', defaultExtension: 'js'},
'@angular/platform-webworker-dynamic': {main: 'index.js', defaultExtension: 'js'}, '@angular/platform-webworker-dynamic': {main: 'index.js', defaultExtension: 'js'},
'rxjs': { 'rxjs': {defaultExtension: 'js'},
defaultExtension: 'js'
}
}, },
defaultJSExtensions: true defaultJSExtensions: true
}); });
System.import("playground/src/web_workers/input/background_index") System.import('playground/src/web_workers/input/background_index')
.then( .then(
function(m) { function(m) {
try { try {
m.main(); m.main();
} catch (e) { } catch (e) {
console.error(e); console.error(e);
} }
}, },
function(error) { console.error("error loading background", error); }); function(error) { console.error('error loading background', error); });

View File

@ -1,8 +1,15 @@
importScripts("../../../vendor/core.js", /**
"../../../vendor/zone.js", * @license
"../../../vendor/long-stack-trace-zone.js", * Copyright Google Inc. All Rights Reserved.
"../../../vendor/system.src.js", *
"../../../vendor/Reflect.js"); * 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
*/
importScripts(
'../../../vendor/core.js', '../../../vendor/zone.js',
'../../../vendor/long-stack-trace-zone.js', '../../../vendor/system.src.js',
'../../../vendor/Reflect.js');
System.config({ System.config({
@ -19,21 +26,19 @@ System.config({
'@angular/platform-webworker': {main: 'index.js', defaultExtension: 'js'}, '@angular/platform-webworker': {main: 'index.js', defaultExtension: 'js'},
'@angular/platform-webworker-dynamic': {main: 'index.js', defaultExtension: 'js'}, '@angular/platform-webworker-dynamic': {main: 'index.js', defaultExtension: 'js'},
'@angular/router': {main: 'index.js', defaultExtension: 'js'}, '@angular/router': {main: 'index.js', defaultExtension: 'js'},
'rxjs': { 'rxjs': {defaultExtension: 'js'},
defaultExtension: 'js'
},
}, },
defaultJSExtensions: true defaultJSExtensions: true
}); });
System.import("playground/src/web_workers/kitchen_sink/background_index") System.import('playground/src/web_workers/kitchen_sink/background_index')
.then( .then(
function(m) { function(m) {
try { try {
m.main(); m.main();
} catch (e) { } catch (e) {
console.error(e); console.error(e);
} }
}, },
function(error) { console.error("error loading background", error); }); function(error) { console.error('error loading background', error); });

View File

@ -1,8 +1,15 @@
importScripts("../../../vendor/core.js", /**
"../../../vendor/zone.js", * @license
"../../../vendor/long-stack-trace-zone.js", * Copyright Google Inc. All Rights Reserved.
"../../../vendor/system.src.js", *
"../../../vendor/Reflect.js"); * 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
*/
importScripts(
'../../../vendor/core.js', '../../../vendor/zone.js',
'../../../vendor/long-stack-trace-zone.js', '../../../vendor/system.src.js',
'../../../vendor/Reflect.js');
System.config({ System.config({
@ -19,21 +26,19 @@ System.config({
'@angular/router': {main: 'index.js', defaultExtension: 'js'}, '@angular/router': {main: 'index.js', defaultExtension: 'js'},
'@angular/platform-webworker': {main: 'index.js', defaultExtension: 'js'}, '@angular/platform-webworker': {main: 'index.js', defaultExtension: 'js'},
'@angular/platform-webworker-dynamic': {main: 'index.js', defaultExtension: 'js'}, '@angular/platform-webworker-dynamic': {main: 'index.js', defaultExtension: 'js'},
'rxjs': { 'rxjs': {defaultExtension: 'js'},
defaultExtension: 'js'
},
}, },
defaultJSExtensions: true defaultJSExtensions: true
}); });
System.import("playground/src/web_workers/message_broker/background_index") System.import('playground/src/web_workers/message_broker/background_index')
.then( .then(
function(m) { function(m) {
try { try {
m.main(); m.main();
} catch (e) { } catch (e) {
console.error(e); console.error(e);
} }
}, },
function(error) { console.error("error loading background", error); }); function(error) { console.error('error loading background', error); });

View File

@ -1,8 +1,15 @@
importScripts("../../../vendor/core.js", /**
"../../../vendor/zone.js", * @license
"../../../vendor/long-stack-trace-zone.js", * Copyright Google Inc. All Rights Reserved.
"../../../vendor/system.src.js", *
"../../../vendor/Reflect.js"); * 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
*/
importScripts(
'../../../vendor/core.js', '../../../vendor/zone.js',
'../../../vendor/long-stack-trace-zone.js', '../../../vendor/system.src.js',
'../../../vendor/Reflect.js');
System.config({ System.config({
@ -19,21 +26,19 @@ System.config({
'@angular/platform-webworker': {main: 'index.js', defaultExtension: 'js'}, '@angular/platform-webworker': {main: 'index.js', defaultExtension: 'js'},
'@angular/platform-webworker-dynamic': {main: 'index.js', defaultExtension: 'js'}, '@angular/platform-webworker-dynamic': {main: 'index.js', defaultExtension: 'js'},
'@angular/router': {main: 'index.js', defaultExtension: 'js'}, '@angular/router': {main: 'index.js', defaultExtension: 'js'},
'rxjs': { 'rxjs': {defaultExtension: 'js'},
defaultExtension: 'js'
},
}, },
defaultJSExtensions: true defaultJSExtensions: true
}); });
System.import("playground/src/web_workers/router/background_index") System.import('playground/src/web_workers/router/background_index')
.then( .then(
function(m) { function(m) {
try { try {
m.main(); m.main();
} catch (e) { } catch (e) {
console.error(e); console.error(e);
} }
}, },
function(error) { console.error("error loading background", error); }); function(error) { console.error('error loading background', error); });

View File

@ -1,8 +1,15 @@
importScripts("../../../vendor/core.js", /**
"../../../vendor/zone.js", * @license
"../../../vendor/long-stack-trace-zone.js", * Copyright Google Inc. All Rights Reserved.
"../../../vendor/system.src.js", *
"../../../vendor/Reflect.js"); * 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
*/
importScripts(
'../../../vendor/core.js', '../../../vendor/zone.js',
'../../../vendor/long-stack-trace-zone.js', '../../../vendor/system.src.js',
'../../../vendor/Reflect.js');
System.config({ System.config({
@ -20,21 +27,19 @@ System.config({
'@angular/platform-webworker': {main: 'index.js', defaultExtension: 'js'}, '@angular/platform-webworker': {main: 'index.js', defaultExtension: 'js'},
'@angular/platform-webworker-dynamic': {main: 'index.js', defaultExtension: 'js'}, '@angular/platform-webworker-dynamic': {main: 'index.js', defaultExtension: 'js'},
'@angular/router': {main: 'index.js', defaultExtension: 'js'}, '@angular/router': {main: 'index.js', defaultExtension: 'js'},
'rxjs': { 'rxjs': {defaultExtension: 'js'},
defaultExtension: 'js'
}
}, },
defaultJSExtensions: true defaultJSExtensions: true
}); });
System.import("playground/src/web_workers/todo/background_index") System.import('playground/src/web_workers/todo/background_index')
.then( .then(
function(m) { function(m) {
try { try {
m.main(); m.main();
} catch (e) { } catch (e) {
console.error(e); console.error(e);
} }
}, },
function(error) { console.error("error loading background", error); }); function(error) { console.error('error loading background', error); });

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
*/
var HelloWorldComponent = ng.core.Component({ var HelloWorldComponent = ng.core.Component({
selector: 'hello-world', selector: 'hello-world',
//template: 'hello world!!!' //template: 'hello world!!!'

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
*/
// import typescript from 'rollup-plugin-typescript'; // import typescript from 'rollup-plugin-typescript';
// import tsc from 'typescript' // import tsc from 'typescript'

View File

@ -1,45 +1,42 @@
/**
* @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
*/
// Make sure that the command line is read as the first thing // Make sure that the command line is read as the first thing
// as this could exit node if the help script should be printed. // as this could exit node if the help script should be printed.
require('./dist/all/e2e_util/e2e_util').readCommandLine(); require('./dist/all/e2e_util/e2e_util').readCommandLine();
var BROWSER_OPTIONS = { var BROWSER_OPTIONS = {
LocalChrome: { LocalChrome: {
'browserName': 'chrome' 'browserName': 'chrome',
}, },
ChromeOnTravis: { ChromeOnTravis: {
browserName: 'chrome', browserName: 'chrome',
chromeOptions: { chromeOptions: {
'args': ['--no-sandbox'], 'args': ['--no-sandbox'],
'binary': process.env.CHROME_BIN 'binary': process.env.CHROME_BIN,
} }
} }
}; };
exports.config = { exports.config = {
onPrepare: function() { onPrepare: function() { beforeEach(function() { browser.ignoreSynchronization = false; }); },
beforeEach(function() {
browser.ignoreSynchronization = false;
});
},
allScriptsTimeout: 11000, allScriptsTimeout: 11000,
specs: [ specs: ['dist/all/**/e2e_test/**/*_spec.js'],
'dist/all/**/e2e_test/**/*_spec.js'
],
exclude: [ exclude: [
'dist/all/@angular/examples/**', 'dist/all/@angular/examples/**',
'**/key_events/**', // can't tell why this is failing '**/key_events/**', // can't tell why this is failing
'**/sourcemap/**' // fails only on travis '**/sourcemap/**' // fails only on travis
], ],
capabilities: process.env.TRAVIS ? BROWSER_OPTIONS.ChromeOnTravis : BROWSER_OPTIONS.LocalChrome, capabilities: process.env.TRAVIS ? BROWSER_OPTIONS.ChromeOnTravis : BROWSER_OPTIONS.LocalChrome,
directConnect: true, directConnect: true,
baseUrl: 'http://localhost:8000/', baseUrl: 'http://localhost:8000/',
framework: 'jasmine2', framework: 'jasmine2',
jasmineNodeOpts: { jasmineNodeOpts:
showColors: true, {showColors: true, defaultTimeoutInterval: 60000, print: function(msg) { console.log(msg) }},
defaultTimeoutInterval: 60000, useAllAngular2AppRoots: true,
print: function(msg) { console.log(msg)}
},
useAllAngular2AppRoots: true
}; };

View File

@ -1,30 +1,30 @@
/**
* @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
*/
// Make sure that the command line is read as the first thing // Make sure that the command line is read as the first thing
// as this could exit node if the help script should be printed. // as this could exit node if the help script should be printed.
require('./dist/all/e2e_util/e2e_util').readCommandLine(); require('./dist/all/e2e_util/e2e_util').readCommandLine();
var BROWSER_OPTIONS = { var BROWSER_OPTIONS = {
LocalChrome: { LocalChrome: {'browserName': 'chrome'},
'browserName': 'chrome'
},
ChromeOnTravis: { ChromeOnTravis: {
browserName: 'chrome', browserName: 'chrome',
chromeOptions: { chromeOptions: {
'args': ['--no-sandbox'], 'args': ['--no-sandbox'],
'binary': process.env.CHROME_BIN 'binary': process.env.CHROME_BIN,
} }
} },
}; };
exports.config = { exports.config = {
onPrepare: function() { onPrepare: function() { beforeEach(function() { browser.ignoreSynchronization = false; }); },
beforeEach(function() {
browser.ignoreSynchronization = false;
});
},
allScriptsTimeout: 11000, allScriptsTimeout: 11000,
specs: [ specs: ['dist/examples/**/e2e_test/*_spec.js'],
'dist/examples/**/e2e_test/*_spec.js'
],
capabilities: process.env.TRAVIS ? BROWSER_OPTIONS.ChromeOnTravis : BROWSER_OPTIONS.LocalChrome, capabilities: process.env.TRAVIS ? BROWSER_OPTIONS.ChromeOnTravis : BROWSER_OPTIONS.LocalChrome,
directConnect: true, directConnect: true,
baseUrl: 'http://localhost:8001/', baseUrl: 'http://localhost:8001/',
@ -32,7 +32,7 @@ exports.config = {
jasmineNodeOpts: { jasmineNodeOpts: {
showColors: true, showColors: true,
defaultTimeoutInterval: 60000, defaultTimeoutInterval: 60000,
print: function(msg) { console.log(msg)} print: function(msg) { console.log(msg); },
}, },
useAllAngular2AppRoots: true useAllAngular2AppRoots: true
}; };

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
*/
// Make sure that the command line is read as the first thing // Make sure that the command line is read as the first thing
// as this could exit node if the help script should be printed. // as this could exit node if the help script should be printed.
require('./dist/all/e2e_util/perf_util').readCommandLine(); require('./dist/all/e2e_util/perf_util').readCommandLine();
@ -15,32 +23,26 @@ var BROWSER_CAPS = {
chromeOptions: CHROME_OPTIONS, chromeOptions: CHROME_OPTIONS,
loggingPrefs: { loggingPrefs: {
performance: 'ALL', performance: 'ALL',
browser: 'ALL' browser: 'ALL',
} }
}, },
ChromeOnTravis: { ChromeOnTravis: {
browserName: 'chrome', browserName: 'chrome',
chromeOptions: mergeInto(CHROME_OPTIONS, { chromeOptions: mergeInto(CHROME_OPTIONS, {
'binary': process.env.CHROME_BIN 'binary': process.env.CHROME_BIN,
}), }),
loggingPrefs: { loggingPrefs: {
performance: 'ALL', performance: 'ALL',
browser: 'ALL' browser: 'ALL',
} }
} }
}; };
exports.config = { exports.config = {
onPrepare: function() { onPrepare: function() { beforeEach(function() { browser.ignoreSynchronization = false; }); },
beforeEach(function() {
browser.ignoreSynchronization = false;
});
},
restartBrowserBetweenTests: true, restartBrowserBetweenTests: true,
allScriptsTimeout: 11000, allScriptsTimeout: 11000,
specs: [ specs: ['dist/all/**/e2e_test/**/*_perf.js'],
'dist/all/**/e2e_test/**/*_perf.js'
],
capabilities: process.env.TRAVIS ? BROWSER_CAPS.ChromeOnTravis : BROWSER_CAPS.LocalChrome, capabilities: process.env.TRAVIS ? BROWSER_CAPS.ChromeOnTravis : BROWSER_CAPS.LocalChrome,
directConnect: true, directConnect: true,
baseUrl: 'http://localhost:8000/', baseUrl: 'http://localhost:8000/',
@ -48,14 +50,14 @@ exports.config = {
jasmineNodeOpts: { jasmineNodeOpts: {
showColors: true, showColors: true,
defaultTimeoutInterval: 60000, defaultTimeoutInterval: 60000,
print: function(msg) { console.log(msg)} print: function(msg) { console.log(msg); },
}, },
useAllAngular2AppRoots: true useAllAngular2AppRoots: true
}; };
function mergeInto(src, target) { function mergeInto(src, target) {
for (var prop in src) { for (var prop in src) {
target[prop] = src[prop]; target[prop] = src[prop];
} }
return target; return target;
} }

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
*/
'use strict'; 'use strict';
var fs = require('fs'); var fs = require('fs');

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
*/
// clang-format off
// This file is used for internal testing with Karma only, it should not be used in real applications. // This file is used for internal testing with Karma only, it should not be used in real applications.
// function.name (all IE) // function.name (all IE)

View File

@ -1,5 +1,13 @@
/**
* @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
*/
// Tun on full stack traces in errors to help debugging // Tun on full stack traces in errors to help debugging
Error.stackTraceLimit=Infinity; Error.stackTraceLimit = Infinity;
jasmine.DEFAULT_TIMEOUT_INTERVAL = 100; jasmine.DEFAULT_TIMEOUT_INTERVAL = 100;
@ -17,94 +25,32 @@ System.config({
'parse5': 'dist/all/empty.js', 'parse5': 'dist/all/empty.js',
'@angular/platform-server/src/parse5_adapter': 'dist/all/empty.js', '@angular/platform-server/src/parse5_adapter': 'dist/all/empty.js',
'angular2/*': 'dist/all/angular2/*.js', 'angular2/*': 'dist/all/angular2/*.js',
'angular2/src/alt_router/router_testing_providers': 'dist/all/angular2/src/alt_router/router_testing_providers.js' 'angular2/src/alt_router/router_testing_providers':
'dist/all/angular2/src/alt_router/router_testing_providers.js'
}, },
packages: { packages: {
'@angular/core/testing': { '@angular/core/testing': {main: 'index.js', defaultExtension: 'js'},
main: 'index.js', '@angular/core': {main: 'index.js', defaultExtension: 'js'},
defaultExtension: 'js' '@angular/compiler/testing': {main: 'index.js', defaultExtension: 'js'},
}, '@angular/compiler': {main: 'index.js', defaultExtension: 'js'},
'@angular/core': { '@angular/common/testing': {main: 'index.js', defaultExtension: 'js'},
main: 'index.js', '@angular/common': {main: 'index.js', defaultExtension: 'js'},
defaultExtension: 'js' '@angular/forms': {main: 'index.js', defaultExtension: 'js'},
},
'@angular/compiler/testing': {
main: 'index.js',
defaultExtension: 'js'
},
'@angular/compiler': {
main: 'index.js',
defaultExtension: 'js'
},
'@angular/common/testing': {
main: 'index.js',
defaultExtension: 'js'
},
'@angular/common': {
main: 'index.js',
defaultExtension: 'js'
},
'@angular/forms': {
main: 'index.js',
defaultExtension: 'js'
},
// remove after all tests imports are fixed // remove after all tests imports are fixed
'@angular/facade': { '@angular/facade': {main: 'index.js', defaultExtension: 'js'},
main: 'index.js', '@angular/router/testing': {main: 'index.js', defaultExtension: 'js'},
defaultExtension: 'js' '@angular/router': {main: 'index.js', defaultExtension: 'js'},
}, '@angular/http/testing': {main: 'index.js', defaultExtension: 'js'},
'@angular/router/testing': { '@angular/http': {main: 'index.js', defaultExtension: 'js'},
main: 'index.js', '@angular/upgrade': {main: 'index.js', defaultExtension: 'js'},
defaultExtension: 'js' '@angular/platform-browser/testing': {main: 'index.js', defaultExtension: 'js'},
}, '@angular/platform-browser': {main: 'index.js', defaultExtension: 'js'},
'@angular/router': { '@angular/platform-browser-dynamic/testing': {main: 'index.js', defaultExtension: 'js'},
main: 'index.js', '@angular/platform-browser-dynamic': {main: 'index.js', defaultExtension: 'js'},
defaultExtension: 'js' '@angular/platform-server/testing': {main: 'index.js', defaultExtension: 'js'},
}, '@angular/platform-server': {main: 'index.js', defaultExtension: 'js'},
'@angular/http/testing': { '@angular/platform-webworker': {main: 'index.js', defaultExtension: 'js'},
main: 'index.js', '@angular/platform-webworker-dynamic': {main: 'index.js', defaultExtension: 'js'},
defaultExtension: 'js'
},
'@angular/http': {
main: 'index.js',
defaultExtension: 'js'
},
'@angular/upgrade': {
main: 'index.js',
defaultExtension: 'js'
},
'@angular/platform-browser/testing': {
main: 'index.js',
defaultExtension: 'js'
},
'@angular/platform-browser': {
main: 'index.js',
defaultExtension: 'js'
},
'@angular/platform-browser-dynamic/testing': {
main: 'index.js',
defaultExtension: 'js'
},
'@angular/platform-browser-dynamic': {
main: 'index.js',
defaultExtension: 'js'
},
'@angular/platform-server/testing': {
main: 'index.js',
defaultExtension: 'js'
},
'@angular/platform-server': {
main: 'index.js',
defaultExtension: 'js'
},
'@angular/platform-webworker': {
main: 'index.js',
defaultExtension: 'js'
},
'@angular/platform-webworker-dynamic': {
main: 'index.js',
defaultExtension: 'js'
}
} }
}); });
@ -112,34 +58,33 @@ System.config({
// Set up the test injector, then import all the specs, execute their `main()` // Set up the test injector, then import all the specs, execute their `main()`
// method and kick off Karma (Jasmine). // method and kick off Karma (Jasmine).
System.import('@angular/core/testing') System.import('@angular/core/testing')
.then(function(coreTesting){ .then(function(coreTesting) {
return System.import('@angular/platform-browser-dynamic/testing') return System.import('@angular/platform-browser-dynamic/testing')
.then(function(browserTesting) { .then(function(browserTesting) {
coreTesting.TestBed.initTestEnvironment( coreTesting.TestBed.initTestEnvironment(
browserTesting.BrowserDynamicTestingModule, browserTesting.BrowserDynamicTestingModule,
browserTesting.platformBrowserDynamicTesting()); browserTesting.platformBrowserDynamicTesting());
}); });
}) })
.then(function() { .then(function() {
return Promise.all( return Promise.all(Object
Object.keys(window.__karma__.files) // All files served by Karma. .keys(window.__karma__.files) // All files served by Karma.
.filter(onlySpecFiles) .filter(onlySpecFiles)
.map(window.file2moduleName) // Normalize paths to module names. .map(window.file2moduleName) // Normalize paths to module names.
.map(function(path) { .map(function(path) {
return System.import(path).then(function(module) { return System.import(path).then(function(module) {
if (module.hasOwnProperty('main')) { if (module.hasOwnProperty('main')) {
module.main(); module.main();
} else { } else {
throw new Error('Module ' + path + ' does not implement main() method.'); throw new Error(
} 'Module ' + path + ' does not implement main() method.');
}); }
})); });
}) }));
.then(function() { })
__karma__.start(); .then(
}, function(error) { function() { __karma__.start(); },
__karma__.error(error.stack || error); function(error) { __karma__.error(error.stack || error); });
});
function onlySpecFiles(path) { function onlySpecFiles(path) {

View File

@ -1,6 +1,11 @@
module.exports = function(gulp, plugins, config) { /**
return function(done) { * @license
del(config.path, done); * 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 = function(gulp, plugins, config) {
return function(done) { del(config.path, done); };
};

View File

@ -1,15 +1,24 @@
/**
* @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 file2moduleName(filePath) { function file2moduleName(filePath) {
return filePath.replace(/\\/g, '/') return filePath
// module name should be relative to `modules` and `tools` folder .replace(/\\/g, '/')
.replace(/.*\/modules\//, '') // module name should be relative to `modules` and `tools` folder
// and 'dist' folder .replace(/.*\/modules\//, '')
.replace(/.*\/dist\/js\/dev\/es5\//, '') // and 'dist' folder
// module name should not include `lib`, `web` folders .replace(/.*\/dist\/js\/dev\/es5\//, '')
// as they are wrapper packages for dart // module name should not include `lib`, `web` folders
.replace(/\/web\//, '/') // as they are wrapper packages for dart
.replace(/\/lib\//, '/') .replace(/\/web\//, '/')
// module name should not have a suffix .replace(/\/lib\//, '/')
.replace(/\.\w*$/, ''); // module name should not have a suffix
.replace(/\.\w*$/, '');
} }
if (typeof module !== 'undefined') { if (typeof module !== 'undefined') {
module.exports = file2moduleName; module.exports = file2moduleName;

View File

@ -1,7 +1,15 @@
/**
* @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
*/
var fs = require('fs'); var fs = require('fs');
module.exports = function(licenseFile, outputFile) { module.exports = function(licenseFile, outputFile) {
var licenseText = fs.readFileSync(licenseFile); var licenseText = fs.readFileSync(licenseFile);
var license = "/**\n @license\n" + licenseText + "\n */\n"; var license = '/**\n @license\n' + licenseText + '\n */\n';
if (outputFile) { if (outputFile) {
outputFile = licenseFile + '.wrapped'; outputFile = licenseFile + '.wrapped';
fs.writeFileSync(outputFile, license, 'utf8'); fs.writeFileSync(outputFile, license, 'utf8');

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
*/
var fs = require('fs'); var fs = require('fs');
var path = require('path'); var path = require('path');
@ -8,8 +16,7 @@ module.exports = function(gulp, plugins, config) {
console.log('creating link', linkDir, sourceDir); console.log('creating link', linkDir, sourceDir);
try { try {
fs.symlinkSync(sourceDir, linkDir, 'dir'); fs.symlinkSync(sourceDir, linkDir, 'dir');
} } catch (e) {
catch(e) {
var sourceDir = path.join(config.dir, relativeFolder); var sourceDir = path.join(config.dir, relativeFolder);
console.log('linking failed: trying to hard copy', linkDir, sourceDir); console.log('linking failed: trying to hard copy', linkDir, sourceDir);
copyRecursiveSync(sourceDir, linkDir); copyRecursiveSync(sourceDir, linkDir);
@ -35,14 +42,13 @@ module.exports = function(gulp, plugins, config) {
}; };
}; };
function copyRecursiveSync (src, dest) { function copyRecursiveSync(src, dest) {
if (fs.existsSync(src)) { if (fs.existsSync(src)) {
var stats = fs.statSync(src); var stats = fs.statSync(src);
if (stats.isDirectory()) { if (stats.isDirectory()) {
fs.mkdirSync(dest); fs.mkdirSync(dest);
fs.readdirSync(src).forEach(function(childItemName) { fs.readdirSync(src).forEach(function(childItemName) {
copyRecursiveSync(path.join(src, childItemName), copyRecursiveSync(path.join(src, childItemName), path.join(dest, childItemName));
path.join(dest, childItemName));
}); });
} else { } else {
fs.writeFileSync(dest, fs.readFileSync(src)); fs.writeFileSync(dest, fs.readFileSync(src));

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
*/
var kLogsArgument = /^--logs\s*=\s*(.+?)$/; var kLogsArgument = /^--logs\s*=\s*(.+?)$/;
var kTrimLeft = /^\s+/; var kTrimLeft = /^\s+/;
var kTrimRight = /\s+$/; var kTrimRight = /\s+$/;
@ -15,23 +23,18 @@ function findArgvLogs() {
} }
function logsToObject(logstr) { function logsToObject(logstr) {
return logstr. return logstr.split(',').reduce(function(obj, key) {
split(','). key = camelize(key);
reduce(function(obj, key) { if (key.length > 0) obj[key] = true;
key = camelize(key); return obj;
if (key.length > 0) obj[key] = true; }, Object.create(null));
return obj;
}, Object.create(null));
return logs; return logs;
} }
function camelize(str) { function camelize(str) {
return str. return str.replace(kTrimLeft, '').replace(kTrimRight, '').replace(kCamelCase, function(match, c) {
replace(kTrimLeft, ''). return c ? c.toUpperCase() : '';
replace(kTrimRight, ''). });
replace(kCamelCase, function(match, c) {
return c ? c.toUpperCase() : "";
});
} }
function shouldLog(str) { function shouldLog(str) {

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
*/
// helper script that will read out the url parameters // helper script that will read out the url parameters
// and store them in appropriate form fields on the page // and store them in appropriate form fields on the page
(function() { (function() {
@ -6,9 +14,9 @@
while (match = regex.exec(search)) { while (match = regex.exec(search)) {
var name = match[1]; var name = match[1];
var value = match[2]; var value = match[2];
var els = document.querySelectorAll('input[name="'+name+'"]'); var els = document.querySelectorAll('input[name="' + name + '"]');
var el; var el;
for (var i=0; i<els.length; i++) { for (var i = 0; i < els.length; i++) {
el = els[i]; el = els[i];
if (el.type === 'radio' || el.type === 'checkbox') { if (el.type === 'radio' || el.type === 'checkbox') {
el.checked = el.value === value; el.checked = el.value === value;

View File

@ -1,5 +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
*/
var fs = require('fs'); var fs = require('fs');
var path = require('path');
var minimatch = require('minimatch'); var minimatch = require('minimatch');
var path = require('path'); var path = require('path');
var Q = require('q'); var Q = require('q');
@ -21,10 +28,8 @@ function subDirs(dir) {
function forEachSubDir(dir, callback) { function forEachSubDir(dir, callback) {
var dirs = subDirs(dir); var dirs = subDirs(dir);
return Q.all(dirs.map(function(subdir) { return Q.all(dirs.map(function(subdir) { return callback(path.join(dir, subdir)); }));
return callback(path.join(dir, subdir)); }
}));
};
function forEachSubDirSequential(dir, callback) { function forEachSubDirSequential(dir, callback) {
var dirs = subDirs(dir); var dirs = subDirs(dir);
@ -32,9 +37,7 @@ function forEachSubDirSequential(dir, callback) {
function next(index) { function next(index) {
if (index < dirs.length) { if (index < dirs.length) {
return callback(path.join(dir, dirs[index])).then(function() { return callback(path.join(dir, dirs[index])).then(function() { return next(index + 1); });
return next(index+1);
});
} else { } else {
return true; return true;
} }
@ -75,6 +78,6 @@ function filterByFile(pathMapping, folder) {
if (match !== undefined) { if (match !== undefined) {
return match; return match;
} else { } else {
throw new Error('No entry for folder '+folder+' found in '+JSON.stringify(pathMapping)); throw new Error('No entry for folder ' + folder + ' found in ' + JSON.stringify(pathMapping));
} }
} }

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
*/
var chokidar = require('chokidar'); var chokidar = require('chokidar');
var runSequence = require('run-sequence'); var runSequence = require('run-sequence');
var path = require('path'); var path = require('path');
@ -16,9 +24,7 @@ function watch(globs, opts, tasks) {
if (!Array.isArray(tasks)) tasks = [tasks]; if (!Array.isArray(tasks)) tasks = [tasks];
tasks = tasks.slice(); tasks = tasks.slice();
tasks.push(tasksDone); tasks.push(tasksDone);
runTasks = function runTaskSequence() { runTasks = function runTaskSequence() { runSequence.apply(null, tasks); };
runSequence.apply(null, tasks);
}
} else { } else {
var sync = tasks.length === 0; var sync = tasks.length === 0;
runTasks = function runCallback() { runTasks = function runCallback() {
@ -42,13 +48,11 @@ function watch(globs, opts, tasks) {
var delay = opts.delay; var delay = opts.delay;
if (delay === undefined) delay = 100; if (delay === undefined) delay = 100;
var watcher = chokidar.watch(globs, opts). var watcher =
on('all', handleEvent). chokidar.watch(globs, opts).on('all', handleEvent).on('error', function(err) { throw err; });
on('error', function(err) {
throw err;
});
var log = function watchLogger(triggerCount) { var log =
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;
@ -62,7 +66,7 @@ function watch(globs, opts, tasks) {
function prettyTime() { function prettyTime() {
var now = new Date(); var now = new Date();
return now.toLocaleDateString() + " at " + now.toLocaleTimeString(); return now.toLocaleDateString() + ' at ' + now.toLocaleTimeString();
} }
} }
@ -76,8 +80,8 @@ function watch(globs, opts, tasks) {
close(); close();
}; };
var eventsRecorded = 0; // Number of events recorded var eventsRecorded = 0; // Number of events recorded
var timeoutId = null; // If non-null, event capture window is open var timeoutId = null; // If non-null, event capture window is open
if (!ignoreInitial) { if (!ignoreInitial) {
// synthetic event to kick off the first task run // synthetic event to kick off the first task run

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
*/
var rewire = require('rewire'); var rewire = require('rewire');
describe('watch()', function() { describe('watch()', function() {
@ -27,7 +35,7 @@ describe('watch()', function() {
it('should fire callback once for events which occur within `delay` window', function() { it('should fire callback once for events which occur within `delay` window', function() {
var cb = jasmine.createSpy('callback'); var cb = jasmine.createSpy('callback');
watcher = watch('./$$fake_path/**/*', { delay: 10, log: false }, cb); watcher = watch('./$$fake_path/**/*', {delay: 10, log: false}, cb);
watcher._emit('add', './$$fake_path/test.txt'); watcher._emit('add', './$$fake_path/test.txt');
timeout.flush(9); timeout.flush(9);
@ -61,7 +69,7 @@ describe('watch()', function() {
expect(timeout.pending).toBe(1); expect(timeout.pending).toBe(1);
} }
var watcher = watch('./$$fake_path/**/*', { delay: 10, log: false }, cb); var watcher = watch('./$$fake_path/**/*', {delay: 10, log: false}, cb);
watcher._emit('change', './$$fake_path/test1.txt'); watcher._emit('change', './$$fake_path/test1.txt');
expect(timeout.pending).toBe(1); expect(timeout.pending).toBe(1);
@ -81,7 +89,7 @@ describe('watch()', function() {
done(); done();
} }
var watcher = watch('./$$fake_path/**/*', { delay: 10, log: false }, cb); var watcher = watch('./$$fake_path/**/*', {delay: 10, log: false}, cb);
watcher._emit('change', './$$fake_path/test1.txt'); watcher._emit('change', './$$fake_path/test1.txt');
timeout.flush(); timeout.flush();
@ -96,7 +104,7 @@ describe('watch()', function() {
it('should cancel pending callback if FSWatcher is closed', function() { it('should cancel pending callback if FSWatcher is closed', function() {
var cb = jasmine.createSpy('callback'); var cb = jasmine.createSpy('callback');
var watcher = watch('./$$fake_path/**/*', { delay: 10, log: false }, cb); var watcher = watch('./$$fake_path/**/*', {delay: 10, log: false}, cb);
watcher._emit('change', './$$fake_path/test1.txt'); watcher._emit('change', './$$fake_path/test1.txt');
expect(timeout.pending).toBe(1); expect(timeout.pending).toBe(1);
@ -119,7 +127,7 @@ describe('watch()', function() {
expect(timeout.pending).toBe(0); expect(timeout.pending).toBe(0);
} }
var watcher = watch('./$$fake_path/**/*', { delay: 10, log: false }, cb); var watcher = watch('./$$fake_path/**/*', {delay: 10, log: false}, cb);
watcher._emit('change', './$$fake_path/test1.txt'); watcher._emit('change', './$$fake_path/test1.txt');
timeout.flush(10); timeout.flush(10);
@ -136,21 +144,13 @@ function mockTimeout() {
var now = 0; var now = 0;
return { return {
mocks: { mocks: {setTimeout: mockSetTimeout, clearTimeout: mockClearTimeout},
setTimeout: mockSetTimeout, flush: flush, get pending() { return events.length; }
clearTimeout: mockClearTimeout
},
flush: flush,
get pending() { return events.length; }
}; };
function mockSetTimeout(fn, delay) { function mockSetTimeout(fn, delay) {
delay = delay || 0; delay = delay || 0;
events.push({ events.push({time: now + delay, fn: fn, id: id});
time: now + delay,
fn: fn,
id: id
});
events.sort(function(a, b) { return a.time - b.time; }); events.sort(function(a, b) { return a.time - b.time; });
return id++; return id++;
} }
@ -165,9 +165,12 @@ function mockTimeout() {
} }
function flush(delay) { function flush(delay) {
if (delay !== undefined) now += delay; if (delay !== undefined)
else if (events.length) now = events[events.length - 1].time; now += delay;
else throw new Error('No timer events registered'); else if (events.length)
now = events[events.length - 1].time;
else
throw new Error('No timer events registered');
while (events.length && events[0].time <= now) { while (events.length && events[0].time <= now) {
events.shift().fn(); events.shift().fn();

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
*/
// this bundle is almost identical to the angular2.umd.js // this bundle is almost identical to the angular2.umd.js
// the only difference being "testing" exports // the only difference being "testing" exports
exports.core = require('angular2/core'); exports.core = require('angular2/core');
@ -8,9 +16,7 @@ exports.platform = {
common_dom: require('angular2/platform/common_dom'), common_dom: require('angular2/platform/common_dom'),
// this is included as compared to the angular2-all.umd.js bundle // this is included as compared to the angular2-all.umd.js bundle
testing: { testing: {browser: require('angular2/platform/testing/browser')}
browser: require('angular2/platform/testing/browser')
}
}; };
exports.http = require('angular2/http'); exports.http = require('angular2/http');
exports.router = require('angular2/router'); exports.router = require('angular2/router');

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
*/
exports.core = require('angular2/core'); exports.core = require('angular2/core');
exports.common = require('angular2/common'); exports.common = require('angular2/common');
exports.compiler = require('angular2/compiler'); exports.compiler = require('angular2/compiler');

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
*/
var webpack = require('webpack'); var webpack = require('webpack');
/** /**
@ -8,8 +16,7 @@ var webpack = require('webpack');
* @returns {Function} * @returns {Function}
*/ */
function webPackPromiseify(options) { function webPackPromiseify(options) {
return new Promise(function(resolve, reject) {
return new Promise(function (resolve, reject) {
webpack(options, function(err, stats) { webpack(options, function(err, stats) {
var jsonStats = stats.toJson() || {}; var jsonStats = stats.toJson() || {};
@ -29,4 +36,4 @@ function webPackPromiseify(options) {
}); });
} }
module.exports = webPackPromiseify; module.exports = webPackPromiseify;

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
*/
/* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! /* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!! !!! !!! !!!
!!! This file is special in that it must be able to execute with wrong Node version !!! !!! This file is special in that it must be able to execute with wrong Node version !!!
@ -16,28 +24,29 @@ var issues = [];
// coarse Node version check // coarse Node version check
if (+process.version[1] < 5) { if (+process.version[1] < 5) {
issues.push("Angular 2 build currently requires Node 5+. Use nvm to update your node version."); issues.push('Angular 2 build currently requires Node 5+. Use nvm to update your node version.');
} }
try { try {
semver = require('semver'); semver = require('semver');
} catch(e) { } catch (e) {
issues.push("Looks like you are missing some npm dependencies. Run: npm install"); issues.push('Looks like you are missing some npm dependencies. Run: npm install');
} }
if (issues.length) { if (issues.length) {
printWarning(issues); printWarning(issues);
console.error("Your environment doesn't provide the prerequisite dependencies.\n" + console.error(
"Please fix the issues listed above and then rerun the gulp command.\n" + 'Your environment doesn\'t provide the prerequisite dependencies.\n' +
"Check out https://github.com/angular/angular/blob/master/DEVELOPER.md for more info."); 'Please fix the issues listed above and then rerun the gulp command.\n' +
'Check out https://github.com/angular/angular/blob/master/DEVELOPER.md for more info.');
process.exit(1); process.exit(1);
} }
// wrap in try/catch in case someone requires from within that file // wrap in try/catch in case someone requires from within that file
try { try {
checkNodeModules = require('./npm/check-node-modules.js'); checkNodeModules = require('./npm/check-node-modules.js');
} catch(e) { } catch (e) {
issues.push("Looks like you are missing some npm dependencies. Run: npm install"); issues.push('Looks like you are missing some npm dependencies. Run: npm install');
throw e; throw e;
} finally { } finally {
// print warnings and move on, the next steps will likely fail, but hey, we warned them. // print warnings and move on, the next steps will likely fail, but hey, we warned them.
@ -45,7 +54,6 @@ try {
} }
function checkEnvironment(reqs) { function checkEnvironment(reqs) {
exec('npm --version', function(e, stdout) { exec('npm --version', function(e, stdout) {
var foundNpmVersion = semver.clean(stdout); var foundNpmVersion = semver.clean(stdout);
var foundNodeVersion = process.version; var foundNodeVersion = process.version;
@ -53,17 +61,20 @@ function checkEnvironment(reqs) {
if (!semver.satisfies(foundNodeVersion, reqs.requiredNodeVersion)) { if (!semver.satisfies(foundNodeVersion, reqs.requiredNodeVersion)) {
issues.push('You are running unsupported node version. Found: ' + foundNodeVersion + issues.push(
' Expected: ' + reqs.requiredNodeVersion + '. Use nvm to update your node version.'); 'You are running unsupported node version. Found: ' + foundNodeVersion + ' Expected: ' +
reqs.requiredNodeVersion + '. Use nvm to update your node version.');
} }
if (!semver.satisfies(foundNpmVersion, reqs.requiredNpmVersion)) { if (!semver.satisfies(foundNpmVersion, reqs.requiredNpmVersion)) {
issues.push('You are running unsupported npm version. Found: ' + foundNpmVersion + issues.push(
' Expected: ' + reqs.requiredNpmVersion + '. Run: npm update -g npm'); 'You are running unsupported npm version. Found: ' + foundNpmVersion + ' Expected: ' +
reqs.requiredNpmVersion + '. Run: npm update -g npm');
} }
if (!checkNodeModules()) { if (!checkNodeModules()) {
issues.push('Your node_modules directory is stale or out of sync with npm-shrinkwrap.json. Run: npm install'); issues.push(
'Your node_modules directory is stale or out of sync with npm-shrinkwrap.json. Run: npm install');
} }
printWarning(issues); printWarning(issues);
@ -76,7 +87,7 @@ function printWarning(issues) {
console.warn(''); console.warn('');
console.warn('!'.repeat(110)); console.warn('!'.repeat(110));
console.warn('!!! Your environment is not in a good shape. Following issues were found:'); console.warn('!!! Your environment is not in a good shape. Following issues were found:');
issues.forEach(function(issue) {console.warn('!!! - ' + issue);}); issues.forEach(function(issue) { console.warn('!!! - ' + issue); });
console.warn('!'.repeat(110)); console.warn('!'.repeat(110));
console.warn(''); console.warn('');

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
*/
/** /**
* Patch Protractor so that it uses ChromeDriver 2.14 instead of 2.15. * Patch Protractor so that it uses ChromeDriver 2.14 instead of 2.15.
* *
@ -13,11 +21,11 @@ var path = require('path');
var protractorConfigFile = path.resolve(require.resolve('protractor'), '../../config.json'); var protractorConfigFile = path.resolve(require.resolve('protractor'), '../../config.json');
var newConfig = { var newConfig = {
"webdriverVersions": { 'webdriverVersions': {
"selenium": "2.45.0", 'selenium': '2.45.0',
"chromedriver": "2.14", 'chromedriver': '2.14',
"iedriver": "2.45.0" 'iedriver': '2.45.0',
} }
} };
fs.writeFile(protractorConfigFile, JSON.stringify(newConfig)); fs.writeFile(protractorConfigFile, JSON.stringify(newConfig));

View File

@ -1,4 +1,11 @@
#! /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
*/
/** /**
* TODO: remove this file when license is included in RxJS bundles. * TODO: remove this file when license is included in RxJS bundles.
@ -17,22 +24,19 @@ ${license}
**/ **/
`; `;
var bundles = fs.readdirSync(args['build-path']) var bundles =
// Match files that begin with Rx and end with js fs.readdirSync(args['build-path'])
.filter(bundle => /^Rx\.?.*\.js$/.test(bundle)) // Match files that begin with Rx and end with js
// Load file contents .filter(bundle => /^Rx\.?.*\.js$/.test(bundle))
.map(bundle => { // Load file contents
return { .map(bundle => {
path: bundle, return {
contents: fs.readFileSync(`${args['build-path']}/${bundle}`).toString() path: bundle,
}; contents: fs.readFileSync(`${args['build-path']}/${bundle}`).toString()
}) };
// Concatenate license to bundle })
.map(bundle => { // Concatenate license to bundle
return { .map(bundle => { return {path: bundle.path, contents: `${license}${bundle.contents}`}; })
path: bundle.path, // Write file to disk
contents: `${license}${bundle.contents}` .forEach(
}; bundle => fs.writeFileSync(`${args['build-path']}/${bundle.path}`, bundle.contents));
})
// Write file to disk
.forEach(bundle => fs.writeFileSync(`${args['build-path']}/${bundle.path}`, bundle.contents));

View File

@ -1,39 +1,44 @@
/**
* @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
*/
var SourceMapConsumer = require('source-map').SourceMapConsumer; var SourceMapConsumer = require('source-map').SourceMapConsumer;
var DotsReporter = require('karma/lib/reporters/dots_color'); 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) { emitter.on('file_list_modified', function(files) { lastServedFiles = files.served });
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('(?:https?:\\/\\/[^\\/]*)?\\/?' + var URL_REGEXP = new RegExp(
'(base|absolute)' + // prefix '(?:https?:\\/\\/[^\\/]*)?\\/?' +
'((?:[A-z]\\:)?[^\\?\\s\\:]*)' + // path '(base|absolute)' + // prefix
'(\\?\\w*)?' + // sha '((?:[A-z]\\:)?[^\\?\\s\\:]*)' + // path
'(\\:(\\d+))?' + // line '(\\?\\w*)?' + // sha
'(\\:(\\d+))?' + // column '(\\:(\\d+))?' + // line
'', 'g') '(\\:(\\d+))?' + // column
'',
'g');
return function (msg, indentation) { return function(msg, indentation) {
msg = (msg || '').replace(URL_REGEXP, function (_, prefix, path, __, ___, line, ____, column) { msg = (msg || '').replace(URL_REGEXP, function(_, prefix, path, __, ___, line, ____, column) {
if (prefix === 'base') { if (prefix === 'base') {
path = basePath + path; path = basePath + path;
} }
line = parseInt(line || '0', 10); line = parseInt(line || '0', 10);
column = parseInt(column || '0', 10); column = parseInt(column || '0', 10);
var file = findFile(path) var file = findFile(path);
if (file && file.sourceMap) { if (file && file.sourceMap) {
try { try {
var original = new SourceMapConsumer(file.sourceMap).originalPositionFor({ var original = new SourceMapConsumer(file.sourceMap)
line: line, .originalPositionFor({line: line, column: column});
column: column return process.cwd() + '/modules/' + original.source + ':' + original.line + ':' +
}); original.column;
return process.cwd() + "/modules/" + original.source + ":" + original.line + ":" + original.column;
} catch (e) { } catch (e) {
console.warn('SourceMap position not found for trace: %s', msg); console.warn('SourceMap position not found for trace: %s', msg);
} }
@ -47,13 +52,16 @@ var createErrorFormatter = function (basePath, emitter, SourceMapConsumer) {
} }
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']
module.exports = {'reporter:internal-angular': ['type', InternalAngularReporter]}; InternalAngularReporter.$inject = ['config', 'emitter'];
module.exports = {
'reporter:internal-angular': ['type', InternalAngularReporter]
};

View File

@ -1,4 +1,12 @@
"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
*/
'use strict';
var fs = require('fs'); var fs = require('fs');
var path = require('path'); var path = require('path');
@ -45,11 +53,11 @@ function _checkCache(markerFile, cacheMarkerFile) {
* pull in existing module. * pull in existing module.
*/ */
function _deleteDir(path) { function _deleteDir(path) {
if( fs.existsSync(path) ) { if (fs.existsSync(path)) {
var subpaths = fs.readdirSync(path); var subpaths = fs.readdirSync(path);
subpaths.forEach(function(subpath) { subpaths.forEach(function(subpath) {
var curPath = path + "/" + subpath; var curPath = path + '/' + subpath;
if(fs.lstatSync(curPath).isDirectory()) { if (fs.lstatSync(curPath).isDirectory()) {
_deleteDir(curPath); _deleteDir(curPath);
} else { } else {
fs.unlinkSync(curPath); fs.unlinkSync(curPath);

View File

@ -1,4 +1,11 @@
#!/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
*/
/** /**
* this script is just a temporary solution to deal with the issue of npm outputting the npm * this script is just a temporary solution to deal with the issue of npm outputting the npm
@ -14,25 +21,22 @@ var path = require('path');
function cleanModule(moduleRecord, name) { function cleanModule(moduleRecord, name) {
// keep `resolve` properties for git dependencies, delete otherwise // keep `resolve` properties for git dependencies, delete otherwise
delete moduleRecord.from; delete moduleRecord.from;
if (!(moduleRecord.resolved && moduleRecord.resolved.match(/^git(\+[a-z]+)?:\/\//))) { if (!(moduleRecord.resolved && moduleRecord.resolved.match(/^git(\+[a-z]+)?:\/\//))) {
delete moduleRecord.resolved; delete moduleRecord.resolved;
} }
_.forEach(moduleRecord.dependencies, function(mod, name) { _.forEach(moduleRecord.dependencies, function(mod, name) { cleanModule(mod, name); });
cleanModule(mod, name);
});
} }
//console.log('Reading npm-shrinkwrap.json'); // console.log('Reading npm-shrinkwrap.json');
var shrinkwrap = require('../../npm-shrinkwrap.json'); var shrinkwrap = require('../../npm-shrinkwrap.json');
//console.log('Cleaning shrinkwrap object'); // console.log('Cleaning shrinkwrap object');
cleanModule(shrinkwrap, shrinkwrap.name); cleanModule(shrinkwrap, shrinkwrap.name);
var cleanShrinkwrapPath = path.join(__dirname, '..', '..', 'npm-shrinkwrap.clean.json'); var cleanShrinkwrapPath = path.join(__dirname, '..', '..', 'npm-shrinkwrap.clean.json');
console.log('writing npm-shrinkwrap.clean.json'); console.log('writing npm-shrinkwrap.clean.json');
fs.writeFileSync(cleanShrinkwrapPath, JSON.stringify(sorted(shrinkwrap), null, 2) + "\n"); fs.writeFileSync(cleanShrinkwrapPath, JSON.stringify(sorted(shrinkwrap), null, 2) + '\n');

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 = 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));

View File

@ -1,6 +1,14 @@
/**
* @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
*/
class RollupNG2 { class RollupNG2 {
resolveId(id, from){ resolveId(id, from) {
if(id.startsWith('@angular/')){ if (id.startsWith('@angular/')) {
return `${__dirname}/../../packages-dist/${id.split('/')[1]}/esm/index.js`; return `${__dirname}/../../packages-dist/${id.split('/')[1]}/esm/index.js`;
} }
@ -10,11 +18,10 @@ class RollupNG2 {
} }
} }
export default { export default {
entry: 'test.js', entry: 'test.js',
format: 'es6', format: 'es6',
plugins: [ plugins: [
new RollupNG2(), new RollupNG2(),
] ]
} };