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

This commit is contained in:
Victor Berchet
2016-10-04 20:39:20 -07:00
committed by Chuck Jazdzewski
parent d25cd244af
commit 0fde7ecd0f
72 changed files with 1166 additions and 946 deletions

View File

@ -1,3 +1,10 @@
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
export default {
entry: '../../../dist/packages-dist/common/testing/index.js',
@ -10,4 +17,4 @@ export default {
'rxjs/Observable': 'Rx',
'rxjs/Subject': 'Rx'
}
}
};

View File

@ -1,3 +1,10 @@
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
export default {
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',
}
}
};

View File

@ -1,10 +1,14 @@
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
module.exports = {
target: 'node',
entry: './test/all_spec.js',
output: {
filename: './all_spec.js'
},
resolve: {
extensions: ['.js']
},
output: {filename: './all_spec.js'},
resolve: {extensions: ['.js']},
};

View File

@ -1,3 +1,10 @@
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
export default {
entry: '../../../dist/packages-dist/compiler/testing/index.js',
@ -11,4 +18,4 @@ export default {
'rxjs/Observable': 'Rx',
'rxjs/Subject': 'Rx'
}
}
};

View File

@ -1,3 +1,10 @@
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
export default {
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 }),
]
}
};

View File

@ -1,3 +1,10 @@
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
export default {
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',
}
}
};

View File

@ -1,3 +1,10 @@
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
export default {
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',
}
}
};

View File

@ -1,3 +1,10 @@
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
export default {
entry: '../../../dist/packages-dist/forms/index.js',
@ -13,4 +20,4 @@ export default {
'rxjs/observable/fromPromise': 'Rx.Observable',
'rxjs/operator/toPromise': 'Rx.Observable.prototype'
}
}
};

View File

@ -1,3 +1,10 @@
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
export default {
entry: '../../../dist/packages-dist/http/testing/index.js',
@ -14,4 +21,4 @@ export default {
'rxjs/Subject': 'Rx',
'rxjs/operator/take': 'Rx.Observable.prototype'
}
}
};

View File

@ -1,3 +1,10 @@
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
export default {
entry: '../../../dist/packages-dist/http/index.js',
@ -11,4 +18,4 @@ export default {
'rxjs/Observable': 'Rx',
'rxjs/Subject': 'Rx'
}
}
};

View File

@ -1,6 +1,15 @@
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
export default {
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'
}
}
};

View File

@ -1,12 +1,21 @@
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
export default {
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',
}
}
};

View File

@ -1,3 +1,10 @@
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
export default {
entry: '../../../dist/packages-dist/platform-browser/testing/index.js',
@ -9,4 +16,4 @@ export default {
'@angular/common': 'ng.common',
'@angular/platform-browser': 'ng.platformBrowser'
}
}
};

View File

@ -1,3 +1,10 @@
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
export default {
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',
}
}
};

View File

@ -1,3 +1,10 @@
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
export default {
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'
}
}
};

View File

@ -1,3 +1,10 @@
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
export default {
entry: '../../../dist/packages-dist/platform-server/index.js',
@ -10,4 +17,4 @@ export default {
'@angular/compiler': 'ng.compiler',
'@angular/platform-browser': 'ng.platformBrowser'
}
}
};

View File

@ -1,6 +1,15 @@
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
export default {
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',
}
}
};

View File

@ -1,3 +1,10 @@
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
export default {
entry: '../../../dist/packages-dist/platform-webworker/index.js',
@ -11,4 +18,4 @@ export default {
'rxjs/Observable': 'Rx',
'rxjs/Subject': 'Rx'
}
}
};

View File

@ -1,9 +1,16 @@
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
/*global jasmine, __karma__, window*/
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);

View File

@ -1,3 +1,11 @@
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
var browserProvidersConf = require('../../../browser-providers.conf.js');
// 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,
});
};

View File

@ -1,3 +1,11 @@
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
export default {
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'
}
}
};

View File

@ -1,3 +1,11 @@
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
export default {
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: []
};

View File

@ -1,3 +1,10 @@
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
export default {
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',
}
}
};