diff --git a/.eslintrc.cjs b/.eslintrc.cjs new file mode 100644 index 0000000..340174b --- /dev/null +++ b/.eslintrc.cjs @@ -0,0 +1,5 @@ +/** @type {import("eslint").Linter.Config} */ +module.exports = { + ...require("@remotion/eslint-config"), + ignorePatterns: ["dist/**", "node_modules/**", "docs/**"], +}; diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8a46e73..18610a4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,6 +33,31 @@ jobs: - name: Build run: npm run build + test: + runs-on: ubuntu-latest + needs: build + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 20 + cache: npm + - run: npm ci + - run: npm test + - run: npm run validate:docs + + studio-smoke: + runs-on: ubuntu-latest + needs: build + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 20 + cache: npm + - run: npm ci + - run: npx remotion compositions + lint: runs-on: ubuntu-latest @@ -50,7 +75,8 @@ jobs: run: npm ci - name: Lint - run: npx eslint src --ext .ts,.tsx || true + continue-on-error: true + run: npm run lint pages: runs-on: ubuntu-latest diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..169001d --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,56 @@ +# Cursor Cloud / agent instructions + +## Update script (VM startup) + +```bash +npm install +``` + +## Develop + +```bash +npm install +npm run build +npm start +``` + +Remotion Studio loads **14** demo compositions from `src/studio/`. + +## Preview server + +```bash +npm run build +npm run preview:web +``` + +Open http://localhost:3456 — upload **audio** (uses `POST /api/process` + STT env keys) or **caption JSON**. + +## Tests & checks + +```bash +npm test +npx tsc --noEmit +npx remotion compositions +npm run validate:docs +``` + +## Environment variables + +| Variable | Purpose | +|----------|---------| +| `GROQ_API_KEY` | Groq Whisper STT | +| `OPENAI_API_KEY` | OpenAI Whisper + `captioneer translate` | +| `DEEPGRAM_API_KEY` | Deepgram STT | +| `ASSEMBLYAI_API_KEY` | AssemblyAI STT | + +Local whisper: `captioneer process audio.mp4 --provider local` (requires whisper.cpp setup). + +## Design (docs & preview UI) + +Marketing and preview surfaces use a neutral zinc palette with a single blue accent (`#3b82f6`). Shared tokens live in `docs/theme.css`; the preview server inlines matching CSS variables. Avoid purple/gold gradients and emoji-heavy headings in new UI. + +## Architecture + +See [docs/PROJECT_PLAN.md](docs/PROJECT_PLAN.md). + +Node-only imports: `remotion-captioneer/node` (STT, export, translate). diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d14475d..94fa20e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -23,15 +23,23 @@ npm start ## Project Structure +See [docs/PROJECT_PLAN.md](docs/PROJECT_PLAN.md) for how surfaces connect. + ``` src/ -├── components/ # Caption style components -├── types.ts # TypeScript type definitions -├── utils.ts # Timing/frame utilities -├── whisper.ts # Whisper.cpp integration -├── cli.ts # CLI tool -├── Root.tsx # Remotion compositions -└── index.ts # Public exports +├── components/ # 14 caption style components + AnimatedCaptions +├── caption-styles.ts # CAPTION_STYLES (single list) +├── demo/captions.ts # Shared demo CaptionData +├── providers/ # Cloud STT providers + registry +├── sync/ # Audio analysis + hooks +├── templates/ # Template builder + renderer +├── layouts/ # Layout primitives +├── presets/ # Style presets +├── cli.ts # CLI (captioneer) +├── preview-server.ts # Browser preview (captioneer preview) +├── remotion-entry.tsx# Remotion registerRoot entry +├── Root.tsx # Studio demo compositions (all styles) +└── index.ts # npm package exports ``` ## Adding a New Caption Style @@ -40,9 +48,10 @@ src/ 2. It receives `captions: CaptionData` and renders animated words 3. Use `useCurrentFrame()` + `useVideoConfig()` to get timing 4. Export it from `src/components/index.ts` -5. Add it to the `styleMap` in `AnimatedCaptions.tsx` -6. Add a demo composition in `Root.tsx` -7. Update the README +5. Add it to `CaptionStyle` in `types.ts` and `CAPTION_STYLES` in `caption-styles.ts` +6. Add it to the `styleMap` in `AnimatedCaptions.tsx` +7. Studio picks it up automatically via `Root.tsx` (no manual composition per style) +8. Update preview-server ` @@ -203,6 +240,7 @@ const HTML_TEMPLATE = ` + @@ -211,17 +249,17 @@ const HTML_TEMPLATE = ` - + +
-
🎙️
- Drop audio file or click to upload -

MP3, WAV, M4A, MP4, OGG

- +

Drop audio or caption JSON

+

MP3, WAV, M4A, MP4, or caption JSON

+
@@ -238,8 +276,8 @@ const HTML_TEMPLATE = `