fix(cli): stop veryfront routes printing a bare bullet and a flush-left API heading - #3556
Conversation
|
Warning Review limit reached
Next review available in: 39 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the 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 configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
cli/commands/routes/routes.integration.test.ts (1)
8-8: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winUse the internal alias for the logger import.
setLoggerPresetis imported with"veryfront/utils/logger"in acli/test. Use#veryfront/utils/loggerso this cross-module import follows the repository’s internal resolution contract.As per coding guidelines:
cli/**/*.tsfiles 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
📒 Files selected for processing (2)
cli/commands/routes/command.tscli/commands/routes/routes.integration.test.ts
…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'.
60ec2da to
29c60a1
Compare
Symptom
veryfront routesrenders its two sections incorrectly — a bare bullet on anotherwise empty line, then the
API:heading printed flush-left with no bulletwhile
Pages:has one:Exit code is 0 — the routes are all discovered correctly, only the rendering is
broken. The scaffold's own
AGENTS.mddeveloper loop tells new developers torun this command ("4. Verify discovered routes with
veryfront routes"), so itis one of the first commands a new user sees.
Root cause
cli/commands/routes/command.tsemitted the second heading as:In the CLI logger preset (
setLoggerPreset("cli"), set incli/main.ts), everymessage is rendered as
<glyph> <message>— seeformatTextLineinsrc/utils/logger/logger.ts. The leading\nis inside the message, so thesingle rendered line is
● \nAPI:: the glyph ends up prefixing an emptymessage, 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:
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-e2ebecause the bug is fullyreproducible 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.logwhile the logger is in the defaultserverpreset and assert withassertStringIncludes, so both the bare glyph line and the lost indentation areinvisible to them. The new test drives the command through the real
clipreset, strips SGR colour codes, and asserts on line structure — that both
headings carry the
<glyph>prefix, and that no emitted line is a glyph withno content.
Confirmed failing before the fix, for the right reason:
Verification
Original symptom reproduced against this tree before the change and gone after,
running the worktree CLI against a scaffold-shaped project:
deno fmt --check,deno lint,deno check, thecli/commands/routesandcli/utilssuites, 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-dogfoodskill.Out of scope
cli/commands/lock/command.tshas the samecliLogger.info("\n…")shape in twoplaces. Left alone deliberately — this PR is scoped to the one confirmed
finding.
Summary by CodeRabbit
Pages:andAPI:sections with a clean blank line.