Merge pull request #716 from mauriceboe/dev

Dev
This commit is contained in:
Julien G.
2026-04-18 02:08:16 +02:00
committed by GitHub
10 changed files with 161 additions and 112 deletions
+2 -2
View File
@@ -1,5 +1,5 @@
#!/usr/bin/env node
// Build server/data/airports.json from OurAirports (davidmegginson.github.io/ourairports-data).
// Build server/assets/airports.json from OurAirports (davidmegginson.github.io/ourairports-data).
// License: Public Domain. Keeps large/medium airports with an IATA code; timezone derived from coords via tz-lookup.
import fs from 'node:fs'
@@ -9,7 +9,7 @@ import { fileURLToPath } from 'node:url'
import tzLookup from 'tz-lookup'
const __dirname = path.dirname(fileURLToPath(import.meta.url))
const OUT = path.join(__dirname, '..', 'data', 'airports.json')
const OUT = path.join(__dirname, '..', 'assets', 'airports.json')
const SRC = 'https://davidmegginson.github.io/ourairports-data/airports.csv'
function fetchText(url) {
+1 -1
View File
@@ -18,7 +18,7 @@ let byIata: Map<string, Airport> | null = null;
function load(): Airport[] {
if (cache) return cache;
const file = path.join(__dirname, '..', '..', 'data', 'airports.json');
const file = path.join(__dirname, '..', '..', 'assets', 'airports.json');
if (!fs.existsSync(file)) {
console.warn('[airports] airports.json missing — run `node scripts/build-airports.mjs`');
cache = [];