Skip to content

Conversation

@zourzouvillys
Copy link
Contributor

@zourzouvillys zourzouvillys commented Dec 5, 2025

Added missing entries for Aland Islands, Ascension Island, Kosovo, Mayotte, Western Sahara, and updated names for Algeria, Congo (split into Democratic Republic and Republic), Macedonia (to North Macedonia), and Swaziland (to Eswatini).

Description

Checklist

  • pnpm test runs as expected.
  • pnpm build runs as expected.
  • (If applicable) JSDoc comments have been added or updated for any package exports
  • (If applicable) Documentation has been updated

Type of change

  • 🐛 Bug fix
  • 🌟 New feature
  • 🔨 Breaking change
  • 📖 Refactoring / dependency upgrade / documentation
  • other:

Summary by CodeRabbit

  • New Features

    • Extended country list in the phone number selector with additions like Åland Islands, Ascension Island, Kosovo, Mayotte, Western Sahara, and North Macedonia.
  • Bug Fixes

    • Standardized and corrected country names (Algeria, Eswatini) and split ambiguous Congo entries into Republic of the Congo and Democratic Republic of the Congo for improved accuracy.

✏️ Tip: You can customize this high-level summary in your review settings.

Added missing entries for Aland Islands, Ascension Island, Kosovo, Mayotte, Western Sahara, and updated names for Algeria, Congo (split into Democratic Republic and Republic), Macedonia (to North Macedonia), and Swaziland (to Eswatini).
@changeset-bot
Copy link

changeset-bot bot commented Dec 5, 2025

🦋 Changeset detected

Latest commit: 1c55299

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@clerk/clerk-js Patch
@clerk/chrome-extension Patch
@clerk/clerk-expo Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link

vercel bot commented Dec 5, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
clerk-js-sandbox Ready Ready Preview Comment Dec 5, 2025 4:32pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 5, 2025

Walkthrough

The phone country code dataset was updated: new country entries added (Åland Islands, Ascension Island, Kosovo, Mayotte, Western Sahara), several country names normalized or expanded (e.g., "Algeria", "Eswatini", "Democratic Republic of the Congo", "Republic of the Congo", "North Macedonia"), and some entries relocated or duplicated. No public API/signature changes.

Changes

Cohort / File(s) Change Summary
Country code data
packages/clerk-js/src/ui/elements/PhoneInput/countryCodeData.ts
Added entries (Åland/ A land Islands, Ascension Island, Kosovo, Mayotte, Western Sahara); normalized names and fixes (removed trailing space from Algeria; replaced SwazilandEswatini); split ambiguous Congo into Democratic Republic of the Congo and Republic of the Congo; replaced MacedoniaNorth Macedonia; some entries relocated or duplicated.
Changeset metadata
.changeset/legal-hands-lead.md
Added a changeset noting a patch release and summarizing the country code/name updates.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Verify there are no unintended duplicate entries (notably Western Sahara and North Macedonia).
  • Confirm ISO codes and dialing prefixes against an authoritative reference.
  • Ensure list ordering/positioning changes do not affect UI selection or rendering.

Poem

🐰 I hopped through country codes with glee,
Åland, Mayotte, and Kosovo for tea,
Eswatini twirls, two Congos stand true,
North Macedonia nods—numbers anew,
Tiny paws, tidy list, ready for you 🥕📱

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix(clerk-js): Update and expand country code data' clearly and accurately summarizes the main changes: updating country code entries and adding new ones to the countryCodeData file.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch theo/add-kosvo

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 505ca9e and 1c55299.

