chore(build): fix check-format

This commit is contained in:
Alex Eagle 2015-04-11 12:40:05 -07:00
parent e18920884e
commit 7b790a3369
5 changed files with 22 additions and 18 deletions

View File

@ -59,10 +59,10 @@ var typescriptTree = new TypescriptCompiler(modulesTree, {
target: 'ES5', target: 'ES5',
sourceMap: true, sourceMap: true,
mapRoot: '', /* force sourcemaps to use relative path */ mapRoot: '', /* force sourcemaps to use relative path */
module: /*system.js*/'commonjs', module: /*system.js*/ 'commonjs',
allowNonTsExtensions: false, allowNonTsExtensions: false,
typescript: require('typescript'), typescript: require('typescript'),
//declarationFiles: true, // declarationFiles: true,
noEmitOnError: true, noEmitOnError: true,
outDir: 'angular2' outDir: 'angular2'
}); });

View File

@ -23,7 +23,8 @@ var es6DevTree = new TraceurCompiler(modulesTree, '.es6', '.map', {
}); });
// Call Traceur again to lower the ES6 build tree to ES5 // Call Traceur again to lower the ES6 build tree to ES5
var es5DevTree = new TraceurCompiler(es6DevTree, '.js', '.js.map', {modules: 'instantiate', sourceMaps: true}); var es5DevTree =
new TraceurCompiler(es6DevTree, '.js', '.js.map', {modules: 'instantiate', sourceMaps: true});
// Now we add a few more files to the es6 tree that Traceur should not see // Now we add a few more files to the es6 tree that Traceur should not see
['angular2', 'benchmarks', 'benchmarks_external', 'benchpress', 'examples', 'rtts_assert'].forEach( ['angular2', 'benchmarks', 'benchmarks_external', 'benchpress', 'examples', 'rtts_assert'].forEach(

View File

@ -23,14 +23,15 @@ var es6ProdTree = new TraceurCompiler(modulesTree, '.es6', '.map', {
}); });
// Call Traceur again to lower the ES6 build tree to ES5 // Call Traceur again to lower the ES6 build tree to ES5
var es5ProdTree = new TraceurCompiler(es6ProdTree, '.js', '.js.map', {modules: 'instantiate', sourceMaps: true}); var es5ProdTree =
new TraceurCompiler(es6ProdTree, '.js', '.js.map', {modules: 'instantiate', sourceMaps: true});
// Now we add a few more files to the es6 tree that Traceur should not see // Now we add a few more files to the es6 tree that Traceur should not see
['angular2', 'benchmarks', 'benchmarks_external', 'benchpress', 'examples', 'rtts_assert'].forEach( ['angular2', 'benchmarks', 'benchmarks_external', 'benchpress', 'examples', 'rtts_assert'].forEach(
function(destDir) { function(destDir) {
var extras = new Funnel('tools/build', {files: ['es5build.js'], destDir: destDir}); var extras = new Funnel('tools/build', {files: ['es5build.js'], destDir: destDir});
es6ProdTree = mergeTrees([es6ProdTree, extras]); es6ProdTree = mergeTrees([es6ProdTree, extras]);
}); });
var vendorScriptsTree = flatten(new Funnel('.', { var vendorScriptsTree = flatten(new Funnel('.', {
files: [ files: [
@ -46,9 +47,9 @@ var vendorScriptsTree = flatten(new Funnel('.', {
] ]
})); }));
var vendorScripts_benchmark = var vendorScripts_benchmark =
new Funnel('tools/build/snippets', {files: ['url_params_to_form.js'], destDir: '/'}); new Funnel('tools/build/snippets', {files: ['url_params_to_form.js'], destDir: '/'});
var vendorScripts_benchmarks_external = var vendorScripts_benchmarks_external =
new Funnel('node_modules/angular', {files: ['angular.js'], destDir: '/'}); new Funnel('node_modules/angular', {files: ['angular.js'], destDir: '/'});
var servingTrees = []; var servingTrees = [];
function copyVendorScriptsTo(destDir) { function copyVendorScriptsTo(destDir) {
@ -58,7 +59,7 @@ function copyVendorScriptsTo(destDir) {
} }
if (destDir.indexOf('benchmarks_external') > -1) { if (destDir.indexOf('benchmarks_external') > -1) {
servingTrees.push( servingTrees.push(
new Funnel(vendorScripts_benchmarks_external, {srcDir: '/', destDir: destDir})); new Funnel(vendorScripts_benchmarks_external, {srcDir: '/', destDir: destDir}));
} }
} }
@ -85,7 +86,7 @@ htmlTree = replace(htmlTree, {
}); });
// TODO(broccoli): are these needed here, if not loaded by a script tag?? // TODO(broccoli): are these needed here, if not loaded by a script tag??
['benchmarks/src', 'benchmarks_external/src', 'examples/src/benchpress'].forEach( ['benchmarks/src', 'benchmarks_external/src', 'examples/src/benchpress'].forEach(
copyVendorScriptsTo); copyVendorScriptsTo);
var scripts = mergeTrees(servingTrees, {overwrite: true}); var scripts = mergeTrees(servingTrees, {overwrite: true});
var css = new Funnel(modulesTree, {include: ["**/*.css"]}); var css = new Funnel(modulesTree, {include: ["**/*.css"]});
@ -100,4 +101,5 @@ htmlTree = mergeTrees([htmlTree, scripts, polymer, css]);
es5ProdTree = mergeTrees([es5ProdTree, htmlTree]); es5ProdTree = mergeTrees([es5ProdTree, htmlTree]);
module.exports = mergeTrees([stew.mv(es6ProdTree, 'js/prod/es6'), stew.mv(es5ProdTree, 'js/prod/es5')]); module.exports =
mergeTrees([stew.mv(es6ProdTree, 'js/prod/es6'), stew.mv(es5ProdTree, 'js/prod/es5')]);

