-
Notifications
You must be signed in to change notification settings - Fork 16
[Oclif v4 Migration] Upgrade CLI to oclif v4 #1808
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Feature/oclif v4 migration
Migrate CLI Table Utility from oclif v3 to v4 using tty-table
aman19K
reviewed
Apr 2, 2025
aman19K
reviewed
Apr 2, 2025
aman19K
previously approved these changes
Apr 2, 2025
aman19K
previously approved these changes
Apr 3, 2025
aman19K
approved these changes
Apr 3, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
[Oclif v4 Migration] Upgrade CLI to oclif v4
Overview
This PR migrates our CLI from oclif v3 to oclif v4, updating dependencies, refactoring deprecated functionalities, and standardizing table rendering across commands. The migration ensures compatibility with oclif v4 while maintaining consistent CLI output and behavior.
Key Changes
✅ 1. Upgraded Dependencies
Updated oclif-related packages to the latest versions:
Example Migration:
Before (oclif v3 using
ux.table())After (oclif v4 using
tty-tableviacliux.table())✅ 3. Standardized Table Rendering with
cliux.table()ux.table()deprecated in oclif v4Introduced
cliux.table(), wrappingtty-tablefor consistent renderingUpdated all CLI commands to use
cliux.table()New Table Utility Usage:
✅ 4. Enhanced Table Flags Handling
The
showHeaderflag now defaults totrue.If
--no-headeris passed, headers will be hidden.Code Change:
✅ 5. Refactored Table Implementations Across Plugins
Migrated the following CLI plugins to use
cliux.table():Auth Plugin → Updated table rendering
Branches Plugin → Applied
cliux.table()updatesConfig Plugin → Replaced
ux.table()CLI Launch Plugin → Verified table formatting
App CLI → Standardized table rendering
TSGen → Ensured table compatibility
Content Types Plugin → Updated table logic
Testing Instructions
✅ Unit & Integration Tests
Run CLI commands and verify correct table output format.
Ensure
--no-headerflag hides headers as expected.✅ Manual Validation Steps
Execute CLI commands that previously used
ux.table().Verify table formatting in output.
Compare old vs. new output for consistency.
Ensure correct behavior of all table-related flags.
Impact & Risks
🚀 Benefits:
Maintains full compatibility with oclif v4.
Standardized table rendering across CLI.
Future-proof for easier upgrades.
Formatting changes: Minor differences in table output formatting.
Flag behavior changes: Some flag options may need adjustments.
Plugin dependencies: External plugins may require additional fixes.
Next Steps
✅ Validate all CLI commands post-migration.
✅ Update documentation to reflect new table usage.
✅ Perform end-to-end testing to identify regressions.
🚀 Deploy migration changes after final review.
PR Checklist
Migrated all CLI table usages to
cliux.table().Updated dependencies to
oclif v4.Ensured correct handling of
showHeaderflag.Verified table rendering across plugins.
Conducted unit tests and manual validations.
Final Notes
This PR finalizes our migration to oclif v4 with improved table rendering and a standardized CLI experience. 🚀