@outfitter/cli 0.2.0 → 0.4.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.
Files changed (261) hide show
  1. package/README.md +47 -4
  2. package/dist/actions.js +0 -2
  3. package/dist/cli.d.ts +1 -1
  4. package/dist/cli.js +1 -2
  5. package/dist/{render → colors}/colors.d.ts +1 -1
  6. package/dist/{render → colors}/colors.js +2 -6
  7. package/dist/colors/index.d.ts +1 -1
  8. package/dist/colors/index.js +3 -4
  9. package/dist/command.d.ts +1 -1
  10. package/dist/command.js +1 -2
  11. package/dist/index.d.ts +3 -3
  12. package/dist/index.js +4 -5
  13. package/dist/input.d.ts +3 -26
  14. package/dist/input.js +1 -31
  15. package/dist/output.d.ts +3 -3
  16. package/dist/output.js +4 -3
  17. package/dist/pagination.d.ts +1 -1
  18. package/dist/pagination.js +0 -2
  19. package/dist/shared/@outfitter/{cli-ttt7r0j7.d.ts → cli-02kyvj7h.d.ts} +2 -13
  20. package/dist/shared/@outfitter/{cli-8gg0hck1.js → cli-7wp5nj0s.js} +16 -12
  21. package/dist/shared/@outfitter/{cli-72kg550t.d.ts → cli-f79bwzsp.d.ts} +30 -2
  22. package/dist/shared/@outfitter/{cli-d9ad0rqj.js → cli-jbj78ac5.js} +1 -6
  23. package/dist/shared/@outfitter/{cli-5g6rkv3d.js → cli-rk9zagkm.js} +24 -32
  24. package/dist/shared/@outfitter/{cli-efy6jfcj.js → cli-zahqsaby.js} +33 -10
  25. package/dist/terminal/detection.js +1 -5
  26. package/dist/terminal/index.js +1 -6
  27. package/dist/{shared/@outfitter/cli-4cb5g831.d.ts → text.d.ts} +1 -1
  28. package/dist/{shared/@outfitter/cli-mwxsh3sr.js → text.js} +15 -14
  29. package/dist/types.d.ts +2 -2
  30. package/dist/types.js +0 -2
  31. package/package.json +35 -213
  32. package/dist/borders/index.d.ts +0 -3
  33. package/dist/borders/index.js +0 -13
  34. package/dist/box/index.d.ts +0 -4
  35. package/dist/box/index.js +0 -13
  36. package/dist/demo/index.d.ts +0 -78
  37. package/dist/demo/index.js +0 -148
  38. package/dist/demo/registry.d.ts +0 -7
  39. package/dist/demo/registry.js +0 -28
  40. package/dist/demo/renderers/borders.d.ts +0 -7
  41. package/dist/demo/renderers/borders.js +0 -17
  42. package/dist/demo/renderers/box.d.ts +0 -7
  43. package/dist/demo/renderers/box.js +0 -18
  44. package/dist/demo/renderers/colors.d.ts +0 -7
  45. package/dist/demo/renderers/colors.js +0 -18
  46. package/dist/demo/renderers/indicators.d.ts +0 -7
  47. package/dist/demo/renderers/indicators.js +0 -17
  48. package/dist/demo/renderers/list.d.ts +0 -7
  49. package/dist/demo/renderers/list.js +0 -19
  50. package/dist/demo/renderers/markdown.d.ts +0 -7
  51. package/dist/demo/renderers/markdown.js +0 -18
  52. package/dist/demo/renderers/progress.d.ts +0 -7
  53. package/dist/demo/renderers/progress.js +0 -17
  54. package/dist/demo/renderers/spinner.d.ts +0 -7
  55. package/dist/demo/renderers/spinner.js +0 -19
  56. package/dist/demo/renderers/table.d.ts +0 -7
  57. package/dist/demo/renderers/table.js +0 -19
  58. package/dist/demo/renderers/text.d.ts +0 -7
  59. package/dist/demo/renderers/text.js +0 -16
  60. package/dist/demo/renderers/tree.d.ts +0 -7
  61. package/dist/demo/renderers/tree.js +0 -18
  62. package/dist/demo/section.d.ts +0 -5
  63. package/dist/demo/section.js +0 -23
  64. package/dist/demo/templates.d.ts +0 -4
  65. package/dist/demo/templates.js +0 -10
  66. package/dist/demo/types.d.ts +0 -3
  67. package/dist/demo/types.js +0 -8
  68. package/dist/list/index.d.ts +0 -3
  69. package/dist/list/index.js +0 -9
  70. package/dist/preset/full.d.ts +0 -14
  71. package/dist/preset/full.js +0 -41
  72. package/dist/preset/standard.d.ts +0 -11
  73. package/dist/preset/standard.js +0 -30
  74. package/dist/prompt/confirm.d.ts +0 -4
  75. package/dist/prompt/confirm.js +0 -9
  76. package/dist/prompt/group.d.ts +0 -4
  77. package/dist/prompt/group.js +0 -9
  78. package/dist/prompt/index.d.ts +0 -7
  79. package/dist/prompt/index.js +0 -32
  80. package/dist/prompt/select.d.ts +0 -4
  81. package/dist/prompt/select.js +0 -11
  82. package/dist/prompt/text.d.ts +0 -4
  83. package/dist/prompt/text.js +0 -11
  84. package/dist/prompt/types.d.ts +0 -3
  85. package/dist/prompt/types.js +0 -8
  86. package/dist/prompt/validators.d.ts +0 -2
  87. package/dist/prompt/validators.js +0 -8
  88. package/dist/render/borders.d.ts +0 -2
  89. package/dist/render/borders.js +0 -15
  90. package/dist/render/box.d.ts +0 -3
  91. package/dist/render/box.js +0 -23
  92. package/dist/render/date.d.ts +0 -2
  93. package/dist/render/date.js +0 -12
  94. package/dist/render/format-relative.d.ts +0 -2
  95. package/dist/render/format-relative.js +0 -8
  96. package/dist/render/format.d.ts +0 -2
  97. package/dist/render/format.js +0 -10
  98. package/dist/render/heading.d.ts +0 -3
  99. package/dist/render/heading.js +0 -14
  100. package/dist/render/index.d.ts +0 -32
  101. package/dist/render/index.js +0 -235
  102. package/dist/render/indicators.d.ts +0 -2
  103. package/dist/render/indicators.js +0 -16
  104. package/dist/render/json.d.ts +0 -2
  105. package/dist/render/json.js +0 -10
  106. package/dist/render/layout.d.ts +0 -5
  107. package/dist/render/layout.js +0 -25
  108. package/dist/render/list.d.ts +0 -2
  109. package/dist/render/list.js +0 -8
  110. package/dist/render/markdown.d.ts +0 -2
  111. package/dist/render/markdown.js +0 -10
  112. package/dist/render/progress.d.ts +0 -2
  113. package/dist/render/progress.js +0 -8
  114. package/dist/render/separator.d.ts +0 -3
  115. package/dist/render/separator.js +0 -14
  116. package/dist/render/shapes.d.ts +0 -2
  117. package/dist/render/shapes.js +0 -35
  118. package/dist/render/spinner.d.ts +0 -2
  119. package/dist/render/spinner.js +0 -12
  120. package/dist/render/stack.d.ts +0 -3
  121. package/dist/render/stack.js +0 -38
  122. package/dist/render/table.d.ts +0 -3
  123. package/dist/render/table.js +0 -12
  124. package/dist/render/text.d.ts +0 -2
  125. package/dist/render/text.js +0 -27
  126. package/dist/render/tree.d.ts +0 -2
  127. package/dist/render/tree.js +0 -10
  128. package/dist/render/types.d.ts +0 -2
  129. package/dist/shared/@outfitter/cli-0djg8q91.js +0 -7
  130. package/dist/shared/@outfitter/cli-0w242qtv.d.ts +0 -48
  131. package/dist/shared/@outfitter/cli-1g8tt31a.d.ts +0 -119
  132. package/dist/shared/@outfitter/cli-1kwbnt86.d.ts +0 -45
  133. package/dist/shared/@outfitter/cli-1sb3xvnw.js +0 -95
  134. package/dist/shared/@outfitter/cli-1vy0vtga.js +0 -135
  135. package/dist/shared/@outfitter/cli-2g8bx1aq.d.ts +0 -50
  136. package/dist/shared/@outfitter/cli-33e97cjs.d.ts +0 -42
  137. package/dist/shared/@outfitter/cli-3b7ed3rm.d.ts +0 -97
  138. package/dist/shared/@outfitter/cli-3hk2xf3c.js +0 -82
  139. package/dist/shared/@outfitter/cli-3hp8qwx3.js +0 -11
  140. package/dist/shared/@outfitter/cli-47yw5h6a.js +0 -7
  141. package/dist/shared/@outfitter/cli-4b6tbp68.d.ts +0 -36
  142. package/dist/shared/@outfitter/cli-4fcz51qa.js +0 -70
  143. package/dist/shared/@outfitter/cli-4x6pqnez.js +0 -20
  144. package/dist/shared/@outfitter/cli-4zk2y4a2.d.ts +0 -61
  145. package/dist/shared/@outfitter/cli-60b5xh1r.js +0 -20
  146. package/dist/shared/@outfitter/cli-6bztk73z.d.ts +0 -51
  147. package/dist/shared/@outfitter/cli-6fxffp8k.js +0 -1
  148. package/dist/shared/@outfitter/cli-6hg0sg2d.d.ts +0 -93
  149. package/dist/shared/@outfitter/cli-6r3m2knf.js +0 -62
  150. package/dist/shared/@outfitter/cli-6ty1nvws.js +0 -179
  151. package/dist/shared/@outfitter/cli-7n610r63.js +0 -20
  152. package/dist/shared/@outfitter/cli-7na6p4fs.d.ts +0 -59
  153. package/dist/shared/@outfitter/cli-83jwvj1t.d.ts +0 -17
  154. package/dist/shared/@outfitter/cli-85fg2vr5.js +0 -123
  155. package/dist/shared/@outfitter/cli-8bwaw3pz.js +0 -7
  156. package/dist/shared/@outfitter/cli-8hngbjyr.d.ts +0 -164
  157. package/dist/shared/@outfitter/cli-8j5k6mr3.js +0 -71
  158. package/dist/shared/@outfitter/cli-8xsmsbbd.d.ts +0 -223
  159. package/dist/shared/@outfitter/cli-914d47mt.js +0 -20
  160. package/dist/shared/@outfitter/cli-9bcm4zhf.d.ts +0 -87
  161. package/dist/shared/@outfitter/cli-9khk3cbq.d.ts +0 -190
  162. package/dist/shared/@outfitter/cli-a4q87517.d.ts +0 -64
  163. package/dist/shared/@outfitter/cli-aem6v4c8.js +0 -146
  164. package/dist/shared/@outfitter/cli-b0tzqgnf.d.ts +0 -132
  165. package/dist/shared/@outfitter/cli-b5c2k0d7.js +0 -39
  166. package/dist/shared/@outfitter/cli-b5epywry.js +0 -1
  167. package/dist/shared/@outfitter/cli-bc17qeh2.js +0 -19
  168. package/dist/shared/@outfitter/cli-bcmcaz1b.js +0 -23
  169. package/dist/shared/@outfitter/cli-bv09nme3.d.ts +0 -56
  170. package/dist/shared/@outfitter/cli-c6pbxpw0.d.ts +0 -112
  171. package/dist/shared/@outfitter/cli-c8fqdaes.js +0 -117
  172. package/dist/shared/@outfitter/cli-c8q4f71g.js +0 -144
  173. package/dist/shared/@outfitter/cli-c9knfqn5.d.ts +0 -30
  174. package/dist/shared/@outfitter/cli-cf1xexgn.d.ts +0 -53
  175. package/dist/shared/@outfitter/cli-cf2s94s1.d.ts +0 -42
  176. package/dist/shared/@outfitter/cli-cwgj6mcs.js +0 -214
  177. package/dist/shared/@outfitter/cli-d8ahdd9d.js +0 -272
  178. package/dist/shared/@outfitter/cli-dbyteh27.d.ts +0 -24
  179. package/dist/shared/@outfitter/cli-e5ms1y0x.d.ts +0 -91
  180. package/dist/shared/@outfitter/cli-en6zn6sj.js +0 -1
  181. package/dist/shared/@outfitter/cli-evx7qcp1.d.ts +0 -300
  182. package/dist/shared/@outfitter/cli-f6fsaayd.js +0 -94
  183. package/dist/shared/@outfitter/cli-fakncnjp.d.ts +0 -106
  184. package/dist/shared/@outfitter/cli-ffa0jwb7.js +0 -122
  185. package/dist/shared/@outfitter/cli-h20jc0bs.d.ts +0 -66
  186. package/dist/shared/@outfitter/cli-h3jz0bxz.js +0 -48
  187. package/dist/shared/@outfitter/cli-h4wpzb3f.js +0 -67
  188. package/dist/shared/@outfitter/cli-hda6mc28.js +0 -126
  189. package/dist/shared/@outfitter/cli-hnpbqmc8.d.ts +0 -328
  190. package/dist/shared/@outfitter/cli-j19a91ck.js +0 -30
  191. package/dist/shared/@outfitter/cli-jejfypgf.js +0 -85
  192. package/dist/shared/@outfitter/cli-jp0k3qd9.js +0 -279
  193. package/dist/shared/@outfitter/cli-k76e7173.js +0 -128
  194. package/dist/shared/@outfitter/cli-kc3ffp1v.d.ts +0 -23
  195. package/dist/shared/@outfitter/cli-kk5hnndk.d.ts +0 -128
  196. package/dist/shared/@outfitter/cli-ktqme80d.js +0 -7
  197. package/dist/shared/@outfitter/cli-mq0jp15z.js +0 -1
  198. package/dist/shared/@outfitter/cli-n0c33vba.js +0 -25
  199. package/dist/shared/@outfitter/cli-n17gt1dz.js +0 -19
  200. package/dist/shared/@outfitter/cli-n9dbh0hp.js +0 -51
  201. package/dist/shared/@outfitter/cli-ndem6tz8.js +0 -63
  202. package/dist/shared/@outfitter/cli-nj4nqy1h.d.ts +0 -24
  203. package/dist/shared/@outfitter/cli-nkns8p4r.js +0 -61
  204. package/dist/shared/@outfitter/cli-p3dqm1vd.js +0 -22
  205. package/dist/shared/@outfitter/cli-pndwprz8.js +0 -118
  206. package/dist/shared/@outfitter/cli-pvrwv6rb.js +0 -352
  207. package/dist/shared/@outfitter/cli-py02m79x.d.ts +0 -20
  208. package/dist/shared/@outfitter/cli-qj83y5wj.d.ts +0 -71
  209. package/dist/shared/@outfitter/cli-regjbef6.d.ts +0 -26
  210. package/dist/shared/@outfitter/cli-s1tx5kha.d.ts +0 -59
  211. package/dist/shared/@outfitter/cli-sam2sq50.js +0 -37
  212. package/dist/shared/@outfitter/cli-snxj55n6.js +0 -43
  213. package/dist/shared/@outfitter/cli-symyxb0z.js +0 -20
  214. package/dist/shared/@outfitter/cli-tvw1xrdj.js +0 -20
  215. package/dist/shared/@outfitter/cli-v1tzwxkt.js +0 -32
  216. package/dist/shared/@outfitter/cli-vd60dj65.js +0 -1
  217. package/dist/shared/@outfitter/cli-vfcrskfj.d.ts +0 -41
  218. package/dist/shared/@outfitter/cli-vstbkzky.d.ts +0 -74
  219. package/dist/shared/@outfitter/cli-vtg0sqk2.d.ts +0 -54
  220. package/dist/shared/@outfitter/cli-x4cavvc0.js +0 -1
  221. package/dist/shared/@outfitter/cli-xep6v2c0.js +0 -52
  222. package/dist/shared/@outfitter/cli-xg5y5fhk.js +0 -86
  223. package/dist/shared/@outfitter/cli-y7k1t81k.js +0 -30
  224. package/dist/shared/@outfitter/cli-yfyzy95c.js +0 -67
  225. package/dist/shared/@outfitter/cli-z78mkrc7.js +0 -59
  226. package/dist/shared/@outfitter/cli-znc47004.js +0 -134
  227. package/dist/shared/@outfitter/cli-zx598p8q.d.ts +0 -26
  228. package/dist/streaming/ansi.d.ts +0 -2
  229. package/dist/streaming/ansi.js +0 -8
  230. package/dist/streaming/index.d.ts +0 -4
  231. package/dist/streaming/index.js +0 -17
  232. package/dist/streaming/spinner.d.ts +0 -3
  233. package/dist/streaming/spinner.js +0 -10
  234. package/dist/streaming/writer.d.ts +0 -2
  235. package/dist/streaming/writer.js +0 -9
  236. package/dist/table/index.d.ts +0 -4
  237. package/dist/table/index.js +0 -13
  238. package/dist/theme/context.d.ts +0 -9
  239. package/dist/theme/context.js +0 -14
  240. package/dist/theme/create.d.ts +0 -8
  241. package/dist/theme/create.js +0 -12
  242. package/dist/theme/index.d.ts +0 -17
  243. package/dist/theme/index.js +0 -42
  244. package/dist/theme/presets/bold.d.ts +0 -8
  245. package/dist/theme/presets/bold.js +0 -12
  246. package/dist/theme/presets/default.d.ts +0 -8
  247. package/dist/theme/presets/default.js +0 -11
  248. package/dist/theme/presets/index.d.ts +0 -12
  249. package/dist/theme/presets/index.js +0 -24
  250. package/dist/theme/presets/minimal.d.ts +0 -8
  251. package/dist/theme/presets/minimal.js +0 -12
  252. package/dist/theme/presets/rounded.d.ts +0 -8
  253. package/dist/theme/presets/rounded.js +0 -12
  254. package/dist/theme/resolve.d.ts +0 -8
  255. package/dist/theme/resolve.js +0 -11
  256. package/dist/theme/types.d.ts +0 -7
  257. package/dist/theme/types.js +0 -1
  258. package/dist/tree/index.d.ts +0 -3
  259. package/dist/tree/index.js +0 -11
  260. /package/dist/shared/@outfitter/{cli-ykxn7rb2.d.ts → cli-xppg982q.d.ts} +0 -0
  261. /package/dist/{render/types.js → shared/@outfitter/cli-zw75pdk8.js} +0 -0
