airport-data-js 3.0.1 → 3.1.0

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/README.md CHANGED
@@ -451,3 +451,99 @@ This project is licensed under the Creative Commons Attribution 4.0 Internationa
451
451
  ## Contributing
452
452
 
453
453
  Contributions, issues, and feature requests are welcome! Feel free to check the [issues page](https://github.com/aashishvanand/airport-data-js/issues).
454
+
455
+ ### Getting Started
456
+
457
+ ```bash
458
+ # Clone the repository
459
+ git clone https://github.com/aashishvanand/airport-data-js.git
460
+ cd airport-data-js
461
+
462
+ # Install dependencies
463
+ npm install
464
+
465
+ # Run the test suite
466
+ npm test
467
+
468
+ # Build both Node.js and browser bundles
469
+ npm run build
470
+ ```
471
+
472
+ ### Project Structure
473
+
474
+ ```
475
+ airport-data-js/
476
+ ├── src/
477
+ │ ├── index.js # Library source code
478
+ │ └── airports.compressed # Compressed airport dataset
479
+ ├── lib/ # Node.js CJS build output
480
+ ├── dist/ # Browser build output
481
+ ├── data/
482
+ │ └── airports.json # Raw airport data (source of truth)
483
+ ├── scripts/
484
+ │ ├── compress_json.js # Compresses airports.json for distribution
485
+ │ ├── check_duplicates.js # Validates no duplicate IATA/ICAO codes
486
+ │ ├── extract_latest_changelog.js # Extracts changelog for GitHub releases
487
+ │ └── benchmark.js # Performance benchmarks
488
+ ├── tests/
489
+ │ └── index.test.js # Jest test suite
490
+ ├── webpack.node.cjs # Webpack config for Node.js bundle
491
+ └── webpack.browser.cjs # Webpack config for browser bundle
492
+ ```
493
+
494
+ ### Available Scripts
495
+
496
+ | Command | Description |
497
+ |---------|-------------|
498
+ | `npm test` | Run the Jest test suite |
499
+ | `npm run build` | Build both Node.js (`lib/`) and browser (`dist/`) bundles |
500
+ | `npm run build:lib` | Build only the Node.js bundle |
501
+ | `npm run build:dist` | Build only the browser bundle |
502
+ | `npm run check:duplicates` | Check for duplicate airport codes in the dataset |
503
+
504
+ ### Development Workflow
505
+
506
+ 1. **Create a branch** from `main` for your changes
507
+ 2. **Make your changes** in `src/index.js` or `data/airports.json`
508
+ 3. **Add or update tests** in `tests/index.test.js`
509
+ 4. **Run tests** to make sure everything passes: `npm test`
510
+ 5. **Build** to verify the bundles compile: `npm run build`
511
+ 6. **Submit a pull request** against `main`
512
+
513
+ ### Updating Airport Data
514
+
515
+ If you are adding or updating airport entries:
516
+
517
+ 1. Edit `data/airports.json` directly
518
+ 2. Run `npm run check:duplicates` to ensure no duplicate IATA/ICAO codes
519
+ 3. Run `node scripts/compress_json.js` to regenerate the compressed dataset
520
+ 4. Run `npm test` to verify the changes
521
+ 5. Submit a pull request with both the JSON and compressed data changes
522
+
523
+ ## Publishing a New Version
524
+
525
+ Releases are automated via the [release workflow](.github/workflows/release.yml). To publish a new version:
526
+
527
+ 1. **Update the version** in `package.json` (follow [Semantic Versioning](https://semver.org/))
528
+ 2. **Update `CHANGELOG.md`** with a new section for the version (follow [Keep a Changelog](https://keepachangelog.com/) format)
529
+ 3. **Build and test locally** to confirm everything works:
530
+ ```bash
531
+ npm run build && npm test
532
+ ```
533
+ 4. **Commit your changes** to `main`
534
+ 5. **Push or merge to the `release` branch** -- this triggers the CI pipeline which will:
535
+ - Run tests across Node.js 20.x, 22.x, and 24.x
536
+ - Run a security audit (`npm audit --audit-level=critical`)
537
+ - Check for duplicate airport codes
538
+ - Build the package
539
+ - Compare the version in `package.json` against the published npm version
540
+ - **Publish to npm** with provenance (if the version is new)
541
+ - **Create a GitHub Release** with notes extracted from `CHANGELOG.md`
542
+
543
+ The workflow can also be triggered manually via `workflow_dispatch` from the Actions tab.
544
+
545
+ ### Version Policy
546
+
547
+ - **Patch** (e.g., 3.0.1 -> 3.0.2): Data updates, bug fixes, performance improvements, dependency bumps
548
+ - **Minor** (e.g., 3.0.x -> 3.1.0): New functions or non-breaking feature additions
549
+ - **Major** (e.g., 3.x.x -> 4.0.0): Breaking API changes or data format changes