refactor: extract @hyperframes/parsers from core#1755
Merged
Conversation
This was referenced Jun 27, 2026
Moves all GSAP parser/writer modules, HTML parser, hf-ids, spring ease, and related types from packages/core/src/parsers/ into a new standalone packages/parsers package with its own build pipeline. Core keeps thin re-export stubs at the old subpath locations for backward compatibility. Consumer imports (studio hooks, sdk, studio-api routes) are updated to import from @hyperframes/parsers directly.
9b0a843 to
019278f
Compare
miguel-heygen
added a commit
that referenced
this pull request
Jun 27, 2026
Moves all lint rules, hyperframeLinter, lintProject, and related types from packages/core/src/lint/ into a new standalone packages/lint package. Core keeps a thin re-export stub at @hyperframes/core/lint for backward compatibility. Consumer imports (cli lint command, producer hyperframeLint) are updated to import from @hyperframes/lint directly. Depends on @hyperframes/parsers (PR #1755).
miguel-heygen
added a commit
that referenced
this pull request
Jun 27, 2026
Moves all studio-api routes, helpers, and Hono server wiring from packages/core/src/studio-api/ into a new standalone packages/studio-server package (@hyperframes/studio-server). Core keeps thin re-export stubs at @hyperframes/core/studio-api and the subpath helpers (screenshot-clip, draft-markers, etc.) for backward compatibility. Consumer imports (cli studioServer, vite adapter/config, producer htmlCompiler, studio manualEditsTypes) are updated to import from @hyperframes/studio-server directly. Also exports rewriteInlineStyleAssetUrls from @hyperframes/core root (was in compiler/rewriteSubCompPaths.ts but not re-exported), required by @hyperframes/studio-server/helpers/subComposition. Removes postcss-selector-parser from @hyperframes/core dependencies (moved to @hyperframes/studio-server which owns the routes that used it). Depends on @hyperframes/parsers (PR #1755).
Collaborator
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
miguel-heygen
added a commit
that referenced
this pull request
Jun 27, 2026
Moves all lint rules, hyperframeLinter, lintProject, and related types from packages/core/src/lint/ into a new standalone packages/lint package. Core keeps a thin re-export stub at @hyperframes/core/lint for backward compatibility. Consumer imports (cli lint command, producer hyperframeLint) are updated to import from @hyperframes/lint directly. Depends on @hyperframes/parsers (PR #1755).
miguel-heygen
added a commit
that referenced
this pull request
Jun 27, 2026
Moves all studio-api routes, helpers, and Hono server wiring from packages/core/src/studio-api/ into a new standalone packages/studio-server package (@hyperframes/studio-server). Core keeps thin re-export stubs at @hyperframes/core/studio-api and the subpath helpers (screenshot-clip, draft-markers, etc.) for backward compatibility. Consumer imports (cli studioServer, vite adapter/config, producer htmlCompiler, studio manualEditsTypes) are updated to import from @hyperframes/studio-server directly. Also exports rewriteInlineStyleAssetUrls from @hyperframes/core root (was in compiler/rewriteSubCompPaths.ts but not re-exported), required by @hyperframes/studio-server/helpers/subComposition. Removes postcss-selector-parser from @hyperframes/core dependencies (moved to @hyperframes/studio-server which owns the routes that used it). Depends on @hyperframes/parsers (PR #1755).
miguel-heygen
added a commit
that referenced
this pull request
Jun 27, 2026
Moves all lint rules, hyperframeLinter, lintProject, and related types from packages/core/src/lint/ into a new standalone packages/lint package. Core keeps a thin re-export stub at @hyperframes/core/lint for backward compatibility. Consumer imports (cli lint command, producer hyperframeLint) are updated to import from @hyperframes/lint directly. Depends on @hyperframes/parsers (PR #1755).
miguel-heygen
added a commit
that referenced
this pull request
Jun 27, 2026
Moves all studio-api routes, helpers, and Hono server wiring from packages/core/src/studio-api/ into a new standalone packages/studio-server package (@hyperframes/studio-server). Core keeps thin re-export stubs at @hyperframes/core/studio-api and the subpath helpers (screenshot-clip, draft-markers, etc.) for backward compatibility. Consumer imports (cli studioServer, vite adapter/config, producer htmlCompiler, studio manualEditsTypes) are updated to import from @hyperframes/studio-server directly. Also exports rewriteInlineStyleAssetUrls from @hyperframes/core root (was in compiler/rewriteSubCompPaths.ts but not re-exported), required by @hyperframes/studio-server/helpers/subComposition. Removes postcss-selector-parser from @hyperframes/core dependencies (moved to @hyperframes/studio-server which owns the routes that used it). Depends on @hyperframes/parsers (PR #1755).
miguel-heygen
added a commit
that referenced
this pull request
Jun 27, 2026
Moves all lint rules, hyperframeLinter, lintProject, and related types from packages/core/src/lint/ into a new standalone packages/lint package. Core keeps a thin re-export stub at @hyperframes/core/lint for backward compatibility. Consumer imports (cli lint command, producer hyperframeLint) are updated to import from @hyperframes/lint directly. Depends on @hyperframes/parsers (PR #1755).
miguel-heygen
added a commit
that referenced
this pull request
Jun 27, 2026
Moves all studio-api routes, helpers, and Hono server wiring from packages/core/src/studio-api/ into a new standalone packages/studio-server package (@hyperframes/studio-server). Core keeps thin re-export stubs at @hyperframes/core/studio-api and the subpath helpers (screenshot-clip, draft-markers, etc.) for backward compatibility. Consumer imports (cli studioServer, vite adapter/config, producer htmlCompiler, studio manualEditsTypes) are updated to import from @hyperframes/studio-server directly. Also exports rewriteInlineStyleAssetUrls from @hyperframes/core root (was in compiler/rewriteSubCompPaths.ts but not re-exported), required by @hyperframes/studio-server/helpers/subComposition. Removes postcss-selector-parser from @hyperframes/core dependencies (moved to @hyperframes/studio-server which owns the routes that used it). Depends on @hyperframes/parsers (PR #1755).
terencecho
approved these changes
Jun 27, 2026
terencecho
left a comment
Contributor
There was a problem hiding this comment.
Textbook-clean extraction. Every load-bearing axis checks out:
Verified
- Shim completeness: 6
@deprecatedstubs inpackages/core/src/parsers/(gsapConstants/gsapParserAcorn/gsapParserExports/gsapWriterAcorn/hfIds/springEase), each a one-linerexport *from the new package.core/package.jsonkeeps all 6 old subpath exports.core.types.tsre-exports every moved type + runtime symbol. Repo-wide search forgsap-parser-recast(the one parsers-only subpath) finds zero consumers — no stub needed for it. - Public surface:
packages/core/src/index.tskeeps every previously-exported name; only 4 source-path lines change. - Test parity: 19
*.test.tsfiles move 1:1, no orphans. - Dep hygiene: core drops
@babel/parser/acorn/acorn-walk/magic-string/recast; parsers picks up exactly those 5. Post-PRpackages/core/src/has zero direct imports of any of them outside the 6 stubs. - Bun-first exports:
{ "bun": "./src/...ts", "node": "./dist/...js", ... }ordering consistent;publishConfig.exportscorrectly maps todist/only. - Fallow audit: new ignore entries are scoped to relocated files (intentional recast↔acorn parity blocks); no suspicious masking.
- CI ordering:
bun run --filter '@hyperframes/parsers' build && bun run --cwd packages/core buildlands before every vitest/studio job that resolves via the"node"condition.preview-regression.ymlpath filter includespackages/parsers/**. Publish order: parsers before core. ✓
Non-blocking polish
packages/parsers/src/index.tsre-exportsgsapUnroll/cssSelectoras named (unrollComputedTimeline,queryByAttr) rather than fullexport *. If those modules grow new public symbols, they won't surface via the top-level barrel — only via subpaths. Tight by design, just worth knowing.linkedomis now in bothcoreandparsersdeps. Both genuinely use it (parsers for HTML parsing, core for non-parser runtime DOM), so the dup is real, not a leak — workspace dedupes at install.
— Review by tai (pr-review)
Collaborator
Author
Merge activity
|
miguel-heygen
added a commit
that referenced
this pull request
Jun 27, 2026
Moves all lint rules, hyperframeLinter, lintProject, and related types from packages/core/src/lint/ into a new standalone packages/lint package. Core keeps a thin re-export stub at @hyperframes/core/lint for backward compatibility. Consumer imports (cli lint command, producer hyperframeLint) are updated to import from @hyperframes/lint directly. Depends on @hyperframes/parsers (PR #1755).
miguel-heygen
added a commit
that referenced
this pull request
Jun 27, 2026
Moves all studio-api routes, helpers, and Hono server wiring from packages/core/src/studio-api/ into a new standalone packages/studio-server package (@hyperframes/studio-server). Core keeps thin re-export stubs at @hyperframes/core/studio-api and the subpath helpers (screenshot-clip, draft-markers, etc.) for backward compatibility. Consumer imports (cli studioServer, vite adapter/config, producer htmlCompiler, studio manualEditsTypes) are updated to import from @hyperframes/studio-server directly. Also exports rewriteInlineStyleAssetUrls from @hyperframes/core root (was in compiler/rewriteSubCompPaths.ts but not re-exported), required by @hyperframes/studio-server/helpers/subComposition. Removes postcss-selector-parser from @hyperframes/core dependencies (moved to @hyperframes/studio-server which owns the routes that used it). Depends on @hyperframes/parsers (PR #1755).
miguel-heygen
added a commit
that referenced
this pull request
Jun 27, 2026
* refactor: extract @hyperframes/lint package from core Moves all lint rules, hyperframeLinter, lintProject, and related types from packages/core/src/lint/ into a new standalone packages/lint package. Core keeps a thin re-export stub at @hyperframes/core/lint for backward compatibility. Consumer imports (cli lint command, producer hyperframeLint) are updated to import from @hyperframes/lint directly. Depends on @hyperframes/parsers (PR #1755). * fix: restore postcss-selector-parser in core (sourceMutation.ts still uses it) * fix(ci): add parsers+lint to Dockerfile and build before preview tests * chore: update bun.lock after restoring postcss-selector-parser dep * test(cli): update lintProject test for string-dir signature from @hyperframes/lint * refactor(core): single-source the lint engine in @hyperframes/lint Delete core's byte-identical copy of the lint rule engine and re-point staticGuard at @hyperframes/lint, so the render-time render-gate and the studio preview share one rule engine instead of two copies that could silently diverge. Back-compat preserved via the @hyperframes/core/lint stub. Addresses review feedback on the dual-copy footgun.
miguel-heygen
added a commit
that referenced
this pull request
Jun 27, 2026
* refactor: extract @hyperframes/studio-server package from core Moves all studio-api routes, helpers, and Hono server wiring from packages/core/src/studio-api/ into a new standalone packages/studio-server package (@hyperframes/studio-server). Core keeps thin re-export stubs at @hyperframes/core/studio-api and the subpath helpers (screenshot-clip, draft-markers, etc.) for backward compatibility. Consumer imports (cli studioServer, vite adapter/config, producer htmlCompiler, studio manualEditsTypes) are updated to import from @hyperframes/studio-server directly. Also exports rewriteInlineStyleAssetUrls from @hyperframes/core root (was in compiler/rewriteSubCompPaths.ts but not re-exported), required by @hyperframes/studio-server/helpers/subComposition. Removes postcss-selector-parser from @hyperframes/core dependencies (moved to @hyperframes/studio-server which owns the routes that used it). Depends on @hyperframes/parsers (PR #1755). * fix(ci): add parsers+studio-server to Dockerfile and build before preview tests * fix(ci): build @hyperframes/studio-server before Test and studio load smoke Studio's vite.config.ts imports @hyperframes/studio-server, which resolves via its "node" export condition to built dist. The Test and studio-load-smoke jobs only built parsers + core, so esbuild's config load failed to resolve the package entry. Build studio-server too. * fix(studio): repoint sdkCutoverParity test import to studio-server sourceMutation moved from core's studio-api to @hyperframes/studio-server; the test still imported the deleted core path. This was masked while studio's vite.config failed to load (couldn't resolve studio-server); now that the config loads, the test runs and the stale import surfaced.
3 tasks
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
Extracts the GSAP parser/writer suite, HTML parser, hf-ids, spring-ease, and the shared composition data types out of
@hyperframes/core/src/parsers/into a new, independently-publishable@hyperframes/parserspackage.This is the foundation of the #1749 effort: make HyperFrames' parsing/linting/validation usable as plain libraries in a Node app, without shelling out to the CLI. Parsers is the standalone base every other extracted package builds on.
Part 1 of 3 — splits #1754 into independently-reviewable pieces. Parts 2 (lint) and 3 (studio-server) stack on this branch.
What moves
src/parsers/→packages/parsers/src/)The big movers:
gsapParser/gsapParserAcorn(the recast + acorn dual parsers),gsapWriterAcorn,gsapSerialize,gsapUnroll,htmlParser,hfIds,springEase,stableIds, plus the__goldens__corpus.Bundle footprint of the new package
dist/(unpacked)dist/index.jsgsapWriterAcorn.js93 KB ·gsapParser.js91 KBMost of the weight is the GSAP AST machinery (recast/babel/acorn). It's tree-shakeable via subpath entries (
@hyperframes/parsers/hf-ids,/gsap-constants, etc.) so a consumer that only needshf-ids(2 KB) doesn't pull the parsers.How
@hyperframes/corechangesThe interesting part: core sheds its entire AST toolchain.
dependencies@babel/parser,acorn,acorn-walk,magic-string,recast@hyperframes/parsers,linkedomBefore this PR, importing
@hyperframes/coreat all dragged in babel + recast + acorn just to construct types. Now those live behind@hyperframes/parsers, and a consumer that only wants core's runtime/compiler types never resolves the parser stack. Core keeps thin@deprecatedre-export stubs at the old subpaths (@hyperframes/core/gsap-parser,/gsap-constants, …) so nothing downstream breaks.Design notes
"bun"export condition before"node"in every package export. Bun resolves the TypeScript source directly (no pre-builtdist/), while Node/tsx/Docker contexts fall through to"node"→dist/. This keeps the dev loop zero-build while published artifacts stay Node-consumable.@hyperframes/parsersis standalone — zero@hyperframes/*dependencies — so it can be the base of the stack.Test plan
bun run --filter @hyperframes/parsers test— 660 tests passbun run --filter @hyperframes/sdk test— 382 tests passbun run build— full monorepo build succeeds