Skip to content

Commit 9a28237

Browse files
authored
Adds builder.printMessage documentation (#508)
Co-authored-by: Nicolas <[email protected]>
1 parent bee4cf7 commit 9a28237

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

app/pages/docs/writing-recipes.mdx

+30
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,36 @@ builder
220220

221221
This step would append "Paul Plain was here!" to the user's README.md
222222

223+
#### Creating a custom message
224+
225+
Sometimes you need to print a simple message, or give some instructions,
226+
you can achieve that with `printMessage`
227+
228+
```ts
229+
builder.printMessage({
230+
successIcon: "ℹ️",
231+
stepId: "oops",
232+
stepName: "Contributors needed!",
233+
message: "If you like this recipe, consider helping out!",
234+
})
235+
```
236+
237+
This step would print "If you like this recipe, consider helping out!" to
238+
terminal and wait for the user to go to the next step.
239+
240+
#### Custom step icons
241+
242+
If you want to customize your recipe even further, you can pass an
243+
optional `successIcon` param to your steps.
244+
245+
```ts
246+
builder
247+
.addTransformFilesStep({
248+
successIcon: "🔧",
249+
...
250+
})
251+
```
252+
223253
#### Modifying Prisma schemas
224254

225255
A lot of recipes may need to add or modify models in the schema.prisma

0 commit comments

Comments
 (0)