refactor: make @hyperframes/lint depend only on parsers#1773
Merged
Conversation
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
@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
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Makes
@hyperframes/lintdepend only on@hyperframes/parsers(+postcss), dropping its@hyperframes/coredependency. This is the follow-up to the package-extraction stack, addressing the lightweight-validator goal of #1749.Why
@hyperframes/lintalready solved the main #1749 pain (validate withoutengine/producer/chrome/FFmpeg). But it still depended oncore, which transitively dragged instudio-server→hono(a web server) andbpm-detective(audio analysis) — both irrelevant to linting.@hyperframes/lintdepscore+parsers+postcssparsers+postcsscore ↔ lintcycleWhat moved
The handful of leaf utilities lint pulled from core are relocated into the standalone
@hyperframes/parsersbase (zero@hyperframes/*deps):decodeUrlPathVariants,rewriteAssetPath,assetPaths)FONT_ALIAS_KEYS,resolveAliasDisplayName, …)parseSlideshowManifest,resolveSlideshow,isSceneLikeCompositionId)corekeeps 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:pathasset helpers are exposed via a new@hyperframes/parsers/asset-pathssubpath 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/lint257,@hyperframes/parsers706,@hyperframes/core914 tests passcli1045,studio1180 tests pass@hyperframes/lintinstall tree no longer contains core / studio-server / hono / bpm-detective