Add bunny colors to table header and command overview#102
Conversation
|
@codex review |
🦋 Changeset detectedLatest commit: 5c3ac81 The changes in this PR will be included in the next version bump. This PR includes changesets to release 6 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Greptile SummaryThis PR applies the brand orange color (
Confidence Score: 5/5Safe to merge — changes are purely cosmetic terminal styling with no logic or data-path impact. Both changed code paths affect only terminal color rendering. The format.ts change is a straightforward chalk style swap, and the NO_COLOR guard remains intact. The define-namespace.ts handler change builds on top of the async issue flagged in a previous review cycle; that pre-existing concern aside, the regex replacement logic itself is correct and benign. No files require special attention beyond the previously reviewed handler in define-namespace.ts. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["User runs namespace command"] --> B["handler called"]
B --> C["yRef.getHelp()"]
C --> D["helpText string"]
D --> E["replace Commands: with bunny.bold"]
E --> F["replace Options: with bunny.bold"]
F --> G["console.log colored output"]
H["formatTable - format=text"] --> I["headers mapped with bunny.bold"]
I --> J{"chalk.level === 0?"}
J -- Yes --> K["plain text headers, head style suppressed"]
J -- No --> L["orange bold headers rendered"]
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
A["User runs namespace command"] --> B["handler called"]
B --> C["yRef.getHelp()"]
C --> D["helpText string"]
D --> E["replace Commands: with bunny.bold"]
E --> F["replace Options: with bunny.bold"]
F --> G["console.log colored output"]
H["formatTable - format=text"] --> I["headers mapped with bunny.bold"]
I --> J{"chalk.level === 0?"}
J -- Yes --> K["plain text headers, head style suppressed"]
J -- No --> L["orange bold headers rendered"]
Reviews (2): Last reviewed commit: "fix order import order" | Re-trigger Greptile |
| handler: () => { | ||
| yRef.showHelp("log"); | ||
| yRef.getHelp().then((helpText) => { | ||
| const colored = helpText | ||
| .replace(/^Commands:/m, bunny.bold("Commands:")) | ||
| .replace(/^Options:/m, bunny.bold("Options:")); | ||
| console.log(colored); | ||
| }); | ||
| }, |
There was a problem hiding this comment.
Promise not returned from yargs handler
The Promise returned by getHelp().then(...) is discarded — the handler returns void instead of Promise<void>. Yargs awaits a handler's returned Promise to know when async work is done; when the return value is dropped, the process can drain the event loop and exit before console.log fires, silently printing nothing. The fix is to add return before yRef.getHelp(), and add a .catch() (or convert to async/await) to surface any errors instead of producing an unhandled rejection.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
| @@ -1,5 +1,5 @@ | |||
| import type { Argv, CommandModule } from "yargs"; | |||
|
|
|||
| import { bunny } from "../core/colors.ts"; | |||
There was a problem hiding this comment.
No description provided.