Skip to content

refactor(DAO-2005): migrate btc-vault formatters to shared utilities [2/5]#2101

Open
Freshenext wants to merge 3 commits intomainfrom
DAO-2005-2-btc-vault-core
Open

refactor(DAO-2005): migrate btc-vault formatters to shared utilities [2/5]#2101
Freshenext wants to merge 3 commits intomainfrom
DAO-2005-2-btc-vault-core

Conversation

@Freshenext
Copy link
Copy Markdown
Collaborator

Summary

  • Remove formatPercent and all date functions from btc-vault formatters.ts
  • Update mappers.ts to import formatPercentage, formatDateDayFirst, formatDateMonthFirst from @/lib/utils
  • Update BtcVaultMetrics to use formatDateFullMonth and formatDateMonthFirst from shared utils

Stack: #2100[2/5]#3#4#5

…ion, and date

Introduce three shared formatting modules in lib/utils:
- formatPercentage: rewritten to produce "10.20%" (padded + suffix, no range validation)
- formatDuration: configurable time-unit formatter with leading-zero suppression
- formatDate: 10 Luxon-based date formatters replacing scattered Intl/moment implementations

Also updates durationToLabel to delegate to the new formatDuration.
- Remove formatPercent, date functions from btc-vault formatters.ts
- Update mappers.ts to import formatPercentage, formatDateDayFirst,
  formatDateMonthFirst from @/lib/utils
- Update BtcVaultMetrics to use formatDateFullMonth and formatDateMonthFirst
  from @/lib/utils
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 14, 2026

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Snapshot Warnings

⚠️: No snapshots were found for the head SHA 1e5fca0.
Ensure that dependencies are being submitted on PR branches and consider enabling retry-on-snapshot-warnings. See the documentation for more information and troubleshooting advice.

Scanned Files

None

@cybervoid0
Copy link
Copy Markdown
Contributor

check the failing test please

@Freshenext Freshenext self-assigned this Apr 14, 2026
Base automatically changed from DAO-2005-1-shared-utils to main April 14, 2026 15:32
Missed imports of formatDateMonthFirst and formatDateFullMonthPaddedDayUtc
still pointed at the btc-vault formatters after they were removed.
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.

2 participants