mepcli 2.0.0-beta.2 → 2.0.0-beta.4

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 (358) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +20 -0
  3. package/dist/ansi.d.ts +36 -0
  4. package/dist/ansi.js +1 -0
  5. package/dist/base.d.ts +61 -0
  6. package/dist/base.js +1 -0
  7. package/dist/{src/core.js → core.d.ts} +181 -345
  8. package/dist/core.js +1 -0
  9. package/dist/data/countries.d.ts +2 -0
  10. package/dist/data/countries.js +1 -0
  11. package/dist/data/licenses.d.ts +2 -0
  12. package/dist/data/licenses.js +1 -0
  13. package/dist/highlight.d.ts +7 -0
  14. package/dist/highlight.js +1 -0
  15. package/dist/index.d.ts +52 -0
  16. package/dist/index.js +1 -0
  17. package/dist/input.d.ts +14 -0
  18. package/dist/input.js +1 -0
  19. package/dist/pipeline.d.ts +90 -0
  20. package/dist/pipeline.js +1 -0
  21. package/dist/prompts/autocomplete.d.ts +22 -0
  22. package/dist/prompts/autocomplete.js +1 -0
  23. package/dist/prompts/box.d.ts +21 -0
  24. package/dist/prompts/box.js +4 -0
  25. package/dist/prompts/breadcrumb-search.d.ts +14 -0
  26. package/dist/prompts/breadcrumb-search.js +2 -0
  27. package/dist/prompts/breadcrumb.d.ts +32 -0
  28. package/dist/prompts/breadcrumb.js +3 -0
  29. package/dist/prompts/byte.d.ts +13 -0
  30. package/dist/prompts/byte.js +5 -0
  31. package/dist/prompts/calculator.d.ts +17 -0
  32. package/dist/prompts/calculator.js +3 -0
  33. package/dist/prompts/calendar.d.ts +33 -0
  34. package/dist/prompts/calendar.js +3 -0
  35. package/dist/prompts/checkbox.d.ts +13 -0
  36. package/dist/prompts/checkbox.js +2 -0
  37. package/dist/prompts/code.d.ts +19 -0
  38. package/dist/prompts/code.js +4 -0
  39. package/dist/prompts/color.d.ts +14 -0
  40. package/dist/prompts/color.js +10 -0
  41. package/dist/prompts/confirm.d.ts +8 -0
  42. package/dist/prompts/confirm.js +1 -0
  43. package/dist/prompts/connection-string.d.ts +18 -0
  44. package/dist/prompts/connection-string.js +1 -0
  45. package/dist/prompts/cron.d.ts +13 -0
  46. package/dist/prompts/cron.js +4 -0
  47. package/dist/prompts/curl-utils.d.ts +25 -0
  48. package/dist/prompts/curl-utils.js +1 -0
  49. package/dist/prompts/curl.d.ts +41 -0
  50. package/dist/prompts/curl.js +12 -0
  51. package/dist/prompts/data-inspector.d.ts +22 -0
  52. package/dist/prompts/data-inspector.js +5 -0
  53. package/dist/prompts/date.d.ts +12 -0
  54. package/dist/prompts/date.js +2 -0
  55. package/dist/prompts/dependency.d.ts +16 -0
  56. package/dist/prompts/dependency.js +3 -0
  57. package/dist/prompts/dial.d.ts +10 -0
  58. package/dist/prompts/dial.js +3 -0
  59. package/dist/prompts/diff.d.ts +10 -0
  60. package/dist/prompts/diff.js +10 -0
  61. package/dist/prompts/draw.d.ts +20 -0
  62. package/dist/prompts/draw.js +6 -0
  63. package/dist/prompts/editor.d.ts +14 -0
  64. package/dist/prompts/editor.js +2 -0
  65. package/dist/prompts/emoji.d.ts +18 -0
  66. package/dist/prompts/emoji.js +5 -0
  67. package/dist/prompts/exec.d.ts +17 -0
  68. package/dist/prompts/exec.js +1 -0
  69. package/dist/prompts/file.d.ts +21 -0
  70. package/dist/prompts/file.js +2 -0
  71. package/dist/prompts/form.d.ts +18 -0
  72. package/dist/prompts/form.js +1 -0
  73. package/dist/prompts/fuzzy-multi-column.d.ts +12 -0
  74. package/dist/prompts/fuzzy-multi-column.js +2 -0
  75. package/dist/prompts/fuzzy.d.ts +12 -0
  76. package/dist/prompts/fuzzy.js +2 -0
  77. package/dist/prompts/gauge.d.ts +21 -0
  78. package/dist/prompts/gauge.js +4 -0
  79. package/dist/prompts/grid.d.ts +14 -0
  80. package/dist/prompts/grid.js +2 -0
  81. package/dist/prompts/heatmap.d.ts +13 -0
  82. package/dist/prompts/heatmap.js +2 -0
  83. package/dist/prompts/ip.d.ts +11 -0
  84. package/dist/prompts/ip.js +3 -0
  85. package/dist/prompts/kanban.d.ts +17 -0
  86. package/dist/prompts/kanban.js +4 -0
  87. package/dist/prompts/keypress.d.ts +7 -0
  88. package/dist/prompts/keypress.js +1 -0
  89. package/dist/prompts/license.d.ts +9 -0
  90. package/dist/prompts/license.js +13 -0
  91. package/dist/prompts/list.d.ts +9 -0
  92. package/dist/prompts/list.js +1 -0
  93. package/dist/prompts/map.d.ts +17 -0
  94. package/dist/prompts/map.js +5 -0
  95. package/dist/prompts/match.d.ts +19 -0
  96. package/dist/prompts/match.js +7 -0
  97. package/dist/prompts/miller.d.ts +15 -0
  98. package/dist/prompts/miller.js +2 -0
  99. package/dist/prompts/multi-column-select.d.ts +10 -0
  100. package/dist/prompts/multi-column-select.js +2 -0
  101. package/dist/prompts/multi-range.d.ts +9 -0
  102. package/dist/prompts/multi-range.js +3 -0
  103. package/dist/prompts/multi-select.d.ts +15 -0
  104. package/dist/prompts/multi-select.js +4 -0
  105. package/dist/prompts/number.d.ts +11 -0
  106. package/dist/prompts/number.js +2 -0
  107. package/dist/prompts/otp.d.ts +10 -0
  108. package/dist/prompts/otp.js +2 -0
  109. package/dist/prompts/pattern.d.ts +22 -0
  110. package/dist/prompts/pattern.js +4 -0
  111. package/dist/prompts/phone.d.ts +41 -0
  112. package/dist/prompts/phone.js +3 -0
  113. package/dist/prompts/quiz-select.d.ts +10 -0
  114. package/dist/prompts/quiz-select.js +7 -0
  115. package/dist/prompts/quiz-text.d.ts +11 -0
  116. package/dist/prompts/quiz-text.js +8 -0
  117. package/dist/prompts/range.d.ts +9 -0
  118. package/dist/prompts/range.js +1 -0
  119. package/dist/prompts/rating.d.ts +8 -0
  120. package/dist/prompts/rating.js +1 -0
  121. package/dist/prompts/regex.d.ts +13 -0
  122. package/dist/prompts/regex.js +5 -0
  123. package/dist/prompts/region.d.ts +11 -0
  124. package/dist/prompts/region.js +5 -0
  125. package/dist/prompts/schedule.d.ts +20 -0
  126. package/dist/prompts/schedule.js +5 -0
  127. package/dist/prompts/scroll.d.ts +13 -0
  128. package/dist/prompts/scroll.js +1 -0
  129. package/dist/prompts/seat.d.ts +17 -0
  130. package/dist/prompts/seat.js +5 -0
  131. package/dist/prompts/select-range.d.ts +8 -0
  132. package/dist/prompts/select-range.js +3 -0
  133. package/dist/prompts/select.d.ts +15 -0
  134. package/dist/prompts/select.js +2 -0
  135. package/dist/prompts/semver.d.ts +6 -0
  136. package/dist/prompts/semver.js +1 -0
  137. package/dist/prompts/shortcut.d.ts +9 -0
  138. package/dist/prompts/shortcut.js +1 -0
  139. package/dist/prompts/slider.d.ts +8 -0
  140. package/dist/prompts/slider.js +1 -0
  141. package/dist/prompts/slot.d.ts +16 -0
  142. package/dist/prompts/slot.js +8 -0
  143. package/dist/prompts/snippet.d.ts +19 -0
  144. package/dist/prompts/snippet.js +4 -0
  145. package/dist/prompts/sort-grid.d.ts +16 -0
  146. package/dist/prompts/sort-grid.js +2 -0
  147. package/dist/prompts/sort.d.ts +14 -0
  148. package/dist/prompts/sort.js +2 -0
  149. package/dist/prompts/spam.d.ts +17 -0
  150. package/dist/prompts/spam.js +2 -0
  151. package/dist/prompts/spreadsheet.d.ts +21 -0
  152. package/dist/prompts/spreadsheet.js +7 -0
  153. package/dist/prompts/table.d.ts +14 -0
  154. package/dist/prompts/table.js +3 -0
  155. package/dist/prompts/text.d.ts +17 -0
  156. package/dist/prompts/text.js +2 -0
  157. package/dist/prompts/time.d.ts +12 -0
  158. package/dist/prompts/time.js +2 -0
  159. package/dist/prompts/toggle.d.ts +8 -0
  160. package/dist/prompts/toggle.js +1 -0
  161. package/dist/prompts/transfer.d.ts +18 -0
  162. package/dist/prompts/transfer.js +5 -0
  163. package/dist/prompts/tree-select.d.ts +31 -0
  164. package/dist/prompts/tree-select.js +3 -0
  165. package/dist/prompts/tree.d.ts +20 -0
  166. package/dist/prompts/tree.js +3 -0
  167. package/dist/prompts/wait.d.ts +18 -0
  168. package/dist/prompts/wait.js +1 -0
  169. package/dist/spinner.d.ts +33 -0
  170. package/dist/spinner.js +3 -0
  171. package/dist/symbols.d.ts +33 -0
  172. package/dist/symbols.js +1 -0
  173. package/dist/tasks.d.ts +57 -0
  174. package/dist/tasks.js +1 -0
  175. package/dist/theme.d.ts +2 -0
  176. package/dist/theme.js +1 -0
  177. package/dist/types.d.ts +519 -0
  178. package/dist/types.js +1 -0
  179. package/dist/utils.d.ts +82 -0
  180. package/dist/utils.js +1 -0
  181. package/package.json +10 -10
  182. package/dist/src/ansi.js +0 -50
  183. package/dist/src/ansi.js.map +0 -1
  184. package/dist/src/base.js +0 -258
  185. package/dist/src/base.js.map +0 -1
  186. package/dist/src/core.js.map +0 -1
  187. package/dist/src/data/countries.js +0 -569
  188. package/dist/src/data/countries.js.map +0 -1
  189. package/dist/src/data/licenses.js +0 -480
  190. package/dist/src/data/licenses.js.map +0 -1
  191. package/dist/src/highlight.js +0 -185
  192. package/dist/src/highlight.js.map +0 -1
  193. package/dist/src/index.js +0 -66
  194. package/dist/src/index.js.map +0 -1
  195. package/dist/src/input.js +0 -158
  196. package/dist/src/input.js.map +0 -1
  197. package/dist/src/pipeline.js +0 -273
  198. package/dist/src/pipeline.js.map +0 -1
  199. package/dist/src/prompts/autocomplete.js +0 -171
  200. package/dist/src/prompts/autocomplete.js.map +0 -1
  201. package/dist/src/prompts/box.js +0 -225
  202. package/dist/src/prompts/box.js.map +0 -1
  203. package/dist/src/prompts/breadcrumb-search.js +0 -260
  204. package/dist/src/prompts/breadcrumb-search.js.map +0 -1
  205. package/dist/src/prompts/breadcrumb.js +0 -307
  206. package/dist/src/prompts/breadcrumb.js.map +0 -1
  207. package/dist/src/prompts/byte.js +0 -176
  208. package/dist/src/prompts/byte.js.map +0 -1
  209. package/dist/src/prompts/calculator.js +0 -243
  210. package/dist/src/prompts/calculator.js.map +0 -1
  211. package/dist/src/prompts/calendar.js +0 -430
  212. package/dist/src/prompts/calendar.js.map +0 -1
  213. package/dist/src/prompts/checkbox.js +0 -159
  214. package/dist/src/prompts/checkbox.js.map +0 -1
  215. package/dist/src/prompts/code.js +0 -271
  216. package/dist/src/prompts/code.js.map +0 -1
  217. package/dist/src/prompts/color.js +0 -165
  218. package/dist/src/prompts/color.js.map +0 -1
  219. package/dist/src/prompts/confirm.js +0 -55
  220. package/dist/src/prompts/confirm.js.map +0 -1
  221. package/dist/src/prompts/connection-string.js +0 -120
  222. package/dist/src/prompts/connection-string.js.map +0 -1
  223. package/dist/src/prompts/cron.js +0 -207
  224. package/dist/src/prompts/cron.js.map +0 -1
  225. package/dist/src/prompts/curl-utils.js +0 -71
  226. package/dist/src/prompts/curl-utils.js.map +0 -1
  227. package/dist/src/prompts/curl.js +0 -431
  228. package/dist/src/prompts/curl.js.map +0 -1
  229. package/dist/src/prompts/data-inspector.js +0 -261
  230. package/dist/src/prompts/data-inspector.js.map +0 -1
  231. package/dist/src/prompts/date.js +0 -185
  232. package/dist/src/prompts/date.js.map +0 -1
  233. package/dist/src/prompts/dependency.js +0 -283
  234. package/dist/src/prompts/dependency.js.map +0 -1
  235. package/dist/src/prompts/dial.js +0 -124
  236. package/dist/src/prompts/dial.js.map +0 -1
  237. package/dist/src/prompts/diff.js +0 -118
  238. package/dist/src/prompts/diff.js.map +0 -1
  239. package/dist/src/prompts/draw.js +0 -191
  240. package/dist/src/prompts/draw.js.map +0 -1
  241. package/dist/src/prompts/editor.js +0 -234
  242. package/dist/src/prompts/editor.js.map +0 -1
  243. package/dist/src/prompts/emoji.js +0 -226
  244. package/dist/src/prompts/emoji.js.map +0 -1
  245. package/dist/src/prompts/exec.js +0 -151
  246. package/dist/src/prompts/exec.js.map +0 -1
  247. package/dist/src/prompts/file.js +0 -217
  248. package/dist/src/prompts/file.js.map +0 -1
  249. package/dist/src/prompts/form.js +0 -241
  250. package/dist/src/prompts/form.js.map +0 -1
  251. package/dist/src/prompts/fuzzy-multi-column.js +0 -161
  252. package/dist/src/prompts/fuzzy-multi-column.js.map +0 -1
  253. package/dist/src/prompts/fuzzy.js +0 -147
  254. package/dist/src/prompts/fuzzy.js.map +0 -1
  255. package/dist/src/prompts/gauge.js +0 -137
  256. package/dist/src/prompts/gauge.js.map +0 -1
  257. package/dist/src/prompts/grid.js +0 -191
  258. package/dist/src/prompts/grid.js.map +0 -1
  259. package/dist/src/prompts/heatmap.js +0 -147
  260. package/dist/src/prompts/heatmap.js.map +0 -1
  261. package/dist/src/prompts/ip.js +0 -138
  262. package/dist/src/prompts/ip.js.map +0 -1
  263. package/dist/src/prompts/kanban.js +0 -233
  264. package/dist/src/prompts/kanban.js.map +0 -1
  265. package/dist/src/prompts/keypress.js +0 -54
  266. package/dist/src/prompts/keypress.js.map +0 -1
  267. package/dist/src/prompts/license.js +0 -144
  268. package/dist/src/prompts/license.js.map +0 -1
  269. package/dist/src/prompts/list.js +0 -124
  270. package/dist/src/prompts/list.js.map +0 -1
  271. package/dist/src/prompts/map.js +0 -262
  272. package/dist/src/prompts/map.js.map +0 -1
  273. package/dist/src/prompts/match.js +0 -271
  274. package/dist/src/prompts/match.js.map +0 -1
  275. package/dist/src/prompts/miller.js +0 -228
  276. package/dist/src/prompts/miller.js.map +0 -1
  277. package/dist/src/prompts/multi-column-select.js +0 -176
  278. package/dist/src/prompts/multi-column-select.js.map +0 -1
  279. package/dist/src/prompts/multi-range.js +0 -189
  280. package/dist/src/prompts/multi-range.js.map +0 -1
  281. package/dist/src/prompts/multi-select.js +0 -183
  282. package/dist/src/prompts/multi-select.js.map +0 -1
  283. package/dist/src/prompts/number.js +0 -166
  284. package/dist/src/prompts/number.js.map +0 -1
  285. package/dist/src/prompts/otp.js +0 -107
  286. package/dist/src/prompts/otp.js.map +0 -1
  287. package/dist/src/prompts/pattern.js +0 -252
  288. package/dist/src/prompts/pattern.js.map +0 -1
  289. package/dist/src/prompts/phone.js +0 -398
  290. package/dist/src/prompts/phone.js.map +0 -1
  291. package/dist/src/prompts/quiz-select.js +0 -114
  292. package/dist/src/prompts/quiz-select.js.map +0 -1
  293. package/dist/src/prompts/quiz-text.js +0 -98
  294. package/dist/src/prompts/quiz-text.js.map +0 -1
  295. package/dist/src/prompts/range.js +0 -164
  296. package/dist/src/prompts/range.js.map +0 -1
  297. package/dist/src/prompts/rating.js +0 -83
  298. package/dist/src/prompts/rating.js.map +0 -1
  299. package/dist/src/prompts/regex.js +0 -145
  300. package/dist/src/prompts/regex.js.map +0 -1
  301. package/dist/src/prompts/region.js +0 -170
  302. package/dist/src/prompts/region.js.map +0 -1
  303. package/dist/src/prompts/schedule.js +0 -270
  304. package/dist/src/prompts/schedule.js.map +0 -1
  305. package/dist/src/prompts/scroll.js +0 -155
  306. package/dist/src/prompts/scroll.js.map +0 -1
  307. package/dist/src/prompts/seat.js +0 -164
  308. package/dist/src/prompts/seat.js.map +0 -1
  309. package/dist/src/prompts/select-range.js +0 -148
  310. package/dist/src/prompts/select-range.js.map +0 -1
  311. package/dist/src/prompts/select.js +0 -163
  312. package/dist/src/prompts/select.js.map +0 -1
  313. package/dist/src/prompts/semver.js +0 -43
  314. package/dist/src/prompts/semver.js.map +0 -1
  315. package/dist/src/prompts/shortcut.js +0 -133
  316. package/dist/src/prompts/shortcut.js.map +0 -1
  317. package/dist/src/prompts/slider.js +0 -69
  318. package/dist/src/prompts/slider.js.map +0 -1
  319. package/dist/src/prompts/slot.js +0 -117
  320. package/dist/src/prompts/slot.js.map +0 -1
  321. package/dist/src/prompts/snippet.js +0 -228
  322. package/dist/src/prompts/snippet.js.map +0 -1
  323. package/dist/src/prompts/sort-grid.js +0 -151
  324. package/dist/src/prompts/sort-grid.js.map +0 -1
  325. package/dist/src/prompts/sort.js +0 -166
  326. package/dist/src/prompts/sort.js.map +0 -1
  327. package/dist/src/prompts/spam.js +0 -80
  328. package/dist/src/prompts/spam.js.map +0 -1
  329. package/dist/src/prompts/spreadsheet.js +0 -240
  330. package/dist/src/prompts/spreadsheet.js.map +0 -1
  331. package/dist/src/prompts/table.js +0 -120
  332. package/dist/src/prompts/table.js.map +0 -1
  333. package/dist/src/prompts/text.js +0 -317
  334. package/dist/src/prompts/text.js.map +0 -1
  335. package/dist/src/prompts/time.js +0 -211
  336. package/dist/src/prompts/time.js.map +0 -1
  337. package/dist/src/prompts/toggle.js +0 -53
  338. package/dist/src/prompts/toggle.js.map +0 -1
  339. package/dist/src/prompts/transfer.js +0 -207
  340. package/dist/src/prompts/transfer.js.map +0 -1
  341. package/dist/src/prompts/tree-select.js +0 -270
  342. package/dist/src/prompts/tree-select.js.map +0 -1
  343. package/dist/src/prompts/tree.js +0 -233
  344. package/dist/src/prompts/tree.js.map +0 -1
  345. package/dist/src/prompts/wait.js +0 -79
  346. package/dist/src/prompts/wait.js.map +0 -1
  347. package/dist/src/spinner.js +0 -105
  348. package/dist/src/spinner.js.map +0 -1
  349. package/dist/src/symbols.js +0 -66
  350. package/dist/src/symbols.js.map +0 -1
  351. package/dist/src/tasks.js +0 -231
  352. package/dist/src/tasks.js.map +0 -1
  353. package/dist/src/theme.js +0 -29
  354. package/dist/src/theme.js.map +0 -1
  355. package/dist/src/types.js +0 -8
  356. package/dist/src/types.js.map +0 -1
  357. package/dist/src/utils.js +0 -480
  358. package/dist/src/utils.js.map +0 -1
