ready for primetime
This commit is contained in:
2
dist/cli.js
vendored
Normal file
2
dist/cli.js
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
#!/usr/bin/env node
|
||||
var index = require("./index.js");
|
26
dist/npmts.compile.js
vendored
26
dist/npmts.compile.js
vendored
@ -3,6 +3,7 @@ require("typings-global");
|
||||
var plugins = require("./npmts.plugins");
|
||||
var helpers = require("./npmts.compile.helpers");
|
||||
var npmts_promisechain_1 = require("./npmts.promisechain");
|
||||
var promiseArray = [];
|
||||
var compileTs = function (tsFileArrayArg, tsOptionsArg) {
|
||||
if (tsOptionsArg === void 0) { tsOptionsArg = {}; }
|
||||
var done = plugins.Q.defer();
|
||||
@ -17,12 +18,25 @@ var compileTs = function (tsFileArrayArg, tsOptionsArg) {
|
||||
var tsOptions = function (keyArg) {
|
||||
return plugins.lodashObject.assign(tsOptionsDefault, tsOptionsArg);
|
||||
};
|
||||
for (var keyArg in tsFileArrayArg) {
|
||||
var _loop_1 = function(keyArg) {
|
||||
plugins.beautylog.info("TypeScript assignment: transpile from " + keyArg.blue + " to " + tsFileArrayArg[keyArg].blue);
|
||||
if (helpers.checkOutputPath(tsFileArrayArg, keyArg)) {
|
||||
var filesToConvert = plugins.smartfile.fs.listFileTree(plugins.path.resolve(keyArg), "**/*.ts");
|
||||
plugins.tsn.compile(filesToConvert, tsFileArrayArg[keyArg]);
|
||||
var filesReadPromise = plugins.smartfile.fs.listFileTree(process.cwd(), keyArg)
|
||||
.then(function (filesToConvertArg) {
|
||||
var filesToConvertAbsolute = plugins.smartpath.transform.toAbsolute(filesToConvertArg, process.cwd());
|
||||
var destDir = plugins.smartpath.transform.toAbsolute(tsFileArrayArg[keyArg], process.cwd());
|
||||
var filesCompiledPromise = plugins.tsn.compile(filesToConvertAbsolute, destDir);
|
||||
promiseArray.push(filesCompiledPromise);
|
||||
});
|
||||
promiseArray.push(filesReadPromise);
|
||||
}
|
||||
};
|
||||
for (var keyArg in tsFileArrayArg) {
|
||||
_loop_1(keyArg);
|
||||
}
|
||||
;
|
||||
plugins.Q.all(promiseArray)
|
||||
.then(done.resolve);
|
||||
return done.promise;
|
||||
};
|
||||
exports.run = function (configArg) {
|
||||
@ -31,10 +45,12 @@ exports.run = function (configArg) {
|
||||
npmts_promisechain_1.npmtsOra.text("now compiling " + "TypeScript".yellow);
|
||||
compileTs(config.ts, config.tsOptions)
|
||||
.then(function () {
|
||||
compileTs(config.testTs);
|
||||
plugins.beautylog.ok("compiled main TypeScript!");
|
||||
plugins.beautylog.log("now compiling tests!");
|
||||
return compileTs(config.testTs);
|
||||
})
|
||||
.then(function () {
|
||||
plugins.beautylog.ok("compiled TypeScript!");
|
||||
plugins.beautylog.ok("compiled all TypeScript!");
|
||||
done.resolve(config);
|
||||
});
|
||||
return done.promise;
|
||||
|
Reference in New Issue
Block a user