@@ -1,67 +0,0 @@
1
- // @bun
2
- import {
3
- createCancelledError
4
- } from "./cli-8bwaw3pz.js";
5
-
6
- // packages/cli/src/prompt/select.ts
7
- import { isCancel, multiselect, select } from "@clack/prompts";
8
- import { Result } from "better-result";
9
- async function promptSelect(options) {
10
- const clackOptions = options.options.map((opt) => {
11
- const mapped = {
12
- value: opt.value,
13
- label: opt.label
14
- };
15
- if (opt.hint !== undefined) {
16
- mapped.hint = opt.hint;
17
- }
18
- return mapped;
19
- });
20
- const selectOptions = {
21
- message: options.message,
22
- options: clackOptions
23
- };
24
- if (options.initialValue !== undefined) {
25
- selectOptions.initialValue = options.initialValue;
26
- }
27
- if (options.pageSize !== undefined) {
28
- selectOptions.maxItems = options.pageSize;
29
- }
30
- const result = await select(selectOptions);
31
- if (isCancel(result)) {
32
- return Result.err(createCancelledError());
33
- }
34
- return Result.ok(result);
35
- }
36
- async function promptMultiSelect(options) {
37
- const clackOptions = options.options.map((opt) => {
38
- const mapped = {
39
- value: opt.value,
40
- label: opt.label
41
- };
42
- if (opt.hint !== undefined) {
43
- mapped.hint = opt.hint;
44
- }
45
- return mapped;
46
- });
47
- const multiselectOptions = {
48
- message: options.message,
49
- options: clackOptions
50
- };
51
- if (options.initialValues !== undefined) {
52
- multiselectOptions.initialValues = options.initialValues;
53
- }
54
- if (options.required !== undefined) {
55
- multiselectOptions.required = options.required;
56
- }
57
- if (options.pageSize !== undefined) {
58
- multiselectOptions.maxItems = options.pageSize;
59
- }
60
- const result = await multiselect(multiselectOptions);
61
- if (isCancel(result)) {
62
- return Result.err(createCancelledError());
63
- }
64
- return Result.ok(result);
65
- }
66
-
67
- export { promptSelect, promptMultiSelect };
@@ -1,59 +0,0 @@
1
- // @bun
2
- import {
3
- BORDERS,
4
- init_borders
5
- } from "./cli-85fg2vr5.js";
6
- import {
7
- ANSI,
8
- init_colors
9
- } from "./cli-5g6rkv3d.js";
10
-
11
- // packages/cli/src/theme/presets/default.ts
12
- init_borders();
13
- init_colors();
14
- var defaultTheme = {
15
- name: "default",
16
- border: "single",
17
- borderChars: BORDERS.single,
18
- treeGuide: "single",
19
- delimiter: "bullet",
20
- markers: {
21
- default: { type: "indicator", category: "marker", name: "circleOutline" },
22
- current: { type: "indicator", category: "marker", name: "circleDot" },
23
- focused: { type: "indicator", category: "marker", name: "pointer" },
24
- checked: { type: "indicator", category: "marker", name: "checkboxChecked" },
25
- disabled: { type: "indicator", category: "marker", name: "dash" },
26
- success: { type: "indicator", category: "status", name: "success" },
27
- warning: { type: "indicator", category: "status", name: "warning" },
28
- error: { type: "indicator", category: "status", name: "error" },
29
- info: { type: "indicator", category: "status", name: "info" }
30
- },
31
- listBullet: { unicode: "\u2022", fallback: "-" },
32
- checkbox: {
33
- checked: { unicode: "\u2611", fallback: "[x]" },
34
- unchecked: { unicode: "\u2610", fallback: "[ ]" }
35
- },
36
- colors: {
37
- success: ANSI.green,
38
- warning: ANSI.yellow,
39
- error: ANSI.red,
40
- info: ANSI.blue,
41
- primary: "",
42
- secondary: ANSI.gray,
43
- muted: ANSI.dim,
44
- accent: ANSI.cyan,
45
- highlight: ANSI.bold,
46
- link: `${ANSI.cyan}${ANSI.underline}`,
47
- destructive: ANSI.brightRed,
48
- subtle: `${ANSI.dim}${ANSI.gray}`
49
- },
50
- spacing: {
51
- boxPadding: 1,
52
- listIndent: 2,
53
- stackGap: 0,
54
- horizontalGap: 1
55
- },
56
- spinner: "dots"
57
- };
58
-
59
- export { defaultTheme };
@@ -1,134 +0,0 @@
1
- // @bun
2
- import {
3
- getThemeMethodsByCategory
4
- } from "./cli-d8ahdd9d.js";
5
- import {
6
- getExample
7
- } from "./cli-xep6v2c0.js";
8
- import {
9
- demoSection
10
- } from "./cli-sam2sq50.js";
11
- import {
12
- ANSI,
13
- applyColor,
14
- createTokens,
15
- init_colors,
16
- resolveTokenColorEnabled
17
- } from "./cli-5g6rkv3d.js";
18
- import {
19
- hasNoColorEnv,
20
- init_detection,
21
- resolveForceColorEnv
22
- } from "./cli-d9ad0rqj.js";
23
-
24
- // packages/cli/src/demo/renderers/colors.ts
25
- init_colors();
26
- init_detection();
27
- function renderColorsDemo(config, theme) {
28
- const showCode = config.showCode ?? true;
29
- const tokens = createTokens();
30
- const colorEnabled = resolveTokenColorEnabled();
31
- const lines = [];
32
- lines.push(demoSection("Theme Colors (createTheme)", { case: "none" }));
33
- lines.push("");
34
- if (showCode) {
35
- lines.push('import { createTheme } from "@outfitter/cli/render";');
36
- lines.push("const theme = createTheme();");
37
- lines.push("");
38
- }
39
- const { semantic } = getThemeMethodsByCategory();
40
- for (const method of semantic) {
41
- const text = getExample(method, config.examples);
42
- const fn = theme[method];
43
- const output = fn(text);
44
- const code = `theme.${method}("${text}")`;
45
- lines.push(`${code.padEnd(42)} \u2192 ${output}`);
46
- }
47
- lines.push("");
48
- lines.push(demoSection("Utility Methods"));
49
- lines.push("");
50
- const { utility } = getThemeMethodsByCategory();
51
- for (const method of utility) {
52
- const text = getExample(method, config.examples);
53
- const fn = theme[method];
54
- const output = fn(text);
55
- const code = `theme.${method}("${text}")`;
56
- lines.push(`${code.padEnd(42)} \u2192 ${output}`);
57
- }
58
- lines.push("");
59
- lines.push(demoSection("Direct Colors (applyColor)", { case: "none" }));
60
- lines.push("");
61
- if (showCode) {
62
- lines.push('import { applyColor } from "@outfitter/cli/render";');
63
- lines.push("");
64
- }
65
- const colors = [
66
- "green",
67
- "yellow",
68
- "red",
69
- "blue",
70
- "cyan",
71
- "magenta",
72
- "gray"
73
- ];
74
- for (const color of colors) {
75
- const code = `applyColor("text", "${color}")`;
76
- const output = applyColor("text", color);
77
- lines.push(`${code.padEnd(32)} \u2192 ${output}`);
78
- }
79
- lines.push("");
80
- lines.push(demoSection("Raw Tokens (createTokens)", { case: "none" }));
81
- lines.push("");
82
- if (showCode) {
83
- lines.push('import { createTokens, ANSI } from "@outfitter/cli/render";');
84
- lines.push("const t = createTokens();");
85
- lines.push("");
86
- }
87
- const d = "$";
88
- const tokenExamples = [
89
- {
90
- code: `\`${d}{t.success}Done${d}{ANSI.reset}\``,
91
- token: tokens.success,
92
- text: "Done"
93
- },
94
- {
95
- code: `\`${d}{t.error}Fail${d}{ANSI.reset}\``,
96
- token: tokens.error,
97
- text: "Fail"
98
- },
99
- {
100
- code: `\`${d}{t.warning}Warn${d}{ANSI.reset}\``,
101
- token: tokens.warning,
102
- text: "Warn"
103
- },
104
- {
105
- code: `\`${d}{t.info}Info${d}{ANSI.reset}\``,
106
- token: tokens.info,
107
- text: "Info"
108
- }
109
- ];
110
- for (const example of tokenExamples) {
111
- const reset = example.token ? ANSI.reset : "";
112
- const output = `${example.token}${example.text}${reset}`;
113
- lines.push(`${example.code.padEnd(36)} \u2192 ${output}`);
114
- }
115
- lines.push("");
116
- lines.push(demoSection("Environment"));
117
- const noColor = hasNoColorEnv();
118
- const forceColor = resolveForceColorEnv();
119
- let forceColorDisplay;
120
- if (forceColor === true) {
121
- forceColorDisplay = theme.success("enabled");
122
- } else if (forceColor === false) {
123
- forceColorDisplay = theme.error("disabled");
124
- } else {
125
- forceColorDisplay = theme.muted("not set");
126
- }
127
- lines.push(`Colors: ${colorEnabled ? theme.success("enabled") : theme.muted("disabled")} ${theme.muted(colorEnabled ? "(TTY detected)" : "(non-TTY or NO_COLOR set)")}`);
128
- lines.push(`NO_COLOR: ${noColor ? theme.warning("set") : theme.muted("not set")}`);
129
- lines.push(`FORCE_COLOR: ${forceColorDisplay}`);
130
- return lines.join(`
131
- `);
132
- }
133
-
134
- export { renderColorsDemo };
@@ -1,26 +0,0 @@
1
- /**
2
- * Date and time formatting utilities.
3
- *
4
- * Provides human-friendly relative time formatting.
5
- *
6
- * @packageDocumentation
7
- */
8
- /**
9
- * Formats a date as a human-friendly relative time string.
10
- *
11
- * Converts timestamps to natural language like "just now", "5 minutes ago",
12
- * "yesterday", or "in 3 hours". Handles both past and future dates.
13
- *
14
- * @param date - Date to format (Date object, timestamp number, or ISO string)
15
- * @returns Human-friendly relative time string
16
- *
17
- * @example
18
- * ```typescript
19
- * formatRelative(new Date()) // "just now"
20
- * formatRelative(Date.now() - 30000) // "30 seconds ago"
21
- * formatRelative(Date.now() - 3600000) // "1 hour ago"
22
- * formatRelative(Date.now() + 300000) // "in 5 minutes"
23
- * ```
24
- */
25
- declare function formatRelative(date: Date | number | string): string;
26
- export { formatRelative };
@@ -1,2 +0,0 @@
1
- import { ANSI } from "../shared/@outfitter/cli-vtg0sqk2";
2
- export { ANSI };
@@ -1,8 +0,0 @@
1
- // @bun
2
- import {
3
- ANSI
4
- } from "../shared/@outfitter/cli-p3dqm1vd.js";
5
- import"../shared/@outfitter/cli-v1tzwxkt.js";
6
- export {
7
- ANSI
8
- };
@@ -1,4 +0,0 @@
1
- import { Spinner, SpinnerOptions, SpinnerStyle, createSpinner } from "../shared/@outfitter/cli-h20jc0bs";
2
- import { StreamWriter, StreamWriterOptions, WritableStream, createStreamWriter } from "../shared/@outfitter/cli-cf1xexgn";
3
- import { ANSI } from "../shared/@outfitter/cli-vtg0sqk2";
4
- export { createStreamWriter, createSpinner, WritableStream, StreamWriterOptions, StreamWriter, SpinnerStyle, SpinnerOptions, Spinner, ANSI };
@@ -1,17 +0,0 @@
1
- // @bun
2
- import {
3
- createStreamWriter
4
- } from "../shared/@outfitter/cli-jejfypgf.js";
5
- import {
6
- createSpinner
7
- } from "../shared/@outfitter/cli-1sb3xvnw.js";
8
- import {
9
- ANSI
10
- } from "../shared/@outfitter/cli-p3dqm1vd.js";
11
- import"../shared/@outfitter/cli-6ty1nvws.js";
12
- import"../shared/@outfitter/cli-v1tzwxkt.js";
13
- export {
14
- createStreamWriter,
15
- createSpinner,
16
- ANSI
17
- };
@@ -1,3 +0,0 @@
1
- import { Spinner, SpinnerOptions, SpinnerStyle, createSpinner } from "../shared/@outfitter/cli-h20jc0bs";
2
- import "../shared/@outfitter/cli-cf1xexgn";
3
- export { createSpinner, SpinnerStyle, SpinnerOptions, Spinner };
@@ -1,10 +0,0 @@
1
- // @bun
2
- import {
3
- createSpinner
4
- } from "../shared/@outfitter/cli-1sb3xvnw.js";
5
- import"../shared/@outfitter/cli-p3dqm1vd.js";
6
- import"../shared/@outfitter/cli-6ty1nvws.js";
7
- import"../shared/@outfitter/cli-v1tzwxkt.js";
8
- export {
9
- createSpinner
10
- };
@@ -1,2 +0,0 @@
1
- import { StreamWriter, StreamWriterOptions, WritableStream, createStreamWriter } from "../shared/@outfitter/cli-cf1xexgn";
2
- export { createStreamWriter, WritableStream, StreamWriterOptions, StreamWriter };
@@ -1,9 +0,0 @@
1
- // @bun
2
- import {
3
- createStreamWriter
4
- } from "../shared/@outfitter/cli-jejfypgf.js";
5
- import"../shared/@outfitter/cli-p3dqm1vd.js";
6
- import"../shared/@outfitter/cli-v1tzwxkt.js";
7
- export {
8
- createStreamWriter
9
- };
@@ -1,4 +0,0 @@
1
- import "../shared/@outfitter/cli-mn8f7rh4";
2
- import { TableOptions, renderTable } from "../shared/@outfitter/cli-qj83y5wj";
3
- import "../shared/@outfitter/cli-fakncnjp";
4
- export { renderTable, TableOptions };
@@ -1,13 +0,0 @@
1
- // @bun
2
- import"../shared/@outfitter/cli-mq0jp15z.js";
3
- import {
4
- renderTable
5
- } from "../shared/@outfitter/cli-c8fqdaes.js";
6
- import"../shared/@outfitter/cli-mwxsh3sr.js";
7
- import"../shared/@outfitter/cli-85fg2vr5.js";
8
- import"../shared/@outfitter/cli-5g6rkv3d.js";
9
- import"../shared/@outfitter/cli-d9ad0rqj.js";
10
- import"../shared/@outfitter/cli-v1tzwxkt.js";
11
- export {
12
- renderTable
13
- };
@@ -1,9 +0,0 @@
1
- import { ThemedContextOptions, ThemedLayoutContext, createThemedContext, getContextTheme } from "../shared/@outfitter/cli-6hg0sg2d";
2
- import "../shared/@outfitter/cli-8hngbjyr";
3
- import "../shared/@outfitter/cli-1g8tt31a";
4
- import "../shared/@outfitter/cli-hnpbqmc8";
5
- import "../shared/@outfitter/cli-3b7ed3rm";
6
- import "../shared/@outfitter/cli-e5ms1y0x";
7
- import "../shared/@outfitter/cli-fakncnjp";
8
- import "../shared/@outfitter/cli-2g8bx1aq";
9
- export { getContextTheme, createThemedContext, ThemedLayoutContext, ThemedContextOptions };
@@ -1,14 +0,0 @@
1
- // @bun
2
- import {
3
- createThemedContext,
4
- getContextTheme
5
- } from "../shared/@outfitter/cli-60b5xh1r.js";
6
- import"../shared/@outfitter/cli-z78mkrc7.js";
7
- import"../shared/@outfitter/cli-85fg2vr5.js";
8
- import"../shared/@outfitter/cli-5g6rkv3d.js";
9
- import"../shared/@outfitter/cli-d9ad0rqj.js";
10
- import"../shared/@outfitter/cli-v1tzwxkt.js";
11
- export {
12
- getContextTheme,
13
- createThemedContext
14
- };
@@ -1,8 +0,0 @@
1
- import { CreateVisualThemeOptions, createVisualTheme } from "../shared/@outfitter/cli-4zk2y4a2";
2
- import "../shared/@outfitter/cli-8hngbjyr";
3
- import "../shared/@outfitter/cli-1g8tt31a";
4
- import "../shared/@outfitter/cli-hnpbqmc8";
5
- import "../shared/@outfitter/cli-3b7ed3rm";
6
- import "../shared/@outfitter/cli-e5ms1y0x";
7
- import "../shared/@outfitter/cli-fakncnjp";
8
- export { createVisualTheme, CreateVisualThemeOptions };
@@ -1,12 +0,0 @@
1
- // @bun
2
- import {
3
- createVisualTheme
4
- } from "../shared/@outfitter/cli-h3jz0bxz.js";
5
- import"../shared/@outfitter/cli-z78mkrc7.js";
6
- import"../shared/@outfitter/cli-85fg2vr5.js";
7
- import"../shared/@outfitter/cli-5g6rkv3d.js";
8
- import"../shared/@outfitter/cli-d9ad0rqj.js";
9
- import"../shared/@outfitter/cli-v1tzwxkt.js";
10
- export {
11
- createVisualTheme
12
- };
@@ -1,17 +0,0 @@
1
- import "../shared/@outfitter/cli-m8vv6kd6";
2
- import "../shared/@outfitter/cli-5ppp2a7c";
3
- import { minimalTheme } from "../shared/@outfitter/cli-regjbef6";
4
- import { CreateVisualThemeOptions, createVisualTheme } from "../shared/@outfitter/cli-4zk2y4a2";
5
- import { ThemedContextOptions, ThemedLayoutContext, createThemedContext, getContextTheme } from "../shared/@outfitter/cli-6hg0sg2d";
6
- import { resolveGlyph, resolveStateMarker } from "../shared/@outfitter/cli-s1tx5kha";
7
- import { defaultTheme } from "../shared/@outfitter/cli-py02m79x";
8
- import { boldTheme } from "../shared/@outfitter/cli-nj4nqy1h";
9
- import { roundedTheme } from "../shared/@outfitter/cli-dbyteh27";
10
- import { GlyphPair, MarkerSpec, PartialVisualTheme, SemanticState, ThemeColors, ThemeSpacing, VisualTheme } from "../shared/@outfitter/cli-8hngbjyr";
11
- import "../shared/@outfitter/cli-1g8tt31a";
12
- import "../shared/@outfitter/cli-hnpbqmc8";
13
- import "../shared/@outfitter/cli-3b7ed3rm";
14
- import "../shared/@outfitter/cli-e5ms1y0x";
15
- import "../shared/@outfitter/cli-fakncnjp";
16
- import "../shared/@outfitter/cli-2g8bx1aq";
17
- export { roundedTheme, resolveStateMarker, resolveGlyph, minimalTheme, getContextTheme, defaultTheme, createVisualTheme, createThemedContext, boldTheme, VisualTheme, ThemedLayoutContext, ThemedContextOptions, ThemeSpacing, ThemeColors, SemanticState, PartialVisualTheme, MarkerSpec, GlyphPair, CreateVisualThemeOptions };
@@ -1,42 +0,0 @@
1
- // @bun
2
- import"../shared/@outfitter/cli-6fxffp8k.js";
3
- import"../shared/@outfitter/cli-vd60dj65.js";
4
- import {
5
- minimalTheme
6
- } from "../shared/@outfitter/cli-y7k1t81k.js";
7
- import {
8
- createVisualTheme
9
- } from "../shared/@outfitter/cli-h3jz0bxz.js";
10
- import {
11
- createThemedContext,
12
- getContextTheme
13
- } from "../shared/@outfitter/cli-60b5xh1r.js";
14
- import {
15
- resolveGlyph,
16
- resolveStateMarker
17
- } from "../shared/@outfitter/cli-symyxb0z.js";
18
- import {
19
- boldTheme
20
- } from "../shared/@outfitter/cli-7n610r63.js";
21
- import {
22
- roundedTheme
23
- } from "../shared/@outfitter/cli-914d47mt.js";
24
- import {
25
- defaultTheme
26
- } from "../shared/@outfitter/cli-z78mkrc7.js";
27
- import"../shared/@outfitter/cli-6ty1nvws.js";
28
- import"../shared/@outfitter/cli-85fg2vr5.js";
29
- import"../shared/@outfitter/cli-5g6rkv3d.js";
30
- import"../shared/@outfitter/cli-d9ad0rqj.js";
31
- import"../shared/@outfitter/cli-v1tzwxkt.js";
32
- export {
33
- roundedTheme,
34
- resolveStateMarker,
35
- resolveGlyph,
36
- minimalTheme,
37
- getContextTheme,
38
- defaultTheme,
39
- createVisualTheme,
40
- createThemedContext,
41
- boldTheme
42
- };
@@ -1,8 +0,0 @@
1
- import { boldTheme } from "../../shared/@outfitter/cli-nj4nqy1h";
2
- import "../../shared/@outfitter/cli-8hngbjyr";
3
- import "../../shared/@outfitter/cli-1g8tt31a";
4
- import "../../shared/@outfitter/cli-hnpbqmc8";
5
- import "../../shared/@outfitter/cli-3b7ed3rm";
6
- import "../../shared/@outfitter/cli-e5ms1y0x";
7
- import "../../shared/@outfitter/cli-fakncnjp";
8
- export { boldTheme };
@@ -1,12 +0,0 @@
1
- // @bun
2
- import {
3
- boldTheme
4
- } from "../../shared/@outfitter/cli-7n610r63.js";
5
- import"../../shared/@outfitter/cli-z78mkrc7.js";
6
- import"../../shared/@outfitter/cli-85fg2vr5.js";
7
- import"../../shared/@outfitter/cli-5g6rkv3d.js";
8
- import"../../shared/@outfitter/cli-d9ad0rqj.js";
9
- import"../../shared/@outfitter/cli-v1tzwxkt.js";
10
- export {
11
- boldTheme
12
- };
@@ -1,8 +0,0 @@
1
- import { defaultTheme } from "../../shared/@outfitter/cli-py02m79x";
2
- import "../../shared/@outfitter/cli-8hngbjyr";
3
- import "../../shared/@outfitter/cli-1g8tt31a";
4
- import "../../shared/@outfitter/cli-hnpbqmc8";
5
- import "../../shared/@outfitter/cli-3b7ed3rm";
6
- import "../../shared/@outfitter/cli-e5ms1y0x";
7
- import "../../shared/@outfitter/cli-fakncnjp";
8
- export { defaultTheme };
@@ -1,11 +0,0 @@
1
- // @bun
2
- import {
3
- defaultTheme
4
- } from "../../shared/@outfitter/cli-z78mkrc7.js";
5
- import"../../shared/@outfitter/cli-85fg2vr5.js";
6
- import"../../shared/@outfitter/cli-5g6rkv3d.js";
7
- import"../../shared/@outfitter/cli-d9ad0rqj.js";
8
- import"../../shared/@outfitter/cli-v1tzwxkt.js";
9
- export {
10
- defaultTheme
11
- };
@@ -1,12 +0,0 @@
1
- import "../../shared/@outfitter/cli-5ppp2a7c";
2
- import { minimalTheme } from "../../shared/@outfitter/cli-regjbef6";
3
- import { defaultTheme } from "../../shared/@outfitter/cli-py02m79x";
4
- import { boldTheme } from "../../shared/@outfitter/cli-nj4nqy1h";
5
- import { roundedTheme } from "../../shared/@outfitter/cli-dbyteh27";
6
- import "../../shared/@outfitter/cli-8hngbjyr";
7
- import "../../shared/@outfitter/cli-1g8tt31a";
8
- import "../../shared/@outfitter/cli-hnpbqmc8";
9
- import "../../shared/@outfitter/cli-3b7ed3rm";
10
- import "../../shared/@outfitter/cli-e5ms1y0x";
11
- import "../../shared/@outfitter/cli-fakncnjp";
12
- export { roundedTheme, minimalTheme, defaultTheme, boldTheme };
@@ -1,24 +0,0 @@
1
- // @bun
2
- import"../../shared/@outfitter/cli-vd60dj65.js";
3
- import {
4
- minimalTheme
5
- } from "../../shared/@outfitter/cli-y7k1t81k.js";
6
- import {
7
- boldTheme
8
- } from "../../shared/@outfitter/cli-7n610r63.js";
9
- import {
10
- roundedTheme
11
- } from "../../shared/@outfitter/cli-914d47mt.js";
12
- import {
13
- defaultTheme
14
- } from "../../shared/@outfitter/cli-z78mkrc7.js";
15
- import"../../shared/@outfitter/cli-85fg2vr5.js";
16
- import"../../shared/@outfitter/cli-5g6rkv3d.js";
17
- import"../../shared/@outfitter/cli-d9ad0rqj.js";
18
- import"../../shared/@outfitter/cli-v1tzwxkt.js";
19
- export {
20
- roundedTheme,
21
- minimalTheme,
22
- defaultTheme,
23
- boldTheme
24
- };
@@ -1,8 +0,0 @@
1
- import { minimalTheme } from "../../shared/@outfitter/cli-regjbef6";
2
- import "../../shared/@outfitter/cli-8hngbjyr";
3
- import "../../shared/@outfitter/cli-1g8tt31a";
4
- import "../../shared/@outfitter/cli-hnpbqmc8";
5
- import "../../shared/@outfitter/cli-3b7ed3rm";
6
- import "../../shared/@outfitter/cli-e5ms1y0x";
7
- import "../../shared/@outfitter/cli-fakncnjp";
8
- export { minimalTheme };
@@ -1,12 +0,0 @@
1
- // @bun
2
- import {
3
- minimalTheme
4
- } from "../../shared/@outfitter/cli-y7k1t81k.js";
5
- import"../../shared/@outfitter/cli-z78mkrc7.js";
6
- import"../../shared/@outfitter/cli-85fg2vr5.js";
7
- import"../../shared/@outfitter/cli-5g6rkv3d.js";
8
- import"../../shared/@outfitter/cli-d9ad0rqj.js";
9
- import"../../shared/@outfitter/cli-v1tzwxkt.js";
10
- export {
11
- minimalTheme
12
- };
@@ -1,8 +0,0 @@
1
- import { roundedTheme } from "../../shared/@outfitter/cli-dbyteh27";
2
- import "../../shared/@outfitter/cli-8hngbjyr";
3
- import "../../shared/@outfitter/cli-1g8tt31a";
4
- import "../../shared/@outfitter/cli-hnpbqmc8";
5
- import "../../shared/@outfitter/cli-3b7ed3rm";
6
- import "../../shared/@outfitter/cli-e5ms1y0x";
7
- import "../../shared/@outfitter/cli-fakncnjp";
8
- export { roundedTheme };
@@ -1,12 +0,0 @@
1
- // @bun
2
- import {
3
- roundedTheme
4
- } from "../../shared/@outfitter/cli-914d47mt.js";
5
- import"../../shared/@outfitter/cli-z78mkrc7.js";
6
- import"../../shared/@outfitter/cli-85fg2vr5.js";
7
- import"../../shared/@outfitter/cli-5g6rkv3d.js";
8
- import"../../shared/@outfitter/cli-d9ad0rqj.js";
9
- import"../../shared/@outfitter/cli-v1tzwxkt.js";
10
- export {
11
- roundedTheme
12
- };
@@ -1,8 +0,0 @@
1
- import { resolveGlyph, resolveStateMarker } from "../shared/@outfitter/cli-s1tx5kha";
2
- import "../shared/@outfitter/cli-8hngbjyr";
3
- import "../shared/@outfitter/cli-1g8tt31a";
4
- import "../shared/@outfitter/cli-hnpbqmc8";
5
- import "../shared/@outfitter/cli-3b7ed3rm";
6
- import "../shared/@outfitter/cli-e5ms1y0x";
7
- import "../shared/@outfitter/cli-fakncnjp";
8
- export { resolveStateMarker, resolveGlyph };
@@ -1,11 +0,0 @@
1
- // @bun
2
- import {
3
- resolveGlyph,
4
- resolveStateMarker
5
- } from "../shared/@outfitter/cli-symyxb0z.js";
6
- import"../shared/@outfitter/cli-6ty1nvws.js";
7
- import"../shared/@outfitter/cli-v1tzwxkt.js";
8
- export {
9
- resolveStateMarker,
10
- resolveGlyph
11
- };
@@ -1,7 +0,0 @@
1
- import { GlyphPair, MarkerSpec, PartialVisualTheme, SemanticState, ThemeColors, ThemeSpacing, VisualTheme } from "../shared/@outfitter/cli-8hngbjyr";
2
- import "../shared/@outfitter/cli-1g8tt31a";
3
- import "../shared/@outfitter/cli-hnpbqmc8";
4
- import "../shared/@outfitter/cli-3b7ed3rm";
5
- import "../shared/@outfitter/cli-e5ms1y0x";
6
- import "../shared/@outfitter/cli-fakncnjp";
7
- export { VisualTheme, ThemeSpacing, ThemeColors, SemanticState, PartialVisualTheme, MarkerSpec, GlyphPair };
@@ -1 +0,0 @@
1
- // @bun