@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.
- package/.env.example +6 -39
- package/GETTING_STARTED.developers.md +87 -0
- package/README.md +94 -238
- package/SKILL.developer.md +430 -104
- package/dist/src/account-pages.js +1 -1
- package/dist/src/app.js +93 -5
- package/dist/src/cli.js +456 -8
- package/dist/src/config.js +3 -2
- package/dist/src/context.js +30 -11
- package/dist/src/db.js +2 -57
- package/dist/src/dev-app.js +0 -1
- package/dist/src/index.js +4 -2
- package/dist/src/lib/template-paths.js +21 -0
- package/dist/src/runtime.js +3 -1
- package/dist/src/services/auth.js +4 -4
- package/dist/src/services/job-logs.js +186 -0
- package/dist/src/services/jobs.js +3 -2
- package/dist/src/services/providers.js +14 -6
- package/dist/src/services/storage.js +85 -2
- package/dist/src/services/template-sources.js +29 -3
- package/dist/templates/template_0000/src/lib/images.js +46 -86
- package/dist/templates/template_0000/src/template.js +277 -53
- package/package.json +5 -6
- package/templates/template_0000/README.md +8 -52
- package/templates/template_0000/SKILL.md +35 -3
- package/templates/template_0000/package.json +3 -6
- package/templates/template_0000/src/lib/images.js +46 -86
- package/templates/template_0000/src/lib/images.ts +55 -98
- package/templates/template_0000/src/template-dna.js +9 -0
- package/templates/template_0000/src/template.js +523 -199
- package/templates/template_0000/src/template.ts +356 -61
- package/templates/template_0000/template.config.json +7 -12
- package/AWS_REMOTION_HANDOFF.md +0 -311
- package/PLATFORM_SPEC.md +0 -1039
- package/SKILL.director.md +0 -599
- package/dist/infra/cdk/bin/vidfarm-prod.js +0 -59
- package/dist/infra/cdk/lib/vidfarm-prod-stack.js +0 -212
- package/templates/template_0000/package-lock.json +0 -5505
- package/templates/template_0000/scripts/create-site.mjs +0 -27
- 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
|
-
}
|