web_lib

Common web application libraries
git clone https://radroots.dev/git/web_lib.git
Log | Files | Refs | LICENSE

commit 12a9b4509d29e7f0ccde357cf8328648d8e01e82
parent 0697118cede9e4ca85d3344ffdcd3ed11074add5
Author: triesap <137732411+triesap@users.noreply.github.com>
Date:   Fri,  8 Aug 2025 20:59:21 +0000

locales: refactor .json data files as .ts modules. update build process to use tsc with targets for esm and cjs outputs

Diffstat:
Mlocales/package.json | 24++++++++++++------------
Dlocales/src/data/iso3166_2.json | 252-------------------------------------------------------------------------------
Alocales/src/data/iso3166_2.ts | 252+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Dlocales/src/data/iso639_1.json | 184-------------------------------------------------------------------------------
Alocales/src/data/iso639_1.ts | 184+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Dlocales/src/data/locales.json | 5-----
Alocales/src/data/locales.ts | 5+++++
Mlocales/src/index.ts | 12++++++------
Alocales/tsconfig.base.json | 12++++++++++++
Alocales/tsconfig.cjs.json | 10++++++++++
Alocales/tsconfig.esm.json | 12++++++++++++
Dlocales/tsconfig.json | 28----------------------------
12 files changed, 493 insertions(+), 487 deletions(-)

