@anvpx/motion-cli 0.0.0-stage → 0.1.1
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/LICENSE +21 -0
- package/README.md +121 -2
- package/dist/analyze/command.d.ts +2 -0
- package/dist/analyze/command.js +190 -0
- package/dist/approval/approval.d.ts +32 -0
- package/dist/approval/approval.js +141 -0
- package/dist/approval/command.d.ts +2 -0
- package/dist/approval/command.js +255 -0
- package/dist/approval/gate.d.ts +7 -0
- package/dist/approval/gate.js +23 -0
- package/dist/approval/hash.d.ts +71 -0
- package/dist/approval/hash.js +464 -0
- package/dist/args.d.ts +30 -0
- package/dist/args.js +53 -0
- package/dist/assets/command.d.ts +2 -0
- package/dist/assets/command.js +165 -0
- package/dist/captions/command.d.ts +2 -0
- package/dist/captions/command.js +341 -0
- package/dist/captions/cues.d.ts +10 -0
- package/dist/captions/cues.js +61 -0
- package/dist/catalog/command.d.ts +2 -0
- package/dist/catalog/command.js +60 -0
- package/dist/catalog/format.d.ts +13 -0
- package/dist/catalog/format.js +54 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.js +35 -0
- package/dist/commands.d.ts +3 -0
- package/dist/commands.js +59 -0
- package/dist/compare/command.d.ts +4 -0
- package/dist/compare/command.js +144 -0
- package/dist/contact/argv.d.ts +24 -0
- package/dist/contact/argv.js +42 -0
- package/dist/contact/command.d.ts +2 -0
- package/dist/contact/command.js +79 -0
- package/dist/doctor/checks.d.ts +25 -0
- package/dist/doctor/checks.js +571 -0
- package/dist/doctor/command.d.ts +4 -0
- package/dist/doctor/command.js +88 -0
- package/dist/doctor/format.d.ts +7 -0
- package/dist/doctor/format.js +41 -0
- package/dist/doctor/heal.d.ts +14 -0
- package/dist/doctor/heal.js +71 -0
- package/dist/doctor/pins.d.ts +8 -0
- package/dist/doctor/pins.js +28 -0
- package/dist/doctor/skills.d.ts +15 -0
- package/dist/doctor/skills.js +58 -0
- package/dist/doctor/types.d.ts +36 -0
- package/dist/doctor/types.js +1 -0
- package/dist/doctor/vendored.d.ts +15 -0
- package/dist/doctor/vendored.js +90 -0
- package/dist/doctor/version.d.ts +8 -0
- package/dist/doctor/version.js +11 -0
- package/dist/exit-codes.d.ts +16 -0
- package/dist/exit-codes.js +15 -0
- package/dist/fit/command.d.ts +5 -0
- package/dist/fit/command.js +154 -0
- package/dist/fit/solve.d.ts +21 -0
- package/dist/fit/solve.js +80 -0
- package/dist/fit/target.d.ts +18 -0
- package/dist/fit/target.js +47 -0
- package/dist/generate3d/command.d.ts +3 -0
- package/dist/generate3d/command.js +38 -0
- package/dist/generate3d/run.d.ts +39 -0
- package/dist/generate3d/run.js +77 -0
- package/dist/icon/command.d.ts +2 -0
- package/dist/icon/command.js +113 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.js +16 -0
- package/dist/install-mk.d.ts +31 -0
- package/dist/install-mk.js +168 -0
- package/dist/integration/preview.integration.d.ts +1 -0
- package/dist/integration/preview.integration.js +53 -0
- package/dist/integration/smoke.integration.d.ts +1 -0
- package/dist/integration/smoke.integration.js +91 -0
- package/dist/main.d.ts +2 -0
- package/dist/main.js +4 -0
- package/dist/node-io.d.ts +14 -0
- package/dist/node-io.js +152 -0
- package/dist/optimize/command.d.ts +12 -0
- package/dist/optimize/command.js +110 -0
- package/dist/packs/command.d.ts +2 -0
- package/dist/packs/command.js +109 -0
- package/dist/patch/apply.d.ts +36 -0
- package/dist/patch/apply.js +186 -0
- package/dist/patch/command.d.ts +2 -0
- package/dist/patch/command.js +92 -0
- package/dist/plugin/install.d.ts +40 -0
- package/dist/plugin/install.js +170 -0
- package/dist/preview/command.d.ts +10 -0
- package/dist/preview/command.js +764 -0
- package/dist/preview/manifest.d.ts +94 -0
- package/dist/preview/manifest.js +19 -0
- package/dist/preview/pack.d.ts +24 -0
- package/dist/preview/pack.js +53 -0
- package/dist/preview/plan.d.ts +58 -0
- package/dist/preview/plan.js +160 -0
- package/dist/preview/provenance.d.ts +23 -0
- package/dist/preview/provenance.js +38 -0
- package/dist/publish/command.d.ts +2 -0
- package/dist/publish/command.js +70 -0
- package/dist/publish/player.d.ts +25 -0
- package/dist/publish/player.js +108 -0
- package/dist/publish/static.d.ts +16 -0
- package/dist/publish/static.js +78 -0
- package/dist/qc.d.ts +2 -0
- package/dist/qc.js +192 -0
- package/dist/scene/author.d.ts +16 -0
- package/dist/scene/author.js +279 -0
- package/dist/scene/command.d.ts +2 -0
- package/dist/scene/command.js +110 -0
- package/dist/scene/ops.d.ts +23 -0
- package/dist/scene/ops.js +151 -0
- package/dist/state/command.d.ts +2 -0
- package/dist/state/command.js +128 -0
- package/dist/state/evidence.d.ts +71 -0
- package/dist/state/evidence.js +243 -0
- package/dist/storyboard/check.d.ts +21 -0
- package/dist/storyboard/check.js +39 -0
- package/dist/storyboard/containment.d.ts +24 -0
- package/dist/storyboard/containment.js +43 -0
- package/dist/storyboard/custom.d.ts +15 -0
- package/dist/storyboard/custom.js +133 -0
- package/dist/storyboard/edit.d.ts +19 -0
- package/dist/storyboard/edit.js +39 -0
- package/dist/storyboard/load.d.ts +11 -0
- package/dist/storyboard/load.js +52 -0
- package/dist/storyboard/report.d.ts +5 -0
- package/dist/storyboard/report.js +8 -0
- package/dist/template/coerce.d.ts +6 -0
- package/dist/template/coerce.js +44 -0
- package/dist/template/command.d.ts +5 -0
- package/dist/template/command.js +163 -0
- package/dist/template/env.d.ts +34 -0
- package/dist/template/env.js +38 -0
- package/dist/template/fork.d.ts +8 -0
- package/dist/template/fork.js +156 -0
- package/dist/template/format.d.ts +21 -0
- package/dist/template/format.js +161 -0
- package/dist/template/list.d.ts +15 -0
- package/dist/template/list.js +116 -0
- package/dist/template/new.d.ts +6 -0
- package/dist/template/new.js +302 -0
- package/dist/testing/env.d.ts +8 -0
- package/dist/testing/env.js +19 -0
- package/dist/testing/fakes.d.ts +33 -0
- package/dist/testing/fakes.js +95 -0
- package/dist/testing/fixtures.d.ts +8 -0
- package/dist/testing/fixtures.js +6 -0
- package/dist/testing/probe.d.ts +15 -0
- package/dist/testing/probe.js +20 -0
- package/dist/testing/project.d.ts +22 -0
- package/dist/testing/project.js +26 -0
- package/dist/tooling/session.d.ts +40 -0
- package/dist/tooling/session.js +106 -0
- package/dist/types.d.ts +59 -0
- package/dist/types.js +1 -0
- package/dist/verify/audio-loudness.d.ts +46 -0
- package/dist/verify/audio-loudness.js +186 -0
- package/dist/verify/command.d.ts +2 -0
- package/dist/verify/command.js +161 -0
- package/dist/verify/determinism.d.ts +30 -0
- package/dist/verify/determinism.js +59 -0
- package/dist/verify/expectation.d.ts +15 -0
- package/dist/verify/expectation.js +19 -0
- package/dist/verify/media-events.d.ts +61 -0
- package/dist/verify/media-events.js +174 -0
- package/dist/verify/platform.d.ts +33 -0
- package/dist/verify/platform.js +59 -0
- package/dist/verify/probe.d.ts +14 -0
- package/dist/verify/probe.js +23 -0
- package/dist/verify/report.d.ts +15 -0
- package/dist/verify/report.js +45 -0
- package/dist/verify/run.d.ts +27 -0
- package/dist/verify/run.js +53 -0
- package/dist/voice/command.d.ts +3 -0
- package/dist/voice/command.js +49 -0
- package/dist/voice/manifest.d.ts +33 -0
- package/dist/voice/manifest.js +69 -0
- package/dist/voice/run.d.ts +27 -0
- package/dist/voice/run.js +190 -0
- package/dist/workflow/build.d.ts +2 -0
- package/dist/workflow/build.js +25 -0
- package/dist/workflow/draft.d.ts +9 -0
- package/dist/workflow/draft.js +215 -0
- package/dist/workflow/finish.d.ts +23 -0
- package/dist/workflow/finish.js +28 -0
- package/dist/workflow/project.d.ts +73 -0
- package/dist/workflow/project.js +198 -0
- package/dist/workflow/provenance.d.ts +18 -0
- package/dist/workflow/provenance.js +36 -0
- package/dist/workflow/render.d.ts +31 -0
- package/dist/workflow/render.js +721 -0
- package/dist/workflow/still.d.ts +5 -0
- package/dist/workflow/still.js +62 -0
- package/dist/workflow/validate.d.ts +2 -0
- package/dist/workflow/validate.js +49 -0
- package/package.json +38 -3
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { Command } from "../types.ts";
|
|
2
|
+
export declare const STILLS_DIR = "stills";
|
|
3
|
+
/** The `hyperframes snapshot` argv for one `--at` timestamp; shared by every command that captures a still. */
|
|
4
|
+
export declare const stillSnapshotArgs: (at: string) => readonly string[];
|
|
5
|
+
export declare const stillCommand: Command;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { join } from "node:path";
|
|
2
|
+
import { textFlag, usageError } from "../args.js";
|
|
3
|
+
import { EXIT } from "../exit-codes.js";
|
|
4
|
+
import { runInProject } from "../tooling/session.js";
|
|
5
|
+
import { parseBuildArgs, prepareProject } from "./project.js";
|
|
6
|
+
const USAGE = `mk still <storyboard.json> (--at 1,5,9 | --review) [--out <dir>] [--assets <dir>] [--ledger <assets.json>]
|
|
7
|
+
|
|
8
|
+
Build, then capture PNGs with \`hyperframes snapshot\`.
|
|
9
|
+
--at: one PNG per timestamp (seconds) with \`--no-end\`.
|
|
10
|
+
--review: the upstream review set instead (scene starts, middles, cut
|
|
11
|
+
seams plus phone-width beats); use either --at or --review, not both.
|
|
12
|
+
PNGs go to <out>/stills; the paths are printed. Output of hyperframes: <out>/render-log.txt.
|
|
13
|
+
`;
|
|
14
|
+
export const STILLS_DIR = "stills";
|
|
15
|
+
const TIMES = /^\d+(\.\d+)?(,\d+(\.\d+)?)*$/;
|
|
16
|
+
/** The `hyperframes snapshot` argv for one `--at` timestamp; shared by every command that captures a still. */
|
|
17
|
+
export const stillSnapshotArgs = (at) => [
|
|
18
|
+
"snapshot",
|
|
19
|
+
".",
|
|
20
|
+
"--at",
|
|
21
|
+
at,
|
|
22
|
+
"--no-end",
|
|
23
|
+
"-o",
|
|
24
|
+
STILLS_DIR,
|
|
25
|
+
];
|
|
26
|
+
async function printStills(dir, io) {
|
|
27
|
+
const names = await io.host.listDir(dir).catch(() => []);
|
|
28
|
+
const shots = names.filter((name) => /\.(png|jpg|jpeg)$/.test(name)).sort();
|
|
29
|
+
if (shots.length === 0) {
|
|
30
|
+
io.stderr(`mk: no stills were written to ${dir}\n`);
|
|
31
|
+
return EXIT.ERROR;
|
|
32
|
+
}
|
|
33
|
+
io.stdout(shots.map((name) => `${join(dir, name)}\n`).join(""));
|
|
34
|
+
return EXIT.OK;
|
|
35
|
+
}
|
|
36
|
+
export const stillCommand = {
|
|
37
|
+
name: "still",
|
|
38
|
+
summary: "build, then capture PNG stills at --at timestamps or --review the upstream set",
|
|
39
|
+
async run(args, io) {
|
|
40
|
+
const parsed = parseBuildArgs("still", USAGE, args, { at: { type: "string" }, review: { type: "boolean" } }, io);
|
|
41
|
+
if (parsed.kind === "exit")
|
|
42
|
+
return parsed.code;
|
|
43
|
+
const at = textFlag(parsed.flags, "at");
|
|
44
|
+
const review = parsed.flags.review === true;
|
|
45
|
+
if (review && at !== undefined) {
|
|
46
|
+
return usageError("still", USAGE, "use either --at or --review, not both", io).code;
|
|
47
|
+
}
|
|
48
|
+
if (!review && (at === undefined || !TIMES.test(at))) {
|
|
49
|
+
return usageError("still", USAGE, "--at needs seconds like 1,5,9", io).code;
|
|
50
|
+
}
|
|
51
|
+
const prepared = await prepareProject(parsed.request, io);
|
|
52
|
+
if (!prepared.ok)
|
|
53
|
+
return prepared.code;
|
|
54
|
+
const snapArgs = review
|
|
55
|
+
? ["snapshot", ".", "--review", "-o", STILLS_DIR]
|
|
56
|
+
: stillSnapshotArgs(at);
|
|
57
|
+
const code = await runInProject(io, prepared.outDir, async (session) => {
|
|
58
|
+
await session.hf([...snapArgs]);
|
|
59
|
+
});
|
|
60
|
+
return code === 0 ? printStills(join(prepared.outDir, STILLS_DIR), io) : code;
|
|
61
|
+
},
|
|
62
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { parseFlags, requireStoryboard } from "../args.js";
|
|
2
|
+
import { EXIT } from "../exit-codes.js";
|
|
3
|
+
import { checkStoryboard, rootError } from "../storyboard/check.js";
|
|
4
|
+
import { readCustomScenes } from "../storyboard/custom.js";
|
|
5
|
+
import { readJsonFile } from "../storyboard/load.js";
|
|
6
|
+
import { formatFindings, summaryLine } from "../storyboard/report.js";
|
|
7
|
+
import { platformLookup } from "../verify/platform.js";
|
|
8
|
+
const USAGE = `mk validate <storyboard.json> [--json]
|
|
9
|
+
|
|
10
|
+
Validate a storyboard: schema, scene props, timing and lint.
|
|
11
|
+
Exit 0 when there are no errors (warnings allowed); 2 on validation errors, bad usage or unreadable files.
|
|
12
|
+
--json one JSON document {ok, errors, warnings}
|
|
13
|
+
`;
|
|
14
|
+
const printText = (report, io) => {
|
|
15
|
+
io.stdout(formatFindings([...report.errors, ...report.warnings]));
|
|
16
|
+
io.stdout(summaryLine(report.errors.length, report.warnings.length));
|
|
17
|
+
};
|
|
18
|
+
const printJson = (report, io) => {
|
|
19
|
+
const { errors, warnings } = report;
|
|
20
|
+
io.stdout(`${JSON.stringify({ ok: errors.length === 0, errors, warnings }, null, 2)}\n`);
|
|
21
|
+
};
|
|
22
|
+
export const validateCommand = {
|
|
23
|
+
name: "validate",
|
|
24
|
+
summary: "check a storyboard: schema, scene props, timing, lint",
|
|
25
|
+
async run(args, io) {
|
|
26
|
+
const parsed = parseFlags("validate", USAGE, args, { json: { type: "boolean" } }, io);
|
|
27
|
+
if (parsed.kind === "exit")
|
|
28
|
+
return parsed.code;
|
|
29
|
+
const path = requireStoryboard("validate", USAGE, parsed.positionals, io);
|
|
30
|
+
if (typeof path !== "string")
|
|
31
|
+
return path.code;
|
|
32
|
+
const loaded = await readJsonFile(path, io.host);
|
|
33
|
+
if (!loaded.ok && loaded.kind === "io") {
|
|
34
|
+
io.stderr(`mk validate: ${loaded.message}\n`);
|
|
35
|
+
return EXIT.USAGE;
|
|
36
|
+
}
|
|
37
|
+
const report = loaded.ok
|
|
38
|
+
? checkStoryboard(loaded.value, { platforms: await platformLookup(io.host) })
|
|
39
|
+
: { errors: [rootError(loaded.message)], warnings: [] };
|
|
40
|
+
if (loaded.ok && report.errors.length === 0) {
|
|
41
|
+
const custom = await readCustomScenes(loaded.value, path, io.host);
|
|
42
|
+
for (const finding of custom.findings) {
|
|
43
|
+
(finding.severity === "error" ? report.errors : report.warnings).push(finding);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
(parsed.flags.json ? printJson : printText)(report, io);
|
|
47
|
+
return report.errors.length === 0 ? EXIT.OK : EXIT.USAGE;
|
|
48
|
+
},
|
|
49
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,41 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@anvpx/motion-cli",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "The mk CLI for @anvpx/motion: validate, preview, approve and render storyboards.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "anvpx",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"engines": {
|
|
9
|
+
"node": ">=22"
|
|
10
|
+
},
|
|
11
|
+
"keywords": [
|
|
12
|
+
"motion-kit",
|
|
13
|
+
"cli",
|
|
14
|
+
"video",
|
|
15
|
+
"storyboard",
|
|
16
|
+
"animation"
|
|
17
|
+
],
|
|
18
|
+
"publishConfig": {
|
|
19
|
+
"access": "public"
|
|
20
|
+
},
|
|
21
|
+
"bin": {
|
|
22
|
+
"mk": "./dist/main.js"
|
|
23
|
+
},
|
|
24
|
+
"exports": {
|
|
25
|
+
".": "./dist/index.js",
|
|
26
|
+
"./package.json": "./package.json"
|
|
27
|
+
},
|
|
28
|
+
"files": [
|
|
29
|
+
"dist/**/*.js",
|
|
30
|
+
"dist/**/*.d.ts"
|
|
31
|
+
],
|
|
32
|
+
"dependencies": {
|
|
33
|
+
"@anvpx/motion-audio": "0.1.1",
|
|
34
|
+
"@anvpx/motion-build": "0.1.1",
|
|
35
|
+
"@anvpx/motion-schema": "0.1.1",
|
|
36
|
+
"@anvpx/motion-templates": "0.1.1"
|
|
37
|
+
},
|
|
38
|
+
"scripts": {
|
|
39
|
+
"test:integration": "vitest run --config vitest.integration.config.ts"
|
|
40
|
+
}
|
|
6
41
|
}
|