Commit Graph
3 Commits
Author SHA1 Message Date
James 2a004d8f55 refactor(codex-plugin): move plugin to repo root, drop build/sync pipeline
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.
2026-04-21 21:26:37 +00:00
James 462bdf48ee refactor(scripts): extract shared sync helpers into scripts/lib/sync.ts
Both sync-schemas.ts and packages/codex-plugin/build.mts were hand-rolling
the same "compare source to target, print drift, exit 1 in --check mode"
pattern with slightly different output shapes. Extract:

- walkFiles(root, filter?) — recursive relative-path lister shared with
  the codex-plugin drift checker
- reportAndExit(drifted, { checkMode, label, fixCommand }) — prints a
  unified ✓/✗ summary, caps drift list, exits non-zero in check mode

Both callers now produce the same output shape so contributors see the
same UI whether they're syncing schemas or the codex plugin:

  ✗ <label> is out of sync:
    changed <path>
    missing <path>
    extra   <path>
  Run `<fix command>` and commit the result.

Verified: lint, format:check, sync-schemas:check, check:codex-plugin all
pass. Drift injection tests pass on both sync paths. Pre-commit hook still
auto-rebuilds the plugin skills/ copy on source changes and correctly
skips when only the plugin copy is edited (no clobber cycle).
2026-04-21 19:36:52 +00:00
Miguel Ángel 9ef864d1f2 fix(docs): serve hyperframes.json / registry JSON schemas (#304) (#305)
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.

- \`https://hyperframes.heygen.com/schema/hyperframes.json\` — **404** (missing entirely)
- \`https://hyperframes.heygen.com/schema/registry.json\` — **404** (only in npm package)
- \`https://hyperframes.heygen.com/schema/registry-item.json\` — **404** (only in npm package)

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

- [x] \`tsx scripts/sync-schemas.ts --check\` passes locally
- [x] Schemas parse as valid JSON and validate real/default project configs
- [x] After merge: \`curl -sI https://hyperframes.heygen.com/schema/hyperframes.json\` returns 200 once Mintlify redeploys
- [x] Same check for \`/schema/registry.json\` and \`/schema/registry-item.json\`
- [x] 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.
2026-04-17 17:43:43 +02:00