mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-11-05 05:37:09 +00:00
Per PR feedback: eliminate the skills/ copy by making the repo root the
plugin root. `.codex-plugin/plugin.json` and `assets/` move from
packages/codex-plugin/ to repo root; the existing `skills/` directory is
referenced in place via `"skills": "./skills/"`. One source of truth.
Install with multi-sparse checkout:
codex plugin marketplace add heygen-com/hyperframes \
--sparse .codex-plugin --sparse skills --sparse assets
Deleted:
- packages/codex-plugin/ (60 duplicated skill files, build.mts, package.json)
- scripts/lib/sync.ts (was only used by the codex-plugin build)
Reverted to pre-plugin state (no longer needed without the copy):
- scripts/sync-schemas.ts (restored to its original shape)
- lefthook.yml (no auto-sync hook)
- .gitignore (no examples/ negation — nothing collides anymore)
- package.json (lint no longer chains check:codex-plugin; removed
build:codex-plugin + check:codex-plugin scripts)
Net: -6831 / +19 lines. The plugin is now just 3 tracked additions at
repo root (.codex-plugin/plugin.json, assets/icon.png, assets/logo.png)
plus one README paragraph documenting the install command.
61 lines
1.8 KiB
TypeScript
61 lines
1.8 KiB
TypeScript
#!/usr/bin/env tsx
|
|
/**
|
|
* Mirror JSON Schemas from `packages/core/schemas/` into `docs/schema/` so
|
|
* Mintlify serves them at `https://hyperframes.heygen.com/schema/*`. The core
|
|
* copies stay authoritative — they're exported from `@hyperframes/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/hyperframes.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();
|