Share compiled schema conversion while recording all four built-in catalog profiles. Preserve canonical hashes, output validation and custom-budget fallback. Refs #723. Co-authored-by: Kaoru0822 <208281322+kaoru0822-kitauji@users.noreply.github.com>
26 lines
707 B
JavaScript
26 lines
707 B
JavaScript
import { pathToFileURL } from "node:url";
|
|
import { resolve } from "node:path";
|
|
const [root, input, output] = process.argv.slice(2);
|
|
const start = performance.now();
|
|
const { createCatalogIdentity } = await import(
|
|
pathToFileURL(resolve(root, "dist/catalogIdentity.js"))
|
|
);
|
|
const imported = performance.now();
|
|
const cpu = process.cpuUsage();
|
|
const identity = createCatalogIdentity(
|
|
input === "compact" ? { budgetBytes: 13 * 1024 } : undefined,
|
|
output,
|
|
);
|
|
const digests = identity.digests;
|
|
const end = performance.now();
|
|
console.log(
|
|
JSON.stringify({
|
|
input,
|
|
output,
|
|
import_ms: imported - start,
|
|
digest_ms: end - imported,
|
|
digest_cpu_us: process.cpuUsage(cpu),
|
|
digests,
|
|
}),
|
|
);
|