@outfitter/cli 0.1.0 → 0.3.0
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/README.md +24 -0
- package/dist/box/index.js +4 -4
- package/dist/cli.d.ts +33 -2
- package/dist/cli.js +1 -1
- package/dist/colors/index.d.ts +1 -1
- package/dist/colors/index.js +2 -2
- package/dist/command.d.ts +6 -3
- package/dist/command.js +23 -3
- package/dist/demo/index.d.ts +5 -5
- package/dist/demo/index.js +21 -21
- package/dist/demo/registry.d.ts +3 -3
- package/dist/demo/registry.js +1 -1
- package/dist/demo/renderers/borders.d.ts +2 -2
- package/dist/demo/renderers/borders.js +8 -8
- package/dist/demo/renderers/box.d.ts +2 -2
- package/dist/demo/renderers/box.js +8 -8
- package/dist/demo/renderers/colors.d.ts +2 -2
- package/dist/demo/renderers/colors.js +8 -8
- package/dist/demo/renderers/indicators.d.ts +2 -2
- package/dist/demo/renderers/indicators.js +8 -8
- package/dist/demo/renderers/list.d.ts +2 -2
- package/dist/demo/renderers/list.js +8 -8
- package/dist/demo/renderers/markdown.d.ts +2 -2
- package/dist/demo/renderers/markdown.js +8 -8
- package/dist/demo/renderers/progress.d.ts +2 -2
- package/dist/demo/renderers/progress.js +7 -7
- package/dist/demo/renderers/spinner.d.ts +2 -2
- package/dist/demo/renderers/spinner.js +8 -8
- package/dist/demo/renderers/table.d.ts +2 -2
- package/dist/demo/renderers/table.js +9 -9
- package/dist/demo/renderers/text.d.ts +2 -2
- package/dist/demo/renderers/text.js +7 -7
- package/dist/demo/renderers/tree.d.ts +2 -2
- package/dist/demo/renderers/tree.js +7 -7
- package/dist/demo/section.d.ts +2 -2
- package/dist/demo/section.js +6 -6
- package/dist/demo/templates.d.ts +3 -3
- package/dist/demo/types.d.ts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +3 -3
- package/dist/output.d.ts +2 -2
- package/dist/output.js +4 -2
- package/dist/preset/full.d.ts +1 -1
- package/dist/preset/full.js +6 -6
- package/dist/preset/standard.d.ts +1 -1
- package/dist/preset/standard.js +6 -6
- package/dist/prompt/confirm.d.ts +2 -2
- package/dist/prompt/group.d.ts +2 -2
- package/dist/prompt/index.d.ts +5 -5
- package/dist/prompt/index.js +1 -1
- package/dist/prompt/select.d.ts +2 -2
- package/dist/prompt/select.js +1 -1
- package/dist/prompt/text.d.ts +2 -2
- package/dist/prompt/types.d.ts +1 -1
- package/dist/render/box.js +3 -3
- package/dist/render/colors.d.ts +1 -1
- package/dist/render/colors.js +1 -1
- package/dist/render/heading.js +5 -5
- package/dist/render/index.d.ts +10 -10
- package/dist/render/index.js +18 -18
- package/dist/render/indicators.d.ts +2 -2
- package/dist/render/indicators.js +3 -1
- package/dist/render/layout.js +4 -4
- package/dist/render/markdown.js +2 -2
- package/dist/render/separator.js +5 -5
- package/dist/render/shapes.js +5 -5
- package/dist/render/stack.js +6 -6
- package/dist/render/table.js +3 -3
- package/dist/render/text.js +2 -2
- package/dist/shared/@outfitter/{cli-f75h8e94.js → cli-0djg8q91.js} +1 -1
- package/dist/shared/@outfitter/{cli-y25tt8nc.d.ts → cli-0w242qtv.d.ts} +1 -1
- package/dist/shared/@outfitter/{cli-sx67mmfx.d.ts → cli-1g8tt31a.d.ts} +22 -1
- package/dist/shared/@outfitter/{cli-j4n8gaf3.js → cli-1sb3xvnw.js} +1 -1
- package/dist/shared/@outfitter/{cli-jhcdwvpn.js → cli-1vy0vtga.js} +2 -2
- package/dist/shared/@outfitter/{cli-xvqtqjxk.js → cli-3hk2xf3c.js} +1 -1
- package/dist/shared/@outfitter/{cli-0psys2vm.js → cli-47yw5h6a.js} +1 -1
- package/dist/shared/@outfitter/{cli-tqewy503.d.ts → cli-4b6tbp68.d.ts} +1 -1
- package/dist/shared/@outfitter/{cli-qp4cbhqr.js → cli-4fcz51qa.js} +2 -2
- package/dist/shared/@outfitter/{cli-efy6jfcj.js → cli-4h4rpdra.js} +1 -0
- package/dist/shared/@outfitter/{cli-6m988kh0.d.ts → cli-4zk2y4a2.d.ts} +1 -1
- package/dist/shared/@outfitter/{cli-9nbyj2bt.js → cli-5g6rkv3d.js} +7 -3
- package/dist/shared/@outfitter/{cli-p9j1phge.js → cli-60b5xh1r.js} +1 -1
- package/dist/shared/@outfitter/{cli-e73v3qqy.d.ts → cli-6hg0sg2d.d.ts} +1 -1
- package/dist/shared/@outfitter/{cli-pkxmzavm.js → cli-6r3m2knf.js} +2 -2
- package/dist/shared/@outfitter/{cli-p1m5dhrs.js → cli-6ty1nvws.js} +11 -1
- package/dist/shared/@outfitter/{cli-8a8xrzhy.js → cli-7n610r63.js} +1 -1
- package/dist/shared/@outfitter/{cli-zact3325.js → cli-7wp5nj0s.js} +20 -3
- package/dist/shared/@outfitter/{cli-7nm6edvh.d.ts → cli-83jwvj1t.d.ts} +1 -1
- package/dist/shared/@outfitter/{cli-s0kkx9m1.d.ts → cli-8hngbjyr.d.ts} +1 -1
- package/dist/shared/@outfitter/{cli-w5y3xepp.js → cli-914d47mt.js} +1 -1
- package/dist/shared/@outfitter/{cli-3f12z5kf.d.ts → cli-9bcm4zhf.d.ts} +4 -0
- package/dist/shared/@outfitter/{cli-671sxkhj.js → cli-aem6v4c8.js} +1 -1
- package/dist/shared/@outfitter/{cli-96b2p4td.d.ts → cli-bv09nme3.d.ts} +2 -2
- package/dist/shared/@outfitter/{cli-qjfc3j11.d.ts → cli-c6pbxpw0.d.ts} +1 -1
- package/dist/shared/@outfitter/{cli-an9j0h80.js → cli-c8fqdaes.js} +1 -1
- package/dist/shared/@outfitter/{cli-7gnrb8cr.js → cli-cwgj6mcs.js} +3 -3
- package/dist/shared/@outfitter/{cli-kc84wmch.js → cli-d8ahdd9d.js} +5 -0
- package/dist/shared/@outfitter/{cli-swwxvjvm.d.ts → cli-dbyteh27.d.ts} +1 -1
- package/dist/shared/@outfitter/{cli-72kg550t.d.ts → cli-e6yv2764.d.ts} +29 -1
- package/dist/shared/@outfitter/{cli-feb5j90n.js → cli-f6fsaayd.js} +3 -3
- package/dist/shared/@outfitter/{cli-ay411nbr.js → cli-ffa0jwb7.js} +1 -1
- package/dist/shared/@outfitter/{cli-ep2cvtk8.js → cli-h3jz0bxz.js} +1 -1
- package/dist/shared/@outfitter/{cli-9mtjjykw.js → cli-h4wpzb3f.js} +2 -2
- package/dist/shared/@outfitter/{cli-thvzhjd1.js → cli-hda6mc28.js} +2 -2
- package/dist/shared/@outfitter/{cli-vp88gxev.js → cli-jp0k3qd9.js} +1 -1
- package/dist/shared/@outfitter/{cli-nvvc92c8.js → cli-k76e7173.js} +2 -2
- package/dist/shared/@outfitter/{cli-4w2a1rfy.d.ts → cli-kc3ffp1v.d.ts} +1 -1
- package/dist/shared/@outfitter/{cli-d7jpshq5.d.ts → cli-kk5hnndk.d.ts} +1 -1
- package/dist/shared/@outfitter/{cli-jjemfdta.js → cli-mwxsh3sr.js} +1 -1
- package/dist/shared/@outfitter/{cli-p38sfxyk.js → cli-n0c33vba.js} +1 -1
- package/dist/shared/@outfitter/{cli-afhjqmg3.js → cli-ndem6tz8.js} +1 -1
- package/dist/shared/@outfitter/{cli-q8r6jarq.d.ts → cli-nj4nqy1h.d.ts} +1 -1
- package/dist/shared/@outfitter/{cli-daw296mv.js → cli-nkns8p4r.js} +1 -1
- package/dist/shared/@outfitter/{cli-6j9qynm8.js → cli-pndwprz8.js} +2 -2
- package/dist/shared/@outfitter/{cli-1bghjef6.js → cli-pvrwv6rb.js} +4 -4
- package/dist/shared/@outfitter/{cli-3dxmmy4c.d.ts → cli-py02m79x.d.ts} +1 -1
- package/dist/shared/@outfitter/{cli-mymyavvj.d.ts → cli-regjbef6.d.ts} +1 -1
- package/dist/shared/@outfitter/{cli-3t2zaenc.d.ts → cli-s1tx5kha.d.ts} +1 -1
- package/dist/shared/@outfitter/{cli-34fqr7bp.js → cli-sam2sq50.js} +2 -2
- package/dist/shared/@outfitter/{cli-0ggcy7fa.js → cli-symyxb0z.js} +1 -1
- package/dist/shared/@outfitter/{cli-8rx4g3s5.d.ts → cli-vfcrskfj.d.ts} +1 -1
- package/dist/shared/@outfitter/{cli-tarpsa8a.js → cli-y7k1t81k.js} +1 -1
- package/dist/shared/@outfitter/{cli-bf3vma4q.js → cli-yfyzy95c.js} +6 -0
- package/dist/shared/@outfitter/{cli-xsaheemc.d.ts → cli-ykxn7rb2.d.ts} +5 -0
- package/dist/shared/@outfitter/{cli-cs45xd6q.js → cli-z78mkrc7.js} +1 -1
- package/dist/shared/@outfitter/{cli-74ba31gz.js → cli-znc47004.js} +3 -3
- package/dist/streaming/index.js +2 -2
- package/dist/streaming/spinner.js +2 -2
- package/dist/table/index.js +3 -3
- package/dist/theme/context.d.ts +3 -3
- package/dist/theme/context.js +3 -3
- package/dist/theme/create.d.ts +3 -3
- package/dist/theme/create.js +3 -3
- package/dist/theme/index.d.ts +9 -9
- package/dist/theme/index.js +9 -9
- package/dist/theme/presets/bold.d.ts +3 -3
- package/dist/theme/presets/bold.js +3 -3
- package/dist/theme/presets/default.d.ts +3 -3
- package/dist/theme/presets/default.js +2 -2
- package/dist/theme/presets/index.d.ts +6 -6
- package/dist/theme/presets/index.js +5 -5
- package/dist/theme/presets/minimal.d.ts +3 -3
- package/dist/theme/presets/minimal.js +3 -3
- package/dist/theme/presets/rounded.d.ts +3 -3
- package/dist/theme/presets/rounded.js +3 -3
- package/dist/theme/resolve.d.ts +3 -3
- package/dist/theme/resolve.js +2 -2
- package/dist/theme/types.d.ts +2 -2
- package/package.json +4 -4
- package/dist/shared/@outfitter/cli-mhamvbty.d.ts +0 -34
package/dist/render/separator.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
renderSeparator
|
|
4
|
-
} from "../shared/@outfitter/cli-
|
|
5
|
-
import"../shared/@outfitter/cli-
|
|
6
|
-
import"../shared/@outfitter/cli-
|
|
7
|
-
import"../shared/@outfitter/cli-
|
|
4
|
+
} from "../shared/@outfitter/cli-n0c33vba.js";
|
|
5
|
+
import"../shared/@outfitter/cli-aem6v4c8.js";
|
|
6
|
+
import"../shared/@outfitter/cli-jp0k3qd9.js";
|
|
7
|
+
import"../shared/@outfitter/cli-mwxsh3sr.js";
|
|
8
8
|
import"../shared/@outfitter/cli-85fg2vr5.js";
|
|
9
|
-
import"../shared/@outfitter/cli-
|
|
9
|
+
import"../shared/@outfitter/cli-5g6rkv3d.js";
|
|
10
10
|
import"../shared/@outfitter/cli-d9ad0rqj.js";
|
|
11
11
|
import"../shared/@outfitter/cli-v1tzwxkt.js";
|
|
12
12
|
export {
|
package/dist/render/shapes.js
CHANGED
|
@@ -10,15 +10,15 @@ import {
|
|
|
10
10
|
render,
|
|
11
11
|
treeNodeToRecord,
|
|
12
12
|
unregisterRenderer
|
|
13
|
-
} from "../shared/@outfitter/cli-
|
|
13
|
+
} from "../shared/@outfitter/cli-1vy0vtga.js";
|
|
14
14
|
import"../shared/@outfitter/cli-3hp8qwx3.js";
|
|
15
15
|
import"../shared/@outfitter/cli-b5c2k0d7.js";
|
|
16
16
|
import"../shared/@outfitter/cli-xg5y5fhk.js";
|
|
17
|
-
import"../shared/@outfitter/cli-
|
|
18
|
-
import"../shared/@outfitter/cli-
|
|
19
|
-
import"../shared/@outfitter/cli-
|
|
17
|
+
import"../shared/@outfitter/cli-c8fqdaes.js";
|
|
18
|
+
import"../shared/@outfitter/cli-ndem6tz8.js";
|
|
19
|
+
import"../shared/@outfitter/cli-mwxsh3sr.js";
|
|
20
20
|
import"../shared/@outfitter/cli-85fg2vr5.js";
|
|
21
|
-
import"../shared/@outfitter/cli-
|
|
21
|
+
import"../shared/@outfitter/cli-5g6rkv3d.js";
|
|
22
22
|
import"../shared/@outfitter/cli-d9ad0rqj.js";
|
|
23
23
|
import"../shared/@outfitter/cli-v1tzwxkt.js";
|
|
24
24
|
export {
|
package/dist/render/stack.js
CHANGED
|
@@ -12,14 +12,14 @@ import {
|
|
|
12
12
|
unbox,
|
|
13
13
|
vstack,
|
|
14
14
|
vstackItem
|
|
15
|
-
} from "../shared/@outfitter/cli-
|
|
15
|
+
} from "../shared/@outfitter/cli-pvrwv6rb.js";
|
|
16
16
|
import"../shared/@outfitter/cli-b5c2k0d7.js";
|
|
17
|
-
import"../shared/@outfitter/cli-
|
|
18
|
-
import"../shared/@outfitter/cli-
|
|
19
|
-
import"../shared/@outfitter/cli-
|
|
20
|
-
import"../shared/@outfitter/cli-
|
|
17
|
+
import"../shared/@outfitter/cli-6ty1nvws.js";
|
|
18
|
+
import"../shared/@outfitter/cli-aem6v4c8.js";
|
|
19
|
+
import"../shared/@outfitter/cli-jp0k3qd9.js";
|
|
20
|
+
import"../shared/@outfitter/cli-mwxsh3sr.js";
|
|
21
21
|
import"../shared/@outfitter/cli-85fg2vr5.js";
|
|
22
|
-
import"../shared/@outfitter/cli-
|
|
22
|
+
import"../shared/@outfitter/cli-5g6rkv3d.js";
|
|
23
23
|
import"../shared/@outfitter/cli-d9ad0rqj.js";
|
|
24
24
|
import"../shared/@outfitter/cli-v1tzwxkt.js";
|
|
25
25
|
export {
|
package/dist/render/table.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
renderTable
|
|
4
|
-
} from "../shared/@outfitter/cli-
|
|
5
|
-
import"../shared/@outfitter/cli-
|
|
4
|
+
} from "../shared/@outfitter/cli-c8fqdaes.js";
|
|
5
|
+
import"../shared/@outfitter/cli-mwxsh3sr.js";
|
|
6
6
|
import"../shared/@outfitter/cli-85fg2vr5.js";
|
|
7
|
-
import"../shared/@outfitter/cli-
|
|
7
|
+
import"../shared/@outfitter/cli-5g6rkv3d.js";
|
|
8
8
|
import"../shared/@outfitter/cli-d9ad0rqj.js";
|
|
9
9
|
import"../shared/@outfitter/cli-v1tzwxkt.js";
|
|
10
10
|
export {
|
package/dist/render/text.js
CHANGED
|
@@ -9,8 +9,8 @@ import {
|
|
|
9
9
|
stripAnsi,
|
|
10
10
|
truncateText,
|
|
11
11
|
wrapText
|
|
12
|
-
} from "../shared/@outfitter/cli-
|
|
13
|
-
import"../shared/@outfitter/cli-
|
|
12
|
+
} from "../shared/@outfitter/cli-mwxsh3sr.js";
|
|
13
|
+
import"../shared/@outfitter/cli-5g6rkv3d.js";
|
|
14
14
|
import"../shared/@outfitter/cli-d9ad0rqj.js";
|
|
15
15
|
import"../shared/@outfitter/cli-v1tzwxkt.js";
|
|
16
16
|
init_text();
|
|
@@ -95,4 +95,25 @@ type ProgressStyle = "circle" | "vertical" | "horizontal" | "shade";
|
|
|
95
95
|
* ```
|
|
96
96
|
*/
|
|
97
97
|
declare function getProgressIndicator(style: ProgressStyle, current: number, max: number, forceUnicode?: boolean): string;
|
|
98
|
-
|
|
98
|
+
/**
|
|
99
|
+
* Severity levels for escalating indicators.
|
|
100
|
+
*
|
|
101
|
+
* Uses the diamond family: ◇ (minor) → ◆ (moderate) → ◈ (severe)
|
|
102
|
+
*/
|
|
103
|
+
type SeverityLevel = "minor" | "moderate" | "severe";
|
|
104
|
+
/**
|
|
105
|
+
* Gets a severity indicator for the given level.
|
|
106
|
+
*
|
|
107
|
+
* @param level - The severity level
|
|
108
|
+
* @param forceUnicode - Override unicode detection
|
|
109
|
+
* @returns The appropriate severity indicator character
|
|
110
|
+
*
|
|
111
|
+
* @example
|
|
112
|
+
* ```typescript
|
|
113
|
+
* getSeverityIndicator("minor"); // "◇"
|
|
114
|
+
* getSeverityIndicator("moderate"); // "◆"
|
|
115
|
+
* getSeverityIndicator("severe"); // "◈"
|
|
116
|
+
* ```
|
|
117
|
+
*/
|
|
118
|
+
declare function getSeverityIndicator(level: SeverityLevel, forceUnicode?: boolean): string;
|
|
119
|
+
export { IndicatorCategory, IndicatorSet, INDICATORS, isUnicodeSupported, getIndicator, ProgressStyle, getProgressIndicator, SeverityLevel, getSeverityIndicator };
|
|
@@ -11,10 +11,10 @@ import {
|
|
|
11
11
|
} from "./cli-xg5y5fhk.js";
|
|
12
12
|
import {
|
|
13
13
|
renderTable
|
|
14
|
-
} from "./cli-
|
|
14
|
+
} from "./cli-c8fqdaes.js";
|
|
15
15
|
import {
|
|
16
16
|
renderMarkdown
|
|
17
|
-
} from "./cli-
|
|
17
|
+
} from "./cli-ndem6tz8.js";
|
|
18
18
|
|
|
19
19
|
// packages/cli/src/render/shapes.ts
|
|
20
20
|
function isCollection(shape) {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
renderMarkdown
|
|
4
|
-
} from "./cli-
|
|
4
|
+
} from "./cli-ndem6tz8.js";
|
|
5
5
|
import {
|
|
6
6
|
getExample
|
|
7
7
|
} from "./cli-xep6v2c0.js";
|
|
8
8
|
import {
|
|
9
9
|
demoSection
|
|
10
|
-
} from "./cli-
|
|
10
|
+
} from "./cli-sam2sq50.js";
|
|
11
11
|
|
|
12
12
|
// packages/cli/src/demo/renderers/markdown.ts
|
|
13
13
|
function renderMarkdownDemo(config, theme) {
|
|
@@ -10,6 +10,7 @@ function createCLI(config) {
|
|
|
10
10
|
if (config.description) {
|
|
11
11
|
program.description(config.description);
|
|
12
12
|
}
|
|
13
|
+
program.option("--json", "Output as JSON", false);
|
|
13
14
|
const exit = config.onExit ?? ((code) => process.exit(code));
|
|
14
15
|
program.exitOverride((error) => {
|
|
15
16
|
if (isCommanderHelp(error)) {
|
|
@@ -33,7 +33,8 @@ function createTheme() {
|
|
|
33
33
|
bold: colorFn(ANSI.bold),
|
|
34
34
|
italic: colorFn(ANSI.italic),
|
|
35
35
|
underline: colorFn(ANSI.underline),
|
|
36
|
-
dim: colorFn(ANSI.dim)
|
|
36
|
+
dim: colorFn(ANSI.dim),
|
|
37
|
+
inverse: colorFn(ANSI.inverse)
|
|
37
38
|
};
|
|
38
39
|
}
|
|
39
40
|
function resolveTokenColorEnabled(options) {
|
|
@@ -71,7 +72,8 @@ function createTokens(options) {
|
|
|
71
72
|
bold: "",
|
|
72
73
|
italic: "",
|
|
73
74
|
underline: "",
|
|
74
|
-
dim: ""
|
|
75
|
+
dim: "",
|
|
76
|
+
inverse: ""
|
|
75
77
|
};
|
|
76
78
|
}
|
|
77
79
|
return {
|
|
@@ -90,7 +92,8 @@ function createTokens(options) {
|
|
|
90
92
|
bold: ANSI.bold,
|
|
91
93
|
italic: ANSI.italic,
|
|
92
94
|
underline: ANSI.underline,
|
|
93
|
-
dim: ANSI.dim
|
|
95
|
+
dim: ANSI.dim,
|
|
96
|
+
inverse: ANSI.inverse
|
|
94
97
|
};
|
|
95
98
|
}
|
|
96
99
|
function applyColor(text, color) {
|
|
@@ -109,6 +112,7 @@ var init_colors = __esm(() => {
|
|
|
109
112
|
dim: "\x1B[2m",
|
|
110
113
|
italic: "\x1B[3m",
|
|
111
114
|
underline: "\x1B[4m",
|
|
115
|
+
inverse: "\x1B[7m",
|
|
112
116
|
green: "\x1B[32m",
|
|
113
117
|
yellow: "\x1B[33m",
|
|
114
118
|
red: "\x1B[31m",
|
|
@@ -20,6 +20,7 @@ var INDICATORS = {
|
|
|
20
20
|
squareSmallOutline: { unicode: "\u25FB", fallback: "[ ]" },
|
|
21
21
|
lozenge: { unicode: "\u25C6", fallback: "\u2666" },
|
|
22
22
|
lozengeOutline: { unicode: "\u25C7", fallback: "\u25CA" },
|
|
23
|
+
lozengeDot: { unicode: "\u25C8", fallback: "\u2666\u2666" },
|
|
23
24
|
dash: { unicode: "\u2013", fallback: "-" },
|
|
24
25
|
pointer: { unicode: "\u276F", fallback: ">" },
|
|
25
26
|
pointerSmall: { unicode: "\u203A", fallback: ">" },
|
|
@@ -165,5 +166,14 @@ function getProgressIndicator(style, current, max, forceUnicode) {
|
|
|
165
166
|
}
|
|
166
167
|
return getIndicator("progress", name, forceUnicode);
|
|
167
168
|
}
|
|
169
|
+
var SEVERITY_MARKERS = {
|
|
170
|
+
minor: "lozengeOutline",
|
|
171
|
+
moderate: "lozenge",
|
|
172
|
+
severe: "lozengeDot"
|
|
173
|
+
};
|
|
174
|
+
function getSeverityIndicator(level, forceUnicode) {
|
|
175
|
+
const name = SEVERITY_MARKERS[level];
|
|
176
|
+
return getIndicator("marker", name, forceUnicode);
|
|
177
|
+
}
|
|
168
178
|
|
|
169
|
-
export { INDICATORS, isUnicodeSupported, getIndicator, getProgressIndicator };
|
|
179
|
+
export { INDICATORS, isUnicodeSupported, getIndicator, getProgressIndicator, getSeverityIndicator };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
// packages/cli/src/output.ts
|
|
3
|
+
import { getEnvironment, getEnvironmentDefaults } from "@outfitter/config";
|
|
3
4
|
import {
|
|
4
5
|
safeStringify as contractsSafeStringify,
|
|
5
6
|
exitCodeMap
|
|
@@ -31,7 +32,7 @@ function detectMode(options) {
|
|
|
31
32
|
return "json";
|
|
32
33
|
if (envJsonl === "0" || envJson === "0")
|
|
33
34
|
return "human";
|
|
34
|
-
return
|
|
35
|
+
return "human";
|
|
35
36
|
}
|
|
36
37
|
function isValidCategory(category) {
|
|
37
38
|
return category in exitCodeMap;
|
|
@@ -137,7 +138,10 @@ async function output(data, options) {
|
|
|
137
138
|
}
|
|
138
139
|
function exitWithError(error, options) {
|
|
139
140
|
const exitCode = getExitCode(error);
|
|
140
|
-
const mode = detectMode(
|
|
141
|
+
const mode = detectMode({
|
|
142
|
+
...options,
|
|
143
|
+
stream: options?.stream ?? process.stderr
|
|
144
|
+
});
|
|
141
145
|
const isJsonMode = mode === "json" || mode === "jsonl";
|
|
142
146
|
if (isJsonMode) {
|
|
143
147
|
process.stderr.write(`${serializeErrorToJson(error)}
|
|
@@ -148,5 +152,18 @@ function exitWithError(error, options) {
|
|
|
148
152
|
}
|
|
149
153
|
process.exit(exitCode);
|
|
150
154
|
}
|
|
155
|
+
function resolveVerbose(verbose) {
|
|
156
|
+
const envVerbose = process.env["OUTFITTER_VERBOSE"];
|
|
157
|
+
if (envVerbose === "1")
|
|
158
|
+
return true;
|
|
159
|
+
if (envVerbose === "0")
|
|
160
|
+
return false;
|
|
161
|
+
if (verbose !== undefined) {
|
|
162
|
+
return verbose;
|
|
163
|
+
}
|
|
164
|
+
const env = getEnvironment();
|
|
165
|
+
const defaults = getEnvironmentDefaults(env);
|
|
166
|
+
return defaults.verbose;
|
|
167
|
+
}
|
|
151
168
|
|
|
152
|
-
export { output, exitWithError };
|
|
169
|
+
export { output, exitWithError, resolveVerbose };
|
|
@@ -49,6 +49,8 @@ interface SelectPromptOptions<T> {
|
|
|
49
49
|
}>;
|
|
50
50
|
/** Initial selected index */
|
|
51
51
|
initialValue?: T;
|
|
52
|
+
/** Maximum number of items to display at once */
|
|
53
|
+
pageSize?: number;
|
|
52
54
|
}
|
|
53
55
|
/**
|
|
54
56
|
* Options for multi-select prompts.
|
|
@@ -66,6 +68,8 @@ interface MultiSelectPromptOptions<T> {
|
|
|
66
68
|
initialValues?: T[];
|
|
67
69
|
/** Require at least one selection */
|
|
68
70
|
required?: boolean;
|
|
71
|
+
/** Maximum number of items to display at once */
|
|
72
|
+
pageSize?: number;
|
|
69
73
|
}
|
|
70
74
|
/**
|
|
71
75
|
* Options for confirm prompts.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { SpinnerStyle } from "./cli-e5ms1y0x";
|
|
2
2
|
import { ListStyle } from "./cli-b0tzqgnf";
|
|
3
3
|
import { BorderStyle } from "./cli-fakncnjp";
|
|
4
|
-
import { PrimitiveId, PrimitiveMeta, ThemeMethodMeta, VariantMeta } from "./cli-
|
|
5
|
-
import { Theme } from "./cli-
|
|
4
|
+
import { PrimitiveId, PrimitiveMeta, ThemeMethodMeta, VariantMeta } from "./cli-c6pbxpw0";
|
|
5
|
+
import { Theme } from "./cli-ykxn7rb2";
|
|
6
6
|
/**
|
|
7
7
|
* Type-safe metadata for all theme methods.
|
|
8
8
|
*
|
|
@@ -2,18 +2,18 @@
|
|
|
2
2
|
import {
|
|
3
3
|
BORDER_STYLE_META,
|
|
4
4
|
getBorderStyles
|
|
5
|
-
} from "./cli-
|
|
5
|
+
} from "./cli-d8ahdd9d.js";
|
|
6
6
|
import {
|
|
7
7
|
getExample
|
|
8
8
|
} from "./cli-xep6v2c0.js";
|
|
9
9
|
import {
|
|
10
10
|
demoSection
|
|
11
|
-
} from "./cli-
|
|
11
|
+
} from "./cli-sam2sq50.js";
|
|
12
12
|
import {
|
|
13
13
|
createBox,
|
|
14
14
|
init_box,
|
|
15
15
|
renderBox
|
|
16
|
-
} from "./cli-
|
|
16
|
+
} from "./cli-jp0k3qd9.js";
|
|
17
17
|
|
|
18
18
|
// packages/cli/src/demo/renderers/box.ts
|
|
19
19
|
init_box();
|
|
@@ -80,6 +80,11 @@ var THEME_METHOD_META = {
|
|
|
80
80
|
category: "utility",
|
|
81
81
|
description: "Dim styling",
|
|
82
82
|
defaultExample: "De-emphasized"
|
|
83
|
+
},
|
|
84
|
+
inverse: {
|
|
85
|
+
category: "utility",
|
|
86
|
+
description: "Inverse styling (swap fg/bg)",
|
|
87
|
+
defaultExample: "Inverted text"
|
|
83
88
|
}
|
|
84
89
|
};
|
|
85
90
|
function getThemeMethodsByCategory() {
|
|
@@ -50,4 +50,32 @@ declare function output(data: unknown, options?: OutputOptions): Promise<void>;
|
|
|
50
50
|
* ```
|
|
51
51
|
*/
|
|
52
52
|
declare function exitWithError(error: Error, options?: OutputOptions): never;
|
|
53
|
-
|
|
53
|
+
/**
|
|
54
|
+
* Resolve verbose mode from environment configuration.
|
|
55
|
+
*
|
|
56
|
+
* Precedence (highest wins):
|
|
57
|
+
* 1. `OUTFITTER_VERBOSE` environment variable (`"1"` or `"0"`)
|
|
58
|
+
* 2. Explicit `verbose` parameter (from CLI flag)
|
|
59
|
+
* 3. `OUTFITTER_ENV` environment profile defaults
|
|
60
|
+
* 4. `false` (default)
|
|
61
|
+
*
|
|
62
|
+
* @param verbose - Optional explicit verbose flag (e.g. from --verbose CLI flag)
|
|
63
|
+
* @returns Whether verbose mode is enabled
|
|
64
|
+
*
|
|
65
|
+
* @example
|
|
66
|
+
* ```typescript
|
|
67
|
+
* import { resolveVerbose } from "@outfitter/cli/output";
|
|
68
|
+
*
|
|
69
|
+
* // Auto-resolve from environment
|
|
70
|
+
* const isVerbose = resolveVerbose();
|
|
71
|
+
*
|
|
72
|
+
* // With OUTFITTER_ENV=development → true
|
|
73
|
+
* // With OUTFITTER_VERBOSE=0 → false (overrides everything)
|
|
74
|
+
* // With nothing set → false
|
|
75
|
+
*
|
|
76
|
+
* // From CLI flag
|
|
77
|
+
* const isVerbose = resolveVerbose(cliFlags.verbose);
|
|
78
|
+
* ```
|
|
79
|
+
*/
|
|
80
|
+
declare function resolveVerbose(verbose?: boolean): boolean;
|
|
81
|
+
export { output, exitWithError, resolveVerbose };
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
renderTable
|
|
4
|
-
} from "./cli-
|
|
4
|
+
} from "./cli-c8fqdaes.js";
|
|
5
5
|
import {
|
|
6
6
|
BORDER_STYLE_META,
|
|
7
7
|
getBorderStyles
|
|
8
|
-
} from "./cli-
|
|
8
|
+
} from "./cli-d8ahdd9d.js";
|
|
9
9
|
import {
|
|
10
10
|
getExample
|
|
11
11
|
} from "./cli-xep6v2c0.js";
|
|
12
12
|
import {
|
|
13
13
|
demoSection
|
|
14
|
-
} from "./cli-
|
|
14
|
+
} from "./cli-sam2sq50.js";
|
|
15
15
|
|
|
16
16
|
// packages/cli/src/demo/renderers/table.ts
|
|
17
17
|
function renderTableDemo(config, theme) {
|
|
@@ -7,13 +7,13 @@ import {
|
|
|
7
7
|
import {
|
|
8
8
|
SPINNER_STYLE_META,
|
|
9
9
|
getSpinnerStyles
|
|
10
|
-
} from "./cli-
|
|
10
|
+
} from "./cli-d8ahdd9d.js";
|
|
11
11
|
import {
|
|
12
12
|
getExample
|
|
13
13
|
} from "./cli-xep6v2c0.js";
|
|
14
14
|
import {
|
|
15
15
|
demoSection
|
|
16
|
-
} from "./cli-
|
|
16
|
+
} from "./cli-sam2sq50.js";
|
|
17
17
|
|
|
18
18
|
// packages/cli/src/demo/renderers/spinner.ts
|
|
19
19
|
function renderSpinnerDemo(config, theme) {
|
|
@@ -5,13 +5,13 @@ import {
|
|
|
5
5
|
import {
|
|
6
6
|
LIST_STYLE_META,
|
|
7
7
|
getListStyles
|
|
8
|
-
} from "./cli-
|
|
8
|
+
} from "./cli-d8ahdd9d.js";
|
|
9
9
|
import {
|
|
10
10
|
getExample
|
|
11
11
|
} from "./cli-xep6v2c0.js";
|
|
12
12
|
import {
|
|
13
13
|
demoSection
|
|
14
|
-
} from "./cli-
|
|
14
|
+
} from "./cli-sam2sq50.js";
|
|
15
15
|
|
|
16
16
|
// packages/cli/src/demo/renderers/list.ts
|
|
17
17
|
function renderListDemo(config, theme) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
demoSection
|
|
4
|
-
} from "./cli-
|
|
4
|
+
} from "./cli-sam2sq50.js";
|
|
5
5
|
import {
|
|
6
6
|
getStringWidth,
|
|
7
7
|
init_text,
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
slugify,
|
|
11
11
|
truncateText,
|
|
12
12
|
wrapText
|
|
13
|
-
} from "./cli-
|
|
13
|
+
} from "./cli-mwxsh3sr.js";
|
|
14
14
|
|
|
15
15
|
// packages/cli/src/demo/renderers/text.ts
|
|
16
16
|
init_text();
|