mirror of
https://github.com/hanzoai/frames.git
synced 2026-10-30 14:44:26 +00:00
@hanzo/frame is taken by the hero video primitive — one full-bleed video element — which has held that name on npm since it shipped. This repo is the video toolchain: a CLI, a renderer, a studio, a player. Plural is what it is, so the CLI publishes as @hanzo/frames and the workspace packages follow it (@hanzo/frames-core, @hanzo/frames-engine, and the rest). The binary stays `frames`, and now actually ships. The manifest mapped it to bin/frames.mjs while the file on disk was bin/hyperframes.mjs, so a global install produced no working command. The paths that name a package to fetch were pointing elsewhere. The update check read registry.npmjs.org/frames, a different author's package, and the npm, bun and pnpm installers would have pulled it over the CLI; the render image installed the upstream hyperframes; scaffolded projects and the docs pinned the unscoped name. All of them now name @hanzo/frames.
61 lines
1.7 KiB
TypeScript
61 lines
1.7 KiB
TypeScript
#!/usr/bin/env tsx
|
|
/**
|
|
* Mirror JSON Schemas from `packages/core/schemas/` into `docs/schema/` so
|
|
* Mintlify serves them at `https://frames.hanzo.ai/schema/*`. The core
|
|
* copies stay authoritative — they're exported from `@hanzo/frames-core` for
|
|
* npm consumers — and this script is the single contract that prevents the
|
|
* docs mirror from drifting.
|
|
*
|
|
* Usage:
|
|
* bun run sync-schemas # copy core → docs
|
|
* bun run sync-schemas --check # exit non-zero if copies are stale (CI)
|
|
*
|
|
* `docs/schema/frames.json` is authored directly in docs (no source in
|
|
* core) so it's skipped by this script.
|
|
*/
|
|
|
|
import { readFileSync, writeFileSync } from "node:fs";
|
|
import { join } from "node:path";
|
|
|
|
const ROOT = join(import.meta.dirname, "..");
|
|
const SOURCE_DIR = join(ROOT, "packages/core/schemas");
|
|
const TARGET_DIR = join(ROOT, "docs/schema");
|
|
const MIRRORED = ["registry.json", "registry-item.json"];
|
|
|
|
function main() {
|
|
const checkOnly = process.argv.includes("--check");
|
|
let drift = 0;
|
|
|
|
for (const name of MIRRORED) {
|
|
const source = readFileSync(join(SOURCE_DIR, name), "utf-8");
|
|
const targetPath = join(TARGET_DIR, name);
|
|
const target = (() => {
|
|
try {
|
|
return readFileSync(targetPath, "utf-8");
|
|
} catch {
|
|
return null;
|
|
}
|
|
})();
|
|
|
|
if (target === source) {
|
|
console.log(` ✓ ${name} in sync`);
|
|
continue;
|
|
}
|
|
|
|
drift++;
|
|
if (checkOnly) {
|
|
console.error(` ✗ ${name} out of sync (run \`bun run sync-schemas\` to fix)`);
|
|
continue;
|
|
}
|
|
writeFileSync(targetPath, source);
|
|
console.log(` → ${name} updated`);
|
|
}
|
|
|
|
if (checkOnly && drift > 0) {
|
|
console.error(`\n${drift} schema${drift === 1 ? "" : "s"} drifted from source.`);
|
|
process.exit(1);
|
|
}
|
|
}
|
|
|
|
main();
|