@vibeframe/cli 0.27.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +4 -0
- package/.turbo/turbo-lint.log +21 -0
- package/.turbo/turbo-test.log +689 -0
- package/dist/agent/adapters/claude.d.ts +15 -0
- package/dist/agent/adapters/claude.d.ts.map +1 -0
- package/dist/agent/adapters/claude.js +119 -0
- package/dist/agent/adapters/claude.js.map +1 -0
- package/dist/agent/adapters/gemini.d.ts +15 -0
- package/dist/agent/adapters/gemini.d.ts.map +1 -0
- package/dist/agent/adapters/gemini.js +132 -0
- package/dist/agent/adapters/gemini.js.map +1 -0
- package/dist/agent/adapters/index.d.ts +27 -0
- package/dist/agent/adapters/index.d.ts.map +1 -0
- package/dist/agent/adapters/index.js +38 -0
- package/dist/agent/adapters/index.js.map +1 -0
- package/dist/agent/adapters/ollama.d.ts +20 -0
- package/dist/agent/adapters/ollama.d.ts.map +1 -0
- package/dist/agent/adapters/ollama.js +186 -0
- package/dist/agent/adapters/ollama.js.map +1 -0
- package/dist/agent/adapters/openai.d.ts +15 -0
- package/dist/agent/adapters/openai.d.ts.map +1 -0
- package/dist/agent/adapters/openai.js +92 -0
- package/dist/agent/adapters/openai.js.map +1 -0
- package/dist/agent/adapters/xai.d.ts +15 -0
- package/dist/agent/adapters/xai.d.ts.map +1 -0
- package/dist/agent/adapters/xai.js +95 -0
- package/dist/agent/adapters/xai.js.map +1 -0
- package/dist/agent/index.d.ts +69 -0
- package/dist/agent/index.d.ts.map +1 -0
- package/dist/agent/index.js +180 -0
- package/dist/agent/index.js.map +1 -0
- package/dist/agent/memory/index.d.ts +70 -0
- package/dist/agent/memory/index.d.ts.map +1 -0
- package/dist/agent/memory/index.js +132 -0
- package/dist/agent/memory/index.js.map +1 -0
- package/dist/agent/prompts/system.d.ts +6 -0
- package/dist/agent/prompts/system.d.ts.map +1 -0
- package/dist/agent/prompts/system.js +103 -0
- package/dist/agent/prompts/system.js.map +1 -0
- package/dist/agent/tools/ai-editing.d.ts +15 -0
- package/dist/agent/tools/ai-editing.d.ts.map +1 -0
- package/dist/agent/tools/ai-editing.js +763 -0
- package/dist/agent/tools/ai-editing.js.map +1 -0
- package/dist/agent/tools/ai-generation.d.ts +13 -0
- package/dist/agent/tools/ai-generation.d.ts.map +1 -0
- package/dist/agent/tools/ai-generation.js +973 -0
- package/dist/agent/tools/ai-generation.js.map +1 -0
- package/dist/agent/tools/ai-pipeline.d.ts +14 -0
- package/dist/agent/tools/ai-pipeline.d.ts.map +1 -0
- package/dist/agent/tools/ai-pipeline.js +961 -0
- package/dist/agent/tools/ai-pipeline.js.map +1 -0
- package/dist/agent/tools/ai.d.ts +13 -0
- package/dist/agent/tools/ai.d.ts.map +1 -0
- package/dist/agent/tools/ai.js +19 -0
- package/dist/agent/tools/ai.js.map +1 -0
- package/dist/agent/tools/batch.d.ts +6 -0
- package/dist/agent/tools/batch.d.ts.map +1 -0
- package/dist/agent/tools/batch.js +383 -0
- package/dist/agent/tools/batch.js.map +1 -0
- package/dist/agent/tools/e2e.test.d.ts +26 -0
- package/dist/agent/tools/e2e.test.d.ts.map +1 -0
- package/dist/agent/tools/e2e.test.js +397 -0
- package/dist/agent/tools/e2e.test.js.map +1 -0
- package/dist/agent/tools/export.d.ts +6 -0
- package/dist/agent/tools/export.d.ts.map +1 -0
- package/dist/agent/tools/export.js +171 -0
- package/dist/agent/tools/export.js.map +1 -0
- package/dist/agent/tools/filesystem.d.ts +6 -0
- package/dist/agent/tools/filesystem.d.ts.map +1 -0
- package/dist/agent/tools/filesystem.js +212 -0
- package/dist/agent/tools/filesystem.js.map +1 -0
- package/dist/agent/tools/index.d.ts +65 -0
- package/dist/agent/tools/index.d.ts.map +1 -0
- package/dist/agent/tools/index.js +120 -0
- package/dist/agent/tools/index.js.map +1 -0
- package/dist/agent/tools/integration.test.d.ts +11 -0
- package/dist/agent/tools/integration.test.d.ts.map +1 -0
- package/dist/agent/tools/integration.test.js +659 -0
- package/dist/agent/tools/integration.test.js.map +1 -0
- package/dist/agent/tools/media.d.ts +6 -0
- package/dist/agent/tools/media.d.ts.map +1 -0
- package/dist/agent/tools/media.js +616 -0
- package/dist/agent/tools/media.js.map +1 -0
- package/dist/agent/tools/project.d.ts +6 -0
- package/dist/agent/tools/project.d.ts.map +1 -0
- package/dist/agent/tools/project.js +284 -0
- package/dist/agent/tools/project.js.map +1 -0
- package/dist/agent/tools/timeline.d.ts +6 -0
- package/dist/agent/tools/timeline.d.ts.map +1 -0
- package/dist/agent/tools/timeline.js +873 -0
- package/dist/agent/tools/timeline.js.map +1 -0
- package/dist/agent/types.d.ts +59 -0
- package/dist/agent/types.d.ts.map +1 -0
- package/dist/agent/types.js +5 -0
- package/dist/agent/types.js.map +1 -0
- package/dist/commands/agent.d.ts +21 -0
- package/dist/commands/agent.d.ts.map +1 -0
- package/dist/commands/agent.js +290 -0
- package/dist/commands/agent.js.map +1 -0
- package/dist/commands/ai-analyze.d.ts +106 -0
- package/dist/commands/ai-analyze.d.ts.map +1 -0
- package/dist/commands/ai-analyze.js +327 -0
- package/dist/commands/ai-analyze.js.map +1 -0
- package/dist/commands/ai-animated-caption.d.ts +64 -0
- package/dist/commands/ai-animated-caption.d.ts.map +1 -0
- package/dist/commands/ai-animated-caption.js +272 -0
- package/dist/commands/ai-animated-caption.js.map +1 -0
- package/dist/commands/ai-audio.d.ts +20 -0
- package/dist/commands/ai-audio.d.ts.map +1 -0
- package/dist/commands/ai-audio.js +808 -0
- package/dist/commands/ai-audio.js.map +1 -0
- package/dist/commands/ai-broll.d.ts +15 -0
- package/dist/commands/ai-broll.d.ts.map +1 -0
- package/dist/commands/ai-broll.js +406 -0
- package/dist/commands/ai-broll.js.map +1 -0
- package/dist/commands/ai-edit-cli.d.ts +14 -0
- package/dist/commands/ai-edit-cli.d.ts.map +1 -0
- package/dist/commands/ai-edit-cli.js +579 -0
- package/dist/commands/ai-edit-cli.js.map +1 -0
- package/dist/commands/ai-edit.d.ts +398 -0
- package/dist/commands/ai-edit.d.ts.map +1 -0
- package/dist/commands/ai-edit.js +1019 -0
- package/dist/commands/ai-edit.js.map +1 -0
- package/dist/commands/ai-fill-gaps.d.ts +14 -0
- package/dist/commands/ai-fill-gaps.d.ts.map +1 -0
- package/dist/commands/ai-fill-gaps.js +451 -0
- package/dist/commands/ai-fill-gaps.js.map +1 -0
- package/dist/commands/ai-helpers.d.ts +20 -0
- package/dist/commands/ai-helpers.d.ts.map +1 -0
- package/dist/commands/ai-helpers.js +59 -0
- package/dist/commands/ai-helpers.js.map +1 -0
- package/dist/commands/ai-highlights.d.ts +127 -0
- package/dist/commands/ai-highlights.d.ts.map +1 -0
- package/dist/commands/ai-highlights.js +1026 -0
- package/dist/commands/ai-highlights.js.map +1 -0
- package/dist/commands/ai-image.d.ts +34 -0
- package/dist/commands/ai-image.d.ts.map +1 -0
- package/dist/commands/ai-image.js +653 -0
- package/dist/commands/ai-image.js.map +1 -0
- package/dist/commands/ai-motion.d.ts +50 -0
- package/dist/commands/ai-motion.d.ts.map +1 -0
- package/dist/commands/ai-motion.js +271 -0
- package/dist/commands/ai-motion.js.map +1 -0
- package/dist/commands/ai-narrate.d.ts +66 -0
- package/dist/commands/ai-narrate.d.ts.map +1 -0
- package/dist/commands/ai-narrate.js +329 -0
- package/dist/commands/ai-narrate.js.map +1 -0
- package/dist/commands/ai-review.d.ts +57 -0
- package/dist/commands/ai-review.d.ts.map +1 -0
- package/dist/commands/ai-review.js +251 -0
- package/dist/commands/ai-review.js.map +1 -0
- package/dist/commands/ai-script-pipeline-cli.d.ts +9 -0
- package/dist/commands/ai-script-pipeline-cli.d.ts.map +1 -0
- package/dist/commands/ai-script-pipeline-cli.js +1494 -0
- package/dist/commands/ai-script-pipeline-cli.js.map +1 -0
- package/dist/commands/ai-script-pipeline.d.ts +259 -0
- package/dist/commands/ai-script-pipeline.d.ts.map +1 -0
- package/dist/commands/ai-script-pipeline.js +1027 -0
- package/dist/commands/ai-script-pipeline.js.map +1 -0
- package/dist/commands/ai-suggest-edit.d.ts +14 -0
- package/dist/commands/ai-suggest-edit.d.ts.map +1 -0
- package/dist/commands/ai-suggest-edit.js +220 -0
- package/dist/commands/ai-suggest-edit.js.map +1 -0
- package/dist/commands/ai-video-fx.d.ts +14 -0
- package/dist/commands/ai-video-fx.d.ts.map +1 -0
- package/dist/commands/ai-video-fx.js +395 -0
- package/dist/commands/ai-video-fx.js.map +1 -0
- package/dist/commands/ai-video.d.ts +15 -0
- package/dist/commands/ai-video.d.ts.map +1 -0
- package/dist/commands/ai-video.js +785 -0
- package/dist/commands/ai-video.js.map +1 -0
- package/dist/commands/ai-viral.d.ts +15 -0
- package/dist/commands/ai-viral.d.ts.map +1 -0
- package/dist/commands/ai-viral.js +519 -0
- package/dist/commands/ai-viral.js.map +1 -0
- package/dist/commands/ai-visual-fx.d.ts +14 -0
- package/dist/commands/ai-visual-fx.d.ts.map +1 -0
- package/dist/commands/ai-visual-fx.js +505 -0
- package/dist/commands/ai-visual-fx.js.map +1 -0
- package/dist/commands/ai.d.ts +38 -0
- package/dist/commands/ai.d.ts.map +1 -0
- package/dist/commands/ai.js +225 -0
- package/dist/commands/ai.js.map +1 -0
- package/dist/commands/ai.test.d.ts +2 -0
- package/dist/commands/ai.test.d.ts.map +1 -0
- package/dist/commands/ai.test.js +554 -0
- package/dist/commands/ai.test.js.map +1 -0
- package/dist/commands/analyze.d.ts +16 -0
- package/dist/commands/analyze.d.ts.map +1 -0
- package/dist/commands/analyze.js +247 -0
- package/dist/commands/analyze.js.map +1 -0
- package/dist/commands/audio.d.ts +18 -0
- package/dist/commands/audio.d.ts.map +1 -0
- package/dist/commands/audio.js +539 -0
- package/dist/commands/audio.js.map +1 -0
- package/dist/commands/batch.d.ts +3 -0
- package/dist/commands/batch.d.ts.map +1 -0
- package/dist/commands/batch.js +366 -0
- package/dist/commands/batch.js.map +1 -0
- package/dist/commands/batch.test.d.ts +2 -0
- package/dist/commands/batch.test.d.ts.map +1 -0
- package/dist/commands/batch.test.js +203 -0
- package/dist/commands/batch.test.js.map +1 -0
- package/dist/commands/detect.d.ts +3 -0
- package/dist/commands/detect.d.ts.map +1 -0
- package/dist/commands/detect.js +273 -0
- package/dist/commands/detect.js.map +1 -0
- package/dist/commands/doctor.d.ts +6 -0
- package/dist/commands/doctor.d.ts.map +1 -0
- package/dist/commands/doctor.js +191 -0
- package/dist/commands/doctor.js.map +1 -0
- package/dist/commands/edit-cmd.d.ts +26 -0
- package/dist/commands/edit-cmd.d.ts.map +1 -0
- package/dist/commands/edit-cmd.js +870 -0
- package/dist/commands/edit-cmd.js.map +1 -0
- package/dist/commands/export.d.ts +39 -0
- package/dist/commands/export.d.ts.map +1 -0
- package/dist/commands/export.js +730 -0
- package/dist/commands/export.js.map +1 -0
- package/dist/commands/generate.d.ts +25 -0
- package/dist/commands/generate.d.ts.map +1 -0
- package/dist/commands/generate.js +1885 -0
- package/dist/commands/generate.js.map +1 -0
- package/dist/commands/media.d.ts +3 -0
- package/dist/commands/media.d.ts.map +1 -0
- package/dist/commands/media.js +165 -0
- package/dist/commands/media.js.map +1 -0
- package/dist/commands/output.d.ts +45 -0
- package/dist/commands/output.d.ts.map +1 -0
- package/dist/commands/output.js +122 -0
- package/dist/commands/output.js.map +1 -0
- package/dist/commands/pipeline.d.ts +19 -0
- package/dist/commands/pipeline.d.ts.map +1 -0
- package/dist/commands/pipeline.js +345 -0
- package/dist/commands/pipeline.js.map +1 -0
- package/dist/commands/project.d.ts +3 -0
- package/dist/commands/project.d.ts.map +1 -0
- package/dist/commands/project.js +139 -0
- package/dist/commands/project.js.map +1 -0
- package/dist/commands/project.test.d.ts +2 -0
- package/dist/commands/project.test.d.ts.map +1 -0
- package/dist/commands/project.test.js +105 -0
- package/dist/commands/project.test.js.map +1 -0
- package/dist/commands/sanitize.d.ts +21 -0
- package/dist/commands/sanitize.d.ts.map +1 -0
- package/dist/commands/sanitize.js +56 -0
- package/dist/commands/sanitize.js.map +1 -0
- package/dist/commands/schema.d.ts +11 -0
- package/dist/commands/schema.d.ts.map +1 -0
- package/dist/commands/schema.js +101 -0
- package/dist/commands/schema.js.map +1 -0
- package/dist/commands/setup.d.ts +6 -0
- package/dist/commands/setup.d.ts.map +1 -0
- package/dist/commands/setup.js +440 -0
- package/dist/commands/setup.js.map +1 -0
- package/dist/commands/timeline.d.ts +3 -0
- package/dist/commands/timeline.d.ts.map +1 -0
- package/dist/commands/timeline.js +469 -0
- package/dist/commands/timeline.js.map +1 -0
- package/dist/commands/timeline.test.d.ts +2 -0
- package/dist/commands/timeline.test.d.ts.map +1 -0
- package/dist/commands/timeline.test.js +320 -0
- package/dist/commands/timeline.test.js.map +1 -0
- package/dist/commands/validate.d.ts +32 -0
- package/dist/commands/validate.d.ts.map +1 -0
- package/dist/commands/validate.js +63 -0
- package/dist/commands/validate.js.map +1 -0
- package/dist/config/config.test.d.ts +2 -0
- package/dist/config/config.test.d.ts.map +1 -0
- package/dist/config/config.test.js +164 -0
- package/dist/config/config.test.js.map +1 -0
- package/dist/config/index.d.ts +35 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +101 -0
- package/dist/config/index.js.map +1 -0
- package/dist/config/schema.d.ts +43 -0
- package/dist/config/schema.d.ts.map +1 -0
- package/dist/config/schema.js +42 -0
- package/dist/config/schema.js.map +1 -0
- package/dist/engine/index.d.ts +3 -0
- package/dist/engine/index.d.ts.map +1 -0
- package/dist/engine/index.js +2 -0
- package/dist/engine/index.js.map +1 -0
- package/dist/engine/project.d.ts +84 -0
- package/dist/engine/project.d.ts.map +1 -0
- package/dist/engine/project.js +355 -0
- package/dist/engine/project.js.map +1 -0
- package/dist/engine/project.test.d.ts +2 -0
- package/dist/engine/project.test.d.ts.map +1 -0
- package/dist/engine/project.test.js +599 -0
- package/dist/engine/project.test.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +131 -0
- package/dist/index.js.map +1 -0
- package/dist/utils/api-key.d.ts +36 -0
- package/dist/utils/api-key.d.ts.map +1 -0
- package/dist/utils/api-key.js +211 -0
- package/dist/utils/api-key.js.map +1 -0
- package/dist/utils/api-key.test.d.ts +2 -0
- package/dist/utils/api-key.test.d.ts.map +1 -0
- package/dist/utils/api-key.test.js +35 -0
- package/dist/utils/api-key.test.js.map +1 -0
- package/dist/utils/audio.d.ts +23 -0
- package/dist/utils/audio.d.ts.map +1 -0
- package/dist/utils/audio.js +79 -0
- package/dist/utils/audio.js.map +1 -0
- package/dist/utils/exec-safe.d.ts +22 -0
- package/dist/utils/exec-safe.d.ts.map +1 -0
- package/dist/utils/exec-safe.js +62 -0
- package/dist/utils/exec-safe.js.map +1 -0
- package/dist/utils/first-run.d.ts +13 -0
- package/dist/utils/first-run.d.ts.map +1 -0
- package/dist/utils/first-run.js +48 -0
- package/dist/utils/first-run.js.map +1 -0
- package/dist/utils/provider-resolver.d.ts +15 -0
- package/dist/utils/provider-resolver.d.ts.map +1 -0
- package/dist/utils/provider-resolver.js +42 -0
- package/dist/utils/provider-resolver.js.map +1 -0
- package/dist/utils/remotion.d.ts +210 -0
- package/dist/utils/remotion.d.ts.map +1 -0
- package/dist/utils/remotion.js +731 -0
- package/dist/utils/remotion.js.map +1 -0
- package/dist/utils/subtitle.d.ts +65 -0
- package/dist/utils/subtitle.d.ts.map +1 -0
- package/dist/utils/subtitle.js +135 -0
- package/dist/utils/subtitle.js.map +1 -0
- package/dist/utils/subtitle.test.d.ts +2 -0
- package/dist/utils/subtitle.test.d.ts.map +1 -0
- package/dist/utils/subtitle.test.js +175 -0
- package/dist/utils/subtitle.test.js.map +1 -0
- package/dist/utils/tty.d.ts +45 -0
- package/dist/utils/tty.d.ts.map +1 -0
- package/dist/utils/tty.js +172 -0
- package/dist/utils/tty.js.map +1 -0
- package/package.json +102 -0
- package/src/agent/adapters/claude.ts +143 -0
- package/src/agent/adapters/gemini.ts +159 -0
- package/src/agent/adapters/index.ts +61 -0
- package/src/agent/adapters/ollama.ts +231 -0
- package/src/agent/adapters/openai.ts +116 -0
- package/src/agent/adapters/xai.ts +119 -0
- package/src/agent/index.ts +251 -0
- package/src/agent/memory/index.ts +151 -0
- package/src/agent/prompts/system.ts +106 -0
- package/src/agent/tools/ai-editing.ts +845 -0
- package/src/agent/tools/ai-generation.ts +1073 -0
- package/src/agent/tools/ai-pipeline.ts +1055 -0
- package/src/agent/tools/ai.ts +21 -0
- package/src/agent/tools/batch.ts +429 -0
- package/src/agent/tools/e2e.test.ts +545 -0
- package/src/agent/tools/export.ts +184 -0
- package/src/agent/tools/filesystem.ts +237 -0
- package/src/agent/tools/index.ts +150 -0
- package/src/agent/tools/integration.test.ts +775 -0
- package/src/agent/tools/media.ts +697 -0
- package/src/agent/tools/project.ts +313 -0
- package/src/agent/tools/timeline.ts +951 -0
- package/src/agent/types.ts +68 -0
- package/src/commands/agent.ts +340 -0
- package/src/commands/ai-analyze.ts +429 -0
- package/src/commands/ai-animated-caption.ts +390 -0
- package/src/commands/ai-audio.ts +941 -0
- package/src/commands/ai-broll.ts +490 -0
- package/src/commands/ai-edit-cli.ts +658 -0
- package/src/commands/ai-edit.ts +1542 -0
- package/src/commands/ai-fill-gaps.ts +566 -0
- package/src/commands/ai-helpers.ts +65 -0
- package/src/commands/ai-highlights.ts +1303 -0
- package/src/commands/ai-image.ts +761 -0
- package/src/commands/ai-motion.ts +347 -0
- package/src/commands/ai-narrate.ts +451 -0
- package/src/commands/ai-review.ts +309 -0
- package/src/commands/ai-script-pipeline-cli.ts +1710 -0
- package/src/commands/ai-script-pipeline.ts +1365 -0
- package/src/commands/ai-suggest-edit.ts +264 -0
- package/src/commands/ai-video-fx.ts +445 -0
- package/src/commands/ai-video.ts +915 -0
- package/src/commands/ai-viral.ts +595 -0
- package/src/commands/ai-visual-fx.ts +601 -0
- package/src/commands/ai.test.ts +627 -0
- package/src/commands/ai.ts +307 -0
- package/src/commands/analyze.ts +282 -0
- package/src/commands/audio.ts +644 -0
- package/src/commands/batch.test.ts +279 -0
- package/src/commands/batch.ts +440 -0
- package/src/commands/detect.ts +329 -0
- package/src/commands/doctor.ts +237 -0
- package/src/commands/edit-cmd.ts +1014 -0
- package/src/commands/export.ts +918 -0
- package/src/commands/generate.ts +2146 -0
- package/src/commands/media.ts +177 -0
- package/src/commands/output.ts +142 -0
- package/src/commands/pipeline.ts +398 -0
- package/src/commands/project.test.ts +127 -0
- package/src/commands/project.ts +149 -0
- package/src/commands/sanitize.ts +60 -0
- package/src/commands/schema.ts +130 -0
- package/src/commands/setup.ts +509 -0
- package/src/commands/timeline.test.ts +499 -0
- package/src/commands/timeline.ts +529 -0
- package/src/commands/validate.ts +77 -0
- package/src/config/config.test.ts +197 -0
- package/src/config/index.ts +125 -0
- package/src/config/schema.ts +82 -0
- package/src/engine/index.ts +2 -0
- package/src/engine/project.test.ts +702 -0
- package/src/engine/project.ts +439 -0
- package/src/index.ts +146 -0
- package/src/utils/api-key.test.ts +41 -0
- package/src/utils/api-key.ts +247 -0
- package/src/utils/audio.ts +83 -0
- package/src/utils/exec-safe.ts +75 -0
- package/src/utils/first-run.ts +52 -0
- package/src/utils/provider-resolver.ts +56 -0
- package/src/utils/remotion.ts +951 -0
- package/src/utils/subtitle.test.ts +227 -0
- package/src/utils/subtitle.ts +169 -0
- package/src/utils/tty.ts +196 -0
- package/tsconfig.json +20 -0
|
@@ -0,0 +1,499 @@
|
|
|
1
|
+
import { describe, it, expect, beforeEach, afterEach } from "vitest";
|
|
2
|
+
import { execSync } from "child_process";
|
|
3
|
+
import { readFileSync, writeFileSync, mkdtempSync, rmSync } from "fs";
|
|
4
|
+
import { join, resolve } from "path";
|
|
5
|
+
import { tmpdir } from "os";
|
|
6
|
+
|
|
7
|
+
const CLI = `npx tsx ${resolve(__dirname, "../index.ts")}`;
|
|
8
|
+
|
|
9
|
+
describe("timeline commands", () => {
|
|
10
|
+
let tempDir: string;
|
|
11
|
+
let projectFile: string;
|
|
12
|
+
let mediaFile: string;
|
|
13
|
+
|
|
14
|
+
beforeEach(() => {
|
|
15
|
+
tempDir = mkdtempSync(join(tmpdir(), "vibe-test-"));
|
|
16
|
+
projectFile = join(tempDir, "test.vibe.json");
|
|
17
|
+
mediaFile = join(tempDir, "sample.mp4");
|
|
18
|
+
|
|
19
|
+
// Create project
|
|
20
|
+
execSync(`${CLI} project create "Timeline Test" -o "${projectFile}"`, {
|
|
21
|
+
cwd: process.cwd(),
|
|
22
|
+
encoding: "utf-8",
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
// Create dummy media file
|
|
26
|
+
writeFileSync(mediaFile, "dummy video content");
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
afterEach(() => {
|
|
30
|
+
rmSync(tempDir, { recursive: true, force: true });
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
describe("timeline add-source", () => {
|
|
34
|
+
it("adds a media source to project", () => {
|
|
35
|
+
execSync(
|
|
36
|
+
`${CLI} timeline add-source "${projectFile}" "${mediaFile}" --duration 10`,
|
|
37
|
+
{ cwd: process.cwd(), encoding: "utf-8" }
|
|
38
|
+
);
|
|
39
|
+
|
|
40
|
+
const content = JSON.parse(readFileSync(projectFile, "utf-8"));
|
|
41
|
+
expect(content.state.sources).toHaveLength(1);
|
|
42
|
+
expect(content.state.sources[0].name).toBe("sample.mp4");
|
|
43
|
+
expect(content.state.sources[0].type).toBe("video");
|
|
44
|
+
expect(content.state.sources[0].duration).toBe(10);
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
it("adds source with custom name", () => {
|
|
48
|
+
execSync(
|
|
49
|
+
`${CLI} timeline add-source "${projectFile}" "${mediaFile}" -n "My Video" -d 5`,
|
|
50
|
+
{ cwd: process.cwd(), encoding: "utf-8" }
|
|
51
|
+
);
|
|
52
|
+
|
|
53
|
+
const content = JSON.parse(readFileSync(projectFile, "utf-8"));
|
|
54
|
+
expect(content.state.sources[0].name).toBe("My Video");
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
it("detects media type from extension", () => {
|
|
58
|
+
const audioFile = join(tempDir, "audio.mp3");
|
|
59
|
+
writeFileSync(audioFile, "dummy audio");
|
|
60
|
+
|
|
61
|
+
execSync(
|
|
62
|
+
`${CLI} timeline add-source "${projectFile}" "${audioFile}" -d 30`,
|
|
63
|
+
{ cwd: process.cwd(), encoding: "utf-8" }
|
|
64
|
+
);
|
|
65
|
+
|
|
66
|
+
const content = JSON.parse(readFileSync(projectFile, "utf-8"));
|
|
67
|
+
expect(content.state.sources[0].type).toBe("audio");
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
describe("timeline add-clip", () => {
|
|
72
|
+
let sourceId: string;
|
|
73
|
+
|
|
74
|
+
beforeEach(() => {
|
|
75
|
+
execSync(
|
|
76
|
+
`${CLI} timeline add-source "${projectFile}" "${mediaFile}" -d 10`,
|
|
77
|
+
{ cwd: process.cwd(), encoding: "utf-8" }
|
|
78
|
+
);
|
|
79
|
+
|
|
80
|
+
const content = JSON.parse(readFileSync(projectFile, "utf-8"));
|
|
81
|
+
sourceId = content.state.sources[0].id;
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
it("adds a clip to timeline", () => {
|
|
85
|
+
execSync(`${CLI} timeline add-clip "${projectFile}" ${sourceId}`, {
|
|
86
|
+
cwd: process.cwd(),
|
|
87
|
+
encoding: "utf-8",
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
const content = JSON.parse(readFileSync(projectFile, "utf-8"));
|
|
91
|
+
expect(content.state.clips).toHaveLength(1);
|
|
92
|
+
expect(content.state.clips[0].sourceId).toBe(sourceId);
|
|
93
|
+
expect(content.state.clips[0].trackId).toBe("video-track-1");
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
it("adds clip with custom start time", () => {
|
|
97
|
+
execSync(
|
|
98
|
+
`${CLI} timeline add-clip "${projectFile}" ${sourceId} --start 5`,
|
|
99
|
+
{ cwd: process.cwd(), encoding: "utf-8" }
|
|
100
|
+
);
|
|
101
|
+
|
|
102
|
+
const content = JSON.parse(readFileSync(projectFile, "utf-8"));
|
|
103
|
+
expect(content.state.clips[0].startTime).toBe(5);
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
it("adds clip with custom duration", () => {
|
|
107
|
+
execSync(
|
|
108
|
+
`${CLI} timeline add-clip "${projectFile}" ${sourceId} --duration 3`,
|
|
109
|
+
{ cwd: process.cwd(), encoding: "utf-8" }
|
|
110
|
+
);
|
|
111
|
+
|
|
112
|
+
const content = JSON.parse(readFileSync(projectFile, "utf-8"));
|
|
113
|
+
expect(content.state.clips[0].duration).toBe(3);
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
it("updates project duration after adding clip", () => {
|
|
117
|
+
execSync(
|
|
118
|
+
`${CLI} timeline add-clip "${projectFile}" ${sourceId} --start 5 --duration 10`,
|
|
119
|
+
{ cwd: process.cwd(), encoding: "utf-8" }
|
|
120
|
+
);
|
|
121
|
+
|
|
122
|
+
const content = JSON.parse(readFileSync(projectFile, "utf-8"));
|
|
123
|
+
expect(content.state.project.duration).toBe(15);
|
|
124
|
+
});
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
describe("timeline add-track", () => {
|
|
128
|
+
it("adds a video track", () => {
|
|
129
|
+
execSync(`${CLI} timeline add-track "${projectFile}" video`, {
|
|
130
|
+
cwd: process.cwd(),
|
|
131
|
+
encoding: "utf-8",
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
const content = JSON.parse(readFileSync(projectFile, "utf-8"));
|
|
135
|
+
expect(content.state.tracks).toHaveLength(3);
|
|
136
|
+
expect(content.state.tracks[2].type).toBe("video");
|
|
137
|
+
expect(content.state.tracks[2].name).toBe("Video 2");
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
it("adds an audio track", () => {
|
|
141
|
+
execSync(`${CLI} timeline add-track "${projectFile}" audio`, {
|
|
142
|
+
cwd: process.cwd(),
|
|
143
|
+
encoding: "utf-8",
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
const content = JSON.parse(readFileSync(projectFile, "utf-8"));
|
|
147
|
+
expect(content.state.tracks).toHaveLength(3);
|
|
148
|
+
expect(content.state.tracks[2].type).toBe("audio");
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
it("adds track with custom name", () => {
|
|
152
|
+
execSync(
|
|
153
|
+
`${CLI} timeline add-track "${projectFile}" video -n "Overlay"`,
|
|
154
|
+
{ cwd: process.cwd(), encoding: "utf-8" }
|
|
155
|
+
);
|
|
156
|
+
|
|
157
|
+
const content = JSON.parse(readFileSync(projectFile, "utf-8"));
|
|
158
|
+
expect(content.state.tracks[2].name).toBe("Overlay");
|
|
159
|
+
});
|
|
160
|
+
});
|
|
161
|
+
|
|
162
|
+
describe("timeline add-effect", () => {
|
|
163
|
+
let clipId: string;
|
|
164
|
+
|
|
165
|
+
beforeEach(() => {
|
|
166
|
+
execSync(
|
|
167
|
+
`${CLI} timeline add-source "${projectFile}" "${mediaFile}" -d 10`,
|
|
168
|
+
{ cwd: process.cwd(), encoding: "utf-8" }
|
|
169
|
+
);
|
|
170
|
+
|
|
171
|
+
let content = JSON.parse(readFileSync(projectFile, "utf-8"));
|
|
172
|
+
const sourceId = content.state.sources[0].id;
|
|
173
|
+
|
|
174
|
+
execSync(`${CLI} timeline add-clip "${projectFile}" ${sourceId}`, {
|
|
175
|
+
cwd: process.cwd(),
|
|
176
|
+
encoding: "utf-8",
|
|
177
|
+
});
|
|
178
|
+
|
|
179
|
+
content = JSON.parse(readFileSync(projectFile, "utf-8"));
|
|
180
|
+
clipId = content.state.clips[0].id;
|
|
181
|
+
});
|
|
182
|
+
|
|
183
|
+
it("adds fadeIn effect to clip", () => {
|
|
184
|
+
execSync(
|
|
185
|
+
`${CLI} timeline add-effect "${projectFile}" ${clipId} fadeIn`,
|
|
186
|
+
{ cwd: process.cwd(), encoding: "utf-8" }
|
|
187
|
+
);
|
|
188
|
+
|
|
189
|
+
const content = JSON.parse(readFileSync(projectFile, "utf-8"));
|
|
190
|
+
expect(content.state.clips[0].effects).toHaveLength(1);
|
|
191
|
+
expect(content.state.clips[0].effects[0].type).toBe("fadeIn");
|
|
192
|
+
});
|
|
193
|
+
|
|
194
|
+
it("adds effect with custom duration", () => {
|
|
195
|
+
execSync(
|
|
196
|
+
`${CLI} timeline add-effect "${projectFile}" ${clipId} fadeOut --duration 2`,
|
|
197
|
+
{ cwd: process.cwd(), encoding: "utf-8" }
|
|
198
|
+
);
|
|
199
|
+
|
|
200
|
+
const content = JSON.parse(readFileSync(projectFile, "utf-8"));
|
|
201
|
+
expect(content.state.clips[0].effects[0].duration).toBe(2);
|
|
202
|
+
});
|
|
203
|
+
|
|
204
|
+
it("adds multiple effects to same clip", () => {
|
|
205
|
+
execSync(
|
|
206
|
+
`${CLI} timeline add-effect "${projectFile}" ${clipId} fadeIn`,
|
|
207
|
+
{ cwd: process.cwd(), encoding: "utf-8" }
|
|
208
|
+
);
|
|
209
|
+
execSync(
|
|
210
|
+
`${CLI} timeline add-effect "${projectFile}" ${clipId} fadeOut`,
|
|
211
|
+
{ cwd: process.cwd(), encoding: "utf-8" }
|
|
212
|
+
);
|
|
213
|
+
|
|
214
|
+
const content = JSON.parse(readFileSync(projectFile, "utf-8"));
|
|
215
|
+
expect(content.state.clips[0].effects).toHaveLength(2);
|
|
216
|
+
});
|
|
217
|
+
});
|
|
218
|
+
|
|
219
|
+
describe("timeline trim", () => {
|
|
220
|
+
let clipId: string;
|
|
221
|
+
|
|
222
|
+
beforeEach(() => {
|
|
223
|
+
execSync(
|
|
224
|
+
`${CLI} timeline add-source "${projectFile}" "${mediaFile}" -d 10`,
|
|
225
|
+
{ cwd: process.cwd(), encoding: "utf-8" }
|
|
226
|
+
);
|
|
227
|
+
|
|
228
|
+
let content = JSON.parse(readFileSync(projectFile, "utf-8"));
|
|
229
|
+
const sourceId = content.state.sources[0].id;
|
|
230
|
+
|
|
231
|
+
execSync(
|
|
232
|
+
`${CLI} timeline add-clip "${projectFile}" ${sourceId} --duration 10`,
|
|
233
|
+
{ cwd: process.cwd(), encoding: "utf-8" }
|
|
234
|
+
);
|
|
235
|
+
|
|
236
|
+
content = JSON.parse(readFileSync(projectFile, "utf-8"));
|
|
237
|
+
clipId = content.state.clips[0].id;
|
|
238
|
+
});
|
|
239
|
+
|
|
240
|
+
it("trims clip duration", () => {
|
|
241
|
+
execSync(
|
|
242
|
+
`${CLI} timeline trim "${projectFile}" ${clipId} --duration 5`,
|
|
243
|
+
{ cwd: process.cwd(), encoding: "utf-8" }
|
|
244
|
+
);
|
|
245
|
+
|
|
246
|
+
const content = JSON.parse(readFileSync(projectFile, "utf-8"));
|
|
247
|
+
expect(content.state.clips[0].duration).toBe(5);
|
|
248
|
+
});
|
|
249
|
+
|
|
250
|
+
it("trims clip start", () => {
|
|
251
|
+
execSync(
|
|
252
|
+
`${CLI} timeline trim "${projectFile}" ${clipId} --start 2`,
|
|
253
|
+
{ cwd: process.cwd(), encoding: "utf-8" }
|
|
254
|
+
);
|
|
255
|
+
|
|
256
|
+
const content = JSON.parse(readFileSync(projectFile, "utf-8"));
|
|
257
|
+
expect(content.state.clips[0].startTime).toBe(2);
|
|
258
|
+
});
|
|
259
|
+
});
|
|
260
|
+
|
|
261
|
+
describe("timeline list", () => {
|
|
262
|
+
beforeEach(() => {
|
|
263
|
+
execSync(
|
|
264
|
+
`${CLI} timeline add-source "${projectFile}" "${mediaFile}" -d 10`,
|
|
265
|
+
{ cwd: process.cwd(), encoding: "utf-8" }
|
|
266
|
+
);
|
|
267
|
+
|
|
268
|
+
const content = JSON.parse(readFileSync(projectFile, "utf-8"));
|
|
269
|
+
const sourceId = content.state.sources[0].id;
|
|
270
|
+
|
|
271
|
+
execSync(`${CLI} timeline add-clip "${projectFile}" ${sourceId}`, {
|
|
272
|
+
cwd: process.cwd(),
|
|
273
|
+
encoding: "utf-8",
|
|
274
|
+
});
|
|
275
|
+
});
|
|
276
|
+
|
|
277
|
+
it("lists all timeline contents", () => {
|
|
278
|
+
const output = execSync(`${CLI} timeline list "${projectFile}"`, {
|
|
279
|
+
cwd: process.cwd(),
|
|
280
|
+
encoding: "utf-8",
|
|
281
|
+
});
|
|
282
|
+
|
|
283
|
+
expect(output).toContain("Sources");
|
|
284
|
+
expect(output).toContain("sample.mp4");
|
|
285
|
+
expect(output).toContain("Tracks");
|
|
286
|
+
expect(output).toContain("Video 1");
|
|
287
|
+
expect(output).toContain("Clips");
|
|
288
|
+
});
|
|
289
|
+
|
|
290
|
+
it("lists only sources", () => {
|
|
291
|
+
const output = execSync(
|
|
292
|
+
`${CLI} timeline list "${projectFile}" --sources`,
|
|
293
|
+
{ cwd: process.cwd(), encoding: "utf-8" }
|
|
294
|
+
);
|
|
295
|
+
|
|
296
|
+
expect(output).toContain("Sources");
|
|
297
|
+
expect(output).toContain("sample.mp4");
|
|
298
|
+
expect(output).not.toContain("Tracks");
|
|
299
|
+
expect(output).not.toContain("Clips");
|
|
300
|
+
});
|
|
301
|
+
|
|
302
|
+
it("lists only tracks", () => {
|
|
303
|
+
const output = execSync(
|
|
304
|
+
`${CLI} timeline list "${projectFile}" --tracks`,
|
|
305
|
+
{ cwd: process.cwd(), encoding: "utf-8" }
|
|
306
|
+
);
|
|
307
|
+
|
|
308
|
+
expect(output).toContain("Tracks");
|
|
309
|
+
expect(output).toContain("Video 1");
|
|
310
|
+
expect(output).not.toContain("Sources");
|
|
311
|
+
expect(output).not.toContain("Clips");
|
|
312
|
+
});
|
|
313
|
+
});
|
|
314
|
+
|
|
315
|
+
describe("timeline split", () => {
|
|
316
|
+
let clipId: string;
|
|
317
|
+
|
|
318
|
+
beforeEach(() => {
|
|
319
|
+
execSync(
|
|
320
|
+
`${CLI} timeline add-source "${projectFile}" "${mediaFile}" -d 10`,
|
|
321
|
+
{ cwd: process.cwd(), encoding: "utf-8" }
|
|
322
|
+
);
|
|
323
|
+
|
|
324
|
+
let content = JSON.parse(readFileSync(projectFile, "utf-8"));
|
|
325
|
+
const sourceId = content.state.sources[0].id;
|
|
326
|
+
|
|
327
|
+
execSync(
|
|
328
|
+
`${CLI} timeline add-clip "${projectFile}" ${sourceId} --duration 10`,
|
|
329
|
+
{ cwd: process.cwd(), encoding: "utf-8" }
|
|
330
|
+
);
|
|
331
|
+
|
|
332
|
+
content = JSON.parse(readFileSync(projectFile, "utf-8"));
|
|
333
|
+
clipId = content.state.clips[0].id;
|
|
334
|
+
});
|
|
335
|
+
|
|
336
|
+
it("splits a clip at given time", () => {
|
|
337
|
+
execSync(`${CLI} timeline split "${projectFile}" ${clipId} --time 4`, {
|
|
338
|
+
cwd: process.cwd(),
|
|
339
|
+
encoding: "utf-8",
|
|
340
|
+
});
|
|
341
|
+
|
|
342
|
+
const content = JSON.parse(readFileSync(projectFile, "utf-8"));
|
|
343
|
+
expect(content.state.clips).toHaveLength(2);
|
|
344
|
+
expect(content.state.clips[0].duration).toBe(4);
|
|
345
|
+
expect(content.state.clips[1].duration).toBe(6);
|
|
346
|
+
expect(content.state.clips[1].startTime).toBe(4);
|
|
347
|
+
});
|
|
348
|
+
|
|
349
|
+
it("fails with invalid split time", () => {
|
|
350
|
+
expect(() => {
|
|
351
|
+
execSync(`${CLI} timeline split "${projectFile}" ${clipId} --time 0`, {
|
|
352
|
+
cwd: process.cwd(),
|
|
353
|
+
encoding: "utf-8",
|
|
354
|
+
stdio: "pipe",
|
|
355
|
+
});
|
|
356
|
+
}).toThrow();
|
|
357
|
+
});
|
|
358
|
+
});
|
|
359
|
+
|
|
360
|
+
describe("timeline duplicate", () => {
|
|
361
|
+
let clipId: string;
|
|
362
|
+
|
|
363
|
+
beforeEach(() => {
|
|
364
|
+
execSync(
|
|
365
|
+
`${CLI} timeline add-source "${projectFile}" "${mediaFile}" -d 10`,
|
|
366
|
+
{ cwd: process.cwd(), encoding: "utf-8" }
|
|
367
|
+
);
|
|
368
|
+
|
|
369
|
+
let content = JSON.parse(readFileSync(projectFile, "utf-8"));
|
|
370
|
+
const sourceId = content.state.sources[0].id;
|
|
371
|
+
|
|
372
|
+
execSync(
|
|
373
|
+
`${CLI} timeline add-clip "${projectFile}" ${sourceId} --duration 5`,
|
|
374
|
+
{ cwd: process.cwd(), encoding: "utf-8" }
|
|
375
|
+
);
|
|
376
|
+
|
|
377
|
+
content = JSON.parse(readFileSync(projectFile, "utf-8"));
|
|
378
|
+
clipId = content.state.clips[0].id;
|
|
379
|
+
});
|
|
380
|
+
|
|
381
|
+
it("duplicates a clip after original", () => {
|
|
382
|
+
execSync(`${CLI} timeline duplicate "${projectFile}" ${clipId}`, {
|
|
383
|
+
cwd: process.cwd(),
|
|
384
|
+
encoding: "utf-8",
|
|
385
|
+
});
|
|
386
|
+
|
|
387
|
+
const content = JSON.parse(readFileSync(projectFile, "utf-8"));
|
|
388
|
+
expect(content.state.clips).toHaveLength(2);
|
|
389
|
+
expect(content.state.clips[1].startTime).toBe(5);
|
|
390
|
+
expect(content.state.clips[1].duration).toBe(5);
|
|
391
|
+
});
|
|
392
|
+
|
|
393
|
+
it("duplicates a clip at specified time", () => {
|
|
394
|
+
execSync(
|
|
395
|
+
`${CLI} timeline duplicate "${projectFile}" ${clipId} --time 20`,
|
|
396
|
+
{ cwd: process.cwd(), encoding: "utf-8" }
|
|
397
|
+
);
|
|
398
|
+
|
|
399
|
+
const content = JSON.parse(readFileSync(projectFile, "utf-8"));
|
|
400
|
+
expect(content.state.clips[1].startTime).toBe(20);
|
|
401
|
+
});
|
|
402
|
+
});
|
|
403
|
+
|
|
404
|
+
describe("timeline delete", () => {
|
|
405
|
+
let clipId: string;
|
|
406
|
+
|
|
407
|
+
beforeEach(() => {
|
|
408
|
+
execSync(
|
|
409
|
+
`${CLI} timeline add-source "${projectFile}" "${mediaFile}" -d 10`,
|
|
410
|
+
{ cwd: process.cwd(), encoding: "utf-8" }
|
|
411
|
+
);
|
|
412
|
+
|
|
413
|
+
let content = JSON.parse(readFileSync(projectFile, "utf-8"));
|
|
414
|
+
const sourceId = content.state.sources[0].id;
|
|
415
|
+
|
|
416
|
+
execSync(`${CLI} timeline add-clip "${projectFile}" ${sourceId}`, {
|
|
417
|
+
cwd: process.cwd(),
|
|
418
|
+
encoding: "utf-8",
|
|
419
|
+
});
|
|
420
|
+
|
|
421
|
+
content = JSON.parse(readFileSync(projectFile, "utf-8"));
|
|
422
|
+
clipId = content.state.clips[0].id;
|
|
423
|
+
});
|
|
424
|
+
|
|
425
|
+
it("deletes a clip", () => {
|
|
426
|
+
const contentBefore = JSON.parse(readFileSync(projectFile, "utf-8"));
|
|
427
|
+
expect(contentBefore.state.clips).toHaveLength(1);
|
|
428
|
+
|
|
429
|
+
execSync(`${CLI} timeline delete "${projectFile}" ${clipId}`, {
|
|
430
|
+
cwd: process.cwd(),
|
|
431
|
+
encoding: "utf-8",
|
|
432
|
+
});
|
|
433
|
+
|
|
434
|
+
const content = JSON.parse(readFileSync(projectFile, "utf-8"));
|
|
435
|
+
expect(content.state.clips).toHaveLength(0);
|
|
436
|
+
});
|
|
437
|
+
|
|
438
|
+
it("fails with non-existent clip", () => {
|
|
439
|
+
expect(() => {
|
|
440
|
+
execSync(`${CLI} timeline delete "${projectFile}" non-existent`, {
|
|
441
|
+
cwd: process.cwd(),
|
|
442
|
+
encoding: "utf-8",
|
|
443
|
+
stdio: "pipe",
|
|
444
|
+
});
|
|
445
|
+
}).toThrow();
|
|
446
|
+
});
|
|
447
|
+
});
|
|
448
|
+
|
|
449
|
+
describe("timeline move", () => {
|
|
450
|
+
let clipId: string;
|
|
451
|
+
|
|
452
|
+
beforeEach(() => {
|
|
453
|
+
execSync(
|
|
454
|
+
`${CLI} timeline add-source "${projectFile}" "${mediaFile}" -d 10`,
|
|
455
|
+
{ cwd: process.cwd(), encoding: "utf-8" }
|
|
456
|
+
);
|
|
457
|
+
|
|
458
|
+
let content = JSON.parse(readFileSync(projectFile, "utf-8"));
|
|
459
|
+
const sourceId = content.state.sources[0].id;
|
|
460
|
+
|
|
461
|
+
execSync(`${CLI} timeline add-clip "${projectFile}" ${sourceId}`, {
|
|
462
|
+
cwd: process.cwd(),
|
|
463
|
+
encoding: "utf-8",
|
|
464
|
+
});
|
|
465
|
+
|
|
466
|
+
content = JSON.parse(readFileSync(projectFile, "utf-8"));
|
|
467
|
+
clipId = content.state.clips[0].id;
|
|
468
|
+
});
|
|
469
|
+
|
|
470
|
+
it("moves a clip to new time", () => {
|
|
471
|
+
execSync(`${CLI} timeline move "${projectFile}" ${clipId} --time 15`, {
|
|
472
|
+
cwd: process.cwd(),
|
|
473
|
+
encoding: "utf-8",
|
|
474
|
+
});
|
|
475
|
+
|
|
476
|
+
const content = JSON.parse(readFileSync(projectFile, "utf-8"));
|
|
477
|
+
expect(content.state.clips[0].startTime).toBe(15);
|
|
478
|
+
});
|
|
479
|
+
|
|
480
|
+
it("moves a clip to different track", () => {
|
|
481
|
+
// Add audio track
|
|
482
|
+
execSync(`${CLI} timeline add-track "${projectFile}" audio -n "Audio 2"`, {
|
|
483
|
+
cwd: process.cwd(),
|
|
484
|
+
encoding: "utf-8",
|
|
485
|
+
});
|
|
486
|
+
|
|
487
|
+
const content = JSON.parse(readFileSync(projectFile, "utf-8"));
|
|
488
|
+
const newTrackId = content.state.tracks[2].id;
|
|
489
|
+
|
|
490
|
+
execSync(
|
|
491
|
+
`${CLI} timeline move "${projectFile}" ${clipId} --track ${newTrackId}`,
|
|
492
|
+
{ cwd: process.cwd(), encoding: "utf-8" }
|
|
493
|
+
);
|
|
494
|
+
|
|
495
|
+
const updated = JSON.parse(readFileSync(projectFile, "utf-8"));
|
|
496
|
+
expect(updated.state.clips[0].trackId).toBe(newTrackId);
|
|
497
|
+
});
|
|
498
|
+
});
|
|
499
|
+
});
|