feat(cli): improve output UX and error handling#736
Conversation
There was a problem hiding this comment.
Pull request overview
This PR refactors CLI UX and error handling by centralizing spinner behavior and improving top-level async error handling, while also making small messaging/lint cleanups.
Changes:
- Introduces a
runWithSpinnerutility to standardize clack spinner usage with error handling. - Updates
PackageJson.install()to use the shared spinner helper for install/update flows. - Improves CLI termination behavior by wrapping
main()in an asyncmainWrapper()with environment-specific error output.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
src/utils/run-with-spinner.ts |
Adds reusable helper to run async work with interactive spinner start/stop/error messages. |
src/utils/package-json.ts |
Replaces duplicated spinner logic in install() with runWithSpinner() calls. |
src/eslint/configs/comments.ts |
Removes unnecessary eslint-disable comment in plugin registration. |
src/cli/index.ts |
Tweaks user-facing warning copy, simplifies success printing, and adds robust async error wrapper with issue link. |
You can also share your feedback on Copilot code review. Take the survey.
2112ede to
4fccd44
Compare
commit: |
e388360 to
7fe0b63
Compare
There was a problem hiding this comment.
Pull request overview
This PR refactors parts of the CLI setup flow to improve UX and error handling, introducing shared utilities (spinner + project-type confirmation) and adding a centralized bug tracker URL for user-facing guidance.
Changes:
- Added reusable helpers:
runWithSpinner()andconfirmProjectType(), plus aBUG_TRACKER_URLconstant. - Updated
PackageJson.install()to support version selection and to use the new spinner helper. - Enhanced CLI flow with early
package.jsonvalidation, ESLint peer-version gating (<10), and improved fatal error reporting.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/utils/run-with-spinner.ts | New helper to run async work with a clack spinner in interactive mode. |
| src/utils/package-json.ts | Adds version-aware install logic, spinner integration, improved messages. |
| src/utils/confirm-project-type.ts | New helper for consistent interactive project-type confirmation and cancellation handling. |
| src/eslint/configs/comments.ts | Removes an unnecessary eslint-disable comment. |
| src/constants/index.ts | Introduces BUG_TRACKER_URL constant for consistent reporting links. |
| src/cli/install-eslint.ts | Pins ESLint to ^9 and updates method name to doesSatisfy. |
| src/cli/index.ts | Adds ESLint version gate, refactors project-type confirmation, and improves unhandled error messaging. |
You can also share your feedback on Copilot code review. Take the survey.
d341a08 to
f2f47d0
Compare
f2f47d0 to
d171b0f
Compare
There was a problem hiding this comment.
Pull request overview
This PR refactors parts of the CLI setup flow for @solvro/config, adding shared helpers for interactive prompts/spinners, tightening dependency/version handling, and improving user-facing messages and error reporting.
Changes:
- Add reusable utilities for spinner-wrapped operations and project type confirmation.
- Update
PackageJsoninstall/version APIs and apply them in CLI installers (ESLint/Prettier). - Improve CLI UX: earlier project directory validation, peer dependency guard for ESLint, and a friendlier “report a bug” path.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/utils/run-with-spinner.ts | New helper to run async work with a clack spinner and consistent error handling. |
| src/utils/package-json.ts | Refactors package install/update logic, introduces doesSatisfy/getPackageInfo, and integrates spinner helper. |
| src/utils/confirm-project-type.ts | New helper to confirm autodetected project type and route users to bug tracker on mismatch. |
| src/constants/index.ts | Adds BUG_TRACKER_URL used by CLI/error handling. |
| src/eslint/configs/comments.ts | Removes a now-unneeded eslint-disable comment. |
| src/cli/install-prettier.ts | Updates installer to new PackageJson.install() option shape. |
| src/cli/install-eslint.ts | Updates installer to new doesSatisfy name and new install option shape. |
| src/cli/index.ts | Adds ESLint peer-deps check, centralizes project-type confirmation, and improves top-level error handling/reporting. |
You can also share your feedback on Copilot code review. Take the survey.
|
🎉 This PR is included in version 2.2.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
also adds a temporary dependency version check which detects unsupported versions of eslint
resolves #727