diff options
| author | cashmere <cashmere@autistici.org> | 2026-07-28 19:41:16 +0200 |
|---|---|---|
| committer | cashmere <cashmere@autistici.org> | 2026-07-28 19:41:16 +0200 |
| commit | f5a82152394fde4d8f740f664ab7737b82861618 (patch) | |
| tree | 5a51b181abead1ce03d2dbfc12b77918d3be0e1b /script/cross-check.ts | |
| parent | e837e7504379e100ff3b56282577ec67bb88bec9 (diff) | |
| download | opencut-f5a82152394fde4d8f740f664ab7737b82861618.tar.gz | |
feat: GPUI desktop port foundation
- scene crate: full project/scene/element model, serde round-trip
proven against the web SerializedProject shape
- transfer crate: .ocp zip container, cross-compat with web fflate
archives proven in both directions
- storage crate: filesystem project store replacing IndexedDB,
.ocp import/export
- media crate: ffmpeg-next 8 decoder (frames, audio, thumbnails,
waveform summaries)
- playback crate: wall-clock anchored, frame-rounded playback clock
- gpu crate: native texture readback; compositor renders headless
offscreen on Vulkan (spike test)
- flake devshell: rust toolchain, GPUI native deps, ffmpeg dev,
bindgen clang args; GPUI hello-world builds
- port plan in notes/gpui-port.md
Diffstat (limited to 'script/cross-check.ts')
| -rw-r--r-- | script/cross-check.ts | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/script/cross-check.ts b/script/cross-check.ts new file mode 100644 index 00000000..4ea430ba --- /dev/null +++ b/script/cross-check.ts @@ -0,0 +1,49 @@ +import { readFileSync, writeFileSync } from "node:fs"; +import { + buildProjectArchive, + parseProjectArchive, +} from "../apps/web/src/project/transfer/container"; + +const direction = process.argv[2]; + +if (direction === "build") { + const projectJson = JSON.stringify({ + version: 7, + metadata: { id: "web-built" }, + nested: { value: 42 }, + }); + const archive = buildProjectArchive({ + projectJson, + media: [ + { + metadata: { + id: "web-asset", + name: "web clip.mov", + mediaType: "video", + fileType: "video/quicktime", + lastModified: 1_753_000_000_000, + width: 1280, + height: 720, + duration: 3.25, + }, + data: new Uint8Array([9, 8, 7, 6]), + }, + ], + }); + writeFileSync("/tmp/web-built.ocp", archive); + console.log("web-built.ocp written"); +} else if (direction === "parse") { + const archive = readFileSync("/tmp/rust-built.ocp"); + const parsed = parseProjectArchive({ archive }); + console.log( + JSON.stringify({ + project: parsed.project, + media: parsed.media, + firstBytes: Array.from( + parsed.readMediaData({ entry: parsed.media[0]?.entry ?? "" }), + ), + }), + ); +} else { + throw new Error("usage: bun cross-check.ts build|parse"); +} |
