@hypercli/ui 0.1.1
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/LICENSE +21 -0
- package/README.md +11 -0
- package/dist/capabilities/index.d.ts +62 -0
- package/dist/capabilities/index.d.ts.map +1 -0
- package/dist/capabilities/index.js +182 -0
- package/dist/capabilities/index.js.map +1 -0
- package/dist/colors.d.ts +32 -0
- package/dist/colors.d.ts.map +1 -0
- package/dist/colors.js +40 -0
- package/dist/colors.js.map +1 -0
- package/dist/components/columns.d.ts +28 -0
- package/dist/components/columns.d.ts.map +1 -0
- package/dist/components/columns.js +70 -0
- package/dist/components/columns.js.map +1 -0
- package/dist/components/confirmPrompt.d.ts +38 -0
- package/dist/components/confirmPrompt.d.ts.map +1 -0
- package/dist/components/confirmPrompt.js +109 -0
- package/dist/components/confirmPrompt.js.map +1 -0
- package/dist/components/diff.d.ts +37 -0
- package/dist/components/diff.d.ts.map +1 -0
- package/dist/components/diff.js +36 -0
- package/dist/components/diff.js.map +1 -0
- package/dist/components/helpLayout.d.ts +59 -0
- package/dist/components/helpLayout.d.ts.map +1 -0
- package/dist/components/helpLayout.js +103 -0
- package/dist/components/helpLayout.js.map +1 -0
- package/dist/components/index.d.ts +38 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.js +23 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/keyValue.d.ts +31 -0
- package/dist/components/keyValue.d.ts.map +1 -0
- package/dist/components/keyValue.js +36 -0
- package/dist/components/keyValue.js.map +1 -0
- package/dist/components/list.d.ts +30 -0
- package/dist/components/list.d.ts.map +1 -0
- package/dist/components/list.js +80 -0
- package/dist/components/list.js.map +1 -0
- package/dist/components/message.d.ts +33 -0
- package/dist/components/message.d.ts.map +1 -0
- package/dist/components/message.js +86 -0
- package/dist/components/message.js.map +1 -0
- package/dist/components/panel.d.ts +28 -0
- package/dist/components/panel.d.ts.map +1 -0
- package/dist/components/panel.js +30 -0
- package/dist/components/panel.js.map +1 -0
- package/dist/components/progressBar.d.ts +44 -0
- package/dist/components/progressBar.d.ts.map +1 -0
- package/dist/components/progressBar.js +154 -0
- package/dist/components/progressBar.js.map +1 -0
- package/dist/components/section.d.ts +22 -0
- package/dist/components/section.d.ts.map +1 -0
- package/dist/components/section.js +48 -0
- package/dist/components/section.js.map +1 -0
- package/dist/components/selectPrompt.d.ts +58 -0
- package/dist/components/selectPrompt.d.ts.map +1 -0
- package/dist/components/selectPrompt.js +206 -0
- package/dist/components/selectPrompt.js.map +1 -0
- package/dist/components/spinner.d.ts +38 -0
- package/dist/components/spinner.d.ts.map +1 -0
- package/dist/components/spinner.js +125 -0
- package/dist/components/spinner.js.map +1 -0
- package/dist/components/statusList.d.ts +22 -0
- package/dist/components/statusList.d.ts.map +1 -0
- package/dist/components/statusList.js +43 -0
- package/dist/components/statusList.js.map +1 -0
- package/dist/components/table.d.ts +39 -0
- package/dist/components/table.d.ts.map +1 -0
- package/dist/components/table.js +132 -0
- package/dist/components/table.js.map +1 -0
- package/dist/components/textPrompt.d.ts +43 -0
- package/dist/components/textPrompt.d.ts.map +1 -0
- package/dist/components/textPrompt.js +123 -0
- package/dist/components/textPrompt.js.map +1 -0
- package/dist/components/tree.d.ts +30 -0
- package/dist/components/tree.d.ts.map +1 -0
- package/dist/components/tree.js +49 -0
- package/dist/components/tree.js.map +1 -0
- package/dist/ds-index.d.ts +113 -0
- package/dist/ds-index.d.ts.map +1 -0
- package/dist/ds-index.js +112 -0
- package/dist/ds-index.js.map +1 -0
- package/dist/help.d.ts +32 -0
- package/dist/help.d.ts.map +1 -0
- package/dist/help.js +34 -0
- package/dist/help.js.map +1 -0
- package/dist/hyper-theme.d.ts +8 -0
- package/dist/hyper-theme.d.ts.map +1 -0
- package/dist/hyper-theme.js +30 -0
- package/dist/hyper-theme.js.map +1 -0
- package/dist/index.d.ts +50 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +39 -0
- package/dist/index.js.map +1 -0
- package/dist/md.d.ts +12 -0
- package/dist/md.d.ts.map +1 -0
- package/dist/md.js +19 -0
- package/dist/md.js.map +1 -0
- package/dist/messages.d.ts +20 -0
- package/dist/messages.d.ts.map +1 -0
- package/dist/messages.js +65 -0
- package/dist/messages.js.map +1 -0
- package/dist/palette.d.ts +20 -0
- package/dist/palette.d.ts.map +1 -0
- package/dist/palette.js +22 -0
- package/dist/palette.js.map +1 -0
- package/dist/primitives/align.d.ts +23 -0
- package/dist/primitives/align.d.ts.map +1 -0
- package/dist/primitives/align.js +40 -0
- package/dist/primitives/align.js.map +1 -0
- package/dist/primitives/badge.d.ts +24 -0
- package/dist/primitives/badge.d.ts.map +1 -0
- package/dist/primitives/badge.js +40 -0
- package/dist/primitives/badge.js.map +1 -0
- package/dist/primitives/border.d.ts +29 -0
- package/dist/primitives/border.d.ts.map +1 -0
- package/dist/primitives/border.js +100 -0
- package/dist/primitives/border.js.map +1 -0
- package/dist/primitives/context.d.ts +48 -0
- package/dist/primitives/context.d.ts.map +1 -0
- package/dist/primitives/context.js +64 -0
- package/dist/primitives/context.js.map +1 -0
- package/dist/primitives/divider.d.ts +25 -0
- package/dist/primitives/divider.d.ts.map +1 -0
- package/dist/primitives/divider.js +56 -0
- package/dist/primitives/divider.js.map +1 -0
- package/dist/primitives/indent.d.ts +16 -0
- package/dist/primitives/indent.d.ts.map +1 -0
- package/dist/primitives/indent.js +25 -0
- package/dist/primitives/indent.js.map +1 -0
- package/dist/primitives/index.d.ts +32 -0
- package/dist/primitives/index.d.ts.map +1 -0
- package/dist/primitives/index.js +22 -0
- package/dist/primitives/index.js.map +1 -0
- package/dist/primitives/line.d.ts +21 -0
- package/dist/primitives/line.d.ts.map +1 -0
- package/dist/primitives/line.js +29 -0
- package/dist/primitives/line.js.map +1 -0
- package/dist/primitives/markdown.d.ts +91 -0
- package/dist/primitives/markdown.d.ts.map +1 -0
- package/dist/primitives/markdown.js +62 -0
- package/dist/primitives/markdown.js.map +1 -0
- package/dist/primitives/pad.d.ts +24 -0
- package/dist/primitives/pad.d.ts.map +1 -0
- package/dist/primitives/pad.js +20 -0
- package/dist/primitives/pad.js.map +1 -0
- package/dist/primitives/stack.d.ts +22 -0
- package/dist/primitives/stack.d.ts.map +1 -0
- package/dist/primitives/stack.js +21 -0
- package/dist/primitives/stack.js.map +1 -0
- package/dist/primitives/styledText.d.ts +36 -0
- package/dist/primitives/styledText.d.ts.map +1 -0
- package/dist/primitives/styledText.js +42 -0
- package/dist/primitives/styledText.js.map +1 -0
- package/dist/primitives/symbol.d.ts +15 -0
- package/dist/primitives/symbol.d.ts.map +1 -0
- package/dist/primitives/symbol.js +18 -0
- package/dist/primitives/symbol.js.map +1 -0
- package/dist/primitives/truncate.d.ts +23 -0
- package/dist/primitives/truncate.d.ts.map +1 -0
- package/dist/primitives/truncate.js +99 -0
- package/dist/primitives/truncate.js.map +1 -0
- package/dist/primitives/wrap.d.ts +23 -0
- package/dist/primitives/wrap.d.ts.map +1 -0
- package/dist/primitives/wrap.js +30 -0
- package/dist/primitives/wrap.js.map +1 -0
- package/dist/render/ansi-utils.d.ts +49 -0
- package/dist/render/ansi-utils.d.ts.map +1 -0
- package/dist/render/ansi-utils.js +405 -0
- package/dist/render/ansi-utils.js.map +1 -0
- package/dist/render/index.d.ts +11 -0
- package/dist/render/index.d.ts.map +1 -0
- package/dist/render/index.js +11 -0
- package/dist/render/index.js.map +1 -0
- package/dist/render/sgr.d.ts +60 -0
- package/dist/render/sgr.d.ts.map +1 -0
- package/dist/render/sgr.js +191 -0
- package/dist/render/sgr.js.map +1 -0
- package/dist/render/strip.d.ts +24 -0
- package/dist/render/strip.d.ts.map +1 -0
- package/dist/render/strip.js +81 -0
- package/dist/render/strip.js.map +1 -0
- package/dist/render/width.d.ts +30 -0
- package/dist/render/width.d.ts.map +1 -0
- package/dist/render/width.js +149 -0
- package/dist/render/width.js.map +1 -0
- package/dist/shortcuts.d.ts +76 -0
- package/dist/shortcuts.d.ts.map +1 -0
- package/dist/shortcuts.js +117 -0
- package/dist/shortcuts.js.map +1 -0
- package/dist/styles.d.ts +43 -0
- package/dist/styles.d.ts.map +1 -0
- package/dist/styles.js +44 -0
- package/dist/styles.js.map +1 -0
- package/dist/symbols.d.ts +19 -0
- package/dist/symbols.d.ts.map +1 -0
- package/dist/symbols.js +21 -0
- package/dist/symbols.js.map +1 -0
- package/dist/test/compare.d.ts +28 -0
- package/dist/test/compare.d.ts.map +1 -0
- package/dist/test/compare.js +37 -0
- package/dist/test/compare.js.map +1 -0
- package/dist/test/index.d.ts +16 -0
- package/dist/test/index.d.ts.map +1 -0
- package/dist/test/index.js +14 -0
- package/dist/test/index.js.map +1 -0
- package/dist/test/mock.d.ts +50 -0
- package/dist/test/mock.d.ts.map +1 -0
- package/dist/test/mock.js +135 -0
- package/dist/test/mock.js.map +1 -0
- package/dist/test/render.d.ts +29 -0
- package/dist/test/render.d.ts.map +1 -0
- package/dist/test/render.js +87 -0
- package/dist/test/render.js.map +1 -0
- package/dist/test/snapshot.d.ts +16 -0
- package/dist/test/snapshot.d.ts.map +1 -0
- package/dist/test/snapshot.js +216 -0
- package/dist/test/snapshot.js.map +1 -0
- package/dist/theme/builtins.d.ts +10 -0
- package/dist/theme/builtins.d.ts.map +1 -0
- package/dist/theme/builtins.js +102 -0
- package/dist/theme/builtins.js.map +1 -0
- package/dist/theme/engine.d.ts +51 -0
- package/dist/theme/engine.d.ts.map +1 -0
- package/dist/theme/engine.js +123 -0
- package/dist/theme/engine.js.map +1 -0
- package/dist/theme/index.d.ts +10 -0
- package/dist/theme/index.d.ts.map +1 -0
- package/dist/theme/index.js +12 -0
- package/dist/theme/index.js.map +1 -0
- package/dist/theme/merge.d.ts +24 -0
- package/dist/theme/merge.d.ts.map +1 -0
- package/dist/theme/merge.js +66 -0
- package/dist/theme/merge.js.map +1 -0
- package/dist/theme/types.d.ts +44 -0
- package/dist/theme/types.d.ts.map +1 -0
- package/dist/theme/types.js +8 -0
- package/dist/theme/types.js.map +1 -0
- package/dist/theme.d.ts +9 -0
- package/dist/theme.d.ts.map +1 -0
- package/dist/theme.js +53 -0
- package/dist/theme.js.map +1 -0
- package/dist/tokens/defaults.d.ts +13 -0
- package/dist/tokens/defaults.d.ts.map +1 -0
- package/dist/tokens/defaults.js +248 -0
- package/dist/tokens/defaults.js.map +1 -0
- package/dist/tokens/index.d.ts +10 -0
- package/dist/tokens/index.d.ts.map +1 -0
- package/dist/tokens/index.js +10 -0
- package/dist/tokens/index.js.map +1 -0
- package/dist/tokens/resolver.d.ts +100 -0
- package/dist/tokens/resolver.d.ts.map +1 -0
- package/dist/tokens/resolver.js +138 -0
- package/dist/tokens/resolver.js.map +1 -0
- package/dist/tokens/types.d.ts +265 -0
- package/dist/tokens/types.d.ts.map +1 -0
- package/dist/tokens/types.js +10 -0
- package/dist/tokens/types.js.map +1 -0
- package/dist/tokens.d.ts +26 -0
- package/dist/tokens.d.ts.map +1 -0
- package/dist/tokens.js +30 -0
- package/dist/tokens.js.map +1 -0
- package/dist/types.d.ts +38 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +11 -0
- package/dist/types.js.map +1 -0
- package/package.json +78 -0
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shortcuts — Quick opinionated API
|
|
3
|
+
*
|
|
4
|
+
* Provides c (color functions), s (composite styles), msg (structured messages),
|
|
5
|
+
* md (inline markdown), symbols, and tokens as convenient shortcuts.
|
|
6
|
+
*/
|
|
7
|
+
import { message } from "./components/index.js";
|
|
8
|
+
import { divider, getContext, indent as indentPrimitive, styledText, symbol, } from "./primitives/index.js";
|
|
9
|
+
// ---------------------------------------------------------------------------
|
|
10
|
+
// md — inline markdown → styled text
|
|
11
|
+
// ---------------------------------------------------------------------------
|
|
12
|
+
export function md(text) {
|
|
13
|
+
return text
|
|
14
|
+
.replace(/`([^`]+)`/g, (_, code) => styledText(code, { color: "code" }))
|
|
15
|
+
.replace(/\*\*([^*]+)\*\*/g, (_, bold) => styledText(bold, { bold: true }))
|
|
16
|
+
.replace(/(?<!\*)\*([^*]+)\*(?!\*)/g, (_, dim) => styledText(dim, { dim: true }));
|
|
17
|
+
}
|
|
18
|
+
// ---------------------------------------------------------------------------
|
|
19
|
+
// c — color functions
|
|
20
|
+
// ---------------------------------------------------------------------------
|
|
21
|
+
export const c = {
|
|
22
|
+
// Status colors
|
|
23
|
+
success: (text) => styledText(text, { color: "success" }),
|
|
24
|
+
error: (text) => styledText(text, { color: "error" }),
|
|
25
|
+
warning: (text) => styledText(text, { color: "warning" }),
|
|
26
|
+
info: (text) => styledText(text, { color: "info" }),
|
|
27
|
+
muted: (text) => styledText(text, { dim: true }),
|
|
28
|
+
// Hex-based / semantic
|
|
29
|
+
command: (text) => styledText(text, { color: "code" }),
|
|
30
|
+
danger: (text) => styledText(text, { color: "error", bold: true }),
|
|
31
|
+
// Formatting helpers
|
|
32
|
+
highlight: (text) => styledText(text, { color: "info" }),
|
|
33
|
+
dim: (text) => styledText(text, { dim: true }),
|
|
34
|
+
bold: (text) => styledText(text, { bold: true }),
|
|
35
|
+
subtle: (text) => styledText(text, { dim: true }),
|
|
36
|
+
text: (text) => text,
|
|
37
|
+
// CLI entity colors
|
|
38
|
+
kit: (text) => styledText(text, { color: "accent" }),
|
|
39
|
+
recipe: (text) => styledText(text, { color: "code" }),
|
|
40
|
+
cookbook: (text) => styledText(text, { color: "accent", bold: true }),
|
|
41
|
+
helper: (text) => styledText(text, { color: "warning" }),
|
|
42
|
+
// Code/data colors
|
|
43
|
+
property: (text) => styledText(text, { color: "info" }),
|
|
44
|
+
required: (text) => styledText(text, { color: "error", bold: true }),
|
|
45
|
+
default: (value) => styledText(` (default: ${JSON.stringify(value)})`, { dim: true }),
|
|
46
|
+
enum: (text) => styledText(text, { color: "warning" }),
|
|
47
|
+
// Headings & labels
|
|
48
|
+
title: (text) => styledText(text, { bold: true, color: "info" }),
|
|
49
|
+
heading: (text) => styledText(text, { bold: true, color: "warning" }),
|
|
50
|
+
version: (text) => styledText(text, { dim: true }),
|
|
51
|
+
};
|
|
52
|
+
// ---------------------------------------------------------------------------
|
|
53
|
+
// s — composite style formatters
|
|
54
|
+
// ---------------------------------------------------------------------------
|
|
55
|
+
export const s = {
|
|
56
|
+
hint: (text) => styledText(text, { dim: true }),
|
|
57
|
+
// Status messages with icons
|
|
58
|
+
success: (text) => `${symbol("success")} ${styledText(text, { color: "success" })}`,
|
|
59
|
+
error: (text) => `${symbol("error")} ${styledText(text, { color: "error" })}`,
|
|
60
|
+
warning: (text) => `${symbol("warning")} ${styledText(text, { color: "warning" })}`,
|
|
61
|
+
info: (text) => `${symbol("info")} ${styledText(text, { color: "info" })}`,
|
|
62
|
+
section: (text) => styledText(text, { bold: true, color: "info" }),
|
|
63
|
+
code: (text) => styledText(`\`${text}\``, { dim: true }),
|
|
64
|
+
highlight: (text) => styledText(text, { color: "info", bold: true }),
|
|
65
|
+
title: (prefix, text) => styledText(`${prefix}: ${text}`, { bold: true, color: "info" }),
|
|
66
|
+
hr: () => divider(),
|
|
67
|
+
keyValue: (key, value, indent = 0) => `${" ".repeat(indent)}${styledText(`${key}:`, { color: "info" })} ${value}`,
|
|
68
|
+
header: (text, count) => styledText(count !== undefined ? `${text} (${count})` : text, { bold: true, color: "warning" }),
|
|
69
|
+
description: (text, level = 2) => indentPrimitive(styledText(text, { dim: true }), level),
|
|
70
|
+
listItem: (text) => ` ${symbol("bullet")} ${text}`,
|
|
71
|
+
/**
|
|
72
|
+
* Renders indented paragraph lines under a list item, followed by a blank line.
|
|
73
|
+
* Use this when a list item has body content (description, sub-items, etc.).
|
|
74
|
+
* Items without body content should NOT use this — they get no trailing blank line.
|
|
75
|
+
*/
|
|
76
|
+
listItemBody: (...lines) => `${lines.join("\n")}\n`,
|
|
77
|
+
indent: (text, spaces) => " ".repeat(spaces) + text,
|
|
78
|
+
path: (text) => styledText(text, { dim: true }),
|
|
79
|
+
version: (text) => styledText(text, { dim: true }),
|
|
80
|
+
md,
|
|
81
|
+
};
|
|
82
|
+
function makeMessageFn(level) {
|
|
83
|
+
return (input) => {
|
|
84
|
+
if (typeof input === "string") {
|
|
85
|
+
return message({ level, text: input });
|
|
86
|
+
}
|
|
87
|
+
// Bridge from UI's API shape to DS's message component
|
|
88
|
+
return message({
|
|
89
|
+
level,
|
|
90
|
+
text: input.summary,
|
|
91
|
+
title: input.title,
|
|
92
|
+
details: input.body,
|
|
93
|
+
});
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
export const msg = {
|
|
97
|
+
error: makeMessageFn("error"),
|
|
98
|
+
warning: makeMessageFn("warning"),
|
|
99
|
+
success: makeMessageFn("success"),
|
|
100
|
+
info: makeMessageFn("info"),
|
|
101
|
+
tip: makeMessageFn("tip"),
|
|
102
|
+
};
|
|
103
|
+
// ---------------------------------------------------------------------------
|
|
104
|
+
// symbols & tokens — resolved values
|
|
105
|
+
// ---------------------------------------------------------------------------
|
|
106
|
+
/** Get resolved symbol glyphs. Lazy getter to ensure system is initialized. */
|
|
107
|
+
export function getSymbols() {
|
|
108
|
+
return getContext().tokens.symbol;
|
|
109
|
+
}
|
|
110
|
+
/** Get resolved tokens. Lazy getter to ensure system is initialized. */
|
|
111
|
+
export function getTokens() {
|
|
112
|
+
return getContext().tokens;
|
|
113
|
+
}
|
|
114
|
+
// For backwards compat, export as objects that proxy to the context
|
|
115
|
+
// These are functions, not static objects, because the context may not be initialized yet
|
|
116
|
+
export { getSymbols as symbols, getTokens as tokens };
|
|
117
|
+
//# sourceMappingURL=shortcuts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shortcuts.js","sourceRoot":"","sources":["../src/shortcuts.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAEhD,OAAO,EACN,OAAO,EACP,UAAU,EACV,MAAM,IAAI,eAAe,EACzB,UAAU,EACV,MAAM,GACN,MAAM,uBAAuB,CAAC;AAE/B,8EAA8E;AAC9E,qCAAqC;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d,KAAK;YACL,IAAI,EAAE,KAAK,CAAC,OAAO;YACnB,KAAK,EAAE,KAAK,CAAC,KAAK;YAClB,OAAO,EAAE,KAAK,CAAC,IAAI;SACnB,CAAC,CAAC;IACJ,CAAC,CAAC;AACH,CAAC;AAED,MAAM,CAAC,MAAM,GAAG,GAAG;IAClB,KAAK,EAAE,aAAa,CAAC,OAAO,CAAC;IAC7B,OAAO,EAAE,aAAa,CAAC,SAAS,CAAC;IACjC,OAAO,EAAE,aAAa,CAAC,SAAS,CAAC;IACjC,IAAI,EAAE,aAAa,CAAC,MAAM,CAAC;IAC3B,GAAG,EAAE,aAAa,CAAC,KAAK,CAAC;CACzB,CAAC;AAEF,8EAA8E;AAC9E,qCAAqC;AACrC,8EAA8E;AAE9E,+EAA+E;AAC/E,MAAM,UAAU,UAAU;IACzB,OAAO,UAAU,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC;AACnC,CAAC;AAED,wEAAwE;AACxE,MAAM,UAAU,SAAS;IACxB,OAAO,UAAU,EAAE,CAAC,MAAM,CAAC;AAC5B,CAAC;AAED,oEAAoE;AACpE,0FAA0F;AAC1F,OAAO,EAAE,UAAU,IAAI,OAAO,EAAE,SAAS,IAAI,MAAM,EAAE,CAAC"}
|
package/dist/styles.d.ts
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Composite style formatters — the `s` object.
|
|
3
|
+
*
|
|
4
|
+
* These produce multi-element styled strings (icon + text, key: value, etc.).
|
|
5
|
+
* Merged from gen/lib/styles.ts + core/ui/styles.ts.
|
|
6
|
+
*/
|
|
7
|
+
import { md } from "./md.js";
|
|
8
|
+
export declare const s: {
|
|
9
|
+
/** Dim hint text */
|
|
10
|
+
hint: (text: string) => string;
|
|
11
|
+
/** Status messages with icons */
|
|
12
|
+
success: (text: string) => string;
|
|
13
|
+
error: (text: string) => string;
|
|
14
|
+
warning: (text: string) => string;
|
|
15
|
+
info: (text: string) => string;
|
|
16
|
+
/** Bold section heading */
|
|
17
|
+
section: (text: string) => string;
|
|
18
|
+
/** Inline code (gray backticks) */
|
|
19
|
+
code: (text: string) => string;
|
|
20
|
+
/** Emphasized text */
|
|
21
|
+
highlight: (text: string) => string;
|
|
22
|
+
/** "Prefix: text" title */
|
|
23
|
+
title: (prefix: string, text: string) => string;
|
|
24
|
+
/** Horizontal rule */
|
|
25
|
+
hr: () => string;
|
|
26
|
+
/** "key: value" with optional indent */
|
|
27
|
+
keyValue: (key: string, value: string, indent?: number) => string;
|
|
28
|
+
/** Section header with optional count */
|
|
29
|
+
header: (text: string, count?: number) => string;
|
|
30
|
+
/** Dim description with optional indent */
|
|
31
|
+
description: (text: string, indent?: number) => string;
|
|
32
|
+
/** Bulleted list item */
|
|
33
|
+
listItem: (text: string) => string;
|
|
34
|
+
/** Indent text by N spaces */
|
|
35
|
+
indent: (text: string, spaces: number) => string;
|
|
36
|
+
/** Dim file path */
|
|
37
|
+
path: (text: string) => string;
|
|
38
|
+
/** Dim version string */
|
|
39
|
+
version: (text: string) => string;
|
|
40
|
+
/** Inline markdown → styled terminal text */
|
|
41
|
+
md: typeof md;
|
|
42
|
+
};
|
|
43
|
+
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../src/styles.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC;AAE7B,eAAO,MAAM,CAAC;IACb,oBAAoB;iBACP,MAAM;IAEnB,iCAAiC;oBACjB,MAAM;kBACR,MAAM;oBACJ,MAAM;iBACT,MAAM;IAEnB,2BAA2B;oBACX,MAAM;IAEtB,mCAAmC;iBACtB,MAAM;IAEnB,sBAAsB;sBACJ,MAAM;IAExB,2BAA2B;oBACX,MAAM,QAAQ,MAAM;IAEpC,sBAAsB;;IAGtB,wCAAwC;oBACxB,MAAM,SAAS,MAAM;IAGrC,yCAAyC;mBAC1B,MAAM,UAAU,MAAM;IAGrC,2CAA2C;wBACvB,MAAM;IAE1B,yBAAyB;qBACR,MAAM;IAEvB,8BAA8B;mBACf,MAAM,UAAU,MAAM;IAErC,oBAAoB;iBACP,MAAM;IAEnB,yBAAyB;oBACT,MAAM;IAEtB,6CAA6C;;CAE7C,CAAC"}
|
package/dist/styles.js
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Composite style formatters — the `s` object.
|
|
3
|
+
*
|
|
4
|
+
* These produce multi-element styled strings (icon + text, key: value, etc.).
|
|
5
|
+
* Merged from gen/lib/styles.ts + core/ui/styles.ts.
|
|
6
|
+
*/
|
|
7
|
+
import chalk from "chalk";
|
|
8
|
+
import { md } from "./md.js";
|
|
9
|
+
export const s = {
|
|
10
|
+
/** Dim hint text */
|
|
11
|
+
hint: (text) => chalk.gray(text),
|
|
12
|
+
/** Status messages with icons */
|
|
13
|
+
success: (text) => chalk.green(`\u2714 ${text}`),
|
|
14
|
+
error: (text) => chalk.red(`\u2718 ${text}`),
|
|
15
|
+
warning: (text) => chalk.yellow(`\u26a0 ${text}`),
|
|
16
|
+
info: (text) => chalk.blue(`\u2139 ${text}`),
|
|
17
|
+
/** Bold section heading */
|
|
18
|
+
section: (text) => chalk.bold.cyan(text),
|
|
19
|
+
/** Inline code (gray backticks) */
|
|
20
|
+
code: (text) => chalk.gray(`\`${text}\``),
|
|
21
|
+
/** Emphasized text */
|
|
22
|
+
highlight: (text) => chalk.cyan.bold(text),
|
|
23
|
+
/** "Prefix: text" title */
|
|
24
|
+
title: (prefix, text) => chalk.bold.cyan(`${prefix}: ${text}`),
|
|
25
|
+
/** Horizontal rule */
|
|
26
|
+
hr: () => chalk.gray("\u2500".repeat(60)),
|
|
27
|
+
/** "key: value" with optional indent */
|
|
28
|
+
keyValue: (key, value, indent = 0) => `${" ".repeat(indent)}${chalk.cyan(`${key}:`)} ${value}`,
|
|
29
|
+
/** Section header with optional count */
|
|
30
|
+
header: (text, count) => chalk.bold.yellow(count !== undefined ? `${text} (${count})` : text),
|
|
31
|
+
/** Dim description with optional indent */
|
|
32
|
+
description: (text, indent = 0) => " ".repeat(indent) + chalk.gray(text),
|
|
33
|
+
/** Bulleted list item */
|
|
34
|
+
listItem: (text) => chalk.white(` \u2022 ${text}`),
|
|
35
|
+
/** Indent text by N spaces */
|
|
36
|
+
indent: (text, spaces) => " ".repeat(spaces) + text,
|
|
37
|
+
/** Dim file path */
|
|
38
|
+
path: (text) => chalk.gray(text),
|
|
39
|
+
/** Dim version string */
|
|
40
|
+
version: (text) => chalk.gray(text),
|
|
41
|
+
/** Inline markdown → styled terminal text */
|
|
42
|
+
md,
|
|
43
|
+
};
|
|
44
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../src/styles.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC;AAE7B,MAAM,CAAC,MAAM,CAAC,GAAG;IAChB,oBAAoB;IACpB,IAAI,EAAE,CAAC,IAAY,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC;IAExC,iCAAiC;IACjC,OAAO,EAAE,CAAC,IAAY,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,UAAU,IAAI,EAAE,CAAC;IACxD,KAAK,EAAE,CAAC,IAAY,EAAE,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,UAAU,IAAI,EAAE,CAAC;IACpD,OAAO,EAAE,CAAC,IAAY,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,UAAU,IAAI,EAAE,CAAC;IACzD,IAAI,EAAE,CAAC,IAAY,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,UAAU,IAAI,EAAE,CAAC;IAEpD,2BAA2B;IAC3B,OAAO,E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K,CAAC,KAAK,CAAC,YAAY,IAAI,EAAE,CAAC;IAE3D,8BAA8B;IAC9B,MAAM,EAAE,CAAC,IAAY,EAAE,MAAc,EAAE,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,IAAI;IAEnE,oBAAoB;IACpB,IAAI,EAAE,CAAC,IAAY,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC;IAExC,yBAAyB;IACzB,OAAO,EAAE,CAAC,IAAY,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC;IAE3C,6CAA6C;IAC7C,EAAE;CACF,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Unicode glyphs for CLI output.
|
|
3
|
+
*
|
|
4
|
+
* Consolidated from core/ui/symbols.ts and gen's inline usage.
|
|
5
|
+
*/
|
|
6
|
+
export declare const symbols: {
|
|
7
|
+
readonly error: "×";
|
|
8
|
+
readonly warning: "▲";
|
|
9
|
+
readonly success: "✔";
|
|
10
|
+
readonly info: "●";
|
|
11
|
+
readonly tip: "◆";
|
|
12
|
+
readonly bar: "│";
|
|
13
|
+
readonly bullet: "•";
|
|
14
|
+
readonly dash: "─";
|
|
15
|
+
readonly arrow: "▸";
|
|
16
|
+
readonly arrowFilled: "▶︎";
|
|
17
|
+
readonly arrowThin: "▹";
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=symbols.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"symbols.d.ts","sourceRoot":"","sources":["../src/symbols.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,eAAO,MAAM,OAAO;;;;;;;;;;;;CAeV,CAAC"}
|
package/dist/symbols.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Unicode glyphs for CLI output.
|
|
3
|
+
*
|
|
4
|
+
* Consolidated from core/ui/symbols.ts and gen's inline usage.
|
|
5
|
+
*/
|
|
6
|
+
export const symbols = {
|
|
7
|
+
// Status indicators
|
|
8
|
+
error: "\u00d7", // ×
|
|
9
|
+
warning: "\u25b2", // ▲
|
|
10
|
+
success: "\u2714", // ✔
|
|
11
|
+
info: "\u25cf", // ●
|
|
12
|
+
tip: "\u25c6", // ◆
|
|
13
|
+
// Structural
|
|
14
|
+
bar: "\u2502", // │
|
|
15
|
+
bullet: "\u2022", // •
|
|
16
|
+
dash: "\u2500", // ─
|
|
17
|
+
arrow: "\u25b8", // ▸
|
|
18
|
+
arrowFilled: "\u25b6\ufe0e", // ▶︎
|
|
19
|
+
arrowThin: "\u25b9", // ▹
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=symbols.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"symbols.js","sourceRoot":"","sources":["../src/symbols.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG;IACtB,oBAAoB;IACpB,KAAK,EAAE,QAAQ,EAAE,IAAI;IACrB,OAAO,EAAE,QAAQ,EAAE,IAAI;IACvB,OAAO,EAAE,QAAQ,EAAE,IAAI;IACvB,IAAI,EAAE,QAAQ,EAAE,IAAI;IACpB,GAAG,EAAE,QAAQ,EAAE,IAAI;IAEnB,aAAa;IACb,GAAG,EAAE,QAAQ,EAAE,IAAI;IACnB,MAAM,EAAE,QAAQ,EAAE,IAAI;IACtB,IAAI,EAAE,QAAQ,EAAE,IAAI;IACpB,KAAK,EAAE,QAAQ,EAAE,IAAI;IACrB,WAAW,EAAE,cAAc,EAAE,KAAK;IAClC,SAAS,EAAE,QAAQ,EAAE,IAAI;CAChB,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Output Comparison Utilities
|
|
3
|
+
*
|
|
4
|
+
* Compare rendered outputs ignoring ANSI codes, reporting visual differences.
|
|
5
|
+
*/
|
|
6
|
+
/** Result of comparing two rendered outputs. */
|
|
7
|
+
export type ComparisonResult = {
|
|
8
|
+
/** Whether the outputs are visually identical (ignoring ANSI codes). */
|
|
9
|
+
equal: boolean;
|
|
10
|
+
/** Line-by-line differences found between the outputs. */
|
|
11
|
+
differences: Array<{
|
|
12
|
+
/** 1-indexed line number where the difference occurs. */
|
|
13
|
+
line: number;
|
|
14
|
+
/** Expected line content (ANSI stripped). */
|
|
15
|
+
expected: string;
|
|
16
|
+
/** Actual line content (ANSI stripped). */
|
|
17
|
+
actual: string;
|
|
18
|
+
}>;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Compares two styled outputs by stripping ANSI codes and diffing line-by-line.
|
|
22
|
+
*
|
|
23
|
+
* @param actual - The actual rendered output.
|
|
24
|
+
* @param expected - The expected rendered output.
|
|
25
|
+
* @returns A {@link ComparisonResult} with equality flag and detailed differences.
|
|
26
|
+
*/
|
|
27
|
+
export declare function compareOutput(actual: string, expected: string): ComparisonResult;
|
|
28
|
+
//# sourceMappingURL=compare.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compare.d.ts","sourceRoot":"","sources":["../../src/test/compare.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,gDAAgD;AAChD,MAAM,MAAM,gBAAgB,GAAG;IAC9B,wEAAwE;IACxE,KAAK,EAAE,OAAO,CAAC;IACf,0DAA0D;IAC1D,WAAW,EAAE,KAAK,CAAC;QAClB,yDAAyD;QACzD,IAAI,EAAE,MAAM,CAAC;QACb,6CAA6C;QAC7C,QAAQ,EAAE,MAAM,CAAC;QACjB,2CAA2C;QAC3C,MAAM,EAAE,MAAM,CAAC;KACf,CAAC,CAAC;CACH,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,gBAAgB,CA2BhF"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Output Comparison Utilities
|
|
3
|
+
*
|
|
4
|
+
* Compare rendered outputs ignoring ANSI codes, reporting visual differences.
|
|
5
|
+
*/
|
|
6
|
+
import { stripAnsi } from "../render/index.js";
|
|
7
|
+
/**
|
|
8
|
+
* Compares two styled outputs by stripping ANSI codes and diffing line-by-line.
|
|
9
|
+
*
|
|
10
|
+
* @param actual - The actual rendered output.
|
|
11
|
+
* @param expected - The expected rendered output.
|
|
12
|
+
* @returns A {@link ComparisonResult} with equality flag and detailed differences.
|
|
13
|
+
*/
|
|
14
|
+
export function compareOutput(actual, expected) {
|
|
15
|
+
const actualPlain = stripAnsi(actual);
|
|
16
|
+
const expectedPlain = stripAnsi(expected);
|
|
17
|
+
const actualLines = actualPlain.split("\n");
|
|
18
|
+
const expectedLines = expectedPlain.split("\n");
|
|
19
|
+
const maxLines = Math.max(actualLines.length, expectedLines.length);
|
|
20
|
+
const differences = [];
|
|
21
|
+
for (let i = 0; i < maxLines; i++) {
|
|
22
|
+
const actualLine = actualLines[i] ?? "";
|
|
23
|
+
const expectedLine = expectedLines[i] ?? "";
|
|
24
|
+
if (actualLine !== expectedLine) {
|
|
25
|
+
differences.push({
|
|
26
|
+
line: i + 1,
|
|
27
|
+
expected: expectedLine,
|
|
28
|
+
actual: actualLine,
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return {
|
|
33
|
+
equal: differences.length === 0,
|
|
34
|
+
differences,
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=compare.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compare.js","sourceRoot":"","sources":["../../src/test/compare.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAiB/C;;;;;;GAMG;AACH,MAAM,UAAU,aAAa,CAAC,MAAc,EAAE,QAAgB;IAC7D,MAAM,WAAW,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC;IACtC,MAAM,aAAa,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC;IAE1C,MAAM,WAAW,GAAG,WAAW,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC5C,MAAM,aAAa,GAAG,aAAa,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAEhD,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC,MAAM,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IACpE,MAAM,WAAW,GAAoC,EAAE,CAAC;IAExD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,EAAE,CAAC,EAAE,EAAE,CAAC;QACnC,MAAM,UAAU,GAAG,WAAW,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;QACxC,MAAM,YAAY,GAAG,aAAa,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;QAE5C,IAAI,UAAU,KAAK,YAAY,EAAE,CAAC;YACjC,WAAW,CAAC,IAAI,CAAC;gBAChB,IAAI,EAAE,CAAC,GAAG,CAAC;gBACX,QAAQ,EAAE,YAAY;gBACtB,MAAM,EAAE,UAAU;aAClB,CAAC,CAAC;QACJ,CAAC;IACF,CAAC;IAED,OAAO;QACN,KAAK,EAAE,WAAW,CAAC,MAAM,KAAK,CAAC;QAC/B,WAAW;KACX,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Test Utilities — Barrel Export
|
|
3
|
+
*
|
|
4
|
+
* Testing helpers for consumers of the CLI Design System.
|
|
5
|
+
* Exported as `cli-ds/test`.
|
|
6
|
+
*/
|
|
7
|
+
export { render } from "./render.ts";
|
|
8
|
+
export type { RenderedOutput } from "./render.ts";
|
|
9
|
+
export { mockCapabilities, mockTheme, setupTestContext } from "./mock.ts";
|
|
10
|
+
export type { CapabilityPreset } from "./mock.ts";
|
|
11
|
+
export { snapshot } from "./snapshot.ts";
|
|
12
|
+
export { compareOutput } from "./compare.ts";
|
|
13
|
+
export type { ComparisonResult } from "./compare.ts";
|
|
14
|
+
export { stripAnsi } from "../render/index.ts";
|
|
15
|
+
export { stringWidth } from "../render/index.ts";
|
|
16
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/test/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,YAAY,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC1E,YAAY,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAElD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,YAAY,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAGrD,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Test Utilities — Barrel Export
|
|
3
|
+
*
|
|
4
|
+
* Testing helpers for consumers of the CLI Design System.
|
|
5
|
+
* Exported as `cli-ds/test`.
|
|
6
|
+
*/
|
|
7
|
+
export { render } from "./render.js";
|
|
8
|
+
export { mockCapabilities, mockTheme, setupTestContext } from "./mock.js";
|
|
9
|
+
export { snapshot } from "./snapshot.js";
|
|
10
|
+
export { compareOutput } from "./compare.js";
|
|
11
|
+
// Re-export commonly used utilities
|
|
12
|
+
export { stripAnsi } from "../render/index.js";
|
|
13
|
+
export { stringWidth } from "../render/index.js";
|
|
14
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/test/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAGrC,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAG1E,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAG7C,oCAAoC;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Test Mocking Utilities
|
|
3
|
+
*
|
|
4
|
+
* Helpers for creating mock capabilities, themes, and test contexts.
|
|
5
|
+
*/
|
|
6
|
+
import type { TerminalCapabilities } from "../capabilities/index.ts";
|
|
7
|
+
import type { Theme, ThemeInput } from "../theme/index.ts";
|
|
8
|
+
/**
|
|
9
|
+
* Predefined terminal capability presets for testing.
|
|
10
|
+
* - `'full'` — truecolor, unicode, TTY, 120 columns
|
|
11
|
+
* - `'ansi256'` — 256-color, unicode, TTY
|
|
12
|
+
* - `'ansi16'` — 16-color, unicode, TTY
|
|
13
|
+
* - `'nocolor'` — color disabled (NO_COLOR), unicode, TTY
|
|
14
|
+
* - `'dumb'` — no color, no unicode, TERM=dumb
|
|
15
|
+
* - `'ascii'` — 16-color, no unicode, TTY
|
|
16
|
+
* - `'ci'` — 16-color, unicode, non-TTY CI environment
|
|
17
|
+
*/
|
|
18
|
+
export type CapabilityPreset = "full" | "ansi256" | "ansi16" | "nocolor" | "dumb" | "ascii" | "ci";
|
|
19
|
+
/**
|
|
20
|
+
* Creates a mock {@link TerminalCapabilities} object for testing at a specific tier.
|
|
21
|
+
*
|
|
22
|
+
* @param preset - A named capability preset, or omit for bare defaults.
|
|
23
|
+
* @param overrides - Additional overrides merged on top of the preset.
|
|
24
|
+
* @returns A frozen capabilities object.
|
|
25
|
+
*/
|
|
26
|
+
export declare function mockCapabilities(preset?: CapabilityPreset, overrides?: Partial<TerminalCapabilities>): TerminalCapabilities;
|
|
27
|
+
/**
|
|
28
|
+
* Creates a mock theme for testing with sensible defaults.
|
|
29
|
+
*
|
|
30
|
+
* @param overrides - Partial theme properties to set.
|
|
31
|
+
* @returns A theme object with a default name of `'test-theme'`.
|
|
32
|
+
*/
|
|
33
|
+
export declare function mockTheme(overrides: Partial<Theme>): Theme;
|
|
34
|
+
/**
|
|
35
|
+
* Sets up a global test context with the given capabilities and theme.
|
|
36
|
+
* Returns a cleanup function that resets the context to defaults.
|
|
37
|
+
*
|
|
38
|
+
* @param preset - Capability preset to use.
|
|
39
|
+
* @param themeInput - Optional theme configuration.
|
|
40
|
+
* @returns A cleanup function that restores the default context.
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```ts
|
|
44
|
+
* const cleanup = setupTestContext('full')
|
|
45
|
+
* // ... run tests ...
|
|
46
|
+
* cleanup()
|
|
47
|
+
* ```
|
|
48
|
+
*/
|
|
49
|
+
export declare function setupTestContext(preset?: CapabilityPreset, themeInput?: ThemeInput): () => void;
|
|
50
|
+
//# sourceMappingURL=mock.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mock.d.ts","sourceRoot":"","sources":["../../src/test/mock.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAc,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAIjF,OAAO,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE3D;;;;;;;;;GASG;AACH,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,SAAS,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC;AAkFnG;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAC/B,MAAM,CAAC,EAAE,gBAAgB,EACzB,SAAS,CAAC,EAAE,OAAO,CAAC,oBAAoB,CAAC,GACvC,oBAAoB,CAGtB;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,SAAS,EAAE,OAAO,CAAC,KAAK,CAAC,GAAG,KAAK,CAK1D;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,CAAC,EAAE,gBAAgB,EAAE,UAAU,CAAC,EAAE,UAAU,GAAG,MAAM,IAAI,CAU/F"}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Test Mocking Utilities
|
|
3
|
+
*
|
|
4
|
+
* Helpers for creating mock capabilities, themes, and test contexts.
|
|
5
|
+
*/
|
|
6
|
+
import { createCapabilities } from "../capabilities/index.js";
|
|
7
|
+
import { createContext, setContext } from "../primitives/index.js";
|
|
8
|
+
const PRESETS = {
|
|
9
|
+
full: {
|
|
10
|
+
colorDepth: "truecolor",
|
|
11
|
+
unicode: true,
|
|
12
|
+
isTTY: true,
|
|
13
|
+
isStderrTTY: true,
|
|
14
|
+
isCI: false,
|
|
15
|
+
isDumb: false,
|
|
16
|
+
noColor: false,
|
|
17
|
+
forceColor: false,
|
|
18
|
+
columns: 120,
|
|
19
|
+
},
|
|
20
|
+
ansi256: {
|
|
21
|
+
colorDepth: "256",
|
|
22
|
+
unicode: true,
|
|
23
|
+
isTTY: true,
|
|
24
|
+
isStderrTTY: true,
|
|
25
|
+
isCI: false,
|
|
26
|
+
isDumb: false,
|
|
27
|
+
noColor: false,
|
|
28
|
+
forceColor: false,
|
|
29
|
+
columns: 80,
|
|
30
|
+
},
|
|
31
|
+
ansi16: {
|
|
32
|
+
colorDepth: "16",
|
|
33
|
+
unicode: true,
|
|
34
|
+
isTTY: true,
|
|
35
|
+
isStderrTTY: true,
|
|
36
|
+
isCI: false,
|
|
37
|
+
isDumb: false,
|
|
38
|
+
noColor: false,
|
|
39
|
+
forceColor: false,
|
|
40
|
+
columns: 80,
|
|
41
|
+
},
|
|
42
|
+
nocolor: {
|
|
43
|
+
colorDepth: "none",
|
|
44
|
+
unicode: true,
|
|
45
|
+
isTTY: true,
|
|
46
|
+
isStderrTTY: true,
|
|
47
|
+
isCI: false,
|
|
48
|
+
isDumb: false,
|
|
49
|
+
noColor: true,
|
|
50
|
+
forceColor: false,
|
|
51
|
+
columns: 80,
|
|
52
|
+
},
|
|
53
|
+
dumb: {
|
|
54
|
+
colorDepth: "none",
|
|
55
|
+
unicode: false,
|
|
56
|
+
isTTY: true,
|
|
57
|
+
isStderrTTY: true,
|
|
58
|
+
isCI: false,
|
|
59
|
+
isDumb: true,
|
|
60
|
+
noColor: false,
|
|
61
|
+
forceColor: false,
|
|
62
|
+
columns: 80,
|
|
63
|
+
},
|
|
64
|
+
ascii: {
|
|
65
|
+
colorDepth: "16",
|
|
66
|
+
unicode: false,
|
|
67
|
+
isTTY: true,
|
|
68
|
+
isStderrTTY: true,
|
|
69
|
+
isCI: false,
|
|
70
|
+
isDumb: false,
|
|
71
|
+
noColor: false,
|
|
72
|
+
forceColor: false,
|
|
73
|
+
columns: 80,
|
|
74
|
+
},
|
|
75
|
+
ci: {
|
|
76
|
+
colorDepth: "16",
|
|
77
|
+
unicode: true,
|
|
78
|
+
isTTY: false,
|
|
79
|
+
isStderrTTY: false,
|
|
80
|
+
isCI: true,
|
|
81
|
+
isDumb: false,
|
|
82
|
+
noColor: false,
|
|
83
|
+
forceColor: false,
|
|
84
|
+
columns: 80,
|
|
85
|
+
},
|
|
86
|
+
};
|
|
87
|
+
/**
|
|
88
|
+
* Creates a mock {@link TerminalCapabilities} object for testing at a specific tier.
|
|
89
|
+
*
|
|
90
|
+
* @param preset - A named capability preset, or omit for bare defaults.
|
|
91
|
+
* @param overrides - Additional overrides merged on top of the preset.
|
|
92
|
+
* @returns A frozen capabilities object.
|
|
93
|
+
*/
|
|
94
|
+
export function mockCapabilities(preset, overrides) {
|
|
95
|
+
const base = preset ? PRESETS[preset] : {};
|
|
96
|
+
return createCapabilities({ ...base, ...overrides });
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Creates a mock theme for testing with sensible defaults.
|
|
100
|
+
*
|
|
101
|
+
* @param overrides - Partial theme properties to set.
|
|
102
|
+
* @returns A theme object with a default name of `'test-theme'`.
|
|
103
|
+
*/
|
|
104
|
+
export function mockTheme(overrides) {
|
|
105
|
+
return {
|
|
106
|
+
name: overrides.name ?? "test-theme",
|
|
107
|
+
...overrides,
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Sets up a global test context with the given capabilities and theme.
|
|
112
|
+
* Returns a cleanup function that resets the context to defaults.
|
|
113
|
+
*
|
|
114
|
+
* @param preset - Capability preset to use.
|
|
115
|
+
* @param themeInput - Optional theme configuration.
|
|
116
|
+
* @returns A cleanup function that restores the default context.
|
|
117
|
+
*
|
|
118
|
+
* @example
|
|
119
|
+
* ```ts
|
|
120
|
+
* const cleanup = setupTestContext('full')
|
|
121
|
+
* // ... run tests ...
|
|
122
|
+
* cleanup()
|
|
123
|
+
* ```
|
|
124
|
+
*/
|
|
125
|
+
export function setupTestContext(preset, themeInput) {
|
|
126
|
+
const caps = mockCapabilities(preset);
|
|
127
|
+
const ctx = createContext(caps, themeInput);
|
|
128
|
+
setContext(ctx);
|
|
129
|
+
return () => {
|
|
130
|
+
// Reset to a default context
|
|
131
|
+
const defaultCtx = createContext();
|
|
132
|
+
setContext(defaultCtx);
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
//# sourceMappingURL=mock.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mock.js","sourceRoot":"","sources":["../../src/test/mock.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,M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AAC;IACxB,CAAC,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Test Rendering Utilities
|
|
3
|
+
*
|
|
4
|
+
* Captures rendered output and provides assertions for ANSI-styled strings.
|
|
5
|
+
*/
|
|
6
|
+
export type RenderedOutput = {
|
|
7
|
+
/** The raw string with ANSI codes */
|
|
8
|
+
readonly styled: string;
|
|
9
|
+
/** Plain text with all ANSI codes stripped */
|
|
10
|
+
readonly plain: string;
|
|
11
|
+
/** Whether any color codes are present (not just typography) */
|
|
12
|
+
readonly hasColor: boolean;
|
|
13
|
+
/** Whether a specific SGR attribute is present */
|
|
14
|
+
hasStyle(attr: "bold" | "dim" | "italic" | "underline" | "strikethrough" | "inverse"): boolean;
|
|
15
|
+
/** Visual width of the first line */
|
|
16
|
+
readonly width: number;
|
|
17
|
+
/** Array of visual lines (split by \n, stripped of ANSI) */
|
|
18
|
+
readonly lines: string[];
|
|
19
|
+
/** Number of visual lines */
|
|
20
|
+
readonly lineCount: number;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Wraps a rendered string in a {@link RenderedOutput} object for inspection and assertions.
|
|
24
|
+
*
|
|
25
|
+
* @param output - The raw styled string to analyze.
|
|
26
|
+
* @returns A {@link RenderedOutput} object with plain text, color detection, and style queries.
|
|
27
|
+
*/
|
|
28
|
+
export declare function render(output: string): RenderedOutput;
|
|
29
|
+
//# sourceMappingURL=render.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../src/test/render.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,MAAM,MAAM,cAAc,GAAG;IAC5B,qCAAqC;IACrC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,8CAA8C;IAC9C,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,gEAAgE;IAChE,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,kDAAkD;IAClD,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,KAAK,GAAG,QAAQ,GAAG,WAAW,GAAG,eAAe,GAAG,SAAS,GAAG,OAAO,CAAC;IAC/F,qCAAqC;IACrC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,4DAA4D;IAC5D,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,CAAC;IACzB,6BAA6B;IAC7B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC3B,CAAC;AAwDF;;;;;GAKG;AACH,wBAAgB,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,cAAc,CAqBrD"}
|