change npmts package name to being @gitzone scoped

This commit is contained in:
2018-04-09 01:03:39 +02:00
parent 7e46b55de5
commit 896e0095fa
36 changed files with 630 additions and 550 deletions

3
dist/index.js vendored
View File

@ -8,8 +8,7 @@ const early = require("early");
early.start('NPMTS');
const plugins = require("./npmts.plugins");
const cli = require("./npmts.cli");
early.stop()
.then(() => {
early.stop().then(() => {
let loaded = plugins; // to make sure plugins get actually loaded
cli.run();
});

View File

@ -26,13 +26,16 @@ let checkProjectTypings = (configArg) => {
const depcheckOptions = {
ignoreBinPackage: false,
parsers: {
// the target parsers
'*.ts': plugins.depcheck.parser.typescript
},
detectors: [
// the target detectors
plugins.depcheck.detector.requireCallExpression,
plugins.depcheck.detector.importDeclaration
],
specials: [
// the target special parsers
plugins.depcheck.special.eslint,
plugins.depcheck.special.webpack
]
@ -42,16 +45,18 @@ let checkDependencies = (configArg) => {
plugins.beautylog.ora.text('Check Module: Check Dependencies...');
let depcheckOptionsMerged = plugins.lodash.merge(depcheckOptions, {
ignoreDirs: [
// folder with these names will be ignored
'test',
'dist',
'bower_components'
],
ignoreMatches: [
// ignore dependencies that matches these globs
'@types/*',
'babel-preset-*'
]
});
plugins.depcheck(paths.cwd, depcheckOptionsMerged, (unused) => {
plugins.depcheck(paths.cwd, depcheckOptionsMerged, unused => {
for (let item of unused.dependencies) {
plugins.beautylog.warn(`Watch out: unused dependency "${item}"`);
}
@ -77,16 +82,18 @@ let checkDevDependencies = (configArg) => {
plugins.beautylog.ora.text('Check Module: Check devDependencies...');
let depcheckOptionsMerged = plugins.lodash.merge(depcheckOptions, {
ignoreDirs: [
// folder with these names will be ignored
'ts',
'dist',
'bower_components'
],
ignoreMatches: [
// ignore dependencies that matches these globs
'@types/*',
'babel-preset-*'
]
});
plugins.depcheck(paths.cwd, depcheckOptionsMerged, (unused) => {
plugins.depcheck(paths.cwd, depcheckOptionsMerged, unused => {
for (let item of unused.devDependencies) {
plugins.beautylog.log(`unused devDependency ${item}`);
}

View File

@ -7,10 +7,14 @@ exports.run = function (configArg) {
let done = q.defer();
let config = configArg;
plugins.beautylog.ora.text('now compiling ' + 'TypeScript');
plugins.tsn.compileGlobStringObject(config.ts, config.tsOptions, paths.cwd)
plugins.tsn
.compileGlobStringObject(config.ts, config.tsOptions, paths.cwd)
.then(() => {
plugins.beautylog.ok(`compiled the module's TypeScript!`);
done.resolve(config);
}).catch(err => { console.log(err); });
})
.catch(err => {
console.log(err);
});
return done.promise;
};

View File

@ -18,10 +18,7 @@ let testTypeScriptConfig = {
target: 'ES5',
emitDecoratorMetadata: true,
experimentalDecorators: true,
lib: [
'DOM',
'ESNext'
]
lib: ['DOM', 'ESNext']
};
/**
* runs mocha
@ -57,13 +54,10 @@ let tap = function (configArg) {
plugins.smartstream.cleanPipe()
]);
// lets run the smartstream
Promise.all([
testableFilesSmartstream.run(),
testFilesSmartstream.run()
]).then(() => __awaiter(this, void 0, void 0, function* () {
Promise.all([testableFilesSmartstream.run(), testFilesSmartstream.run()]).then(() => __awaiter(this, void 0, void 0, function* () {
configArg.runData.coverageLcovInfo = yield npmtsTapBuffer.runTests();
done.resolve(configArg);
}), (err) => {
}), err => {
plugins.beautylog.error('Tests failed!');
console.log(err);
if (configArg.watch) {
@ -84,14 +78,14 @@ let handleCoverageData = (configArg) => __awaiter(this, void 0, void 0, function
plugins.beautylog.warn('Hey... Did your tests import and use your module that you are trying to test?');
}
if (coverageResult >= configArg.coverageTreshold) {
plugins.beautylog.ok(`${(coverageResult).toString()}% `
+ `coverage exceeds your treshold of `
+ `${configArg.coverageTreshold.toString()}%`);
plugins.beautylog.ok(`${coverageResult.toString()}% ` +
`coverage exceeds your treshold of ` +
`${configArg.coverageTreshold.toString()}%`);
}
else {
plugins.beautylog.warn(`${(coverageResult).toString()}% `
+ `coverage fails your treshold of `
+ `${configArg.coverageTreshold.toString()}%`);
plugins.beautylog.warn(`${coverageResult.toString()}% ` +
`coverage fails your treshold of ` +
`${configArg.coverageTreshold.toString()}%`);
plugins.beautylog.error('exiting due to coverage failure');
if (!configArg.watch) {
process.exit(1);
@ -111,13 +105,19 @@ exports.run = function (configArg) {
.then(handleCoverageData)
.then(() => {
done.resolve(config);
}).catch(err => { console.log(err); });
})
.catch(err => {
console.log(err);
});
}
else {
tap(config)
.then(() => {
done.resolve(config);
}).catch(err => { console.log(err); });
})
.catch(err => {
console.log(err);
});
}
}
else {

30
dist/npmts.cli.js vendored
View File

@ -33,12 +33,14 @@ let npmtsAnalytics = new plugins.smartanalytics.Analytics({
});
process.nextTick(() => __awaiter(this, void 0, void 0, function* () {
// make the analytics call
npmtsAnalytics.recordEvent('npmToolExecution', {
npmtsAnalytics
.recordEvent('npmToolExecution', {
executionMode: (yield NpmtsConfig.configPromise).mode,
tsOptions: (yield NpmtsConfig.configPromise).tsOptions,
watch: (yield NpmtsConfig.configPromise).watch,
coverageTreshold: (yield NpmtsConfig.configPromise).coverageTreshold
}).catch(err => {
})
.catch(err => {
plugins.beautylog.warn('Lossless Analytics API not available...');
});
}));
@ -50,21 +52,24 @@ exports.run = () => __awaiter(this, void 0, void 0, function* () {
yield plugins.smartupdate.standardHandler.check('npmts', npmtsProjectInfo.version, 'http://gitzone.gitlab.io/npmts/changelog.html');
plugins.beautylog.log('---------------------------------------------');
let npmtsCli = new plugins.smartcli.Smartcli();
npmtsCli.standardTask()
.then((argvArg) => {
npmtsCli
.standardTask()
.then(argvArg => {
plugins.beautylog.info('npmts version: ' + npmtsProjectInfo.version);
return NpmtsConfig.run(argvArg);
})
.then((configArg) => {
let done = q.defer();
plugins.beautylog.ora.start('loading additional modules...');
NpmtsMods.modCompile.load()
.then((modCompile) => {
NpmtsMods.modCompile
.load()
.then(modCompile => {
return modCompile.run(configArg);
})
.then(configArg => {
let done = q.defer();
NpmtsMods.modDocs.load()
NpmtsMods.modDocs
.load()
.then(modDocs => {
return modDocs.run(configArg);
})
@ -75,7 +80,8 @@ exports.run = () => __awaiter(this, void 0, void 0, function* () {
})
.then(configArg => {
let done = q.defer();
NpmtsMods.modTest.load()
NpmtsMods.modTest
.load()
.then(modTest => {
return modTest.run(configArg);
})
@ -88,9 +94,11 @@ exports.run = () => __awaiter(this, void 0, void 0, function* () {
.then(NpmtsShip.run);
return done.promise;
})
.catch((err) => { if (err instanceof Error) {
console.log(err);
} });
.catch(err => {
if (err instanceof Error) {
console.log(err);
}
});
npmtsCli.addVersion(npmtsProjectInfo.version);
npmtsCli.startParse();
return yield done.promise;

2
dist/npmts.watch.js vendored
View File

@ -16,7 +16,7 @@ exports.run = (configArg) => {
pathsToWatch.push(key);
}
npmtsSmartchok = new smartchok.Smartchok(pathsToWatch);
npmtsSmartchok.getObservableFor('change').then((changeObservableArg) => {
npmtsSmartchok.getObservableFor('change').then(changeObservableArg => {
plugins.beautylog.info('now watching...');
changeObservableArg.subscribe(() => {
cli.run();