Feature/wrap up#33
Conversation
📝 WalkthroughWalkthroughAdds Duration.balance() and Duration.format(), memoized Intl helpers, cascading intl.numberFormat support in Tempo.init, a lexer permissiveness fix for per*-prefixed tokens, licensing JWS handling refactor, removal of premium plugin/term helpers, resolve-types updates, docs/changelog/package bumps to v2.11.0, and related tests with explicit locale initialization. ChangesDuration Formatting and Intl Configuration
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint skipped: no ESLint configuration detected in root package.json. To enable, add 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. Comment |
|
@coderabbitai please set reviews.auto_title_instructions |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/tempo/src/module/module.duration.ts`:
- Around line 59-67: The decomposition uses Math.floor and % which misbehaves
for negative totalDays; change the logic in module.duration.ts (where years,
months, weeks are computed from totalDays) to use truncating division and
subtraction instead of floor+mod. Specifically, compute each unit with
Math.trunc(totalDays / 365) (and similarly for 30 and 7 for months/weeks), then
subtract years * 365 (etc.) from totalDays to get the remainder; apply the same
pattern for months and weeks so negative durations correctly distribute across
units.
- Around line 97-105: The .format() branch in
packages/tempo/src/module/module.duration.ts currently only checks years→seconds
and then returns '0' if none match, which drops sub-second-only durations;
update the conditional sequence in the formatting logic (the method that
contains the lines checking this.years/this.months/...this.seconds) to also
check this.milliseconds, this.microseconds, and this.nanoseconds (in that order
or smallest-first as desired) and set val and u accordingly so sub-second
durations are formatted instead of returning '0'. Ensure the same identifying
symbols (this.milliseconds, this.microseconds, this.nanoseconds, and the
existing val/u variables) are used and that the final fallback only triggers
when truly zero.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 4a48302e-4525-4436-b462-331c277a59fa
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (23)
CHANGELOG.mdpackage.jsonpackages/library/CHANGELOG.mdpackages/library/package.jsonpackages/library/src/common/international.library.tspackages/tempo/.vitepress/config.tspackages/tempo/CHANGELOG.mdpackages/tempo/doc/releases/v2.x.mdpackages/tempo/doc/tempo-vs-temporal.mdpackages/tempo/doc/tempo.config.mdpackages/tempo/doc/tempo.duration.mdpackages/tempo/doc/tempo.weekday.mdpackages/tempo/package.jsonpackages/tempo/src/engine/engine.lexer.tspackages/tempo/src/module/module.duration.tspackages/tempo/src/support/support.intl.tspackages/tempo/src/tempo.class.tspackages/tempo/src/tempo.type.tspackages/tempo/test/discrete/compact.time.test.tspackages/tempo/test/engine/layout.order.test.tspackages/tempo/test/instance/instance.since.test.tspackages/tempo/test/plugins/duration.balance.test.tspackages/tempo/test/plugins/slick.shorthand.test.ts
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain
🛠 Debug Information Gathered
Could you provide the value you'd like to set? For example: Once you share the desired instructions, I can update your |
|
@coderabbitai: please set reviews.auto_title_instructions to |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: Length of output: 534 🏁 Script executed: Length of output: 888
reviews:
auto_title_instructions: "Generate a concise PR title that starts with a conventional commit type (feat, fix, chore, etc.) followed by a short imperative description of the change."
path_filters:
...You can view the commit here: 92db727 Once this PR is merged into |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/tempo/src/plugin/term/term.index.ts`:
- Line 11: The public barrel export removed definePremiumTerm which is a
breaking change; restore backwards compatibility by re-exporting a deprecated
shim named definePremiumTerm from this module (term.index.ts) that forwards to
the new implementation (e.g., call or re-export the appropriate symbol used by
defineTerm/defineRange/getTermRange), mark it as deprecated in comments, and
keep the existing export line (export { defineTerm, defineRange, getTermRange })
while adding export { definePremiumTerm } so existing imports continue to work
without changing consumers.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 3e551310-9b1d-4df1-9b02-570805d56a0f
📒 Files selected for processing (10)
packages/library/src/common/string.library.tspackages/tempo/bin/resolve-types.tspackages/tempo/doc/tempo.plugin.mdpackages/tempo/doc/tempo.term.mdpackages/tempo/rollup.config.jspackages/tempo/src/module/module.duration.tspackages/tempo/src/plugin/plugin.util.tspackages/tempo/src/plugin/term/term.index.tspackages/tempo/src/plugin/term/term.util.tspackages/tempo/src/support/support.license.ts
💤 Files with no reviewable changes (1)
- packages/tempo/src/plugin/term/term.util.ts
✅ Files skipped from review due to trivial changes (1)
- packages/tempo/rollup.config.js
Duration balancing / formatting
Small fixes
Summary by CodeRabbit
New Features
Bug Fixes
Documentation