1// Checks relay configuration files, part of npm run typecheck for every2// template in relay-templates/. For one file of your own: npm run relay check <file>.3import { checkConfig, describe, readConfig } from "./config.mjs";45const files = process.argv.slice(2);6if (files.length === 0) {7 console.error("usage: check-config.mjs <file.jsonc>...; for one file, npm run relay check <file>");8 process.exit(2);9}10let failed = false;11for (const f of files) {12 try {13 const cfg = await checkConfig(readConfig(f), f);14 console.log(`${f}: ok\n ${describe(cfg).join("\n ")}`);15 } catch (e) {16 failed = true;17 console.error(e.message);18 }19}20process.exit(failed ? 1 : 0);