major update
This commit is contained in:
		@@ -11,7 +11,7 @@ var plugins = {
 | 
				
			|||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
plugins.beautylog.log('now compiling the mojo.io gulp tasks');
 | 
					plugins.beautylog.log('now compiling NPMTS');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
plugins.gulp.task('indexTS', function() {
 | 
					plugins.gulp.task('indexTS', function() {
 | 
				
			||||||
    var tsResult = plugins.gulp.src('../ts/index.ts')
 | 
					    var tsResult = plugins.gulp.src('../ts/index.ts')
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										9
									
								
								index.d.ts
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										9
									
								
								index.d.ts
									
									
									
									
										vendored
									
									
								
							@@ -1,4 +1,4 @@
 | 
				
			|||||||
/// <reference path="../ts/typings/tsd.d.ts" />
 | 
					/// <reference path="../ts/typings/main.d.ts" />
 | 
				
			||||||
declare module NpmtsPlugins {
 | 
					declare module NpmtsPlugins {
 | 
				
			||||||
    var init: () => {
 | 
					    var init: () => {
 | 
				
			||||||
        beautylog: any;
 | 
					        beautylog: any;
 | 
				
			||||||
@@ -7,7 +7,6 @@ declare module NpmtsPlugins {
 | 
				
			|||||||
        g: {
 | 
					        g: {
 | 
				
			||||||
            insert: any;
 | 
					            insert: any;
 | 
				
			||||||
            sequence: any;
 | 
					            sequence: any;
 | 
				
			||||||
            tsd: any;
 | 
					 | 
				
			||||||
            typescript: any;
 | 
					            typescript: any;
 | 
				
			||||||
        };
 | 
					        };
 | 
				
			||||||
        mergeStream: any;
 | 
					        mergeStream: any;
 | 
				
			||||||
@@ -15,6 +14,7 @@ declare module NpmtsPlugins {
 | 
				
			|||||||
        path: any;
 | 
					        path: any;
 | 
				
			||||||
        q: any;
 | 
					        q: any;
 | 
				
			||||||
        smartcli: any;
 | 
					        smartcli: any;
 | 
				
			||||||
 | 
					        typings: any;
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
declare module NpmtsPaths {
 | 
					declare module NpmtsPaths {
 | 
				
			||||||
@@ -23,6 +23,9 @@ declare module NpmtsPaths {
 | 
				
			|||||||
declare module NpmtsOptions {
 | 
					declare module NpmtsOptions {
 | 
				
			||||||
    var run: () => any;
 | 
					    var run: () => any;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					declare module NpmtsTypings {
 | 
				
			||||||
 | 
					    var run: () => any;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
declare module NpmtsDefault {
 | 
					declare module NpmtsDefault {
 | 
				
			||||||
    var run: () => any;
 | 
					    var run: () => any;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@@ -39,7 +42,6 @@ declare var plugins: {
 | 
				
			|||||||
    g: {
 | 
					    g: {
 | 
				
			||||||
        insert: any;
 | 
					        insert: any;
 | 
				
			||||||
        sequence: any;
 | 
					        sequence: any;
 | 
				
			||||||
        tsd: any;
 | 
					 | 
				
			||||||
        typescript: any;
 | 
					        typescript: any;
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
    mergeStream: any;
 | 
					    mergeStream: any;
 | 
				
			||||||
@@ -47,6 +49,7 @@ declare var plugins: {
 | 
				
			|||||||
    path: any;
 | 
					    path: any;
 | 
				
			||||||
    q: any;
 | 
					    q: any;
 | 
				
			||||||
    smartcli: any;
 | 
					    smartcli: any;
 | 
				
			||||||
 | 
					    typings: any;
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
declare var paths: any;
 | 
					declare var paths: any;
 | 
				
			||||||
declare var promisechain: any;
 | 
					declare var promisechain: any;
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										50
									
								
								index.js
									
									
									
									
									
								
							
							
						
						
									
										50
									
								
								index.js
									
									
									
									
									
								
							@@ -6,19 +6,19 @@ var NpmtsPlugins;
 | 
				
			|||||||
    NpmtsPlugins.init = function () {
 | 
					    NpmtsPlugins.init = function () {
 | 
				
			||||||
        var plugins = {
 | 
					        var plugins = {
 | 
				
			||||||
            beautylog: require("beautylog"),
 | 
					            beautylog: require("beautylog"),
 | 
				
			||||||
            fs: require("fs"),
 | 
					            fs: require("fs-extra"),
 | 
				
			||||||
            gulp: require("gulp"),
 | 
					            gulp: require("gulp"),
 | 
				
			||||||
            g: {
 | 
					            g: {
 | 
				
			||||||
                insert: require("gulp-insert"),
 | 
					                insert: require("gulp-insert"),
 | 
				
			||||||
                sequence: require("gulp-sequence"),
 | 
					                sequence: require("gulp-sequence"),
 | 
				
			||||||
                tsd: require("gulp-tsd"),
 | 
					 | 
				
			||||||
                typescript: require("gulp-typescript")
 | 
					                typescript: require("gulp-typescript")
 | 
				
			||||||
            },
 | 
					            },
 | 
				
			||||||
            mergeStream: require("merge2"),
 | 
					            mergeStream: require("merge2"),
 | 
				
			||||||
            mocha: require("mocha"),
 | 
					            mocha: require("mocha"),
 | 
				
			||||||
            path: require("path"),
 | 
					            path: require("path"),
 | 
				
			||||||
            q: require("q"),
 | 
					            q: require("q"),
 | 
				
			||||||
            smartcli: require("smartcli")
 | 
					            smartcli: require("smartcli"),
 | 
				
			||||||
 | 
					            typings: require("typings")
 | 
				
			||||||
        };
 | 
					        };
 | 
				
			||||||
        return plugins;
 | 
					        return plugins;
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
@@ -30,7 +30,7 @@ var NpmtsPaths;
 | 
				
			|||||||
    NpmtsPaths.init = function () {
 | 
					    NpmtsPaths.init = function () {
 | 
				
			||||||
        var paths = {};
 | 
					        var paths = {};
 | 
				
			||||||
        paths.cwd = plugins.smartcli.get.cwd().path;
 | 
					        paths.cwd = plugins.smartcli.get.cwd().path;
 | 
				
			||||||
        paths.tsd = plugins.path.join(paths.cwd, "ts/tsd.json");
 | 
					        paths.tsDir = plugins.path.join(paths.cwd, "ts/");
 | 
				
			||||||
        paths.indexTS = plugins.path.join(paths.cwd, "ts/index.ts");
 | 
					        paths.indexTS = plugins.path.join(paths.cwd, "ts/index.ts");
 | 
				
			||||||
        paths.testTS = plugins.path.join(paths.cwd, "ts/test.ts");
 | 
					        paths.testTS = plugins.path.join(paths.cwd, "ts/test.ts");
 | 
				
			||||||
        paths.testDir = plugins.path.join(paths.cwd, "test/");
 | 
					        paths.testDir = plugins.path.join(paths.cwd, "test/");
 | 
				
			||||||
@@ -47,24 +47,24 @@ var NpmtsOptions;
 | 
				
			|||||||
    };
 | 
					    };
 | 
				
			||||||
})(NpmtsOptions || (NpmtsOptions = {}));
 | 
					})(NpmtsOptions || (NpmtsOptions = {}));
 | 
				
			||||||
/// <reference path="./index.ts" />
 | 
					/// <reference path="./index.ts" />
 | 
				
			||||||
 | 
					var NpmtsTypings;
 | 
				
			||||||
 | 
					(function (NpmtsTypings) {
 | 
				
			||||||
 | 
					    NpmtsTypings.run = function () {
 | 
				
			||||||
 | 
					        var done = plugins.q.defer();
 | 
				
			||||||
 | 
					        plugins.beautylog.log("now installing typings");
 | 
				
			||||||
 | 
					        plugins.typings.install({ production: false, cwd: paths.tsDir })
 | 
				
			||||||
 | 
					            .then(function () {
 | 
				
			||||||
 | 
					            done.resolve();
 | 
				
			||||||
 | 
					        });
 | 
				
			||||||
 | 
					        return done.promise;
 | 
				
			||||||
 | 
					    };
 | 
				
			||||||
 | 
					})(NpmtsTypings || (NpmtsTypings = {}));
 | 
				
			||||||
 | 
					/// <reference path="./index.ts" /> 
 | 
				
			||||||
/// <reference path="./index.ts" />
 | 
					/// <reference path="./index.ts" />
 | 
				
			||||||
var NpmtsDefault;
 | 
					var NpmtsDefault;
 | 
				
			||||||
(function (NpmtsDefault) {
 | 
					(function (NpmtsDefault) {
 | 
				
			||||||
    NpmtsDefault.run = function () {
 | 
					    NpmtsDefault.run = function () {
 | 
				
			||||||
        var done = plugins.q.defer();
 | 
					        var done = plugins.q.defer();
 | 
				
			||||||
        plugins.gulp.task("defaultTsd", function (cb) {
 | 
					 | 
				
			||||||
            if (!process.env.TRAVIS) {
 | 
					 | 
				
			||||||
                plugins.g.tsd({
 | 
					 | 
				
			||||||
                    command: 'reinstall',
 | 
					 | 
				
			||||||
                    config: paths.tsd
 | 
					 | 
				
			||||||
                }, cb);
 | 
					 | 
				
			||||||
                plugins.beautylog.log("now installing typings from" + " ts/tsd.json".blue);
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
            else {
 | 
					 | 
				
			||||||
                plugins.beautylog.warn("We are on TRAVIS. Typings will not be installed due to GitHub API restrictions.");
 | 
					 | 
				
			||||||
                plugins.beautylog.log("Make sure the repo tracks " + "typings".blue + " directories");
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
        });
 | 
					 | 
				
			||||||
        plugins.gulp.task("defaultIndexTS", function () {
 | 
					        plugins.gulp.task("defaultIndexTS", function () {
 | 
				
			||||||
            plugins.beautylog.log("now compiling" + " ts/index.ts".blue);
 | 
					            plugins.beautylog.log("now compiling" + " ts/index.ts".blue);
 | 
				
			||||||
            var tsResult = plugins.gulp.src(paths.indexTS)
 | 
					            var tsResult = plugins.gulp.src(paths.indexTS)
 | 
				
			||||||
@@ -93,7 +93,7 @@ var NpmtsDefault;
 | 
				
			|||||||
            cb();
 | 
					            cb();
 | 
				
			||||||
        });
 | 
					        });
 | 
				
			||||||
        plugins.gulp.task("default", function (cb) {
 | 
					        plugins.gulp.task("default", function (cb) {
 | 
				
			||||||
            plugins.g.sequence("defaultTsd", "defaultIndexTS", "defaultTestTS", "defaultCleanup", cb);
 | 
					            plugins.g.sequence("defaultIndexTS", "defaultTestTS", "defaultCleanup", cb);
 | 
				
			||||||
        });
 | 
					        });
 | 
				
			||||||
        plugins.gulp.start.apply(plugins.gulp, ['default']);
 | 
					        plugins.gulp.start.apply(plugins.gulp, ['default']);
 | 
				
			||||||
        return done.promise;
 | 
					        return done.promise;
 | 
				
			||||||
@@ -104,16 +104,15 @@ var NpmtsTests;
 | 
				
			|||||||
(function (NpmtsTests) {
 | 
					(function (NpmtsTests) {
 | 
				
			||||||
    NpmtsTests.run = function () {
 | 
					    NpmtsTests.run = function () {
 | 
				
			||||||
        var done = plugins.q.defer();
 | 
					        var done = plugins.q.defer();
 | 
				
			||||||
 | 
					        plugins.fs.ensureDirSync(paths.testDir); //make sure that mocha has a directory to look for tests
 | 
				
			||||||
        plugins.beautylog.info("Now running mocha tests");
 | 
					        plugins.beautylog.info("Now running mocha tests");
 | 
				
			||||||
        // Instantiate a Mocha instance.
 | 
					        var mocha = new plugins.mocha(); // Instantiate a Mocha instance.
 | 
				
			||||||
        var mocha = new plugins.mocha();
 | 
					 | 
				
			||||||
        var testDir = paths.testDir;
 | 
					 | 
				
			||||||
        // Add each .js file to the mocha instance
 | 
					        // Add each .js file to the mocha instance
 | 
				
			||||||
        plugins.fs.readdirSync(testDir).filter(function (file) {
 | 
					        plugins.fs.readdirSync(paths.testDir).filter(function (file) {
 | 
				
			||||||
            // Only keep the .js files
 | 
					            // Only keep the .js files
 | 
				
			||||||
            return file.substr(-3) === '.js';
 | 
					            return file.substr(-3) === '.js';
 | 
				
			||||||
        }).forEach(function (file) {
 | 
					        }).forEach(function (file) {
 | 
				
			||||||
            mocha.addFile(plugins.path.join(testDir, file));
 | 
					            mocha.addFile(plugins.path.join(paths.testDir, file));
 | 
				
			||||||
        });
 | 
					        });
 | 
				
			||||||
        // Run the tests.
 | 
					        // Run the tests.
 | 
				
			||||||
        mocha.run(function (failures) {
 | 
					        mocha.run(function (failures) {
 | 
				
			||||||
@@ -130,20 +129,23 @@ var NpmtsPromisechain;
 | 
				
			|||||||
    NpmtsPromisechain.init = function () {
 | 
					    NpmtsPromisechain.init = function () {
 | 
				
			||||||
        var promisechain;
 | 
					        var promisechain;
 | 
				
			||||||
        NpmtsOptions.run()
 | 
					        NpmtsOptions.run()
 | 
				
			||||||
 | 
					            .then(NpmtsTypings.run)
 | 
				
			||||||
            .then(NpmtsDefault.run)
 | 
					            .then(NpmtsDefault.run)
 | 
				
			||||||
            .then(NpmtsTests.run);
 | 
					            .then(NpmtsTests.run);
 | 
				
			||||||
        return promisechain;
 | 
					        return promisechain;
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
})(NpmtsPromisechain || (NpmtsPromisechain = {}));
 | 
					})(NpmtsPromisechain || (NpmtsPromisechain = {}));
 | 
				
			||||||
/// <reference path="./typings/tsd.d.ts" />
 | 
					/// <reference path="./typings/main.d.ts" />
 | 
				
			||||||
/// <reference path="./npmts.plugins.ts" />
 | 
					/// <reference path="./npmts.plugins.ts" />
 | 
				
			||||||
/// <reference path="./npmts.cli.ts" />
 | 
					/// <reference path="./npmts.cli.ts" />
 | 
				
			||||||
/// <reference path="./npmts.paths.ts" />
 | 
					/// <reference path="./npmts.paths.ts" />
 | 
				
			||||||
/// <reference path="./npmts.options.ts" />
 | 
					/// <reference path="./npmts.options.ts" />
 | 
				
			||||||
 | 
					/// <reference path="./npmts.typings.ts" />
 | 
				
			||||||
/// <reference path="./npmts.custom.ts" />
 | 
					/// <reference path="./npmts.custom.ts" />
 | 
				
			||||||
/// <reference path="./npmts.default.ts" />
 | 
					/// <reference path="./npmts.default.ts" />
 | 
				
			||||||
/// <reference path="./npmts.tests.ts" />
 | 
					/// <reference path="./npmts.tests.ts" />
 | 
				
			||||||
/// <reference path="./npmts.promisechain.ts" />
 | 
					/// <reference path="./npmts.promisechain.ts" />
 | 
				
			||||||
 | 
					console.log("** starting NPMTS **");
 | 
				
			||||||
var plugins = NpmtsPlugins.init();
 | 
					var plugins = NpmtsPlugins.init();
 | 
				
			||||||
var paths = NpmtsPaths.init();
 | 
					var paths = NpmtsPaths.init();
 | 
				
			||||||
var promisechain = NpmtsPromisechain.init();
 | 
					var promisechain = NpmtsPromisechain.init();
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -28,14 +28,16 @@
 | 
				
			|||||||
  "homepage": "https://github.com/pushrocks/npmts#readme",
 | 
					  "homepage": "https://github.com/pushrocks/npmts#readme",
 | 
				
			||||||
  "dependencies": {
 | 
					  "dependencies": {
 | 
				
			||||||
    "beautylog": "2.0.2",
 | 
					    "beautylog": "2.0.2",
 | 
				
			||||||
 | 
					    "fs-extra": "^0.26.5",
 | 
				
			||||||
    "gulp": "3.9.0",
 | 
					    "gulp": "3.9.0",
 | 
				
			||||||
    "gulp-insert": "0.5.0",
 | 
					    "gulp-insert": "0.5.0",
 | 
				
			||||||
    "gulp-sequence": "^0.4.4",
 | 
					    "gulp-sequence": "^0.4.4",
 | 
				
			||||||
    "gulp-tsd": "^0.1.0",
 | 
					 | 
				
			||||||
    "gulp-typescript": "2.10.0",
 | 
					    "gulp-typescript": "2.10.0",
 | 
				
			||||||
 | 
					    "gulp-typings": "0.0.0",
 | 
				
			||||||
    "merge2": "0.3.6",
 | 
					    "merge2": "0.3.6",
 | 
				
			||||||
    "mocha": "^2.4.5",
 | 
					    "mocha": "^2.4.5",
 | 
				
			||||||
    "q": "^1.4.1",
 | 
					    "q": "^1.4.1",
 | 
				
			||||||
    "smartcli": "0.0.11"
 | 
					    "smartcli": "0.0.11",
 | 
				
			||||||
 | 
					    "typings": "^0.6.3"
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,18 +0,0 @@
 | 
				
			|||||||
{
 | 
					 | 
				
			||||||
  "version": "v4",
 | 
					 | 
				
			||||||
  "repo": "borisyankov/DefinitelyTyped",
 | 
					 | 
				
			||||||
  "ref": "master",
 | 
					 | 
				
			||||||
  "path": "typings",
 | 
					 | 
				
			||||||
  "bundle": "typings/tsd.d.ts",
 | 
					 | 
				
			||||||
  "installed": {
 | 
					 | 
				
			||||||
    "node/node.d.ts": {
 | 
					 | 
				
			||||||
      "commit": "78d36dd49b6b55b9fdfe61776a12bf05c8b07777"
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
    "colors/colors.d.ts": {
 | 
					 | 
				
			||||||
      "commit": "09e37435ffb2c56a6f908081194a74756f24f99d"
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
    "vinyl/vinyl.d.ts": {
 | 
					 | 
				
			||||||
      "commit": "78d36dd49b6b55b9fdfe61776a12bf05c8b07777"
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
  }
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
							
								
								
									
										7
									
								
								test/assets/ts/typings.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								test/assets/ts/typings.json
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,7 @@
 | 
				
			|||||||
 | 
					{
 | 
				
			||||||
 | 
					  "ambientDependencies": {
 | 
				
			||||||
 | 
					    "node": "github:DefinitelyTyped/DefinitelyTyped/node/node.d.ts#78d36dd49b6b55b9fdfe61776a12bf05c8b07777",
 | 
				
			||||||
 | 
					    "colors": "github:DefinitelyTyped/DefinitelyTyped/colors/colors.d.ts#09e37435ffb2c56a6f908081194a74756f24f99d",
 | 
				
			||||||
 | 
					    "vinyl": "github:DefinitelyTyped/DefinitelyTyped/vinyl/vinyl.d.ts#78d36dd49b6b55b9fdfe61776a12bf05c8b07777"
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@@ -1,13 +1,14 @@
 | 
				
			|||||||
/// <reference path="./typings/tsd.d.ts" />
 | 
					/// <reference path="./typings/main.d.ts" />
 | 
				
			||||||
/// <reference path="./npmts.plugins.ts" />
 | 
					/// <reference path="./npmts.plugins.ts" />
 | 
				
			||||||
/// <reference path="./npmts.cli.ts" />
 | 
					/// <reference path="./npmts.cli.ts" />
 | 
				
			||||||
/// <reference path="./npmts.paths.ts" />
 | 
					/// <reference path="./npmts.paths.ts" />
 | 
				
			||||||
/// <reference path="./npmts.options.ts" />
 | 
					/// <reference path="./npmts.options.ts" />
 | 
				
			||||||
 | 
					/// <reference path="./npmts.typings.ts" />
 | 
				
			||||||
/// <reference path="./npmts.custom.ts" />
 | 
					/// <reference path="./npmts.custom.ts" />
 | 
				
			||||||
/// <reference path="./npmts.default.ts" />
 | 
					/// <reference path="./npmts.default.ts" />
 | 
				
			||||||
/// <reference path="./npmts.tests.ts" />
 | 
					/// <reference path="./npmts.tests.ts" />
 | 
				
			||||||
/// <reference path="./npmts.promisechain.ts" />
 | 
					/// <reference path="./npmts.promisechain.ts" />
 | 
				
			||||||
 | 
					console.log("** starting NPMTS **")
 | 
				
			||||||
var plugins = NpmtsPlugins.init();
 | 
					var plugins = NpmtsPlugins.init();
 | 
				
			||||||
var paths = NpmtsPaths.init();
 | 
					var paths = NpmtsPaths.init();
 | 
				
			||||||
var promisechain = NpmtsPromisechain.init();
 | 
					var promisechain = NpmtsPromisechain.init();
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -3,19 +3,6 @@
 | 
				
			|||||||
module NpmtsDefault {
 | 
					module NpmtsDefault {
 | 
				
			||||||
    export var run = function() {
 | 
					    export var run = function() {
 | 
				
			||||||
        var done = plugins.q.defer();
 | 
					        var done = plugins.q.defer();
 | 
				
			||||||
        plugins.gulp.task("defaultTsd",function(cb){
 | 
					 | 
				
			||||||
            if(!process.env.TRAVIS) {
 | 
					 | 
				
			||||||
                plugins.g.tsd({
 | 
					 | 
				
			||||||
                    command: 'reinstall',
 | 
					 | 
				
			||||||
                    config: paths.tsd
 | 
					 | 
				
			||||||
                }, cb);
 | 
					 | 
				
			||||||
                plugins.beautylog.log("now installing typings from" + " ts/tsd.json".blue);
 | 
					 | 
				
			||||||
            } else {
 | 
					 | 
				
			||||||
                plugins.beautylog.warn("We are on TRAVIS. Typings will not be installed due to GitHub API restrictions.");
 | 
					 | 
				
			||||||
                plugins.beautylog.log("Make sure the repo tracks " + "typings".blue + " directories")
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        });
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        plugins.gulp.task("defaultIndexTS", function(){
 | 
					        plugins.gulp.task("defaultIndexTS", function(){
 | 
				
			||||||
@@ -50,7 +37,7 @@ module NpmtsDefault {
 | 
				
			|||||||
        });
 | 
					        });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        plugins.gulp.task("default",function(cb){
 | 
					        plugins.gulp.task("default",function(cb){
 | 
				
			||||||
            plugins.g.sequence("defaultTsd","defaultIndexTS","defaultTestTS","defaultCleanup",cb);
 | 
					            plugins.g.sequence("defaultIndexTS","defaultTestTS","defaultCleanup",cb);
 | 
				
			||||||
        });
 | 
					        });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        plugins.gulp.start.apply(plugins.gulp, ['default']);
 | 
					        plugins.gulp.start.apply(plugins.gulp, ['default']);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -3,7 +3,7 @@ module NpmtsPaths {
 | 
				
			|||||||
    export var init = function() {
 | 
					    export var init = function() {
 | 
				
			||||||
        var paths:any = {};
 | 
					        var paths:any = {};
 | 
				
			||||||
        paths.cwd = plugins.smartcli.get.cwd().path;
 | 
					        paths.cwd = plugins.smartcli.get.cwd().path;
 | 
				
			||||||
        paths.tsd = plugins.path.join(paths.cwd,"ts/tsd.json");
 | 
					        paths.tsDir = plugins.path.join(paths.cwd,"ts/");
 | 
				
			||||||
        paths.indexTS = plugins.path.join(paths.cwd,"ts/index.ts");
 | 
					        paths.indexTS = plugins.path.join(paths.cwd,"ts/index.ts");
 | 
				
			||||||
        paths.testTS = plugins.path.join(paths.cwd,"ts/test.ts");
 | 
					        paths.testTS = plugins.path.join(paths.cwd,"ts/test.ts");
 | 
				
			||||||
        paths.testDir = plugins.path.join(paths.cwd,"test/");
 | 
					        paths.testDir = plugins.path.join(paths.cwd,"test/");
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -3,12 +3,11 @@ module NpmtsPlugins {
 | 
				
			|||||||
    export var init = function() {
 | 
					    export var init = function() {
 | 
				
			||||||
        var plugins = {
 | 
					        var plugins = {
 | 
				
			||||||
            beautylog: require("beautylog"),
 | 
					            beautylog: require("beautylog"),
 | 
				
			||||||
            fs: require("fs"),
 | 
					            fs: require("fs-extra"),
 | 
				
			||||||
            gulp: require("gulp"),
 | 
					            gulp: require("gulp"),
 | 
				
			||||||
            g: {
 | 
					            g: {
 | 
				
			||||||
                insert: require("gulp-insert"),
 | 
					                insert: require("gulp-insert"),
 | 
				
			||||||
                sequence: require("gulp-sequence"),
 | 
					                sequence: require("gulp-sequence"),
 | 
				
			||||||
                tsd: require("gulp-tsd"),
 | 
					 | 
				
			||||||
                typescript: require("gulp-typescript")
 | 
					                typescript: require("gulp-typescript")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            },
 | 
					            },
 | 
				
			||||||
@@ -16,7 +15,8 @@ module NpmtsPlugins {
 | 
				
			|||||||
            mocha: require("mocha"),
 | 
					            mocha: require("mocha"),
 | 
				
			||||||
            path: require("path"),
 | 
					            path: require("path"),
 | 
				
			||||||
            q:require("q"),
 | 
					            q:require("q"),
 | 
				
			||||||
            smartcli: require("smartcli")
 | 
					            smartcli: require("smartcli"),
 | 
				
			||||||
 | 
					            typings: require("typings")
 | 
				
			||||||
        };
 | 
					        };
 | 
				
			||||||
        return plugins;
 | 
					        return plugins;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -3,6 +3,7 @@ module NpmtsPromisechain {
 | 
				
			|||||||
    export var init = function(){
 | 
					    export var init = function(){
 | 
				
			||||||
        var promisechain;
 | 
					        var promisechain;
 | 
				
			||||||
        NpmtsOptions.run()
 | 
					        NpmtsOptions.run()
 | 
				
			||||||
 | 
					            .then(NpmtsTypings.run)
 | 
				
			||||||
            .then(NpmtsDefault.run)
 | 
					            .then(NpmtsDefault.run)
 | 
				
			||||||
            .then(NpmtsTests.run);
 | 
					            .then(NpmtsTests.run);
 | 
				
			||||||
        return promisechain;
 | 
					        return promisechain;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -2,20 +2,18 @@
 | 
				
			|||||||
module NpmtsTests {
 | 
					module NpmtsTests {
 | 
				
			||||||
    export var run = function() {
 | 
					    export var run = function() {
 | 
				
			||||||
        var done = plugins.q.defer();
 | 
					        var done = plugins.q.defer();
 | 
				
			||||||
 | 
					        plugins.fs.ensureDirSync(paths.testDir); //make sure that mocha has a directory to look for tests
 | 
				
			||||||
        plugins.beautylog.info("Now running mocha tests");
 | 
					        plugins.beautylog.info("Now running mocha tests");
 | 
				
			||||||
        // Instantiate a Mocha instance.
 | 
					        var mocha = new plugins.mocha(); // Instantiate a Mocha instance.
 | 
				
			||||||
        var mocha = new plugins.mocha();
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        var testDir = paths.testDir;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
        // Add each .js file to the mocha instance
 | 
					        // Add each .js file to the mocha instance
 | 
				
			||||||
        plugins.fs.readdirSync(testDir).filter(function(file){
 | 
					        plugins.fs.readdirSync(paths.testDir).filter(function(file){
 | 
				
			||||||
            // Only keep the .js files
 | 
					            // Only keep the .js files
 | 
				
			||||||
            return file.substr(-3) === '.js';
 | 
					            return file.substr(-3) === '.js';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        }).forEach(function(file){
 | 
					        }).forEach(function(file){
 | 
				
			||||||
            mocha.addFile(
 | 
					            mocha.addFile(
 | 
				
			||||||
                plugins.path.join(testDir, file)
 | 
					                plugins.path.join(paths.testDir, file)
 | 
				
			||||||
            );
 | 
					            );
 | 
				
			||||||
        });
 | 
					        });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										12
									
								
								ts/npmts.typings.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								ts/npmts.typings.ts
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,12 @@
 | 
				
			|||||||
 | 
					/// <reference path="./index.ts" />
 | 
				
			||||||
 | 
					module NpmtsTypings {
 | 
				
			||||||
 | 
					    export var run = function(){
 | 
				
			||||||
 | 
					        var done = plugins.q.defer();
 | 
				
			||||||
 | 
					        plugins.beautylog.log("now installing typings");
 | 
				
			||||||
 | 
					        plugins.typings.install({production: false, cwd: paths.tsDir})
 | 
				
			||||||
 | 
					            .then(function(){
 | 
				
			||||||
 | 
					                done.resolve();
 | 
				
			||||||
 | 
					            });
 | 
				
			||||||
 | 
					        return done.promise;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
							
								
								
									
										18
									
								
								ts/tsd.json
									
									
									
									
									
								
							
							
						
						
									
										18
									
								
								ts/tsd.json
									
									
									
									
									
								
							@@ -1,18 +0,0 @@
 | 
				
			|||||||
{
 | 
					 | 
				
			||||||
  "version": "v4",
 | 
					 | 
				
			||||||
  "repo": "borisyankov/DefinitelyTyped",
 | 
					 | 
				
			||||||
  "ref": "master",
 | 
					 | 
				
			||||||
  "path": "typings",
 | 
					 | 
				
			||||||
  "bundle": "typings/tsd.d.ts",
 | 
					 | 
				
			||||||
  "installed": {
 | 
					 | 
				
			||||||
    "node/node.d.ts": {
 | 
					 | 
				
			||||||
      "commit": "78d36dd49b6b55b9fdfe61776a12bf05c8b07777"
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
    "colors/colors.d.ts": {
 | 
					 | 
				
			||||||
      "commit": "09e37435ffb2c56a6f908081194a74756f24f99d"
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
    "vinyl/vinyl.d.ts": {
 | 
					 | 
				
			||||||
      "commit": "78d36dd49b6b55b9fdfe61776a12bf05c8b07777"
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
  }
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
							
								
								
									
										7
									
								
								ts/typings.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								ts/typings.json
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,7 @@
 | 
				
			|||||||
 | 
					{
 | 
				
			||||||
 | 
					  "ambientDependencies": {
 | 
				
			||||||
 | 
					    "node": "github:DefinitelyTyped/DefinitelyTyped/node/node.d.ts#78d36dd49b6b55b9fdfe61776a12bf05c8b07777",
 | 
				
			||||||
 | 
					    "colors": "github:DefinitelyTyped/DefinitelyTyped/colors/colors.d.ts#09e37435ffb2c56a6f908081194a74756f24f99d",
 | 
				
			||||||
 | 
					    "vinyl": "github:DefinitelyTyped/DefinitelyTyped/vinyl/vinyl.d.ts#78d36dd49b6b55b9fdfe61776a12bf05c8b07777"
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
							
								
								
									
										3
									
								
								ts/typings/browser.d.ts
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								ts/typings/browser.d.ts
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,3 @@
 | 
				
			|||||||
 | 
					/// <reference path="browser/ambient/colors/colors.d.ts" />
 | 
				
			||||||
 | 
					/// <reference path="browser/ambient/node/node.d.ts" />
 | 
				
			||||||
 | 
					/// <reference path="browser/ambient/vinyl/vinyl.d.ts" />
 | 
				
			||||||
@@ -1,3 +1,5 @@
 | 
				
			|||||||
 | 
					// Compiled using typings@0.6.3
 | 
				
			||||||
 | 
					// Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/09e37435ffb2c56a6f908081194a74756f24f99d/colors/colors.d.ts
 | 
				
			||||||
// Type definitions for Colors.js 0.6.0-1
 | 
					// Type definitions for Colors.js 0.6.0-1
 | 
				
			||||||
// Project: https://github.com/Marak/colors.js
 | 
					// Project: https://github.com/Marak/colors.js
 | 
				
			||||||
// Definitions by: Bart van der Schoor <https://github.com/Bartvds>
 | 
					// Definitions by: Bart van der Schoor <https://github.com/Bartvds>
 | 
				
			||||||
@@ -1,3 +1,5 @@
 | 
				
			|||||||
 | 
					// Compiled using typings@0.6.3
 | 
				
			||||||
 | 
					// Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/78d36dd49b6b55b9fdfe61776a12bf05c8b07777/node/node.d.ts
 | 
				
			||||||
// Type definitions for Node.js v4.x
 | 
					// Type definitions for Node.js v4.x
 | 
				
			||||||
// Project: http://nodejs.org/
 | 
					// Project: http://nodejs.org/
 | 
				
			||||||
// Definitions by: Microsoft TypeScript <http://typescriptlang.org>, DefinitelyTyped <https://github.com/borisyankov/DefinitelyTyped>
 | 
					// Definitions by: Microsoft TypeScript <http://typescriptlang.org>, DefinitelyTyped <https://github.com/borisyankov/DefinitelyTyped>
 | 
				
			||||||
@@ -1,9 +1,10 @@
 | 
				
			|||||||
 | 
					// Compiled using typings@0.6.3
 | 
				
			||||||
 | 
					// Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/78d36dd49b6b55b9fdfe61776a12bf05c8b07777/vinyl/vinyl.d.ts
 | 
				
			||||||
// Type definitions for vinyl 0.4.3
 | 
					// Type definitions for vinyl 0.4.3
 | 
				
			||||||
// Project: https://github.com/wearefractal/vinyl
 | 
					// Project: https://github.com/wearefractal/vinyl
 | 
				
			||||||
// Definitions by: vvakame <https://github.com/vvakame/>, jedmao <https://github.com/jedmao>
 | 
					// Definitions by: vvakame <https://github.com/vvakame/>, jedmao <https://github.com/jedmao>
 | 
				
			||||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
 | 
					// Definitions: https://github.com/borisyankov/DefinitelyTyped
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/// <reference path="../node/node.d.ts" />
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
declare module 'vinyl' {
 | 
					declare module 'vinyl' {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
							
								
								
									
										3
									
								
								ts/typings/main.d.ts
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								ts/typings/main.d.ts
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,3 @@
 | 
				
			|||||||
 | 
					/// <reference path="main/ambient/colors/colors.d.ts" />
 | 
				
			||||||
 | 
					/// <reference path="main/ambient/node/node.d.ts" />
 | 
				
			||||||
 | 
					/// <reference path="main/ambient/vinyl/vinyl.d.ts" />
 | 
				
			||||||
							
								
								
									
										125
									
								
								ts/typings/main/ambient/colors/colors.d.ts
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										125
									
								
								ts/typings/main/ambient/colors/colors.d.ts
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,125 @@
 | 
				
			|||||||
 | 
					// Compiled using typings@0.6.3
 | 
				
			||||||
 | 
					// Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/09e37435ffb2c56a6f908081194a74756f24f99d/colors/colors.d.ts
 | 
				
			||||||
 | 
					// Type definitions for Colors.js 0.6.0-1
 | 
				
			||||||
 | 
					// Project: https://github.com/Marak/colors.js
 | 
				
			||||||
 | 
					// Definitions by: Bart van der Schoor <https://github.com/Bartvds>
 | 
				
			||||||
 | 
					// Definitions: https://github.com/borisyankov/DefinitelyTyped
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					declare module "colors" {
 | 
				
			||||||
 | 
					    interface Color {
 | 
				
			||||||
 | 
					        (text: string): string;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        black: Color;
 | 
				
			||||||
 | 
					        red: Color;
 | 
				
			||||||
 | 
					        green: Color;
 | 
				
			||||||
 | 
					        yellow: Color;
 | 
				
			||||||
 | 
					        blue: Color;
 | 
				
			||||||
 | 
					        magenta: Color;
 | 
				
			||||||
 | 
					        cyan: Color;
 | 
				
			||||||
 | 
					        white: Color;
 | 
				
			||||||
 | 
					        gray: Color;
 | 
				
			||||||
 | 
					        grey: Color;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        bgBlack: Color;
 | 
				
			||||||
 | 
					        bgRed: Color;
 | 
				
			||||||
 | 
					        bgGreen: Color;
 | 
				
			||||||
 | 
					        bgYellow: Color;
 | 
				
			||||||
 | 
					        bgBlue: Color;
 | 
				
			||||||
 | 
					        bgMagenta: Color;
 | 
				
			||||||
 | 
					        bgCyan: Color;
 | 
				
			||||||
 | 
					        bgWhite: Color;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        reset: Color;
 | 
				
			||||||
 | 
					        bold: Color;
 | 
				
			||||||
 | 
					        dim: Color;
 | 
				
			||||||
 | 
					        italic: Color;
 | 
				
			||||||
 | 
					        underline: Color;
 | 
				
			||||||
 | 
					        inverse: Color;
 | 
				
			||||||
 | 
					        hidden: Color;
 | 
				
			||||||
 | 
					        strikethrough: Color;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        rainbow: Color;
 | 
				
			||||||
 | 
					        zebra: Color;
 | 
				
			||||||
 | 
					        america: Color;
 | 
				
			||||||
 | 
					        trap: Color;
 | 
				
			||||||
 | 
					        random: Color;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    module e {
 | 
				
			||||||
 | 
					        export function setTheme(theme:any): void;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        export var black: Color;
 | 
				
			||||||
 | 
					        export var red: Color;
 | 
				
			||||||
 | 
					        export var green: Color;
 | 
				
			||||||
 | 
					        export var yellow: Color;
 | 
				
			||||||
 | 
					        export var blue: Color;
 | 
				
			||||||
 | 
					        export var magenta: Color;
 | 
				
			||||||
 | 
					        export var cyan: Color;
 | 
				
			||||||
 | 
					        export var white: Color;
 | 
				
			||||||
 | 
					        export var gray: Color;
 | 
				
			||||||
 | 
					        export var grey: Color;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        export var bgBlack: Color;
 | 
				
			||||||
 | 
					        export var bgRed: Color;
 | 
				
			||||||
 | 
					        export var bgGreen: Color;
 | 
				
			||||||
 | 
					        export var bgYellow: Color;
 | 
				
			||||||
 | 
					        export var bgBlue: Color;
 | 
				
			||||||
 | 
					        export var bgMagenta: Color;
 | 
				
			||||||
 | 
					        export var bgCyan: Color;
 | 
				
			||||||
 | 
					        export var bgWhite: Color;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        export var reset: Color;
 | 
				
			||||||
 | 
					        export var bold: Color;
 | 
				
			||||||
 | 
					        export var dim: Color;
 | 
				
			||||||
 | 
					        export var italic: Color;
 | 
				
			||||||
 | 
					        export var underline: Color;
 | 
				
			||||||
 | 
					        export var inverse: Color;
 | 
				
			||||||
 | 
					        export var hidden: Color;
 | 
				
			||||||
 | 
					        export var strikethrough: Color;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        export var rainbow: Color;
 | 
				
			||||||
 | 
					        export var zebra: Color;
 | 
				
			||||||
 | 
					        export var america: Color;
 | 
				
			||||||
 | 
					        export var trap: Color;
 | 
				
			||||||
 | 
					        export var random: Color;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    export = e;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					interface String {
 | 
				
			||||||
 | 
					    black: string;
 | 
				
			||||||
 | 
					    red: string;
 | 
				
			||||||
 | 
					    green: string;
 | 
				
			||||||
 | 
					    yellow: string;
 | 
				
			||||||
 | 
					    blue: string;
 | 
				
			||||||
 | 
					    magenta: string;
 | 
				
			||||||
 | 
					    cyan: string;
 | 
				
			||||||
 | 
					    white: string;
 | 
				
			||||||
 | 
					    gray: string;
 | 
				
			||||||
 | 
					    grey: string;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    bgBlack: string;
 | 
				
			||||||
 | 
					    bgRed: string;
 | 
				
			||||||
 | 
					    bgGreen: string;
 | 
				
			||||||
 | 
					    bgYellow: string;
 | 
				
			||||||
 | 
					    bgBlue: string;
 | 
				
			||||||
 | 
					    bgMagenta: string;
 | 
				
			||||||
 | 
					    bgCyan: string;
 | 
				
			||||||
 | 
					    bgWhite: string;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    reset: string;
 | 
				
			||||||
 | 
					    bold: string;
 | 
				
			||||||
 | 
					    dim: string;
 | 
				
			||||||
 | 
					    italic: string;
 | 
				
			||||||
 | 
					    underline: string;
 | 
				
			||||||
 | 
					    inverse: string;
 | 
				
			||||||
 | 
					    hidden: string;
 | 
				
			||||||
 | 
					    strikethrough: string;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    rainbow: string;
 | 
				
			||||||
 | 
					    zebra: string;
 | 
				
			||||||
 | 
					    america: string;
 | 
				
			||||||
 | 
					    trap: string;
 | 
				
			||||||
 | 
					    random: string;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
							
								
								
									
										2092
									
								
								ts/typings/main/ambient/node/node.d.ts
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										2092
									
								
								ts/typings/main/ambient/node/node.d.ts
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										110
									
								
								ts/typings/main/ambient/vinyl/vinyl.d.ts
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										110
									
								
								ts/typings/main/ambient/vinyl/vinyl.d.ts
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,110 @@
 | 
				
			|||||||
 | 
					// Compiled using typings@0.6.3
 | 
				
			||||||
 | 
					// Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/78d36dd49b6b55b9fdfe61776a12bf05c8b07777/vinyl/vinyl.d.ts
 | 
				
			||||||
 | 
					// Type definitions for vinyl 0.4.3
 | 
				
			||||||
 | 
					// Project: https://github.com/wearefractal/vinyl
 | 
				
			||||||
 | 
					// Definitions by: vvakame <https://github.com/vvakame/>, jedmao <https://github.com/jedmao>
 | 
				
			||||||
 | 
					// Definitions: https://github.com/borisyankov/DefinitelyTyped
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					declare module 'vinyl' {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						import fs = require('fs');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						/**
 | 
				
			||||||
 | 
						* A virtual file format.
 | 
				
			||||||
 | 
						*/
 | 
				
			||||||
 | 
						class File {
 | 
				
			||||||
 | 
							constructor(options?: {
 | 
				
			||||||
 | 
								/**
 | 
				
			||||||
 | 
								* Default: process.cwd()
 | 
				
			||||||
 | 
								*/
 | 
				
			||||||
 | 
								cwd?: string;
 | 
				
			||||||
 | 
								/**
 | 
				
			||||||
 | 
								* Used for relative pathing. Typically where a glob starts.
 | 
				
			||||||
 | 
								*/
 | 
				
			||||||
 | 
								base?: string;
 | 
				
			||||||
 | 
								/**
 | 
				
			||||||
 | 
								* Full path to the file.
 | 
				
			||||||
 | 
								*/
 | 
				
			||||||
 | 
								path?: string;
 | 
				
			||||||
 | 
								/**
 | 
				
			||||||
 | 
								* Path history. Has no effect if options.path is passed.
 | 
				
			||||||
 | 
								*/
 | 
				
			||||||
 | 
								history?: string[];
 | 
				
			||||||
 | 
								/**
 | 
				
			||||||
 | 
								* The result of an fs.stat call. See fs.Stats for more information.
 | 
				
			||||||
 | 
								*/
 | 
				
			||||||
 | 
								stat?: fs.Stats;
 | 
				
			||||||
 | 
								/**
 | 
				
			||||||
 | 
								* File contents.
 | 
				
			||||||
 | 
								* Type: Buffer, Stream, or null
 | 
				
			||||||
 | 
								*/
 | 
				
			||||||
 | 
								contents?: Buffer | NodeJS.ReadWriteStream;
 | 
				
			||||||
 | 
							});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							/**
 | 
				
			||||||
 | 
							* Default: process.cwd()
 | 
				
			||||||
 | 
							*/
 | 
				
			||||||
 | 
							public cwd: string;
 | 
				
			||||||
 | 
							/**
 | 
				
			||||||
 | 
							* Used for relative pathing. Typically where a glob starts.
 | 
				
			||||||
 | 
							*/
 | 
				
			||||||
 | 
							public base: string;
 | 
				
			||||||
 | 
							/**
 | 
				
			||||||
 | 
							* Full path to the file.
 | 
				
			||||||
 | 
							*/
 | 
				
			||||||
 | 
							public path: string;
 | 
				
			||||||
 | 
							public stat: fs.Stats;
 | 
				
			||||||
 | 
							/**
 | 
				
			||||||
 | 
							* Type: Buffer|Stream|null (Default: null)
 | 
				
			||||||
 | 
							*/
 | 
				
			||||||
 | 
							public contents: Buffer | NodeJS.ReadableStream;
 | 
				
			||||||
 | 
							/**
 | 
				
			||||||
 | 
							* Returns path.relative for the file base and file path.
 | 
				
			||||||
 | 
							* Example:
 | 
				
			||||||
 | 
							*  var file = new File({
 | 
				
			||||||
 | 
							*    cwd: "/",
 | 
				
			||||||
 | 
							*    base: "/test/",
 | 
				
			||||||
 | 
							*    path: "/test/file.js"
 | 
				
			||||||
 | 
							*  });
 | 
				
			||||||
 | 
							*  console.log(file.relative); // file.js
 | 
				
			||||||
 | 
							*/
 | 
				
			||||||
 | 
							public relative: string;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							public isBuffer(): boolean;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							public isStream(): boolean;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							public isNull(): boolean;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							public isDirectory(): boolean;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							/**
 | 
				
			||||||
 | 
							* Returns a new File object with all attributes cloned. Custom attributes are deep-cloned.
 | 
				
			||||||
 | 
							*/
 | 
				
			||||||
 | 
							public clone(opts?: { contents?: boolean }): File;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							/**
 | 
				
			||||||
 | 
							* If file.contents is a Buffer, it will write it to the stream.
 | 
				
			||||||
 | 
							* If file.contents is a Stream, it will pipe it to the stream.
 | 
				
			||||||
 | 
							* If file.contents is null, it will do nothing.
 | 
				
			||||||
 | 
							*/
 | 
				
			||||||
 | 
							public pipe<T extends NodeJS.ReadWriteStream>(
 | 
				
			||||||
 | 
								stream: T,
 | 
				
			||||||
 | 
								opts?: {
 | 
				
			||||||
 | 
									/**
 | 
				
			||||||
 | 
									* If false, the destination stream will not be ended (same as node core).
 | 
				
			||||||
 | 
									*/
 | 
				
			||||||
 | 
									end?: boolean;
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							): T;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							/**
 | 
				
			||||||
 | 
							* Returns a pretty String interpretation of the File. Useful for console.log.
 | 
				
			||||||
 | 
							*/
 | 
				
			||||||
 | 
							public inspect(): string;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						export = File;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
							
								
								
									
										3
									
								
								ts/typings/tsd.d.ts
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										3
									
								
								ts/typings/tsd.d.ts
									
									
									
									
										vendored
									
									
								
							@@ -1,3 +0,0 @@
 | 
				
			|||||||
/// <reference path="node/node.d.ts" />
 | 
					 | 
				
			||||||
/// <reference path="colors/colors.d.ts" />
 | 
					 | 
				
			||||||
/// <reference path="vinyl/vinyl.d.ts" />
 | 
					 | 
				
			||||||
		Reference in New Issue
	
	Block a user