📒 Files selected for processing (1)
  • packages/clerk-js/src/ui/elements/PhoneInput/countryCodeData.ts (8 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/clerk-js/src/ui/elements/PhoneInput/countryCodeData.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
  • GitHub Check: Build Packages
  • GitHub Check: Formatting | Dedupe | Changeset
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: semgrep-cloud-platform/scan
  • GitHub Check: semgrep-cloud-platform/scan

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

@zourzouvillys zourzouvillys changed the title Update and expand country code data fix(clerk-js): Update and expand country code data Dec 5, 2025
@pkg-pr-new
Copy link

pkg-pr-new bot commented Dec 5, 2025

Open in StackBlitz

@clerk/agent-toolkit

npm i https://pkg.pr.new/@clerk/agent-toolkit@7378

@clerk/astro

npm i https://pkg.pr.new/@clerk/astro@7378

@clerk/backend

npm i https://pkg.pr.new/@clerk/backend@7378

@clerk/chrome-extension

npm i https://pkg.pr.new/@clerk/chrome-extension@7378

@clerk/clerk-js

npm i https://pkg.pr.new/@clerk/clerk-js@7378

@clerk/dev-cli

npm i https://pkg.pr.new/@clerk/dev-cli@7378

@clerk/elements

npm i https://pkg.pr.new/@clerk/elements@7378

@clerk/clerk-expo

npm i https://pkg.pr.new/@clerk/clerk-expo@7378

@clerk/expo-passkeys

npm i https://pkg.pr.new/@clerk/expo-passkeys@7378

@clerk/express

npm i https://pkg.pr.new/@clerk/express@7378

@clerk/fastify

npm i https://pkg.pr.new/@clerk/fastify@7378

@clerk/localizations

npm i https://pkg.pr.new/@clerk/localizations@7378

@clerk/nextjs

npm i https://pkg.pr.new/@clerk/nextjs@7378

@clerk/nuxt

npm i https://pkg.pr.new/@clerk/nuxt@7378

@clerk/clerk-react

npm i https://pkg.pr.new/@clerk/clerk-react@7378

@clerk/react-router

npm i https://pkg.pr.new/@clerk/react-router@7378

@clerk/remix

npm i https://pkg.pr.new/@clerk/remix@7378

@clerk/shared

npm i https://pkg.pr.new/@clerk/shared@7378

@clerk/tanstack-react-start

npm i https://pkg.pr.new/@clerk/tanstack-react-start@7378

@clerk/testing

npm i https://pkg.pr.new/@clerk/testing@7378

@clerk/themes

npm i https://pkg.pr.new/@clerk/themes@7378

@clerk/types

npm i https://pkg.pr.new/@clerk/types@7378

@clerk/upgrade

npm i https://pkg.pr.new/@clerk/upgrade@7378

@clerk/vue

npm i https://pkg.pr.new/@clerk/vue@7378

commit: 1c55299

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 4ff106a and d36f43c.

📒 Files selected for processing (1)
  • packages/clerk-js/src/ui/elements/PhoneInput/countryCodeData.ts (7 hunks)
🧰 Additional context used
📓 Path-based instructions (8)
packages/clerk-js/src/ui/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/clerk-js-ui.mdc)

packages/clerk-js/src/ui/**/*.{ts,tsx}: Element descriptors should be written in camelCase
Use useCardState for card-level state management
Use useFormState for form-level state management
Use useLoadingStatus for managing loading states
Use useFormControl hook for form field state management with validation and localization support
All rendered values must be localized using useLocalizations hook - hard coded values are not allowed
Use localizationKeys for translating UI text with support for parameters and error messages
Use handleError utility for API error handling and provide field states for proper error mapping
Use the styled system sx prop with theme tokens for custom styling instead of inline styles
Use the Card component pattern with Card.Root, Card.Header, Card.Title, Card.Content, and Card.Footer for consistent card layouts
Use FormContainer with headerTitle and headerSubtitle localization keys combined with Form.Root and FormButtons for consistent form layouts
When form submission occurs, manage loading and error states by calling status.setLoading(), card.setLoading(), and card.setError() appropriately

Files:

  • packages/clerk-js/src/ui/elements/PhoneInput/countryCodeData.ts
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

All code must pass ESLint checks with the project's configuration

Files:

  • packages/clerk-js/src/ui/elements/PhoneInput/countryCodeData.ts
