@assistkick/create 1.6.0 → 1.8.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/package.json +2 -2
- package/templates/assistkick-product-system/.env.example +1 -0
- package/templates/assistkick-product-system/local.db +0 -0
- package/templates/assistkick-product-system/package.json +4 -2
- package/templates/assistkick-product-system/packages/backend/package.json +2 -0
- package/templates/assistkick-product-system/packages/backend/src/routes/agents.ts +165 -0
- package/templates/assistkick-product-system/packages/backend/src/routes/files.test.ts +358 -0
- package/templates/assistkick-product-system/packages/backend/src/routes/files.ts +356 -0
- package/templates/assistkick-product-system/packages/backend/src/routes/git.ts +96 -1
- package/templates/assistkick-product-system/packages/backend/src/routes/graph.ts +1 -0
- package/templates/assistkick-product-system/packages/backend/src/routes/kanban.ts +43 -4
- package/templates/assistkick-product-system/packages/backend/src/routes/pipeline.ts +200 -84
- package/templates/assistkick-product-system/packages/backend/src/routes/projects.ts +6 -3
- package/templates/assistkick-product-system/packages/backend/src/routes/terminal.ts +53 -17
- package/templates/assistkick-product-system/packages/backend/src/routes/video.ts +218 -0
- package/templates/assistkick-product-system/packages/backend/src/routes/workflow_groups.ts +119 -0
- package/templates/assistkick-product-system/packages/backend/src/routes/workflows.ts +154 -0
- package/templates/assistkick-product-system/packages/backend/src/server.ts +81 -9
- package/templates/assistkick-product-system/packages/backend/src/services/agent_service.test.ts +489 -0
- package/templates/assistkick-product-system/packages/backend/src/services/agent_service.ts +416 -0
- package/templates/assistkick-product-system/packages/backend/src/services/bundle_service.test.ts +189 -0
- package/templates/assistkick-product-system/packages/backend/src/services/bundle_service.ts +182 -0
- package/templates/assistkick-product-system/packages/backend/src/services/init.ts +28 -78
- package/templates/assistkick-product-system/packages/backend/src/services/project_service.test.ts +16 -0
- package/templates/assistkick-product-system/packages/backend/src/services/project_service.ts +73 -2
- package/templates/assistkick-product-system/packages/backend/src/services/project_workspace_service.test.ts +4 -4
- package/templates/assistkick-product-system/packages/backend/src/services/project_workspace_service.ts +87 -11
- package/templates/assistkick-product-system/packages/backend/src/services/pty_session_manager.test.ts +210 -69
- package/templates/assistkick-product-system/packages/backend/src/services/pty_session_manager.ts +210 -215
- package/templates/assistkick-product-system/packages/backend/src/services/ssh_key_service.test.ts +162 -0
- package/templates/assistkick-product-system/packages/backend/src/services/ssh_key_service.ts +148 -0
- package/templates/assistkick-product-system/packages/backend/src/services/terminal_ws_handler.ts +11 -5
- package/templates/assistkick-product-system/packages/backend/src/services/tts_service.test.ts +64 -0
- package/templates/assistkick-product-system/packages/backend/src/services/tts_service.ts +134 -0
- package/templates/assistkick-product-system/packages/backend/src/services/video_render_service.test.ts +256 -0
- package/templates/assistkick-product-system/packages/backend/src/services/video_render_service.ts +258 -0
- package/templates/assistkick-product-system/packages/backend/src/services/workflow_group_service.ts +106 -0
- package/templates/assistkick-product-system/packages/backend/src/services/workflow_service.test.ts +275 -0
- package/templates/assistkick-product-system/packages/backend/src/services/workflow_service.ts +222 -0
- package/templates/assistkick-product-system/packages/frontend/index.html +3 -0
- package/templates/assistkick-product-system/packages/frontend/package-lock.json +800 -11
- package/templates/assistkick-product-system/packages/frontend/package.json +11 -1
- package/templates/assistkick-product-system/packages/frontend/src/App.tsx +24 -7
- package/templates/assistkick-product-system/packages/frontend/src/api/client.ts +456 -16
- package/templates/assistkick-product-system/packages/frontend/src/api/client_files.test.ts +172 -0
- package/templates/assistkick-product-system/packages/frontend/src/api/client_video.test.ts +238 -0
- package/templates/assistkick-product-system/packages/frontend/src/components/AgentsView.tsx +307 -0
- package/templates/assistkick-product-system/packages/frontend/src/components/CoherenceView.tsx +82 -66
- package/templates/assistkick-product-system/packages/frontend/src/components/CompositionPlaceholder.tsx +97 -0
- package/templates/assistkick-product-system/packages/frontend/src/components/DesignSystemView.tsx +383 -0
- package/templates/assistkick-product-system/packages/frontend/src/components/EditorTabBar.tsx +57 -0
- package/templates/assistkick-product-system/packages/frontend/src/components/FileTree.tsx +313 -0
- package/templates/assistkick-product-system/packages/frontend/src/components/FileTreeContextMenu.tsx +61 -0
- package/templates/assistkick-product-system/packages/frontend/src/components/FileTreeInlineInput.tsx +73 -0
- package/templates/assistkick-product-system/packages/frontend/src/components/FilesView.tsx +404 -0
- package/templates/assistkick-product-system/packages/frontend/src/components/GitRepoModal.tsx +193 -64
- package/templates/assistkick-product-system/packages/frontend/src/components/GraphLegend.tsx +71 -73
- package/templates/assistkick-product-system/packages/frontend/src/components/GraphSettings.tsx +8 -8
- package/templates/assistkick-product-system/packages/frontend/src/components/GraphView.tsx +1 -1
- package/templates/assistkick-product-system/packages/frontend/src/components/InviteUserDialog.tsx +15 -11
- package/templates/assistkick-product-system/packages/frontend/src/components/KanbanView.tsx +226 -291
- package/templates/assistkick-product-system/packages/frontend/src/components/LoginPage.tsx +14 -14
- package/templates/assistkick-product-system/packages/frontend/src/components/ProjectSelector.tsx +54 -33
- package/templates/assistkick-product-system/packages/frontend/src/components/QaIssueSheet.tsx +40 -66
- package/templates/assistkick-product-system/packages/frontend/src/components/SidePanel.tsx +55 -115
- package/templates/assistkick-product-system/packages/frontend/src/components/TerminalView.tsx +121 -52
- package/templates/assistkick-product-system/packages/frontend/src/components/Toolbar.tsx +155 -77
- package/templates/assistkick-product-system/packages/frontend/src/components/UsersView.tsx +52 -52
- package/templates/assistkick-product-system/packages/frontend/src/components/VideoGallery.tsx +313 -0
- package/templates/assistkick-product-system/packages/frontend/src/components/VideographyView.tsx +250 -0
- package/templates/assistkick-product-system/packages/frontend/src/components/WorkflowsView.tsx +474 -0
- package/templates/assistkick-product-system/packages/frontend/src/components/ds/AccentBorderList.tsx +53 -0
- package/templates/assistkick-product-system/packages/frontend/src/components/ds/Button.tsx +87 -0
- package/templates/assistkick-product-system/packages/frontend/src/components/ds/ButtonGroup.tsx +29 -0
- package/templates/assistkick-product-system/packages/frontend/src/components/ds/ButtonShowcase.tsx +221 -0
- package/templates/assistkick-product-system/packages/frontend/src/components/ds/CardGlass.tsx +141 -0
- package/templates/assistkick-product-system/packages/frontend/src/components/ds/CompletionRing.tsx +30 -0
- package/templates/assistkick-product-system/packages/frontend/src/components/ds/ContentCard.tsx +34 -0
- package/templates/assistkick-product-system/packages/frontend/src/components/ds/IconButton.tsx +74 -0
- package/templates/assistkick-product-system/packages/frontend/src/components/ds/KanbanCard.tsx +270 -0
- package/templates/assistkick-product-system/packages/frontend/src/components/ds/KanbanCardShowcase.tsx +37 -0
- package/templates/assistkick-product-system/packages/frontend/src/components/ds/Kbd.tsx +11 -0
- package/templates/assistkick-product-system/packages/frontend/src/components/ds/KindBadge.tsx +21 -0
- package/templates/assistkick-product-system/packages/frontend/src/components/ds/NavBarSidekick.tsx +207 -0
- package/templates/assistkick-product-system/packages/frontend/src/components/ds/SidePanelShowcase.tsx +370 -0
- package/templates/assistkick-product-system/packages/frontend/src/components/ds/SideSheet.tsx +64 -0
- package/templates/assistkick-product-system/packages/frontend/src/components/ds/StatusDot.tsx +18 -0
- package/templates/assistkick-product-system/packages/frontend/src/components/workflow/CheckCardPositionNode.tsx +36 -0
- package/templates/assistkick-product-system/packages/frontend/src/components/workflow/CheckCycleCountNode.tsx +60 -0
- package/templates/assistkick-product-system/packages/frontend/src/components/workflow/EndNode.tsx +42 -0
- package/templates/assistkick-product-system/packages/frontend/src/components/workflow/GroupNode.tsx +189 -0
- package/templates/assistkick-product-system/packages/frontend/src/components/workflow/NodePalette.tsx +123 -0
- package/templates/assistkick-product-system/packages/frontend/src/components/workflow/RunAgentNode.tsx +51 -0
- package/templates/assistkick-product-system/packages/frontend/src/components/workflow/SetCardMetadataNode.tsx +53 -0
- package/templates/assistkick-product-system/packages/frontend/src/components/workflow/StartNode.tsx +18 -0
- package/templates/assistkick-product-system/packages/frontend/src/components/workflow/TransitionCardNode.tsx +59 -0
- package/templates/assistkick-product-system/packages/frontend/src/components/workflow/WorkflowCanvas.tsx +335 -0
- package/templates/assistkick-product-system/packages/frontend/src/components/workflow/WorkflowMonitorModal.tsx +634 -0
- package/templates/assistkick-product-system/packages/frontend/src/components/workflow/autoLayout.ts +103 -0
- package/templates/assistkick-product-system/packages/frontend/src/components/workflow/edgeColors.ts +35 -0
- package/templates/assistkick-product-system/packages/frontend/src/components/workflow/monitor_nodes.tsx +208 -0
- package/templates/assistkick-product-system/packages/frontend/src/components/workflow/workflow_types.test.ts +119 -0
- package/templates/assistkick-product-system/packages/frontend/src/components/workflow/workflow_types.ts +107 -0
- package/templates/assistkick-product-system/packages/frontend/src/constants/graph.ts +13 -11
- package/templates/assistkick-product-system/packages/frontend/src/hooks/useAutoSave.ts +75 -0
- package/templates/assistkick-product-system/packages/frontend/src/hooks/useGraph.ts +6 -21
- package/templates/assistkick-product-system/packages/frontend/src/hooks/useProjects.ts +15 -80
- package/templates/assistkick-product-system/packages/frontend/src/hooks/useToast.tsx +16 -3
- package/templates/assistkick-product-system/packages/frontend/src/pages/accept_invitation_page.tsx +30 -27
- package/templates/assistkick-product-system/packages/frontend/src/pages/forgot_password_page.tsx +18 -15
- package/templates/assistkick-product-system/packages/frontend/src/pages/register_page.tsx +21 -18
- package/templates/assistkick-product-system/packages/frontend/src/pages/reset_password_page.tsx +28 -25
- package/templates/assistkick-product-system/packages/frontend/src/routes/AgentsRoute.tsx +6 -0
- package/templates/assistkick-product-system/packages/frontend/src/routes/CoherenceRoute.tsx +19 -0
- package/templates/assistkick-product-system/packages/frontend/src/routes/DashboardLayout.tsx +54 -0
- package/templates/assistkick-product-system/packages/frontend/src/routes/DesignSystemRoute.tsx +6 -0
- package/templates/assistkick-product-system/packages/frontend/src/routes/FilesRoute.tsx +13 -0
- package/templates/assistkick-product-system/packages/frontend/src/routes/GraphRoute.tsx +93 -0
- package/templates/assistkick-product-system/packages/frontend/src/routes/KanbanRoute.tsx +30 -0
- package/templates/assistkick-product-system/packages/frontend/src/routes/TerminalRoute.tsx +9 -0
- package/templates/assistkick-product-system/packages/frontend/src/routes/UsersRoute.tsx +6 -0
- package/templates/assistkick-product-system/packages/frontend/src/routes/VideographyRoute.tsx +13 -0
- package/templates/assistkick-product-system/packages/frontend/src/routes/WorkflowsRoute.tsx +6 -0
- package/templates/assistkick-product-system/packages/frontend/src/stores/useGitModalStore.ts +14 -0
- package/templates/assistkick-product-system/packages/frontend/src/stores/useGraphStore.ts +36 -0
- package/templates/assistkick-product-system/packages/frontend/src/stores/useGraphUIStore.ts +25 -0
- package/templates/assistkick-product-system/packages/frontend/src/stores/useProjectStore.ts +90 -0
- package/templates/assistkick-product-system/packages/frontend/src/stores/useQaSheetStore.ts +27 -0
- package/templates/assistkick-product-system/packages/frontend/src/stores/useSidePanelStore.ts +76 -0
- package/templates/assistkick-product-system/packages/frontend/src/styles/index.css +336 -3632
- package/templates/assistkick-product-system/packages/frontend/src/utils/auto_save_service.test.ts +167 -0
- package/templates/assistkick-product-system/packages/frontend/src/utils/auto_save_service.ts +101 -0
- package/templates/assistkick-product-system/packages/frontend/src/utils/composition_matcher.test.ts +42 -0
- package/templates/assistkick-product-system/packages/frontend/src/utils/composition_matcher.ts +17 -0
- package/templates/assistkick-product-system/packages/frontend/src/utils/file_utils.test.ts +145 -0
- package/templates/assistkick-product-system/packages/frontend/src/utils/file_utils.ts +42 -0
- package/templates/assistkick-product-system/packages/frontend/src/utils/task_status.test.ts +4 -10
- package/templates/assistkick-product-system/packages/frontend/src/utils/task_status.ts +19 -1
- package/templates/assistkick-product-system/packages/frontend/vite.config.ts +7 -1
- package/templates/assistkick-product-system/packages/shared/db/local.db +0 -0
- package/templates/assistkick-product-system/packages/shared/db/migrations/0004_tidy_matthew_murdock.sql +9 -0
- package/templates/assistkick-product-system/packages/shared/db/migrations/0005_mysterious_falcon.sql +692 -0
- package/templates/assistkick-product-system/packages/shared/db/migrations/0006_next_venom.sql +9 -0
- package/templates/assistkick-product-system/packages/shared/db/migrations/0007_deep_barracuda.sql +39 -0
- package/templates/assistkick-product-system/packages/shared/db/migrations/0008_puzzling_hannibal_king.sql +1 -0
- package/templates/assistkick-product-system/packages/shared/db/migrations/0009_amused_beast.sql +8 -0
- package/templates/assistkick-product-system/packages/shared/db/migrations/0010_spotty_moira_mactaggert.sql +9 -0
- package/templates/assistkick-product-system/packages/shared/db/migrations/0011_goofy_snowbird.sql +3 -0
- package/templates/assistkick-product-system/packages/shared/db/migrations/0011_supreme_doctor_octopus.sql +3 -0
- package/templates/assistkick-product-system/packages/shared/db/migrations/0013_reflective_prowler.sql +15 -0
- package/templates/assistkick-product-system/packages/shared/db/migrations/meta/0004_snapshot.json +921 -0
- package/templates/assistkick-product-system/packages/shared/db/migrations/meta/0005_snapshot.json +1042 -0
- package/templates/assistkick-product-system/packages/shared/db/migrations/meta/0006_snapshot.json +1101 -0
- package/templates/assistkick-product-system/packages/shared/db/migrations/meta/0007_snapshot.json +1336 -0
- package/templates/assistkick-product-system/packages/shared/db/migrations/meta/0008_snapshot.json +1275 -0
- package/templates/assistkick-product-system/packages/shared/db/migrations/meta/0009_snapshot.json +1327 -0
- package/templates/assistkick-product-system/packages/shared/db/migrations/meta/0010_snapshot.json +1393 -0
- package/templates/assistkick-product-system/packages/shared/db/migrations/meta/0011_snapshot.json +1436 -0
- package/templates/assistkick-product-system/packages/shared/db/migrations/meta/0013_snapshot.json +1538 -0
- package/templates/assistkick-product-system/packages/shared/db/migrations/meta/_journal.json +70 -0
- package/templates/assistkick-product-system/packages/shared/db/schema.ts +113 -0
- package/templates/assistkick-product-system/packages/shared/lib/claude-service.ts +32 -7
- package/templates/assistkick-product-system/packages/shared/lib/constants.ts +9 -0
- package/templates/assistkick-product-system/packages/shared/lib/git_workflow.ts +12 -4
- package/templates/assistkick-product-system/packages/shared/lib/graph.ts +16 -5
- package/templates/assistkick-product-system/packages/shared/lib/workflow_engine.test.ts +1753 -0
- package/templates/assistkick-product-system/packages/shared/lib/workflow_engine.ts +1281 -0
- package/templates/assistkick-product-system/packages/shared/lib/workflow_orchestrator.ts +211 -0
- package/templates/assistkick-product-system/packages/shared/tools/add_node.test.ts +43 -0
- package/templates/assistkick-product-system/packages/shared/tools/add_node.ts +13 -2
- package/templates/assistkick-product-system/packages/shared/tools/get_kanban.ts +1 -1
- package/templates/assistkick-product-system/packages/shared/tools/migrate_epics.test.ts +226 -0
- package/templates/assistkick-product-system/packages/shared/tools/migrate_epics.ts +251 -0
- package/templates/assistkick-product-system/packages/shared/tools/update_node.ts +2 -2
- package/templates/assistkick-product-system/packages/shared/utils/hello_workflow.test.ts +10 -0
- package/templates/assistkick-product-system/packages/shared/utils/hello_workflow.ts +6 -0
- package/templates/assistkick-product-system/packages/video/Root.tsx +85 -0
- package/templates/assistkick-product-system/packages/video/components/email_scene.tsx +231 -0
- package/templates/assistkick-product-system/packages/video/components/outro_scene.tsx +153 -0
- package/templates/assistkick-product-system/packages/video/components/part_divider.tsx +90 -0
- package/templates/assistkick-product-system/packages/video/components/scene.tsx +226 -0
- package/templates/assistkick-product-system/packages/video/components/theme.ts +22 -0
- package/templates/assistkick-product-system/packages/video/components/title_scene.tsx +169 -0
- package/templates/assistkick-product-system/packages/video/components/video_split_layout.tsx +84 -0
- package/templates/assistkick-product-system/packages/video/compositions/.gitkeep +0 -0
- package/templates/assistkick-product-system/packages/video/index.ts +4 -0
- package/templates/assistkick-product-system/packages/video/package.json +28 -0
- package/templates/assistkick-product-system/packages/video/remotion.config.ts +11 -0
- package/templates/assistkick-product-system/packages/video/scripts/process_script.test.ts +326 -0
- package/templates/assistkick-product-system/packages/video/scripts/process_script.ts +630 -0
- package/templates/assistkick-product-system/packages/video/style.css +1 -0
- package/templates/assistkick-product-system/packages/video/tsconfig.json +18 -0
- package/templates/assistkick-product-system/tests/graph_legend.test.ts +2 -1
- package/templates/assistkick-product-system/tests/video_render_service.test.ts +179 -0
- package/templates/assistkick-product-system/tests/web_terminal.test.ts +219 -455
- package/templates/assistkick-product-system/tests/workflow_integration.test.ts +341 -0
- package/templates/skills/assistkick-bootstrap/SKILL.md +3 -3
- package/templates/skills/assistkick-code-reviewer/SKILL.md +2 -2
- package/templates/skills/assistkick-debugger/SKILL.md +2 -2
- package/templates/skills/assistkick-developer/SKILL.md +6 -3
- package/templates/skills/assistkick-developer/references/react_development_guidelines.md +225 -0
- package/templates/skills/assistkick-interview/SKILL.md +2 -2
- package/templates/skills/product-system/graph.json +1890 -0
- package/templates/skills/product-system/kanban.json +304 -0
- package/templates/skills/product-system/nodes/comp_001.md +56 -0
- package/templates/skills/product-system/nodes/comp_002.md +57 -0
- package/templates/skills/product-system/nodes/data_001.md +51 -0
- package/templates/skills/product-system/nodes/data_002.md +40 -0
- package/templates/skills/product-system/nodes/data_004.md +38 -0
- package/templates/skills/product-system/nodes/dec_001.md +34 -0
- package/templates/skills/product-system/nodes/dec_016.md +32 -0
- package/templates/skills/product-system/nodes/feat_008.md +30 -0
- package/templates/skills/video-composition-agent/SKILL.md +232 -0
- package/templates/skills/video-script-writer/SKILL.md +136 -0
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tests for Video Rendering Service (feat_affe2fc7).
|
|
3
|
+
* Verifies the VideoRenderService class, API routes, schema, and Dockerfile.
|
|
4
|
+
* Uses node:test built-in runner.
|
|
5
|
+
*/
|
|
6
|
+
import { describe, it, mock } from 'node:test';
|
|
7
|
+
import assert from 'node:assert/strict';
|
|
8
|
+
import { readFile } from 'node:fs/promises';
|
|
9
|
+
import { join, dirname } from 'node:path';
|
|
10
|
+
import { fileURLToPath } from 'node:url';
|
|
11
|
+
|
|
12
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
13
|
+
const SOURCE_ROOT = join(__dirname, '..');
|
|
14
|
+
const BACKEND_SRC = join(SOURCE_ROOT, 'packages', 'backend', 'src');
|
|
15
|
+
const SHARED_DB = join(SOURCE_ROOT, 'packages', 'shared', 'db');
|
|
16
|
+
|
|
17
|
+
describe('VideoRenderService', () => {
|
|
18
|
+
let serviceContent: string;
|
|
19
|
+
let routeContent: string;
|
|
20
|
+
let schemaContent: string;
|
|
21
|
+
let serverContent: string;
|
|
22
|
+
let dockerfileContent: string;
|
|
23
|
+
|
|
24
|
+
it('loads source files', async () => {
|
|
25
|
+
serviceContent = await readFile(join(BACKEND_SRC, 'services', 'video_render_service.ts'), 'utf-8');
|
|
26
|
+
routeContent = await readFile(join(BACKEND_SRC, 'routes', 'video.ts'), 'utf-8');
|
|
27
|
+
schemaContent = await readFile(join(SHARED_DB, 'schema.ts'), 'utf-8');
|
|
28
|
+
serverContent = await readFile(join(BACKEND_SRC, 'server.ts'), 'utf-8');
|
|
29
|
+
dockerfileContent = await readFile(join(SOURCE_ROOT, '..', 'Dockerfile'), 'utf-8');
|
|
30
|
+
assert.ok(serviceContent.length > 0);
|
|
31
|
+
assert.ok(routeContent.length > 0);
|
|
32
|
+
assert.ok(schemaContent.length > 0);
|
|
33
|
+
assert.ok(serverContent.length > 0);
|
|
34
|
+
assert.ok(dockerfileContent.length > 0);
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
describe('Schema', () => {
|
|
38
|
+
it('defines video_renders table', () => {
|
|
39
|
+
assert.ok(schemaContent.includes("videoRenders = sqliteTable('video_renders'"), 'schema should define video_renders table');
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
it('has required columns', () => {
|
|
43
|
+
assert.ok(schemaContent.includes("projectId: text('project_id')"), 'should have projectId column');
|
|
44
|
+
assert.ok(schemaContent.includes("featureId: text('feature_id')"), 'should have featureId column');
|
|
45
|
+
assert.ok(schemaContent.includes("compositionId: text('composition_id')"), 'should have compositionId column');
|
|
46
|
+
assert.ok(schemaContent.includes("status: text('status')"), 'should have status column');
|
|
47
|
+
assert.ok(schemaContent.includes("progress: real('progress')"), 'should have progress column');
|
|
48
|
+
assert.ok(schemaContent.includes("filePath: text('file_path')"), 'should have filePath column');
|
|
49
|
+
assert.ok(schemaContent.includes("fileSize: integer('file_size')"), 'should have fileSize column');
|
|
50
|
+
assert.ok(schemaContent.includes("durationSeconds: real('duration_seconds')"), 'should have durationSeconds column');
|
|
51
|
+
assert.ok(schemaContent.includes("error: text('error')"), 'should have error column');
|
|
52
|
+
assert.ok(schemaContent.includes("completedAt: text('completed_at')"), 'should have completedAt column');
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
describe('Service class', () => {
|
|
57
|
+
it('exports VideoRenderService class', () => {
|
|
58
|
+
assert.ok(serviceContent.includes('export class VideoRenderService'), 'should export VideoRenderService class');
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
it('uses constructor DI', () => {
|
|
62
|
+
assert.ok(serviceContent.includes('constructor({ getDb, workspacesDir, bundleOutputDir, log }'), 'should use constructor DI');
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
it('uses arrow functions for methods', () => {
|
|
66
|
+
assert.ok(serviceContent.includes('startRender = async'), 'startRender should be an arrow function');
|
|
67
|
+
assert.ok(serviceContent.includes('getStatus = async'), 'getStatus should be an arrow function');
|
|
68
|
+
assert.ok(serviceContent.includes('getFilePath = async'), 'getFilePath should be an arrow function');
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
it('uses @remotion/renderer for rendering', () => {
|
|
72
|
+
assert.ok(serviceContent.includes("from '@remotion/renderer'"), 'should import from @remotion/renderer');
|
|
73
|
+
assert.ok(serviceContent.includes('renderMedia'), 'should use renderMedia');
|
|
74
|
+
assert.ok(serviceContent.includes('selectComposition'), 'should use selectComposition');
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
it('tracks render progress', () => {
|
|
78
|
+
assert.ok(serviceContent.includes('onProgress'), 'should have onProgress callback');
|
|
79
|
+
assert.ok(serviceContent.includes('progress'), 'should update progress');
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
it('outputs to correct path pattern', () => {
|
|
83
|
+
assert.ok(serviceContent.includes("'media'"), 'should output under media directory');
|
|
84
|
+
assert.ok(serviceContent.includes("'outputs'"), 'should output to outputs subdirectory');
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
it('handles render status lifecycle', () => {
|
|
88
|
+
assert.ok(serviceContent.includes("status: 'queued'"), 'should set initial status to queued');
|
|
89
|
+
assert.ok(serviceContent.includes("status: 'rendering'"), 'should transition to rendering');
|
|
90
|
+
assert.ok(serviceContent.includes("status: 'complete'"), 'should transition to complete');
|
|
91
|
+
assert.ok(serviceContent.includes("status: 'failed'"), 'should transition to failed');
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
it('passes mediaBasePath as inputProps', () => {
|
|
95
|
+
assert.ok(serviceContent.includes('mediaBasePath'), 'should pass mediaBasePath');
|
|
96
|
+
assert.ok(serviceContent.includes('inputProps'), 'should set inputProps for composition');
|
|
97
|
+
});
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
describe('API routes', () => {
|
|
101
|
+
it('has POST /render endpoint', () => {
|
|
102
|
+
assert.ok(routeContent.includes("router.post('/render'"), 'should have POST /render route');
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
it('has GET /render/:id endpoint', () => {
|
|
106
|
+
assert.ok(routeContent.includes("router.get('/render/:id'"), 'should have GET /render/:id route');
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
it('has GET /file/:renderId endpoint', () => {
|
|
110
|
+
assert.ok(routeContent.includes("router.get('/file/:renderId'"), 'should have GET /file/:renderId route');
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
it('validates required POST parameters', () => {
|
|
114
|
+
assert.ok(routeContent.includes("'compositionId is required'"), 'should validate compositionId');
|
|
115
|
+
assert.ok(routeContent.includes("'projectId is required'"), 'should validate projectId');
|
|
116
|
+
assert.ok(routeContent.includes("'featureId is required'"), 'should validate featureId');
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
it('accepts render settings', () => {
|
|
120
|
+
assert.ok(routeContent.includes('resolution'), 'should accept resolution parameter');
|
|
121
|
+
assert.ok(routeContent.includes('fileOutputPrefix'), 'should accept fileOutputPrefix parameter');
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
it('serves MP4 files with sendFile', () => {
|
|
125
|
+
assert.ok(routeContent.includes('res.sendFile'), 'should use res.sendFile for MP4 delivery');
|
|
126
|
+
});
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
describe('Server integration', () => {
|
|
130
|
+
it('imports VideoRenderService', () => {
|
|
131
|
+
assert.ok(serverContent.includes("import { VideoRenderService }"), 'server should import VideoRenderService');
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
it('instantiates VideoRenderService with DI', () => {
|
|
135
|
+
assert.ok(serverContent.includes('new VideoRenderService('), 'server should instantiate VideoRenderService');
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
it('passes videoRenderService to video routes', () => {
|
|
139
|
+
assert.ok(serverContent.includes('videoRenderService'), 'server should pass videoRenderService to routes');
|
|
140
|
+
});
|
|
141
|
+
});
|
|
142
|
+
|
|
143
|
+
describe('Dockerfile', () => {
|
|
144
|
+
it('installs Chromium', () => {
|
|
145
|
+
assert.ok(dockerfileContent.includes('chromium'), 'Dockerfile should install chromium');
|
|
146
|
+
});
|
|
147
|
+
|
|
148
|
+
it('sets REMOTION_CHROME_EXECUTABLE_PATH', () => {
|
|
149
|
+
assert.ok(dockerfileContent.includes('REMOTION_CHROME_EXECUTABLE_PATH'), 'should set REMOTION_CHROME_EXECUTABLE_PATH');
|
|
150
|
+
});
|
|
151
|
+
|
|
152
|
+
it('sets PUPPETEER_EXECUTABLE_PATH', () => {
|
|
153
|
+
assert.ok(dockerfileContent.includes('PUPPETEER_EXECUTABLE_PATH'), 'should set PUPPETEER_EXECUTABLE_PATH');
|
|
154
|
+
});
|
|
155
|
+
});
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
describe('VideoRenderService resolution parsing', () => {
|
|
159
|
+
it('parses standard resolution', () => {
|
|
160
|
+
// Test the parseResolution logic by importing dynamically
|
|
161
|
+
const parseResolution = (resolution?: string): { width: number; height: number } => {
|
|
162
|
+
if (!resolution) return { width: 1920, height: 1080 };
|
|
163
|
+
const parts = resolution.split('x');
|
|
164
|
+
if (parts.length !== 2) return { width: 1920, height: 1080 };
|
|
165
|
+
const width = parseInt(parts[0], 10);
|
|
166
|
+
const height = parseInt(parts[1], 10);
|
|
167
|
+
if (isNaN(width) || isNaN(height)) return { width: 1920, height: 1080 };
|
|
168
|
+
return { width, height };
|
|
169
|
+
};
|
|
170
|
+
|
|
171
|
+
assert.deepStrictEqual(parseResolution('1920x1080'), { width: 1920, height: 1080 });
|
|
172
|
+
assert.deepStrictEqual(parseResolution('1080x1920'), { width: 1080, height: 1920 });
|
|
173
|
+
assert.deepStrictEqual(parseResolution('720x480'), { width: 720, height: 480 });
|
|
174
|
+
assert.deepStrictEqual(parseResolution(undefined), { width: 1920, height: 1080 });
|
|
175
|
+
assert.deepStrictEqual(parseResolution('invalid'), { width: 1920, height: 1080 });
|
|
176
|
+
assert.deepStrictEqual(parseResolution('axb'), { width: 1920, height: 1080 });
|
|
177
|
+
assert.deepStrictEqual(parseResolution(''), { width: 1920, height: 1080 });
|
|
178
|
+
});
|
|
179
|
+
});
|