Skip to content

chore: integrate chalk colors into storage.js and hook.js#110

Open
Ruchira807 wants to merge 1 commit into
adithya-naik:developfrom
Ruchira807:chore/integrate-chalk-storage-hook
Open

chore: integrate chalk colors into storage.js and hook.js#110
Ruchira807 wants to merge 1 commit into
adithya-naik:developfrom
Ruchira807:chore/integrate-chalk-storage-hook

Conversation

@Ruchira807

@Ruchira807 Ruchira807 commented Jul 1, 2026

Copy link
Copy Markdown

Summary

Refactored CLI output to use the centralized colors.js utility for consistent terminal styling across commands.

Changes made:

  • Updated hook.js to use colored success, warning, error, heading, info, and bold messages.
  • Updated storage.js initialization messages to use the shared color utility.
  • Improved readability and consistency of CLI output without changing existing functionality.
  • Preserved all existing command behavior.

Related Issue

Closes #108

Type of Change

  • Bug fix
  • New feature
  • Documentation update
  • Refactoring
  • CI/CD

Testing

  • Tested locally
  • Existing functionality still works

Checklist

  • Code follows project conventions
  • Documentation updated if needed
  • Linked to an issue

Summary by CodeRabbit

  • Enhancements
    • Improved terminal messages for hook and unhook commands with clearer headings, shell detection, and color-coded success, warning, and error output.
    • Added colored success messages when creating tracker storage directories and files, making setup feedback easier to read.

@Ruchira807 Ruchira807 requested a review from adithya-naik as a code owner July 1, 2026 15:09
@coderabbitai

coderabbitai Bot commented Jul 1, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 6e1ad77f-5765-4c7d-9922-bc8efe549ea6

📥 Commits

Reviewing files that changed from the base of the PR and between 24645af and cfe3156.

📒 Files selected for processing (2)
  • src/commands/hook.js
  • src/utils/storage.js

📝 Walkthrough

Walkthrough

The changes integrate the existing colors utility into src/commands/hook.js and src/utils/storage.js, replacing plain console strings with colored info, warning, success, and error output while preserving existing command logic and control flow.

Changes

Colors Integration

Layer / File(s) Summary
Colored output in hook and unhook commands
src/commands/hook.js
hookCommand and unhookCommand import colors and use it for heading, detected-shell info, already-installed warnings, and success/error messages based on install/remove results, keeping the same source command logic.
Colored success messages in storage initialization
src/utils/storage.js
storage.js imports colors and updates initStorage() to print .tracker directory and commands.json creation success messages using colors.success(...) instead of plain strings.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Possibly related PRs

  • adithya-naik/cmd-tracker#96: Modifies the same hook.js/storage.js user-facing output messaging that this PR restyles with colors.
  • adithya-naik/cmd-tracker#107: Introduced the src/utils/colors utility and its integration pattern that this PR extends to hook.js and storage.js.

Poem
A rabbit hopped through code so plain,
Sprinkling colors like sun after rain.
Hooks now glow in green and red,
Storage success in hues instead.
Consistent hues from head to tail—
No more gray in the terminal trail! 🐇🎨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main change: adding colorized CLI output in storage.js and hook.js.
Linked Issues check ✅ Passed The changes satisfy issue #108 by integrating the colors utility into both storage.js and hook.js for consistent terminal styling.
Out of Scope Changes check ✅ Passed The edits stay within the requested scope and only adjust colored output in the two targeted files.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@sonarqubecloud

sonarqubecloud Bot commented Jul 1, 2026

Copy link
Copy Markdown

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

chore: integrate chalk colors into storage.js and hook.js for UI consistency

2 participants