Skip to content

refactor: make @hyperframes/lint depend only on parsers#1773

Merged
miguel-heygen merged 2 commits into
mainfrom
refactor/lint-parsers-only
Jun 27, 2026
Merged

refactor: make @hyperframes/lint depend only on parsers#1773
miguel-heygen merged 2 commits into
mainfrom
refactor/lint-parsers-only

Conversation

@miguel-heygen

Copy link
Copy Markdown
Collaborator

Summary

Makes @hyperframes/lint depend only on @hyperframes/parsers (+ postcss), dropping its @hyperframes/core dependency. This is the follow-up to the package-extraction stack, addressing the lightweight-validator goal of #1749.

Why

@hyperframes/lint already solved the main #1749 pain (validate without engine/producer/chrome/FFmpeg). But it still depended on core, which transitively dragged in studio-serverhono (a web server) and bpm-detective (audio analysis) — both irrelevant to linting.

before after
@hyperframes/lint deps core + parsers + postcss parsers + postcss
transitively pulls core, studio-server, hono, bpm-detective, pretext, … just parsers' deps
core ↔ lint cycle yes gone

What moved

The handful of leaf utilities lint pulled from core are relocated into the standalone @hyperframes/parsers base (zero @hyperframes/* deps):

  • URL/asset-path helpers (decodeUrlPathVariants, rewriteAssetPath, assetPaths)
  • font aliases (FONT_ALIAS_KEYS, resolveAliasDisplayName, …)
  • the slideshow manifest parser (parseSlideshowManifest, resolveSlideshow, isSceneLikeCompositionId)

core keeps back-compat re-export stubs at every old path (@hyperframes/core/fonts/aliases, @hyperframes/core/slideshow, @hyperframes/core/compiler, …), so producer / studio / CLI are unchanged.

Browser-safety

The Node-only node:path asset helpers are exposed via a new @hyperframes/parsers/asset-paths subpath rather than the main entry, keeping @hyperframes/parsers (which browser code imports) browser-safe. The slideshow parser is exposed via @hyperframes/parsers/slideshow.

Test plan

  • bun run build — full monorepo build green
  • @hyperframes/lint 257, @hyperframes/parsers 706, @hyperframes/core 914 tests pass
  • Consumers unaffected: cli 1045, studio 1180 tests pass
  • Fallow audit clean
  • Verified @hyperframes/lint install tree no longer contains core / studio-server / hono / bpm-detective

Relocates the leaf utilities lint pulled from core — URL/asset-path helpers,
font aliases, and the slideshow manifest parser — into the standalone
@hyperframes/parsers base, and drops @hyperframes/core from lint's
dependencies. Core keeps back-compat re-export stubs at the old paths, so
producer/studio/cli are unchanged.

Why: lint was the lightweight validator from #1749, but depending on core
transitively pulled studio-server (hono) and bpm-detective — irrelevant to
linting. Now installing @hyperframes/lint pulls only parsers + postcss, and
the core<->lint dependency cycle is gone.

- parsers main entry stays browser-safe (pure utils only); the node:path
  asset helpers live behind the new @hyperframes/parsers/asset-paths subpath
- slideshow parser exposed via @hyperframes/parsers/slideshow
Comment thread packages/parsers/src/rewriteSubCompPaths.ts Fixed
@hyperframes/lint/browser — a fully client-side rule engine (lintHyperframeHtml,
lintMediaUrls, shouldBlockRender) with zero node: builtins, so browser-only
editors can validate compositions with no Node.js and no server round-trip.
Closes the browser-validation ask on #1749.

- shouldBlockRender extracted from the fs-bound project.ts into its own pure
  module so the browser entry stays node-free
- pure composition primitives (data types, font aliases, URL helper) exposed via
  a new recast-free @hyperframes/parsers/composition subpath, so the browser
  bundle tree-shakes out the GSAP/recast machinery (verified: esbuild
  platform=browser bundles with 0 node builtins)
- lint built with a platform:browser tsup pass — compile-time guarantee the
  browser entry never pulls a node builtin
- harden CSS_URL_RE against polynomial ReDoS (CodeQL js/polynomial-redos);
  behavior-preserving, verified against existing tests + an old/new parity check
- parsers/lint marked sideEffects:false
@mintlify

mintlify Bot commented Jun 27, 2026

Copy link
Copy Markdown

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

Project Status Preview Updated (UTC)
hyperframes 🟢 Ready View Preview Jun 27, 2026, 5:25 PM

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

@miguel-heygen miguel-heygen merged commit 6aaab32 into main Jun 27, 2026
53 checks passed
@miguel-heygen miguel-heygen deleted the refactor/lint-parsers-only branch June 27, 2026 17:51
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.

2 participants