(fileArg, data, label, pretty = false)
| 252 | } |
| 253 | |
| 254 | function writeJson(fileArg, data, label, pretty = false) { |
| 255 | const out = resolve(fileArg) |
| 256 | writeFileSync(out, pretty ? JSON.stringify(data, null, 2) + '\n' : JSON.stringify(data), 'utf8') |
| 257 | console.log(` → ${out} (${label})`) |
| 258 | } |
| 259 | |
| 260 | /** Emit one TS module per domain: types and commands/events, both from bidi_schema.json. */ |
| 261 | function generateTypeScript(ast, model, vendorModel, args) { |