now using npmextra
This commit is contained in:
		
							
								
								
									
										47
									
								
								dist/npmts.configfile.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										47
									
								
								dist/npmts.configfile.js
									
									
									
									
										vendored
									
									
								
							@@ -2,33 +2,34 @@
 | 
				
			|||||||
require("typings-global");
 | 
					require("typings-global");
 | 
				
			||||||
var plugins = require("./npmts.plugins");
 | 
					var plugins = require("./npmts.plugins");
 | 
				
			||||||
var paths = require("./npmts.paths");
 | 
					var paths = require("./npmts.paths");
 | 
				
			||||||
 | 
					var npmts_promisechain_1 = require("./npmts.promisechain");
 | 
				
			||||||
exports.run = function (argvArg) {
 | 
					exports.run = function (argvArg) {
 | 
				
			||||||
    var done = plugins.Q.defer();
 | 
					    var done = plugins.Q.defer();
 | 
				
			||||||
    var config = {};
 | 
					    npmts_promisechain_1.npmtsOra.text("looking for npmextra.json");
 | 
				
			||||||
    var configPath = plugins.path.join(paths.cwd, "npmts.json");
 | 
					    var defaultConfig = {
 | 
				
			||||||
 | 
					        mode: "default",
 | 
				
			||||||
 | 
					        notest: false
 | 
				
			||||||
 | 
					    };
 | 
				
			||||||
    if (argvArg.notest) {
 | 
					    if (argvArg.notest) {
 | 
				
			||||||
        config.notest = true;
 | 
					        defaultConfig.notest = true;
 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    if (plugins.smartfile.fs.fileExistsSync(configPath)) {
 | 
					 | 
				
			||||||
        plugins.beautylog.info("npmts.json".blue + " config file found!");
 | 
					 | 
				
			||||||
        config = plugins.lodashObject.assign(config, plugins.smartfile.fs.toObjectSync(configPath));
 | 
					 | 
				
			||||||
        switch (config.mode) {
 | 
					 | 
				
			||||||
            case "default":
 | 
					 | 
				
			||||||
            case "custom":
 | 
					 | 
				
			||||||
                plugins.beautylog.ok("mode is " + config.mode.yellow);
 | 
					 | 
				
			||||||
                done.resolve(config);
 | 
					 | 
				
			||||||
                break;
 | 
					 | 
				
			||||||
            default:
 | 
					 | 
				
			||||||
                plugins.beautylog.error("mode " + config.mode.yellow + " not recognised!".red);
 | 
					 | 
				
			||||||
                process.exit(1);
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        ;
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    else {
 | 
					 | 
				
			||||||
        plugins.beautylog.log("no config file found: so mode is " + "default".yellow);
 | 
					 | 
				
			||||||
        config.mode = "default";
 | 
					 | 
				
			||||||
        done.resolve(config);
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    ;
 | 
					    ;
 | 
				
			||||||
 | 
					    var config = plugins.npmextra.dataFor({
 | 
				
			||||||
 | 
					        toolName: "npmts",
 | 
				
			||||||
 | 
					        defaultSettings: defaultConfig,
 | 
				
			||||||
 | 
					        cwd: paths.cwd
 | 
				
			||||||
 | 
					    });
 | 
				
			||||||
 | 
					    switch (config.mode) {
 | 
				
			||||||
 | 
					        case "default":
 | 
				
			||||||
 | 
					        case "custom":
 | 
				
			||||||
 | 
					            plugins.beautylog.ok("mode is " + config.mode.yellow);
 | 
				
			||||||
 | 
					            done.resolve(config);
 | 
				
			||||||
 | 
					            break;
 | 
				
			||||||
 | 
					        default:
 | 
				
			||||||
 | 
					            plugins.beautylog.error("mode " + config.mode.yellow + " not recognised!".red);
 | 
				
			||||||
 | 
					            process.exit(1);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    ;
 | 
				
			||||||
 | 
					    done.resolve(config);
 | 
				
			||||||
    return done.promise;
 | 
					    return done.promise;
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										1
									
								
								dist/npmts.plugins.d.ts
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								dist/npmts.plugins.d.ts
									
									
									
									
										vendored
									
									
								
							@@ -12,6 +12,7 @@ export declare let g: {
 | 
				
			|||||||
    typedoc: any;
 | 
					    typedoc: any;
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
export declare let lodashObject: any;
 | 
					export declare let lodashObject: any;
 | 
				
			||||||
 | 
					export import npmextra = require("npmextra");
 | 
				
			||||||
export import projectinfo = require("projectinfo");
 | 
					export import projectinfo = require("projectinfo");
 | 
				
			||||||
export import path = require("path");
 | 
					export import path = require("path");
 | 
				
			||||||
export import Q = require("q");
 | 
					export import Q = require("q");
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										1
									
								
								dist/npmts.plugins.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								dist/npmts.plugins.js
									
									
									
									
										vendored
									
									
								
							@@ -13,6 +13,7 @@ exports.g = {
 | 
				
			|||||||
    typedoc: require("gulp-typedoc")
 | 
					    typedoc: require("gulp-typedoc")
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
exports.lodashObject = require('lodash/fp/object');
 | 
					exports.lodashObject = require('lodash/fp/object');
 | 
				
			||||||
 | 
					exports.npmextra = require("npmextra");
 | 
				
			||||||
exports.projectinfo = require("projectinfo");
 | 
					exports.projectinfo = require("projectinfo");
 | 
				
			||||||
exports.path = require("path");
 | 
					exports.path = require("path");
 | 
				
			||||||
exports.Q = require("q");
 | 
					exports.Q = require("q");
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -29,9 +29,9 @@
 | 
				
			|||||||
  },
 | 
					  },
 | 
				
			||||||
  "homepage": "https://gitlab.com/pushrocks/npmts#readme",
 | 
					  "homepage": "https://gitlab.com/pushrocks/npmts#readme",
 | 
				
			||||||
  "dependencies": {
 | 
					  "dependencies": {
 | 
				
			||||||
    "@types/minimatch": "*",
 | 
					    "@types/minimatch": "^2.0.28",
 | 
				
			||||||
    "@types/q": "*",
 | 
					    "@types/q": "^0.0.27",
 | 
				
			||||||
    "@types/shelljs": "*",
 | 
					    "@types/shelljs": "^0.3.27",
 | 
				
			||||||
    "babel-preset-es2015": "^6.9.0",
 | 
					    "babel-preset-es2015": "^6.9.0",
 | 
				
			||||||
    "beautylog": "5.0.14",
 | 
					    "beautylog": "5.0.14",
 | 
				
			||||||
    "early": "^2.0.13",
 | 
					    "early": "^2.0.13",
 | 
				
			||||||
@@ -47,6 +47,7 @@
 | 
				
			|||||||
    "gulp-sourcemaps": "^1.6.0",
 | 
					    "gulp-sourcemaps": "^1.6.0",
 | 
				
			||||||
    "gulp-typedoc": "^2.0.0",
 | 
					    "gulp-typedoc": "^2.0.0",
 | 
				
			||||||
    "lodash": "^4.13.1",
 | 
					    "lodash": "^4.13.1",
 | 
				
			||||||
 | 
					    "npmextra": "^1.0.7",
 | 
				
			||||||
    "projectinfo": "1.0.3",
 | 
					    "projectinfo": "1.0.3",
 | 
				
			||||||
    "q": "^1.4.1",
 | 
					    "q": "^1.4.1",
 | 
				
			||||||
    "shelljs": "^0.7.0",
 | 
					    "shelljs": "^0.7.0",
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,33 +1,32 @@
 | 
				
			|||||||
import "typings-global";
 | 
					import "typings-global";
 | 
				
			||||||
import plugins = require("./npmts.plugins");
 | 
					import plugins = require("./npmts.plugins");
 | 
				
			||||||
import paths = require("./npmts.paths");
 | 
					import paths = require("./npmts.paths");
 | 
				
			||||||
 | 
					import {npmtsOra} from "./npmts.promisechain";
 | 
				
			||||||
export var run = function(argvArg){
 | 
					export var run = function(argvArg){
 | 
				
			||||||
    var done = plugins.Q.defer();
 | 
					    let done = plugins.Q.defer();
 | 
				
			||||||
    var config:any = {};
 | 
					    npmtsOra.text("looking for npmextra.json");
 | 
				
			||||||
    var configPath = plugins.path.join(paths.cwd,"npmts.json");
 | 
					    let defaultConfig = {
 | 
				
			||||||
    if(argvArg.notest){
 | 
					        mode: "default",
 | 
				
			||||||
        config.notest = true;
 | 
					        notest:false
 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    if(plugins.smartfile.fs.fileExistsSync(configPath)){
 | 
					 | 
				
			||||||
        plugins.beautylog.info("npmts.json".blue + " config file found!");
 | 
					 | 
				
			||||||
        config = plugins.lodashObject.assign(
 | 
					 | 
				
			||||||
            config,
 | 
					 | 
				
			||||||
            plugins.smartfile.fs.toObjectSync(configPath)
 | 
					 | 
				
			||||||
        );
 | 
					 | 
				
			||||||
        switch (config.mode){
 | 
					 | 
				
			||||||
            case "default":
 | 
					 | 
				
			||||||
            case "custom":
 | 
					 | 
				
			||||||
                plugins.beautylog.ok("mode is " + config.mode.yellow);
 | 
					 | 
				
			||||||
                done.resolve(config);
 | 
					 | 
				
			||||||
                break;
 | 
					 | 
				
			||||||
            default:
 | 
					 | 
				
			||||||
                plugins.beautylog.error("mode " + config.mode.yellow + " not recognised!".red);
 | 
					 | 
				
			||||||
                process.exit(1);
 | 
					 | 
				
			||||||
        };
 | 
					 | 
				
			||||||
    } else {
 | 
					 | 
				
			||||||
        plugins.beautylog.log("no config file found: so mode is " + "default".yellow);
 | 
					 | 
				
			||||||
        config.mode = "default";
 | 
					 | 
				
			||||||
        done.resolve(config);
 | 
					 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
 | 
					    if(argvArg.notest){
 | 
				
			||||||
 | 
					        defaultConfig.notest = true;
 | 
				
			||||||
 | 
					    };
 | 
				
			||||||
 | 
					    let config = plugins.npmextra.dataFor({
 | 
				
			||||||
 | 
					        toolName:"npmts",
 | 
				
			||||||
 | 
					        defaultSettings:defaultConfig,
 | 
				
			||||||
 | 
					        cwd:paths.cwd
 | 
				
			||||||
 | 
					    });
 | 
				
			||||||
 | 
					    switch (config.mode){
 | 
				
			||||||
 | 
					        case "default":
 | 
				
			||||||
 | 
					        case "custom":
 | 
				
			||||||
 | 
					            plugins.beautylog.ok("mode is " + config.mode.yellow);
 | 
				
			||||||
 | 
					            done.resolve(config);
 | 
				
			||||||
 | 
					            break;
 | 
				
			||||||
 | 
					        default:
 | 
				
			||||||
 | 
					            plugins.beautylog.error("mode " + config.mode.yellow + " not recognised!".red);
 | 
				
			||||||
 | 
					            process.exit(1);
 | 
				
			||||||
 | 
					    };
 | 
				
			||||||
 | 
					    done.resolve(config);
 | 
				
			||||||
    return done.promise;
 | 
					    return done.promise;
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
@@ -12,6 +12,7 @@ export let g = {
 | 
				
			|||||||
    typedoc: require("gulp-typedoc")
 | 
					    typedoc: require("gulp-typedoc")
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
export let lodashObject = require('lodash/fp/object');
 | 
					export let lodashObject = require('lodash/fp/object');
 | 
				
			||||||
 | 
					export import npmextra = require("npmextra");
 | 
				
			||||||
export import projectinfo = require("projectinfo");
 | 
					export import projectinfo = require("projectinfo");
 | 
				
			||||||
export import path = require("path");
 | 
					export import path = require("path");
 | 
				
			||||||
export import Q = require("q");
 | 
					export import Q = require("q");
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user