@maizzle/framework 6.0.0-rc.0 → 6.0.0-rc.2

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 (207) hide show
  1. package/bin/maizzle.mjs +1 -1
  2. package/dist/build.mjs +25 -7
  3. package/dist/build.mjs.map +1 -1
  4. package/dist/config/index.mjs +25 -1
  5. package/dist/config/index.mjs.map +1 -1
  6. package/dist/render/createRenderer.d.mts +4 -0
  7. package/dist/render/createRenderer.d.mts.map +1 -1
  8. package/dist/render/createRenderer.mjs +10 -4
  9. package/dist/render/createRenderer.mjs.map +1 -1
  10. package/dist/render/index.mjs +5 -1
  11. package/dist/render/index.mjs.map +1 -1
  12. package/dist/serve.mjs +4 -1
  13. package/dist/serve.mjs.map +1 -1
  14. package/dist/types/config.d.mts +20 -0
  15. package/dist/types/config.d.mts.map +1 -1
  16. package/node_modules/@clack/core/CHANGELOG.md +87 -4
  17. package/node_modules/@clack/core/README.md +1 -1
  18. package/node_modules/@clack/core/dist/index.d.mts +186 -48
  19. package/node_modules/@clack/core/dist/index.mjs +10 -14
  20. package/node_modules/@clack/core/dist/index.mjs.map +1 -1
  21. package/node_modules/@clack/core/package.json +7 -9
  22. package/node_modules/@clack/prompts/CHANGELOG.md +171 -7
  23. package/node_modules/@clack/prompts/README.md +66 -3
  24. package/node_modules/@clack/prompts/dist/index.d.mts +302 -76
  25. package/node_modules/@clack/prompts/dist/index.mjs +134 -84
  26. package/node_modules/@clack/prompts/dist/index.mjs.map +1 -1
  27. package/node_modules/@clack/prompts/package.json +14 -10
  28. package/node_modules/citty/LICENSE +0 -15
  29. package/node_modules/citty/README.md +166 -69
  30. package/node_modules/citty/dist/index.d.mts +88 -56
  31. package/node_modules/citty/dist/index.mjs +399 -437
  32. package/node_modules/citty/package.json +28 -35
  33. package/node_modules/giget/README.md +59 -11
  34. package/node_modules/giget/dist/THIRD-PARTY-LICENSES.md +205 -0
  35. package/node_modules/giget/dist/_chunks/giget.mjs +508 -0
  36. package/node_modules/giget/dist/_chunks/libs/citty.mjs +269 -0
  37. package/node_modules/giget/dist/_chunks/libs/nypm.d.mts +1 -0
  38. package/node_modules/giget/dist/_chunks/libs/nypm.mjs +669 -0
  39. package/node_modules/giget/dist/_chunks/libs/tar.mjs +2931 -0
  40. package/node_modules/giget/dist/_chunks/rolldown-runtime.mjs +14 -0
  41. package/node_modules/giget/dist/cli.d.mts +1 -0
  42. package/node_modules/giget/dist/cli.mjs +89 -111
  43. package/node_modules/giget/dist/index.d.mts +46 -35
  44. package/node_modules/giget/dist/index.mjs +2 -22
  45. package/node_modules/giget/package.json +32 -45
  46. package/node_modules/maizzle/README.md +140 -0
  47. package/node_modules/maizzle/bin/maizzle.mjs +5 -0
  48. package/node_modules/maizzle/dist/commands/new.d.mts +7 -0
  49. package/node_modules/maizzle/dist/commands/new.mjs +278 -0
  50. package/node_modules/{@maizzle/cli → maizzle}/dist/index.d.mts +1 -1
  51. package/node_modules/maizzle/dist/index.mjs +44 -0
  52. package/node_modules/{commander → maizzle/node_modules/commander}/Readme.md +94 -67
  53. package/node_modules/{commander → maizzle/node_modules/commander}/lib/argument.js +5 -4
  54. package/node_modules/{commander → maizzle/node_modules/commander}/lib/command.js +154 -39
  55. package/node_modules/{commander → maizzle/node_modules/commander}/lib/help.js +77 -39
  56. package/node_modules/{commander → maizzle/node_modules/commander}/lib/option.js +16 -3
  57. package/node_modules/{commander → maizzle/node_modules/commander}/package-support.json +4 -1
  58. package/node_modules/{commander → maizzle/node_modules/commander}/package.json +8 -8
  59. package/node_modules/{commander → maizzle/node_modules/commander}/typings/index.d.ts +71 -3
  60. package/node_modules/{@maizzle/cli → maizzle}/package.json +13 -11
  61. package/node_modules/tinyexec/README.md +49 -3
  62. package/node_modules/tinyexec/dist/main.d.mts +25 -14
  63. package/node_modules/tinyexec/dist/main.mjs +148 -100
  64. package/node_modules/tinyexec/package.json +9 -8
  65. package/package.json +3 -3
  66. package/node_modules/@clack/core/dist/index.cjs +0 -15
  67. package/node_modules/@clack/core/dist/index.cjs.map +0 -1
  68. package/node_modules/@clack/core/dist/index.d.cts +0 -211
  69. package/node_modules/@clack/core/dist/index.d.ts +0 -211
  70. package/node_modules/@clack/prompts/dist/index.cjs +0 -87
  71. package/node_modules/@clack/prompts/dist/index.cjs.map +0 -1
  72. package/node_modules/@clack/prompts/dist/index.d.cts +0 -165
  73. package/node_modules/@clack/prompts/dist/index.d.ts +0 -165
  74. package/node_modules/@maizzle/cli/README.md +0 -58
  75. package/node_modules/@maizzle/cli/dist/index.mjs +0 -42
  76. package/node_modules/citty/dist/index.cjs +0 -475
  77. package/node_modules/citty/dist/index.d.cts +0 -80
  78. package/node_modules/citty/dist/index.d.ts +0 -80
  79. package/node_modules/consola/LICENSE +0 -47
  80. package/node_modules/consola/README.md +0 -352
  81. package/node_modules/consola/basic.d.ts +0 -1
  82. package/node_modules/consola/browser.d.ts +0 -1
  83. package/node_modules/consola/core.d.ts +0 -1
  84. package/node_modules/consola/dist/basic.cjs +0 -32
  85. package/node_modules/consola/dist/basic.d.cts +0 -23
  86. package/node_modules/consola/dist/basic.d.mts +0 -21
  87. package/node_modules/consola/dist/basic.d.ts +0 -23
  88. package/node_modules/consola/dist/basic.mjs +0 -24
  89. package/node_modules/consola/dist/browser.cjs +0 -84
  90. package/node_modules/consola/dist/browser.d.cts +0 -23
  91. package/node_modules/consola/dist/browser.d.mts +0 -21
  92. package/node_modules/consola/dist/browser.d.ts +0 -23
  93. package/node_modules/consola/dist/browser.mjs +0 -76
  94. package/node_modules/consola/dist/chunks/prompt.cjs +0 -288
  95. package/node_modules/consola/dist/chunks/prompt.mjs +0 -280
  96. package/node_modules/consola/dist/core.cjs +0 -517
  97. package/node_modules/consola/dist/core.d.cts +0 -459
  98. package/node_modules/consola/dist/core.d.mts +0 -459
  99. package/node_modules/consola/dist/core.d.ts +0 -459
  100. package/node_modules/consola/dist/core.mjs +0 -512
  101. package/node_modules/consola/dist/index.cjs +0 -663
  102. package/node_modules/consola/dist/index.d.cts +0 -24
  103. package/node_modules/consola/dist/index.d.mts +0 -22
  104. package/node_modules/consola/dist/index.d.ts +0 -24
  105. package/node_modules/consola/dist/index.mjs +0 -651
  106. package/node_modules/consola/dist/shared/consola.DCGIlDNP.cjs +0 -75
  107. package/node_modules/consola/dist/shared/consola.DRwqZj3T.mjs +0 -72
  108. package/node_modules/consola/dist/shared/consola.DXBYu-KD.mjs +0 -288
  109. package/node_modules/consola/dist/shared/consola.DwRq1yyg.cjs +0 -312
  110. package/node_modules/consola/dist/utils.cjs +0 -64
  111. package/node_modules/consola/dist/utils.d.cts +0 -286
  112. package/node_modules/consola/dist/utils.d.mts +0 -286
  113. package/node_modules/consola/dist/utils.d.ts +0 -286
  114. package/node_modules/consola/dist/utils.mjs +0 -54
  115. package/node_modules/consola/lib/index.cjs +0 -10
  116. package/node_modules/consola/package.json +0 -136
  117. package/node_modules/consola/utils.d.ts +0 -1
  118. package/node_modules/create-maizzle/README.md +0 -86
  119. package/node_modules/create-maizzle/bin/create-maizzle.mjs +0 -4
  120. package/node_modules/create-maizzle/node_modules/@clack/core/CHANGELOG.md +0 -340
  121. package/node_modules/create-maizzle/node_modules/@clack/core/LICENSE +0 -9
  122. package/node_modules/create-maizzle/node_modules/@clack/core/README.md +0 -22
  123. package/node_modules/create-maizzle/node_modules/@clack/core/dist/index.d.mts +0 -349
  124. package/node_modules/create-maizzle/node_modules/@clack/core/dist/index.mjs +0 -11
  125. package/node_modules/create-maizzle/node_modules/@clack/core/dist/index.mjs.map +0 -1
  126. package/node_modules/create-maizzle/node_modules/@clack/core/package.json +0 -60
  127. package/node_modules/create-maizzle/node_modules/@clack/prompts/CHANGELOG.md +0 -576
  128. package/node_modules/create-maizzle/node_modules/@clack/prompts/LICENSE +0 -9
  129. package/node_modules/create-maizzle/node_modules/@clack/prompts/README.md +0 -270
  130. package/node_modules/create-maizzle/node_modules/@clack/prompts/dist/index.d.mts +0 -391
  131. package/node_modules/create-maizzle/node_modules/@clack/prompts/dist/index.mjs +0 -137
  132. package/node_modules/create-maizzle/node_modules/@clack/prompts/dist/index.mjs.map +0 -1
  133. package/node_modules/create-maizzle/node_modules/@clack/prompts/package.json +0 -65
  134. package/node_modules/create-maizzle/package.json +0 -47
  135. package/node_modules/create-maizzle/src/index.js +0 -242
  136. package/node_modules/defu/LICENSE +0 -21
  137. package/node_modules/defu/README.md +0 -171
  138. package/node_modules/defu/dist/defu.cjs +0 -77
  139. package/node_modules/defu/dist/defu.d.cts +0 -31
  140. package/node_modules/defu/dist/defu.d.mts +0 -29
  141. package/node_modules/defu/dist/defu.d.ts +0 -31
  142. package/node_modules/defu/dist/defu.mjs +0 -69
  143. package/node_modules/defu/lib/defu.cjs +0 -10
  144. package/node_modules/defu/lib/defu.d.cts +0 -12
  145. package/node_modules/defu/package.json +0 -48
  146. package/node_modules/giget/dist/shared/giget.OCaTp9b-.mjs +0 -468
  147. package/node_modules/node-fetch-native/LICENSE +0 -114
  148. package/node_modules/node-fetch-native/README.md +0 -225
  149. package/node_modules/node-fetch-native/dist/chunks/multipart-parser.cjs +0 -2
  150. package/node_modules/node-fetch-native/dist/chunks/multipart-parser.mjs +0 -2
  151. package/node_modules/node-fetch-native/dist/index.cjs +0 -1
  152. package/node_modules/node-fetch-native/dist/index.mjs +0 -1
  153. package/node_modules/node-fetch-native/dist/native.cjs +0 -1
  154. package/node_modules/node-fetch-native/dist/native.mjs +0 -1
  155. package/node_modules/node-fetch-native/dist/node.cjs +0 -19
  156. package/node_modules/node-fetch-native/dist/node.mjs +0 -19
  157. package/node_modules/node-fetch-native/dist/polyfill.cjs +0 -1
  158. package/node_modules/node-fetch-native/dist/polyfill.mjs +0 -1
  159. package/node_modules/node-fetch-native/dist/proxy-stub.cjs +0 -1
  160. package/node_modules/node-fetch-native/dist/proxy-stub.mjs +0 -1
  161. package/node_modules/node-fetch-native/dist/proxy.cjs +0 -58
  162. package/node_modules/node-fetch-native/dist/shared/node-fetch-native.DfbY2q-x.mjs +0 -1
  163. package/node_modules/node-fetch-native/dist/shared/node-fetch-native.DhEqb06g.cjs +0 -1
  164. package/node_modules/node-fetch-native/index.d.ts +0 -1
  165. package/node_modules/node-fetch-native/lib/empty.cjs +0 -0
  166. package/node_modules/node-fetch-native/lib/empty.mjs +0 -0
  167. package/node_modules/node-fetch-native/lib/index.cjs +0 -11
  168. package/node_modules/node-fetch-native/lib/index.d.cts +0 -10
  169. package/node_modules/node-fetch-native/lib/index.d.mts +0 -10
  170. package/node_modules/node-fetch-native/lib/index.d.ts +0 -10
  171. package/node_modules/node-fetch-native/lib/native.cjs +0 -11
  172. package/node_modules/node-fetch-native/lib/polyfill.d.cts +0 -1
  173. package/node_modules/node-fetch-native/lib/polyfill.d.mts +0 -1
  174. package/node_modules/node-fetch-native/lib/polyfill.d.ts +0 -1
  175. package/node_modules/node-fetch-native/lib/proxy.d.ts +0 -32
  176. package/node_modules/node-fetch-native/node.d.ts +0 -1
  177. package/node_modules/node-fetch-native/package.json +0 -138
  178. package/node_modules/node-fetch-native/polyfill.d.ts +0 -1
  179. package/node_modules/node-fetch-native/proxy.d.ts +0 -1
  180. package/node_modules/nypm/node_modules/citty/LICENSE +0 -21
  181. package/node_modules/nypm/node_modules/citty/README.md +0 -231
  182. package/node_modules/nypm/node_modules/citty/dist/index.d.mts +0 -112
  183. package/node_modules/nypm/node_modules/citty/dist/index.mjs +0 -425
  184. package/node_modules/nypm/node_modules/citty/package.json +0 -42
  185. /package/node_modules/{nypm/node_modules/citty → citty}/dist/THIRD-PARTY-LICENSES.md +0 -0
  186. /package/node_modules/{nypm/node_modules/citty → citty}/dist/_chunks/libs/scule.mjs +0 -0
  187. /package/node_modules/{@maizzle/cli → maizzle}/LICENSE +0 -0
  188. /package/node_modules/{@maizzle/cli → maizzle}/dist/commands/make/component.d.mts +0 -0
  189. /package/node_modules/{@maizzle/cli → maizzle}/dist/commands/make/component.mjs +0 -0
  190. /package/node_modules/{@maizzle/cli → maizzle}/dist/commands/make/config.d.mts +0 -0
  191. /package/node_modules/{@maizzle/cli → maizzle}/dist/commands/make/config.mjs +0 -0
  192. /package/node_modules/{@maizzle/cli → maizzle}/dist/commands/make/layout.d.mts +0 -0
  193. /package/node_modules/{@maizzle/cli → maizzle}/dist/commands/make/layout.mjs +0 -0
  194. /package/node_modules/{@maizzle/cli → maizzle}/dist/commands/make/scaffold.d.mts +0 -0
  195. /package/node_modules/{@maizzle/cli → maizzle}/dist/commands/make/scaffold.mjs +0 -0
  196. /package/node_modules/{@maizzle/cli → maizzle}/dist/commands/make/stubs/component.vue +0 -0
  197. /package/node_modules/{@maizzle/cli → maizzle}/dist/commands/make/stubs/config.ts +0 -0
  198. /package/node_modules/{@maizzle/cli → maizzle}/dist/commands/make/stubs/layout.vue +0 -0
  199. /package/node_modules/{@maizzle/cli → maizzle}/dist/commands/make/stubs/template.vue +0 -0
  200. /package/node_modules/{@maizzle/cli → maizzle}/dist/commands/make/template.d.mts +0 -0
  201. /package/node_modules/{@maizzle/cli → maizzle}/dist/commands/make/template.mjs +0 -0
  202. /package/node_modules/{commander → maizzle/node_modules/commander}/LICENSE +0 -0
  203. /package/node_modules/{commander → maizzle/node_modules/commander}/esm.mjs +0 -0
  204. /package/node_modules/{commander → maizzle/node_modules/commander}/index.js +0 -0
  205. /package/node_modules/{commander → maizzle/node_modules/commander}/lib/error.js +0 -0
  206. /package/node_modules/{commander → maizzle/node_modules/commander}/lib/suggestSimilar.js +0 -0
  207. /package/node_modules/{commander → maizzle/node_modules/commander}/typings/esm.d.mts +0 -0
@@ -1,270 +0,0 @@
1
- # `@clack/prompts`
2
-
3
- Effortlessly build beautiful command-line apps 🪄 [Try the demo](https://stackblitz.com/edit/clack-prompts?file=index.js)
4
-
5
- ![clack-prompt](https://github.com/bombshell-dev/clack/blob/main/.github/assets/clack-demo.gif)
6
-
7
- ---
8
-
9
- `@clack/prompts` is an opinionated, pre-styled wrapper around [`@clack/core`](https://www.npmjs.com/package/@clack/core).
10
-
11
- - 🤏 80% smaller than other options
12
- - 💎 Beautiful, minimal UI
13
- - ✅ Simple API
14
- - 🧱 Comes with `text`, `confirm`, `select`, `multiselect`, and `spinner` components
15
-
16
- ## Basics
17
-
18
- ### Setup
19
-
20
- The `intro` and `outro` functions will print a message to begin or end a prompt session, respectively.
21
-
22
- ```js
23
- import { intro, outro } from '@clack/prompts';
24
-
25
- intro(`create-my-app`);
26
- // Do stuff
27
- outro(`You're all set!`);
28
- ```
29
-
30
- ### Cancellation
31
-
32
- The `isCancel` function is a guard that detects when a user cancels a question with `CTRL + C`. You should handle this situation for each prompt, optionally providing a nice cancellation message with the `cancel` utility.
33
-
34
- ```js
35
- import { isCancel, cancel, text } from '@clack/prompts';
36
-
37
- const value = await text({
38
- message: 'What is the meaning of life?',
39
- });
40
-
41
- if (isCancel(value)) {
42
- cancel('Operation cancelled.');
43
- process.exit(0);
44
- }
45
- ```
46
-
47
- ## Components
48
-
49
- ### Text
50
-
51
- The text component accepts a single line of text.
52
-
53
- ```js
54
- import { text } from '@clack/prompts';
55
-
56
- const meaning = await text({
57
- message: 'What is the meaning of life?',
58
- placeholder: 'Not sure',
59
- initialValue: '42',
60
- validate(value) {
61
- if (value.length === 0) return `Value is required!`;
62
- },
63
- });
64
- ```
65
-
66
- ### Confirm
67
-
68
- The confirm component accepts a yes or no answer. The result is a boolean value of `true` or `false`.
69
-
70
- ```js
71
- import { confirm } from '@clack/prompts';
72
-
73
- const shouldContinue = await confirm({
74
- message: 'Do you want to continue?',
75
- });
76
- ```
77
-
78
- ### Select
79
-
80
- The select component allows a user to choose one value from a list of options. The result is the `value` prop of a given option.
81
-
82
- ```js
83
- import { select } from '@clack/prompts';
84
-
85
- const projectType = await select({
86
- message: 'Pick a project type.',
87
- options: [
88
- { value: 'ts', label: 'TypeScript' },
89
- { value: 'js', label: 'JavaScript', disabled: true },
90
- { value: 'coffee', label: 'CoffeeScript', hint: 'oh no' },
91
- ],
92
- });
93
- ```
94
-
95
- ### Multi-Select
96
-
97
- The `multiselect` component allows a user to choose many values from a list of options. The result is an array with all selected `value` props.
98
-
99
- ```js
100
- import { multiselect } from '@clack/prompts';
101
-
102
- const additionalTools = await multiselect({
103
- message: 'Select additional tools.',
104
- options: [
105
- { value: 'eslint', label: 'ESLint', hint: 'recommended' },
106
- { value: 'prettier', label: 'Prettier', disabled: true },
107
- { value: 'gh-action', label: 'GitHub Action' },
108
- ],
109
- required: false,
110
- });
111
- ```
112
-
113
- It is also possible to select multiple items arranged into hierarchy by using `groupMultiselect`:
114
-
115
- ```js
116
- import { groupMultiselect } from '@clack/prompts';
117
-
118
- const basket = await groupMultiselect({
119
- message: 'Select your favorite fruits and vegetables:',
120
- options: {
121
- fruits: [
122
- { value: 'apple', label: 'apple' },
123
- { value: 'banana', label: 'banana' },
124
- { value: 'cherry', label: 'cherry' },
125
- ],
126
- vegetables: [
127
- { value: 'carrot', label: 'carrot' },
128
- { value: 'spinach', label: 'spinach' },
129
- { value: 'potato', label: 'potato' },
130
- ]
131
- }
132
- });
133
- ```
134
-
135
- ### Spinner
136
-
137
- The spinner component surfaces a pending action, such as a long-running download or dependency installation.
138
-
139
- ```js
140
- import { spinner } from '@clack/prompts';
141
-
142
- const s = spinner();
143
- s.start('Installing via npm');
144
- // Do installation here
145
- s.stop('Installed via npm');
146
- ```
147
-
148
- ### Progress
149
-
150
- The progress component extends the spinner component to add a progress bar to visualize the progression of an action.
151
-
152
- ```js
153
- import { progress } from '@clack/prompts';
154
-
155
- const p = progress({ max: 10 });
156
- p.start('Downloading archive');
157
- // Do download here
158
- p.advance(3, 'Downloading (30%)');
159
- // ...
160
- p.advance(8, 'Downloading (80%)');
161
- // ...
162
- p.stop('Archive downloaded');
163
- ```
164
-
165
- ## Utilities
166
-
167
- ### Grouping
168
-
169
- Grouping prompts together is a great way to keep your code organized. This accepts a JSON object with a name that can be used to reference the group later. The second argument is an optional but has a `onCancel` callback that will be called if the user cancels one of the prompts in the group.
170
-
171
- ```js
172
- import * as p from '@clack/prompts';
173
-
174
- const group = await p.group(
175
- {
176
- name: () => p.text({ message: 'What is your name?' }),
177
- age: () => p.text({ message: 'What is your age?' }),
178
- color: ({ results }) =>
179
- p.multiselect({
180
- message: `What is your favorite color ${results.name}?`,
181
- options: [
182
- { value: 'red', label: 'Red' },
183
- { value: 'green', label: 'Green' },
184
- { value: 'blue', label: 'Blue' },
185
- ],
186
- }),
187
- },
188
- {
189
- // On Cancel callback that wraps the group
190
- // So if the user cancels one of the prompts in the group this function will be called
191
- onCancel: ({ results }) => {
192
- p.cancel('Operation cancelled.');
193
- process.exit(0);
194
- },
195
- }
196
- );
197
-
198
- console.log(group.name, group.age, group.color);
199
- ```
200
-
201
- ### Tasks
202
-
203
- Execute multiple tasks in spinners.
204
-
205
- ```js
206
- import { tasks } from '@clack/prompts';
207
-
208
- await tasks([
209
- {
210
- title: 'Installing via npm',
211
- task: async (message) => {
212
- // Do installation here
213
- return 'Installed via npm';
214
- },
215
- },
216
- ]);
217
- ```
218
-
219
- ### Logs
220
-
221
- ```js
222
- import { log } from '@clack/prompts';
223
-
224
- log.info('Info!');
225
- log.success('Success!');
226
- log.step('Step!');
227
- log.warn('Warn!');
228
- log.error('Error!');
229
- log.message('Hello, World', { symbol: color.cyan('~') });
230
- ```
231
-
232
-
233
- ### Stream
234
-
235
- When interacting with dynamic LLMs or other streaming message providers, use the `stream` APIs to log messages from an iterable, even an async one.
236
-
237
- ```js
238
- import { stream } from '@clack/prompts';
239
-
240
- stream.info((function *() { yield 'Info!'; })());
241
- stream.success((function *() { yield 'Success!'; })());
242
- stream.step((function *() { yield 'Step!'; })());
243
- stream.warn((function *() { yield 'Warn!'; })());
244
- stream.error((function *() { yield 'Error!'; })());
245
- stream.message((function *() { yield 'Hello'; yield ", World" })(), { symbol: color.cyan('~') });
246
- ```
247
-
248
- ![clack-log-prompts](https://github.com/bombshell-dev/clack/blob/main/.github/assets/clack-logs.png)
249
-
250
- ### Task Log
251
-
252
- When executing a sub-process or a similar sub-task, `taskLog` can be used to render the output continuously and clear it at the end if it was successful.
253
-
254
- ```js
255
- import { taskLog } from '@clack/prompts';
256
-
257
- const log = taskLog({
258
- title: 'Running npm install'
259
- });
260
-
261
- for await (const line of npmInstall()) {
262
- log.message(line);
263
- }
264
-
265
- if (success) {
266
- log.success('Done!');
267
- } else {
268
- log.error('Failed!');
269
- }
270
- ```
@@ -1,391 +0,0 @@
1
- import { State, AutocompletePrompt, DateFormat } from '@clack/core';
2
- export { ClackSettings, DateFormat, isCancel, settings, updateSettings } from '@clack/core';
3
- import { Readable, Writable } from 'node:stream';
4
-
5
- declare const unicode: boolean;
6
- declare const isCI: () => boolean;
7
- declare const isTTY: (output: Writable) => boolean;
8
- declare const unicodeOr: (c: string, fallback: string) => string;
9
- declare const S_STEP_ACTIVE: string;
10
- declare const S_STEP_CANCEL: string;
11
- declare const S_STEP_ERROR: string;
12
- declare const S_STEP_SUBMIT: string;
13
- declare const S_BAR_START: string;
14
- declare const S_BAR: string;
15
- declare const S_BAR_END: string;
16
- declare const S_BAR_START_RIGHT: string;
17
- declare const S_BAR_END_RIGHT: string;
18
- declare const S_RADIO_ACTIVE: string;
19
- declare const S_RADIO_INACTIVE: string;
20
- declare const S_CHECKBOX_ACTIVE: string;
21
- declare const S_CHECKBOX_SELECTED: string;
22
- declare const S_CHECKBOX_INACTIVE: string;
23
- declare const S_PASSWORD_MASK: string;
24
- declare const S_BAR_H: string;
25
- declare const S_CORNER_TOP_RIGHT: string;
26
- declare const S_CONNECT_LEFT: string;
27
- declare const S_CORNER_BOTTOM_RIGHT: string;
28
- declare const S_CORNER_BOTTOM_LEFT: string;
29
- declare const S_CORNER_TOP_LEFT: string;
30
- declare const S_INFO: string;
31
- declare const S_SUCCESS: string;
32
- declare const S_WARN: string;
33
- declare const S_ERROR: string;
34
- declare const symbol: (state: State) => string;
35
- declare const symbolBar: (state: State) => string;
36
- interface CommonOptions {
37
- input?: Readable;
38
- output?: Writable;
39
- signal?: AbortSignal;
40
- withGuide?: boolean;
41
- }
42
-
43
- type Primitive = Readonly<string | boolean | number>;
44
- type Option<Value> = Value extends Primitive ? {
45
- /**
46
- * Internal data for this option.
47
- */
48
- value: Value;
49
- /**
50
- * The optional, user-facing text for this option.
51
- *
52
- * By default, the `value` is converted to a string.
53
- */
54
- label?: string;
55
- /**
56
- * An optional hint to display to the user when
57
- * this option might be selected.
58
- *
59
- * By default, no `hint` is displayed.
60
- */
61
- hint?: string;
62
- /**
63
- * Whether this option is disabled.
64
- * Disabled options are visible but cannot be selected.
65
- *
66
- * By default, options are not disabled.
67
- */
68
- disabled?: boolean;
69
- } : {
70
- /**
71
- * Internal data for this option.
72
- */
73
- value: Value;
74
- /**
75
- * Required. The user-facing text for this option.
76
- */
77
- label: string;
78
- /**
79
- * An optional hint to display to the user when
80
- * this option might be selected.
81
- *
82
- * By default, no `hint` is displayed.
83
- */
84
- hint?: string;
85
- /**
86
- * Whether this option is disabled.
87
- * Disabled options are visible but cannot be selected.
88
- *
89
- * By default, options are not disabled.
90
- */
91
- disabled?: boolean;
92
- };
93
- interface SelectOptions<Value> extends CommonOptions {
94
- message: string;
95
- options: Option<Value>[];
96
- initialValue?: Value;
97
- maxItems?: number;
98
- }
99
- declare const select: <Value>(opts: SelectOptions<Value>) => Promise<Value | symbol>;
100
-
101
- interface AutocompleteSharedOptions<Value> extends CommonOptions {
102
- /**
103
- * The message to display to the user.
104
- */
105
- message: string;
106
- /**
107
- * Available options for the autocomplete prompt.
108
- */
109
- options: Option<Value>[] | ((this: AutocompletePrompt<Option<Value>>) => Option<Value>[]);
110
- /**
111
- * Maximum number of items to display at once.
112
- */
113
- maxItems?: number;
114
- /**
115
- * Placeholder text to display when no input is provided.
116
- */
117
- placeholder?: string;
118
- /**
119
- * Validates the value
120
- */
121
- validate?: (value: Value | Value[] | undefined) => string | Error | undefined;
122
- /**
123
- * Custom filter function to match options against search input.
124
- * If not provided, a default filter that matches label, hint, and value is used.
125
- */
126
- filter?: (search: string, option: Option<Value>) => boolean;
127
- }
128
- interface AutocompleteOptions<Value> extends AutocompleteSharedOptions<Value> {
129
- /**
130
- * The initial selected value.
131
- */
132
- initialValue?: Value;
133
- /**
134
- * The initial user input
135
- */
136
- initialUserInput?: string;
137
- }
138
- declare const autocomplete: <Value>(opts: AutocompleteOptions<Value>) => Promise<Value | symbol>;
139
- interface AutocompleteMultiSelectOptions<Value> extends AutocompleteSharedOptions<Value> {
140
- /**
141
- * The initial selected values
142
- */
143
- initialValues?: Value[];
144
- /**
145
- * If true, at least one option must be selected
146
- */
147
- required?: boolean;
148
- }
149
- /**
150
- * Integrated autocomplete multiselect - combines type-ahead filtering with multiselect in one UI
151
- */
152
- declare const autocompleteMultiselect: <Value>(opts: AutocompleteMultiSelectOptions<Value>) => Promise<Value[] | symbol>;
153
-
154
- type BoxAlignment = 'left' | 'center' | 'right';
155
- interface BoxOptions extends CommonOptions {
156
- contentAlign?: BoxAlignment;
157
- titleAlign?: BoxAlignment;
158
- width?: number | 'auto';
159
- titlePadding?: number;
160
- contentPadding?: number;
161
- rounded?: boolean;
162
- formatBorder?: (text: string) => string;
163
- }
164
- declare const box: (message?: string, title?: string, opts?: BoxOptions) => void;
165
-
166
- interface ConfirmOptions extends CommonOptions {
167
- message: string;
168
- active?: string;
169
- inactive?: string;
170
- initialValue?: boolean;
171
- vertical?: boolean;
172
- }
173
- declare const confirm: (opts: ConfirmOptions) => Promise<boolean | symbol>;
174
-
175
- interface DateOptions extends CommonOptions {
176
- message: string;
177
- format?: DateFormat;
178
- locale?: string;
179
- defaultValue?: Date;
180
- initialValue?: Date;
181
- minDate?: Date;
182
- maxDate?: Date;
183
- validate?: (value: Date | undefined) => string | Error | undefined;
184
- }
185
- declare const date: (opts: DateOptions) => Promise<Date | symbol>;
186
-
187
- type Prettify<T> = {
188
- [P in keyof T]: T[P];
189
- } & {};
190
- type PromptGroupAwaitedReturn<T> = {
191
- [P in keyof T]: Exclude<Awaited<T[P]>, symbol>;
192
- };
193
- interface PromptGroupOptions<T> {
194
- /**
195
- * Control how the group can be canceled
196
- * if one of the prompts is canceled.
197
- */
198
- onCancel?: (opts: {
199
- results: Prettify<Partial<PromptGroupAwaitedReturn<T>>>;
200
- }) => void;
201
- }
202
- type PromptGroup<T> = {
203
- [P in keyof T]: (opts: {
204
- results: Prettify<Partial<PromptGroupAwaitedReturn<Omit<T, P>>>>;
205
- }) => undefined | Promise<T[P] | undefined>;
206
- };
207
- /**
208
- * Define a group of prompts to be displayed
209
- * and return a results of objects within the group
210
- */
211
- declare const group: <T>(prompts: PromptGroup<T>, opts?: PromptGroupOptions<T>) => Promise<Prettify<PromptGroupAwaitedReturn<T>>>;
212
-
213
- interface GroupMultiSelectOptions<Value> extends CommonOptions {
214
- message: string;
215
- options: Record<string, Option<Value>[]>;
216
- initialValues?: Value[];
217
- required?: boolean;
218
- cursorAt?: Value;
219
- selectableGroups?: boolean;
220
- groupSpacing?: number;
221
- }
222
- declare const groupMultiselect: <Value>(opts: GroupMultiSelectOptions<Value>) => Promise<Value[] | symbol>;
223
-
224
- interface LimitOptionsParams<TOption> extends CommonOptions {
225
- options: TOption[];
226
- cursor: number;
227
- style: (option: TOption, active: boolean) => string;
228
- maxItems?: number;
229
- columnPadding?: number;
230
- rowPadding?: number;
231
- }
232
- declare const limitOptions: <TOption>({ cursor, options, style, output, maxItems, columnPadding, rowPadding, }: LimitOptionsParams<TOption>) => string[];
233
-
234
- interface LogMessageOptions extends CommonOptions {
235
- symbol?: string;
236
- spacing?: number;
237
- secondarySymbol?: string;
238
- }
239
- declare const log: {
240
- message: (message?: string | string[], { symbol, secondarySymbol, output, spacing, withGuide, }?: LogMessageOptions) => void;
241
- info: (message: string, opts?: LogMessageOptions) => void;
242
- success: (message: string, opts?: LogMessageOptions) => void;
243
- step: (message: string, opts?: LogMessageOptions) => void;
244
- warn: (message: string, opts?: LogMessageOptions) => void;
245
- /** alias for `log.warn()`. */
246
- warning: (message: string, opts?: LogMessageOptions) => void;
247
- error: (message: string, opts?: LogMessageOptions) => void;
248
- };
249
-
250
- declare const cancel: (message?: string, opts?: CommonOptions) => void;
251
- declare const intro: (title?: string, opts?: CommonOptions) => void;
252
- declare const outro: (message?: string, opts?: CommonOptions) => void;
253
-
254
- interface MultiSelectOptions<Value> extends CommonOptions {
255
- message: string;
256
- options: Option<Value>[];
257
- initialValues?: Value[];
258
- maxItems?: number;
259
- required?: boolean;
260
- cursorAt?: Value;
261
- }
262
- declare const multiselect: <Value>(opts: MultiSelectOptions<Value>) => Promise<Value[] | symbol>;
263
-
264
- type FormatFn = (line: string) => string;
265
- interface NoteOptions extends CommonOptions {
266
- format?: FormatFn;
267
- }
268
- declare const note: (message?: string, title?: string, opts?: NoteOptions) => void;
269
-
270
- interface PasswordOptions extends CommonOptions {
271
- message: string;
272
- mask?: string;
273
- validate?: (value: string | undefined) => string | Error | undefined;
274
- clearOnError?: boolean;
275
- }
276
- declare const password: (opts: PasswordOptions) => Promise<string | symbol>;
277
-
278
- interface PathOptions extends CommonOptions {
279
- root?: string;
280
- directory?: boolean;
281
- initialValue?: string;
282
- message: string;
283
- validate?: (value: string | undefined) => string | Error | undefined;
284
- }
285
- declare const path: (opts: PathOptions) => Promise<string | symbol>;
286
-
287
- interface SpinnerOptions extends CommonOptions {
288
- indicator?: 'dots' | 'timer';
289
- onCancel?: () => void;
290
- cancelMessage?: string;
291
- errorMessage?: string;
292
- frames?: string[];
293
- delay?: number;
294
- styleFrame?: (frame: string) => string;
295
- }
296
- interface SpinnerResult {
297
- start(msg?: string): void;
298
- stop(msg?: string): void;
299
- cancel(msg?: string): void;
300
- error(msg?: string): void;
301
- message(msg?: string): void;
302
- clear(): void;
303
- readonly isCancelled: boolean;
304
- }
305
- declare const spinner: ({ indicator, onCancel, output, cancelMessage, errorMessage, frames, delay, signal, ...opts }?: SpinnerOptions) => SpinnerResult;
306
-
307
- interface ProgressOptions extends SpinnerOptions {
308
- style?: 'light' | 'heavy' | 'block';
309
- max?: number;
310
- size?: number;
311
- }
312
- interface ProgressResult extends SpinnerResult {
313
- advance(step?: number, msg?: string): void;
314
- }
315
- declare function progress({ style, max: userMax, size: userSize, ...spinnerOptions }?: ProgressOptions): ProgressResult;
316
-
317
- interface SelectKeyOptions<Value extends string> extends CommonOptions {
318
- message: string;
319
- options: Option<Value>[];
320
- initialValue?: Value;
321
- caseSensitive?: boolean;
322
- }
323
- declare const selectKey: <Value extends string>(opts: SelectKeyOptions<Value>) => Promise<Value | symbol>;
324
-
325
- declare const stream: {
326
- message: (iterable: Iterable<string> | AsyncIterable<string>, { symbol }?: LogMessageOptions) => Promise<void>;
327
- info: (iterable: Iterable<string> | AsyncIterable<string>) => Promise<void>;
328
- success: (iterable: Iterable<string> | AsyncIterable<string>) => Promise<void>;
329
- step: (iterable: Iterable<string> | AsyncIterable<string>) => Promise<void>;
330
- warn: (iterable: Iterable<string> | AsyncIterable<string>) => Promise<void>;
331
- /** alias for `log.warn()`. */
332
- warning: (iterable: Iterable<string> | AsyncIterable<string>) => Promise<void>;
333
- error: (iterable: Iterable<string> | AsyncIterable<string>) => Promise<void>;
334
- };
335
-
336
- type Task = {
337
- /**
338
- * Task title
339
- */
340
- title: string;
341
- /**
342
- * Task function
343
- */
344
- task: (message: (string: string) => void) => string | Promise<string> | void | Promise<void>;
345
- /**
346
- * If enabled === false the task will be skipped
347
- */
348
- enabled?: boolean;
349
- };
350
- /**
351
- * Define a group of tasks to be executed
352
- */
353
- declare const tasks: (tasks: Task[], opts?: CommonOptions) => Promise<void>;
354
-
355
- interface TaskLogOptions extends CommonOptions {
356
- title: string;
357
- limit?: number;
358
- spacing?: number;
359
- retainLog?: boolean;
360
- }
361
- interface TaskLogMessageOptions {
362
- raw?: boolean;
363
- }
364
- interface TaskLogCompletionOptions {
365
- showLog?: boolean;
366
- }
367
- /**
368
- * Renders a log which clears on success and remains on failure
369
- */
370
- declare const taskLog: (opts: TaskLogOptions) => {
371
- message(msg: string, mopts?: TaskLogMessageOptions): void;
372
- group(name: string): {
373
- message(msg: string, mopts?: TaskLogMessageOptions): void;
374
- error(message: string): void;
375
- success(message: string): void;
376
- };
377
- error(message: string, opts?: TaskLogCompletionOptions): void;
378
- success(message: string, opts?: TaskLogCompletionOptions): void;
379
- };
380
-
381
- interface TextOptions extends CommonOptions {
382
- message: string;
383
- placeholder?: string;
384
- defaultValue?: string;
385
- initialValue?: string;
386
- validate?: (value: string | undefined) => string | Error | undefined;
387
- }
388
- declare const text: (opts: TextOptions) => Promise<string | symbol>;
389
-
390
- export { S_BAR, S_BAR_END, S_BAR_END_RIGHT, S_BAR_H, S_BAR_START, S_BAR_START_RIGHT, S_CHECKBOX_ACTIVE, S_CHECKBOX_INACTIVE, S_CHECKBOX_SELECTED, S_CONNECT_LEFT, S_CORNER_BOTTOM_LEFT, S_CORNER_BOTTOM_RIGHT, S_CORNER_TOP_LEFT, S_CORNER_TOP_RIGHT, S_ERROR, S_INFO, S_PASSWORD_MASK, S_RADIO_ACTIVE, S_RADIO_INACTIVE, S_STEP_ACTIVE, S_STEP_CANCEL, S_STEP_ERROR, S_STEP_SUBMIT, S_SUCCESS, S_WARN, autocomplete, autocompleteMultiselect, box, cancel, confirm, date, group, groupMultiselect, intro, isCI, isTTY, limitOptions, log, multiselect, note, outro, password, path, progress, select, selectKey, spinner, stream, symbol, symbolBar, taskLog, tasks, text, unicode, unicodeOr };
391
- export type { AutocompleteMultiSelectOptions, AutocompleteOptions, BoxAlignment, BoxOptions, CommonOptions, ConfirmOptions, DateOptions, GroupMultiSelectOptions, LimitOptionsParams, LogMessageOptions, MultiSelectOptions, NoteOptions, Option, PasswordOptions, PathOptions, ProgressOptions, ProgressResult, PromptGroup, PromptGroupAwaitedReturn, PromptGroupOptions, SelectKeyOptions, SelectOptions, SpinnerOptions, SpinnerResult, Task, TaskLogCompletionOptions, TaskLogMessageOptions, TaskLogOptions, TextOptions };