Merge current main into Nepal flood contribution

This commit is contained in:
Sameh Khamis committed 2026-09-15 08:24:37 -07:00
commit 1a936ebac1
136 files changed
+11006 -4580

No files matched your search

+3
View File
@@ -0,0 +1,3 @@
{
"roots": ["src", "server"]
}
+3 -1
View File
@@ -722,5 +722,7 @@
"scripts/qa-transit-scenes.mjs",
"scripts/qa-transit-controls.mjs",
"src/tooling/transitQa.test.mjs",
"scripts/qa-transit-browser.mjs"
"scripts/qa-transit-browser.mjs",
"scripts/format-runtime.json",
"src/tooling/transitService.test.mjs"
]
+56 -3
View File
@@ -1,9 +1,58 @@
import { execFileSync } from 'node:child_process';
import { existsSync } from 'node:fs';
import { readFile, writeFile, realpath, stat } from 'node:fs/promises';
import path from 'node:path';
import { fileURLToPath, pathToFileURL } from 'node:url';
import * as prettier from 'prettier';
/** Check or format the explicitly adopted files, without scanning other source. */
/** Discover owned runtime code; tests and other files retain explicit adoption. */
export async function discoverRuntimeFormatFiles(root) {
const configFile = path.join(root, 'scripts/format-runtime.json');
if (!existsSync(configFile)) return [];
const { roots } = JSON.parse(await readFile(configFile, 'utf8'));
if (
!Array.isArray(roots) ||
!roots.length ||
new Set(roots).size !== roots.length ||
roots.some(
(name) =>
typeof name !== 'string' ||
!/^[a-zA-Z0-9_-]+(?:\/[a-zA-Z0-9_-]+)*$/.test(name),
)
)
throw new Error(
'Runtime formatting roots must be unique repository directory paths',
);
const candidates = execFileSync(
'git',
[
'ls-files',
'-z',
'--cached',
'--others',
'--exclude-standard',
'--',
...roots,
],
{ cwd: root, encoding: 'utf8' },
).split('\0');
const files = [];
for (const name of new Set(candidates)) {
if (
!/\.[cm]?js$/.test(name) ||
/\.test\.[cm]?js$/.test(name) ||
!existsSync(path.join(root, name))
)
continue;
const info = await prettier.getFileInfo(path.join(root, name), {
ignorePath: path.join(root, '.prettierignore'),
});
if (!info.ignored) files.push(name);
}
return files.sort();
}
/** Check or format explicit adoption plus automatically discovered runtime code. */
export async function formatAdoptedFiles(root, mode) {
if (!['--check', '--write'].includes(mode)) {
throw new Error('Usage: node scripts/format.mjs --check|--write');
@@ -22,9 +71,13 @@ export async function formatAdoptedFiles(root, mode) {
);
}
const names = [
...new Set([...scope, ...(await discoverRuntimeFormatFiles(root))]),
];
// Validate the whole scope before any write, including resolved symlink paths.
const files = [];
for (const name of scope) {
for (const name of names) {
if (
typeof name !== 'string' ||
!name ||
@@ -91,7 +144,7 @@ if (import.meta.url === invoked) {
process.exitCode = 1;
} else {
console.log(
`${mode === '--write' ? 'Formatted' : 'Checked'} ${result.count} adopted files.`,
`${mode === '--write' ? 'Formatted' : 'Checked'} ${result.count} source files.`,
);
}
} catch (error) {
+51 -11
View File
@@ -68,7 +68,8 @@
"scripts/google-server-key.mjs",
"src/data/placeProviderPayloads.js",
"src/data/routeSteps.js",
"src/sources/httpBody.js"
"src/sources/httpBody.js",
"src/sources/rateLimit.js"
],
"external": []
},
@@ -205,7 +206,8 @@
"src/data/placeProviderPayloads.js",
"src/data/routeSteps.js",
"src/sources/httpBody.js",
"src/sources/overpass.js"
"src/sources/overpass.js",
"src/sources/rateLimit.js"
],
"external": []
},
@@ -223,7 +225,8 @@
"server/providers/overpass/constants.js",
"server/providers/overpass/geometry.js",
"server/providers/overpass/transport.js",
"src/sources/httpBody.js"
"src/sources/httpBody.js",
"src/sources/rateLimit.js"
],
"external": []
},
@@ -244,7 +247,8 @@
"server/providers/regional/weather.js",
"src/data/regionalModel.js",
"src/nominatimGeocode.js",
"src/sources/httpBody.js"
"src/sources/httpBody.js",
"src/sources/rateLimit.js"
],
"external": []
},
@@ -266,7 +270,8 @@
"src/hudSummaryResponse.js",
"src/voice/voiceCost.js",
"src/voice/actionSchemas.js",
"server/providers/openai/toolDescriptions.js"
"server/providers/openai/toolDescriptions.js",
"src/sources/rateLimit.js"
],
"external": []
},
@@ -1678,7 +1683,9 @@
"src/data/gtfsRealtime.js",
"src/layers/transit/trails.js",
"src/layers/transit/movement.js",
"src/layers/transit/qaMetrics.js"
"src/layers/transit/qaMetrics.js",
"src/layers/transit/source.js",
"src/sources/transitHistory.js"
],
"external": [
"@mapbox/vector-tile",
@@ -2065,7 +2072,9 @@
"src/data/gtfsRealtime.js",
"src/layers/transit/trails.js",
"src/layers/transit/movement.js",
"src/layers/transit/qaMetrics.js"
"src/layers/transit/qaMetrics.js",
"src/layers/transit/source.js",
"src/sources/transitHistory.js"
],
"external": [
"cesium",
@@ -2398,7 +2407,11 @@
"src/data/gtfsRealtime.js",
"src/data/transitFeeds.js",
"src/data/transitProxy.js",
"src/sources/httpBody.js"
"src/sources/httpBody.js",
"src/sources/transitHistory.js",
"src/sources/transitService.js",
"src/sources/transitHistoryStore.js",
"src/sources/rateLimit.js"
],
"external": ["pbf"]
},
@@ -2407,7 +2420,8 @@
"modules": [
"src/data/gtfsRealtime.js",
"src/data/transitFeeds.js",
"src/data/transitProxy.js"
"src/data/transitProxy.js",
"src/sources/transitHistory.js"
],
"external": ["pbf"]
},
@@ -2461,7 +2475,9 @@
"src/services/meshFloorSampler.js",
"src/services/requests.js",
"src/services/terrainHeights.js",
"src/sources/sourceSlot.js"
"src/sources/sourceSlot.js",
"src/layers/transit/source.js",
"src/sources/transitHistory.js"
],
"external": ["cesium", "egm96-universal", "pbf"]
},
@@ -2496,8 +2512,32 @@
"src/layers/transit/qaMetrics.test.mjs",
"scripts/qa-transit-scenes.mjs",
"scripts/qa-transit-controls.mjs",
"scripts/qa-transit-browser.mjs"
"scripts/qa-transit-browser.mjs",
"src/layers/transit/source.js",
"src/sources/transitHistory.js"
],
"external": ["cesium", "pbf"]
},
"transit-source-factory": {
"exports": ["./layers/transit/source"],
"modules": [
"src/layers/transit/source.js",
"src/sources/transitHistory.js"
],
"external": []
},
"transit-service": {
"exports": ["./sources/transit-service"],
"modules": [
"src/data/transitFeeds.js",
"src/data/transitProxy.js",
"src/data/gtfsRealtime.js",
"src/sources/httpBody.js",
"src/sources/transitHistory.js",
"src/sources/transitService.js",
"src/sources/transitHistoryStore.js",
"src/sources/rateLimit.js"
],
"external": ["pbf"]
}
}