Skip to content

Commit 25d70a2

Browse files
committed
docs: update readme
1 parent 2c4dee6 commit 25d70a2

File tree

1 file changed

+24
-21
lines changed

1 file changed

+24
-21
lines changed

packages/prompts/README.md

Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ log.message('Hello, World', { symbol: color.cyan('~') });
192192

193193
### Workflow
194194

195-
Just like `group`, but on builder way, so you can choose which one fits better.
195+
Works just like `group` but infer types way better and treats your group like a workflow, allowing you to create conditional steps (forks) along the process.
196196

197197
```js
198198
import * as p from '@clack/prompts';
@@ -223,26 +223,29 @@ const results = await p
223223
)
224224
.step('fork', ({ results }) => {
225225
if (results.install === true) {
226-
return p.workflow().step('package', () =>
227-
p.select({
228-
message: 'Pick a package manager:',
229-
initialValue: 'pnpm',
230-
options: [
231-
{
232-
label: 'npm',
233-
value: 'npm',
234-
},
235-
{
236-
label: 'yarn',
237-
value: 'yarn',
238-
},
239-
{
240-
label: 'pnpm',
241-
value: 'pnpm',
242-
},
243-
],
244-
})
245-
).run();
226+
return p
227+
.workflow()
228+
.step('package', () =>
229+
p.select({
230+
message: 'Pick a package manager:',
231+
initialValue: 'pnpm',
232+
options: [
233+
{
234+
label: 'npm',
235+
value: 'npm',
236+
},
237+
{
238+
label: 'yarn',
239+
value: 'yarn',
240+
},
241+
{
242+
label: 'pnpm',
243+
value: 'pnpm',
244+
},
245+
],
246+
})
247+
)
248+
.run();
246249
}
247250
})
248251
.onCancel(() => {

0 commit comments

Comments
 (0)