@opaline/help-theme-default
Advanced tools
Comparing version 0.0.2 to 0.0.3
# @opaline/help-theme-default | ||
## 0.0.3 | ||
### Patch Changes | ||
- 370c233: update dev dependencies | ||
- 8874c76: update @opaline/help-theme-default dependencies | ||
## 0.0.2 | ||
### Patch Changes | ||
- 95b6984: Release missing packages |
"use strict"; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const chalk_1 = __importDefault(require("chalk")); | ||
const colorette_1 = require("colorette"); | ||
/** | ||
@@ -23,12 +20,12 @@ * Default formatter for help output | ||
if (help.usage) { | ||
output.push("", chalk_1.default.bold("USAGE"), [help.usage]); | ||
output.push("", (0, colorette_1.bold)("USAGE"), [help.usage]); | ||
} | ||
if (help.options && help.options.length) { | ||
output.push("", chalk_1.default.bold("OPTIONS"), formatList(help.options.map(formatOption)).map((opt) => `${opt[0]} ${opt[1]}`)); | ||
output.push("", (0, colorette_1.bold)("OPTIONS"), formatList(help.options.map(formatOption)).map((opt) => `${opt[0]} ${opt[1]}`)); | ||
} | ||
if (help.description) { | ||
output.push("", chalk_1.default.bold("DESCRIPTION"), [capFirst(help.description)]); | ||
output.push("", (0, colorette_1.bold)("DESCRIPTION"), [capFirst(help.description)]); | ||
} | ||
if (help.examples && help.examples.length) { | ||
output.push("", chalk_1.default.bold("EXAMPLES"), help.examples); | ||
output.push("", (0, colorette_1.bold)("EXAMPLES"), help.examples); | ||
} | ||
@@ -42,19 +39,17 @@ return output; | ||
} | ||
output.push("", chalk_1.default.bold("VERSION"), [ | ||
`${help.cliName}/${help.cliVersion}`, | ||
]); | ||
output.push("", (0, colorette_1.bold)("VERSION"), [`${help.cliName}/${help.cliVersion}`]); | ||
if (help.usage) { | ||
output.push("", chalk_1.default.bold("USAGE"), [help.usage]); | ||
output.push("", (0, colorette_1.bold)("USAGE"), [help.usage]); | ||
} | ||
if (help.commands && help.commands.length) { | ||
output.push("", chalk_1.default.bold("COMMANDS"), formatList(help.commands.map((c) => [c.name, capFirst(c.title || "")])).map((c) => `${c[0]} ${c[1]}`), "", join([ | ||
chalk_1.default.yellow("> NOTE:"), | ||
chalk_1.default.dim(`To view the usage information for a specific command, run '${help.cliName} [COMMAND] --help'`), | ||
output.push("", (0, colorette_1.bold)("COMMANDS"), formatList(help.commands.map((c) => [c.name, capFirst(c.title || "")])).map((c) => `${c[0]} ${c[1]}`), "", join([ | ||
(0, colorette_1.yellow)("> NOTE:"), | ||
(0, colorette_1.dim)(`To view the usage information for a specific command, run '${help.cliName} [COMMAND] --help'`), | ||
], " ")); | ||
} | ||
if (help.options && help.options.length) { | ||
output.push("", chalk_1.default.bold("OPTIONS"), formatList(help.options.map(formatOption)).map((opt) => `${opt[0]} ${opt[1]}`)); | ||
output.push("", (0, colorette_1.bold)("OPTIONS"), formatList(help.options.map(formatOption)).map((opt) => `${opt[0]} ${opt[1]}`)); | ||
} | ||
if (help.examples && help.examples.length) { | ||
output.push("", chalk_1.default.bold("EXAMPLES"), help.examples); | ||
output.push("", (0, colorette_1.bold)("EXAMPLES"), help.examples); | ||
} | ||
@@ -85,4 +80,4 @@ return output; | ||
capFirst(option.title || ""), | ||
option.type ? chalk_1.default.dim(`[${option.type}]`) : "", | ||
option.default ? chalk_1.default.dim(`[default: ${option.default}]`) : "", | ||
option.type ? (0, colorette_1.dim)(`[${option.type}]`) : "", | ||
option.default ? (0, colorette_1.dim)(`[default: ${option.default}]`) : "", | ||
], " "), | ||
@@ -89,0 +84,0 @@ ]; |
{ | ||
"name": "@opaline/help-theme-default", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"main": "./dist/index.js", | ||
@@ -13,4 +13,4 @@ "description": "", | ||
"@types/node": "^12.6.9", | ||
"chalk": "^3.0.0" | ||
"colorette": "^2.0.16" | ||
} | ||
} |
@@ -1,2 +0,2 @@ | ||
import chalk from "chalk"; | ||
import { bold, yellow, dim } from "colorette"; | ||
@@ -21,3 +21,3 @@ /** | ||
if (help.usage) { | ||
output.push("", chalk.bold("USAGE"), [help.usage]); | ||
output.push("", bold("USAGE"), [help.usage]); | ||
} | ||
@@ -28,3 +28,3 @@ | ||
"", | ||
chalk.bold("OPTIONS"), | ||
bold("OPTIONS"), | ||
formatList(help.options.map(formatOption)).map( | ||
@@ -37,7 +37,7 @@ (opt) => `${opt[0]} ${opt[1]}` | ||
if (help.description) { | ||
output.push("", chalk.bold("DESCRIPTION"), [capFirst(help.description)]); | ||
output.push("", bold("DESCRIPTION"), [capFirst(help.description)]); | ||
} | ||
if (help.examples && help.examples.length) { | ||
output.push("", chalk.bold("EXAMPLES"), help.examples); | ||
output.push("", bold("EXAMPLES"), help.examples); | ||
} | ||
@@ -55,8 +55,6 @@ | ||
output.push("", chalk.bold("VERSION"), [ | ||
`${help.cliName}/${help.cliVersion}`, | ||
]); | ||
output.push("", bold("VERSION"), [`${help.cliName}/${help.cliVersion}`]); | ||
if (help.usage) { | ||
output.push("", chalk.bold("USAGE"), [help.usage]); | ||
output.push("", bold("USAGE"), [help.usage]); | ||
} | ||
@@ -67,3 +65,3 @@ | ||
"", | ||
chalk.bold("COMMANDS"), | ||
bold("COMMANDS"), | ||
formatList( | ||
@@ -75,4 +73,4 @@ help.commands.map((c) => [c.name, capFirst(c.title || "")]) | ||
[ | ||
chalk.yellow("> NOTE:"), | ||
chalk.dim( | ||
yellow("> NOTE:"), | ||
dim( | ||
`To view the usage information for a specific command, run '${help.cliName} [COMMAND] --help'` | ||
@@ -89,3 +87,3 @@ ), | ||
"", | ||
chalk.bold("OPTIONS"), | ||
bold("OPTIONS"), | ||
formatList(help.options.map(formatOption)).map( | ||
@@ -98,3 +96,3 @@ (opt) => `${opt[0]} ${opt[1]}` | ||
if (help.examples && help.examples.length) { | ||
output.push("", chalk.bold("EXAMPLES"), help.examples); | ||
output.push("", bold("EXAMPLES"), help.examples); | ||
} | ||
@@ -130,4 +128,4 @@ | ||
capFirst(option.title || ""), | ||
option.type ? chalk.dim(`[${option.type}]`) : "", | ||
option.default ? chalk.dim(`[default: ${option.default}]`) : "", | ||
option.type ? dim(`[${option.type}]`) : "", | ||
option.default ? dim(`[default: ${option.default}]`) : "", | ||
], | ||
@@ -134,0 +132,0 @@ " " |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
24707
302
+ Addedcolorette@^2.0.16
+ Addedcolorette@2.0.20(transitive)
- Removedchalk@^3.0.0
- Removedansi-styles@4.3.0(transitive)
- Removedchalk@3.0.0(transitive)
- Removedcolor-convert@2.0.1(transitive)
- Removedcolor-name@1.1.4(transitive)
- Removedhas-flag@4.0.0(transitive)
- Removedsupports-color@7.2.0(transitive)