@@ -0,0 +1,519 @@
1
+ /**
2
+ * Type definitions for Mep CLI interactions.
3
+ */
4
+ /**
5
+ * Extension registry for custom prompts.
6
+ * Extend this interface via declaration merging to register custom prompt types:
7
+ *
8
+ * @example
9
+ * declare module 'mep' {
10
+ * interface ExtensionRegistry {
11
+ * myPrompt: { options: MyPromptOptions; result: string };
12
+ * }
13
+ * }
14
+ * MepCLI.register('myPrompt', MyPromptClass);
15
+ * const result = await MepCLI.prompt({ type: 'myPrompt', message: '...' });
16
+ * @see {@link https://github.com/CodeTease/mep/blob/main/examples/extension-registry.ts}
17
+ */
18
+ export interface ExtensionRegistry {
19
+ }
20
+ export interface ThemeConfig {
21
+ main: string;
22
+ success: string;
23
+ error: string;
24
+ muted: string;
25
+ title: string;
26
+ syntax: {
27
+ key: string;
28
+ string: string;
29
+ number: string;
30
+ boolean: string;
31
+ null: string;
32
+ punctuation: string;
33
+ };
34
+ }
35
+ export interface BaseOptions {
36
+ message: string;
37
+ mouse?: boolean;
38
+ }
39
+ export interface MouseEvent {
40
+ name: 'mouse';
41
+ x: number;
42
+ y: number;
43
+ button: number;
44
+ action: 'press' | 'release' | 'move' | 'scroll';
45
+ scroll?: 'up' | 'down';
46
+ shift?: boolean;
47
+ ctrl?: boolean;
48
+ meta?: boolean;
49
+ }
50
+ export interface TextOptions extends BaseOptions {
51
+ placeholder?: string;
52
+ initial?: string;
53
+ validate?: (value: string) => string | boolean | Promise<string | boolean>;
54
+ isPassword?: boolean;
55
+ multiline?: boolean;
56
+ mask?: string;
57
+ suggest?: (input: string) => string | Promise<string>;
58
+ }
59
+ export interface Separator {
60
+ separator: true;
61
+ text?: string;
62
+ }
63
+ export interface SelectChoice<V> {
64
+ title: string;
65
+ value: V;
66
+ description?: string;
67
+ }
68
+ export interface SelectOptions<V> extends BaseOptions {
69
+ choices: (SelectChoice<V> | Separator)[];
70
+ }
71
+ export interface TransferOptions<V> extends BaseOptions {
72
+ source: (string | SelectChoice<V>)[];
73
+ target?: (string | SelectChoice<V>)[];
74
+ }
75
+ export interface CronOptions extends BaseOptions {
76
+ initial?: string;
77
+ placeholder?: string;
78
+ }
79
+ export interface CheckboxChoice<V> extends SelectChoice<V> {
80
+ selected?: boolean;
81
+ }
82
+ export interface CheckboxOptions<V> extends BaseOptions {
83
+ choices: CheckboxChoice<V>[];
84
+ min?: number;
85
+ max?: number;
86
+ }
87
+ export interface ConfirmOptions extends BaseOptions {
88
+ initial?: boolean;
89
+ }
90
+ export interface NumberOptions extends BaseOptions {
91
+ initial?: number;
92
+ min?: number;
93
+ max?: number;
94
+ step?: number;
95
+ placeholder?: string;
96
+ }
97
+ export interface ToggleOptions extends BaseOptions {
98
+ initial?: boolean;
99
+ activeText?: string;
100
+ inactiveText?: string;
101
+ }
102
+ export interface ListOptions extends BaseOptions {
103
+ placeholder?: string;
104
+ initial?: string[];
105
+ validate?: (value: string[]) => string | boolean | Promise<string | boolean>;
106
+ }
107
+ export interface SliderOptions extends BaseOptions {
108
+ min: number;
109
+ max: number;
110
+ initial?: number;
111
+ step?: number;
112
+ unit?: string;
113
+ }
114
+ export interface RangeOptions extends BaseOptions {
115
+ min: number;
116
+ max: number;
117
+ initial?: [number, number];
118
+ step?: number;
119
+ unit?: string;
120
+ }
121
+ export interface SelectRangeOptions<V> extends Omit<SelectOptions<V>, 'initial'> {
122
+ initial?: [number, number];
123
+ }
124
+ export interface RatingOptions extends BaseOptions {
125
+ min?: number;
126
+ max?: number;
127
+ initial?: number;
128
+ }
129
+ export interface DateOptions extends BaseOptions {
130
+ initial?: Date;
131
+ min?: Date;
132
+ max?: Date;
133
+ }
134
+ export interface FileOptions extends BaseOptions {
135
+ basePath?: string;
136
+ extensions?: string[];
137
+ onlyDirectories?: boolean;
138
+ }
139
+ export interface MultiSelectOptions<V> extends CheckboxOptions<V> {
140
+ }
141
+ export interface AutocompleteOptions<V> extends BaseOptions {
142
+ suggest: (input: string) => Promise<SelectChoice<V>[]>;
143
+ limit?: number;
144
+ fallback?: string;
145
+ initial?: string;
146
+ }
147
+ export interface SortOptions extends BaseOptions {
148
+ items: string[];
149
+ }
150
+ export interface EditorOptions extends BaseOptions {
151
+ initial?: string;
152
+ extension?: string;
153
+ waitUserInput?: boolean;
154
+ }
155
+ export interface TableRow<V> {
156
+ value: V;
157
+ row: string[];
158
+ }
159
+ export interface TableOptions<V> extends BaseOptions {
160
+ columns: string[];
161
+ data: TableRow<V>[];
162
+ rows?: number;
163
+ }
164
+ export interface TreeNode<V> {
165
+ title: string;
166
+ value: V;
167
+ children?: TreeNode<V>[];
168
+ expanded?: boolean;
169
+ disabled?: boolean;
170
+ selected?: boolean | 'indeterminate';
171
+ }
172
+ export interface TreeOptions<V> extends BaseOptions {
173
+ data: TreeNode<V>[];
174
+ initial?: V;
175
+ indent?: number;
176
+ }
177
+ export interface KeypressOptions extends BaseOptions {
178
+ keys?: string[];
179
+ showInvisible?: boolean;
180
+ }
181
+ export interface FormField {
182
+ name: string;
183
+ message: string;
184
+ initial?: string;
185
+ validate?: (value: string) => string | boolean | Promise<string | boolean>;
186
+ }
187
+ export interface FormOptions extends BaseOptions {
188
+ fields: FormField[];
189
+ }
190
+ export interface SnippetOptions extends BaseOptions {
191
+ template: string;
192
+ values?: Record<string, string>;
193
+ fields?: Record<string, {
194
+ message?: string;
195
+ validate?: (value: string) => string | boolean;
196
+ }>;
197
+ }
198
+ export interface SpamOptions extends BaseOptions {
199
+ threshold: number;
200
+ spamKey?: string;
201
+ decay?: boolean;
202
+ }
203
+ export interface WaitOptions extends BaseOptions {
204
+ seconds: number;
205
+ autoSubmit?: boolean;
206
+ }
207
+ export interface CodeOptions extends BaseOptions {
208
+ template: string;
209
+ language?: 'json' | 'env' | 'toml' | 'csv' | 'sh' | 'bash' | 'zsh' | 'properties' | 'props' | 'conf';
210
+ /**
211
+ * Enable syntax highlighting (Experimental).
212
+ * @default true
213
+ */
214
+ highlight?: boolean;
215
+ /**
216
+ * Initial values for variables in the template.
217
+ */
218
+ values?: Record<string, string>;
219
+ }
220
+ export interface TreeSelectNode<V> {
221
+ title: string;
222
+ value: V;
223
+ children?: TreeSelectNode<V>[];
224
+ expanded?: boolean;
225
+ disabled?: boolean;
226
+ selected?: boolean | 'indeterminate';
227
+ }
228
+ export interface TreeSelectOptions<V> extends BaseOptions {
229
+ data: TreeSelectNode<V>[];
230
+ initial?: V[];
231
+ indent?: number;
232
+ }
233
+ export interface ColorOptions extends BaseOptions {
234
+ initial?: string;
235
+ format?: 'hex' | 'rgb' | 'hsl';
236
+ }
237
+ export interface GridOptions extends BaseOptions {
238
+ rows: string[];
239
+ columns: string[];
240
+ initial?: boolean[][];
241
+ }
242
+ export interface SortGridOptions extends BaseOptions {
243
+ data: string[][];
244
+ }
245
+ export interface CalendarOptions extends BaseOptions {
246
+ mode?: 'single' | 'range';
247
+ multiple?: boolean;
248
+ initial?: Date | [Date, Date];
249
+ min?: Date;
250
+ max?: Date;
251
+ weekStart?: 0 | 1;
252
+ }
253
+ export interface MapOptions extends BaseOptions {
254
+ initial?: Record<string, string>;
255
+ suggestions?: string[];
256
+ }
257
+ export interface SemVerOptions extends BaseOptions {
258
+ currentVersion: string;
259
+ }
260
+ export interface IPOptions extends BaseOptions {
261
+ initial?: string;
262
+ }
263
+ export interface OTPOptions extends BaseOptions {
264
+ length?: number;
265
+ mask?: string;
266
+ secure?: boolean;
267
+ placeholder?: string;
268
+ }
269
+ export interface QuizSelectOptions<V> extends SelectOptions<V> {
270
+ correctValue: V;
271
+ explanation?: string;
272
+ }
273
+ export interface QuizTextOptions extends TextOptions {
274
+ verify?: (value: string) => boolean | Promise<boolean>;
275
+ correctAnswer: string;
276
+ explanation?: string;
277
+ }
278
+ export interface KanbanItem {
279
+ id: string;
280
+ title: string;
281
+ [key: string]: any;
282
+ }
283
+ export interface KanbanColumn<V extends KanbanItem> {
284
+ id: string;
285
+ title: string;
286
+ items: V[];
287
+ }
288
+ export interface KanbanOptions<V extends KanbanItem> extends BaseOptions {
289
+ columns: KanbanColumn<V>[];
290
+ }
291
+ export interface TimeOptions extends BaseOptions {
292
+ format?: '12h' | '24h';
293
+ step?: number;
294
+ initial?: Date | string;
295
+ }
296
+ export interface HeatmapLegend {
297
+ value: number;
298
+ char: string;
299
+ color: (str: string) => string;
300
+ }
301
+ export interface HeatmapOptions extends BaseOptions {
302
+ rows: string[];
303
+ columns: string[];
304
+ legend: HeatmapLegend[];
305
+ initial?: number[][];
306
+ }
307
+ export interface ByteOptions extends BaseOptions {
308
+ initial?: number;
309
+ min?: number;
310
+ max?: number;
311
+ }
312
+ export interface SlotOptions extends BaseOptions {
313
+ choices: string[];
314
+ rows?: number;
315
+ initial?: number;
316
+ }
317
+ export interface GaugeOptions extends BaseOptions {
318
+ theme?: Partial<ThemeConfig>;
319
+ width?: number;
320
+ /** Safe zone width as a percentage (0-1) or absolute character count (>1). Default: 0.2 (20%) */
321
+ safeZone?: number;
322
+ }
323
+ export interface CalculatorOptions extends BaseOptions {
324
+ initial?: string;
325
+ variables?: Record<string, number>;
326
+ precision?: number;
327
+ placeholder?: string;
328
+ }
329
+ export interface EmojiItem {
330
+ char: string;
331
+ name: string;
332
+ description?: string;
333
+ }
334
+ export interface EmojiOptions extends BaseOptions {
335
+ emojis: EmojiItem[];
336
+ recent?: string[];
337
+ cols?: number;
338
+ }
339
+ export interface MatchItem {
340
+ id: string;
341
+ label: string;
342
+ value?: any;
343
+ }
344
+ export interface MatchOptions extends BaseOptions {
345
+ source: (string | MatchItem)[];
346
+ target: (string | MatchItem)[];
347
+ constraints?: {
348
+ required?: boolean;
349
+ oneToMany?: boolean;
350
+ };
351
+ }
352
+ export interface DiffOptions extends BaseOptions {
353
+ original: string;
354
+ modified: string;
355
+ context?: number;
356
+ mode?: 'inline' | 'split';
357
+ }
358
+ export interface DialOptions extends BaseOptions {
359
+ min: number;
360
+ max: number;
361
+ step?: number;
362
+ radius?: number;
363
+ pointerSymbol?: string;
364
+ initial?: number;
365
+ }
366
+ export interface DrawOptions extends BaseOptions {
367
+ width: number;
368
+ height: number;
369
+ exportType?: 'matrix' | 'text';
370
+ initial?: boolean[][];
371
+ }
372
+ export interface MultiColumnSelectOptions<V> extends SelectOptions<V> {
373
+ cols?: number | 'auto';
374
+ }
375
+ export interface FuzzySelectOptions<V> extends SelectOptions<V> {
376
+ }
377
+ export interface MillerOptions<V> extends BaseOptions {
378
+ data: TreeNode<V>[];
379
+ initial?: V[];
380
+ separator?: string;
381
+ }
382
+ export interface PatternOptions extends BaseOptions {
383
+ rows?: number;
384
+ cols?: number;
385
+ nodeChar?: string;
386
+ lineChar?: string;
387
+ }
388
+ export interface MapRegion {
389
+ id: string;
390
+ label: string;
391
+ x: number;
392
+ y: number;
393
+ description?: string;
394
+ }
395
+ export interface RegionOptions extends BaseOptions {
396
+ mapArt: string;
397
+ regions: MapRegion[];
398
+ initial?: string;
399
+ }
400
+ export interface SpreadsheetColumn {
401
+ name: string;
402
+ key: string;
403
+ width?: number;
404
+ editable?: boolean;
405
+ }
406
+ export interface SpreadsheetOptions extends BaseOptions {
407
+ columns: SpreadsheetColumn[];
408
+ data: Record<string, any>[];
409
+ rows?: number;
410
+ keyBindings?: {
411
+ save?: string[];
412
+ cancel?: string[];
413
+ };
414
+ }
415
+ export interface ScrollOptions extends BaseOptions {
416
+ content: string;
417
+ height?: number;
418
+ requireScrollToBottom?: boolean;
419
+ }
420
+ export interface BreadcrumbOptions extends BaseOptions {
421
+ root?: string;
422
+ separator?: string;
423
+ showHidden?: boolean;
424
+ }
425
+ export interface ScheduleTask {
426
+ name: string;
427
+ start: Date;
428
+ end: Date;
429
+ metadata?: any;
430
+ }
431
+ export interface ScheduleOptions extends BaseOptions {
432
+ data: ScheduleTask[];
433
+ }
434
+ export interface DataInspectorOptions extends BaseOptions {
435
+ data: any;
436
+ maxDepth?: number;
437
+ }
438
+ export interface ExecOptions extends BaseOptions {
439
+ command: string;
440
+ timeout?: number;
441
+ cwd?: string;
442
+ streamOutput?: boolean;
443
+ }
444
+ export interface ShortcutResult {
445
+ name: string;
446
+ ctrl: boolean;
447
+ shift: boolean;
448
+ meta: boolean;
449
+ sequence: string;
450
+ }
451
+ export interface ShortcutOptions extends BaseOptions {
452
+ initial?: ShortcutResult;
453
+ }
454
+ export interface SeatOptions extends BaseOptions {
455
+ layout: string[];
456
+ rows?: string[];
457
+ cols?: string[];
458
+ initial?: string[];
459
+ multiple?: boolean;
460
+ }
461
+ export interface DependencyItem<V> extends CheckboxChoice<V> {
462
+ dependsOn?: V[];
463
+ triggers?: V[];
464
+ conflictsWith?: V[];
465
+ }
466
+ export interface DependencyOptions<V> extends BaseOptions {
467
+ choices: DependencyItem<V>[];
468
+ min?: number;
469
+ max?: number;
470
+ autoResolve?: boolean;
471
+ }
472
+ export interface License {
473
+ id: string;
474
+ name: string;
475
+ description: string;
476
+ permissions: string[];
477
+ conditions: string[];
478
+ limitations: string[];
479
+ }
480
+ export interface LicenseOptions extends BaseOptions {
481
+ defaultLicense?: string;
482
+ }
483
+ export interface RegexOptions extends BaseOptions {
484
+ tests: string[];
485
+ flags?: string;
486
+ }
487
+ export interface BoxOptions extends BaseOptions {
488
+ initial?: number | {
489
+ top: number;
490
+ right: number;
491
+ bottom: number;
492
+ left: number;
493
+ };
494
+ min?: number;
495
+ max?: number;
496
+ step?: number;
497
+ }
498
+ export interface PhoneOptions extends BaseOptions {
499
+ defaultCountry?: string;
500
+ placeholder?: string;
501
+ strict?: boolean;
502
+ validate?: (value: string) => string | boolean | Promise<string | boolean>;
503
+ }
504
+ export type TaskStatus = 'pending' | 'loading' | 'success' | 'error' | 'warning';
505
+ export interface TaskConfig {
506
+ id: string;
507
+ title: string;
508
+ type?: 'spinner' | 'progress';
509
+ total?: number;
510
+ }
511
+ export interface TaskState extends TaskConfig {
512
+ status: TaskStatus;
513
+ current: number;
514
+ message?: string;
515
+ }
516
+ export interface TaskGroupOptions {
517
+ concurrency?: number;
518
+ renderer?: 'default' | 'minimal';
519
+ }
package/dist/types.js ADDED
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});
@@ -0,0 +1,82 @@
1
+ /**
2
+ * Detects terminal capabilities.
3
+ */
4
+ export declare function detectCapabilities(): {
5
+ isCI: boolean;
6
+ hasTrueColor: boolean;
7
+ hasUnicode: boolean | "";
8
+ hasMouse: boolean;
9
+ };
10
+ /**
11
+ * Strips ANSI escape codes from a string.
12
+ */
13
+ export declare function stripAnsi(str: string): string;
14
+ /**
15
+ * Calculates the visual width of a string.
16
+ * Uses binary search for wide characters.
17
+ * Handles ANSI codes (zero width).
18
+ */
19
+ export declare function stringWidth(str: string): number;
20
+ /**
21
+ * Safely splits a string into an array of grapheme clusters.
22
+ * Uses Intl.Segmenter (Node 16+).
23
+ */
24
+ export declare function safeSplit(str: string): string[];
25
+ /**
26
+ * Fuzzy match algorithm (Subsequence matching).
27
+ * Returns score and matched indices, or null if no match.
28
+ */
29
+ export declare function fuzzyMatch(query: string, target: string): {
30
+ score: number;
31
+ indices: number[];
32
+ } | null;
33
+ /**
34
+ * Layout utilities for advanced rendering (Split View, etc.)
35
+ */
36
+ export declare const Layout: {
37
+ /**
38
+ * Truncates a string to a specific visual width, respecting ANSI codes.
39
+ */
40
+ truncate(str: string, width: number): string;
41
+ /**
42
+ * Pads a string to a specific visual length.
43
+ * Respects ANSI codes (does not count them towards length).
44
+ */
45
+ pad(text: string, length: number, align?: "left" | "right" | "center"): string;
46
+ /**
47
+ * Splits two multi-line strings side-by-side.
48
+ * @param left Content for left column
49
+ * @param right Content for right column
50
+ * @param width Total available width
51
+ * @param options Configuration for ratio and gap
52
+ */
53
+ split(left: string, right: string, width: number, options?: {
54
+ ratio?: number;
55
+ gap?: number;
56
+ }): string;
57
+ /**
58
+ * Wraps a string to a specific visual width.
59
+ * Respects word boundaries where possible.
60
+ */
61
+ wrap(str: string, width: number): string;
62
+ };
63
+ /**
64
+ * Graph utilities for dependency management
65
+ */
66
+ export declare const Graph: {
67
+ /**
68
+ * Returns all dependencies (transitive) for an item.
69
+ */
70
+ getDependencies<T>(item: T, getDeps: (i: T) => T[]): T[];
71
+ /**
72
+ * Topologically sorts items based on dependencies.
73
+ * Returns items in order (dependencies first).
74
+ * Throws error if cycle detected.
75
+ */
76
+ topologicalSort<T>(items: T[], getDeps: (i: T) => T[]): T[];
77
+ };
78
+ /**
79
+ * Generates a progress bar string.
80
+ */
81
+ export declare function generateProgressBar(current: number, total: number, width?: number): string;
82
+ export declare const truncate: (str: string, width: number) => string;
package/dist/utils.js ADDED
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});function _export(target,all){for(var name in all)Object.defineProperty(target,name,{enumerable:true,get:Object.getOwnPropertyDescriptor(all,name).get})}_export(exports,{get Graph(){return Graph},get Layout(){return Layout},get detectCapabilities(){return detectCapabilities},get fuzzyMatch(){return fuzzyMatch},get generateProgressBar(){return generateProgressBar},get safeSplit(){return safeSplit},get stringWidth(){return stringWidth},get stripAnsi(){return stripAnsi},get truncate(){return truncate}});function detectCapabilities(){const env=process.env;const isCI=!!env.CI;const hasTrueColor=env.COLORTERM==="truecolor"||!!env.WT_SESSION;const isTTY=process.stdout.isTTY;const isWindows=process.platform==="win32";const isUnicodeSupported=()=>{if(isWindows){if(env.WT_SESSION)return true;if(env.TERM_PROGRAM==="vscode")return true;if(env.TERM==="xterm-256color"||env.TERM==="alacritty")return true;if(env.ConEmuTask)return true;if(isCI)return true;return false}if(env.TERM_PROGRAM==="Apple_Terminal")return true;const lang=env.LANG||"";const lcAll=env.LC_ALL||"";return lang&&lang.toUpperCase().endsWith("UTF-8")||lcAll&&lcAll.toUpperCase().endsWith("UTF-8")};return{isCI,hasTrueColor,hasUnicode:isTTY&&isUnicodeSupported(),hasMouse:isTTY&&!isCI}}function stripAnsi(str){return str.replace(/\x1b\[[0-9;]*m/g,"")}const WIDE_RANGES=[[4352,4607],[11904,12031],[12032,12255],[12288,12351],[12352,12447],[12448,12543],[12544,12591],[12592,12687],[12800,13055],[13056,13311],[13312,19903],[19968,40959],[43360,43391],[44032,55215],[55216,55295],[63744,64255],[65040,65055],[65072,65103],[65104,65135],[65281,65376],[65504,65510],[127744,128767],[129280,129535]];function isWideCodePoint(cp){let low=0;let high=WIDE_RANGES.length-1;while(low<=high){const mid=Math.floor((low+high)/2);const[start,end]=WIDE_RANGES[mid];if(cp>=start&&cp<=end){return true}else if(cp<start){high=mid-1}else{low=mid+1}}return false}function stringWidth(str){let width=0;let inAnsi=false;for(let i=0;i<str.length;i++){const code=str.charCodeAt(i);if(str[i]==="\x1b"){inAnsi=true;continue}if(inAnsi){if(str[i]==="["){continue}if(str[i]>="@"&&str[i]<="~"){inAnsi=false}continue}let cp=code;if(code>=55296&&code<=56319&&i+1<str.length){const next=str.charCodeAt(i+1);if(next>=56320&&next<=57343){cp=(code-55296)*1024+(next-56320)+65536;i++}}width+=isWideCodePoint(cp)?2:1}return width}function safeSplit(str){const segmenter=new Intl.Segmenter(undefined,{granularity:"grapheme"});const segments=segmenter.segment(str);const result=[];for(const segment of segments){result.push(segment.segment)}return result}function fuzzyMatch(query,target){if(!query)return{score:0,indices:[]};const queryLower=query.toLowerCase();const targetLower=target.toLowerCase();let queryIdx=0;let targetIdx=0;const indices=[];let score=0;let consecutive=0;let lastMatchIdx=-1;while(queryIdx<queryLower.length&&targetIdx<targetLower.length){const qChar=queryLower[queryIdx];const tChar=targetLower[targetIdx];if(qChar===tChar){indices.push(targetIdx);let charScore=1;if(lastMatchIdx!==-1&&targetIdx===lastMatchIdx+1){consecutive++;charScore+=consecutive*2}else{consecutive=0}if(targetIdx===0){charScore+=5}else if(targetIdx>0){const prevChar=target.charAt(targetIdx-1);if(/[\s_\-.]/.test(prevChar)||prevChar==="/"){charScore+=4}else if(prevChar!==prevChar.toUpperCase()&&target.charAt(targetIdx)===target.charAt(targetIdx).toUpperCase()){charScore+=3}}score+=charScore;lastMatchIdx=targetIdx;queryIdx++}targetIdx++}if(queryIdx<queryLower.length){return null}score-=target.length*.1;if(indices.length>1){const spread=indices[indices.length-1]-indices[0];score-=spread*.5}return{score,indices}}const Layout={truncate(str,width){const visualWidth=stringWidth(str);if(visualWidth<=width){return str}let currentWidth=0;let cutIndex=0;let inAnsi=false;for(let i=0;i<str.length;i++){if(str[i]==="\x1b")inAnsi=true;if(!inAnsi){const code=str.charCodeAt(i);if(code>=55296&&code<=56319&&i+1<str.length){const next=str.charCodeAt(i+1);if(next>=56320&&next<=57343){const cp=(code-55296)*1024+(next-56320)+65536;const w=isWideCodePoint(cp)?2:1;if(currentWidth+w>width)break;currentWidth+=w;cutIndex=i+2;i++;continue}}const w=isWideCodePoint(code)?2:1;if(currentWidth+w>width)break;currentWidth+=w}else{if(str[i]==="m"||str[i]>="A"&&str[i]<="Z")inAnsi=false}cutIndex=i+1}return str.substring(0,cutIndex)+"\x1b[0m"},pad(text,length,align="left"){const visualLen=stringWidth(text);if(visualLen>=length)return text;const padLen=Math.max(0,length-visualLen);if(align==="left"){return text+" ".repeat(padLen)}else if(align==="right"){return" ".repeat(padLen)+text}else{const leftPad=Math.floor(padLen/2);const rightPad=padLen-leftPad;return" ".repeat(leftPad)+text+" ".repeat(rightPad)}},split(left,right,width,options={}){const ratio=options.ratio??.5;const gap=options.gap??2;let leftWidth=Math.floor((width-gap)*ratio);let rightWidth=width-leftWidth-gap;if(leftWidth<1||rightWidth<1){leftWidth=Math.max(0,width);rightWidth=0}const leftLines=left.split("\n");const rightLines=right.split("\n");const maxLines=Math.max(leftLines.length,rightLines.length);const result=[];for(let i=0;i<maxLines;i++){const leftLine=leftLines[i]||"";const rightLine=rightLines[i]||"";const l=Layout.pad(Layout.truncate(leftLine,leftWidth),leftWidth);const r=Layout.pad(Layout.truncate(rightLine,rightWidth),rightWidth);result.push(`${l}${" ".repeat(gap)}${r}`)}return result.join("\n")},wrap(str,width){const paragraphs=str.split("\n");return paragraphs.map(para=>{const words=para.split(" ");let currentLine="";const lines=[];for(const word of words){const wordWidth=stringWidth(word);const currentWidth=stringWidth(currentLine);const spaceWidth=currentLine?1:0;if(currentWidth+spaceWidth+wordWidth<=width){currentLine+=(currentLine?" ":"")+word}else{if(currentLine)lines.push(currentLine);currentLine=word}}if(currentLine)lines.push(currentLine);return lines.join("\n")}).join("\n")}};const Graph={getDependencies(item,getDeps){const visited=new Set;const result=[];const visit=current=>{if(visited.has(current))return;visited.add(current);const deps=getDeps(current);for(const dep of deps){visit(dep)}if(current!==item){result.push(current)}};visit(item);return result},topologicalSort(items,getDeps){const visited=new Set;const temp=new Set;const order=[];const visit=node=>{if(temp.has(node)){throw new Error("Cyclic dependency detected")}if(visited.has(node))return;temp.add(node);const deps=getDeps(node);for(const dep of deps){visit(dep)}temp.delete(node);visited.add(node);order.push(node)};for(const item of items){if(!visited.has(item)){visit(item)}}return order}};function generateProgressBar(current,total,width=20){const percentage=Math.min(Math.max(current/total,0),1);const barWidth=width;const filledWidth=Math.round(barWidth*percentage);const emptyWidth=barWidth-filledWidth;const filled="█".repeat(filledWidth);const empty="-".repeat(emptyWidth);const percentStr=Math.round(percentage*100)+"%";return`[${filled}${empty}] ${percentStr}`}const truncate=Layout.truncate;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mepcli",
3
- "version": "2.0.0-beta.2",
3
+ "version": "2.0.0-beta.4",
4
4
  "description": "Zero-dependency interactive CLI prompt",
5
5
  "repository": {
6
6
  "type": "git",
@@ -15,12 +15,14 @@
15
15
  ],
16
16
  "scripts": {
17
17
  "typecheck": "tsc --noEmit",
18
- "build": "swc src -d dist --config-file .swcrc",
18
+ "compile": "swc src -d dist --strip-leading-paths --config-file .swcrc",
19
+ "types": "tsc --emitDeclarationOnly --outDir dist",
20
+ "build": "bun run compile && bun run types",
19
21
  "prepublishOnly": "bun run build",
20
22
  "test": "bun test",
21
23
  "demo": "bun example.ts",
22
- "lint": "eslint .",
23
- "lint:fix": "eslint . --fix"
24
+ "lint": "biome check ./src",
25
+ "lint:fix": "biome check --write ./src"
24
26
  },
25
27
  "keywords": [
26
28
  "cli",
@@ -45,13 +47,11 @@
45
47
  "author": "CodeTease",
46
48
  "license": "MIT",
47
49
  "devDependencies": {
48
- "@eslint/js": "^9.39.3",
50
+ "@biomejs/biome": "^1.9.4",
49
51
  "@swc/cli": "^0.8.0",
50
52
  "@swc/core": "^1.15.18",
51
- "@types/node": "^22.19.13",
52
- "eslint": "^9.39.3",
53
- "globals": "^17.4.0",
54
- "typescript": "^5.9.3",
55
- "typescript-eslint": "^8.56.1"
53
+ "@types/jest": "^30.0.0",
54
+ "@types/node": "^22.19.15",
55
+ "typescript": "^5.9.3"
56
56
  }
57
57
  }