Skip to content

fix(docs): serve hyperframes.json / registry JSON schemas (#304)#305

Merged
miguel-heygen merged 1 commit intomainfrom
fix/schema-404s
Apr 17, 2026
Merged

fix(docs): serve hyperframes.json / registry JSON schemas (#304)#305
miguel-heygen merged 1 commit intomainfrom
fix/schema-404s

Conversation

@miguel-heygen
Copy link
Copy Markdown
Collaborator

@miguel-heygen miguel-heygen commented Apr 17, 2026

Closes #304.

Summary

The three /schema/*.json URLs baked into every Hyperframes project as \$schema references are 404ing on the live docs site — blocking editor autocomplete and validation.

Mintlify serves top-level non-MDX dirs in `docs/` at `/<dir>/` (confirmed by `docs/logo/.svg` → `/logo/*.svg`). This PR drops the three schemas into `docs/schema/` so the URLs resolve.

What changed

File Role
`docs/schema/hyperframes.json` New. Authored from the `ProjectConfig` type in `packages/cli/src/utils/projectConfig.ts`.
`docs/schema/registry.json` Mirror of `packages/core/schemas/registry.json`.
`docs/schema/registry-item.json` Mirror of `packages/core/schemas/registry-item.json`.
`scripts/sync-schemas.ts` Keeps the registry mirrors in lockstep with their authoritative copies in `packages/core/schemas/`. `--check` mode fails the Docs workflow on drift.
`.github/workflows/docs.yml` Runs `tsx scripts/sync-schemas.ts --check` on every PR touching docs or core schemas.
`package.json` `sync-schemas` / `sync-schemas:check` npm scripts.

Why not make `packages/core/schemas/` authoritative for `hyperframes.json` too?

`hyperframes.json` is CLI config, not a core type. Keeping the schema in `docs/` avoids an artificial dependency between `@hyperframes/core` and `@hyperframes/cli`. If the two ever need to align, we can flip the direction then.

Verification

  • `bun run sync-schemas:check` → `2/2 in sync`.
  • Ajv (draft 2020-12, in-process) validation against 9 cases:
    • ✓ real factory-series-c-video config
    • ✓ default shape from `hyperframes init`
    • ✓ `$schema` is optional
    • ✓ missing registry → rejected
    • ✓ missing paths.assets → rejected
    • ✓ extra top-level key → rejected
    • ✓ empty registry string → rejected
    • ✓ empty block path → rejected
    • ✓ missing paths entirely → rejected

Test plan

  • `tsx scripts/sync-schemas.ts --check` passes locally
  • Schemas parse as valid JSON and validate real/default project configs
  • After merge: `curl -sI https://hyperframes.heygen.com/schema/hyperframes.json\` returns 200 once Mintlify redeploys
  • Same check for `/schema/registry.json` and `/schema/registry-item.json`
  • VS Code autocomplete and error-highlighting work on `hyperframes.json` without extra config

Notes

  • The Docs workflow now triggers on `packages/core/schemas/` and `scripts/sync-schemas.ts` in addition to `docs/`, so a core-schemas change that forgets to run `sync-schemas` will fail CI instead of silently publishing stale docs.
  • No runtime / API changes to any package; ship independent of a version bump.

The three /schema/*.json URLs baked into every Hyperframes project as
\$schema references were all 404ing on the live docs site — blocking
editor autocomplete and validation for hyperframes.json, registry.json,
and registry-item.json.

Adds docs/schema/ so Mintlify serves the three expected URLs:
- /schema/hyperframes.json       (new — authored from ProjectConfig)
- /schema/registry.json          (mirrored from packages/core/schemas/)
- /schema/registry-item.json     (mirrored from packages/core/schemas/)

The registry schemas stay authoritative in packages/core/schemas/ where
they're npm-exported for @hyperframes/core consumers. scripts/sync-schemas.ts
mirrors them into docs/schema/ and a new --check mode fails the Docs
workflow if the two drift, so the npm copy and the docs copy can't
diverge silently.

Validated against the factory-series-c-video config + a default config
generated by hyperframes init; negative cases (missing registry,
extra top-level keys, empty required strings) reject as expected.
@mintlify
Copy link
Copy Markdown

mintlify bot commented Apr 17, 2026

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
hyperframes 🟢 Ready View Preview Apr 17, 2026, 3:28 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

@miguel-heygen miguel-heygen merged commit 9ef864d into main Apr 17, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

unable to load schema file for hyperframes.json

2 participants