mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-09-03 04:38:33 +00:00
* feat(core): add registry schema + TS types
PR 1/17 of the catalog system rollout. Foundation for a shadcn-style
registry with three item tiers: examples (full projects), blocks
(sub-compositions), components (effect snippets).
## What
- TS types: RegistryItem (discriminated union of ExampleItem/BlockItem/
ComponentItem), RegistryManifest, FileTarget, ItemType, FileType
- JSON Schemas: schemas/registry.json, schemas/registry-item.json
- Compile-time exhaustiveness asserts on ITEM_TYPES/FILE_TYPES so adding
to the TS union without updating the constant stops compiling
- Drift-guard test: schema enums must equal ITEM_TYPES/FILE_TYPES by
set-equality; exactly 2 distinct type enums in registry-item.json
- Public API via new ./registry export path plus re-exports from root;
schemas exposed via ./schemas/registry.json export for external tooling
## Why
- Every downstream PR (resolver, installer, hyperframes add, docs
codegen, CI previews, skill, catalog command) builds on these types
- Getting the shape right now avoids painful migrations later
## How
- Discriminated union enforces that components do not have dimensions
or duration and examples/blocks must have them (schema mirrors via
if/then/else on the type discriminant)
- target path pattern rejects .. segments, Unix absolute paths, and
Windows drive letters (defense-in-depth; CLI validates at runtime in
PR 3)
- name pattern requires alphanumeric start and end (no trailing hyphens)
- Optional metadata: version, author, license, deprecated, minCliVersion
- additionalProperties: false on nested objects (catches typos on
critical fields) but relaxed on top-level RegistryItem (allows
third-party custom metadata in PR 15 custom registries)
## Test plan
- [x] Unit tests: 11 new tests covering type guards, discriminant
narrowing, schema/TS drift guards, schema \$id sanity, optional
metadata acceptance, and compile-time checks (via @ts-expect-error)
- [x] bun run test in packages/core: 445 passed (was 434 on main,
+11 from this PR)
- [x] bunx oxfmt and bunx oxlint: clean
- [x] bun run typecheck: clean
- [ ] Manual testing: N/A (types + schemas only)
- [ ] Documentation updated: per-item doc pages land in PR 9 (codegen
from these manifests); guide updates in PR 10+
## Breaking / migration
None. Pure additive — new module, new export paths, no existing
surface touched.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix(core): remove version field + hyperframes:demo file type
Address review feedback from Miguel:
- Remove `version` from RegistryItemBase + schema. Per shadcn model,
the registry is versioned by git tags, not per-item. The adversarial
review added it; the original design doc was correct.
- Remove `hyperframes:demo` from FileType union + FILE_TYPES constant
+ schema. Demo files exist on disk for the CI preview pipeline but
are NOT installed to user projects and should not appear in
registry-item.json files[]. Neither shadcn nor Remotion has a
dedicated demo file type — demos are just compositions.
- Add `required: ["type"]` to the if-condition in the schema's
allOf discriminant (Miguel's nit — makes the condition self-
contained)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix(ci): add shader-transitions to Dockerfile.test
PR #251 added packages/shader-transitions/ to the workspace but didn't
update Dockerfile.test to COPY its package.json. This caused
`bun install --frozen-lockfile` to fail in the regression Docker build:
bun saw a lockfile referencing @hyperframes/shader-transitions but the
package.json wasn't present in the container, so it wanted to remove
the entry — triggering "lockfile had changes."
Verified: Docker build passes with `--no-cache` after this fix.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
129 lines
4.3 KiB
JSON
129 lines
4.3 KiB
JSON
{
|
|
"name": "@hyperframes/core",
|
|
"version": "0.3.0",
|
|
"description": "",
|
|
"repository": {
|
|
"type": "git",
|
|
"url": "https://github.com/heygen-com/hyperframes",
|
|
"directory": "packages/core"
|
|
},
|
|
"files": [
|
|
"dist",
|
|
"docs",
|
|
"schemas",
|
|
"README.md"
|
|
],
|
|
"type": "module",
|
|
"main": "./src/index.ts",
|
|
"types": "./src/index.ts",
|
|
"exports": {
|
|
".": {
|
|
"import": "./src/index.ts",
|
|
"types": "./src/index.ts"
|
|
},
|
|
"./lint": {
|
|
"import": "./src/lint/index.ts",
|
|
"types": "./src/lint/index.ts"
|
|
},
|
|
"./compiler": {
|
|
"import": "./src/compiler/index.ts",
|
|
"types": "./src/compiler/index.ts"
|
|
},
|
|
"./runtime": "./dist/hyperframe.runtime.iife.js",
|
|
"./studio-api": {
|
|
"import": "./src/studio-api/index.ts",
|
|
"types": "./src/studio-api/index.ts"
|
|
},
|
|
"./text": {
|
|
"import": "./src/text/index.ts",
|
|
"types": "./src/text/index.ts"
|
|
},
|
|
"./registry": {
|
|
"import": "./src/registry/index.ts",
|
|
"types": "./src/registry/index.ts"
|
|
},
|
|
"./schemas/registry.json": "./schemas/registry.json",
|
|
"./schemas/registry-item.json": "./schemas/registry-item.json"
|
|
},
|
|
"publishConfig": {
|
|
"access": "public",
|
|
"exports": {
|
|
".": {
|
|
"import": "./dist/index.js",
|
|
"types": "./dist/index.d.ts"
|
|
},
|
|
"./lint": {
|
|
"import": "./dist/lint/index.js",
|
|
"types": "./dist/lint/index.d.ts"
|
|
},
|
|
"./compiler": {
|
|
"import": "./dist/compiler/index.js",
|
|
"types": "./dist/compiler/index.d.ts"
|
|
},
|
|
"./runtime": "./dist/hyperframe.runtime.iife.js",
|
|
"./studio-api": {
|
|
"import": "./dist/studio-api/index.js",
|
|
"types": "./dist/studio-api/index.d.ts"
|
|
},
|
|
"./text": {
|
|
"import": "./dist/text/index.js",
|
|
"types": "./dist/text/index.d.ts"
|
|
},
|
|
"./registry": {
|
|
"import": "./dist/registry/index.js",
|
|
"types": "./dist/registry/index.d.ts"
|
|
},
|
|
"./schemas/registry.json": "./schemas/registry.json",
|
|
"./schemas/registry-item.json": "./schemas/registry-item.json"
|
|
},
|
|
"main": "./dist/index.js",
|
|
"types": "./dist/index.d.ts"
|
|
},
|
|
"scripts": {
|
|
"build": "tsc && bun run build:hyperframes-runtime",
|
|
"test": "vitest run",
|
|
"test:watch": "vitest",
|
|
"test:coverage": "vitest run --coverage",
|
|
"typecheck": "tsc --noEmit",
|
|
"lint:runtime-preview-guards": "tsx scripts/lint-runtime-preview-guards.ts",
|
|
"build:hyperframes-runtime": "tsx scripts/build-hyperframes-runtime-artifact.ts",
|
|
"build:hyperframes-runtime:modular": "SANDBOX_RUNTIME_VARIANT=modular tsx scripts/build-hyperframes-runtime-artifact.ts",
|
|
"build:hyperframe-runtime": "tsx scripts/build-hyperframes-runtime-artifact.ts",
|
|
"test:hyperframe-runtime-contract": "tsx scripts/test-hyperframe-runtime-contract.ts",
|
|
"test:hyperframe-runtime-behavior": "tsx scripts/test-hyperframe-runtime-behavior.ts",
|
|
"test:hyperframe-runtime-seek": "tsx scripts/test-hyperframe-runtime-seek.ts",
|
|
"test:hyperframe-runtime-duration-guards": "tsx scripts/test-hyperframe-runtime-duration-guards.ts",
|
|
"test:hyperframe-runtime-parity": "tsx scripts/test-hyperframe-runtime-parity.ts",
|
|
"test:hyperframe-runtime-security": "tsx scripts/test-hyperframe-runtime-security.ts",
|
|
"test:hyperframe-linter": "tsx scripts/test-hyperframe-linter.ts",
|
|
"test:hyperframe-runtime-ci": "bun run build:hyperframes-runtime && bun run test:hyperframe-runtime-contract && bun run test:hyperframe-runtime-behavior && bun run test:hyperframe-runtime-seek && bun run test:hyperframe-runtime-duration-guards && bun run test:hyperframe-runtime-parity && bun run test:hyperframe-runtime-security",
|
|
"check:hyperframe-html": "tsx scripts/check-hyperframe-static.ts",
|
|
"debug:timeline": "tsx scripts/debug-timeline.ts",
|
|
"prepublishOnly": "echo skip"
|
|
},
|
|
"dependencies": {
|
|
"@chenglou/pretext": "^0.0.5"
|
|
},
|
|
"devDependencies": {
|
|
"@types/jsdom": "^28.0.0",
|
|
"@types/node": "^24.10.13",
|
|
"@vitest/coverage-v8": "^3.2.4",
|
|
"jsdom": "^29.0.0",
|
|
"tsx": "^4.21.0",
|
|
"typescript": "^5.0.0",
|
|
"vitest": "^3.2.4"
|
|
},
|
|
"peerDependencies": {
|
|
"hono": "^4.0.0"
|
|
},
|
|
"peerDependenciesMeta": {
|
|
"hono": {
|
|
"optional": true
|
|
}
|
|
},
|
|
"optionalDependencies": {
|
|
"esbuild": "^0.25.12",
|
|
"linkedom": "^0.18.12"
|
|
}
|
|
}
|