@visulima/iso-locale 1.0.0-alpha.1 → 1.0.0-alpha.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,139 @@
1
+ ## @visulima/iso-locale [1.0.0-alpha.12](https://github.com/visulima/visulima/compare/@visulima/iso-locale@1.0.0-alpha.11...@visulima/iso-locale@1.0.0-alpha.12) (2026-06-13)
2
+
3
+ ### Features
4
+
5
+ * **iso-locale:** add typed codes, unified lookups and i18n names ([5c09bb6](https://github.com/visulima/visulima/commit/5c09bb61823c7997f034091f1cbeddc838d305a3))
6
+
7
+ ### Code Refactoring
8
+
9
+ * **iso-locale:** apply eslint/prettier formatting cleanup ([d9875f0](https://github.com/visulima/visulima/commit/d9875f073d73d66f19ef9272b11694a80b3552be))
10
+ * **iso-locale:** derive literal unions from datasets ([c843246](https://github.com/visulima/visulima/commit/c843246db0a9b474cb68740b90b5718f6bc09d6e))
11
+
12
+ ## @visulima/iso-locale [1.0.0-alpha.11](https://github.com/visulima/visulima/compare/@visulima/iso-locale@1.0.0-alpha.10...@visulima/iso-locale@1.0.0-alpha.11) (2026-06-04)
13
+
14
+ ### Bug Fixes
15
+
16
+ * **iso-locale:** 2 bug fixes + 1 perf ([5a75216](https://github.com/visulima/visulima/commit/5a752163531e8bd458dffa264e05466e33f9d444))
17
+
18
+ ### Miscellaneous Chores
19
+
20
+ * apply eslint + prettier autofixes across packages ([c1bb784](https://github.com/visulima/visulima/commit/c1bb7848a0d93d0dfe2960c77e3cda22239c79a0))
21
+
22
+ ### Tests
23
+
24
+ * improve coverage across packages ([91bd6d3](https://github.com/visulima/visulima/commit/91bd6d3b61736e3c8bd1fc59b0b5955f76a5d323))
25
+ * **iso-locale:** cover numeric country lookups, currency fallbacks, and bcp47 parse branches ([695bf35](https://github.com/visulima/visulima/commit/695bf354daac3699c166b6a3a671cec15bd639ee))
26
+
27
+ ## @visulima/iso-locale [1.0.0-alpha.10](https://github.com/visulima/visulima/compare/@visulima/iso-locale@1.0.0-alpha.9...@visulima/iso-locale@1.0.0-alpha.10) (2026-05-27)
28
+
29
+ ### Bug Fixes
30
+
31
+ * **storage-client:** percent-encode user fields in defaultFingerprint ([7c78a0f](https://github.com/visulima/visulima/commit/7c78a0f9512e2a673b941d80839e9f1e86b7b5d0))
32
+
33
+ ### Documentation
34
+
35
+ * prettier-format agent instructions ([71b6414](https://github.com/visulima/visulima/commit/71b6414528780ac82c4e0bb25b5f4f11faba5549))
36
+
37
+ ### Miscellaneous Chores
38
+
39
+ * sorted package.json ([b47c545](https://github.com/visulima/visulima/commit/b47c545591600fdab17d5cd3a3fbc68b61e199da))
40
+
41
+ ## @visulima/iso-locale [1.0.0-alpha.9](https://github.com/visulima/visulima/compare/@visulima/iso-locale@1.0.0-alpha.8...@visulima/iso-locale@1.0.0-alpha.9) (2026-05-26)
42
+
43
+ ### Bug Fixes
44
+
45
+ * **security:** address codeql findings across packages ([3366f9c](https://github.com/visulima/visulima/commit/3366f9c07d54bdde5242fbd90780baa4634de179))
46
+
47
+ ### Miscellaneous Chores
48
+
49
+ * **ci-stability:** green CI across vis, native, lint, tests, attw ([#651](https://github.com/visulima/visulima/issues/651)) ([d4eb684](https://github.com/visulima/visulima/commit/d4eb684b5f75c818c9251048c605a0ed54a268e3))
50
+ * **iso-locale:** housekeeping cleanup ([326d3e4](https://github.com/visulima/visulima/commit/326d3e4be152fdcb828da32a67341fae0c274709))
51
+ * **iso-locale:** upgrade packem to 2.0.0-alpha.76 ([9908d9c](https://github.com/visulima/visulima/commit/9908d9c57641ade481016ea711981e03d53c746c))
52
+ * re-sort workspace package.json files via vis sort-package-json ([f625696](https://github.com/visulima/visulima/commit/f625696cfac974325774b3243e1a83c3d23acbd7))
53
+ * **repo:** sort package.json keys across all packages ([e1fd9ab](https://github.com/visulima/visulima/commit/e1fd9ab467ef96a98c777da1572ff6a50fcf7e71))
54
+
55
+ ### Tests
56
+
57
+ * **repo:** add dist runtime + types integration tests ([32ee300](https://github.com/visulima/visulima/commit/32ee300b7184117a0ddf9f9d390f75f8932d5ed9))
58
+
59
+ ## @visulima/iso-locale [1.0.0-alpha.8](https://github.com/visulima/visulima/compare/@visulima/iso-locale@1.0.0-alpha.7...@visulima/iso-locale@1.0.0-alpha.8) (2026-04-22)
60
+
61
+ ### Bug Fixes
62
+
63
+ * Remove JSR configuration generation script and generated jsr.json files ([#616](https://github.com/visulima/visulima/issues/616)) ([533744b](https://github.com/visulima/visulima/commit/533744b103b74896941db5b727173e617a27a63b))
64
+
65
+ ### Miscellaneous Chores
66
+
67
+ * bump engines.node to ^22.14.0 || >=24.10.0 ([c3d0931](https://github.com/visulima/visulima/commit/c3d0931d1504e4f21ebf50ea680cfa7ce4ba15ce))
68
+ * fixed jsr.json ([5d85e51](https://github.com/visulima/visulima/commit/5d85e5179de38e284ec433b14d77c71a1619c8d6))
69
+
70
+ ## @visulima/iso-locale [1.0.0-alpha.7](https://github.com/visulima/visulima/compare/@visulima/iso-locale@1.0.0-alpha.6...@visulima/iso-locale@1.0.0-alpha.7) (2026-04-15)
71
+
72
+ ### Bug Fixes
73
+
74
+ * **data-manipulation:** resolve eslint and type-safety issues ([f1682c2](https://github.com/visulima/visulima/commit/f1682c2611cbcc6c85d4bbea520d43464b42e7ee))
75
+ * **iso-locale:** cast readonly Country array to mutable type for public export ([b93bc50](https://github.com/visulima/visulima/commit/b93bc5064e123c541140b1ab072c280989087afc))
76
+
77
+ ## @visulima/iso-locale [1.0.0-alpha.6](https://github.com/visulima/visulima/compare/@visulima/iso-locale@1.0.0-alpha.5...@visulima/iso-locale@1.0.0-alpha.6) (2026-04-08)
78
+
79
+ ### Bug Fixes
80
+
81
+ * **iso-locale:** resolve eslint errors ([8f24691](https://github.com/visulima/visulima/commit/8f246919ecf1c5d08a3f85a019d8857bcbf31c4f))
82
+
83
+ ### Miscellaneous Chores
84
+
85
+ * apply linting and formatting fixes across packages ([5d150a5](https://github.com/visulima/visulima/commit/5d150a578f9ce861c791843c683deeb849b774a9))
86
+ * **data-manipulation:** remove empty dependency objects from package.json ([c0e8f76](https://github.com/visulima/visulima/commit/c0e8f7689a2da413f771494f6ecb07babc4b5e06))
87
+ * **iso-locale:** add tsconfig.eslint.json for type-aware linting ([0322596](https://github.com/visulima/visulima/commit/0322596031774fef5e1bbbce188de31d2033824b))
88
+ * **iso-locale:** apply prettier formatting ([420b06e](https://github.com/visulima/visulima/commit/420b06e28f37beea0679b16f2ada733518e2cffe))
89
+ * **iso-locale:** migrate .prettierrc.cjs to prettier.config.js ([ecc98a0](https://github.com/visulima/visulima/commit/ecc98a0b65de3b5c97cc5b12bd55732e193b2dc9))
90
+
91
+ ## @visulima/iso-locale [1.0.0-alpha.5](https://github.com/visulima/visulima/compare/@visulima/iso-locale@1.0.0-alpha.4...@visulima/iso-locale@1.0.0-alpha.5) (2026-03-26)
92
+
93
+ ### Features
94
+
95
+ * **web:** auto-generate packages page from workspace metadata ([623e520](https://github.com/visulima/visulima/commit/623e5207693a7fe720f5f2f179593a3654c880e3))
96
+
97
+ ## @visulima/iso-locale [1.0.0-alpha.4](https://github.com/visulima/visulima/compare/@visulima/iso-locale@1.0.0-alpha.3...@visulima/iso-locale@1.0.0-alpha.4) (2026-03-26)
98
+
99
+ ### Bug Fixes
100
+
101
+ * **web:** improve build setup with incremental stats caching and prod install ([fe33e75](https://github.com/visulima/visulima/commit/fe33e75827586779b4b3a0c6d57b39f889ee6207))
102
+
103
+ ### Miscellaneous Chores
104
+
105
+ * **iso-locale:** migrate deps to pnpm catalogs ([77a0af9](https://github.com/visulima/visulima/commit/77a0af94f3ee1c405cfca1df1db16af6c6b288ea))
106
+ * **iso-locale:** update dependencies ([171ce31](https://github.com/visulima/visulima/commit/171ce31272306c952d35018dea8ec4072f11cd52))
107
+ * visulima website ([#591](https://github.com/visulima/visulima/issues/591)) ([59ab2e2](https://github.com/visulima/visulima/commit/59ab2e2befb03e51cd2088956f83d9b87de6d033))
108
+
109
+ ## @visulima/iso-locale [1.0.0-alpha.3](https://github.com/visulima/visulima/compare/@visulima/iso-locale@1.0.0-alpha.2...@visulima/iso-locale@1.0.0-alpha.3) (2026-03-06)
110
+
111
+ ### Bug Fixes
112
+
113
+ * **iso-locale:** update packem to 2.0.0-alpha.54 ([17ce847](https://github.com/visulima/visulima/commit/17ce8479d65e21f26da08674cedadfd69bf8fbeb))
114
+
115
+ ### Documentation
116
+
117
+ * **humanizer,html,iso-locale,package,tsconfig:** add comprehensive Fumadocs documentation ([19781ce](https://github.com/visulima/visulima/commit/19781ce5d27605971a9f2fdf0a99863effd98091))
118
+
119
+ ### Miscellaneous Chores
120
+
121
+ * **data-manipulation:** update dependencies ([49458ab](https://github.com/visulima/visulima/commit/49458ab8f8e17d875840b1b4fe8b5efe12ff3513))
122
+ * **iso-locale:** update dependencies ([78c7b5e](https://github.com/visulima/visulima/commit/78c7b5e3528c2ec4a32cab44449c5840664fa94d))
123
+ * update lock file maintenance ([d83e716](https://github.com/visulima/visulima/commit/d83e71697b75d24704185b66bb521a934d2db02d))
124
+ * year update ([47f4105](https://github.com/visulima/visulima/commit/47f410596ce7190cfea36a073db32e0cec50bbcd))
125
+
126
+ ## @visulima/iso-locale [1.0.0-alpha.2](https://github.com/visulima/visulima/compare/@visulima/iso-locale@1.0.0-alpha.1...@visulima/iso-locale@1.0.0-alpha.2) (2026-01-17)
127
+
128
+ ### Bug Fixes
129
+
130
+ * added missing og image ([7712247](https://github.com/visulima/visulima/commit/771224739f29e977d5684849dcf015486c75ff00))
131
+
132
+ ### Miscellaneous Chores
133
+
134
+ * fixed changelog ([6ebdc5b](https://github.com/visulima/visulima/commit/6ebdc5b56e94054f4ac88d2bc2235a2c14d3d608))
135
+ * sorting package.json ([430ed68](https://github.com/visulima/visulima/commit/430ed683d3e38e4c5c5530f787ca832f083b17e4))
136
+
1
137
  ## @visulima/iso-locale 1.0.0-alpha.1 (2026-01-17)
2
138
 
3
139
  ### Features
package/LICENSE.md CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2025 visulima
3
+ Copyright (c) 2026 visulima
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -1,4 +1,14 @@
1
- <!-- START_PACKAGE_OG_IMAGE_PLACEHOLDER --><!-- END_PACKAGE_OG_IMAGE_PLACEHOLDER -->
1
+ <!-- START_PACKAGE_OG_IMAGE_PLACEHOLDER -->
2
+
3
+ <a href="https://www.anolilab.com/open-source" align="center">
4
+
5
+ <img src="__assets__/package-og.svg" alt="iso-locale" />
6
+
7
+ </a>
8
+
9
+ <h3 align="center">ISO data for countries, currencies, regions, timezones, and BCP 47 locale support.</h3>
10
+
11
+ <!-- END_PACKAGE_OG_IMAGE_PLACEHOLDER -->
2
12
 
3
13
  <br />
4
14
 
@@ -43,12 +53,16 @@ pnpm add @visulima/iso-locale
43
53
  ### Countries
44
54
 
45
55
  ```typescript
46
- import { getByAlpha2, getCountryByName, getEmoji, getCallingCode, getLanguages } from "@visulima/iso-locale";
56
+ import { getByAlpha2, getCountry, getCountryByName, getCountryName, getEmoji, getCallingCode, getLanguages } from "@visulima/iso-locale";
47
57
 
48
58
  // Get country by code
49
59
  const country = getByAlpha2("US");
50
60
  console.log(country.name); // "United States"
51
61
 
62
+ // Get country by ANY code format (alpha-2, alpha-3, or numeric)
63
+ console.log(getCountry("US")?.name); // "United States"
64
+ console.log(getCountry("USA")?.name); // "United States"
65
+
52
66
  // Get country by name
53
67
  const country2 = getCountryByName("United States");
54
68
 
@@ -60,6 +74,23 @@ console.log(getCallingCode("US")); // "+1"
60
74
 
61
75
  // Get languages
62
76
  console.log(getLanguages("US")); // ["eng"]
77
+
78
+ // Localized country name (uses the runtime Intl.DisplayNames API)
79
+ console.log(getCountryName("DE", "fr")); // "Allemagne"
80
+ console.log(getCountryName("US")); // "United States"
81
+ ```
82
+
83
+ ### Strongly-typed codes
84
+
85
+ The country and currency code unions are derived directly from the bundled
86
+ datasets, so consumers get autocomplete and compile-time validation for free:
87
+
88
+ ```typescript
89
+ import type { Alpha2Code, Alpha3Code, CurrencyCode } from "@visulima/iso-locale";
90
+
91
+ const region: Alpha2Code = "US"; // ✅
92
+ const wrong: Alpha2Code = "ZZ"; // ❌ compile error
93
+ const money: CurrencyCode = "EUR"; // ✅
63
94
  ```
64
95
 
65
96
  ### Currencies
@@ -135,8 +166,41 @@ const parsed = parseBCP47Tag("zh-Hant-TW");
135
166
  console.log(parsed);
136
167
  // { language: "zh", script: "Hant", country: "TW" }
137
168
 
138
- // Generate BCP 47 tag
169
+ // Generate BCP 47 tag (script subtags are canonicalized to title case)
139
170
  console.log(generateBCP47Tag("en", "US")); // "en-US"
171
+ console.log(generateBCP47Tag("zh", "TW", "hant")); // "zh-Hant-TW"
172
+ ```
173
+
174
+ ### Languages
175
+
176
+ ```typescript
177
+ import { getCountriesByLanguage, getLanguageName } from "@visulima/iso-locale";
178
+
179
+ // Reverse lookup: which countries use a language (accepts ISO 639-1 or 639-3)
180
+ console.log(getCountriesByLanguage("de")); // ["AT", "BE", "CH", "DE", "LI", ...]
181
+
182
+ // Localized language name (uses the runtime Intl.DisplayNames API)
183
+ console.log(getLanguageName("de", "fr")); // "allemand"
184
+ ```
185
+
186
+ ## Subpath entrypoints
187
+
188
+ Every domain is also available as a focused entrypoint, so you can import only
189
+ the dataset you need and let bundlers tree-shake the rest:
190
+
191
+ | Import | Contents |
192
+ | --------------------------------- | ------------------------------------------------------ |
193
+ | `@visulima/iso-locale` | Aggregate barrel re-exporting everything below |
194
+ | `@visulima/iso-locale/countries` | ISO 3166-1 country lookups + `Alpha2Code`/`Alpha3Code` |
195
+ | `@visulima/iso-locale/currencies` | ISO 4217 currency lookups + `CurrencyCode` |
196
+ | `@visulima/iso-locale/locale` | BCP 47 helpers, `getCurrency`, `getLanguageName` |
197
+ | `@visulima/iso-locale/regions` | UN M.49 region helpers |
198
+ | `@visulima/iso-locale/timezones` | IANA timezone helpers |
199
+ | `@visulima/iso-locale/types` | Shared TypeScript interfaces |
200
+
201
+ ```typescript
202
+ // Only pulls in the currency dataset, not countries/regions/timezones
203
+ import { getByCode, getSymbol } from "@visulima/iso-locale/currencies";
140
204
  ```
141
205
 
142
206
  ## Related