upgrade to newest tsn
This commit is contained in:
parent
9542140b93
commit
1d431792a5
4
dist/npmts.check.js
vendored
4
dist/npmts.check.js
vendored
@ -30,7 +30,7 @@ var depcheckOptions = {
|
|||||||
};
|
};
|
||||||
var checkDependencies = function (configArg) {
|
var checkDependencies = function (configArg) {
|
||||||
var done = plugins.Q.defer();
|
var done = plugins.Q.defer();
|
||||||
var depcheckOptionsMerged = plugins.lodashObject.merge(depcheckOptions, {
|
var depcheckOptionsMerged = plugins.lodash.merge(depcheckOptions, {
|
||||||
ignoreDirs: [
|
ignoreDirs: [
|
||||||
'test',
|
'test',
|
||||||
'dist',
|
'dist',
|
||||||
@ -72,7 +72,7 @@ var checkDependencies = function (configArg) {
|
|||||||
};
|
};
|
||||||
var checkDevDependencies = function (configArg) {
|
var checkDevDependencies = function (configArg) {
|
||||||
var done = plugins.Q.defer();
|
var done = plugins.Q.defer();
|
||||||
var depcheckOptionsMerged = plugins.lodashObject.merge(depcheckOptions, {
|
var depcheckOptionsMerged = plugins.lodash.merge(depcheckOptions, {
|
||||||
ignoreDirs: [
|
ignoreDirs: [
|
||||||
'ts',
|
'ts',
|
||||||
'dist',
|
'dist',
|
||||||
|
1
dist/npmts.compile.helpers.d.ts
vendored
1
dist/npmts.compile.helpers.d.ts
vendored
@ -1 +0,0 @@
|
|||||||
export declare let checkOutputPath: (tsArrayArg: any, keyArg: any) => boolean;
|
|
16
dist/npmts.compile.helpers.js
vendored
16
dist/npmts.compile.helpers.js
vendored
@ -1,16 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
var plugins = require("./npmts.plugins");
|
|
||||||
var paths = require("./npmts.paths");
|
|
||||||
var outputPathIsDir = function (tsArrayArg, keyArg) {
|
|
||||||
return plugins.smartpath.check.isDir(plugins.path.join(paths.cwd, tsArrayArg[keyArg]));
|
|
||||||
};
|
|
||||||
exports.checkOutputPath = function (tsArrayArg, keyArg) {
|
|
||||||
if (!outputPathIsDir(tsArrayArg, keyArg)) {
|
|
||||||
plugins.beautylog.warn('Skipping ' + keyArg + ' because ' + tsArrayArg[keyArg] + ' it is no directory!');
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
;
|
|
||||||
};
|
|
47
dist/npmts.compile.js
vendored
47
dist/npmts.compile.js
vendored
@ -1,58 +1,17 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
require("typings-global");
|
require("typings-global");
|
||||||
var plugins = require("./npmts.plugins");
|
var plugins = require("./npmts.plugins");
|
||||||
var helpers = require("./npmts.compile.helpers");
|
var paths = require("./npmts.paths");
|
||||||
var npmts_promisechain_1 = require("./npmts.promisechain");
|
var npmts_promisechain_1 = require("./npmts.promisechain");
|
||||||
var promiseArray = [];
|
|
||||||
var compileTs = function (tsFileArrayArg, tsOptionsArg) {
|
|
||||||
if (tsOptionsArg === void 0) { tsOptionsArg = {}; }
|
|
||||||
var done = plugins.Q.defer();
|
|
||||||
var compilerOptionsDefault = {
|
|
||||||
declaration: true,
|
|
||||||
module: 'CommonJS',
|
|
||||||
target: 'ES6'
|
|
||||||
};
|
|
||||||
/**
|
|
||||||
* merges default ts options with those found in npmts.json
|
|
||||||
*/
|
|
||||||
var compilerOptions = function (keyArg) {
|
|
||||||
var tsOptionsCombined = plugins.lodashObject.merge(compilerOptionsDefault, tsOptionsArg);
|
|
||||||
var compilerOptions = {
|
|
||||||
declaration: tsOptionsCombined.declaration,
|
|
||||||
module: plugins.tsn.ModuleKind[tsOptionsCombined.module],
|
|
||||||
target: plugins.tsn.ScriptTarget[tsOptionsCombined.target],
|
|
||||||
exclude: 'node_modules/**/*'
|
|
||||||
};
|
|
||||||
return compilerOptions;
|
|
||||||
};
|
|
||||||
var _loop_1 = function (keyArg) {
|
|
||||||
plugins.beautylog.info("TypeScript assignment: transpile from " + keyArg.blue + " to " + tsFileArrayArg[keyArg].blue);
|
|
||||||
if (helpers.checkOutputPath(tsFileArrayArg, keyArg)) {
|
|
||||||
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());
|
|
||||||
return plugins.tsn.compile(filesToConvertAbsolute, destDir, compilerOptions(keyArg));
|
|
||||||
})
|
|
||||||
.then(function () {
|
|
||||||
done.resolve();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
|
||||||
for (var keyArg in tsFileArrayArg) {
|
|
||||||
_loop_1(keyArg);
|
|
||||||
}
|
|
||||||
return done.promise;
|
|
||||||
};
|
|
||||||
exports.run = function (configArg) {
|
exports.run = function (configArg) {
|
||||||
var done = plugins.Q.defer();
|
var done = plugins.Q.defer();
|
||||||
var config = configArg;
|
var config = configArg;
|
||||||
npmts_promisechain_1.npmtsOra.text('now compiling ' + 'TypeScript'.yellow);
|
npmts_promisechain_1.npmtsOra.text('now compiling ' + 'TypeScript'.yellow);
|
||||||
compileTs(config.ts, config.tsOptions)
|
plugins.tsn.compileGlobStringObject(config.ts, config.tsOptions, paths.cwd)
|
||||||
.then(function () {
|
.then(function () {
|
||||||
plugins.beautylog.ok('compiled main TypeScript!');
|
plugins.beautylog.ok('compiled main TypeScript!');
|
||||||
plugins.beautylog.log('now compiling tests!');
|
plugins.beautylog.log('now compiling tests!');
|
||||||
return compileTs(config.testTs);
|
return plugins.tsn.compileGlobStringObject(config.testTs);
|
||||||
})
|
})
|
||||||
.then(function () {
|
.then(function () {
|
||||||
plugins.beautylog.ok('compiled all TypeScript!');
|
plugins.beautylog.ok('compiled all TypeScript!');
|
||||||
|
2
dist/npmts.plugins.d.ts
vendored
2
dist/npmts.plugins.d.ts
vendored
@ -11,7 +11,7 @@ export declare let g: {
|
|||||||
sourcemaps: any;
|
sourcemaps: any;
|
||||||
typedoc: any;
|
typedoc: any;
|
||||||
};
|
};
|
||||||
export import lodashObject = require('lodash');
|
export import lodash = require('lodash');
|
||||||
export import npmextra = require('npmextra');
|
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');
|
||||||
|
2
dist/npmts.plugins.js
vendored
2
dist/npmts.plugins.js
vendored
@ -12,7 +12,7 @@ exports.g = {
|
|||||||
sourcemaps: require('gulp-sourcemaps'),
|
sourcemaps: require('gulp-sourcemaps'),
|
||||||
typedoc: require('gulp-typedoc')
|
typedoc: require('gulp-typedoc')
|
||||||
};
|
};
|
||||||
exports.lodashObject = require("lodash");
|
exports.lodash = require("lodash");
|
||||||
exports.npmextra = require("npmextra");
|
exports.npmextra = require("npmextra");
|
||||||
exports.projectinfo = require("projectinfo");
|
exports.projectinfo = require("projectinfo");
|
||||||
exports.path = require("path");
|
exports.path = require("path");
|
||||||
|
@ -39,7 +39,7 @@
|
|||||||
"babel-preset-es2015": "^6.14.0",
|
"babel-preset-es2015": "^6.14.0",
|
||||||
"beautylog": "5.0.23",
|
"beautylog": "5.0.23",
|
||||||
"depcheck": "^0.6.4",
|
"depcheck": "^0.6.4",
|
||||||
"early": "^2.0.26",
|
"early": "^2.0.28",
|
||||||
"gulp": "3.9.1",
|
"gulp": "3.9.1",
|
||||||
"gulp-babel": "^6.1.2",
|
"gulp-babel": "^6.1.2",
|
||||||
"gulp-function": "^1.3.6",
|
"gulp-function": "^1.3.6",
|
||||||
@ -49,18 +49,18 @@
|
|||||||
"gulp-sourcemaps": "^1.6.0",
|
"gulp-sourcemaps": "^1.6.0",
|
||||||
"gulp-typedoc": "^2.0.0",
|
"gulp-typedoc": "^2.0.0",
|
||||||
"lodash": "^4.15.0",
|
"lodash": "^4.15.0",
|
||||||
"npmextra": "^1.0.9",
|
"npmextra": "^1.0.11",
|
||||||
"projectinfo": "1.0.3",
|
"projectinfo": "1.0.3",
|
||||||
"q": "^1.4.1",
|
"q": "^1.4.1",
|
||||||
"shelljs": "^0.7.4",
|
"shelljs": "^0.7.4",
|
||||||
"smartcli": "1.0.9",
|
"smartcli": "1.0.9",
|
||||||
"smartcov": "1.0.0",
|
"smartcov": "1.0.0",
|
||||||
"smartenv": "1.2.5",
|
"smartenv": "1.2.5",
|
||||||
"smartfile": "4.0.15",
|
"smartfile": "4.0.18",
|
||||||
"smartpath": "3.2.2",
|
"smartpath": "3.2.2",
|
||||||
"smartstring": "^2.0.17",
|
"smartstring": "^2.0.17",
|
||||||
"source-map-support": "^0.4.2",
|
"source-map-support": "^0.4.2",
|
||||||
"tsn": "^1.0.13",
|
"tsn": "^2.0.3",
|
||||||
"typedoc": "^0.4.5",
|
"typedoc": "^0.4.5",
|
||||||
"typescript": "next",
|
"typescript": "next",
|
||||||
"typings-global": "^1.0.14"
|
"typings-global": "^1.0.14"
|
||||||
|
@ -34,7 +34,7 @@ const depcheckOptions = {
|
|||||||
|
|
||||||
let checkDependencies = (configArg) => {
|
let checkDependencies = (configArg) => {
|
||||||
let done = plugins.Q.defer()
|
let done = plugins.Q.defer()
|
||||||
let depcheckOptionsMerged = plugins.lodashObject.merge(depcheckOptions, {
|
let depcheckOptionsMerged = plugins.lodash.merge(depcheckOptions, {
|
||||||
ignoreDirs: [ // folder with these names will be ignored
|
ignoreDirs: [ // folder with these names will be ignored
|
||||||
'test',
|
'test',
|
||||||
'dist',
|
'dist',
|
||||||
@ -69,7 +69,7 @@ let checkDependencies = (configArg) => {
|
|||||||
|
|
||||||
let checkDevDependencies = (configArg) => {
|
let checkDevDependencies = (configArg) => {
|
||||||
let done = plugins.Q.defer()
|
let done = plugins.Q.defer()
|
||||||
let depcheckOptionsMerged = plugins.lodashObject.merge(depcheckOptions, {
|
let depcheckOptionsMerged = plugins.lodash.merge(depcheckOptions, {
|
||||||
ignoreDirs: [ // folder with these names will be ignored
|
ignoreDirs: [ // folder with these names will be ignored
|
||||||
'ts',
|
'ts',
|
||||||
'dist',
|
'dist',
|
||||||
|
@ -1,15 +0,0 @@
|
|||||||
import plugins = require('./npmts.plugins')
|
|
||||||
import paths = require('./npmts.paths')
|
|
||||||
|
|
||||||
let outputPathIsDir = function (tsArrayArg,keyArg) {
|
|
||||||
return plugins.smartpath.check.isDir(plugins.path.join(paths.cwd, tsArrayArg[keyArg]))
|
|
||||||
}
|
|
||||||
|
|
||||||
export let checkOutputPath = function(tsArrayArg,keyArg){
|
|
||||||
if (!outputPathIsDir(tsArrayArg,keyArg)) {
|
|
||||||
plugins.beautylog.warn('Skipping ' + keyArg + ' because ' + tsArrayArg[keyArg] + ' it is no directory!')
|
|
||||||
return false
|
|
||||||
} else {
|
|
||||||
return true
|
|
||||||
};
|
|
||||||
}
|
|
@ -1,62 +1,17 @@
|
|||||||
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 helpers = require('./npmts.compile.helpers')
|
|
||||||
import {npmtsOra} from './npmts.promisechain'
|
import {npmtsOra} from './npmts.promisechain'
|
||||||
|
|
||||||
let compileTs = (tsFileArrayArg: string[],tsOptionsArg = {}) => {
|
|
||||||
let done = plugins.Q.defer()
|
|
||||||
|
|
||||||
let compilerOptionsDefault = {
|
|
||||||
declaration: true,
|
|
||||||
module: 'CommonJS',
|
|
||||||
target: 'ES6'
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* merges default ts options with those found in npmts.json
|
|
||||||
*/
|
|
||||||
let compilerOptions = function (keyArg: string) {
|
|
||||||
let tsOptionsCombined = plugins.lodashObject.merge(compilerOptionsDefault, tsOptionsArg)
|
|
||||||
let compilerOptions: plugins.tsn.CompilerOptions = {
|
|
||||||
declaration: tsOptionsCombined.declaration,
|
|
||||||
module: plugins.tsn.ModuleKind[tsOptionsCombined.module],
|
|
||||||
target: plugins.tsn.ScriptTarget[tsOptionsCombined.target],
|
|
||||||
exclude: 'node_modules/**/*'
|
|
||||||
}
|
|
||||||
return compilerOptions
|
|
||||||
}
|
|
||||||
for (let keyArg in tsFileArrayArg) {
|
|
||||||
plugins.beautylog.info(`TypeScript assignment: transpile from ${keyArg.blue} to ${tsFileArrayArg[keyArg].blue}`)
|
|
||||||
if (helpers.checkOutputPath(tsFileArrayArg,keyArg)) {
|
|
||||||
plugins.smartfile.fs.listFileTree(process.cwd(),keyArg)
|
|
||||||
.then((filesToConvertArg: string[]) => {
|
|
||||||
let filesToConvertAbsolute = plugins.smartpath.transform.toAbsolute(filesToConvertArg,process.cwd())
|
|
||||||
let destDir = plugins.smartpath.transform.toAbsolute(tsFileArrayArg[keyArg],process.cwd())
|
|
||||||
return plugins.tsn.compile(
|
|
||||||
filesToConvertAbsolute,
|
|
||||||
destDir,
|
|
||||||
compilerOptions(keyArg)
|
|
||||||
)
|
|
||||||
})
|
|
||||||
.then(() => {
|
|
||||||
done.resolve()
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return done.promise
|
|
||||||
}
|
|
||||||
|
|
||||||
export let run = function (configArg) {
|
export let run = function (configArg) {
|
||||||
let done = plugins.Q.defer()
|
let done = plugins.Q.defer()
|
||||||
let config = configArg
|
let config = configArg
|
||||||
npmtsOra.text('now compiling ' + 'TypeScript'.yellow)
|
npmtsOra.text('now compiling ' + 'TypeScript'.yellow)
|
||||||
|
plugins.tsn.compileGlobStringObject(config.ts,config.tsOptions,paths.cwd)
|
||||||
compileTs(config.ts,config.tsOptions)
|
|
||||||
.then(() => {
|
.then(() => {
|
||||||
plugins.beautylog.ok('compiled main TypeScript!')
|
plugins.beautylog.ok('compiled main TypeScript!')
|
||||||
plugins.beautylog.log('now compiling tests!')
|
plugins.beautylog.log('now compiling tests!')
|
||||||
return compileTs(config.testTs)
|
return plugins.tsn.compileGlobStringObject(config.testTs)
|
||||||
})
|
})
|
||||||
.then(function () {
|
.then(function () {
|
||||||
plugins.beautylog.ok('compiled all TypeScript!')
|
plugins.beautylog.ok('compiled all TypeScript!')
|
||||||
|
@ -32,7 +32,7 @@ export var run = function (argvArg) {
|
|||||||
|
|
||||||
// mix with configfile
|
// mix with configfile
|
||||||
npmtsOra.text('looking for npmextra.json')
|
npmtsOra.text('looking for npmextra.json')
|
||||||
let config: INpmtsConfig = plugins.npmextra.dataFor({
|
let config: INpmtsConfig = plugins.npmextra.dataFor<INpmtsConfig>({
|
||||||
toolName: 'npmts',
|
toolName: 'npmts',
|
||||||
defaultSettings: defaultConfig,
|
defaultSettings: defaultConfig,
|
||||||
cwd: paths.cwd
|
cwd: paths.cwd
|
||||||
|
@ -11,7 +11,7 @@ export let g = {
|
|||||||
sourcemaps: require('gulp-sourcemaps'),
|
sourcemaps: require('gulp-sourcemaps'),
|
||||||
typedoc: require('gulp-typedoc')
|
typedoc: require('gulp-typedoc')
|
||||||
}
|
}
|
||||||
export import lodashObject = require('lodash')
|
export import lodash = require('lodash')
|
||||||
export import npmextra = require('npmextra')
|
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')
|
||||||
|
Loading…
Reference in New Issue
Block a user