From cf269d9ff43b913dbac4ba0ed6932c708ae58512 Mon Sep 17 00:00:00 2001 From: Victor Berchet Date: Tue, 4 Oct 2016 20:39:20 -0700 Subject: [PATCH] refactor: add license header to JS files & format files (#12081) --- browser-providers.conf.js | 384 +++++------------- gulpfile.js | 146 ++++--- karma-js.conf.js | 56 +-- .../@angular/common/rollup-testing.config.js | 9 +- modules/@angular/common/rollup.config.js | 11 +- .../integrationtest/webpack.config.js | 16 +- .../compiler/rollup-testing.config.js | 9 +- modules/@angular/compiler/rollup.config.js | 13 +- .../@angular/core/rollup-testing.config.js | 12 +- modules/@angular/core/rollup.config.js | 12 +- modules/@angular/forms/rollup.config.js | 9 +- .../@angular/http/rollup-testing.config.js | 9 +- modules/@angular/http/rollup.config.js | 9 +- .../rollup-testing.config.js | 13 +- .../platform-browser-dynamic/rollup.config.js | 15 +- .../platform-browser/rollup-testing.config.js | 9 +- .../platform-browser/rollup.config.js | 11 +- .../platform-server/rollup-testing.config.js | 9 +- .../@angular/platform-server/rollup.config.js | 9 +- .../rollup.config.js | 15 +- .../platform-webworker/rollup.config.js | 9 +- modules/@angular/router/karma-test-shim.js | 132 +++--- modules/@angular/router/karma.conf.js | 42 +- .../@angular/router/rollup-testing.config.js | 10 +- modules/@angular/router/rollup.config.js | 15 +- modules/@angular/upgrade/rollup.config.js | 14 +- modules/angular1_router/build.js | 8 + modules/angular1_router/karma-router.conf.js | 8 + .../angular1_router/src/module_template.js | 7 + modules/angular1_router/src/ng_route_shim.js | 13 +- .../test/integration/animation_spec.js | 8 + .../test/integration/lifecycle_hook_spec.js | 8 + .../test/integration/navigation_spec.js | 8 + .../test/integration/router_spec.js | 8 + .../test/integration/shim_spec.js | 8 + modules/angular1_router/test/ng_link_spec.js | 8 + modules/angular1_router/test/util.es5.js | 8 + .../playground/src/web_workers/images/b64.js | 1 + .../src/web_workers/images/bitmap.js | 22 +- .../src/web_workers/images/loader.js | 42 +- .../src/web_workers/input/loader.js | 41 +- .../src/web_workers/kitchen_sink/loader.js | 41 +- .../src/web_workers/message_broker/loader.js | 41 +- .../src/web_workers/router/loader.js | 41 +- .../playground/src/web_workers/todo/loader.js | 41 +- modules/rollup-test/hello_world.js | 8 + modules/rollup-test/rollup.config.js | 8 + protractor-e2e.conf.js | 35 +- protractor-examples-e2e.conf.js | 28 +- protractor-perf.conf.js | 34 +- scripts/browserstack/start_tunnel.js | 8 + test-main.js | 173 +++----- tools/build/benchpress.js | 15 +- tools/build/file2modulename.js | 31 +- tools/build/licensewrap.js | 10 +- tools/build/linknodemodules.js | 16 +- tools/build/logging.js | 29 +- tools/build/snippets/url_params_to_form.js | 12 +- tools/build/util.js | 21 +- tools/build/watch.js | 28 +- tools/build/watch.spec.js | 41 +- .../build/webpack/angular2-all-testing.umd.js | 12 +- tools/build/webpack/angular2-all.umd.js | 8 + tools/build/webpack/promiseify.js | 13 +- tools/check-environment.js | 41 +- tools/chromedriverpatch.js | 20 +- tools/code.angularjs.org/add-license-to-rx.js | 42 +- tools/karma/reporter.js | 62 +-- tools/npm/check-node-modules.js | 16 +- tools/npm/clean-shrinkwrap.js | 18 +- tools/travis/travis-fold.js | 8 + tools/tree-shaking-test/rollup.config.js | 15 +- 72 files changed, 1166 insertions(+), 946 deletions(-) diff --git a/browser-providers.conf.js b/browser-providers.conf.js index 4b6f079f1c..5e75463f12 100644 --- a/browser-providers.conf.js +++ b/browser-providers.conf.js @@ -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 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 = { - 'Chrome': { unitTest: {target: 'SL', required: true}, e2e: {target: null, required: true}}, - 'Firefox': { 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}}, // FirefoxBeta and ChromeBeta should be target:'BS' or target:'SL', and required:true // Currently deactivated due to https://github.com/angular/angular/issues/7560 - 'ChromeBeta': { unitTest: {target: null, required: true}, 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}}, - 'FirefoxDev': { unitTest: {target: null, required: true}, 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}}, - 'IE11': { unitTest: {target: 'SL', required: true}, 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.2': { 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}}, - 'Android5': { unitTest: {target: 'SL', 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}}, - 'Safari9': { 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}}, - 'iOS8': { 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}}, - 'WindowsPhone': { unitTest: {target: 'BS', required: false}, e2e: {target: null, required: true}} + 'ChromeBeta': {unitTest: {target: null, required: true}, 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}}, + 'FirefoxDev': {unitTest: {target: null, required: true}, 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}}, + 'IE11': {unitTest: {target: 'SL', required: true}, 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.2': {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}}, + 'Android5': {unitTest: {target: 'SL', 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}}, + 'Safari9': {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}}, + 'iOS8': {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}}, + 'WindowsPhone': {unitTest: {target: 'BS', required: false}, e2e: {target: null, required: true}} }; var customLaunchers = { - 'DartiumWithWebPlatform': { - base: 'Dartium', - flags: ['--enable-experimental-web-platform-features'] }, - 'ChromeNoSandbox': { - base: 'Chrome', - flags: ['--no-sandbox'] }, - 'SL_CHROME': { - base: 'SauceLabs', - browserName: 'chrome', - version: '52' - }, - 'SL_CHROMEBETA': { - base: 'SauceLabs', - browserName: 'chrome', - version: 'beta' - }, - 'SL_CHROMEDEV': { - base: 'SauceLabs', - browserName: 'chrome', - version: 'dev' - }, - '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' - }, + 'DartiumWithWebPlatform': + {base: 'Dartium', flags: ['--enable-experimental-web-platform-features']}, + 'ChromeNoSandbox': {base: 'Chrome', flags: ['--no-sandbox']}, + 'SL_CHROME': {base: 'SauceLabs', browserName: 'chrome', version: '52'}, + 'SL_CHROMEBETA': {base: 'SauceLabs', browserName: 'chrome', version: 'beta'}, + 'SL_CHROMEDEV': {base: 'SauceLabs', browserName: 'chrome', version: 'dev'}, + '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': { base: 'SauceLabs', browserName: 'internet explorer', platform: 'Windows 2012', version: '10' }, - 'SL_IE11': { - base: 'SauceLabs', - browserName: 'internet explorer', - platform: 'Windows 8.1', - version: '11' - }, + 'SL_IE11': + {base: 'SauceLabs', browserName: 'internet explorer', platform: 'Windows 8.1', version: '11'}, 'SL_EDGE': { base: 'SauceLabs', browserName: 'MicrosoftEdge', platform: 'Windows 10', version: '13.10586' }, - 'SL_ANDROID4.1': { - base: 'SauceLabs', - browserName: 'android', - platform: 'Linux', - version: '4.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' - }, + 'SL_ANDROID4.1': {base: 'SauceLabs', browserName: 'android', platform: 'Linux', version: '4.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': { - base: 'BrowserStack', - browser: 'chrome', - os: 'OS X', - os_version: 'Yosemite' - }, - 'BS_FIREFOX': { - base: 'BrowserStack', - browser: 'firefox', - os: 'Windows', - os_version: '10' - }, - '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_CHROME': {base: 'BrowserStack', browser: 'chrome', os: 'OS X', os_version: 'Yosemite'}, + 'BS_FIREFOX': {base: 'BrowserStack', browser: 'firefox', os: 'Windows', os_version: '10'}, + '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': { base: 'BrowserStack', browser: 'ie', @@ -251,54 +107,31 @@ var customLaunchers = { os: 'Windows', os_version: '10' }, - 'BS_EDGE': { - base: 'BrowserStack', - browser: 'edge', - os: 'Windows', - os_version: '10' - }, - 'BS_WINDOWSPHONE' : { - base: 'BrowserStack', - device: 'Nokia Lumia 930', - os: 'winphone', - os_version: '8.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' - } + 'BS_EDGE': {base: 'BrowserStack', browser: 'edge', os: 'Windows', os_version: '10'}, + 'BS_WINDOWSPHONE': + {base: 'BrowserStack', device: 'Nokia Lumia 930', os: 'winphone', os_version: '8.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 = { - 'ALL': Object.keys(customLaunchers).filter(function(item) {return customLaunchers[item].base == 'SauceLabs';}), - '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'], + 'ALL': Object.keys(customLaunchers).filter(function(item) { + return customLaunchers[item].base == 'SauceLabs'; + }), + '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'], 'IE': ['SL_IE9', 'SL_IE10', 'SL_IE11'], 'IOS': ['SL_IOS7', 'SL_IOS8', 'SL_IOS9', 'SL_IOS10'], @@ -310,9 +143,16 @@ var sauceAliases = { }; var browserstackAliases = { - 'ALL': Object.keys(customLaunchers).filter(function(item) {return customLaunchers[item].base == 'BrowserStack';}), - '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'], + 'ALL': Object.keys(customLaunchers).filter(function(item) { + return customLaunchers[item].base == 'BrowserStack'; + }), + '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'], 'IE': ['BS_IE9', 'BS_IE10', 'BS_IE11'], 'IOS': ['BS_IOS7', 'BS_IOS8', 'BS_IOS9', 'BS_IOS10'], @@ -329,9 +169,9 @@ module.exports = { function buildConfiguration(type, target, required) { return Object.keys(CIconfiguration) - .filter((item) => { - var conf = CIconfiguration[item][type]; - return conf.required === required && conf.target === target; - }) - .map((item) => target + '_' + item.toUpperCase()); + .filter((item) => { + var conf = CIconfiguration[item][type]; + return conf.required === required && conf.target === target; + }) + .map((item) => target + '_' + item.toUpperCase()); } diff --git a/gulpfile.js b/gulpfile.js index 99abcbec26..ce41eeeb29 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -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'; // THIS CHECK SHOULD BE THE FIRST THING IN THIS FILE @@ -13,12 +21,14 @@ const os = require('os'); // clang-format entry points const srcsToFmt = [ - 'modules/@angular/**/*.ts', - 'modules/benchmarks/**/*.ts', - 'modules/e2e_util/**/*.ts', - 'modules/playground/**/*.ts', - 'tools/**/*.ts', + 'modules/@angular/**/*.{js,ts}', + 'modules/benchmarks/**/*.{js,ts}', + 'modules/e2e_util/**/*.{js,ts}', + 'modules/playground/**/*.{js,ts}', + 'tools/**/*.{js,ts}', '!tools/public_api_guard/**/*.d.ts', + './*.{js,ts}', + '!shims_for_IE.js', ]; // Check source code for formatting errors (clang-format) @@ -26,15 +36,16 @@ gulp.task('format:enforce', () => { const format = require('gulp-clang-format'); const clangFormat = require('clang-format'); 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) gulp.task('format', () => { const format = require('gulp-clang-format'); const clangFormat = require('clang-format'); - return gulp.src(srcsToFmt, { base: '.' }).pipe( - format.format('file', clangFormat)).pipe(gulp.dest('.')); + return gulp.src(srcsToFmt, {base: '.'}) + .pipe(format.format('file', clangFormat)) + .pipe(gulp.dest('.')); }); const entrypoints = [ @@ -62,12 +73,18 @@ const entrypoints = [ ]; const publicApiDir = path.normalize('tools/public_api_guard'); const publicApiArgs = [ - '--rootDir', 'dist/packages-dist', - '--stripExportPattern', '^__', - '--allowModuleIdentifiers', 'jasmine', - '--allowModuleIdentifiers', 'protractor', - '--allowModuleIdentifiers', 'angular', - '--onStabilityMissing', 'error', + '--rootDir', + 'dist/packages-dist', + '--stripExportPattern', + '^__', + '--allowModuleIdentifiers', + 'jasmine', + '--allowModuleIdentifiers', + 'protractor', + '--allowModuleIdentifiers', + 'angular', + '--onStabilityMissing', + 'error', ].concat(entrypoints); // Build angular @@ -83,17 +100,17 @@ gulp.task('public-api:enforce', (done) => { const childProcess = require('child_process'); childProcess - .spawn( - path.join(__dirname, platformScriptPath(`/node_modules/.bin/ts-api-guardian`)), - ['--verifyDir', publicApiDir].concat(publicApiArgs), {stdio: 'inherit'}) - .on('close', (errorCode) => { - if (errorCode !== 0) { - done(new Error( - 'Public API differs from golden file. Please run `gulp public-api:update`.')); - } else { - done(); - } - }); + .spawn( + path.join(__dirname, platformScriptPath(`/node_modules/.bin/ts-api-guardian`)), + ['--verifyDir', publicApiDir].concat(publicApiArgs), {stdio: 'inherit'}) + .on('close', (errorCode) => { + if (errorCode !== 0) { + done(new Error( + 'Public API differs from golden file. Please run `gulp public-api:update`.')); + } else { + done(); + } + }); }); // Generate the public API golden files @@ -101,20 +118,24 @@ gulp.task('public-api:update', ['build.sh'], (done) => { const childProcess = require('child_process'); childProcess - .spawn( - path.join(__dirname, platformScriptPath(`/node_modules/.bin/ts-api-guardian`)), - ['--outDir', publicApiDir].concat(publicApiArgs), {stdio: 'inherit'}) - .on('close', done); + .spawn( + path.join(__dirname, platformScriptPath(`/node_modules/.bin/ts-api-guardian`)), + ['--outDir', publicApiDir].concat(publicApiArgs), {stdio: 'inherit'}) + .on('close', done); }); -// Checks tests for presence of ddescribe, fdescribe, fit, iit and fails the build if one of the 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. +// Checks tests for presence of ddescribe, fdescribe, fit, iit and fails the build if one of the +// 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() { const ddescribeIit = require('gulp-ddescribe-iit'); - return gulp.src([ - 'modules/**/*.spec.ts', - 'modules/**/*_spec.ts', - ]).pipe(ddescribeIit({allowDisabledTests: true})); + return gulp + .src([ + 'modules/**/*.spec.ts', + 'modules/**/*_spec.ts', + ]) + .pipe(ddescribeIit({allowDisabledTests: true})); }); // Check the coding standards and programming errors @@ -123,14 +144,21 @@ gulp.task('lint', ['check-tests', 'format:enforce', 'tools:build'], () => { // Built-in rules are at // https://github.com/palantir/tslint#supported-rules const tslintConfig = require('./tslint.json'); - return gulp.src(['modules/@angular/**/*.ts', 'modules/benchpress/**/*.ts']) - .pipe(tslint({ - tslint: require('tslint').default, - configuration: tslintConfig, - rulesDirectory: 'dist/tools/tslint', - formatter: 'prose', - })) - .pipe(tslint.report({emitError: true})); + return gulp + .src([ + // todo(vicb): add .js files when supported + // see https://github.com/palantir/tslint/pull/1515 + 'modules/@angular/**/*.ts', + 'modules/benchpress/**/*.ts', + './*.ts', + ]) + .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); }); @@ -142,7 +170,7 @@ gulp.task('check-cycle', (done) => { const dependencyObject = madge(['dist/all/'], { format: 'cjs', 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(); if (circularDependencies.length > 0) { @@ -173,11 +201,11 @@ gulp.task('serve-examples', () => { const cors = require('cors'); connect.server({ - root: `${__dirname}/dist/examples`, - port: 8001, - livereload: false, - open: false, - middleware: (connect, opt) => [cors()], + root: `${__dirname}/dist/examples`, + port: 8001, + livereload: false, + open: false, + middleware: (connect, opt) => [cors()], }); }); @@ -187,16 +215,13 @@ gulp.task('changelog', () => { const conventionalChangelog = require('gulp-conventional-changelog'); return gulp.src('CHANGELOG.md') - .pipe(conventionalChangelog({ - preset: 'angular', - releaseCount: 1 - }, { - // Conventional Changelog Context - // 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 - currentTag: require('./package.json').version - })) - .pipe(gulp.dest('./')); + .pipe(conventionalChangelog({preset: 'angular', releaseCount: 1}, { + // Conventional Changelog Context + // 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 + currentTag: require('./package.json').version + })) + .pipe(gulp.dest('./')); }); function tsc(projectPath, done) { @@ -205,8 +230,7 @@ function tsc(projectPath, done) { childProcess .spawn( path.normalize(platformScriptPath(`${__dirname}/node_modules/.bin/tsc`)), - ['-p', path.join(__dirname, projectPath)], - {stdio: 'inherit'}) + ['-p', path.join(__dirname, projectPath)], {stdio: 'inherit'}) .on('close', done); } diff --git a/karma-js.conf.js b/karma-js.conf.js index 7a4d3cedc1..443bf417df 100644 --- a/karma-js.conf.js +++ b/karma-js.conf.js @@ -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 internalAngularReporter = require('./tools/karma/reporter.js'); @@ -17,24 +25,25 @@ module.exports = function(config) { // include Angular v1 for upgrade module testing 'node_modules/angular/angular.min.js', - 'node_modules/zone.js/dist/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/jasmine-patch.js', - 'node_modules/zone.js/dist/async-test.js', + 'node_modules/zone.js/dist/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/jasmine-patch.js', 'node_modules/zone.js/dist/async-test.js', 'node_modules/zone.js/dist/fake-async-test.js', // Including systemjs because it defines `__eval`, which produces correct stack traces. - 'shims_for_IE.js', - 'node_modules/systemjs/dist/system.src.js', + 'shims_for_IE.js', 'node_modules/systemjs/dist/system.src.js', {pattern: 'node_modules/rxjs/**', included: false, watched: false, served: true}, - 'node_modules/reflect-metadata/Reflect.js', - 'tools/build/file2modulename.js', - 'test-main.js', - {pattern: 'dist/all/empty.*', included: false, watched: false}, - {pattern: 'modules/@angular/platform-browser/test/static_assets/**', included: false, watched: false}, - {pattern: 'modules/@angular/platform-browser/test/browser/static_assets/**', included: false, watched: false} + 'node_modules/reflect-metadata/Reflect.js', 'tools/build/file2modulename.js', 'test-main.js', + {pattern: 'dist/all/empty.*', included: false, watched: false}, { + pattern: 'modules/@angular/platform-browser/test/static_assets/**', + included: false, + watched: false + }, + { + pattern: 'modules/@angular/platform-browser/test/browser/static_assets/**', + included: false, + watched: false, + } ], exclude: [ @@ -44,7 +53,7 @@ module.exports = function(config) { 'dist/all/@angular/benchpress/**', 'dist/all/angular1_router.js', 'dist/all/@angular/platform-browser/testing/e2e_util.js', - 'dist/examples/**/e2e_test/**' + 'dist/examples/**/e2e_test/**', ], customLaunchers: browserProvidersConf.customLaunchers, @@ -55,11 +64,11 @@ module.exports = function(config) { 'karma-sauce-launcher', 'karma-chrome-launcher', 'karma-sourcemap-loader', - internalAngularReporter + internalAngularReporter, ], preprocessors: { - '**/*.js': ['sourcemap'] + '**/*.js': ['sourcemap'], }, reporters: ['internal-angular'], @@ -73,7 +82,7 @@ module.exports = function(config) { 'selenium-version': '2.53.0', 'command-timeout': 600, 'idle-timeout': 600, - 'max-duration': 5400 + 'max-duration': 5400, } }, @@ -82,20 +91,21 @@ module.exports = function(config) { startTunnel: false, retryLimit: 3, timeout: 600, - pollingTimeout: 10000 + pollingTimeout: 10000, }, browsers: ['Chrome'], port: 9876, captureTimeout: 60000, - browserDisconnectTimeout : 60000, - browserDisconnectTolerance : 3, - browserNoActivityTimeout : 60000, + browserDisconnectTimeout: 60000, + browserDisconnectTolerance: 3, + browserNoActivityTimeout: 60000, }); 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')) { config.sauceLabs.build = buildId; config.sauceLabs.tunnelIdentifier = process.env.TRAVIS_JOB_NUMBER; diff --git a/modules/@angular/common/rollup-testing.config.js b/modules/@angular/common/rollup-testing.config.js index 3a0e5d0236..8c0e1d7618 100644 --- a/modules/@angular/common/rollup-testing.config.js +++ b/modules/@angular/common/rollup-testing.config.js @@ -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 { entry: '../../../dist/packages-dist/common/testing/index.js', @@ -10,4 +17,4 @@ export default { 'rxjs/Observable': 'Rx', 'rxjs/Subject': 'Rx' } -} +}; diff --git a/modules/@angular/common/rollup.config.js b/modules/@angular/common/rollup.config.js index 0ff5c1a5df..1e6b494fc8 100644 --- a/modules/@angular/common/rollup.config.js +++ b/modules/@angular/common/rollup.config.js @@ -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 { entry: '../../../dist/packages-dist/common/index.js', @@ -7,6 +14,6 @@ export default { globals: { '@angular/core': 'ng.core', 'rxjs/Observable': 'Rx', - 'rxjs/Subject': 'Rx' + 'rxjs/Subject': 'Rx', } -} +}; diff --git a/modules/@angular/compiler-cli/integrationtest/webpack.config.js b/modules/@angular/compiler-cli/integrationtest/webpack.config.js index 5478a9431c..90d348e286 100644 --- a/modules/@angular/compiler-cli/integrationtest/webpack.config.js +++ b/modules/@angular/compiler-cli/integrationtest/webpack.config.js @@ -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 = { target: 'node', entry: './test/all_spec.js', - output: { - filename: './all_spec.js' - }, - resolve: { - extensions: ['.js'] - }, + output: {filename: './all_spec.js'}, + resolve: {extensions: ['.js']}, }; diff --git a/modules/@angular/compiler/rollup-testing.config.js b/modules/@angular/compiler/rollup-testing.config.js index dbc0d14d4e..8772530d02 100644 --- a/modules/@angular/compiler/rollup-testing.config.js +++ b/modules/@angular/compiler/rollup-testing.config.js @@ -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 { entry: '../../../dist/packages-dist/compiler/testing/index.js', @@ -11,4 +18,4 @@ export default { 'rxjs/Observable': 'Rx', 'rxjs/Subject': 'Rx' } -} +}; diff --git a/modules/@angular/compiler/rollup.config.js b/modules/@angular/compiler/rollup.config.js index 3f6d445490..4aa5777651 100644 --- a/modules/@angular/compiler/rollup.config.js +++ b/modules/@angular/compiler/rollup.config.js @@ -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 { entry: '../../../dist/packages-dist/compiler/index.js', @@ -7,9 +14,9 @@ export default { globals: { '@angular/core': 'ng.core', 'rxjs/Observable': 'Rx', - 'rxjs/Subject': 'Rx' + 'rxjs/Subject': 'Rx', }, plugins: [ -// nodeResolve({ jsnext: true, main: true }), + // nodeResolve({ jsnext: true, main: true }), ] -} +}; diff --git a/modules/@angular/core/rollup-testing.config.js b/modules/@angular/core/rollup-testing.config.js index 0d150b4c92..bf27b75a40 100644 --- a/modules/@angular/core/rollup-testing.config.js +++ b/modules/@angular/core/rollup-testing.config.js @@ -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 { entry: '../../../dist/packages-dist/core/testing/index.js', @@ -7,7 +14,6 @@ export default { globals: { '@angular/core': 'ng.core', 'rxjs/Observable': 'Rx', - 'rxjs/Subject': 'Rx' + 'rxjs/Subject': 'Rx', } -} - +}; diff --git a/modules/@angular/core/rollup.config.js b/modules/@angular/core/rollup.config.js index 6e7fa74e72..c13b6b6f6b 100644 --- a/modules/@angular/core/rollup.config.js +++ b/modules/@angular/core/rollup.config.js @@ -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 { entry: '../../../dist/packages-dist/core/index.js', @@ -6,7 +13,6 @@ export default { moduleName: 'ng.core', globals: { 'rxjs/Observable': 'Rx', - 'rxjs/Subject': 'Rx' + 'rxjs/Subject': 'Rx', } -} - +}; diff --git a/modules/@angular/forms/rollup.config.js b/modules/@angular/forms/rollup.config.js index 10133a054e..89990f851c 100644 --- a/modules/@angular/forms/rollup.config.js +++ b/modules/@angular/forms/rollup.config.js @@ -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 { entry: '../../../dist/packages-dist/forms/index.js', @@ -13,4 +20,4 @@ export default { 'rxjs/observable/fromPromise': 'Rx.Observable', 'rxjs/operator/toPromise': 'Rx.Observable.prototype' } -} +}; diff --git a/modules/@angular/http/rollup-testing.config.js b/modules/@angular/http/rollup-testing.config.js index 8ca61d2efc..52c3207716 100644 --- a/modules/@angular/http/rollup-testing.config.js +++ b/modules/@angular/http/rollup-testing.config.js @@ -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 { entry: '../../../dist/packages-dist/http/testing/index.js', @@ -14,4 +21,4 @@ export default { 'rxjs/Subject': 'Rx', 'rxjs/operator/take': 'Rx.Observable.prototype' } -} +}; diff --git a/modules/@angular/http/rollup.config.js b/modules/@angular/http/rollup.config.js index 43fbb74359..69e786cdda 100644 --- a/modules/@angular/http/rollup.config.js +++ b/modules/@angular/http/rollup.config.js @@ -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 { entry: '../../../dist/packages-dist/http/index.js', @@ -11,4 +18,4 @@ export default { 'rxjs/Observable': 'Rx', 'rxjs/Subject': 'Rx' } -} +}; diff --git a/modules/@angular/platform-browser-dynamic/rollup-testing.config.js b/modules/@angular/platform-browser-dynamic/rollup-testing.config.js index c78d0a4fb9..ca88ac7f53 100644 --- a/modules/@angular/platform-browser-dynamic/rollup-testing.config.js +++ b/modules/@angular/platform-browser-dynamic/rollup-testing.config.js @@ -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 { 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', moduleName: 'ng.platformBrowserDynamic.testing', globals: { @@ -13,4 +22,4 @@ export default { '@angular/platform-browser/testing': 'ng.platformBrowser.testing', '@angular/platform-browser-dynamic': 'ng.platformBrowserDynamic' } -} +}; diff --git a/modules/@angular/platform-browser-dynamic/rollup.config.js b/modules/@angular/platform-browser-dynamic/rollup.config.js index ef9cc3e576..03ed750040 100644 --- a/modules/@angular/platform-browser-dynamic/rollup.config.js +++ b/modules/@angular/platform-browser-dynamic/rollup.config.js @@ -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 { 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', moduleName: 'ng.platformBrowserDynamic', globals: { '@angular/core': 'ng.core', '@angular/common': 'ng.common', '@angular/compiler': 'ng.compiler', - '@angular/platform-browser': 'ng.platformBrowser' + '@angular/platform-browser': 'ng.platformBrowser', } -} +}; diff --git a/modules/@angular/platform-browser/rollup-testing.config.js b/modules/@angular/platform-browser/rollup-testing.config.js index 1a04170dae..bd8fb02094 100644 --- a/modules/@angular/platform-browser/rollup-testing.config.js +++ b/modules/@angular/platform-browser/rollup-testing.config.js @@ -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 { entry: '../../../dist/packages-dist/platform-browser/testing/index.js', @@ -9,4 +16,4 @@ export default { '@angular/common': 'ng.common', '@angular/platform-browser': 'ng.platformBrowser' } -} +}; diff --git a/modules/@angular/platform-browser/rollup.config.js b/modules/@angular/platform-browser/rollup.config.js index 4e920200d5..a02654510a 100644 --- a/modules/@angular/platform-browser/rollup.config.js +++ b/modules/@angular/platform-browser/rollup.config.js @@ -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 { entry: '../../../dist/packages-dist/platform-browser/index.js', @@ -6,6 +13,6 @@ export default { moduleName: 'ng.platformBrowser', globals: { '@angular/core': 'ng.core', - '@angular/common': 'ng.common' + '@angular/common': 'ng.common', } -} +}; diff --git a/modules/@angular/platform-server/rollup-testing.config.js b/modules/@angular/platform-server/rollup-testing.config.js index 8741bcaa21..94b9763bf2 100644 --- a/modules/@angular/platform-server/rollup-testing.config.js +++ b/modules/@angular/platform-server/rollup-testing.config.js @@ -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 { entry: '../../../dist/packages-dist/platform-server/testing/index.js', @@ -13,4 +20,4 @@ export default { '@angular/platform-server': 'ng.platformServer', '@angular/platform-browser-dynamic/testing': 'ng.platformBrowserDynamic.testing' } -} +}; diff --git a/modules/@angular/platform-server/rollup.config.js b/modules/@angular/platform-server/rollup.config.js index 345d5b3702..99f753257a 100644 --- a/modules/@angular/platform-server/rollup.config.js +++ b/modules/@angular/platform-server/rollup.config.js @@ -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 { entry: '../../../dist/packages-dist/platform-server/index.js', @@ -10,4 +17,4 @@ export default { '@angular/compiler': 'ng.compiler', '@angular/platform-browser': 'ng.platformBrowser' } -} +}; diff --git a/modules/@angular/platform-webworker-dynamic/rollup.config.js b/modules/@angular/platform-webworker-dynamic/rollup.config.js index 407844e271..f8b4a0f4d3 100644 --- a/modules/@angular/platform-webworker-dynamic/rollup.config.js +++ b/modules/@angular/platform-webworker-dynamic/rollup.config.js @@ -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 { 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', moduleName: 'ng.platformWebworkerDynamic', globals: { @@ -9,6 +18,6 @@ export default { '@angular/compiler': 'ng.compiler', '@angular/platform-browser': 'ng.platformBrowser', '@angular/platform-browser-dynamic': 'ng.platformBrowserDynamic', - '@angular/platform-webworker': 'ng.platformWebworker' + '@angular/platform-webworker': 'ng.platformWebworker', } -} +}; diff --git a/modules/@angular/platform-webworker/rollup.config.js b/modules/@angular/platform-webworker/rollup.config.js index cafbd1b952..c195c8be83 100644 --- a/modules/@angular/platform-webworker/rollup.config.js +++ b/modules/@angular/platform-webworker/rollup.config.js @@ -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 { entry: '../../../dist/packages-dist/platform-webworker/index.js', @@ -11,4 +18,4 @@ export default { 'rxjs/Observable': 'Rx', 'rxjs/Subject': 'Rx' } -} +}; diff --git a/modules/@angular/router/karma-test-shim.js b/modules/@angular/router/karma-test-shim.js index 9f84243e2b..9b71826f28 100644 --- a/modules/@angular/router/karma-test-shim.js +++ b/modules/@angular/router/karma-test-shim.js @@ -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*/ Error.stackTraceLimit = 5; jasmine.DEFAULT_TIMEOUT_INTERVAL = 10000; -__karma__.loaded = function () { -}; +__karma__.loaded = function() {}; function isJsFile(path) { return path.slice(-3) == '.js'; @@ -18,93 +25,50 @@ function isBuiltFile(path) { return isJsFile(path) && (path.substr(0, builtPath.length) == builtPath); } -var allSpecFiles = Object.keys(window.__karma__.files) - .filter(isSpecFile) - .filter(isBuiltFile); +var allSpecFiles = Object.keys(window.__karma__.files).filter(isSpecFile).filter(isBuiltFile); // Load our SystemJS configuration. System.config({ - baseURL: '/base' + baseURL: '/base', }); -System.config( - { - map: { - 'rxjs': 'node_modules/rxjs', - '@angular': 'dist/all/@angular' - }, - packages: { - '@angular/core/testing': { - main: 'index.js', - defaultExtension: 'js' - }, - '@angular/core': { - 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/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' - } - } - }); +System.config({ + map: {'rxjs': 'node_modules/rxjs', '@angular': 'dist/all/@angular'}, + packages: { + '@angular/core/testing': {main: 'index.js', defaultExtension: 'js'}, + '@angular/core': {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/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([ - System.import('@angular/core/testing'), - System.import('@angular/platform-browser-dynamic/testing') -]).then(function (providers) { - var testing = providers[0]; - var testingBrowser = providers[1]; +Promise + .all([ + System.import('@angular/core/testing'), + System.import('@angular/platform-browser-dynamic/testing') + ]) + .then(function(providers) { + var testing = providers[0]; + var testingBrowser = providers[1]; - testing.TestBed.initTestEnvironment( - testingBrowser.BrowserDynamicTestingModule, - testingBrowser.platformBrowserDynamicTesting()); + testing.TestBed.initTestEnvironment( + testingBrowser.BrowserDynamicTestingModule, + testingBrowser.platformBrowserDynamicTesting()); -}).then(function() { - // Finally, load all spec files. - // This will run the tests directly. - return Promise.all( - allSpecFiles.map(function (moduleName) { - return System.import(moduleName); - })); -}).then(__karma__.start, __karma__.error); + }) + .then(function() { + // Finally, load all spec files. + // This will run the tests directly. + return Promise.all( + allSpecFiles.map(function(moduleName) { return System.import(moduleName); })); + }) + .then(__karma__.start, __karma__.error); diff --git a/modules/@angular/router/karma.conf.js b/modules/@angular/router/karma.conf.js index 4188df437a..26812a70a7 100644 --- a/modules/@angular/router/karma.conf.js +++ b/modules/@angular/router/karma.conf.js @@ -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'); // Karma configuration @@ -28,11 +36,11 @@ module.exports = function(config) { 'node_modules/zone.js/dist/fake-async-test.js', // RxJs. - { pattern: 'node_modules/rxjs/**/*.js', included: false, watched: false }, - { pattern: 'node_modules/rxjs/**/*.js.map', included: false, watched: false }, + {pattern: 'node_modules/rxjs/**/*.js', included: false, watched: false}, + {pattern: 'node_modules/rxjs/**/*.js.map', included: false, watched: false}, // 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 {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/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/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 {pattern: 'dist/all/@angular/router/**/*.js', included: false, watched: true} @@ -66,11 +86,11 @@ module.exports = function(config) { 'karma-browserstack-launcher', 'karma-sauce-launcher', 'karma-chrome-launcher', - 'karma-sourcemap-loader' + 'karma-sourcemap-loader', ], preprocessors: { - '**/*.js': ['sourcemap'] + '**/*.js': ['sourcemap'], }, reporters: ['dots'], @@ -81,8 +101,8 @@ module.exports = function(config) { browsers: ['Chrome'], singleRun: false, captureTimeout: 60000, - browserDisconnectTimeout : 60000, - browserDisconnectTolerance : 3, - browserNoActivityTimeout : 60000 + browserDisconnectTimeout: 60000, + browserDisconnectTolerance: 3, + browserNoActivityTimeout: 60000, }); }; diff --git a/modules/@angular/router/rollup-testing.config.js b/modules/@angular/router/rollup-testing.config.js index 329907971d..1943b5793c 100644 --- a/modules/@angular/router/rollup-testing.config.js +++ b/modules/@angular/router/rollup-testing.config.js @@ -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 { entry: '../../../dist/packages-dist/router/testing/index.js', dest: '../../../dist/packages-dist/router/bundles/router-testing.umd.js', @@ -10,4 +18,4 @@ export default { '@angular/platform-browser': 'ng.platformBrowser', '@angular/router': 'ng.router' } -} +}; diff --git a/modules/@angular/router/rollup.config.js b/modules/@angular/router/rollup.config.js index 3e52b6a40c..2d6906587c 100644 --- a/modules/@angular/router/rollup.config.js +++ b/modules/@angular/router/rollup.config.js @@ -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 { entry: '../../../dist/packages-dist/router/index.js', dest: '../../../dist/packages-dist/router/bundles/router.umd.js', @@ -28,8 +36,7 @@ export default { 'rxjs/operator/every': 'Rx.Observable.prototype', 'rxjs/operator/first': 'Rx.Observable.prototype', 'rxjs/operator/catch': 'Rx.Observable.prototype', - 'rxjs/operator/last': 'Rx.Observable.prototype' + 'rxjs/operator/last': 'Rx.Observable.prototype', }, - plugins: [ - ] -} + plugins: [] +}; diff --git a/modules/@angular/upgrade/rollup.config.js b/modules/@angular/upgrade/rollup.config.js index b14fc3c2c1..f02a7da579 100644 --- a/modules/@angular/upgrade/rollup.config.js +++ b/modules/@angular/upgrade/rollup.config.js @@ -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 { entry: '../../../dist/packages-dist/upgrade/index.js', @@ -11,8 +18,9 @@ export default { '@angular/platform-browser': 'ng.platformBrowser', '@angular/platform-browser-dynamic': 'ng.platformBrowserDynamic', '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/Observable': 'Rx' + 'rxjs/Observable': 'Rx', } -} +}; diff --git a/modules/angular1_router/build.js b/modules/angular1_router/build.js index 9937074988..0c10a7ba6e 100644 --- a/modules/angular1_router/build.js +++ b/modules/angular1_router/build.js @@ -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'; var fs = require('fs'); diff --git a/modules/angular1_router/karma-router.conf.js b/modules/angular1_router/karma-router.conf.js index 128f839e52..b5632d67ab 100644 --- a/modules/angular1_router/karma-router.conf.js +++ b/modules/angular1_router/karma-router.conf.js @@ -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'; var browserProvidersConf = require('../../browser-providers.conf.js'); diff --git a/modules/angular1_router/src/module_template.js b/modules/angular1_router/src/module_template.js index f648cbce42..61b49c409e 100644 --- a/modules/angular1_router/src/module_template.js +++ b/modules/angular1_router/src/module_template.js @@ -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'). value('$route', null). // can be overloaded with ngRouteShim diff --git a/modules/angular1_router/src/ng_route_shim.js b/modules/angular1_router/src/ng_route_shim.js index bdb29bf851..7bbef6a13b 100644 --- a/modules/angular1_router/src/ng_route_shim.js +++ b/modules/angular1_router/src/ng_route_shim.js @@ -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 () { 'use strict'; @@ -282,8 +289,8 @@ var href = element.attr(hrefAttrName); 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) { $rootRouter.navigateByUrl(href); event.preventDefault(); diff --git a/modules/angular1_router/test/integration/animation_spec.js b/modules/angular1_router/test/integration/animation_spec.js index 7ab30b4c19..bb11563041 100644 --- a/modules/angular1_router/test/integration/animation_spec.js +++ b/modules/angular1_router/test/integration/animation_spec.js @@ -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'; describe('ngOutlet animations', function () { diff --git a/modules/angular1_router/test/integration/lifecycle_hook_spec.js b/modules/angular1_router/test/integration/lifecycle_hook_spec.js index 461103272f..1d1c38a045 100644 --- a/modules/angular1_router/test/integration/lifecycle_hook_spec.js +++ b/modules/angular1_router/test/integration/lifecycle_hook_spec.js @@ -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'; describe('Navigation lifecycle', function () { diff --git a/modules/angular1_router/test/integration/navigation_spec.js b/modules/angular1_router/test/integration/navigation_spec.js index ab4853f212..581cfca25b 100644 --- a/modules/angular1_router/test/integration/navigation_spec.js +++ b/modules/angular1_router/test/integration/navigation_spec.js @@ -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'; describe('navigation', function () { diff --git a/modules/angular1_router/test/integration/router_spec.js b/modules/angular1_router/test/integration/router_spec.js index 37b4508a59..350340cd76 100644 --- a/modules/angular1_router/test/integration/router_spec.js +++ b/modules/angular1_router/test/integration/router_spec.js @@ -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'; describe('router', function () { diff --git a/modules/angular1_router/test/integration/shim_spec.js b/modules/angular1_router/test/integration/shim_spec.js index 31dec18b5c..b70041e1ac 100644 --- a/modules/angular1_router/test/integration/shim_spec.js +++ b/modules/angular1_router/test/integration/shim_spec.js @@ -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'; describe('ngRoute shim', function () { diff --git a/modules/angular1_router/test/ng_link_spec.js b/modules/angular1_router/test/ng_link_spec.js index 12ce06c92e..e55f88bb16 100644 --- a/modules/angular1_router/test/ng_link_spec.js +++ b/modules/angular1_router/test/ng_link_spec.js @@ -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'; describe('ngLink', function () { diff --git a/modules/angular1_router/test/util.es5.js b/modules/angular1_router/test/util.es5.js index 9b58fa6c6c..7ce89d8584 100644 --- a/modules/angular1_router/test/util.es5.js +++ b/modules/angular1_router/test/util.es5.js @@ -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 */ diff --git a/modules/playground/src/web_workers/images/b64.js b/modules/playground/src/web_workers/images/b64.js index 46001d2f16..f850a56fe9 100644 --- a/modules/playground/src/web_workers/images/b64.js +++ b/modules/playground/src/web_workers/images/b64.js @@ -1,3 +1,4 @@ +// clang-format off var lookup = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; ;(function (exports) { diff --git a/modules/playground/src/web_workers/images/bitmap.js b/modules/playground/src/web_workers/images/bitmap.js index 759f979571..b4062f66da 100644 --- a/modules/playground/src/web_workers/images/bitmap.js +++ b/modules/playground/src/web_workers/images/bitmap.js @@ -68,7 +68,7 @@ Bitmap.prototype.subsample = function gamma(v) { return sample(Math.pow(v, .45455)); } function row(pixel, width, y) { - var data = "\0"; + var data = '\0'; for (var x = 0; x < width; x++) { var r = pixel[x][y]; 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) { - var data = ""; + var data = ''; for (var y = 0; y < height; y++) data += row(pixel, width, y); return data; } @@ -95,8 +95,8 @@ Bitmap.prototype.subsample = function deflate(data) { var len = data.length; - return "\170\1\1" + String.fromCharCode(len & 255, len >>> 8, ~len & 255, (~len >>> 8) & 255) + - data + hton(adler(data)); + return '\170\1\1' + String.fromCharCode(len & 255, len >>> 8, ~len & 255, (~len >>> 8) & 255) + + data + hton(adler(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 base64(data) { - enc = ""; + enc = ''; 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]; - for (; enc.length % 4; enc += "=") + for (; enc.length % 4; enc += '=') ; return enc; } - var png = "\211PNG\r\n\32\n" + - 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", ""); + var png = '\211PNG\r\n\32\n' + + 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', ''); - return "data:image/png;base64," + base64(png); + return 'data:image/png;base64,' + base64(png); } diff --git a/modules/playground/src/web_workers/images/loader.js b/modules/playground/src/web_workers/images/loader.js index 57d3e706b6..22706de6d9 100644 --- a/modules/playground/src/web_workers/images/loader.js +++ b/modules/playground/src/web_workers/images/loader.js @@ -1,9 +1,15 @@ -importScripts("../../../vendor/core.js", - "../../../vendor/zone.js", - "../../../vendor/long-stack-trace-zone.js", - "../../../vendor/system.src.js", - "../../../vendor/Reflect.js", - "b64.js"); +/** + * @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 + */ + +importScripts( + '../../../vendor/core.js', '../../../vendor/zone.js', + '../../../vendor/long-stack-trace-zone.js', '../../../vendor/system.src.js', + '../../../vendor/Reflect.js', 'b64.js'); System.config({ @@ -19,21 +25,19 @@ System.config({ '@angular/platform-webworker': {main: 'index.js', defaultExtension: 'js'}, '@angular/platform-webworker-dynamic': {main: 'index.js', defaultExtension: 'js'}, '@angular/router': {main: 'index.js', defaultExtension: 'js'}, - 'rxjs': { - defaultExtension: 'js' - } + 'rxjs': {defaultExtension: 'js'}, }, defaultJSExtensions: true }); -System.import("playground/src/web_workers/images/background_index") - .then( - function(m) { - try { - m.main(); - } catch (e) { - console.error(e); - } - }, - function(error) { console.error("error loading background", error); }); +System.import('playground/src/web_workers/images/background_index') + .then( + function(m) { + try { + m.main(); + } catch (e) { + console.error(e); + } + }, + function(error) { console.error('error loading background', error); }); diff --git a/modules/playground/src/web_workers/input/loader.js b/modules/playground/src/web_workers/input/loader.js index da3d48480f..e6768680b8 100644 --- a/modules/playground/src/web_workers/input/loader.js +++ b/modules/playground/src/web_workers/input/loader.js @@ -1,8 +1,15 @@ -importScripts("../../../vendor/core.js", - "../../../vendor/zone.js", - "../../../vendor/long-stack-trace-zone.js", - "../../../vendor/system.src.js", - "../../../vendor/Reflect.js"); +/** + * @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 + */ + +importScripts( + '../../../vendor/core.js', '../../../vendor/zone.js', + '../../../vendor/long-stack-trace-zone.js', '../../../vendor/system.src.js', + '../../../vendor/Reflect.js'); System.config({ @@ -18,21 +25,19 @@ System.config({ '@angular/platform-browser-dynamic': {main: 'index.js', defaultExtension: 'js'}, '@angular/platform-webworker': {main: 'index.js', defaultExtension: 'js'}, '@angular/platform-webworker-dynamic': {main: 'index.js', defaultExtension: 'js'}, - 'rxjs': { - defaultExtension: 'js' - } + 'rxjs': {defaultExtension: 'js'}, }, defaultJSExtensions: true }); -System.import("playground/src/web_workers/input/background_index") - .then( - function(m) { - try { - m.main(); - } catch (e) { - console.error(e); - } - }, - function(error) { console.error("error loading background", error); }); +System.import('playground/src/web_workers/input/background_index') + .then( + function(m) { + try { + m.main(); + } catch (e) { + console.error(e); + } + }, + function(error) { console.error('error loading background', error); }); diff --git a/modules/playground/src/web_workers/kitchen_sink/loader.js b/modules/playground/src/web_workers/kitchen_sink/loader.js index 8d6ab0ca00..49afc84d6d 100644 --- a/modules/playground/src/web_workers/kitchen_sink/loader.js +++ b/modules/playground/src/web_workers/kitchen_sink/loader.js @@ -1,8 +1,15 @@ -importScripts("../../../vendor/core.js", - "../../../vendor/zone.js", - "../../../vendor/long-stack-trace-zone.js", - "../../../vendor/system.src.js", - "../../../vendor/Reflect.js"); +/** + * @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 + */ + +importScripts( + '../../../vendor/core.js', '../../../vendor/zone.js', + '../../../vendor/long-stack-trace-zone.js', '../../../vendor/system.src.js', + '../../../vendor/Reflect.js'); System.config({ @@ -19,21 +26,19 @@ System.config({ '@angular/platform-webworker': {main: 'index.js', defaultExtension: 'js'}, '@angular/platform-webworker-dynamic': {main: 'index.js', defaultExtension: 'js'}, '@angular/router': {main: 'index.js', defaultExtension: 'js'}, - 'rxjs': { - defaultExtension: 'js' - }, + 'rxjs': {defaultExtension: 'js'}, }, defaultJSExtensions: true }); -System.import("playground/src/web_workers/kitchen_sink/background_index") - .then( - function(m) { - try { - m.main(); - } catch (e) { - console.error(e); - } - }, - function(error) { console.error("error loading background", error); }); +System.import('playground/src/web_workers/kitchen_sink/background_index') + .then( + function(m) { + try { + m.main(); + } catch (e) { + console.error(e); + } + }, + function(error) { console.error('error loading background', error); }); diff --git a/modules/playground/src/web_workers/message_broker/loader.js b/modules/playground/src/web_workers/message_broker/loader.js index b2bccbc7db..d6e27f8cba 100644 --- a/modules/playground/src/web_workers/message_broker/loader.js +++ b/modules/playground/src/web_workers/message_broker/loader.js @@ -1,8 +1,15 @@ -importScripts("../../../vendor/core.js", - "../../../vendor/zone.js", - "../../../vendor/long-stack-trace-zone.js", - "../../../vendor/system.src.js", - "../../../vendor/Reflect.js"); +/** + * @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 + */ + +importScripts( + '../../../vendor/core.js', '../../../vendor/zone.js', + '../../../vendor/long-stack-trace-zone.js', '../../../vendor/system.src.js', + '../../../vendor/Reflect.js'); System.config({ @@ -19,21 +26,19 @@ System.config({ '@angular/router': {main: 'index.js', defaultExtension: 'js'}, '@angular/platform-webworker': {main: 'index.js', defaultExtension: 'js'}, '@angular/platform-webworker-dynamic': {main: 'index.js', defaultExtension: 'js'}, - 'rxjs': { - defaultExtension: 'js' - }, + 'rxjs': {defaultExtension: 'js'}, }, defaultJSExtensions: true }); -System.import("playground/src/web_workers/message_broker/background_index") - .then( - function(m) { - try { - m.main(); - } catch (e) { - console.error(e); - } - }, - function(error) { console.error("error loading background", error); }); +System.import('playground/src/web_workers/message_broker/background_index') + .then( + function(m) { + try { + m.main(); + } catch (e) { + console.error(e); + } + }, + function(error) { console.error('error loading background', error); }); diff --git a/modules/playground/src/web_workers/router/loader.js b/modules/playground/src/web_workers/router/loader.js index 7f812c68e1..eaf32d6c57 100644 --- a/modules/playground/src/web_workers/router/loader.js +++ b/modules/playground/src/web_workers/router/loader.js @@ -1,8 +1,15 @@ -importScripts("../../../vendor/core.js", - "../../../vendor/zone.js", - "../../../vendor/long-stack-trace-zone.js", - "../../../vendor/system.src.js", - "../../../vendor/Reflect.js"); +/** + * @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 + */ + +importScripts( + '../../../vendor/core.js', '../../../vendor/zone.js', + '../../../vendor/long-stack-trace-zone.js', '../../../vendor/system.src.js', + '../../../vendor/Reflect.js'); System.config({ @@ -19,21 +26,19 @@ System.config({ '@angular/platform-webworker': {main: 'index.js', defaultExtension: 'js'}, '@angular/platform-webworker-dynamic': {main: 'index.js', defaultExtension: 'js'}, '@angular/router': {main: 'index.js', defaultExtension: 'js'}, - 'rxjs': { - defaultExtension: 'js' - }, + 'rxjs': {defaultExtension: 'js'}, }, defaultJSExtensions: true }); -System.import("playground/src/web_workers/router/background_index") - .then( - function(m) { - try { - m.main(); - } catch (e) { - console.error(e); - } - }, - function(error) { console.error("error loading background", error); }); +System.import('playground/src/web_workers/router/background_index') + .then( + function(m) { + try { + m.main(); + } catch (e) { + console.error(e); + } + }, + function(error) { console.error('error loading background', error); }); diff --git a/modules/playground/src/web_workers/todo/loader.js b/modules/playground/src/web_workers/todo/loader.js index b658b5f2af..f6a091b54c 100644 --- a/modules/playground/src/web_workers/todo/loader.js +++ b/modules/playground/src/web_workers/todo/loader.js @@ -1,8 +1,15 @@ -importScripts("../../../vendor/core.js", - "../../../vendor/zone.js", - "../../../vendor/long-stack-trace-zone.js", - "../../../vendor/system.src.js", - "../../../vendor/Reflect.js"); +/** + * @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 + */ + +importScripts( + '../../../vendor/core.js', '../../../vendor/zone.js', + '../../../vendor/long-stack-trace-zone.js', '../../../vendor/system.src.js', + '../../../vendor/Reflect.js'); System.config({ @@ -20,21 +27,19 @@ System.config({ '@angular/platform-webworker': {main: 'index.js', defaultExtension: 'js'}, '@angular/platform-webworker-dynamic': {main: 'index.js', defaultExtension: 'js'}, '@angular/router': {main: 'index.js', defaultExtension: 'js'}, - 'rxjs': { - defaultExtension: 'js' - } + 'rxjs': {defaultExtension: 'js'}, }, defaultJSExtensions: true }); -System.import("playground/src/web_workers/todo/background_index") - .then( - function(m) { - try { - m.main(); - } catch (e) { - console.error(e); - } - }, - function(error) { console.error("error loading background", error); }); +System.import('playground/src/web_workers/todo/background_index') + .then( + function(m) { + try { + m.main(); + } catch (e) { + console.error(e); + } + }, + function(error) { console.error('error loading background', error); }); diff --git a/modules/rollup-test/hello_world.js b/modules/rollup-test/hello_world.js index dc7362e2bb..a187d9e5c3 100644 --- a/modules/rollup-test/hello_world.js +++ b/modules/rollup-test/hello_world.js @@ -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({ selector: 'hello-world', //template: 'hello world!!!' diff --git a/modules/rollup-test/rollup.config.js b/modules/rollup-test/rollup.config.js index a00d967cc4..0746125542 100644 --- a/modules/rollup-test/rollup.config.js +++ b/modules/rollup-test/rollup.config.js @@ -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 tsc from 'typescript' diff --git a/protractor-e2e.conf.js b/protractor-e2e.conf.js index 685fe883d9..7afc6f56f2 100644 --- a/protractor-e2e.conf.js +++ b/protractor-e2e.conf.js @@ -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 // as this could exit node if the help script should be printed. require('./dist/all/e2e_util/e2e_util').readCommandLine(); var BROWSER_OPTIONS = { LocalChrome: { - 'browserName': 'chrome' + 'browserName': 'chrome', }, ChromeOnTravis: { browserName: 'chrome', chromeOptions: { 'args': ['--no-sandbox'], - 'binary': process.env.CHROME_BIN + 'binary': process.env.CHROME_BIN, } } }; exports.config = { - onPrepare: function() { - beforeEach(function() { - browser.ignoreSynchronization = false; - }); - }, + onPrepare: function() { beforeEach(function() { browser.ignoreSynchronization = false; }); }, allScriptsTimeout: 11000, - specs: [ - 'dist/all/**/e2e_test/**/*_spec.js' - ], + specs: ['dist/all/**/e2e_test/**/*_spec.js'], exclude: [ 'dist/all/@angular/examples/**', '**/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, directConnect: true, baseUrl: 'http://localhost:8000/', framework: 'jasmine2', - jasmineNodeOpts: { - showColors: true, - defaultTimeoutInterval: 60000, - print: function(msg) { console.log(msg)} - }, - useAllAngular2AppRoots: true + jasmineNodeOpts: + {showColors: true, defaultTimeoutInterval: 60000, print: function(msg) { console.log(msg) }}, + useAllAngular2AppRoots: true, }; - - diff --git a/protractor-examples-e2e.conf.js b/protractor-examples-e2e.conf.js index 69fb4243cc..8a08e3b2e0 100644 --- a/protractor-examples-e2e.conf.js +++ b/protractor-examples-e2e.conf.js @@ -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 // as this could exit node if the help script should be printed. require('./dist/all/e2e_util/e2e_util').readCommandLine(); var BROWSER_OPTIONS = { - LocalChrome: { - 'browserName': 'chrome' - }, + LocalChrome: {'browserName': 'chrome'}, ChromeOnTravis: { browserName: 'chrome', chromeOptions: { 'args': ['--no-sandbox'], - 'binary': process.env.CHROME_BIN + 'binary': process.env.CHROME_BIN, } - } + }, }; exports.config = { - onPrepare: function() { - beforeEach(function() { - browser.ignoreSynchronization = false; - }); - }, + onPrepare: function() { beforeEach(function() { browser.ignoreSynchronization = false; }); }, allScriptsTimeout: 11000, - specs: [ - 'dist/examples/**/e2e_test/*_spec.js' - ], + specs: ['dist/examples/**/e2e_test/*_spec.js'], capabilities: process.env.TRAVIS ? BROWSER_OPTIONS.ChromeOnTravis : BROWSER_OPTIONS.LocalChrome, directConnect: true, baseUrl: 'http://localhost:8001/', @@ -32,7 +32,7 @@ exports.config = { jasmineNodeOpts: { showColors: true, defaultTimeoutInterval: 60000, - print: function(msg) { console.log(msg)} + print: function(msg) { console.log(msg); }, }, useAllAngular2AppRoots: true }; diff --git a/protractor-perf.conf.js b/protractor-perf.conf.js index 97b250225b..a2a618be42 100644 --- a/protractor-perf.conf.js +++ b/protractor-perf.conf.js @@ -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 // as this could exit node if the help script should be printed. require('./dist/all/e2e_util/perf_util').readCommandLine(); @@ -15,32 +23,26 @@ var BROWSER_CAPS = { chromeOptions: CHROME_OPTIONS, loggingPrefs: { performance: 'ALL', - browser: 'ALL' + browser: 'ALL', } }, ChromeOnTravis: { browserName: 'chrome', chromeOptions: mergeInto(CHROME_OPTIONS, { - 'binary': process.env.CHROME_BIN + 'binary': process.env.CHROME_BIN, }), loggingPrefs: { performance: 'ALL', - browser: 'ALL' + browser: 'ALL', } } }; exports.config = { - onPrepare: function() { - beforeEach(function() { - browser.ignoreSynchronization = false; - }); - }, + onPrepare: function() { beforeEach(function() { browser.ignoreSynchronization = false; }); }, restartBrowserBetweenTests: true, allScriptsTimeout: 11000, - specs: [ - 'dist/all/**/e2e_test/**/*_perf.js' - ], + specs: ['dist/all/**/e2e_test/**/*_perf.js'], capabilities: process.env.TRAVIS ? BROWSER_CAPS.ChromeOnTravis : BROWSER_CAPS.LocalChrome, directConnect: true, baseUrl: 'http://localhost:8000/', @@ -48,14 +50,14 @@ exports.config = { jasmineNodeOpts: { showColors: true, defaultTimeoutInterval: 60000, - print: function(msg) { console.log(msg)} + print: function(msg) { console.log(msg); }, }, useAllAngular2AppRoots: true }; function mergeInto(src, target) { -for (var prop in src) { - target[prop] = src[prop]; -} -return target; + for (var prop in src) { + target[prop] = src[prop]; + } + return target; } diff --git a/scripts/browserstack/start_tunnel.js b/scripts/browserstack/start_tunnel.js index f4ebe0fa8f..c4bb6b95f7 100644 --- a/scripts/browserstack/start_tunnel.js +++ b/scripts/browserstack/start_tunnel.js @@ -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'; var fs = require('fs'); diff --git a/test-main.js b/test-main.js index 11e11de04b..5507d941bd 100644 --- a/test-main.js +++ b/test-main.js @@ -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 -Error.stackTraceLimit=Infinity; +Error.stackTraceLimit = Infinity; jasmine.DEFAULT_TIMEOUT_INTERVAL = 100; @@ -17,94 +25,32 @@ System.config({ 'parse5': 'dist/all/empty.js', '@angular/platform-server/src/parse5_adapter': 'dist/all/empty.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: { - '@angular/core/testing': { - main: 'index.js', - defaultExtension: 'js' - }, - '@angular/core': { - 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' - }, + '@angular/core/testing': {main: 'index.js', defaultExtension: 'js'}, + '@angular/core': {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 - '@angular/facade': { - main: 'index.js', - defaultExtension: 'js' - }, - '@angular/router/testing': { - main: 'index.js', - defaultExtension: 'js' - }, - '@angular/router': { - main: 'index.js', - defaultExtension: 'js' - }, - '@angular/http/testing': { - main: 'index.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' - } + '@angular/facade': {main: 'index.js', defaultExtension: 'js'}, + '@angular/router/testing': {main: 'index.js', defaultExtension: 'js'}, + '@angular/router': {main: 'index.js', defaultExtension: 'js'}, + '@angular/http/testing': {main: 'index.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()` // method and kick off Karma (Jasmine). System.import('@angular/core/testing') - .then(function(coreTesting){ - return System.import('@angular/platform-browser-dynamic/testing') - .then(function(browserTesting) { - coreTesting.TestBed.initTestEnvironment( - browserTesting.BrowserDynamicTestingModule, - browserTesting.platformBrowserDynamicTesting()); - }); - }) -.then(function() { - return Promise.all( - Object.keys(window.__karma__.files) // All files served by Karma. - .filter(onlySpecFiles) - .map(window.file2moduleName) // Normalize paths to module names. - .map(function(path) { - return System.import(path).then(function(module) { - if (module.hasOwnProperty('main')) { - module.main(); - } else { - throw new Error('Module ' + path + ' does not implement main() method.'); - } - }); - })); -}) -.then(function() { - __karma__.start(); -}, function(error) { - __karma__.error(error.stack || error); -}); + .then(function(coreTesting) { + return System.import('@angular/platform-browser-dynamic/testing') + .then(function(browserTesting) { + coreTesting.TestBed.initTestEnvironment( + browserTesting.BrowserDynamicTestingModule, + browserTesting.platformBrowserDynamicTesting()); + }); + }) + .then(function() { + return Promise.all(Object + .keys(window.__karma__.files) // All files served by Karma. + .filter(onlySpecFiles) + .map(window.file2moduleName) // Normalize paths to module names. + .map(function(path) { + return System.import(path).then(function(module) { + if (module.hasOwnProperty('main')) { + module.main(); + } else { + throw new Error( + 'Module ' + path + ' does not implement main() method.'); + } + }); + })); + }) + .then( + function() { __karma__.start(); }, + function(error) { __karma__.error(error.stack || error); }); function onlySpecFiles(path) { diff --git a/tools/build/benchpress.js b/tools/build/benchpress.js index 7ccbbc923e..a4de6a40c5 100644 --- a/tools/build/benchpress.js +++ b/tools/build/benchpress.js @@ -1,6 +1,11 @@ -module.exports = function(gulp, plugins, config) { - return function(done) { - del(config.path, done); - }; -}; +/** + * @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(gulp, plugins, config) { + return function(done) { del(config.path, done); }; +}; diff --git a/tools/build/file2modulename.js b/tools/build/file2modulename.js index 2906ade4f6..5cd7810e21 100644 --- a/tools/build/file2modulename.js +++ b/tools/build/file2modulename.js @@ -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) { - return filePath.replace(/\\/g, '/') - // module name should be relative to `modules` and `tools` folder - .replace(/.*\/modules\//, '') - // and 'dist' folder - .replace(/.*\/dist\/js\/dev\/es5\//, '') - // module name should not include `lib`, `web` folders - // as they are wrapper packages for dart - .replace(/\/web\//, '/') - .replace(/\/lib\//, '/') - // module name should not have a suffix - .replace(/\.\w*$/, ''); + return filePath + .replace(/\\/g, '/') + // module name should be relative to `modules` and `tools` folder + .replace(/.*\/modules\//, '') + // and 'dist' folder + .replace(/.*\/dist\/js\/dev\/es5\//, '') + // module name should not include `lib`, `web` folders + // as they are wrapper packages for dart + .replace(/\/web\//, '/') + .replace(/\/lib\//, '/') + // module name should not have a suffix + .replace(/\.\w*$/, ''); } if (typeof module !== 'undefined') { module.exports = file2moduleName; diff --git a/tools/build/licensewrap.js b/tools/build/licensewrap.js index 3d87830070..694635cbf2 100644 --- a/tools/build/licensewrap.js +++ b/tools/build/licensewrap.js @@ -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'); module.exports = function(licenseFile, outputFile) { var licenseText = fs.readFileSync(licenseFile); - var license = "/**\n @license\n" + licenseText + "\n */\n"; + var license = '/**\n @license\n' + licenseText + '\n */\n'; if (outputFile) { outputFile = licenseFile + '.wrapped'; fs.writeFileSync(outputFile, license, 'utf8'); diff --git a/tools/build/linknodemodules.js b/tools/build/linknodemodules.js index 9c4f9eaf94..14a49c7948 100644 --- a/tools/build/linknodemodules.js +++ b/tools/build/linknodemodules.js @@ -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 path = require('path'); @@ -8,8 +16,7 @@ module.exports = function(gulp, plugins, config) { console.log('creating link', linkDir, sourceDir); try { fs.symlinkSync(sourceDir, linkDir, 'dir'); - } - catch(e) { + } catch (e) { var sourceDir = path.join(config.dir, relativeFolder); console.log('linking failed: trying to hard copy', linkDir, sourceDir); 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)) { var stats = fs.statSync(src); if (stats.isDirectory()) { fs.mkdirSync(dest); fs.readdirSync(src).forEach(function(childItemName) { - copyRecursiveSync(path.join(src, childItemName), - path.join(dest, childItemName)); + copyRecursiveSync(path.join(src, childItemName), path.join(dest, childItemName)); }); } else { fs.writeFileSync(dest, fs.readFileSync(src)); diff --git a/tools/build/logging.js b/tools/build/logging.js index f7e3d2313e..fb6e8f2f5c 100644 --- a/tools/build/logging.js +++ b/tools/build/logging.js @@ -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 kTrimLeft = /^\s+/; var kTrimRight = /\s+$/; @@ -15,23 +23,18 @@ function findArgvLogs() { } function logsToObject(logstr) { - return logstr. - split(','). - reduce(function(obj, key) { - key = camelize(key); - if (key.length > 0) obj[key] = true; - return obj; - }, Object.create(null)); + return logstr.split(',').reduce(function(obj, key) { + key = camelize(key); + if (key.length > 0) obj[key] = true; + return obj; + }, Object.create(null)); return logs; } function camelize(str) { - return str. - replace(kTrimLeft, ''). - replace(kTrimRight, ''). - replace(kCamelCase, function(match, c) { - return c ? c.toUpperCase() : ""; - }); + return str.replace(kTrimLeft, '').replace(kTrimRight, '').replace(kCamelCase, function(match, c) { + return c ? c.toUpperCase() : ''; + }); } function shouldLog(str) { diff --git a/tools/build/snippets/url_params_to_form.js b/tools/build/snippets/url_params_to_form.js index 60adbd3ff8..a9dd0c29ac 100644 --- a/tools/build/snippets/url_params_to_form.js +++ b/tools/build/snippets/url_params_to_form.js @@ -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 // and store them in appropriate form fields on the page (function() { @@ -6,9 +14,9 @@ while (match = regex.exec(search)) { var name = match[1]; var value = match[2]; - var els = document.querySelectorAll('input[name="'+name+'"]'); + var els = document.querySelectorAll('input[name="' + name + '"]'); var el; - for (var i=0; i /^Rx\.?.*\.js$/.test(bundle)) - // Load file contents - .map(bundle => { - return { - path: bundle, - contents: fs.readFileSync(`${args['build-path']}/${bundle}`).toString() - }; - }) - // Concatenate license to bundle - .map(bundle => { - return { - path: bundle.path, - contents: `${license}${bundle.contents}` - }; - }) - // Write file to disk - .forEach(bundle => fs.writeFileSync(`${args['build-path']}/${bundle.path}`, bundle.contents)); +var bundles = + fs.readdirSync(args['build-path']) + // Match files that begin with Rx and end with js + .filter(bundle => /^Rx\.?.*\.js$/.test(bundle)) + // Load file contents + .map(bundle => { + return { + path: bundle, + contents: fs.readFileSync(`${args['build-path']}/${bundle}`).toString() + }; + }) + // Concatenate license to bundle + .map(bundle => { return {path: bundle.path, contents: `${license}${bundle.contents}`}; }) + // Write file to disk + .forEach( + bundle => fs.writeFileSync(`${args['build-path']}/${bundle.path}`, bundle.contents)); diff --git a/tools/karma/reporter.js b/tools/karma/reporter.js index ecc0b85eb2..9c518d89ad 100644 --- a/tools/karma/reporter.js +++ b/tools/karma/reporter.js @@ -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 DotsReporter = require('karma/lib/reporters/dots_color'); -var createErrorFormatter = function (basePath, emitter, SourceMapConsumer) { +var createErrorFormatter = function(basePath, emitter, SourceMapConsumer) { var lastServedFiles = []; - emitter.on('file_list_modified', function (files) { - lastServedFiles = files.served - }); - function findFile(path) { - return lastServedFiles.filter(_ => _.path === path)[0]; - } + emitter.on('file_list_modified', function(files) { lastServedFiles = files.served }); + function findFile(path) { return lastServedFiles.filter(_ => _.path === path)[0]; } - var URL_REGEXP = new RegExp('(?:https?:\\/\\/[^\\/]*)?\\/?' + - '(base|absolute)' + // prefix - '((?:[A-z]\\:)?[^\\?\\s\\:]*)' + // path - '(\\?\\w*)?' + // sha - '(\\:(\\d+))?' + // line - '(\\:(\\d+))?' + // column - '', 'g') + var URL_REGEXP = new RegExp( + '(?:https?:\\/\\/[^\\/]*)?\\/?' + + '(base|absolute)' + // prefix + '((?:[A-z]\\:)?[^\\?\\s\\:]*)' + // path + '(\\?\\w*)?' + // sha + '(\\:(\\d+))?' + // line + '(\\:(\\d+))?' + // column + '', + 'g'); - return function (msg, indentation) { - msg = (msg || '').replace(URL_REGEXP, function (_, prefix, path, __, ___, line, ____, column) { + return function(msg, indentation) { + msg = (msg || '').replace(URL_REGEXP, function(_, prefix, path, __, ___, line, ____, column) { if (prefix === 'base') { path = basePath + path; } line = parseInt(line || '0', 10); column = parseInt(column || '0', 10); - var file = findFile(path) + var file = findFile(path); if (file && file.sourceMap) { try { - var original = new SourceMapConsumer(file.sourceMap).originalPositionFor({ - line: line, - column: column - }); - return process.cwd() + "/modules/" + original.source + ":" + original.line + ":" + original.column; + var original = new SourceMapConsumer(file.sourceMap) + .originalPositionFor({line: line, column: column}); + return process.cwd() + '/modules/' + original.source + ':' + original.line + ':' + + original.column; } catch (e) { console.warn('SourceMap position not found for trace: %s', msg); } @@ -47,13 +52,16 @@ var createErrorFormatter = function (basePath, emitter, SourceMapConsumer) { } return msg + '\n'; } -} +}; -var InternalAngularReporter = function (config, emitter) { +var InternalAngularReporter = function(config, emitter) { var formatter = createErrorFormatter(config.basePath, emitter, SourceMapConsumer); 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] +}; diff --git a/tools/npm/check-node-modules.js b/tools/npm/check-node-modules.js index 64215c04c2..68747d379a 100755 --- a/tools/npm/check-node-modules.js +++ b/tools/npm/check-node-modules.js @@ -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 path = require('path'); @@ -45,11 +53,11 @@ function _checkCache(markerFile, cacheMarkerFile) { * pull in existing module. */ function _deleteDir(path) { - if( fs.existsSync(path) ) { + if (fs.existsSync(path)) { var subpaths = fs.readdirSync(path); subpaths.forEach(function(subpath) { - var curPath = path + "/" + subpath; - if(fs.lstatSync(curPath).isDirectory()) { + var curPath = path + '/' + subpath; + if (fs.lstatSync(curPath).isDirectory()) { _deleteDir(curPath); } else { fs.unlinkSync(curPath); diff --git a/tools/npm/clean-shrinkwrap.js b/tools/npm/clean-shrinkwrap.js index 3fd05e1c70..3dc3f6c08d 100755 --- a/tools/npm/clean-shrinkwrap.js +++ b/tools/npm/clean-shrinkwrap.js @@ -1,4 +1,11 @@ #!/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 @@ -14,25 +21,22 @@ var path = require('path'); function cleanModule(moduleRecord, name) { - // keep `resolve` properties for git dependencies, delete otherwise delete moduleRecord.from; if (!(moduleRecord.resolved && moduleRecord.resolved.match(/^git(\+[a-z]+)?:\/\//))) { delete moduleRecord.resolved; } - _.forEach(moduleRecord.dependencies, function(mod, name) { - cleanModule(mod, name); - }); + _.forEach(moduleRecord.dependencies, function(mod, name) { cleanModule(mod, name); }); } -//console.log('Reading npm-shrinkwrap.json'); +// console.log('Reading npm-shrinkwrap.json'); var shrinkwrap = require('../../npm-shrinkwrap.json'); -//console.log('Cleaning shrinkwrap object'); +// console.log('Cleaning shrinkwrap object'); cleanModule(shrinkwrap, shrinkwrap.name); var cleanShrinkwrapPath = path.join(__dirname, '..', '..', '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'); diff --git a/tools/travis/travis-fold.js b/tools/travis/travis-fold.js index 330a97c7d0..38ac34e30f 100644 --- a/tools/travis/travis-fold.js +++ b/tools/travis/travis-fold.js @@ -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) { if (process.env.TRAVIS) console.log('travis_fold:start:' + encode(name)); diff --git a/tools/tree-shaking-test/rollup.config.js b/tools/tree-shaking-test/rollup.config.js index b027594f50..633f476432 100644 --- a/tools/tree-shaking-test/rollup.config.js +++ b/tools/tree-shaking-test/rollup.config.js @@ -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 { - resolveId(id, from){ - if(id.startsWith('@angular/')){ + resolveId(id, from) { + if (id.startsWith('@angular/')) { return `${__dirname}/../../packages-dist/${id.split('/')[1]}/esm/index.js`; } @@ -10,11 +18,10 @@ class RollupNG2 { } } - export default { entry: 'test.js', format: 'es6', plugins: [ new RollupNG2(), ] -} +};