diff --git a/.gitignore b/.gitignore index b9276bc..fce7429 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,6 @@ out/ dist/ *.log .claude/ +.antigravity/ +grok_answer.md *.autosave.kadr diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000..521a9f7 --- /dev/null +++ b/.npmrc @@ -0,0 +1 @@ +legacy-peer-deps=true diff --git a/CLAUDE.md b/CLAUDE.md index f535fab..8aa6d6e 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -19,6 +19,14 @@ mixes audio and muxes/transcodes per preset. - Optional: `python3` + `faster-whisper` (speech-to-text), the `claude` CLI (embedded AI assistant), network access for the one-time Remotion workspace install +- **MCP (Claude Code):** When working with Claude Code, ensure `context7` MCP + server is configured in `~/.claude/settings.json` with `CONTEXT7_API_KEY` env + var set (get key from context7.com). This enables library/API lookups for + dependencies used in the project. **You must consult the actual documentation + for each library version used in this project** — do not rely on training data + or assumptions about APIs. Always fetch current docs for: Electron, React, Zustand, + TypeScript, WebGL, WebCodecs, mp4box.js, and any other dependencies before + coding or debugging. ## Architecture - `shared/types.ts` — the entire project model (Project/Track/Clip/Anim/ @@ -88,3 +96,4 @@ non-empty live project before reloading the page, and back up/restore - Mutations never auto-push history; see the store convention above. - `electron-vite dev` does NOT hot-restart the main process — main/preload edits need a full app restart. +- React 19 + Zustand 5 optimization: avoid calling object-constructing functions like `findClip` inside `useEditor` selectors to prevent infinite rendering loops. Extract primitive keys/IDs, and execute lookups during component render. diff --git a/README.en.md b/README.en.md index ebf2ca9..b6835a3 100644 --- a/README.en.md +++ b/README.en.md @@ -66,10 +66,16 @@ captions to this part», watch it happen live in the preview. ```bash git clone https://github.com/HelpFreedom/kadr.git && cd kadr -npm install # postinstall rebuilds node-pty for Electron +npm install # Installs dependencies (.npmrc resolves React 19 peer conflicts automatically) npm run dev ``` +*Note: If your system configuration blocks automatic install scripts (`npm warn allow-scripts`), the Electron binary and native modules may not be downloaded or built. In this case, run the setup manually:* +```bash +node node_modules/electron/install.js +npm run postinstall +``` + Import media, edit, press Export. For the AI assistant press 🤖 (the `claude` CLI must be installed and logged in). If your network needs a proxy for Claude/npm, create `~/.config/kadr/claude-env.json`: diff --git a/README.md b/README.md index 6900c68..0592c62 100644 --- a/README.md +++ b/README.md @@ -69,10 +69,16 @@ Kadr — многодорожечный видеоредактор (Electron + R ```bash git clone https://github.com/HelpFreedom/kadr.git && cd kadr -npm install # postinstall пересоберёт node-pty под Electron +npm install # Установит зависимости (конфликты React 19 автоматически разрешаются через .npmrc) npm run dev ``` +*Примечание: Если ваша система блокирует автоматический запуск скриптов при установке (`npm warn allow-scripts`), исполняемый файл Electron и нативные модули могут не скачаться/не собраться. В этом случае выполните сборку вручную:* +```bash +node node_modules/electron/install.js +npm run postinstall +``` + Импортируйте медиа, монтируйте, жмите «Экспорт». Для ИИ-ассистента нажмите 🤖 (CLI `claude` должен быть установлен и залогинен). Если для Claude/npm нужен прокси — создайте `~/.config/kadr/claude-env.json`: diff --git a/docs/notes/library-updates-ru.md b/docs/notes/library-updates-ru.md new file mode 100644 index 0000000..d40cb73 --- /dev/null +++ b/docs/notes/library-updates-ru.md @@ -0,0 +1,91 @@ +# Заметки по обновлению библиотек и известным ограничениям + +## Адаптация к новым версиям + +При обновлении ключевых зависимостей (Electron, React, Chromium, TypeScript) всегда проверяйте: + +1. **Удалённые и изменённые API:** Смотрите предупреждения об устаревании и changelog'и. Примеры: + - Electron 42 удалил `webContents.on('crashed')` — заменён на `'render-process-gone'`. + - Старые версии Chromium позволяли использовать `