Compare commits
20 Commits
Author | SHA1 | Date | |
---|---|---|---|
e01ecb9369 | |||
fd29434fa6 | |||
4684b9616c | |||
a2701bc3be | |||
425a86b33c | |||
20631eb0a8 | |||
27287d24fb | |||
1b2393c7ed | |||
330b0527c5 | |||
4485b5bfc6 | |||
cf6f636d3e | |||
37e726a45f | |||
0f0f2dd4ed | |||
9033eede2c | |||
e65e7da26b | |||
ef5c5eb2b8 | |||
ed156e6de8 | |||
d889a20572 | |||
da1ec0329f | |||
95e3f9cb10 |
3
dist/mod00/mod00.check.d.ts
vendored
3
dist/mod00/mod00.check.d.ts
vendored
@ -1,3 +1,4 @@
|
||||
import { ProjectinfoNpm } from 'projectinfo';
|
||||
import { INpmtsConfig } from '../npmts.config';
|
||||
export declare let projectInfo: ProjectinfoNpm;
|
||||
export declare let run: (configArg: any) => Promise<{}>;
|
||||
export declare let run: (configArg: INpmtsConfig) => Promise<INpmtsConfig>;
|
||||
|
32
dist/mod00/mod00.check.js
vendored
32
dist/mod00/mod00.check.js
vendored
@ -1,4 +1,12 @@
|
||||
"use strict";
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const q = require("smartq");
|
||||
const projectinfo_1 = require("projectinfo");
|
||||
@ -107,23 +115,17 @@ let checkNodeVersion = (configArg) => {
|
||||
done.resolve(configArg);
|
||||
return done.promise;
|
||||
};
|
||||
exports.run = (configArg) => {
|
||||
let done = q.defer();
|
||||
exports.run = (configArg) => __awaiter(this, void 0, void 0, function* () {
|
||||
plugins.beautylog.ora.text('Check Module: ...');
|
||||
// check cli
|
||||
if (configArg.argv.nocheck) {
|
||||
configArg.checkDependencies = false;
|
||||
}
|
||||
if (configArg.checkDependencies) {
|
||||
checkProjectTypings(configArg)
|
||||
.then(checkDependencies)
|
||||
.then(checkDevDependencies)
|
||||
.then(checkNodeVersion)
|
||||
.then(done.resolve)
|
||||
.catch((err) => { console.log(err); });
|
||||
configArg = yield checkProjectTypings(configArg);
|
||||
configArg = yield checkDependencies(configArg);
|
||||
configArg = yield checkDevDependencies(configArg);
|
||||
configArg = yield checkNodeVersion(configArg);
|
||||
return configArg;
|
||||
}
|
||||
else {
|
||||
done.resolve(configArg);
|
||||
configArg = yield checkProjectTypings(configArg);
|
||||
return configArg;
|
||||
}
|
||||
return done.promise;
|
||||
};
|
||||
});
|
||||
|
1
dist/mod02/index.js
vendored
1
dist/mod02/index.js
vendored
@ -24,6 +24,7 @@ let tap = function (configArg) {
|
||||
* the TabBuffer for npmts
|
||||
*/
|
||||
let npmtsTapBuffer = new plugins.tapbuffer.TabBuffer();
|
||||
npmtsTapBuffer.setConfig(configArg.testConfig);
|
||||
/**
|
||||
* handle the testable files
|
||||
*/
|
||||
|
1
dist/npmts.config.d.ts
vendored
1
dist/npmts.config.d.ts
vendored
@ -13,6 +13,7 @@ export interface INpmtsConfig {
|
||||
mode: npmtsMode;
|
||||
test: boolean;
|
||||
testTs: any;
|
||||
testConfig: any;
|
||||
ts: any;
|
||||
tsOptions: any;
|
||||
watch: boolean;
|
||||
|
9
dist/npmts.config.js
vendored
9
dist/npmts.config.js
vendored
@ -13,6 +13,9 @@ exports.run = function (argvArg) {
|
||||
mode: 'default',
|
||||
test: true,
|
||||
testTs: {},
|
||||
testConfig: {
|
||||
parallel: true
|
||||
},
|
||||
ts: {},
|
||||
tsOptions: {},
|
||||
watch: false,
|
||||
@ -49,6 +52,12 @@ exports.run = function (argvArg) {
|
||||
if (config.argv.notest) {
|
||||
config.test = false;
|
||||
}
|
||||
if (config.argv.nocoverage) {
|
||||
config.coverage = false;
|
||||
}
|
||||
if (config.argv.nochecks) {
|
||||
config.checkDependencies = false;
|
||||
}
|
||||
if (config.argv.watch) {
|
||||
config.watch = true;
|
||||
}
|
||||
|
2826
package-lock.json
generated
Normal file
2826
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
24
package.json
24
package.json
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "npmts",
|
||||
"version": "7.1.3",
|
||||
"version": "7.2.2",
|
||||
"description": "Write npm modules with TypeScript without hassle. TypeScript ready. Fully ES6.",
|
||||
"main": "dist/index.js",
|
||||
"bin": {
|
||||
@ -34,35 +34,35 @@
|
||||
},
|
||||
"homepage": "https://gitlab.com/gitzone/npmts#readme",
|
||||
"dependencies": {
|
||||
"@types/gulp-sourcemaps": "0.0.30",
|
||||
"@types/gulp-sourcemaps": "0.0.31",
|
||||
"@types/minimatch": "^2.0.29",
|
||||
"@types/through2": "^2.0.33",
|
||||
"beautylog": "6.1.10",
|
||||
"beautylog": "^6.1.10",
|
||||
"depcheck": "^0.6.7",
|
||||
"early": "^2.1.1",
|
||||
"gulp-function": "^2.2.9",
|
||||
"gulp-sourcemaps": "^2.6.0",
|
||||
"gulp-typescript": "^3.1.7",
|
||||
"gulp-typescript": "^3.2.1",
|
||||
"lodash": "^4.17.4",
|
||||
"npmextra": "^2.0.5",
|
||||
"npmextra": "^2.0.7",
|
||||
"projectinfo": "^3.0.2",
|
||||
"smartanalytics": "^1.0.6",
|
||||
"smartchok": "^1.0.8",
|
||||
"smartchok": "^1.0.11",
|
||||
"smartcli": "^2.0.7",
|
||||
"smartcov": "^1.0.2",
|
||||
"smarterror": "^1.0.3",
|
||||
"smartfile": "^4.2.17",
|
||||
"smartgulp": "^1.0.6",
|
||||
"smartpath": "^3.2.8",
|
||||
"smartq": "^1.1.1",
|
||||
"smartstream": "^1.0.8",
|
||||
"smartq": "^1.1.6",
|
||||
"smartstream": "^1.0.10",
|
||||
"smartstring": "^2.0.24",
|
||||
"smartsystem": "^1.0.17",
|
||||
"tapbuffer": "^1.0.13",
|
||||
"smartsystem": "^1.0.18",
|
||||
"tapbuffer": "^1.0.19",
|
||||
"through2": "^2.0.3",
|
||||
"tsn": "^2.0.15",
|
||||
"typescript": "^2.3.4",
|
||||
"typings-global": "^1.0.16"
|
||||
"typescript": "^2.4.1",
|
||||
"typings-global": "^1.0.19"
|
||||
},
|
||||
"devDependencies": {}
|
||||
}
|
||||
|
@ -1,14 +1,17 @@
|
||||
import * as q from 'smartq'
|
||||
import { ProjectinfoNpm } from 'projectinfo'
|
||||
|
||||
// interfaces
|
||||
import { INpmtsConfig } from '../npmts.config'
|
||||
|
||||
import * as paths from '../npmts.paths'
|
||||
|
||||
import * as plugins from './mod00.plugins'
|
||||
|
||||
export let projectInfo: ProjectinfoNpm
|
||||
|
||||
let checkProjectTypings = (configArg) => {
|
||||
let done = q.defer()
|
||||
let checkProjectTypings = (configArg: INpmtsConfig) => {
|
||||
let done = q.defer<INpmtsConfig>()
|
||||
plugins.beautylog.ora.text('Check Module: Check Project Typings...')
|
||||
projectInfo = new ProjectinfoNpm(paths.cwd)
|
||||
if (typeof projectInfo.packageJson.typings === 'undefined') {
|
||||
@ -34,8 +37,8 @@ const depcheckOptions = {
|
||||
]
|
||||
}
|
||||
|
||||
let checkDependencies = (configArg) => {
|
||||
let done = q.defer()
|
||||
let checkDependencies = (configArg: INpmtsConfig) => {
|
||||
let done = q.defer<INpmtsConfig>()
|
||||
plugins.beautylog.ora.text('Check Module: Check Dependencies...')
|
||||
let depcheckOptionsMerged = plugins.lodash.merge(depcheckOptions, {
|
||||
ignoreDirs: [ // folder with these names will be ignored
|
||||
@ -70,8 +73,8 @@ let checkDependencies = (configArg) => {
|
||||
return done.promise
|
||||
}
|
||||
|
||||
let checkDevDependencies = (configArg) => {
|
||||
let done = q.defer()
|
||||
let checkDevDependencies = (configArg: INpmtsConfig) => {
|
||||
let done = q.defer<INpmtsConfig>()
|
||||
plugins.beautylog.ora.text('Check Module: Check devDependencies...')
|
||||
let depcheckOptionsMerged = plugins.lodash.merge(depcheckOptions, {
|
||||
ignoreDirs: [ // folder with these names will be ignored
|
||||
@ -106,31 +109,24 @@ let checkDevDependencies = (configArg) => {
|
||||
return done.promise
|
||||
}
|
||||
|
||||
let checkNodeVersion = (configArg) => {
|
||||
let done = q.defer()
|
||||
let checkNodeVersion = (configArg: INpmtsConfig) => {
|
||||
let done = q.defer<INpmtsConfig>()
|
||||
plugins.beautylog.ora.text('checking node version')
|
||||
done.resolve(configArg)
|
||||
return done.promise
|
||||
}
|
||||
|
||||
export let run = (configArg) => {
|
||||
let done = q.defer()
|
||||
export let run = async (configArg: INpmtsConfig) => {
|
||||
plugins.beautylog.ora.text('Check Module: ...')
|
||||
|
||||
// check cli
|
||||
if (configArg.argv.nocheck) {
|
||||
configArg.checkDependencies = false
|
||||
}
|
||||
if (configArg.checkDependencies) {
|
||||
checkProjectTypings(configArg)
|
||||
.then(checkDependencies)
|
||||
.then(checkDevDependencies)
|
||||
.then(checkNodeVersion)
|
||||
.then(done.resolve)
|
||||
.catch((err) => { console.log(err) })
|
||||
configArg = await checkProjectTypings(configArg)
|
||||
configArg = await checkDependencies(configArg)
|
||||
configArg = await checkDevDependencies(configArg)
|
||||
configArg = await checkNodeVersion(configArg)
|
||||
return configArg
|
||||
} else {
|
||||
done.resolve(configArg)
|
||||
configArg = await checkProjectTypings(configArg)
|
||||
return configArg
|
||||
}
|
||||
|
||||
return done.promise
|
||||
}
|
||||
|
@ -20,6 +20,8 @@ let tap = function (configArg: INpmtsConfig) {
|
||||
*/
|
||||
let npmtsTapBuffer = new plugins.tapbuffer.TabBuffer()
|
||||
|
||||
npmtsTapBuffer.setConfig(configArg.testConfig)
|
||||
|
||||
/**
|
||||
* handle the testable files
|
||||
*/
|
||||
|
@ -19,6 +19,7 @@ export interface INpmtsConfig {
|
||||
mode: npmtsMode
|
||||
test: boolean
|
||||
testTs: any
|
||||
testConfig: any
|
||||
ts: any
|
||||
tsOptions: any
|
||||
watch: boolean
|
||||
@ -38,6 +39,9 @@ export let run = function (argvArg) {
|
||||
mode: 'default',
|
||||
test: true,
|
||||
testTs: {},
|
||||
testConfig: {
|
||||
parallel: true
|
||||
},
|
||||
ts: {},
|
||||
tsOptions: {},
|
||||
watch: false,
|
||||
@ -83,6 +87,15 @@ export let run = function (argvArg) {
|
||||
if (config.argv.notest) {
|
||||
config.test = false
|
||||
}
|
||||
|
||||
if (config.argv.nocoverage) {
|
||||
config.coverage = false
|
||||
}
|
||||
|
||||
if (config.argv.nochecks) {
|
||||
config.checkDependencies = false
|
||||
}
|
||||
|
||||
if (config.argv.watch) {
|
||||
config.watch = true
|
||||
}
|
||||
|
Reference in New Issue
Block a user