Repository navigation
fix(site-import): upload and re-point imported video sources - #661
Draft
rodrigoc-neu-Lab wants to merge 1 commit into
Draft
rodrigoc-neu-Lab wants to merge 1 commit into
rodrigoc-neu-Lab wants to merge 1 commit into
Conversation
The HTML importer stores a <video>/<source> URL in base.video's `videoUrl` prop, but the site-import asset pipeline only normalised and rewrote `src`, `href` and `srcset`. Imported videos kept their relative path and the file was never uploaded. Add `videoUrl` to the URL-bearing props and make assetPlan.ts the single owner of that list so applyAssetRewrites can no longer drift from it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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
Importing a static site that contains
<video src>or<video><source src>left the video pointing at its original relative path (for examplevideos/bg.mp4). The file was never uploaded, so the published page requested a URL that does not exist.The HTML importer stores a video's URL in the
base.videonode'svideoUrlprop. The site-import asset pipeline only normalised and rewrotesrc,hrefandsrcset, sovideoUrlwas skipped at both steps:buildAssetPlannever recorded the file as an asset, andapplyAssetRewritesnever swapped in the uploaded media URL.This PR:
videoUrlto the URL-bearing node props;assetPlan.tsthe single owner of that list, whichapplyAssetRewrites.tsnow imports. Before, each file declared its own copy, which is how the two could drift apart;PagePlan.nodeFragmentdocs anddocs/features/site-import.md.Found while importing a Webflow export: its background videos (
<video><source src="videos/…mp4">) came through as broken links.Verification
bun run buildbun test(8 failures intoolbar.test.ts/selectorStability.test.tsalso occur on a cleanorigin/maincheckout. Those tests build paths withnew URL(…).pathname, which percent-encodes a space in the checkout path. They are unrelated to this PR.)bun run lintAdded two regression tests, both of which fail without the fix:
assetPlan.test.ts: a page in a subfolder with<video><source src="../videos/bg.mp4">. The test checks thatvideoUrlnormalises to the FileMap key and that the file is recorded as an asset.applyAssetRewrites.test.ts:videoUrlis rewritten to the uploaded media URL.Checklist
🤖 Generated with Claude Code