**/*.{js,jsx,ts,tsx,json,md,yml,yaml}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

Use Prettier for consistent code formatting

Files:

  • packages/clerk-js/src/ui/elements/PhoneInput/countryCodeData.ts
packages/**/src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

TypeScript is required for all packages

Files:

  • packages/clerk-js/src/ui/elements/PhoneInput/countryCodeData.ts
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

Follow established naming conventions (PascalCase for components, camelCase for variables)

Prefer importing types from @clerk/shared/types instead of the deprecated @clerk/types alias

Files:

  • packages/clerk-js/src/ui/elements/PhoneInput/countryCodeData.ts
packages/**/src/**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

packages/**/src/**/*.{ts,tsx,js,jsx}: Maintain comprehensive JSDoc comments for public APIs
Use tree-shaking friendly exports
Validate all inputs and sanitize outputs
All public APIs must be documented with JSDoc
Use dynamic imports for optional features
Provide meaningful error messages to developers
Include error recovery suggestions where applicable
Log errors appropriately for debugging
Lazy load components and features when possible
Implement proper caching strategies
Use efficient data structures and algorithms
Implement proper logging with different levels

Files:

  • packages/clerk-js/src/ui/elements/PhoneInput/countryCodeData.ts
**/*.ts?(x)

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

Use proper TypeScript error types

Files:

  • packages/clerk-js/src/ui/elements/PhoneInput/countryCodeData.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/typescript.mdc)

**/*.{ts,tsx}: Always define explicit return types for functions, especially public APIs
Use proper type annotations for variables and parameters where inference isn't clear
Avoid any type - prefer unknown when type is uncertain, then narrow with type guards
Implement type guards for unknown types using the pattern function isType(value: unknown): value is Type
Use interface for object shapes that might be extended
Use type for unions, primitives, and computed types
Prefer readonly properties for immutable data structures
Use private for internal implementation details in classes
Use protected for inheritance hierarchies
Use public explicitly for clarity in public APIs
Use mixins for shared behavior across unrelated classes in TypeScript
Use generic constraints with bounded type parameters like <T extends { id: string }>
Use utility types like Omit, Partial, and Pick for data transformation instead of manual type construction
Use discriminated unions instead of boolean flags for state management and API responses
Use mapped types for transforming object types
Use conditional types for type-level logic
Leverage template literal types for string manipulation at the type level
Use ES6 imports/exports consistently
Use default exports sparingly, prefer named exports
Document functions with JSDoc comments including @param, @returns, @throws, and @example tags
Create custom error classes that extend Error for specific error types
Use the Result pattern for error handling instead of throwing exceptions
Use optional chaining (?.) and nullish coalescing (??) operators for safe property access
Let TypeScript infer obvious types to reduce verbosity
Use const assertions with as const for literal types
Use satisfies operator for type checking without widening types
Declare readonly arrays and objects for immutable data structures
Use spread operator and array spread for immutable updates instead of mutations
Use lazy loading for large types...

Files:

  • packages/clerk-js/src/ui/elements/PhoneInput/countryCodeData.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
  • GitHub Check: Build Packages
  • GitHub Check: Formatting | Dedupe | Changeset
  • GitHub Check: semgrep-cloud-platform/scan
  • GitHub Check: semgrep-cloud-platform/scan
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (1)
packages/clerk-js/src/ui/elements/PhoneInput/countryCodeData.ts (1)

16-16: All country code data additions and name updates are accurate.

Verified against authoritative sources:

  • Åland Islands (ax, 358), Ascension Island (ac, 247), Kosovo (xk, 383), and Western Sahara (eh, 212) use correct E.164 codes and ISO alpha-2 codes per ITU and ISO 3166-1 standards
  • Mayotte (yt, 262) correctly shares the code with Réunion
  • Congo split into Democratic Republic of the Congo (cd, 243) and Republic of the Congo (cg, 242) with correct codes
  • Eswatini reflects the official name change (2018)
  • North Macedonia reflects the official name change (2019)

