({ args })
| 907 | }, |
| 908 | }, |
| 909 | async run({ args }) { |
| 910 | ensureDOMParser(); |
| 911 | const runtime = normalizeRuntime(args.runtime, commandOptions.defaultRuntime); |
| 912 | if (runtime === "css" || runtime === "anime") { |
| 913 | console.log( |
| 914 | c.dim( |
| 915 | `${commandOptions.name}: ${runtime} output is a static authoring surface; use validate/render/snapshot to verify runtime adapter seekability.`, |
| 916 | ), |
| 917 | ); |
| 918 | console.log(); |
| 919 | } |
| 920 | const { comps: rawComps, allComps, projectName, projectDir } = resolveScope(args); |
| 921 | const comps = filterCompositionsByRuntime(rawComps, runtime); |
| 922 | |
| 923 | // --shot: 3D onion-skin self-verify screenshot. Returns true when the command |
| 924 | // should stop (guard failure) so run() stays small. |
| 925 | if (args.shot && (await runOnionShot(comps, allComps, projectDir, args))) return; |
| 926 | |
| 927 | if (args.json) { |
| 928 | console.log( |
| 929 | JSON.stringify(withMeta({ project: projectName, runtime, compositions: comps }), null, 2), |
| 930 | ); |
| 931 | return; |
| 932 | } |
| 933 | |
| 934 | const total = comps.reduce( |
| 935 | (n, cmp) => n + cmp.tweens.length + cmp.cssKeyframes.length + cmp.anime.length, |
| 936 | 0, |
| 937 | ); |
| 938 | if (total === 0) { |
| 939 | console.log(`${c.success("◇")} ${c.accent(projectName)} ${c.dim("— no keyframes found")}`); |
| 940 | return; |
| 941 | } |
| 942 | console.log( |
| 943 | `${c.success("◇")} ${c.accent(projectName)} ${c.dim("—")} ${c.dim(`${total} item${total === 1 ? "" : "s"}`)}`, |
| 944 | ); |
| 945 | console.log(); |
| 946 | for (const cmp of comps) printComposition(cmp); |
| 947 | console.log( |
| 948 | c.dim( |
| 949 | `Tip: edit the keyframes in source, then \`${commandOptions.invocation} --shot out.png\` to see the rendered motion.`, |
| 950 | ), |
| 951 | ); |
| 952 | }, |
| 953 | }); |
| 954 | } |
| 955 |
nothing calls this directly
no test coverage detected