update options
This commit is contained in:
2
dist/cli.js
vendored
2
dist/cli.js
vendored
@ -1,2 +0,0 @@
|
||||
#!/usr/bin/env node
|
||||
var index = require("./index.js");
|
4
dist/npmts.configfile.d.ts
vendored
4
dist/npmts.configfile.d.ts
vendored
@ -1,4 +0,0 @@
|
||||
/// <reference types="q" />
|
||||
import "typings-global";
|
||||
import plugins = require("./npmts.plugins");
|
||||
export declare var run: (argvArg: any) => plugins.Q.Promise<{}>;
|
40
dist/npmts.configfile.js
vendored
40
dist/npmts.configfile.js
vendored
@ -1,40 +0,0 @@
|
||||
"use strict";
|
||||
require("typings-global");
|
||||
var plugins = require("./npmts.plugins");
|
||||
var paths = require("./npmts.paths");
|
||||
var npmts_promisechain_1 = require("./npmts.promisechain");
|
||||
exports.run = function (argvArg) {
|
||||
var done = plugins.Q.defer();
|
||||
npmts_promisechain_1.npmtsOra.text("looking for npmextra.json");
|
||||
var defaultConfig = {
|
||||
mode: "default",
|
||||
notest: false,
|
||||
nodocs: false
|
||||
};
|
||||
if (argvArg.notest) {
|
||||
defaultConfig.notest = true;
|
||||
}
|
||||
;
|
||||
if (argvArg.nodocs) {
|
||||
defaultConfig.nodocs = true;
|
||||
}
|
||||
;
|
||||
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;
|
||||
};
|
13
dist/npmts.options.d.ts
vendored
13
dist/npmts.options.d.ts
vendored
@ -1,4 +1,15 @@
|
||||
/// <reference types="q" />
|
||||
import "typings-global";
|
||||
import plugins = require("./npmts.plugins");
|
||||
export declare var run: (configArg: any) => plugins.Q.Promise<{}>;
|
||||
export declare type npmtsMode = "default" | "custom";
|
||||
export interface npmtsConfig {
|
||||
argv: any;
|
||||
coverageTreshold: number;
|
||||
docs: boolean;
|
||||
mode: npmtsMode;
|
||||
test: boolean;
|
||||
testTs: any;
|
||||
ts: any;
|
||||
tsOptions: any;
|
||||
}
|
||||
export declare var run: (argvArg: any) => plugins.Q.Promise<{}>;
|
||||
|
54
dist/npmts.options.js
vendored
54
dist/npmts.options.js
vendored
@ -1,16 +1,42 @@
|
||||
"use strict";
|
||||
require("typings-global");
|
||||
var plugins = require("./npmts.plugins");
|
||||
var paths = require("./npmts.paths");
|
||||
var npmts_promisechain_1 = require("./npmts.promisechain");
|
||||
exports.run = function (configArg) {
|
||||
;
|
||||
exports.run = function (argvArg) {
|
||||
var done = plugins.Q.defer();
|
||||
var config = configArg;
|
||||
npmts_promisechain_1.npmtsOra.text("now determining build options...");
|
||||
var defaultConfig = {
|
||||
argv: undefined,
|
||||
coverageTreshold: 70,
|
||||
docs: true,
|
||||
mode: "default",
|
||||
test: true,
|
||||
testTs: {},
|
||||
ts: {},
|
||||
tsOptions: {}
|
||||
};
|
||||
// mix with configfile
|
||||
npmts_promisechain_1.npmtsOra.text("looking for npmextra.json");
|
||||
var config = plugins.npmextra.dataFor({
|
||||
toolName: "npmts",
|
||||
defaultSettings: defaultConfig,
|
||||
cwd: paths.cwd
|
||||
});
|
||||
// check mode
|
||||
switch (config.mode) {
|
||||
case "default":
|
||||
case "custom":
|
||||
plugins.beautylog.ok("mode is " + config.mode);
|
||||
done.resolve(config);
|
||||
break;
|
||||
default:
|
||||
plugins.beautylog.error("mode " + config.mode + " not recognised!".red);
|
||||
process.exit(1);
|
||||
}
|
||||
;
|
||||
//handle default mode
|
||||
if (config.mode == "default") {
|
||||
config.typings = [
|
||||
"./ts/typings.json"
|
||||
];
|
||||
config.ts = (_a = {},
|
||||
_a["./ts/**/*.ts"] = "./dist/",
|
||||
_a
|
||||
@ -19,13 +45,17 @@ exports.run = function (configArg) {
|
||||
_b["./test/test.ts"] = "./test/",
|
||||
_b
|
||||
);
|
||||
config.test = ["./index.js"];
|
||||
}
|
||||
//check if config.tsOptions is available
|
||||
config.tsOptions ? void (0) : config.tsOptions = {};
|
||||
config.coverageTreshold ? void (0) : config.coverageTreshold = 70;
|
||||
// handle docs
|
||||
config.docs ? void (0) : config.docs = {};
|
||||
;
|
||||
// mix with commandline
|
||||
if (config.argv.notest) {
|
||||
config.test = false;
|
||||
}
|
||||
;
|
||||
if (config.argv.nodocs) {
|
||||
config.docs = false;
|
||||
}
|
||||
;
|
||||
plugins.beautylog.ok("build options are ready!");
|
||||
done.resolve(config);
|
||||
return done.promise;
|
||||
|
4
dist/npmts.promisechain.js
vendored
4
dist/npmts.promisechain.js
vendored
@ -6,15 +6,13 @@ var NpmtsAssets = require("./npmts.assets");
|
||||
var NpmtsCheck = require("./npmts.check");
|
||||
var NpmtsClean = require("./npmts.clean");
|
||||
var NpmtsCompile = require("./npmts.compile");
|
||||
var NpmtsConfigFile = require("./npmts.configfile");
|
||||
var NpmtsTypeDoc = require("./npmts.typedoc");
|
||||
var NpmtsOptions = require("./npmts.options");
|
||||
var NpmtsTests = require("./npmts.tests");
|
||||
exports.promisechain = function (argvArg) {
|
||||
var done = plugins.Q.defer();
|
||||
exports.npmtsOra.start();
|
||||
NpmtsConfigFile.run(argvArg)
|
||||
.then(NpmtsOptions.run)
|
||||
NpmtsOptions.run(argvArg)
|
||||
.then(NpmtsClean.run)
|
||||
.then(NpmtsCheck.run)
|
||||
.then(NpmtsCompile.run)
|
||||
|
2
dist/npmts.tests.js
vendored
2
dist/npmts.tests.js
vendored
@ -60,7 +60,7 @@ var coverage = function (configArg) {
|
||||
exports.run = function (configArg) {
|
||||
var done = plugins.Q.defer();
|
||||
var config = configArg;
|
||||
if (config.notest != true) {
|
||||
if (config.test === true) {
|
||||
npmts_promisechain_1.npmtsOra.text("now starting tests");
|
||||
plugins.beautylog.log("-------------------------------------------------------\n" +
|
||||
"*************************** TESTS: ***************************\n" +
|
||||
|
8
dist/npmts.typedoc.js
vendored
8
dist/npmts.typedoc.js
vendored
@ -27,15 +27,15 @@ var genTypeDoc = function (configArg) {
|
||||
};
|
||||
exports.run = function (configArg) {
|
||||
var done = plugins.Q.defer();
|
||||
if (configArg.nodocs) {
|
||||
done.resolve(configArg);
|
||||
}
|
||||
else {
|
||||
if (configArg.docs) {
|
||||
genTypeDoc(configArg)
|
||||
.then(function () {
|
||||
done.resolve(configArg);
|
||||
});
|
||||
}
|
||||
else {
|
||||
done.resolve(configArg);
|
||||
}
|
||||
;
|
||||
return done.promise;
|
||||
};
|
||||
|
Reference in New Issue
Block a user