No corrections needed.

Adds and updates country codes for Aland Islands, Ascension Island, Kosovo, Mayotte, Western Sahara, and revises names for Algeria, Congo (split), Macedonia (to North Macedonia), and Swaziland (to Eswatini).
Moved 'Mayotte' and 'North Macedonia' entries to maintain alphabetical order in the country code data array for improved consistency.
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between d36f43c and 505ca9e.

📒 Files selected for processing (2)
  • .changeset/legal-hands-lead.md (1 hunks)
  • packages/clerk-js/src/ui/elements/PhoneInput/countryCodeData.ts (8 hunks)
🧰 Additional context used
📓 Path-based instructions (8)
packages/clerk-js/src/ui/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/clerk-js-ui.mdc)

packages/clerk-js/src/ui/**/*.{ts,tsx}: Element descriptors should be written in camelCase
Use useCardState for card-level state management
Use useFormState for form-level state management
Use useLoadingStatus for managing loading states
Use useFormControl hook for form field state management with validation and localization support
All rendered values must be localized using useLocalizations hook - hard coded values are not allowed
Use localizationKeys for translating UI text with support for parameters and error messages
Use handleError utility for API error handling and provide field states for proper error mapping
Use the styled system sx prop with theme tokens for custom styling instead of inline styles
Use the Card component pattern with Card.Root, Card.Header, Card.Title, Card.Content, and Card.Footer for consistent card layouts
Use FormContainer with headerTitle and headerSubtitle localization keys combined with Form.Root and FormButtons for consistent form layouts
When form submission occurs, manage loading and error states by calling status.setLoading(), card.setLoading(), and card.setError() appropriately

Files:

  • packages/clerk-js/src/ui/elements/PhoneInput/countryCodeData.ts
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

All code must pass ESLint checks with the project's configuration

Files:

  • packages/clerk-js/src/ui/elements/PhoneInput/countryCodeData.ts
**/*.{js,jsx,ts,tsx,json,md,yml,yaml}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

Use Prettier for consistent code formatting

Files:

  • packages/clerk-js/src/ui/elements/PhoneInput/countryCodeData.ts
packages/**/src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

TypeScript is required for all packages

Files:

  • packages/clerk-js/src/ui/elements/PhoneInput/countryCodeData.ts
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

Follow established naming conventions (PascalCase for components, camelCase for variables)

Prefer importing types from @clerk/shared/types instead of the deprecated @clerk/types alias

Files:

  • packages/clerk-js/src/ui/elements/PhoneInput/countryCodeData.ts
packages/**/src/**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

packages/**/src/**/*.{ts,tsx,js,jsx}: Maintain comprehensive JSDoc comments for public APIs
Use tree-shaking friendly exports
Validate all inputs and sanitize outputs
All public APIs must be documented with JSDoc
Use dynamic imports for optional features
Provide meaningful error messages to developers
Include error recovery suggestions where applicable
Log errors appropriately for debugging
Lazy load components and features when possible
Implement proper caching strategies
Use efficient data structures and algorithms
Implement proper logging with different levels

Files:

  • packages/clerk-js/src/ui/elements/PhoneInput/countryCodeData.ts
