Polish project documentation and runtime config

This commit is contained in:
2026-06-09 10:22:59 +08:00
parent 5f061295d8
commit 0594fc9f8c
43 changed files with 1001 additions and 97 deletions

View File

@@ -4,7 +4,8 @@ import path from "node:path";
import http from "node:http";
import { spawn } from "node:child_process";
const BASE_DIR = "/Users/xuexue/Documents/trae_projects/travel- graph/delivery_20260602";
const ROOT = path.resolve(new URL("..", import.meta.url).pathname, "..");
const BASE_DIR = process.env.TRAVEL_DELIVERY_ROOT || path.join(ROOT, "data", "source", "travel_delivery_20260602");
const OUT_DIR = path.join(BASE_DIR, "amap_js_enriched");
const CACHE_FILE = path.join(OUT_DIR, "_amap_js_cache.json");
const CHROME = "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome";
@@ -185,8 +186,9 @@ function jsString(v) {
}
async function initAmap(cdp) {
const key = readEnvKey("/Users/xuexue/new2/.env", "AMAP_JS_KEY");
const security = readEnvKey("/Users/xuexue/new2/.env", "AMAP_SECURITY_JSCODE");
const envPath = process.env.TRAVEL_KG_ENV_PATH || path.join(ROOT, ".env");
const key = readEnvKey(envPath, "AMAP_JS_KEY");
const security = readEnvKey(envPath, "AMAP_SECURITY_JSCODE");
if (!key || !security) throw new Error("missing AMap JS key/security");
const expr = `
(async () => {