Skip to content

fix(cli): stop veryfront routes printing a bare bullet and a flush-left API heading - #3556

Merged
kojiwakayama merged 2 commits into
mainfrom
fix/dx-20260811-0742-2
Aug 11, 2026
Merged

kojiwakayama merged 2 commits into
mainfrom
fix/dx-20260811-0742-2

Conversation

@kojiwakayama

@kojiwakayama kojiwakayama commented Aug 11, 2026 •

Copy link
Copy Markdown
Contributor

Symptom

veryfront routes renders its two sections incorrectly — a bare bullet on an
otherwise empty line, then the API: heading printed flush-left with no bullet
while Pages: has one:

Veryfront (v0.1.1228)

  ● Pages:
  ●   / -> app/page.tsx
  ● 
API:
  ●   /api/ag-ui -> app/api/ag-ui/route.ts

Exit code is 0 — the routes are all discovered correctly, only the rendering is
broken. The scaffold's own AGENTS.md developer loop tells new developers to
run this command ("4. Verify discovered routes with veryfront routes"), so it
is one of the first commands a new user sees.

Root cause

cli/commands/routes/command.ts emitted the second heading as:

cliLogger.info("\nAPI:");

In the CLI logger preset (setLoggerPreset("cli"), set in cli/main.ts), every
message is rendered as <glyph> <message> — see formatTextLine in
src/utils/logger/logger.ts. The leading \n is inside the message, so the
single rendered line is ● \nAPI:: the glyph ends up prefixing an empty
message, and the real heading lands on the next line outside the prefixing
wrapper.

Fix

Emit the section break as its own blank line and hand the heading to the logger
by itself. This matches the "blank line between logical sections" rule in the
CLI output conventions and leaves both headings identically prefixed:

  ● Pages:
  ●   / -> app/page.tsx

  ● API:
  ●   /api/ag-ui -> app/api/ag-ui/route.ts

Regression test

cli/commands/routes/routes.integration.test.ts —
"separates sections without a bare glyph line or an unprefixed heading".

It lives there rather than in veryfront-e2e because the bug is fully
reproducible in-process: no browser, no deployment, no credentials. It runs in
the pre-push gate alongside the existing routes integration tests.

The three pre-existing tests in that file could not catch this: they capture
console.log while the logger is in the default server preset and assert with
assertStringIncludes, so both the bare glyph line and the lost indentation are
invisible to them. The new test drives the command through the real cli
preset, strips SGR colour codes, and asserts on line structure — that both
headings carry the <glyph> prefix, and that no emitted line is a glyph with
no content.

Confirmed failing before the fix, for the right reason:

error: AssertionError: API heading is not indented/prefixed: "API:"

Verification

Original symptom reproduced against this tree before the change and gone after,
running the worktree CLI against a scaffold-shaped project:

# before
  ● Pages:
  ●   / -> app/page.tsx
  ● $
API:$
  ●   /api/ag-ui -> app/api/ag-ui/route.ts

# after
  ● Pages:
  ●   / -> app/page.tsx
$
  ● API:$
  ●   /api/ag-ui -> app/api/ag-ui/route.ts

deno fmt --check, deno lint, deno check, the cli/commands/routes and
cli/utils suites, and the full pre-push gate all pass.

Provenance

Found by a DX dogfood walk of
https://veryfront.com/docs/code/getting-started/quickstart against published CLI
0.1.1228, following the vf-dx-dogfood skill.

Out of scope

cli/commands/lock/command.ts has the same cliLogger.info("\n…") shape in two
places. Left alone deliberately — this PR is scoped to the one confirmed
finding.

Summary by CodeRabbit

  • Bug Fixes
    • Improved route command output formatting by separating the Pages: and API: sections with a clean blank line.
    • Ensured section headings consistently include the expected CLI logger formatting.
    • Removed an unnecessary glyph-only line from route output.

@coderabbitai

coderabbitai Bot commented Aug 11, 2026 •

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@kojiwakayama, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 39 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: ca746de3-b86b-4355-9190-791a9500459b

📥 Commits

Reviewing files that changed from the base of the PR and between 441d2e0 and 29c60a1.

📒 Files selected for processing (1)
  • cli/commands/routes/routes.integration.test.ts
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/dx-20260811-0742-2

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

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
cli/commands/routes/routes.integration.test.ts (1)

8-8: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Use the internal alias for the logger import.

setLoggerPreset is imported with "veryfront/utils/logger" in a cli/ test. Use #veryfront/utils/logger so this cross-module import follows the repository’s internal resolution contract.

As per coding guidelines: cli/**/*.ts files must use #cli/* or relative imports inside the CLI. Based on learnings: “For internal TypeScript source imports, use the repository's #veryfront/* path aliases.”

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@cli/commands/routes/routes.integration.test.ts` at line 8, Update the
setLoggerPreset import in routes.integration.test.ts to use the internal
`#veryfront/utils/logger` alias instead of the veryfront/utils/logger package
path, preserving the existing symbol and behavior.

Sources: Coding guidelines, Learnings

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@cli/commands/routes/routes.integration.test.ts`:
- Around line 159-164: Update the route output assertions in the
lines-validation loop to require the section order `Pages:` followed by `API:`
with an empty separator line immediately before `API:`. Preserve the existing
glyph-only line validation, but add assertions that fail when the blank
separator is removed or the sections appear out of order.

---

Nitpick comments:
In `@cli/commands/routes/routes.integration.test.ts`:
- Line 8: Update the setLoggerPreset import in routes.integration.test.ts to use
the internal `#veryfront/utils/logger` alias instead of the veryfront/utils/logger
package path, preserving the existing symbol and behavior.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 1beaa7b8-e17e-4f94-8292-df5ac59ecfe9

📥 Commits

Reviewing files that changed from the base of the PR and between fe5d5b8 and 441d2e0.

📒 Files selected for processing (2)
  • cli/commands/routes/command.ts
  • cli/commands/routes/routes.integration.test.ts

Comment thread cli/commands/routes/routes.integration.test.ts
@kojiwakayama
kojiwakayama added this pull request to the merge queue Aug 11, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 11, 2026
@kojiwakayama
kojiwakayama added this pull request to the merge queue Aug 11, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 11, 2026
…ft API heading

The API section heading was emitted as `cliLogger.info("\nAPI:")`. In the CLI
logger preset every message is rendered as `  <glyph> <message>`, so the leading
newline split the line in two: the glyph got an empty message ("  ● ") and the
actual "API:" heading escaped the prefixing wrapper and printed flush-left.

Emit the section break as its own blank line and pass the heading to the logger
on its own, matching the "blank line between logical sections" rule in the CLI
output conventions.
The regression test asserted both headings carry the CLI logger prefix and
that no glyph-only line is emitted, but nothing required the blank line
between the Pages and API sections. Removing the console.log("") that
emits it left the test passing, so only half the fix was locked.

Assert the section order and that the line immediately before the API
heading is empty. Verified by mutation: deleting the console.log("") now
fails with 'expected a blank line before the API heading'.
@kojiwakayama
kojiwakayama force-pushed the fix/dx-20260811-0742-2 branch from 60ec2da to 29c60a1 Compare August 11, 2026 08:59
@kojiwakayama
kojiwakayama added this pull request to the merge queue Aug 11, 2026
Merged via the queue into main with commit 7b25cb7 Aug 11, 2026
33 checks passed
@kojiwakayama
kojiwakayama deleted the fix/dx-20260811-0742-2 branch August 11, 2026 09:19
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