@vlandoss/clibuddy 0.0.8-git-474ac67.0 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +3 -3
- package/src/colors.ts +7 -6
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vlandoss/clibuddy",
|
|
3
|
-
"version": "0.0.8
|
|
3
|
+
"version": "0.0.8",
|
|
4
4
|
"description": "A helper library to create CLIs in Variable Land",
|
|
5
5
|
"homepage": "https://github.com/variableland/dx/tree/main/packages/clibuddy#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
"src"
|
|
25
25
|
],
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@pnpm/workspace.find-packages": "
|
|
28
|
-
"@pnpm/workspace.read-manifest": "
|
|
27
|
+
"@pnpm/workspace.find-packages": "1000.0.62",
|
|
28
|
+
"@pnpm/workspace.read-manifest": "1000.2.10",
|
|
29
29
|
"chalk": "5.6.2",
|
|
30
30
|
"read-package-up": "12.0.0",
|
|
31
31
|
"supports-color": "10.2.2",
|
package/src/colors.ts
CHANGED
|
@@ -2,16 +2,17 @@ import chalk, { type ChalkInstance } from "chalk";
|
|
|
2
2
|
import supportsColor from "supports-color";
|
|
3
3
|
|
|
4
4
|
// https://no-color.org/
|
|
5
|
-
const colorIsSupported = () => supportsColor.stdout && !process.env.NO_COLOR;
|
|
5
|
+
export const colorIsSupported = () => supportsColor.stdout && !process.env.NO_COLOR;
|
|
6
6
|
|
|
7
7
|
const identity = <T>(x: T) => x;
|
|
8
8
|
const safe = (style: ChalkInstance) => (colorIsSupported() ? style : identity);
|
|
9
9
|
|
|
10
|
-
export const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
greenBright: safe(chalk.greenBright),
|
|
10
|
+
export const colorize = (hex: string) => safe(chalk.hex(hex));
|
|
11
|
+
|
|
12
|
+
export const palette = {
|
|
14
13
|
bold: safe(chalk.bold),
|
|
15
|
-
|
|
14
|
+
italic: safe(chalk.italic),
|
|
16
15
|
link: safe(chalk.underline),
|
|
16
|
+
muted: safe(chalk.dim),
|
|
17
|
+
vland: colorize("#36d399"),
|
|
17
18
|
};
|