Skip to content

fix(data): update country currencies to current ISO 4217 - #167

Merged
dmythro merged 1 commit into
mainfrom
fix/actualize-currency-data
Jun 14, 2026
Merged

fix(data): update country currencies to current ISO 4217#167
dmythro merged 1 commit into
mainfrom
fix/actualize-currency-data

Conversation

@dmythro

@dmythro dmythro commented Jun 14, 2026

Copy link
Copy Markdown
Member

Stacked on #166 (currencies feature) — base retargets to main once #166 merges.

Summary

Brings country currency assignments up to date with current ISO 4217. The audit in #166 found exactly 3 codes in countries.ts withdrawn from ISO 4217; this updates them to their active successors:

Country Before After Reason
Curaçao (CW), Sint Maarten (SX) ANG XCG Caribbean Guilder replaced the Netherlands Antillean Guilder (circulating since 2025-03-31)
Sierra Leone (SL) SLL SLE 2022 redenomination (÷1000)
United States (US) USD, USN, USS USD, USN USS (Dollar Same-day) removed from ISO 4217

This PR only touches countries.ts and the regenerated currencies.ts — the generator and the withdrawn-code handling live in #166.

⚠️ Potentially breaking (for release notes)

countries / getCountryData() currency values change for CW, SX, SL, US. Consumers hardcoding ANG/SLL/USS for these countries will see the new codes — suggest a minor or major bump with this called out.

