feat: add customizable spinner cancel and error messages#278
feat: add customizable spinner cancel and error messages#278
Conversation
🦋 Changeset detectedLatest commit: 5b2b75b The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
@example/basic • @example/changesets commit: |
|
we should already have some spinner tests in we don't yet test exits, but we do test everything else. so you'd have to copy your process exit stuff across as for the change itself, I wonder if we should have some i18n-like concept in here. basically a map of all constant strings so people can override them in general I'll have a think and re-review soon |
sounds good, i will tinker with those suggestions. thanks james! 😁 |
natemoo-re
left a comment
There was a problem hiding this comment.
Looks great! My only request would be using the existing updateSettings() function unless there's a good argument for a separate API here?
packages/prompts/src/index.ts
Outdated
| const promptsSettings = { | ||
| messages: { | ||
| cancel: 'Canceled', | ||
| error: 'Something went wrong', | ||
| } | ||
| }; |
There was a problem hiding this comment.
Could this use the existing global settings object? We should already expose an updateSettings() function
packages/prompts/src/index.ts
Outdated
| ? (errorMessage ?? promptsSettings.messages.error) | ||
| : (cancelMessage ?? promptsSettings.messages.cancel); |
There was a problem hiding this comment.
Nice, I like how this override works!
|
As for @43081j's suggestion of i18n support, I think that's a great idea! Maybe we can track that as a follow-up. I haven't really seen localized CLI tooling before but that seems pretty amazing. |
natemoo-re
left a comment
There was a problem hiding this comment.
Looks great! Please update the changeset and exports before merging 🙏
f5773a8 to
37f6046
Compare
…nsistent message handling
closes: #209