Code-first video & image, rendered natively on WebGPU.
Generate the npm README from the repository README
okanasl10637d2193c7
diff --git a/.gitignore b/.gitignoreindex 26c1ffa5..82198ef5 100644--- a/.gitignore+++ b/.gitignore@@ -90,3 +90,6 @@ packages/**/models/# Plugin ZIP for the OpenAI plugin directory (pnpm run pack:plugin)gitframes-plugin.zip++# Generated package README, built from the repo root README (scripts/sync-readme.mjs)+packages/gitframes/README.mddiff --git a/package.json b/package.jsonindex c37e74d1..0f31e3d1 100644--- a/package.json+++ b/package.json@@ -11,6 +11,7 @@"generate:effects": "tsx --conditions development scripts/generate-effects.mts","generate:node-renderers": "tsx scripts/generate-node-renderers.mts","sync:effects-catalog": "node scripts/sync-effects-catalog.mjs",+ "sync:readme": "node scripts/sync-readme.mjs","changeset": "changeset","version:packages": "changeset version && node scripts/sync-plugin-version.mjs","sync:plugin-version": "node scripts/sync-plugin-version.mjs",diff --git a/packages/gitframes/README.md b/packages/gitframes/README.mddeleted file mode 100644index a2661bf2..00000000--- a/packages/gitframes/README.md+++ /dev/null@@ -1,78 +0,0 @@-# Gitframes--> **High-Performance WebGPU Rendering Engine & SDK for Programmatic Video, Motion Graphics, Audio DSP, and Neural Conditioning.**--`gitframes` is a code-first video composition SDK built directly on native WebGPU and reactive Signals. It brings Photoshop-grade 2D image processing, After Effects-grade kinetic typography, unified 3D spatial camera motion, procedural audio DSP, and real-time neural vision pipelines into a single, deterministic rendering pipeline.--Unlike browser-dependent frameworks that run inside headless Chromium, Gitframes executes directly on GPU hardware via Dawn / WebGPU in Node.js and in modern WebGPU-enabled browsers—delivering high frame rate rendering with a tiny resource footprint.-------## Installation--```bash-npm install gitframes-# or-pnpm add gitframes-```--### System Requirements-- Node.js >= 22-- WebGPU-capable GPU / drivers (Metal on macOS, Vulkan/DirectX on Linux & Windows)-------## Quickstart--```typescript-import { Composition, Layer, LayerAnimation } from "gitframes";--// 1. Create a 1080p, 60 FPS composition-const comp = new Composition({- width: 1920,- height: 1080,- fps: 60,- durationFrames: 180,-});--// 2. Add background-comp.add(- Layer.box({- width: "100%",- height: "100%",- background: "#0a0a0f",- })-);--// 3. Add animated typography-comp.add(- Layer.text("Build with Gitframes", {- fontSize: 72,- fill: "#ffffff",- fontFamily: "Inter",- align: "center",- y: 480,- }).animate(- LayerAnimation.create()- .fadeIn(0, 30, "power2.out")- .fromTo("y", 520, 480, { start: 0, end: 30, ease: "power3.out" })- )-);-```-------## Core Capabilities--- **Slug GPU Vector Typography**: Resolution-independent vector glyph evaluation in WGSL shaders.-- **Photoshop-Grade VFX (50+ Shaders)**: Curves, Levels, Selective Color, 3D LUTs, Film Grain, Vignette, Blur, Depth of Field, SSAO, PBR Glass.-- **Unified 3D Scene Graph**: Position 2D surfaces in 3D coordinate space with 3D cameras, lights, and OBJ/FBX/glTF models.-- **Audio DSP & SFX**: Procedural sound effects (impact, whoosh, riser), audio stem analysis, and audio-reactive signals.-- **Headless GPU Video Rendering**: Direct hardware encoding via `@mediabunny/server` / WebCodecs without headless browser overhead.-- **Live Preview**: `startPreview({ entry, export })` opens a localhost player (soundtrack, waveform timeline, frame stepping). The page runs the composition's own code and renders it with WebGPU in the browser, at or near full frame rate. It serves the page and returns the URL, so an agent can show it in its own browser pane (`open: true` opens the system browser instead). Re-running it replaces the running preview, and an open tab reloads into the new version.-------## License--Apache-2.0diff --git a/packages/gitframes/package.json b/packages/gitframes/package.jsonindex d2bb2a10..b7ce9f7e 100644--- a/packages/gitframes/package.json+++ b/packages/gitframes/package.json@@ -77,9 +77,10 @@"dist/**"],"scripts": {- "build": "tsdown && node scripts/check-dts-bundle.mjs",+ "build": "tsdown && node ../../scripts/sync-readme.mjs && node scripts/check-dts-bundle.mjs","dev": "tsdown --watch","clean": "rm -rf dist .turbo",+ "prepack": "node ../../scripts/sync-readme.mjs","test": "vitest run --passWithNoTests"},"dependencies": {diff --git a/scripts/sync-readme.mjs b/scripts/sync-readme.mjsnew file mode 100644index 00000000..209c74eb--- /dev/null+++ b/scripts/sync-readme.mjs@@ -0,0 +1,65 @@+#!/usr/bin/env node+// npm renders the README that sits beside the package's package.json, while+// GitHub shows the repo root's. Keep one source of truth: generate+// packages/gitframes/README.md from the root README, rewriting its relative+// asset and repository links to absolute GitHub URLs so images and links+// resolve on npmjs.com (which serves the file with no repo context).+//+// Run by the package's `prepack` (npm and pnpm both run it) and by `pnpm build`.+import { readFileSync, writeFileSync } from "node:fs";+import { dirname, join, resolve } from "node:path";+import { fileURLToPath } from "node:url";++const repoRoot = resolve(dirname(fileURLToPath(import.meta.url)), "..");+const source = join(repoRoot, "README.md");+const target = join(repoRoot, "packages", "gitframes", "README.md");++const pkg = JSON.parse(+ readFileSync(join(repoRoot, "packages", "gitframes", "package.json"), "utf8"),+);+const repo = /github\.com[/:]([^/]+)\/([^/]+?)(?:\.git)?$/.exec(+ pkg.repository?.url ?? pkg.repository ?? "",+);+if (!repo) throw new Error("gitframes: no GitHub repository URL to link to");+const REPO = `https://github.com/${repo[1]}/${repo[2]}`;+const REF = "main";+const RAW = `https://raw.githubusercontent.com/${repo[1]}/${repo[2]}/${REF}/`;+const BLOB = `${REPO}/blob/${REF}/`;++// A path inside the repo: not a URL, protocol-relative, anchor or mailto.+const isRelative = (url) =>+ !!url &&+ !/^[a-z][a-z0-9+.-]*:/i.test(url) &&+ !url.startsWith("//") &&+ !url.startsWith("#");++const clean = (url) => url.replace(/^\.?\//, "");++function rewrite(markdown) {+ return (+ markdown+ .replace(+ /(<img\b[^>]*?\bsrc=)(["'])([^"']+)\2/gi,+ (m, pre, quote, url) =>+ isRelative(url) ? `${pre}${quote}${RAW}${clean(url)}${quote}` : m,+ )+ .replace(/(<a\b[^>]*?\bhref=)(["'])([^"']+)\2/gi, (m, pre, quote, url) =>+ isRelative(url) ? `${pre}${quote}${BLOB}${clean(url)}${quote}` : m,+ )+ .replace(/(!\[[^\]]*\]\()([^)\s]+)(\))/g, (m, pre, url, post) =>+ isRelative(url) ? `${pre}${RAW}${clean(url)}${post}` : m,+ )+ // Any remaining `](target)` is a link, including badge links whose text+ // is itself an image (`[](target)`).+ .replace(/(\]\()([^)\s]+)(\))/g, (m, pre, url, post) =>+ isRelative(url) ? `${pre}${BLOB}${clean(url)}${post}` : m,+ )+ );+}++const readme = readFileSync(source, "utf8");+const generated = `<!-- Generated from README.md by scripts/sync-readme.mjs. Edit that file, not this one. -->\n\n${rewrite(readme)}`;+writeFileSync(target, generated);+console.log(+ `packages/gitframes/README.md ← README.md (${generated.length} bytes)`,+);