Currencies table (regenerated)

  • ANG, SLL, USS stay in the full table flagged withdrawn: true (defined directly in the generator, in feat(currencies): add ISO 4217 currency support (opt-in) #166), so legacy lookups still resolve and getCurrencyByNumeric('532') still returns the active XCG.
  • The in-use subset (currencies.min.json) now includes XCG/SLE and excludes the withdrawn codes (159 vs 160).
  • XCG/SLE pick up home-locale data now that a country references them — XCG name Caribische gulden, symbol/symbolNative Cg; SLE native symbol Le. (XCG symbol is corrected to the official Cg via a small generator override — CLDR returns Cg. for the new code.)

bun run ci passes; the every country currency exists in the currencies table integrity test validates the updated data.

Copilot AI review requested due to automatic review settings June 14, 2026 14:32
@coderabbitai

coderabbitai Bot commented Jun 14, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

Pull request was closed or merged during review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a81acf9f-fd71-4df6-928a-e1e8cda7a790

📥 Commits

Reviewing files that changed from the base of the PR and between 391f057 and 1ec4ea7.

📒 Files selected for processing (3)
  • packages/countries/src/data/countries.ts
  • packages/countries/src/data/currencies.ts
  • packages/scripts/generateCurrencies.ts
✅ Files skipped from review due to trivial changes (1)
  • packages/countries/src/data/currencies.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/countries/src/data/countries.ts

📝 Walkthrough

Walkthrough

Currency codes for four countries are updated in countries.ts: Curaçao (CW) and Sint Maarten (SX) switch from ANG to XCG, Sierra Leone (SL) switches from SLL to SLE, and the United States (US) drops USS from its currency list. In currencies.ts, the SLE entry's symbolNative is corrected from 'SLE' to 'Le', and the XCG entry's native name is updated to 'Caribische gulden' with symbolNative changed from 'Cg.' to 'Cg'. The currency generation script is enhanced with a SYMBOL_OVERRIDES map to allow corrected narrow-symbol strings to override CLDR-based output.

Possibly related PRs

  • annexare/Countries#166: Updates the ISO 4217 currencies dataset and generateCurrencies.ts symbol-generation logic, directly intersecting with the currency-support infrastructure that this PR refines.

Poem

🐇 A gulden renamed, a Leone reborn,
The USS quietly trimmed with the morn,
Four countries now speak with currencies true,
Their symbols corrected, their native names new.
With a hop and a fix, the data shines through! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main objective: updating country currencies to align with current ISO 4217 standard.
Description check ✅ Passed The description is detailed and complete, covering changes, affected countries, verification notes, and breaking change warnings, but lacks explicit verification source URLs as specified in the template.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/actualize-currency-data

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Updates country→currency assignments and currency metadata to align with current ISO 4217, while keeping withdrawn legacy codes available for lookups via the full currencies table.

Changes:

  • Update country currency codes: CW/SX ANGXCG, SL SLLSLE, and remove USS from US.
  • Make the currency generator explicitly define withdrawn legacy currencies (name/symbol/numeric/decimals/withdrawn) rather than attempting CLDR derivation.
  • Regenerate published artifacts (TS data, dist JS/JSON/SQL/CSV) including improved symbolNative for SLE and XCG.

Reviewed changes

Copilot reviewed 3 out of 13 changed files in this pull request and generated no comments.

Show a summary per file
File Description
packages/scripts/generateCurrencies.ts Refactors generation to merge active ISO codes with fully-specified withdrawn legacy codes for stable re-runs.
packages/countries/src/data/currencies.ts Updates symbolNative for SLE and XCG in the source currency table.
packages/countries/src/data/countries.ts Updates affected countries’ currency arrays to the current ISO 4217 codes.
dist/mjs/currencies.js Regenerated ESM currency bundle reflecting new symbols/withdrawn handling.
dist/cjs/currencies.js Regenerated CJS currency bundle reflecting new symbols/withdrawn handling.
dist/data.sql Updates currency/country rows to match the revised codes and symbols.
dist/currencies.min.json Regenerates in-use currency subset to include XCG/SLE and exclude withdrawn codes.
dist/currencies.all.min.json Regenerates full currency dataset retaining withdrawn codes with withdrawn: true.
dist/countries.min.json Regenerates minified country dataset with updated currency codes.
dist/countries.csv Regenerates CSV export with updated currency codes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@dmythro
dmythro force-pushed the fix/actualize-currency-data branch from b99c754 to 361d4bb Compare June 14, 2026 14:42
@dmythro
dmythro force-pushed the feat/iso-4217-currencies branch from eab0c08 to aeec6f2 Compare June 14, 2026 14:57
@dmythro
dmythro force-pushed the fix/actualize-currency-data branch from 361d4bb to e3b8161 Compare June 14, 2026 14:58
@dmythro
dmythro force-pushed the feat/iso-4217-currencies branch 2 times, most recently from 12139de to 96a4d29 Compare June 14, 2026 15:26
@dmythro
dmythro force-pushed the fix/actualize-currency-data branch from e3b8161 to 60c7778 Compare June 14, 2026 15:29
@dmythro
dmythro force-pushed the feat/iso-4217-currencies branch from 96a4d29 to 167fa53 Compare June 14, 2026 15:50
@dmythro
dmythro force-pushed the fix/actualize-currency-data branch from 60c7778 to 4393594 Compare June 14, 2026 15:51
@dmythro
dmythro force-pushed the feat/iso-4217-currencies branch from 167fa53 to 49e3679 Compare June 14, 2026 16:15
@dmythro
dmythro force-pushed the fix/actualize-currency-data branch from 4393594 to 3910059 Compare June 14, 2026 16:16
Base automatically changed from feat/iso-4217-currencies to main June 14, 2026 16:27
@dmythro
dmythro force-pushed the fix/actualize-currency-data branch from 3910059 to 391f057 Compare June 14, 2026 16:28

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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/countries/src/data/currencies.ts`:
- Around line 1345-1347: Remove the period from the symbol field in the
Caribbean Guilder (Caribische gulden) currency definition. Change the symbol
from 'Cg.' to 'Cg' to match the official abbreviation. The native name
'Caribische gulden' and symbolNative 'Cg' are already correct and require no
changes.
🪄 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: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: c6838bbf-dc36-4616-9a71-f86f1b3dbff2

📥 Commits

Reviewing files that changed from the base of the PR and between d13f57f and 391f057.

📒 Files selected for processing (2)
  • packages/countries/src/data/countries.ts
  • packages/countries/src/data/currencies.ts

Comment thread packages/countries/src/data/currencies.ts
Replace currency codes withdrawn from ISO 4217 with their active
successors, and drop a removed fund code:

- CW, SX: ANG -> XCG (Caribbean Guilder, in circulation since 2025)
- SL: SLL -> SLE (2022 redenomination)
- US: drop USS (US Dollar Same-day, removed from ISO 4217)

ANG, SLL and USS stay in the currencies table flagged `withdrawn` for
legacy lookups; the generator specifies their display data directly since
they no longer map to a country.

Potentially breaking: getCountryData() currency values change for CW, SX,
SL and US.
@dmythro
dmythro force-pushed the fix/actualize-currency-data branch from 391f057 to 1ec4ea7 Compare June 14, 2026 16:39
@dmythro
dmythro merged commit e79f0dd into main Jun 14, 2026
2 of 3 checks passed
@dmythro
dmythro deleted the fix/actualize-currency-data branch June 14, 2026 16:41
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