@assistkick/create 1.7.0 → 1.9.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/dist/bin/create.js +0 -0
- package/package.json +9 -7
- 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 +61 -6
- 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 +158 -0
- package/templates/assistkick-product-system/packages/backend/src/server.ts +60 -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 +43 -77
- 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 +245 -0
- package/templates/assistkick-product-system/packages/frontend/package-lock.json +3455 -0
- package/templates/assistkick-product-system/packages/frontend/package.json +6 -0
- package/templates/assistkick-product-system/packages/frontend/src/App.tsx +8 -0
- package/templates/assistkick-product-system/packages/frontend/src/api/client.ts +458 -18
- 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 +20 -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 +187 -56
- 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/IterationCommentModal.tsx +80 -0
- package/templates/assistkick-product-system/packages/frontend/src/components/KanbanView.tsx +263 -167
- 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 +32 -49
- package/templates/assistkick-product-system/packages/frontend/src/components/SidePanel.tsx +43 -48
- package/templates/assistkick-product-system/packages/frontend/src/components/TerminalView.tsx +121 -52
- package/templates/assistkick-product-system/packages/frontend/src/components/Toolbar.tsx +20 -14
- 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 +103 -87
- package/templates/assistkick-product-system/packages/frontend/src/components/ds/KanbanCardShowcase.tsx +9 -188
- 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 +81 -37
- 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/GenerateTTSNode.tsx +52 -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/RebuildBundleNode.tsx +20 -0
- package/templates/assistkick-product-system/packages/frontend/src/components/workflow/RenderVideoNode.tsx +72 -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 +341 -0
- package/templates/assistkick-product-system/packages/frontend/src/components/workflow/WorkflowMonitorModal.tsx +643 -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 +246 -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 +136 -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/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 +1 -1
- package/templates/assistkick-product-system/packages/frontend/src/routes/DashboardLayout.tsx +2 -2
- package/templates/assistkick-product-system/packages/frontend/src/routes/FilesRoute.tsx +13 -0
- package/templates/assistkick-product-system/packages/frontend/src/routes/GraphRoute.tsx +2 -2
- 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/useProjectStore.ts +6 -3
- package/templates/assistkick-product-system/packages/frontend/src/stores/useSidePanelStore.ts +4 -4
- package/templates/assistkick-product-system/packages/frontend/src/styles/index.css +275 -3535
- 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 +5 -0
- 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/0014_nifty_punisher.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/0014_snapshot.json +1545 -0
- package/templates/assistkick-product-system/packages/shared/db/migrations/meta/_journal.json +77 -0
- package/templates/assistkick-product-system/packages/shared/db/schema.ts +114 -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 +5 -0
- package/templates/assistkick-product-system/packages/shared/lib/workflow_engine.test.ts +1999 -0
- package/templates/assistkick-product-system/packages/shared/lib/workflow_engine.ts +1437 -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 +181 -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-developer/SKILL.md +3 -0
- package/templates/skills/assistkick-developer/references/react_development_guidelines.md +225 -0
- 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,181 @@
|
|
|
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 initContent: string;
|
|
23
|
+
let dockerfileContent: string;
|
|
24
|
+
|
|
25
|
+
it('loads source files', async () => {
|
|
26
|
+
serviceContent = await readFile(join(BACKEND_SRC, 'services', 'video_render_service.ts'), 'utf-8');
|
|
27
|
+
routeContent = await readFile(join(BACKEND_SRC, 'routes', 'video.ts'), 'utf-8');
|
|
28
|
+
schemaContent = await readFile(join(SHARED_DB, 'schema.ts'), 'utf-8');
|
|
29
|
+
serverContent = await readFile(join(BACKEND_SRC, 'server.ts'), 'utf-8');
|
|
30
|
+
initContent = await readFile(join(BACKEND_SRC, 'services', 'init.ts'), 'utf-8');
|
|
31
|
+
dockerfileContent = await readFile(join(SOURCE_ROOT, '..', 'Dockerfile'), 'utf-8');
|
|
32
|
+
assert.ok(serviceContent.length > 0);
|
|
33
|
+
assert.ok(routeContent.length > 0);
|
|
34
|
+
assert.ok(schemaContent.length > 0);
|
|
35
|
+
assert.ok(serverContent.length > 0);
|
|
36
|
+
assert.ok(dockerfileContent.length > 0);
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
describe('Schema', () => {
|
|
40
|
+
it('defines video_renders table', () => {
|
|
41
|
+
assert.ok(schemaContent.includes("videoRenders = sqliteTable('video_renders'"), 'schema should define video_renders table');
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
it('has required columns', () => {
|
|
45
|
+
assert.ok(schemaContent.includes("projectId: text('project_id')"), 'should have projectId column');
|
|
46
|
+
assert.ok(schemaContent.includes("featureId: text('feature_id')"), 'should have featureId column');
|
|
47
|
+
assert.ok(schemaContent.includes("compositionId: text('composition_id')"), 'should have compositionId column');
|
|
48
|
+
assert.ok(schemaContent.includes("status: text('status')"), 'should have status column');
|
|
49
|
+
assert.ok(schemaContent.includes("progress: real('progress')"), 'should have progress column');
|
|
50
|
+
assert.ok(schemaContent.includes("filePath: text('file_path')"), 'should have filePath column');
|
|
51
|
+
assert.ok(schemaContent.includes("fileSize: integer('file_size')"), 'should have fileSize column');
|
|
52
|
+
assert.ok(schemaContent.includes("durationSeconds: real('duration_seconds')"), 'should have durationSeconds column');
|
|
53
|
+
assert.ok(schemaContent.includes("error: text('error')"), 'should have error column');
|
|
54
|
+
assert.ok(schemaContent.includes("completedAt: text('completed_at')"), 'should have completedAt column');
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
describe('Service class', () => {
|
|
59
|
+
it('exports VideoRenderService class', () => {
|
|
60
|
+
assert.ok(serviceContent.includes('export class VideoRenderService'), 'should export VideoRenderService class');
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
it('uses constructor DI', () => {
|
|
64
|
+
assert.ok(serviceContent.includes('constructor({ getDb, workspacesDir, bundleOutputDir, log }'), 'should use constructor DI');
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
it('uses arrow functions for methods', () => {
|
|
68
|
+
assert.ok(serviceContent.includes('startRender = async'), 'startRender should be an arrow function');
|
|
69
|
+
assert.ok(serviceContent.includes('getStatus = async'), 'getStatus should be an arrow function');
|
|
70
|
+
assert.ok(serviceContent.includes('getFilePath = async'), 'getFilePath should be an arrow function');
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
it('uses @remotion/renderer for rendering', () => {
|
|
74
|
+
assert.ok(serviceContent.includes("from '@remotion/renderer'"), 'should import from @remotion/renderer');
|
|
75
|
+
assert.ok(serviceContent.includes('renderMedia'), 'should use renderMedia');
|
|
76
|
+
assert.ok(serviceContent.includes('selectComposition'), 'should use selectComposition');
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
it('tracks render progress', () => {
|
|
80
|
+
assert.ok(serviceContent.includes('onProgress'), 'should have onProgress callback');
|
|
81
|
+
assert.ok(serviceContent.includes('progress'), 'should update progress');
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
it('outputs to correct path pattern', () => {
|
|
85
|
+
assert.ok(serviceContent.includes("'media'"), 'should output under media directory');
|
|
86
|
+
assert.ok(serviceContent.includes("'outputs'"), 'should output to outputs subdirectory');
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
it('handles render status lifecycle', () => {
|
|
90
|
+
assert.ok(serviceContent.includes("status: 'queued'"), 'should set initial status to queued');
|
|
91
|
+
assert.ok(serviceContent.includes("status: 'rendering'"), 'should transition to rendering');
|
|
92
|
+
assert.ok(serviceContent.includes("status: 'complete'"), 'should transition to complete');
|
|
93
|
+
assert.ok(serviceContent.includes("status: 'failed'"), 'should transition to failed');
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
it('passes mediaBasePath as inputProps', () => {
|
|
97
|
+
assert.ok(serviceContent.includes('mediaBasePath'), 'should pass mediaBasePath');
|
|
98
|
+
assert.ok(serviceContent.includes('inputProps'), 'should set inputProps for composition');
|
|
99
|
+
});
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
describe('API routes', () => {
|
|
103
|
+
it('has POST /render endpoint', () => {
|
|
104
|
+
assert.ok(routeContent.includes("router.post('/render'"), 'should have POST /render route');
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
it('has GET /render/:id endpoint', () => {
|
|
108
|
+
assert.ok(routeContent.includes("router.get('/render/:id'"), 'should have GET /render/:id route');
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
it('has GET /file/:renderId endpoint', () => {
|
|
112
|
+
assert.ok(routeContent.includes("router.get('/file/:renderId'"), 'should have GET /file/:renderId route');
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
it('validates required POST parameters', () => {
|
|
116
|
+
assert.ok(routeContent.includes("'compositionId is required'"), 'should validate compositionId');
|
|
117
|
+
assert.ok(routeContent.includes("'projectId is required'"), 'should validate projectId');
|
|
118
|
+
assert.ok(routeContent.includes("'featureId is required'"), 'should validate featureId');
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
it('accepts render settings', () => {
|
|
122
|
+
assert.ok(routeContent.includes('resolution'), 'should accept resolution parameter');
|
|
123
|
+
assert.ok(routeContent.includes('fileOutputPrefix'), 'should accept fileOutputPrefix parameter');
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
it('serves MP4 files with sendFile', () => {
|
|
127
|
+
assert.ok(routeContent.includes('res.sendFile'), 'should use res.sendFile for MP4 delivery');
|
|
128
|
+
});
|
|
129
|
+
});
|
|
130
|
+
|
|
131
|
+
describe('Server integration', () => {
|
|
132
|
+
it('imports VideoRenderService in init.ts', () => {
|
|
133
|
+
assert.ok(initContent.includes("import { VideoRenderService }"), 'init.ts should import VideoRenderService');
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
it('instantiates VideoRenderService with DI in init.ts', () => {
|
|
137
|
+
assert.ok(initContent.includes('new VideoRenderService('), 'init.ts should instantiate VideoRenderService');
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
it('passes videoRenderService to video routes', () => {
|
|
141
|
+
assert.ok(serverContent.includes('videoRenderService'), 'server should pass videoRenderService to routes');
|
|
142
|
+
});
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
describe('Dockerfile', () => {
|
|
146
|
+
it('installs Chromium', () => {
|
|
147
|
+
assert.ok(dockerfileContent.includes('chromium'), 'Dockerfile should install chromium');
|
|
148
|
+
});
|
|
149
|
+
|
|
150
|
+
it('sets REMOTION_CHROME_EXECUTABLE_PATH', () => {
|
|
151
|
+
assert.ok(dockerfileContent.includes('REMOTION_CHROME_EXECUTABLE_PATH'), 'should set REMOTION_CHROME_EXECUTABLE_PATH');
|
|
152
|
+
});
|
|
153
|
+
|
|
154
|
+
it('sets PUPPETEER_EXECUTABLE_PATH', () => {
|
|
155
|
+
assert.ok(dockerfileContent.includes('PUPPETEER_EXECUTABLE_PATH'), 'should set PUPPETEER_EXECUTABLE_PATH');
|
|
156
|
+
});
|
|
157
|
+
});
|
|
158
|
+
});
|
|
159
|
+
|
|
160
|
+
describe('VideoRenderService resolution parsing', () => {
|
|
161
|
+
it('parses standard resolution', () => {
|
|
162
|
+
// Test the parseResolution logic by importing dynamically
|
|
163
|
+
const parseResolution = (resolution?: string): { width: number; height: number } => {
|
|
164
|
+
if (!resolution) return { width: 1920, height: 1080 };
|
|
165
|
+
const parts = resolution.split('x');
|
|
166
|
+
if (parts.length !== 2) return { width: 1920, height: 1080 };
|
|
167
|
+
const width = parseInt(parts[0], 10);
|
|
168
|
+
const height = parseInt(parts[1], 10);
|
|
169
|
+
if (isNaN(width) || isNaN(height)) return { width: 1920, height: 1080 };
|
|
170
|
+
return { width, height };
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
assert.deepStrictEqual(parseResolution('1920x1080'), { width: 1920, height: 1080 });
|
|
174
|
+
assert.deepStrictEqual(parseResolution('1080x1920'), { width: 1080, height: 1920 });
|
|
175
|
+
assert.deepStrictEqual(parseResolution('720x480'), { width: 720, height: 480 });
|
|
176
|
+
assert.deepStrictEqual(parseResolution(undefined), { width: 1920, height: 1080 });
|
|
177
|
+
assert.deepStrictEqual(parseResolution('invalid'), { width: 1920, height: 1080 });
|
|
178
|
+
assert.deepStrictEqual(parseResolution('axb'), { width: 1920, height: 1080 });
|
|
179
|
+
assert.deepStrictEqual(parseResolution(''), { width: 1920, height: 1080 });
|
|
180
|
+
});
|
|
181
|
+
});
|