refactor(tools): support an explicit project directory

This commit is contained in:
Sameh Khamis committed 2026-09-14 07:35:38 -07:00
1 parent 844c25212c
commit 6d5478ffa9
15 files changed
+169 -16

No files matched your search

+6
View File
@@ -4,6 +4,12 @@ CLI scripts for fetching, rendering, and reprojecting geospatial imagery. All to
Output files go to `output/` by default (gitignored).
When invoking these tools from a separate project, set `GEV_PROJECT_ROOT` to its
absolute directory. Environment files, dependencies and relative output paths
resolve there; bundled rendering HTML stays with the tool. The same setting is
supported by `dev-fresh.sh`, `dev-secure.sh`, `opensky-import-client.sh` and the
setup doctor. Without it, paths continue to resolve from this repository.
## Prerequisites
- Node.js (via `mise`)
+2 -1
View File
@@ -48,11 +48,12 @@
import { readFileSync, mkdirSync } from 'node:fs';
import { resolve, join } from 'node:path';
import { fileURLToPath } from 'node:url';
import { projectRoot } from '../scripts/project-root.mjs';
import { createServer } from 'node:http';
import puppeteer from 'puppeteer';
const __dirname = fileURLToPath(new URL('.', import.meta.url));
const PROJECT_ROOT = resolve(__dirname, '..');
const PROJECT_ROOT = projectRoot(import.meta.url);
// ---------------------------------------------------------------------------
// Argument parsing
+2 -1
View File
@@ -37,10 +37,11 @@
import { readFileSync, mkdirSync, writeFileSync } from 'node:fs';
import { resolve, join, basename, extname } from 'node:path';
import { fileURLToPath } from 'node:url';
import { projectRoot } from '../scripts/project-root.mjs';
import sharp from 'sharp';
const __dirname = fileURLToPath(new URL('.', import.meta.url));
const PROJECT_ROOT = resolve(__dirname, '..');
const PROJECT_ROOT = projectRoot(import.meta.url);
// ---------------------------------------------------------------------------
// Argument parsing
+2 -1
View File
@@ -33,10 +33,11 @@
import { readFileSync, mkdirSync } from 'node:fs';
import { resolve, join } from 'node:path';
import { fileURLToPath } from 'node:url';
import { projectRoot } from '../scripts/project-root.mjs';
import sharp from 'sharp';
const __dirname = fileURLToPath(new URL('.', import.meta.url));
const PROJECT_ROOT = resolve(__dirname, '..');
const PROJECT_ROOT = projectRoot(import.meta.url);
const TILE_SIZE = 256;
const MAX_CONCURRENT = 8;
+2 -1
View File
@@ -24,11 +24,12 @@
import { readFileSync, mkdirSync, writeFileSync } from 'node:fs';
import { resolve, join } from 'node:path';
import { fileURLToPath } from 'node:url';
import { projectRoot } from '../scripts/project-root.mjs';
import { parseEnv } from 'node:util';
import { resolveGoogleServerKey } from '../scripts/google-server-key.mjs';
const __dirname = fileURLToPath(new URL('.', import.meta.url));
const PROJECT_ROOT = resolve(__dirname, '..');
const PROJECT_ROOT = projectRoot(import.meta.url);
function parseArgs() {
const args = process.argv.slice(2);
+2 -1
View File
@@ -25,10 +25,11 @@
import { readFileSync, mkdirSync, writeFileSync } from 'node:fs';
import { resolve, join } from 'node:path';
import { fileURLToPath } from 'node:url';
import { projectRoot } from '../scripts/project-root.mjs';
import sharp from 'sharp';
const __dirname = fileURLToPath(new URL('.', import.meta.url));
const PROJECT_ROOT = resolve(__dirname, '..');
const PROJECT_ROOT = projectRoot(import.meta.url);
// ---------------------------------------------------------------------------
// Argument parsing