build: consolidate tsc to ease migration to @types/ based typings delivery
I actually tried to use @types/* directly but came across several issues which prevented me from switching over: - https://github.com/Microsoft/TypeScript/issues/8715 - https://github.com/Microsoft/TypeScript/issues/8723
This commit is contained in:
@ -1,5 +1,3 @@
|
||||
/// <reference path="../typings/node/node.d.ts" />
|
||||
/// <reference path="../typings/fs-extra/fs-extra.d.ts" />
|
||||
import fse = require('fs-extra');
|
||||
import path = require('path');
|
||||
import {wrapDiffingPlugin, DiffingBroccoliPlugin, DiffResult} from './diffing-broccoli-plugin';
|
||||
@ -62,8 +60,9 @@ class DartFormatter implements DiffingBroccoliPlugin {
|
||||
}
|
||||
|
||||
let execute = (args: string[]) => {
|
||||
if (args.length < 2) return Promise.resolve();
|
||||
return new Promise((resolve, reject) => {
|
||||
if (args.length < 2)
|
||||
return Promise.resolve();
|
||||
return new Promise<void>((resolve, reject) => {
|
||||
exec(this.DARTFMT + ' ' + args.join(' '), (err: Error, stdout: string, stderr: string) => {
|
||||
if (this.verbose) {
|
||||
console.log(stdout);
|
||||
|
@ -1,6 +1,3 @@
|
||||
/// <reference path="../typings/node/node.d.ts" />
|
||||
/// <reference path="../typings/fs-extra/fs-extra.d.ts" />
|
||||
|
||||
import fs = require('fs');
|
||||
import fse = require('fs-extra');
|
||||
import path = require('path');
|
||||
|
2
tools/broccoli/broccoli-filter.d.ts
vendored
2
tools/broccoli/broccoli-filter.d.ts
vendored
@ -1,5 +1,3 @@
|
||||
/// <reference path="../typings/es6-promise/es6-promise.d.ts" />
|
||||
|
||||
interface FilterOptions {
|
||||
extensions?: string[]
|
||||
}
|
||||
|
@ -1,6 +1,3 @@
|
||||
/// <reference path="../typings/node/node.d.ts" />
|
||||
/// <reference path="../typings/jasmine/jasmine.d.ts" />
|
||||
|
||||
let mockfs = require('mock-fs');
|
||||
import fs = require('fs');
|
||||
import path = require('path');
|
||||
|
@ -1,6 +1,3 @@
|
||||
/// <reference path="../typings/node/node.d.ts" />
|
||||
/// <reference path="../typings/jasmine/jasmine.d.ts" />
|
||||
|
||||
let mockfs = require('mock-fs');
|
||||
import fs = require('fs');
|
||||
import {TreeDiffer, DiffResult} from './tree-differ';
|
||||
|
@ -1,6 +1,3 @@
|
||||
/// <reference path="broccoli.d.ts" />
|
||||
/// <reference path="../typings/node/node.d.ts" />
|
||||
|
||||
import fs = require('fs');
|
||||
let symlinkOrCopy = require('symlink-or-copy');
|
||||
|
||||
|
@ -1,6 +1,3 @@
|
||||
/// <reference path="../typings/node/node.d.ts" />
|
||||
/// <reference path="../typings/fs-extra/fs-extra.d.ts" />
|
||||
|
||||
import fs = require('fs');
|
||||
import fse = require('fs-extra');
|
||||
import path = require('path');
|
||||
|
@ -1,5 +1,3 @@
|
||||
/// <reference path="../typings/node/node.d.ts" />
|
||||
|
||||
import fs = require('fs');
|
||||
import fse = require('fs-extra');
|
||||
import path = require('path');
|
||||
|
2
tools/broccoli/broccoli-writer.d.ts
vendored
2
tools/broccoli/broccoli-writer.d.ts
vendored
@ -1,5 +1,3 @@
|
||||
/// <reference path="../typings/es6-promise/es6-promise.d.ts" />
|
||||
|
||||
declare module "broccoli-writer" {
|
||||
class Writer {
|
||||
write(readTree: (tree: BroccoliTree) => Promise<string>, destDir: string): Promise<any>;
|
||||
|
3
tools/broccoli/broccoli.d.ts
vendored
3
tools/broccoli/broccoli.d.ts
vendored
@ -1,6 +1,3 @@
|
||||
/// <reference path="../typings/es6-promise/es6-promise.d.ts" />
|
||||
|
||||
|
||||
interface BroccoliTree {
|
||||
/**
|
||||
* Contains the fs path for the input tree when the plugin takes only one input tree.
|
||||
|
@ -1,6 +1,4 @@
|
||||
/// <reference path="broccoli.d.ts" />
|
||||
/// <reference path="../typings/fs-extra/fs-extra.d.ts" />
|
||||
/// <reference path="../typings/node/node.d.ts" />
|
||||
|
||||
import fs = require('fs');
|
||||
import fse = require('fs-extra');
|
||||
|
@ -1,5 +1,3 @@
|
||||
/// <reference path="../typings/node/node.d.ts" />
|
||||
/// <reference path="../typings/fs-extra/fs-extra.d.ts" />
|
||||
/// <reference path="./broccoli-writer.d.ts" />
|
||||
|
||||
import Writer = require('broccoli-writer');
|
||||
|
@ -1,6 +1,3 @@
|
||||
/// <reference path="../typings/node/node.d.ts" />
|
||||
/// <reference path="../typings/jasmine/jasmine.d.ts" />
|
||||
|
||||
let mockfs = require('mock-fs');
|
||||
import fs = require('fs');
|
||||
import path = require('path');
|
||||
|
@ -1,5 +1,3 @@
|
||||
/// <reference path="../typings/node/node.d.ts" />
|
||||
|
||||
import fs = require('fs');
|
||||
import path = require('path');
|
||||
|
||||
|
@ -1,4 +1,3 @@
|
||||
/// <reference path="../../typings/node/node.d.ts" />
|
||||
'use strict';
|
||||
|
||||
import {MultiCopy} from './../multi_copy';
|
||||
|
@ -15,12 +15,11 @@
|
||||
"rootDir": "../../dist/all/@angular",
|
||||
"sourceMap": true,
|
||||
"sourceRoot": ".",
|
||||
"lib": ["es6", "dom"],
|
||||
"target": "es5"
|
||||
},
|
||||
"files": [
|
||||
"../../modules/@angular/typings/es6-collections/es6-collections.d.ts",
|
||||
"../../modules/@angular/typings/es6-promise/es6-promise.d.ts",
|
||||
"../../modules/@angular/typings/node/node.d.ts",
|
||||
"../../typings/node/node.d.ts",
|
||||
"../../dist/all/@angular/compiler/test/output/output_emitter_codegen_typed.ts",
|
||||
"../../dist/all/@angular/compiler/test/output/output_emitter_codegen_untyped.ts",
|
||||
"../../dist/all/@angular/compiler/test/offline_compiler_codegen_untyped.ts",
|
||||
|
@ -50,8 +50,8 @@ export class TscWatch {
|
||||
this.onStartCmds.forEach((cmd) => this.runCmd(cmd, null, () => null, () => null));
|
||||
}
|
||||
|
||||
private runCmd(argsOrCmd: string[] | Command, env?: {[k: string]: string},
|
||||
stdOut = pipeStdOut, stdErr = pipeStdErr): Promise<number>
|
||||
private runCmd(argsOrCmd: string[] | Command, env?: {[k: string]: string},
|
||||
stdOut = pipeStdOut, stdErr = pipeStdErr): Promise<number>
|
||||
{
|
||||
if (typeof argsOrCmd == 'function') {
|
||||
return (argsOrCmd as Command)(stdErr, stdOut);
|
||||
@ -117,7 +117,7 @@ export class TscWatch {
|
||||
}
|
||||
|
||||
triggerCmds() {
|
||||
var cmdPromise: Promise<number> = Promise.resolve();
|
||||
var cmdPromise: Promise<number> = Promise.resolve(0);
|
||||
this.onChangeCmds.forEach((cmd: string[] | Command) => {cmdPromise = cmdPromise.then(() => {
|
||||
return this.runCmd(<string[]>cmd);
|
||||
})});
|
||||
|
@ -13,6 +13,7 @@
|
||||
"rootDir": ".",
|
||||
"sourceMap": true,
|
||||
"inlineSources": true,
|
||||
"lib": ["es6", "dom"],
|
||||
"target": "es5"
|
||||
},
|
||||
"exclude": [
|
||||
|
@ -1,21 +0,0 @@
|
||||
{
|
||||
"version": "v4",
|
||||
"repo": "DefinitelyTyped/DefinitelyTyped",
|
||||
"ref": "master",
|
||||
"path": "typings",
|
||||
"bundle": "typings/tsd.d.ts",
|
||||
"installed": {
|
||||
"fs-extra/fs-extra.d.ts": {
|
||||
"commit": "6eebd5e90a1cbd6b47b0705ba72dbcd5baf846f3"
|
||||
},
|
||||
"node/node.d.ts": {
|
||||
"commit": "6eebd5e90a1cbd6b47b0705ba72dbcd5baf846f3"
|
||||
},
|
||||
"es6-promise/es6-promise.d.ts": {
|
||||
"commit": "6eebd5e90a1cbd6b47b0705ba72dbcd5baf846f3"
|
||||
},
|
||||
"jasmine/jasmine.d.ts": {
|
||||
"commit": "6eebd5e90a1cbd6b47b0705ba72dbcd5baf846f3"
|
||||
}
|
||||
}
|
||||
}
|
5
tools/types.d.ts
vendored
Normal file
5
tools/types.d.ts
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
// This file contains all ambient imports needed to compile the tools source code
|
||||
|
||||
/// <reference path="../typings/jasmine/jasmine.d.ts" />
|
||||
/// <reference path="../typings/node/node.d.ts" />
|
||||
/// <reference path="../typings/fs-extra/fs-extra.d.ts" />
|
Reference in New Issue
Block a user