v1.0.7#33
Conversation
…dule - Register "vnext" as an additional bin alias (recommended on Windows) - Extract shared LOG/printApiError/printErrorSummaryTable into src/lib/ui.js - Add resolveWorkspaceDomain() that auto-switches domain from vnext.config.json - Display active domain banner via commander preAction hook - Parse RFC 7807 Problem Details in API error responses for richer output - Update README with alias docs and auto-domain resolution guide
…h-error-display-auto-resolve-domain-from-config-add-vnext-alias feat(cli): add vnext alias, auto-domain resolution, and unified UI mo…
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Reviewer's GuideAdds a vNext alias and improves domain-aware UX by auto-resolving workspace domains, centralizing CLI UI/logging helpers, and enriching API error reporting and error summaries across sync/reset/update flows, with corresponding README documentation updates. Sequence diagram for auto domain resolution and banner before CLI commandssequenceDiagram
actor User
participant CLI as CLI_workflow_js
participant Config as lib_config
participant UI as lib_ui
User->>CLI: run command (e.g. wf update)
CLI->>CLI: commander preAction hook
CLI->>Config: resolveWorkspaceDomain(cwd)
Config-->>CLI: result { resolved, switched, domain, previous }
alt domain resolved and switched
CLI->>User: log [auto] Domain switched to domain
end
CLI->>UI: printActiveDomainBanner()
UI-->>User: show active domain and API banner
CLI->>CLI: execute requested command handler
Class diagram for centralized UI helpers and domain resolutionclassDiagram
class lib_config {
+DEFAULT_DOMAIN_CONFIG
+get(key)
+set(key, value)
+getActiveDomainConfig()
+resolveWorkspaceDomain(projectRoot)
}
class lib_ui {
+LOG
+printApiError(result, componentType, fileName)
+printErrorSummaryTable(errors)
+printActiveDomainBanner()
}
class lib_api {
+publishComponent(baseUrl, componentData)
}
class command_sync {
+syncCommand()
}
class command_update {
+updateCommand(options)
}
class command_reset {
+resetCommand(options)
}
class command_csx {
+csxCommand(options)
}
class command_check {
+checkCommand()
}
class workflow_cli {
+preAction_hook(thisCommand, actionCommand)
}
lib_config --> lib_ui : used_by_for_banner_data
lib_config --> workflow_cli : provide_resolveWorkspaceDomain
lib_ui --> command_sync : LOG_and_error_helpers
lib_ui --> command_update : LOG_and_error_helpers
lib_ui --> command_reset : LOG_and_error_helpers
lib_ui --> command_csx : LOG_helpers
lib_ui --> command_check : LOG_helpers
lib_ui --> workflow_cli : printActiveDomainBanner
lib_api --> command_sync : publishComponent_results
lib_api --> command_update : publishComponent_results
lib_api --> command_reset : publishComponent_results
workflow_cli --> command_check : invokes
workflow_cli --> command_csx : invokes
workflow_cli --> command_sync : invokes
workflow_cli --> command_update : invokes
workflow_cli --> command_reset : invokes
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- In
resolveWorkspaceDomain, all parsing errors are swallowed and returned as{ reason: 'error' }; consider at least logging the failure in a debug/verbose mode so users can diagnose malformedvnext.config.jsonor permission issues. - The
printErrorSummaryTabletruncates thedetailfield to a fixed width, which can hide important information for complex validation errors; consider either wrapping the text to multiple lines or including a way to view the full message (e.g. a separate detailed log or an optional verbose flag). - The active-domain banner uses
config.get('API_BASE_URL')globally rather than a domain-specific URL; ifAPI_BASE_URLis scoped per domain/profile, it might be clearer to resolve and display the URL associated with the active domain profile instead of a single global value.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- In `resolveWorkspaceDomain`, all parsing errors are swallowed and returned as `{ reason: 'error' }`; consider at least logging the failure in a debug/verbose mode so users can diagnose malformed `vnext.config.json` or permission issues.
- The `printErrorSummaryTable` truncates the `detail` field to a fixed width, which can hide important information for complex validation errors; consider either wrapping the text to multiple lines or including a way to view the full message (e.g. a separate detailed log or an optional verbose flag).
- The active-domain banner uses `config.get('API_BASE_URL')` globally rather than a domain-specific URL; if `API_BASE_URL` is scoped per domain/profile, it might be clearer to resolve and display the URL associated with the active domain profile instead of a single global value.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
There was a problem hiding this comment.
Code Review
This pull request introduces automatic domain resolution based on local vnext.config.json files, adds a new vnext CLI alias, and centralizes UI and logging logic into a dedicated ui.js module. Additionally, API error handling has been enhanced to support RFC 7807 Problem Details for more structured feedback. Review feedback suggests improving the new error summary table by adding truncation logic to the padding function to prevent alignment issues with long strings.
| const COL = { idx: 3, type: 16, file: 26, http: 5, code: 16, detail: 36 }; | ||
| const totalWidth = COL.idx + COL.type + COL.file + COL.http + COL.code + COL.detail + 15; | ||
|
|
||
| const pad = (str, len) => String(str || '').padEnd(len); |
There was a problem hiding this comment.
The pad function currently only adds padding but does not handle cases where the input string exceeds the specified column length. This can cause the summary table alignment to break if a filename or component type is particularly long. Consider adding truncation logic to ensure the table structure remains intact.
| const pad = (str, len) => String(str || '').padEnd(len); | |
| const pad = (str, len) => { | |
| const s = String(str || ''); | |
| return s.length > len ? s.substring(0, len - 3) + '...' : s.padEnd(len); | |
| }; |


Summary by Sourcery
Introduce workspace-aware domain auto-resolution, improve error reporting and UI consistency across CLI commands, and add an additional CLI alias.
New Features:
Enhancements:
Documentation: