-
Notifications
You must be signed in to change notification settings - Fork 11.7k
Closed
Closed
Copy link
Labels
area/coreIssues related to User Interface, OS Support, Core FunctionalityIssues related to User Interface, OS Support, Core Functionalitygood first issuehelp wantedWe will accept PRs from all issues marked as "help wanted". Thanks for your support!We will accept PRs from all issues marked as "help wanted". Thanks for your support!kind/enhancementpriority/p3Backlog - a good idea but not currently a priority.Backlog - a good idea but not currently a priority.status/bot-triagedtype/task
Description
Summary
The formatMemoryUsage function in packages/core/src/utils/formatters.ts is a general-purpose byte formatting utility that converts byte values to human-readable strings (e.g., 1024 → "1.0 KB").
The current name formatMemoryUsage is misleading as it suggests the function is specific to memory metrics, when it actually formats any byte value.
Proposed Change
Rename formatMemoryUsage → formatBytes within the core package scope only.
Files affected:
packages/core/src/utils/formatters.ts- rename functionpackages/core/src/utils/formatters.test.ts- update test suite namepackages/core/src/tools/shell.ts- update import and usage
Why this matters:
- Clarity:
formatBytesaccurately describes what the function does - Reuse: The current name discourages reuse because it sounds memory-specific, even though it's a general byte formatter
- Consistency: Aligns with common naming conventions (
formatBytesis standard across ecosystems)
Scope
This refactor is limited to packages/core/ only. The cli/ package has its own formatMemoryUsage function which remains unchanged (intentional package independence per project conventions).
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area/coreIssues related to User Interface, OS Support, Core FunctionalityIssues related to User Interface, OS Support, Core Functionalitygood first issuehelp wantedWe will accept PRs from all issues marked as "help wanted". Thanks for your support!We will accept PRs from all issues marked as "help wanted". Thanks for your support!kind/enhancementpriority/p3Backlog - a good idea but not currently a priority.Backlog - a good idea but not currently a priority.status/bot-triagedtype/task