Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,19 @@ on:
branches:
- main
paths:
- '.github/workflows/nodejs.yml'
- 'packages/countries/src/**'
- '!.editorconfig'
- '!**LICENSE*'
- '!**README*'
- '.github/workflows/build-test.yml'
- 'packages/countries/**'
- 'packages/scripts/**'
- 'packages/test-js/**'
- 'packages/tsconfig/**'
- 'package.json'
- 'bun.lock'
- 'bunfig.toml'
- 'biome.json'
- 'tsconfig.json'
- '!**/.editorconfig'
- '!**/LICENSE*'
- '!**/README*'

jobs:
build-test:
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

coverage
.phpunit.cache
.turbo

composer.phar

Expand Down
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Commands

- Build: `bun run build` (builds all packages via turbo)
- Build: `bun run build` (builds all workspace packages)
- Lint: `bun run lint` (runs biome check)
- Lint fix: `bun run lint:fix` (runs biome check --write)
- Format: `bun run format` (runs biome format --write)
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Also, contains separate JSON files with additional country **Emoji** flags data.
## Version 3.0: Breaking changes

Version 3 comes with some data structure changes.
It was completely reworked under the hood with **TypeScript**, **ESM** exports and **Turborepo** file structure.
It was completely reworked under the hood with **TypeScript**, **ESM** exports and a **Bun workspaces** monorepo structure.

Everything is strongly typed so you can easily use data with auto-complete in your IDE.

Expand Down Expand Up @@ -146,7 +146,7 @@ Everything is generated from strongly typed files in `packages/countries/src`, i

Everything in `dist` is generated,
so please make data related changes **ONLY** to files from `packages/countries`, commit them.
Use `bun run build` (or `turbo build`, `turbo test`) command to build/test generated files.
Use `bun run build` / `bun run test` to build/test generated files.

The `currencies` dataset (`packages/countries/src/data/currencies.ts`) is generated from the official ISO 4217 list and Unicode CLDR via `packages/scripts/generateCurrencies.ts`. Refresh it with `cd packages/scripts && bun run generate:currencies` (requires network) when ISO 4217 publishes an update, rather than editing the data by hand.

Expand Down
2 changes: 1 addition & 1 deletion biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"preset": "recommended",
"suspicious": {
"noExplicitAny": "warn"
}
Expand Down
73 changes: 28 additions & 45 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 1 addition & 11 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,7 @@
"files": ["dist/index.php"]
},
"archive": {
"exclude": [
".npmignore",
"*.js",
"*.map",
"*.mjs",
"*.ts",
"/.*",
"/packages",
"package*.json",
"turbo.json"
]
"exclude": [".npmignore", "*.js", "*.map", "*.mjs", "*.ts", "/.*", "/packages", "package*.json"]
},
"homepage": "http://annexare.github.io/Countries/"
}
19 changes: 8 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,36 +7,33 @@
],
"catalogs": {
"default": {
"@biomejs/biome": "2.4.5",
"@types/bun": "1.3.10",
"turbo": "2.8.13",
"typescript": "5.9.3"
"@biomejs/biome": "2.5.0",
"@types/bun": "1.3.14",
"typescript": "6.0.3"
}
}
},
"scripts": {
"build": "turbo run build",
"build": "bun run --filter scripts build && bun run --filter countries build",
"bump": "bun update -i -r",
"check-types": "tsc -p packages/countries/tsconfig.json --noEmit",
"ci": "turbo run lint build test",
"ci": "bun run lint && bun run check-types && bun run test",
"format": "biome format --write .",
"lint": "biome check .",
"lint:fix": "biome check --write --unsafe .",
"test": "turbo run test",
"test": "bun run build && bun run --filter test-js test",
"version": "cd ./packages/scripts && bun run version"
},
"devDependencies": {
"@biomejs/biome": "catalog:default",
"@types/bun": "catalog:default",
"lefthook": "2.1.2",
"turbo": "catalog:default",
"lefthook": "2.1.9",
"typescript": "catalog:default"
},
"trustedDependencies": [
"@biomejs/biome",
"esbuild",
"lefthook",
"turbo"
"lefthook"
],
"packageManager": "bun@1.3.3"
}
7 changes: 4 additions & 3 deletions packages/countries/tsconfig-base.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
"allowImportingTsExtensions": true,
"noEmit": true,
"esModuleInterop": true,
"module": "NodeNext",
"moduleResolution": "Node",
"module": "ESNext",
"moduleResolution": "Bundler",
"resolveJsonModule": true,
"skipLibCheck": true,
"strict": true
"strict": true,
"types": ["node"]
}
}
1 change: 0 additions & 1 deletion packages/countries/tsconfig-cjs.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"extends": "./tsconfig-base.json",
"compilerOptions": {
"module": "commonjs",
"outDir": "../../dist/cjs",
"target": "ES6"
}
Expand Down
1 change: 0 additions & 1 deletion packages/countries/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"extends": "./tsconfig-base.json",
"compilerOptions": {
"composite": true,
"module": "ESNext",
"outDir": "../../dist/mjs",
"target": "ESNext"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/scripts/generateCurrencies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* - Currency name, symbol and native symbol come from Unicode CLDR via the runtime `Intl` APIs.
*
* This is a manual, network-dependent refresh tool (like `version.ts`); it is NOT part of
* `turbo build`. Re-run it when ISO 4217 publishes an update, then review and commit the diff:
* `bun run build`. Re-run it when ISO 4217 publishes an update, then review and commit the diff:
* cd packages/scripts && bun run generate:currencies
*/
import { countries } from 'countries/data/countries.ts'
Expand Down
Loading