@mevdragon/vidfarm-devcli 0.2.1 → 0.2.3

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.
Files changed (40) hide show
  1. package/.env.example +6 -39
  2. package/GETTING_STARTED.developers.md +87 -0
  3. package/README.md +94 -238
  4. package/SKILL.developer.md +430 -104
  5. package/dist/src/account-pages.js +1 -1
  6. package/dist/src/app.js +93 -5
  7. package/dist/src/cli.js +456 -8
  8. package/dist/src/config.js +3 -2
  9. package/dist/src/context.js +30 -11
  10. package/dist/src/db.js +2 -57
  11. package/dist/src/dev-app.js +0 -1
  12. package/dist/src/index.js +4 -2
  13. package/dist/src/lib/template-paths.js +21 -0
  14. package/dist/src/runtime.js +3 -1
  15. package/dist/src/services/auth.js +4 -4
  16. package/dist/src/services/job-logs.js +186 -0
  17. package/dist/src/services/jobs.js +3 -2
  18. package/dist/src/services/providers.js +14 -6
  19. package/dist/src/services/storage.js +85 -2
  20. package/dist/src/services/template-sources.js +29 -3
  21. package/dist/templates/template_0000/src/lib/images.js +46 -86
  22. package/dist/templates/template_0000/src/template.js +277 -53
  23. package/package.json +5 -6
  24. package/templates/template_0000/README.md +8 -52
  25. package/templates/template_0000/SKILL.md +35 -3
  26. package/templates/template_0000/package.json +3 -6
  27. package/templates/template_0000/src/lib/images.js +46 -86
  28. package/templates/template_0000/src/lib/images.ts +55 -98
  29. package/templates/template_0000/src/template-dna.js +9 -0
  30. package/templates/template_0000/src/template.js +523 -199
  31. package/templates/template_0000/src/template.ts +356 -61
  32. package/templates/template_0000/template.config.json +7 -12
  33. package/AWS_REMOTION_HANDOFF.md +0 -311
  34. package/PLATFORM_SPEC.md +0 -1039
  35. package/SKILL.director.md +0 -599
  36. package/dist/infra/cdk/bin/vidfarm-prod.js +0 -59
  37. package/dist/infra/cdk/lib/vidfarm-prod-stack.js +0 -212
  38. package/templates/template_0000/package-lock.json +0 -5505
  39. package/templates/template_0000/scripts/create-site.mjs +0 -27
  40. package/templates/template_0000/scripts/render-cloud.mjs +0 -72
@@ -1,27 +0,0 @@
1
- import { readFileSync } from "node:fs";
2
- import path from "node:path";
3
- import { fileURLToPath } from "node:url";
4
- import { execFileSync } from "node:child_process";
5
-
6
- const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
7
- const config = JSON.parse(readFileSync(path.join(root, "template.config.json"), "utf8"));
8
- const remotion = config.remotion;
9
-
10
- execFileSync(
11
- path.join(root, "node_modules", ".bin", "remotion"),
12
- [
13
- "lambda",
14
- "sites",
15
- "create",
16
- remotion.entry_point,
17
- "--site-name",
18
- remotion.site_name,
19
- "--region",
20
- remotion.region
21
- ],
22
- {
23
- cwd: root,
24
- stdio: "inherit",
25
- env: process.env
26
- }
27
- );
@@ -1,72 +0,0 @@
1
- import { readFileSync, writeFileSync } from "node:fs";
2
- import path from "node:path";
3
- import { fileURLToPath } from "node:url";
4
- import { execFileSync } from "node:child_process";
5
-
6
- const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
7
- const config = JSON.parse(readFileSync(path.join(root, "template.config.json"), "utf8"));
8
- const remotion = config.remotion;
9
- const args = process.argv.slice(2);
10
- const manifestArgIndex = args.findIndex((value) => value === "--manifest");
11
- const propsPath = manifestArgIndex >= 0 && args[manifestArgIndex + 1]
12
- ? await buildPropsFileFromManifest(args[manifestArgIndex + 1])
13
- : remotion.props_file;
14
-
15
- execFileSync(
16
- path.join(root, "node_modules", ".bin", "remotion"),
17
- [
18
- "lambda",
19
- "render",
20
- remotion.serve_url,
21
- remotion.composition_id,
22
- "--props",
23
- propsPath,
24
- "--region",
25
- remotion.region,
26
- "--function-name",
27
- remotion.function_name,
28
- "--timeout",
29
- String(remotion.timeout_ms),
30
- "--frames-per-lambda",
31
- String(remotion.frames_per_lambda)
32
- ],
33
- {
34
- cwd: root,
35
- stdio: "inherit",
36
- env: process.env
37
- }
38
- );
39
-
40
- async function buildPropsFileFromManifest(manifestInput) {
41
- const manifest = await readManifest(manifestInput);
42
- const slides = Array.isArray(manifest.slides)
43
- ? manifest.slides
44
- .map((slide) => slide?.frameImageUrl ? { imageUrl: slide.frameImageUrl } : null)
45
- .filter(Boolean)
46
- : [];
47
-
48
- if (!slides.length) {
49
- throw new Error(`Manifest did not contain any frameImageUrl slides: ${manifestPath}`);
50
- }
51
-
52
- const propsPath = path.join(root, ".tmp-render-cloud-props.json");
53
- const props = {
54
- slides,
55
- secondsPerSlide: manifest.secondsPerSlide ?? 4
56
- };
57
- writeFileSync(propsPath, JSON.stringify(props, null, 2));
58
- return propsPath;
59
- }
60
-
61
- async function readManifest(manifestInput) {
62
- if (/^https?:\/\//i.test(manifestInput)) {
63
- const response = await fetch(manifestInput);
64
- if (!response.ok) {
65
- throw new Error(`Could not fetch manifest URL ${manifestInput}: ${response.status}`);
66
- }
67
- return await response.json();
68
- }
69
-
70
- const manifestPath = path.isAbsolute(manifestInput) ? manifestInput : path.resolve(process.cwd(), manifestInput);
71
- return JSON.parse(readFileSync(manifestPath, "utf8"));
72
- }