mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-11-18 16:08:56 +00:00
* fix(producer): local renders bring in only media, font, CSS and JS from outside the project Local renders (`render`, range render, `benchmark`, the Studio server and the Vite Studio adapter) run with allowOutsideProjectAssets, which copied every existing file that markup named outside the project into compiled/hf-ext, of any type and from any folder, and served project links that lead outside without looking at where they lead. Publish already applies a policy here: outside references are kept, private locations are left out, and only image, video, audio, font, CSS and JS files are copied. Local renders now follow the same policy. The publish predicates (private location, copied file type, left-out wording) move from the CLI to a new `@hyperframes/studio-server/outside-file` subpath, since the producer cannot import the CLI and already depends on studio-server. The CLI re-exports them, so publish behaves as before. The media extension sets move with them because the copied-type list includes them. The producer decides with one predicate, `outsideAssetRefusal` in utils/paths.ts, and applies it wherever allowOutsideProjectAssets lets an outside file in, so no entry point can skip it: - collectExternalAssets: src/href/url() references, which covers <a href> and <link href> - dropMediaOutsideProject: video/audio/image sources in any spelling the media resolver accepts (file: URLs, percent-encoding), so nothing probes or extracts them - the render file server: project links that lead outside - the distributed plan's project copy: the same links (range render) - GIF/HEIC prep and sub-composition links: private locations only, since those inputs are converted or compiled rather than copied as they are Each left-out file logs the publish wording with "left out of the render". To reproduce on main: a project whose index.html references ../../.ssh/id_key through <link href>, <a href> and url(), with a project link to a file in .ssh, rendered locally, gets those files copied into compiled/hf-ext and served. Comment lines: the four in studio-server's outsideFile.ts moved verbatim from the CLI files they replace. Two are new, in utils/paths.ts. The one on outsideAssetRefusal states the policy once, so its six call sites carry no comment. The one on refusesOutsideLink says its boolean means "refused, and already warned", which the name alone does not say. Comment ratchet is clean. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(cli): keep outsideFileType as a re-export of the shared module The base repository's deletion guard rejects removing a file that exists on main unless git pairs it as a rename. outsideFileType.ts moved into studio-server/outside-file with enough added around it that git no longer pairs the two, so CI's "Reject accidental file deletions" step failed. The file stays as a two-name re-export and publish keeps importing from it, so publishProject.ts and its file-type test are back to main. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * chore(producer): raise the unpacked size budgets for the outside-file policy CI's packed-manifest check measured @hyperframes/producer at 3,244,665 bytes unpacked (budget 3,210,000) and @hyperframes/studio-server at 653,506 (budget 646,000), both just past the 1% tolerance. Both packages were already at the edge on main. Measured locally with npm pack --dry-run, main is 3,237,162 for producer and 652,502 for studio-server, so studio-server on main is already at its ceiling. This branch adds about 7.9 KB unpacked to producer, because the new checks sit in the compiler, render stages and file server, which each producer entry bundles. It adds about 5.5 KB to studio-server for the new outside-file entry and its declarations. No source maps, tests or assets were added to either tarball. The budgets go to 3,245,000 and 654,000, just above CI's measurements, the same way #7579 raised producer's budget for the project-folder checks. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(producer): apply the outside-file policy to embedded local fonts A project font file that links outside the project is now left out of font embedding with the same warning the file server gives, instead of being inlined into the compiled HTML. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>