Conversation
8f99646 to
cec41db
Compare
c0706b3 to
6d50162
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR refactors CLI utilities by extracting common functionality into a shared utils module and adds comprehensive test coverage for command help messages.
- Created centralized utility functions for binary resolution and environment variable defaults
- Refactored all command modules to use the shared utilities, reducing code duplication
- Added snapshot tests for CLI command help messages to ensure documentation consistency
Reviewed Changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| packages/tools/src/utils.ts | Enhanced semver replacement regex to handle more version patterns |
| packages/tools/src/tests/utils.spec.ts | Added test cases for new semver pattern matching |
| packages/tools/src/tests/snapshots/utils.spec.ts.snap | Updated snapshots to reflect improved semver replacement |
| packages/cli/src/utils.ts | New utility module with shared resolver and environment defaults |
| packages/cli/src/vite.ts | Refactored to use shared utilities, removing duplicate resolver code |
| packages/cli/src/test.ts | Refactored to use shared utilities and environment defaults |
| packages/cli/src/lint.ts | Refactored to use shared utilities and environment defaults |
| packages/cli/src/lib.ts | Refactored to use shared utilities and environment defaults |
| packages/cli/src/fmt.ts | Refactored to use shared utilities and environment defaults |
| packages/cli/src/doc.ts | Refactored to use shared utilities and environment defaults |
| packages/cli/snap-tests/command-lib/snap.txt | Updated snapshot to use normalized semver format |
| packages/cli/snap-tests/command-helper/* | New test suite for comprehensive CLI help message validation |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
cursor review |
|
@codex review |
There was a problem hiding this comment.
Codex Review: Here are some suggestions.
About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you open a pull request for review, mark a draft as ready, or comment "@codex review". If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex fix this CI failure" or "@codex address that feedback".
cec41db to
49ae39d
Compare
49ae39d to
b07e3fb
Compare
b07e3fb to
a2d6fd5
Compare
903c927 to
991d11a
Compare
a2d6fd5 to
24d7cac
Compare
991d11a to
4a12f74
Compare
24d7cac to
bb8c75a
Compare
4a12f74 to
a6a2966
Compare
a6a2966 to
9359bec
Compare
bb8c75a to
92f8ff4
Compare
92f8ff4 to
cb238c4
Compare

TL;DR
Refactored CLI utilities and added command help message tests.
What changed?
utils.tsfile with common utility functions for resolving binaries and default environment variablesHow to test?
-hflag to verify help messages are displayed correctly:Why make this change?
This change improves code maintainability by reducing duplication across command modules. The common utility functions centralize binary resolution and environment variable handling, making the codebase more DRY. The added tests for command help messages ensure that CLI documentation remains accurate and consistent as the project evolves.