feat: add web OSM import workflow

This commit is contained in:
2026-08-26 14:05:26 +08:00
parent 81e02c670d
commit 181e575e1e
10 changed files with 189 additions and 16 deletions

View File

@@ -3,12 +3,12 @@
const path = require("path");
const { startWorkbench } = require("../workbench/server");
const fs = require("fs");
const args = process.argv.slice(2);
const index = args.indexOf("--input");
if (index < 0 || !args[index + 1]) throw new Error("Usage: road-workbench --input <RoadCompilerInput.json> [--port <port>]");
const inputFile = path.resolve(args[index + 1]);
const input = require(inputFile);
const inputFile = index >= 0 && args[index + 1] ? path.resolve(args[index + 1]) : null;
const input = inputFile ? JSON.parse(fs.readFileSync(inputFile, "utf8")) : null;
const portIndex = args.indexOf("--port");
const port = portIndex >= 0 ? Number(args[portIndex + 1]) : 8787;
startWorkbench({ input, inputFile, port });
startWorkbench({ input, inputFile, repoRoot: path.resolve(__dirname, ".."), port });