-
Notifications
You must be signed in to change notification settings - Fork 161
feat: add customizable spinner cancel and error messages #278
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Please update the changeset and exports before merging 🙏
f5773a8 to
37f6046
Compare
natemoo-re
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Last things!
…nsistent message handling
closes: #209