mirror of
https://github.com/stablyai/orca.git
synced 2026-11-13 09:27:29 +00:00
* refactor(tooling): group remaining scripts by concrete domain owners * fix(tooling): preserve relocated launcher resource roots
22 lines
941 B
JavaScript
22 lines
941 B
JavaScript
// Regenerates the host-method region of resources/plugins/declarative/orca.d.ts from the host API
|
|
// table. `--check` fails when it is stale instead of rewriting it.
|
|
import { readFileSync, writeFileSync } from 'node:fs'
|
|
import path from 'node:path'
|
|
import { loadPluginSchemaModule, REPO_ROOT } from './plugin-schema-module-loader.mjs'
|
|
|
|
const TYPINGS = path.join(REPO_ROOT, 'resources', 'plugins', 'declarative', 'orca.d.ts')
|
|
const { spliceOrcaHostTypings } = loadPluginSchemaModule(
|
|
'declarative/plugin-declarative-host-typings.ts'
|
|
)
|
|
const current = readFileSync(TYPINGS, 'utf8')
|
|
const next = spliceOrcaHostTypings(current)
|
|
if (process.argv.includes('--check')) {
|
|
if (next !== current) {
|
|
console.error('orca.d.ts host methods are stale; run pnpm generate:plugin-declarative-typings')
|
|
process.exit(1)
|
|
}
|
|
} else if (next !== current) {
|
|
writeFileSync(TYPINGS, next)
|
|
console.log(`wrote ${path.relative(REPO_ROOT, TYPINGS)}`)
|
|
}
|