@keg-hub/cli-utils
Advanced tools
Comparing version 0.8.0 to 0.9.0
{ | ||
"name": "@keg-hub/cli-utils", | ||
"version": "0.8.0", | ||
"version": "0.9.0", | ||
"description": "Utility methods for writing Custom Tasks consumed by the Keg-CLI", | ||
@@ -17,2 +17,4 @@ "main": "index.js", | ||
"index.js", | ||
"runTask.js", | ||
"logger.js", | ||
"registerTs.js", | ||
@@ -19,0 +21,0 @@ "src/" |
@@ -34,4 +34,5 @@ const colorMap = { | ||
brightRed: (log) => addColor(colorMap.bright, colorMap.red, log), | ||
brightBlue: (log) => addColor(colorMap.bright, colorMap.blue, log), | ||
brightGray: (log) => addColor(colorMap.bright, colorMap.gray, log), | ||
brightCyan: (log) => addColor(colorMap.bright, colorMap.cyan, log), | ||
brightBlue: (log) => addColor(colorMap.bright, colorMap.blue, log), | ||
brightWhite: (log) => addColor(colorMap.bright, colorMap.white, log), | ||
@@ -49,5 +50,11 @@ brightGreen: (log) => addColor(colorMap.bright, colorMap.green, log), | ||
colors.dim = Object.keys(colors).reduce((acc, key) => { | ||
acc[key] = (log) => addColor(colorMap.dim, colors[key](log)) | ||
return acc | ||
}, {}) | ||
module.exports = { | ||
colors, | ||
} |
@@ -1,2 +0,2 @@ | ||
const { get, isColl, isObj, isFunc } = require('@keg-hub/jsutils') | ||
const { get, isColl } = require('@keg-hub/jsutils') | ||
const { colors } = require('./colors') | ||
@@ -34,3 +34,3 @@ | ||
? colors[logColor](JSON.stringify(data, null, 2)) | ||
: isFunc(data.toString) | ||
: typeof data.toString === `function` | ||
? colors[logColor](data.toString()) | ||
@@ -167,4 +167,6 @@ : colors[logColor](data) | ||
*/ | ||
setColors = colorMap => | ||
isObj(colorMap) && (this.colorMap = { ...this.colorMap, ...colorMap }) | ||
setColors = colorMap => { | ||
typeof colorMap === `object` | ||
&& (this.colorMap = { ...this.colorMap, ...colorMap }) | ||
} | ||
@@ -171,0 +173,0 @@ /** |
@@ -72,7 +72,2 @@ #!/usr/bin/env node | ||
// Check if the parent module ( task module ) has a parent | ||
// If it does, then it was called by the Keg-CLI | ||
// So we should return the task definition instead of running the task action | ||
module.parent | ||
? (module.exports = { runTask }) | ||
: runTask() | ||
module.exports = { runTask } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
156359
95
4500