BREAKING(cli/unstable): remove `ProgressBarFormatter.styledTime` and use `DurationFormat`
We should not provide an opinionated time style in the ProgressBarFormatter object, we already provide a defaultFormatter which styles the time.
Instead we should point to Intl.DurationFormat which allows for all kinds of styles.
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 94.68%. Comparing base (
3d44532) to head (6ddd319).
Additional details and impacted files
@@ Coverage Diff @@
## main #6692 +/- ##
==========================================
- Coverage 94.70% 94.68% -0.02%
==========================================
Files 567 567
Lines 46793 46797 +4
Branches 6582 6582
==========================================
- Hits 44315 44312 -3
- Misses 2436 2443 +7
Partials 42 42
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
- :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
We should not provide an opinionated time style in the ProgressBarFormatter object, we already provide a defaultFormatter which styles the time.
I don't see this reasoning. MM:SS is probably most common format for indicating minutes and seconds, and styledTime is convenient shorthand for reusing that format when choosing different style as default formatter. Why do we need to remove it?
This change doesn't format correctly. It puts everything under the seconds section.
new Intl.DurationFormat(undefined, {
minutes: "2-digit",
seconds:"2-digit",
fractionalDigits: 0
})
.format({milliseconds: Date.now()});
// "00:1748597655"
This change doesn't format correctly. It puts everything under the seconds section.
new Intl.DurationFormat(undefined, { minutes: "2-digit", seconds:"2-digit", fractionalDigits: 0 }) .format({milliseconds: Date.now()}); // "00:1748597655"
Good catch!
I think this has to wait until Temporal is stable. Then that can be solved with Temporal.Duration.prototype.round().
Putting this as draft for now.