diff --git a/locales/package.json b/locales/package.json @@ -4,24 +4,24 @@ "private": true, "license": "GPLv3", "type": "module", - "main": "./dist/index.js", - "types": "./dist/index.d.ts", - "files": [ - "dist" - ], + "main": "./dist/cjs/index.cjs", + "module": "./dist/esm/index.js", + "types": "./dist/types/index.d.ts", "exports": { ".": { - "import": "./dist/index.js", - "types": "./dist/index.d.ts" + "types": "./dist/types/index.d.ts", + "import": "./dist/esm/index.js", + "require": "./dist/cjs/index.js" } }, "scripts": { + "build:esm": "tsc -p tsconfig.esm.json", + "build:cjs": "tsc -p tsconfig.cjs.json", + "build": "npm run clean && npm run build:esm && npm run build:cjs", "prebuild": "npm run clean", - "build": "tsc", - "clean": "rimraf dist && rimraf tsconfig.tsbuildinfo", - "lint": "eslint 'src/**/*.{ts,tsx}'", - "format": "prettier --write \"src/**/*.{ts,tsx}\"", - "test": "jest" + "clean": "rimraf dist", + "dev": "npm run watch", + "watch": "tsc -w" }, "devDependencies": { "@types/node": "^22.15.3", diff --git a/locales/src/data/iso3166_2.json b/locales/src/data/iso3166_2.json @@ -1,251 +0,0 @@ -{ - "AD": "Andorra", - "AE": "United Arab Emirates", - "AF": "Afghanistan", - "AG": "Antigua and Barbuda", - "AI": "Anguilla", - "AL": "Albania", - "AM": "Armenia", - "AO": "Angola", - "AQ": "Antarctica", - "AR": "Argentina", - "AS": "American Samoa", - "AT": "Austria", - "AU": "Australia", - "AW": "Aruba", - "AX": "Åland Islands", - "AZ": "Azerbaijan", - "BA": "Bosnia and Herzegovina", - "BB": "Barbados", - "BD": "Bangladesh", - "BE": "Belgium", - "BF": "Burkina Faso", - "BG": "Bulgaria", - "BH": "Bahrain", - "BI": "Burundi", - "BJ": "Benin", - "BL": "Saint Barthélemy", - "BM": "Bermuda", - "BN": "Brunei Darussalam", - "BO": "Bolivia", - "BQ": "Bonaire, Sint Eustatius and Saba", - "BR": "Brazil", - "BS": "Bahamas", - "BT": "Bhutan", - "BV": "Bouvet Island", - "BW": "Botswana", - "BY": "Belarus", - "BZ": "Belize", - "CA": "Canada", - "CC": "Cocos (Keeling) Islands", - "CD": "Democratic Republic of the Congo", - "CF": "Central African Republic", - "CG": "Congo", - "CH": "Switzerland", - "CI": "Côte d'Ivoire", - "CK": "Cook Islands", - "CL": "Chile", - "CM": "Cameroon", - "CN": "China", - "CO": "Colombia", - "CR": "Costa Rica", - "CU": "Cuba", - "CV": "Cabo Verde", - "CW": "Curaçao", - "CX": "Christmas Island", - "CY": "Cyprus", - "CZ": "Czechia", - "DE": "Germany", - "DJ": "Djibouti", - "DK": "Denmark", - "DM": "Dominica", - "DO": "Dominican Republic", - "DZ": "Algeria", - "EC": "Ecuador", - "EE": "Estonia", - "EG": "Egypt", - "EH": "Western Sahara", - "ER": "Eritrea", - "ES": "Spain", - "ET": "Ethiopia", - "FI": "Finland", - "FJ": "Fiji", - "FK": "Malvinas Islands", - "FM": "Federated States of Micronesia", - "FO": "Faroe Islands", - "FR": "France", - "GA": "Gabon", - "GB": "United Kingdom of Great Britain and Northern Ireland", - "GD": "Grenada", - "GE": "Georgia", - "GF": "French Guiana", - "GG": "Guernsey", - "GH": "Ghana", - "GI": "Gibraltar", - "GL": "Greenland", - "GM": "Gambia", - "GN": "Guinea", - "GP": "Guadeloupe", - "GQ": "Equatorial Guinea", - "GR": "Greece", - "GS": "South Georgia and the South Sandwich Islands", - "GT": "Guatemala", - "GU": "Guam", - "GW": "Guinea-Bissau", - "GY": "Guyana", - "HK": "Hong Kong", - "HM": "Heard Island and McDonald Islands", - "HN": "Honduras", - "HR": "Croatia", - "HT": "Haiti", - "HU": "Hungary", - "ID": "Indonesia", - "IE": "Ireland", - "IL": "Israel", - "IM": "Isle of Man", - "IN": "India", - "IO": "British Indian Ocean Territory", - "IQ": "Iraq", - "IR": "Iran", - "IS": "Iceland", - "IT": "Italy", - "JE": "Jersey", - "JM": "Jamaica", - "JO": "Jordan", - "JP": "Japan", - "KE": "Kenya", - "KG": "Kyrgyzstan", - "KH": "Cambodia", - "KI": "Kiribati", - "KM": "Comoros", - "KN": "Saint Kitts and Nevis", - "KP": "Democratic People's Republic of Korea", - "KR": "Republic of Korea", - "KW": "Kuwait", - "KY": "Cayman Islands", - "KZ": "Kazakhstan", - "LA": "Lao People's Democratic Republic", - "LB": "Lebanon", - "LC": "Saint Lucia", - "LI": "Liechtenstein", - "LK": "Sri Lanka", - "LR": "Liberia", - "LS": "Lesotho", - "LT": "Lithuania", - "LU": "Luxembourg", - "LV": "Latvia", - "LY": "Libya", - "MA": "Morocco", - "MC": "Monaco", - "MD": "Moldova", - "ME": "Montenegro", - "MF": "Saint Martin", - "MG": "Madagascar", - "MH": "Marshall Islands", - "MK": "North Macedonia", - "ML": "Mali", - "MM": "Myanmar", - "MN": "Mongolia", - "MO": "Macao", - "MP": "Northern Mariana Islands", - "MQ": "Martinique", - "MR": "Mauritania", - "MS": "Montserrat", - "MT": "Malta", - "MU": "Mauritius", - "MV": "Maldives", - "MW": "Malawi", - "MX": "Mexico", - "MY": "Malaysia", - "MZ": "Mozambique", - "NA": "Namibia", - "NC": "New Caledonia", - "NE": "Niger", - "NF": "Norfolk Island", - "NG": "Nigeria", - "NI": "Nicaragua", - "NL": "Netherlands", - "NO": "Norway", - "NP": "Nepal", - "NR": "Nauru", - "NU": "Niue", - "NZ": "New Zealand", - "OM": "Oman", - "PA": "Panama", - "PE": "Peru", - "PF": "French Polynesia", - "PG": "Papua New Guinea", - "PH": "Philippines", - "PK": "Pakistan", - "PL": "Poland", - "PM": "Saint Pierre and Miquelon", - "PN": "Pitcairn", - "PR": "Puerto Rico", - "PS": "Palestine", - "PT": "Portugal", - "PW": "Palau", - "PY": "Paraguay", - "QA": "Qatar", - "RE": "Réunion", - "RO": "Romania", - "RS": "Serbia", - "RU": "Russian Federation", - "RW": "Rwanda", - "SA": "Saudi Arabia", - "SB": "Solomon Islands", - "SC": "Seychelles", - "SD": "Sudan", - "SE": "Sweden", - "SG": "Singapore", - "SH": "Saint Helena, Ascension and Tristan da Cunha", - "SI": "Slovenia", - "SJ": "Svalbard and Jan Mayen", - "SK": "Slovakia", - "SL": "Sierra Leone", - "SM": "San Marino", - "SN": "Senegal", - "SO": "Somalia", - "SR": "Suriname", - "SS": "South Sudan", - "ST": "Sao Tome and Principe", - "SV": "El Salvador", - "SX": "Sint Maarten", - "SY": "Syrian Arab Republic", - "SZ": "Eswatini", - "TC": "Turks and Caicos Islands", - "TD": "Chad", - "TF": "French Southern Territories", - "TG": "Togo", - "TH": "Thailand", - "TJ": "Tajikistan", - "TK": "Tokelau", - "TL": "Timor-Leste", - "TM": "Turkmenistan", - "TN": "Tunisia", - "TO": "Tonga", - "TR": "Türkiye", - "TT": "Trinidad and Tobago", - "TV": "Tuvalu", - "TW": "Taiwan", - "TZ": "Tanzania", - "UA": "Ukraine", - "UG": "Uganda", - "UM": "United States Minor Outlying Islands", - "US": "United States of America", - "UY": "Uruguay", - "UZ": "Uzbekistan", - "VA": "Holy See", - "VC": "Saint Vincent and the Grenadines", - "VE": "Venezuela", - "VG": "British Virgin Islands", - "VI": "U.S. Virgin Islands", - "VN": "Viet Nam", - "VU": "Vanuatu", - "WF": "Wallis and Futuna", - "WS": "Samoa", - "YE": "Yemen", - "YT": "Mayotte", - "ZA": "South Africa", - "ZM": "Zambia", - "ZW": "Zimbabwe" -} -\ No newline at end of file diff --git a/locales/src/data/iso3166_2.ts b/locales/src/data/iso3166_2.ts @@ -0,0 +1,251 @@ +export const iso3166_2 = { + "AD": "Andorra", + "AE": "United Arab Emirates", + "AF": "Afghanistan", + "AG": "Antigua and Barbuda", + "AI": "Anguilla", + "AL": "Albania", + "AM": "Armenia", + "AO": "Angola", + "AQ": "Antarctica", + "AR": "Argentina", + "AS": "American Samoa", + "AT": "Austria", + "AU": "Australia", + "AW": "Aruba", + "AX": "Åland Islands", + "AZ": "Azerbaijan", + "BA": "Bosnia and Herzegovina", + "BB": "Barbados", + "BD": "Bangladesh", + "BE": "Belgium", + "BF": "Burkina Faso", + "BG": "Bulgaria", + "BH": "Bahrain", + "BI": "Burundi", + "BJ": "Benin", + "BL": "Saint Barthélemy", + "BM": "Bermuda", + "BN": "Brunei Darussalam", + "BO": "Bolivia", + "BQ": "Bonaire, Sint Eustatius and Saba", + "BR": "Brazil", + "BS": "Bahamas", + "BT": "Bhutan", + "BV": "Bouvet Island", + "BW": "Botswana", + "BY": "Belarus", + "BZ": "Belize", + "CA": "Canada", + "CC": "Cocos (Keeling) Islands", + "CD": "Democratic Republic of the Congo", + "CF": "Central African Republic", + "CG": "Congo", + "CH": "Switzerland", + "CI": "Côte d'Ivoire", + "CK": "Cook Islands", + "CL": "Chile", + "CM": "Cameroon", + "CN": "China", + "CO": "Colombia", + "CR": "Costa Rica", + "CU": "Cuba", + "CV": "Cabo Verde", + "CW": "Curaçao", + "CX": "Christmas Island", + "CY": "Cyprus", + "CZ": "Czechia", + "DE": "Germany", + "DJ": "Djibouti", + "DK": "Denmark", + "DM": "Dominica", + "DO": "Dominican Republic", + "DZ": "Algeria", + "EC": "Ecuador", + "EE": "Estonia", + "EG": "Egypt", + "EH": "Western Sahara", + "ER": "Eritrea", + "ES": "Spain", + "ET": "Ethiopia", + "FI": "Finland", + "FJ": "Fiji", + "FK": "Malvinas Islands", + "FM": "Federated States of Micronesia", + "FO": "Faroe Islands", + "FR": "France", + "GA": "Gabon", + "GB": "United Kingdom of Great Britain and Northern Ireland", + "GD": "Grenada", + "GE": "Georgia", + "GF": "French Guiana", + "GG": "Guernsey", + "GH": "Ghana", + "GI": "Gibraltar", + "GL": "Greenland", + "GM": "Gambia", + "GN": "Guinea", + "GP": "Guadeloupe", + "GQ": "Equatorial Guinea", + "GR": "Greece", + "GS": "South Georgia and the South Sandwich Islands", + "GT": "Guatemala", + "GU": "Guam", + "GW": "Guinea-Bissau", + "GY": "Guyana", + "HK": "Hong Kong", + "HM": "Heard Island and McDonald Islands", + "HN": "Honduras", + "HR": "Croatia", + "HT": "Haiti", + "HU": "Hungary", + "ID": "Indonesia", + "IE": "Ireland", + "IL": "Israel", + "IM": "Isle of Man", + "IN": "India", + "IO": "British Indian Ocean Territory", + "IQ": "Iraq", + "IR": "Iran", + "IS": "Iceland", + "IT": "Italy", + "JE": "Jersey", + "JM": "Jamaica", + "JO": "Jordan", + "JP": "Japan", + "KE": "Kenya", + "KG": "Kyrgyzstan", + "KH": "Cambodia", + "KI": "Kiribati", + "KM": "Comoros", + "KN": "Saint Kitts and Nevis", + "KP": "Democratic People's Republic of Korea", + "KR": "Republic of Korea", + "KW": "Kuwait", + "KY": "Cayman Islands", + "KZ": "Kazakhstan", + "LA": "Lao People's Democratic Republic", + "LB": "Lebanon", + "LC": "Saint Lucia", + "LI": "Liechtenstein", + "LK": "Sri Lanka", + "LR": "Liberia", + "LS": "Lesotho", + "LT": "Lithuania", + "LU": "Luxembourg", + "LV": "Latvia", + "LY": "Libya", + "MA": "Morocco", + "MC": "Monaco", + "MD": "Moldova", + "ME": "Montenegro", + "MF": "Saint Martin", + "MG": "Madagascar", + "MH": "Marshall Islands", + "MK": "North Macedonia", + "ML": "Mali", + "MM": "Myanmar", + "MN": "Mongolia", + "MO": "Macao", + "MP": "Northern Mariana Islands", + "MQ": "Martinique", + "MR": "Mauritania", + "MS": "Montserrat", + "MT": "Malta", + "MU": "Mauritius", + "MV": "Maldives", + "MW": "Malawi", + "MX": "Mexico", + "MY": "Malaysia", + "MZ": "Mozambique", + "NA": "Namibia", + "NC": "New Caledonia", + "NE": "Niger", + "NF": "Norfolk Island", + "NG": "Nigeria", + "NI": "Nicaragua", + "NL": "Netherlands", + "NO": "Norway", + "NP": "Nepal", + "NR": "Nauru", + "NU": "Niue", + "NZ": "New Zealand", + "OM": "Oman", + "PA": "Panama", + "PE": "Peru", + "PF": "French Polynesia", + "PG": "Papua New Guinea", + "PH": "Philippines", + "PK": "Pakistan", + "PL": "Poland", + "PM": "Saint Pierre and Miquelon", + "PN": "Pitcairn", + "PR": "Puerto Rico", + "PS": "Palestine", + "PT": "Portugal", + "PW": "Palau", + "PY": "Paraguay", + "QA": "Qatar", + "RE": "Réunion", + "RO": "Romania", + "RS": "Serbia", + "RU": "Russian Federation", + "RW": "Rwanda", + "SA": "Saudi Arabia", + "SB": "Solomon Islands", + "SC": "Seychelles", + "SD": "Sudan", + "SE": "Sweden", + "SG": "Singapore", + "SH": "Saint Helena, Ascension and Tristan da Cunha", + "SI": "Slovenia", + "SJ": "Svalbard and Jan Mayen", + "SK": "Slovakia", + "SL": "Sierra Leone", + "SM": "San Marino", + "SN": "Senegal", + "SO": "Somalia", + "SR": "Suriname", + "SS": "South Sudan", + "ST": "Sao Tome and Principe", + "SV": "El Salvador", + "SX": "Sint Maarten", + "SY": "Syrian Arab Republic", + "SZ": "Eswatini", + "TC": "Turks and Caicos Islands", + "TD": "Chad", + "TF": "French Southern Territories", + "TG": "Togo", + "TH": "Thailand", + "TJ": "Tajikistan", + "TK": "Tokelau", + "TL": "Timor-Leste", + "TM": "Turkmenistan", + "TN": "Tunisia", + "TO": "Tonga", + "TR": "Türkiye", + "TT": "Trinidad and Tobago", + "TV": "Tuvalu", + "TW": "Taiwan", + "TZ": "Tanzania", + "UA": "Ukraine", + "UG": "Uganda", + "UM": "United States Minor Outlying Islands", + "US": "United States of America", + "UY": "Uruguay", + "UZ": "Uzbekistan", + "VA": "Holy See", + "VC": "Saint Vincent and the Grenadines", + "VE": "Venezuela", + "VG": "British Virgin Islands", + "VI": "U.S. Virgin Islands", + "VN": "Viet Nam", + "VU": "Vanuatu", + "WF": "Wallis and Futuna", + "WS": "Samoa", + "YE": "Yemen", + "YT": "Mayotte", + "ZA": "South Africa", + "ZM": "Zambia", + "ZW": "Zimbabwe" +} as const; +\ No newline at end of file diff --git a/locales/src/data/iso639_1.json b/locales/src/data/iso639_1.json @@ -1,183 +0,0 @@ -{ - "aa": "Afar", - "ab": "Abkhaz", - "ae": "Avestan", - "af": "Afrikaans", - "ak": "Akan", - "am": "አማርኛ", - "ar": "العربية", - "as": "অসমীয়া", - "av": "Avar", - "ay": "Aymara", - "az": "Azərbaycanca", - "ba": "Bashkir", - "be": "Беларуская", - "bg": "Български", - "bh": "Bihari", - "bi": "Bislama", - "bm": "Bambara", - "bn": "বাংলা", - "bo": "བོད་སྐད", - "br": "Breton", - "bs": "Bosanski", - "ca": "Català", - "ce": "Chechen", - "ch": "Chamorro", - "co": "Corsu", - "cr": "Cree", - "cs": "Čeština", - "cu": "Church Slavonic", - "cv": "Chuvash", - "cy": "Cymraeg", - "da": "Dansk", - "de": "Deutsch", - "dv": "Divehi", - "dz": "Dzongkha", - "ee": "Ewe", - "el": "Ελληνικά", - "en": "English", - "eo": "Esperanto", - "es": "Español", - "et": "Eesti", - "eu": "Euskara", - "fa": "فارسی", - "ff": "Fula", - "fi": "Suomi", - "fj": "Fijian", - "fo": "Føroyskt", - "fr": "Français", - "fy": "Frysk", - "ga": "Gaeilge", - "gd": "Gàidhlig", - "gl": "Galego", - "gn": "Guarani", - "gu": "ગુજરાતી", - "gv": "Manx", - "ha": "Hausa", - "he": "עברית", - "hi": "हिन्दी", - "ho": "Hiri Motu", - "hr": "Hrvatski", - "ht": "Kreyòl Ayisyen", - "hu": "Magyar", - "hy": "Հայերեն", - "hz": "Herero", - "ia": "Interlingua", - "id": "Bahasa Indonesia", - "ie": "Interlingue", - "ig": "Igbo", - "ii": "Sichuan Yi", - "ik": "Inupiaq", - "io": "Ido", - "is": "Íslenska", - "it": "Italiano", - "iu": "Inuktitut", - "ja": "日本語", - "jv": "Jawa", - "ka": "ქართული", - "kbp": "Kabuverdianu", - "kk": "Қазақша", - "kl": "Kalaallisut", - "km": "ខ្មែរ", - "kn": "ಕನ್ನಡ", - "ko": "한국어", - "kr": "Kanuri", - "ks": "Kashmiri", - "ku": "Kurdî", - "kv": "Komi", - "kw": "Cornish", - "ky": "Кыргызча", - "la": "Latina", - "lb": "Lëtzebuergesch", - "lg": "Ganda", - "li": "Limburgish", - "ln": "Lingala", - "lo": "ລາວ", - "lt": "Lietuvių", - "lu": "Luba-Katanga", - "lv": "Latviešu", - "mg": "Malagasy", - "mh": "Marshallese", - "mi": "Māori", - "mk": "Македонски", - "ml": "മലയാളം", - "mn": "Монгол", - "mo": "Moldovan", - "mr": "मराठी", - "ms": "Malay", - "mt": "Maltese", - "my": "မြန်မာစာ", - "na": "Nauru", - "nb": "Norsk bokmål", - "nd": "North Ndebele", - "ne": "नेपाली", - "ng": "Ndonga", - "nl": "Nederlands", - "nn": "Norsk nynorsk", - "no": "Norsk", - "nr": "South Ndebele", - "nv": "Navajo", - "ny": "Chichewa", - "oc": "Occitan", - "oj": "Ojibwe", - "om": "Oromo", - "or": "ଓଡ଼ିଆ", - "os": "Ossetian", - "pa": "ਪੰਜਾਬੀ", - "pl": "Polski", - "ps": "Pashto", - "pt": "Português", - "qu": "Quechua", - "rm": "Romansh", - "rn": "Kirundi", - "ro": "Română", - "ru": "Русский", - "rw": "Kinyarwanda", - "sa": "संस्कृतम्", - "sc": "Sardinian", - "sd": "سنڌي", - "se": "Northern Sami", - "sg": "Sango", - "si": "සිංහල", - "sk": "Slovenčina", - "sl": "Slovenščina", - "sm": "Samoan", - "sn": "ChiShona", - "so": "Soomaaliga", - "sq": "Shqip", - "sr": "Српски", - "ss": "Swati", - "st": "Southern Sotho", - "su": "Basa Sunda", - "sv": "Svenska", - "sw": "Kiswahili", - "ta": "தமிழ்", - "te": "తెలుగు", - "tg": "Тоҷикӣ", - "th": "ไทย", - "ti": "Tigrinya", - "tk": "Türkmençe", - "tl": "Tagalog", - "tn": "Tswana", - "to": "Tongan", - "tr": "Türkçe", - "ts": "Tsonga", - "tt": "Tatar", - "tw": "Twi", - "ty": "Tahitian", - "ug": "ئۇيغۇرچە", - "uk": "Українська", - "ur": "اردو", - "uz": "O‘zbek", - "ve": "Venda", - "vi": "Tiếng Việt", - "vo": "Volapük", - "wa": "Walloon", - "wo": "Wolof", - "xh": "Xhosa", - "yi": "ייִדיש", - "yo": "Yorùbá", - "za": "Zhuang", - "zu": "isiZulu", - "zz": "Zazaki" -} -\ No newline at end of file diff --git a/locales/src/data/iso639_1.ts b/locales/src/data/iso639_1.ts @@ -0,0 +1,183 @@ +export const iso639_1 = { + "aa": "Afar", + "ab": "Abkhaz", + "ae": "Avestan", + "af": "Afrikaans", + "ak": "Akan", + "am": "አማርኛ", + "ar": "العربية", + "as": "অসমীয়া", + "av": "Avar", + "ay": "Aymara", + "az": "Azərbaycanca", + "ba": "Bashkir", + "be": "Беларуская", + "bg": "Български", + "bh": "Bihari", + "bi": "Bislama", + "bm": "Bambara", + "bn": "বাংলা", + "bo": "བོད་སྐད", + "br": "Breton", + "bs": "Bosanski", + "ca": "Català", + "ce": "Chechen", + "ch": "Chamorro", + "co": "Corsu", + "cr": "Cree", + "cs": "Čeština", + "cu": "Church Slavonic", + "cv": "Chuvash", + "cy": "Cymraeg", + "da": "Dansk", + "de": "Deutsch", + "dv": "Divehi", + "dz": "Dzongkha", + "ee": "Ewe", + "el": "Ελληνικά", + "en": "English", + "eo": "Esperanto", + "es": "Español", + "et": "Eesti", + "eu": "Euskara", + "fa": "فارسی", + "ff": "Fula", + "fi": "Suomi", + "fj": "Fijian", + "fo": "Føroyskt", + "fr": "Français", + "fy": "Frysk", + "ga": "Gaeilge", + "gd": "Gàidhlig", + "gl": "Galego", + "gn": "Guarani", + "gu": "ગુજરાતી", + "gv": "Manx", + "ha": "Hausa", + "he": "עברית", + "hi": "हिन्दी", + "ho": "Hiri Motu", + "hr": "Hrvatski", + "ht": "Kreyòl Ayisyen", + "hu": "Magyar", + "hy": "Հայերեն", + "hz": "Herero", + "ia": "Interlingua", + "id": "Bahasa Indonesia", + "ie": "Interlingue", + "ig": "Igbo", + "ii": "Sichuan Yi", + "ik": "Inupiaq", + "io": "Ido", + "is": "Íslenska", + "it": "Italiano", + "iu": "Inuktitut", + "ja": "日本語", + "jv": "Jawa", + "ka": "ქართული", + "kbp": "Kabuverdianu", + "kk": "Қазақша", + "kl": "Kalaallisut", + "km": "ខ្មែរ", + "kn": "ಕನ್ನಡ", + "ko": "한국어", + "kr": "Kanuri", + "ks": "Kashmiri", + "ku": "Kurdî", + "kv": "Komi", + "kw": "Cornish", + "ky": "Кыргызча", + "la": "Latina", + "lb": "Lëtzebuergesch", + "lg": "Ganda", + "li": "Limburgish", + "ln": "Lingala", + "lo": "ລາວ", + "lt": "Lietuvių", + "lu": "Luba-Katanga", + "lv": "Latviešu", + "mg": "Malagasy", + "mh": "Marshallese", + "mi": "Māori", + "mk": "Македонски", + "ml": "മലയാളം", + "mn": "Монгол", + "mo": "Moldovan", + "mr": "मराठी", + "ms": "Malay", + "mt": "Maltese", + "my": "မြန်မာစာ", + "na": "Nauru", + "nb": "Norsk bokmål", + "nd": "North Ndebele", + "ne": "नेपाली", + "ng": "Ndonga", + "nl": "Nederlands", + "nn": "Norsk nynorsk", + "no": "Norsk", + "nr": "South Ndebele", + "nv": "Navajo", + "ny": "Chichewa", + "oc": "Occitan", + "oj": "Ojibwe", + "om": "Oromo", + "or": "ଓଡ଼ିଆ", + "os": "Ossetian", + "pa": "ਪੰਜਾਬੀ", + "pl": "Polski", + "ps": "Pashto", + "pt": "Português", + "qu": "Quechua", + "rm": "Romansh", + "rn": "Kirundi", + "ro": "Română", + "ru": "Русский", + "rw": "Kinyarwanda", + "sa": "संस्कृतम्", + "sc": "Sardinian", + "sd": "سنڌي", + "se": "Northern Sami", + "sg": "Sango", + "si": "සිංහල", + "sk": "Slovenčina", + "sl": "Slovenščina", + "sm": "Samoan", + "sn": "ChiShona", + "so": "Soomaaliga", + "sq": "Shqip", + "sr": "Српски", + "ss": "Swati", + "st": "Southern Sotho", + "su": "Basa Sunda", + "sv": "Svenska", + "sw": "Kiswahili", + "ta": "தமிழ்", + "te": "తెలుగు", + "tg": "Тоҷикӣ", + "th": "ไทย", + "ti": "Tigrinya", + "tk": "Türkmençe", + "tl": "Tagalog", + "tn": "Tswana", + "to": "Tongan", + "tr": "Türkçe", + "ts": "Tsonga", + "tt": "Tatar", + "tw": "Twi", + "ty": "Tahitian", + "ug": "ئۇيغۇرچە", + "uk": "Українська", + "ur": "اردو", + "uz": "O‘zbek", + "ve": "Venda", + "vi": "Tiếng Việt", + "vo": "Volapük", + "wa": "Walloon", + "wo": "Wolof", + "xh": "Xhosa", + "yi": "ייִדיש", + "yo": "Yorùbá", + "za": "Zhuang", + "zu": "isiZulu", + "zz": "Zazaki" +} as const; +\ No newline at end of file diff --git a/locales/src/data/locales.json b/locales/src/data/locales.json @@ -1,4 +0,0 @@ -[ - "en", - "es" -] -\ No newline at end of file diff --git a/locales/src/data/locales.ts b/locales/src/data/locales.ts @@ -0,0 +1,4 @@ +export const locales_default = [ + "en", + "es" +] as const; +\ No newline at end of file diff --git a/locales/src/index.ts b/locales/src/index.ts @@ -1,10 +1,10 @@ -import iso3166_2 from "./data/iso3166_2.json" assert { type: "json" }; -import iso639_1 from "./data/iso639_1.json" assert { type: "json" }; -import locales from "./data/locales.json" assert { type: "json" }; -export { iso3166_2, iso639_1, locales }; +import { iso3166_2 } from "./data/iso3166_2.js"; +import { iso639_1 } from "./data/iso639_1.js"; +import { locales_default } from "./data/locales.js"; -export const locales_default = [`en`, `es`] as const; -export type Locales = typeof locales_default[number]; +export { iso3166_2, iso639_1, locales_default }; + +export type Locales = (typeof locales_default)[number]; export const locales_set = new Set<string>(locales_default); export const get_locales_undef = (val?: string): Locales | undefined => { diff --git a/locales/tsconfig.base.json b/locales/tsconfig.base.json @@ -0,0 +1,12 @@ +{ + "compilerOptions": { + "target": "ES2019", + "strict": true, + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "skipLibCheck": true, + "sourceMap": false, + "rootDir": "src", + "resolveJsonModule": true + } +} diff --git a/locales/tsconfig.cjs.json b/locales/tsconfig.cjs.json @@ -0,0 +1,10 @@ +{ + "extends": "./tsconfig.base.json", + "compilerOptions": { + "outDir": "./dist/cjs", + "module": "CommonJS", + "declaration": false, + "moduleResolution": "Node" + }, + "include": ["src"] +} diff --git a/locales/tsconfig.esm.json b/locales/tsconfig.esm.json @@ -0,0 +1,12 @@ +{ + "extends": "./tsconfig.base.json", + "compilerOptions": { + "outDir": "./dist/esm", + "module": "NodeNext", + "declaration": true, + "declarationDir": "./dist/types", + "moduleResolution": "NodeNext", + "emitDeclarationOnly": false + }, + "include": ["src"] +} diff --git a/locales/tsconfig.json b/locales/tsconfig.json @@ -1,27 +0,0 @@ -{ - "compilerOptions": { - "plugins": [{ "transform": "tsc-alias/transform" }], - "target": "ES2022", - "module": "ESNext", - "lib": ["ES2022"], - "moduleResolution": "node", - "moduleDetection": "force", - "rootDir": "./src", - "outDir": "./dist", - "baseUrl": "./", - "declaration": true, - "declarationMap": true, - "esModuleInterop": true, - "resolveJsonModule": true, - "strict": true, - "sourceMap": true, - "skipLibCheck": true, - "composite": true, - "experimentalDecorators": true, - "emitDecoratorMetadata": true, - "types": ["node"], - }, - "include": ["src", "src/data/*.json"], - "exclude": ["node_modules", "dist"] - } - -\ No newline at end of file