View File

@ -6,7 +6,8 @@ declare var assert: any;
declare var global: Window; declare var global: Window;
type int = number; type int = number;
interface List<T> extends Array<T> {} interface List<T> extends Array<T> {
}
interface Window { interface Window {
Object: typeof Object; Object: typeof Object;

View File

@ -9,7 +9,7 @@ interface String {
* same as the corresponding elements of this object (converted to a String) starting at * same as the corresponding elements of this object (converted to a String) starting at
* position. Otherwise returns false. * position. Otherwise returns false.
*/ */
startsWith(searchString: string, position ?: number): boolean; startsWith(searchString: string, position?: number): boolean;
} }
interface NumberConstructor { interface NumberConstructor {
@ -29,14 +29,14 @@ interface Array<T> {
* @param end index to stop filling the array at. If end is negative, it is treated as * @param end index to stop filling the array at. If end is negative, it is treated as
* length+end. * length+end.
*/ */
fill(value: T, start ?: number, end ?: number): T[]; fill(value: T, start?: number, end?: number): T[];
} }
// Copied from lib.dom.d.ts and modified // Copied from lib.dom.d.ts and modified
interface Map<K, V> { interface Map<K, V> {
clear(): void; clear(): void;
delete (key: K): boolean; delete (key: K): boolean;
forEach(callbackfn: (value: V, index: K, map: Map<K, V>) => void, thisArg ?: any): void; forEach(callbackfn: (value: V, index: K, map: Map<K, V>) => void, thisArg?: any): void;
get(key: K): V; get(key: K): V;
has(key: K): boolean; has(key: K): boolean;
set(key: K, value: V): Map<K, V>; set(key: K, value: V): Map<K, V>;
@ -54,7 +54,7 @@ interface Set<T> {
add(value: T): Set<T>; add(value: T): Set<T>;
clear(): void; clear(): void;
delete (value: T): boolean; delete (value: T): boolean;
forEach(callbackfn: (value: T, index: T, set: Set<T>) => void, thisArg ?: any): void; forEach(callbackfn: (value: T, index: T, set: Set<T>) => void, thisArg?: any): void;
has(value: T): boolean; has(value: T): boolean;
size: number; size: number;
} }