Skip to content

Conversation

@Pixselve
Copy link
Contributor

Description of changes:

Initially coming from https://github.com/cloudscape-design/components/tree/19cf57da0cefff1173ecf2d6457d84fb95b4a8df/src/internal/utils/locale

Will be used in chart-components as charts will optionally take a locale prop, to format numbers, dates...

@codecov
Copy link

codecov bot commented Nov 24, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.82%. Comparing base (836039f) to head (f716264).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #176      +/-   ##
==========================================
+ Coverage   98.78%   98.82%   +0.04%     
==========================================
  Files          37       40       +3     
  Lines         906      937      +31     
  Branches      242      263      +21     
==========================================
+ Hits          895      926      +31     
+ Misses         11       10       -1     
- Partials        0        1       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

src/index.ts Outdated
export type { PropertyDescriptions } from './use-controllable-state/interfaces';

// Locale utils
export { mergeLocales } from './locale/merge-locales';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For cases like this in which we are the only known consumers, we add new exports in ./internal instead.

I would propose to add one entry-point index file inside ./internal/locale and an exports entry in the package.json file for ./internal/locale/index.js

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ack, thanks for the context. Updated in the next rev


export type DayIndex = 0 | 1 | 2 | 3 | 4 | 5 | 6;

export function normalizeStartOfWeek(startOfWeek: number | undefined, locale: string) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually I see that this function does not have its own coverage (also not in components) and since we are now exporting as part of this package, I think it is more necessary. Could you add some coverage? A couple cases where the start of the week is different would suffice.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added 👍

@jperals jperals added this pull request to the merge queue Nov 28, 2025
Merged via the queue into cloudscape-design:main with commit 954d4ec Nov 28, 2025
43 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants