Skip to content

v1.0.7#33

Merged
yilmaztayfun merged 2 commits into
release-v1.0from
master
May 7, 2026
Merged

v1.0.7#33
yilmaztayfun merged 2 commits into
release-v1.0from
master

Conversation

@yilmaztayfun

@yilmaztayfun yilmaztayfun commented May 7, 2026

Copy link
Copy Markdown
Contributor

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:

  • Add automatic domain resolution based on vnext.config.json so commands use the correct domain profile per workspace.
  • Expose a new vnext CLI alias alongside existing workflow and wf commands.

Enhancements:

  • Centralize CLI logging and UI helpers into a shared ui module and adopt it across check, csx, sync, update, and reset commands.
  • Display the active domain and API endpoint in a banner before each command runs.
  • Improve API error parsing to support RFC 7807 problem-details responses and surface structured error information in command output.
  • Summarize batch operation failures in a tabular error report for component and CSX processing.

Documentation:

  • Document the new CLI aliases, recommend vnext for Windows users, and clarify alias usage when installing from source.
  • Expand multidomain workflow documentation with auto domain switching via vnext.config.json and the new auto-resolution behavior.

yilmaztayfun and others added 2 commits May 7, 2026 23:35
…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…
@yilmaztayfun yilmaztayfun self-assigned this May 7, 2026
@yilmaztayfun yilmaztayfun requested review from a team May 7, 2026 20:36
@coderabbitai

coderabbitai Bot commented May 7, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 9175063c-8998-4fc6-906b-98819a4baec1

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch master

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@sourcery-ai

sourcery-ai Bot commented May 7, 2026

Copy link
Copy Markdown

Reviewer's Guide

Adds 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 commands

sequenceDiagram
  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
Loading

Class diagram for centralized UI helpers and domain resolution

classDiagram
  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
Loading

File-Level Changes

Change Details Files
Introduce centralized UI/logging helpers and structured error reporting for API operations.
  • Create src/lib/ui.js with shared LOG helper, structured printApiError, tabular printErrorSummaryTable, and printActiveDomainBanner.
  • Refactor sync, update, reset, csx, and check commands to import LOG and error helpers from the new UI module instead of having local LOG implementations.
  • Replace ad-hoc error printing in sync, update, and reset with printApiError and printErrorSummaryTable, and aggregate CSX and component errors into unified error lists.
src/lib/ui.js
src/commands/sync.js
src/commands/update.js
src/commands/reset.js
src/commands/csx.js
src/commands/check.js
Add workspace-based auto domain resolution and active-domain banner before running commands.
  • Extend config module with resolveWorkspaceDomain which reads vnext.config.json in the current project, matches the domain to a stored CLI domain profile, and updates ACTIVE_DOMAIN if needed.
  • Wire a commander preAction hook in bin/workflow.js that runs for all commands except domain, calls resolveWorkspaceDomain, logs auto-switches, and prints the active domain banner via printActiveDomainBanner.
src/lib/config.js
src/lib/ui.js
bin/workflow.js
Enhance publishComponent API error handling to support RFC 7807 problem details and feed richer data into UI helpers.
  • Update publishComponent to detect RFC 7807-style responses, build an apiError object (title, detail, errors, errorCode, traceId, type), and return it along with statusCode and error message.
  • Expand error objects captured in sync, reset, and update commands to include statusCode and apiError so they can be rendered by printApiError and printErrorSummaryTable.
src/lib/api.js
src/commands/sync.js
src/commands/update.js
src/commands/reset.js
Expose a new vnext CLI alias and document alias usage and auto domain behavior in the README.
  • Add vnext as a bin alias in package.json so wf, workflow, and vnext all point to the same entry script.
  • Update README to show all three aliases, recommend vnext for Windows, and clarify that examples use wf but aliases are interchangeable.
  • Revise multidomain workflow docs to describe auto domain switching via vnext.config.json vs manual wf domain use, add an Auto Domain Resolution section, and extend troubleshooting alias instructions to include vnext.
package.json
README.md

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@yilmaztayfun yilmaztayfun merged commit e114768 into release-v1.0 May 7, 2026
3 of 4 checks passed
@sonarqubecloud

sonarqubecloud Bot commented May 7, 2026

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
6.4% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 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.
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.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/lib/ui.js
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);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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.

Suggested change
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);
};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant