update beautylog

This commit is contained in:
Philipp Kunz 2017-01-21 23:23:00 +01:00
parent 3e4ac03a63
commit d94d66ef19
21 changed files with 36 additions and 62 deletions

4
dist/mod00/index.js vendored
View File

@ -3,14 +3,14 @@
* This module compiles TypeScript files
* -------------------------------------------- */
const q = require("smartq");
const npmts_log_1 = require("../npmts.log");
const plugins = require("./mod00.plugins");
const NpmtsAssets = require("./mod00.assets");
const NpmtsCheck = require("./mod00.check");
const NpmtsClean = require("./mod00.clean");
const NpmtsCompile = require("./mod00.compile");
exports.run = function (configArg) {
let done = q.defer();
npmts_log_1.npmtsOra.text('starting TypeScript Compilation');
plugins.beautylog.ora.text('starting TypeScript Compilation');
NpmtsClean.run(configArg)
.then(NpmtsCheck.run)
.then(NpmtsCompile.run)

View File

@ -1,13 +1,12 @@
"use strict";
const q = require("smartq");
const paths = require("../npmts.paths");
const npmts_log_1 = require("../npmts.log");
const plugins = require("./mod00.plugins");
const mod00_check_1 = require("../mod00/mod00.check");
exports.run = function (configArg) {
let done = q.defer();
let config = configArg;
npmts_log_1.npmtsOra.text('now looking at ' + 'required assets'.yellow);
plugins.beautylog.ora.text('now looking at ' + 'required assets'.yellow);
if (config.cli === true) {
let mainJsPath = mod00_check_1.projectInfo.packageJson.main;
let cliJsString = plugins.smartfile.fs.toStringSync(plugins.path.join(paths.npmtsAssetsDir, 'cli.js'));

View File

@ -2,11 +2,10 @@
const q = require("smartq");
const projectinfo_1 = require("projectinfo");
const paths = require("../npmts.paths");
const npmts_log_1 = require("../npmts.log");
const plugins = require("./mod00.plugins");
let checkProjectTypings = (configArg) => {
let done = q.defer();
npmts_log_1.npmtsOra.text('Check Module: Check Project Typings...');
plugins.beautylog.ora.text('Check Module: Check Project Typings...');
exports.projectInfo = new projectinfo_1.ProjectinfoNpm(paths.cwd);
if (typeof exports.projectInfo.packageJson.typings === 'undefined') {
plugins.beautylog.error(`please add typings field to package.json`);
@ -32,7 +31,7 @@ const depcheckOptions = {
};
let checkDependencies = (configArg) => {
let done = q.defer();
npmts_log_1.npmtsOra.text('Check Module: Check Dependencies...');
plugins.beautylog.ora.text('Check Module: Check Dependencies...');
let depcheckOptionsMerged = plugins.lodash.merge(depcheckOptions, {
ignoreDirs: [
'test',
@ -68,7 +67,7 @@ let checkDependencies = (configArg) => {
};
let checkDevDependencies = (configArg) => {
let done = q.defer();
npmts_log_1.npmtsOra.text('Check Module: Check devDependencies...');
plugins.beautylog.ora.text('Check Module: Check devDependencies...');
let depcheckOptionsMerged = plugins.lodash.merge(depcheckOptions, {
ignoreDirs: [
'ts',
@ -103,13 +102,13 @@ let checkDevDependencies = (configArg) => {
};
let checkNodeVersion = (configArg) => {
let done = q.defer();
npmts_log_1.npmtsOra.text('checking node version');
plugins.beautylog.ora.text('checking node version');
done.resolve(configArg);
return done.promise;
};
exports.run = (configArg) => {
let done = q.defer();
npmts_log_1.npmtsOra.text('Check Module: ...');
plugins.beautylog.ora.text('Check Module: ...');
checkProjectTypings(configArg)
.then(checkDependencies)
.then(checkDevDependencies)

View File

@ -1,13 +1,12 @@
"use strict";
const q = require("smartq");
const paths = require("../npmts.paths");
const npmts_log_1 = require("../npmts.log");
const plugins = require("./mod00.plugins");
/**
* removes the dist directory which will be entirely rebuild
*/
let removeDist = function () {
npmts_log_1.npmtsOra.text('cleaning dist folder');
plugins.beautylog.ora.text('cleaning dist folder');
return plugins.smartfile.fs.remove(paths.distDir);
};
/**
@ -25,11 +24,11 @@ let removeTestDeclarations = function () {
* remove old pages
*/
let removePages = function () {
npmts_log_1.npmtsOra.text('cleaning pages folder');
plugins.beautylog.ora.text('cleaning pages folder');
return plugins.smartfile.fs.remove(paths.pagesDir);
};
exports.run = function (configArg) {
npmts_log_1.npmtsOra.text('cleaning up from previous builds...');
plugins.beautylog.ora.text('cleaning up from previous builds...');
let done = q.defer();
removeDist()
.then(removeTestDeclarations)

View File

@ -1,12 +1,11 @@
"use strict";
const q = require("smartq");
const paths = require("../npmts.paths");
const npmts_log_1 = require("../npmts.log");
const plugins = require("./mod00.plugins");
exports.run = function (configArg) {
let done = q.defer();
let config = configArg;
npmts_log_1.npmtsOra.text('now compiling ' + 'TypeScript'.yellow);
plugins.beautylog.ora.text('now compiling ' + 'TypeScript'.yellow);
plugins.tsn.compileGlobStringObject(config.ts, config.tsOptions, paths.cwd)
.then(() => {
plugins.beautylog.ok('compiled main TypeScript!');

9
dist/mod02/index.js vendored
View File

@ -13,14 +13,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
const plugins = require("./mod02.plugins");
const paths = require("../npmts.paths");
const q = require("smartq");
const npmts_log_1 = require("../npmts.log");
/**
* runs mocha
* @returns INpmtsConfig
*/
let mocha = function (configArg) {
npmts_log_1.npmtsOra.text('Instrumentalizing and testing transpiled JS');
npmts_log_1.npmtsOra.end(); // end npmtsOra for tests.
plugins.beautylog.ora.text('Instrumentalizing and testing transpiled JS');
plugins.beautylog.ora.end(); // end plugins.beautylog.ora for tests.
let done = q.defer();
let coverageSmartstream = new plugins.smartstream.Smartstream([
plugins.gulp.src([plugins.path.join(paths.cwd, './ts/**/*.ts')]),
@ -103,7 +102,7 @@ exports.run = function (configArg) {
let done = q.defer();
let config = configArg;
if (config.test === true) {
npmts_log_1.npmtsOra.text('now starting tests');
plugins.beautylog.ora.text('now starting tests');
plugins.beautylog.log('------------------------------------------------------\n' +
'*************************** TESTS: ***************************\n' +
'--------------------------------------------------------------');
@ -114,7 +113,7 @@ exports.run = function (configArg) {
}).catch(err => { console.log(err); });
}
else {
npmts_log_1.npmtsOra.end();
plugins.beautylog.ora.end();
done.resolve(config);
}
return done.promise;

3
dist/npmts.cli.js vendored
View File

@ -6,7 +6,6 @@ const NpmtsConfig = require("./npmts.config");
const NpmtsMods = require("./npmts.mods");
const NpmtsWatch = require("./npmts.watch");
const NpmtsShip = require("./npmts.ship");
const npmts_log_1 = require("./npmts.log");
exports.run = () => {
let done = q.defer();
let npmtsProjectInfo = new plugins.projectinfo.ProjectinfoNpm(paths.npmtsPackageRoot);
@ -19,7 +18,7 @@ exports.run = () => {
})
.then((configArg) => {
let done = q.defer();
npmts_log_1.npmtsOra.start('loading additional modules...');
plugins.beautylog.ora.start('loading additional modules...');
NpmtsMods.mod00.load()
.then((mod00) => {
return mod00.run(configArg);

View File

@ -2,7 +2,6 @@
const plugins = require("./npmts.plugins");
const paths = require("./npmts.paths");
const q = require("smartq");
const npmts_log_1 = require("./npmts.log");
;
exports.run = function (argvArg) {
let done = q.defer();
@ -17,7 +16,7 @@ exports.run = function (argvArg) {
watch: false
};
// mix with configfile
npmts_log_1.npmtsOra.text('running npmextra');
plugins.beautylog.ora.text('running npmextra');
let localNpmextra = new plugins.npmextra.Npmextra(paths.cwd);
let config = localNpmextra.dataFor('npmts', defaultConfig);
// add argv

2
dist/npmts.log.d.ts vendored
View File

@ -1,2 +0,0 @@
import { Ora } from 'beautylog';
export declare let npmtsOra: Ora;

3
dist/npmts.log.js vendored
View File

@ -1,3 +0,0 @@
"use strict";
const beautylog_1 = require("beautylog");
exports.npmtsOra = new beautylog_1.Ora('setting up TaskChain', 'cyan');

View File

@ -40,7 +40,7 @@
"@types/gulp-sourcemaps": "0.0.29",
"@types/minimatch": "^2.0.29",
"@types/through2": "^2.0.32",
"beautylog": "6.0.6",
"beautylog": "6.1.0",
"depcheck": "^0.6.7",
"early": "^2.0.35",
"gulp": "3.9.1",

View File

@ -3,7 +3,6 @@
* -------------------------------------------- */
import * as q from 'smartq'
import { npmtsOra } from '../npmts.log'
import { INpmtsConfig } from '../npmts.config'
import * as plugins from './mod00.plugins'
@ -15,7 +14,7 @@ import * as NpmtsCompile from './mod00.compile'
export let run = function(configArg: INpmtsConfig): Promise<INpmtsConfig> {
let done = q.defer<INpmtsConfig>()
npmtsOra.text('starting TypeScript Compilation')
plugins.beautylog.ora.text('starting TypeScript Compilation')
NpmtsClean.run(configArg)
.then(NpmtsCheck.run)
.then(NpmtsCompile.run)

View File

@ -1,7 +1,6 @@
import * as q from 'smartq'
import paths = require('../npmts.paths')
import { npmtsOra } from '../npmts.log'
import plugins = require('./mod00.plugins')
import { projectInfo } from '../mod00/mod00.check'
@ -9,7 +8,7 @@ import { projectInfo } from '../mod00/mod00.check'
export let run = function(configArg){
let done = q.defer()
let config = configArg
npmtsOra.text('now looking at ' + 'required assets'.yellow)
plugins.beautylog.ora.text('now looking at ' + 'required assets'.yellow)
if (config.cli === true) {
let mainJsPath = projectInfo.packageJson.main
let cliJsString: string = plugins.smartfile.fs.toStringSync(plugins.path.join(paths.npmtsAssetsDir,'cli.js'))

View File

@ -2,7 +2,6 @@ import * as q from 'smartq'
import { ProjectinfoNpm } from 'projectinfo'
import * as paths from '../npmts.paths'
import { npmtsOra } from '../npmts.log'
import * as plugins from './mod00.plugins'
@ -10,7 +9,7 @@ export let projectInfo: ProjectinfoNpm
let checkProjectTypings = (configArg) => {
let done = q.defer()
npmtsOra.text('Check Module: Check Project Typings...')
plugins.beautylog.ora.text('Check Module: Check Project Typings...')
projectInfo = new ProjectinfoNpm(paths.cwd)
if (typeof projectInfo.packageJson.typings === 'undefined') {
plugins.beautylog.error(`please add typings field to package.json`)
@ -37,7 +36,7 @@ const depcheckOptions = {
let checkDependencies = (configArg) => {
let done = q.defer()
npmtsOra.text('Check Module: Check Dependencies...')
plugins.beautylog.ora.text('Check Module: Check Dependencies...')
let depcheckOptionsMerged = plugins.lodash.merge(depcheckOptions, {
ignoreDirs: [ // folder with these names will be ignored
'test',
@ -73,7 +72,7 @@ let checkDependencies = (configArg) => {
let checkDevDependencies = (configArg) => {
let done = q.defer()
npmtsOra.text('Check Module: Check devDependencies...')
plugins.beautylog.ora.text('Check Module: Check devDependencies...')
let depcheckOptionsMerged = plugins.lodash.merge(depcheckOptions, {
ignoreDirs: [ // folder with these names will be ignored
'ts',
@ -109,14 +108,14 @@ let checkDevDependencies = (configArg) => {
let checkNodeVersion = (configArg) => {
let done = q.defer()
npmtsOra.text('checking node version')
plugins.beautylog.ora.text('checking node version')
done.resolve(configArg)
return done.promise
}
export let run = (configArg) => {
let done = q.defer()
npmtsOra.text('Check Module: ...')
plugins.beautylog.ora.text('Check Module: ...')
checkProjectTypings(configArg)
.then(checkDependencies)
.then(checkDevDependencies)

View File

@ -1,15 +1,13 @@
import * as q from 'smartq'
import paths = require('../npmts.paths')
import { npmtsOra } from '../npmts.log'
import plugins = require('./mod00.plugins')
/**
* removes the dist directory which will be entirely rebuild
*/
let removeDist = function () {
npmtsOra.text('cleaning dist folder')
plugins.beautylog.ora.text('cleaning dist folder')
return plugins.smartfile.fs.remove(paths.distDir)
}
@ -29,12 +27,12 @@ let removeTestDeclarations = function () {
* remove old pages
*/
let removePages = function () {
npmtsOra.text('cleaning pages folder')
plugins.beautylog.ora.text('cleaning pages folder')
return plugins.smartfile.fs.remove(paths.pagesDir)
}
export let run = function (configArg) {
npmtsOra.text('cleaning up from previous builds...')
plugins.beautylog.ora.text('cleaning up from previous builds...')
let done = q.defer()
removeDist()
.then(removeTestDeclarations)

View File

@ -1,14 +1,13 @@
import * as q from 'smartq'
import * as paths from '../npmts.paths'
import { npmtsOra } from '../npmts.log'
import * as plugins from './mod00.plugins'
export let run = function (configArg) {
let done = q.defer()
let config = configArg
npmtsOra.text('now compiling ' + 'TypeScript'.yellow)
plugins.beautylog.ora.text('now compiling ' + 'TypeScript'.yellow)
plugins.tsn.compileGlobStringObject(config.ts,config.tsOptions,paths.cwd)
.then(() => {
plugins.beautylog.ok('compiled main TypeScript!')

View File

@ -4,7 +4,6 @@
import * as q from 'smartq'
import * as paths from '../npmts.paths'
import { npmtsOra } from '../npmts.log'
import { INpmtsConfig } from '../npmts.config'
import * as plugins from './mod01.plugins'

View File

@ -6,7 +6,6 @@ import paths = require('../npmts.paths')
import * as q from 'smartq'
import { npmtsOra } from '../npmts.log'
import { INpmtsConfig } from '../npmts.config'
/**
@ -14,8 +13,8 @@ import { INpmtsConfig } from '../npmts.config'
* @returns INpmtsConfig
*/
let mocha = function (configArg: INpmtsConfig) {
npmtsOra.text('Instrumentalizing and testing transpiled JS')
npmtsOra.end() // end npmtsOra for tests.
plugins.beautylog.ora.text('Instrumentalizing and testing transpiled JS')
plugins.beautylog.ora.end() // end plugins.beautylog.ora for tests.
let done = q.defer()
let coverageSmartstream = new plugins.smartstream.Smartstream([
@ -108,7 +107,7 @@ export let run = function (configArg: INpmtsConfig) {
let done = q.defer<INpmtsConfig>()
let config = configArg
if (config.test === true) {
npmtsOra.text('now starting tests')
plugins.beautylog.ora.text('now starting tests')
plugins.beautylog.log(
'------------------------------------------------------\n' +
'*************************** TESTS: ***************************\n' +
@ -121,7 +120,7 @@ export let run = function (configArg: INpmtsConfig) {
done.resolve(config)
}).catch(err => { console.log(err) })
} else {
npmtsOra.end()
plugins.beautylog.ora.end()
done.resolve(config)
}
return done.promise

View File

@ -7,8 +7,6 @@ import * as NpmtsMods from './npmts.mods'
import * as NpmtsWatch from './npmts.watch'
import * as NpmtsShip from './npmts.ship'
import { npmtsOra } from './npmts.log'
export let run = () => {
let done = q.defer()
let npmtsProjectInfo = new plugins.projectinfo.ProjectinfoNpm(paths.npmtsPackageRoot)
@ -21,7 +19,7 @@ export let run = () => {
})
.then((configArg: NpmtsConfig.INpmtsConfig) => {
let done = q.defer()
npmtsOra.start('loading additional modules...')
plugins.beautylog.ora.start('loading additional modules...')
NpmtsMods.mod00.load()
.then((mod00) => {
return mod00.run(configArg)

View File

@ -3,8 +3,6 @@ import paths = require('./npmts.paths')
import * as q from 'smartq'
import { npmtsOra } from './npmts.log'
export type npmtsMode = 'default' | 'custom'
export interface INpmtsConfig {
@ -33,7 +31,7 @@ export let run = function (argvArg) {
}
// mix with configfile
npmtsOra.text('running npmextra')
plugins.beautylog.ora.text('running npmextra')
let localNpmextra = new plugins.npmextra.Npmextra(paths.cwd)
let config: INpmtsConfig = localNpmextra.dataFor<INpmtsConfig>(

View File

@ -1,2 +0,0 @@
import {Ora} from 'beautylog'
export let npmtsOra = new Ora('setting up TaskChain','cyan')