**/*.ts?(x)

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

Use proper TypeScript error types

Files:

  • packages/clerk-js/src/ui/elements/PhoneInput/countryCodeData.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/typescript.mdc)

**/*.{ts,tsx}: Always define explicit return types for functions, especially public APIs
Use proper type annotations for variables and parameters where inference isn't clear
Avoid any type - prefer unknown when type is uncertain, then narrow with type guards
Implement type guards for unknown types using the pattern function isType(value: unknown): value is Type
Use interface for object shapes that might be extended
Use type for unions, primitives, and computed types
Prefer readonly properties for immutable data structures
Use private for internal implementation details in classes
Use protected for inheritance hierarchies
Use public explicitly for clarity in public APIs
Use mixins for shared behavior across unrelated classes in TypeScript
Use generic constraints with bounded type parameters like <T extends { id: string }>
Use utility types like Omit, Partial, and Pick for data transformation instead of manual type construction
Use discriminated unions instead of boolean flags for state management and API responses
Use mapped types for transforming object types
Use conditional types for type-level logic
Leverage template literal types for string manipulation at the type level
Use ES6 imports/exports consistently
Use default exports sparingly, prefer named exports
Document functions with JSDoc comments including @param, @returns, @throws, and @example tags
Create custom error classes that extend Error for specific error types
Use the Result pattern for error handling instead of throwing exceptions
Use optional chaining (?.) and nullish coalescing (??) operators for safe property access
Let TypeScript infer obvious types to reduce verbosity
Use const assertions with as const for literal types
Use satisfies operator for type checking without widening types
Declare readonly arrays and objects for immutable data structures
Use spread operator and array spread for immutable updates instead of mutations
Use lazy loading for large types...

Files:

  • packages/clerk-js/src/ui/elements/PhoneInput/countryCodeData.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
  • GitHub Check: Build Packages
  • GitHub Check: Formatting | Dedupe | Changeset
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: semgrep-cloud-platform/scan
  • GitHub Check: semgrep-cloud-platform/scan
🔇 Additional comments (9)
packages/clerk-js/src/ui/elements/PhoneInput/countryCodeData.ts (8)

18-18: LGTM!

The normalization of Algeria (removing trailing space) improves data consistency.


62-63: Excellent disambiguation!

Splitting the ambiguous "Congo" entries into "Democratic Republic of the Congo" and "Republic of the Congo" with their respective ISO codes ('cd' and 'cg') significantly improves data clarity and prevents confusion between these two distinct countries.


120-120: Note: Using user-assigned ISO code for Kosovo.

The ISO code 'xk' is a user-assigned code (not officially part of ISO 3166-1) but is widely used for Kosovo. This is acceptable as Kosovo's status is disputed and it lacks an official ISO code. The dialing code '383' is correct.


143-143: LGTM! Alphabetical ordering is correct.

The entry for Mayotte is correctly positioned after Mauritius and before Mexico. The past review comment about ordering appears to be outdated—the current ordering is alphabetically correct.

ISO code 'yt' and dialing code '262' (shared with Réunion) are both correct for Mayotte.


166-166: LGTM!

The rename from "Macedonia" to "North Macedonia" correctly reflects the country's official name change. ISO code and dialing code remain correct.


213-213: LGTM!

The rename from "Swaziland" to "Eswatini" correctly reflects the country's official name change. ISO code and dialing code remain correct.


242-242: LGTM!

The entry for Western Sahara is correctly positioned. ISO code 'eh' is correct, and the dialing code '212' is appropriately shared with Morocco (line 151), reflecting the territory's status. The existing CodeToCountriesMap implementation properly handles shared dialing codes.


27-27: Update Ascension Island entry to use official ISO 3166-1 code 'SH' or document the use of informal codes.

The dialing code '247' is correct. However, 'ac' is not an official ISO 3166-1 alpha-2 country code. Ascension Island is a subdivision of Saint Helena, Ascension and Tristan da Cunha (ISO 3166-1: SH, subdivision: SH-AC). If this codebase follows ISO standards for country codes, use 'SH' instead. If informal territory codes are intentional for UI purposes, document this pattern in a comment for clarity and consistency.

.changeset/legal-hands-lead.md (1)

1-5: LGTM!

The changeset accurately documents all country code additions and name updates. The patch-level release is appropriate for these data changes that don't affect the public API.

Corrected the spelling from 'Aland Islands' to 'Åland Islands' in the phone input country code data for improved accuracy.
@zourzouvillys zourzouvillys merged commit 0db4661 into main Dec 5, 2025
75 of 79 checks passed
@zourzouvillys zourzouvillys deleted the theo/add-kosvo branch December 5, 2025 17:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants