@hyperfrontend/questions 0.1.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -1
- package/README.md +19 -7
- package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/math/index.cjs.js +7 -0
- package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/math/index.esm.js +5 -0
- package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/object/index.cjs.js +5 -0
- package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/object/index.esm.js +4 -0
- package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/promise/index.cjs.js +6 -0
- package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/promise/index.esm.js +5 -0
- package/index.cjs.js +175 -151
- package/index.d.ts +331 -9
- package/index.d.ts.map +1 -1
- package/index.esm.js +143 -120
- package/package.json +13 -3
- package/index.cjs.js.map +0 -1
- package/index.esm.js.map +0 -1
- package/render.d.ts +0 -113
- package/render.d.ts.map +0 -1
- package/terminal.d.ts +0 -109
- package/terminal.d.ts.map +0 -1
- package/types.d.ts +0 -108
- package/types.d.ts.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,7 +2,23 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
-
## 0.1.
|
|
5
|
+
## [0.2.1](https://github.com/AndrewRedican/hyperfrontend/compare/926d40cab470e589fc30a1ef3a61ca764ff047bd...466c0388c4cd516b9c704214140b4df1004098e6) - 2026-06-23
|
|
6
|
+
|
|
7
|
+
### Other
|
|
8
|
+
|
|
9
|
+
- **@hyperfrontend/workspace:** remove lib-builder and tool-package as implicit dependencies for all lib projects
|
|
10
|
+
|
|
11
|
+
## [0.2.0](https://github.com/AndrewRedican/hyperfrontend/compare/587d0dc108d5bb7f48c44a5a0065e349c774e4cf...b5f254d41cb9549c783146db48eff78ed39e5bf5) - 2026-04-25
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
- add filter as you type search on select prompt
|
|
16
|
+
|
|
17
|
+
### Bug Fixes
|
|
18
|
+
|
|
19
|
+
- prompt cursor math and add live text render hook
|
|
20
|
+
|
|
21
|
+
## 0.1.0 - 2026-04-20
|
|
6
22
|
|
|
7
23
|
### Features
|
|
8
24
|
|
package/README.md
CHANGED
|
@@ -89,6 +89,17 @@ if (nameResult.result === PromptResult.Submitted) {
|
|
|
89
89
|
console.log(`Hello, ${nameResult.value}!`)
|
|
90
90
|
}
|
|
91
91
|
|
|
92
|
+
// Text input with a live label — `renderMessage` is recomputed on every keystroke
|
|
93
|
+
import { style } from '@hyperfrontend/questions'
|
|
94
|
+
|
|
95
|
+
await text({
|
|
96
|
+
message: 'Title:',
|
|
97
|
+
renderMessage: (value) => {
|
|
98
|
+
const left = 72 - value.length
|
|
99
|
+
return `Title (${left >= 0 ? style.green(`${left} left`) : style.red(`${-left} over`)}):`
|
|
100
|
+
},
|
|
101
|
+
})
|
|
102
|
+
|
|
92
103
|
// Confirmation
|
|
93
104
|
const continueResult = await confirm({
|
|
94
105
|
message: 'Continue?',
|
|
@@ -120,13 +131,14 @@ const featuresResult = await multiselect({
|
|
|
120
131
|
|
|
121
132
|
## API Overview
|
|
122
133
|
|
|
123
|
-
| Function | Description
|
|
124
|
-
| -------------- |
|
|
125
|
-
| `text` | Free-form text input with optional validation
|
|
126
|
-
| `confirm` | Yes/no confirmation prompt
|
|
127
|
-
| `select` | Single selection from a list of choices
|
|
128
|
-
| `multiselect` | Multiple selections with optional search
|
|
129
|
-
| `
|
|
134
|
+
| Function | Description |
|
|
135
|
+
| -------------- | ----------------------------------------------------------------------------- |
|
|
136
|
+
| `text` | Free-form text input with optional validation and live-updating labels |
|
|
137
|
+
| `confirm` | Yes/no confirmation prompt |
|
|
138
|
+
| `select` | Single selection from a list of choices |
|
|
139
|
+
| `multiselect` | Multiple selections with optional search |
|
|
140
|
+
| `style` | ANSI colour helpers (`green`, `yellow`, `red`, `cyan`, `bold`, `dim`, `gray`) |
|
|
141
|
+
| `PromptResult` | Discriminated union: `'submitted' \| 'cancelled'` |
|
|
130
142
|
|
|
131
143
|
All prompts return `Promise<PromptOutcome<T>>` where:
|
|
132
144
|
|