@vosjs/cli 0.54.1 → 0.54.2
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/{chunk-M7FLXLBN.js → chunk-MTOCJ2LC.js} +25 -21
- package/dist/{chunk-M7FLXLBN.js.map → chunk-MTOCJ2LC.js.map} +1 -1
- package/dist/cli.js +5 -3
- package/dist/cli.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/{run-SYDEWMK2.js → run-H23EUWAJ.js} +2 -2
- package/package.json +3 -3
- /package/dist/{run-SYDEWMK2.js.map → run-H23EUWAJ.js.map} +0 -0
|
@@ -9248,7 +9248,7 @@ import {
|
|
|
9248
9248
|
readdirSync as readdirSync4,
|
|
9249
9249
|
statSync as statSync5
|
|
9250
9250
|
} from "fs";
|
|
9251
|
-
import {
|
|
9251
|
+
import { dirname as dirname6, join as join21, relative as relative2, resolve as resolve9 } from "path";
|
|
9252
9252
|
import { pathToFileURL as pathToFileURL2 } from "url";
|
|
9253
9253
|
import { findFontFamily as findFontFamily3 } from "@vosjs/shared";
|
|
9254
9254
|
function detectEngine(dir) {
|
|
@@ -9614,7 +9614,8 @@ async function readInventory(source, opts) {
|
|
|
9614
9614
|
}
|
|
9615
9615
|
const scriptStrings = scriptStringsOf(read.scriptText);
|
|
9616
9616
|
return {
|
|
9617
|
-
source: relative2(process.cwd(), abs) ||
|
|
9617
|
+
source: relative2(process.cwd(), abs) || ".",
|
|
9618
|
+
root: abs.endsWith(".html") ? dirname6(abs) : abs,
|
|
9618
9619
|
engine,
|
|
9619
9620
|
width: read.width,
|
|
9620
9621
|
height: read.height,
|
|
@@ -9638,7 +9639,7 @@ async function readInventory(source, opts) {
|
|
|
9638
9639
|
// src/plugin/portScaffold.ts
|
|
9639
9640
|
import { spawnSync as spawnSync3 } from "child_process";
|
|
9640
9641
|
import { copyFileSync, existsSync as existsSync18, mkdirSync as mkdirSync4, writeFileSync as writeFileSync4 } from "fs";
|
|
9641
|
-
import { basename as
|
|
9642
|
+
import { basename as basename7, dirname as dirname7, join as join22, resolve as resolve10 } from "path";
|
|
9642
9643
|
import { findFontFamily as findFontFamily4, fontFaceUrl, nearestFontWeight } from "@vosjs/shared";
|
|
9643
9644
|
var DESIGN_HEIGHT = 1080;
|
|
9644
9645
|
function toHex(css) {
|
|
@@ -9847,7 +9848,7 @@ function planScaffold(inv, opts) {
|
|
|
9847
9848
|
const copies = [];
|
|
9848
9849
|
inv.media.filter((m) => m.kind === "audio" && m.src).forEach((m, i) => {
|
|
9849
9850
|
const from = resolve10(opts.sourceDir, m.src);
|
|
9850
|
-
const name =
|
|
9851
|
+
const name = basename7(from);
|
|
9851
9852
|
if (!existsSync18(from)) {
|
|
9852
9853
|
report.push(
|
|
9853
9854
|
`- the audio ${m.src} is not in the source folder; add it to doc.json by hand`
|
|
@@ -9891,6 +9892,7 @@ function planScaffold(inv, opts) {
|
|
|
9891
9892
|
elements: elements.length,
|
|
9892
9893
|
params: params.length,
|
|
9893
9894
|
painter,
|
|
9895
|
+
scores: audio.map((a) => String(a.key)),
|
|
9894
9896
|
extra: report
|
|
9895
9897
|
})
|
|
9896
9898
|
};
|
|
@@ -10004,7 +10006,9 @@ function reportText(inv, r) {
|
|
|
10004
10006
|
"",
|
|
10005
10007
|
`- ${r.elements} words as bound text elements, ${Object.keys(inv.palette).length} palette colours from the source's custom properties, ${r.params} knobs.`,
|
|
10006
10008
|
`- ${inv.scenes.length} scenes as labels${inv.scenes.length ? "" : " (none declared: name them as you translate)"}.`,
|
|
10007
|
-
...
|
|
10009
|
+
...r.scores.length ? [
|
|
10010
|
+
`- the score as a doc.json track (${r.scores.join(", ")}, copied beside the program; vos push uploads it).`
|
|
10011
|
+
] : [],
|
|
10008
10012
|
"",
|
|
10009
10013
|
"## Faces",
|
|
10010
10014
|
"",
|
|
@@ -10128,11 +10132,7 @@ async function scaffold(argv) {
|
|
|
10128
10132
|
strFlag(flags, "out") ?? join23(dirname8(from), "program")
|
|
10129
10133
|
);
|
|
10130
10134
|
const plan = planScaffold(inv, {
|
|
10131
|
-
sourceDir:
|
|
10132
|
-
resolve11(
|
|
10133
|
-
inv.source.endsWith(".html") ? inv.source : join23(inv.source, "index.html")
|
|
10134
|
-
)
|
|
10135
|
-
),
|
|
10135
|
+
sourceDir: scaffoldSourceDir(inv),
|
|
10136
10136
|
probeDuration: probeAudioDuration
|
|
10137
10137
|
});
|
|
10138
10138
|
writeScaffold(plan, outDir);
|
|
@@ -10151,14 +10151,18 @@ async function scaffold(argv) {
|
|
|
10151
10151
|
);
|
|
10152
10152
|
return EXIT_OK;
|
|
10153
10153
|
}
|
|
10154
|
+
function scaffoldSourceDir(inv) {
|
|
10155
|
+
if (inv.root) return inv.root;
|
|
10156
|
+
return inv.source.endsWith(".html") ? dirname8(resolve11(inv.source)) : resolve11(inv.source);
|
|
10157
|
+
}
|
|
10154
10158
|
|
|
10155
10159
|
// src/plugin/recipe.ts
|
|
10156
10160
|
import { readFileSync as readFileSync7 } from "fs";
|
|
10157
|
-
import { basename as
|
|
10161
|
+
import { basename as basename8 } from "path";
|
|
10158
10162
|
var BOOLEAN_FLAGS8 = /* @__PURE__ */ new Set(["json", "help"]);
|
|
10159
10163
|
var USAGE = "vos recipe push <file.md> (--folder <folderId|slug> | --asset <assetId>)";
|
|
10160
10164
|
function recipeFilename(file) {
|
|
10161
|
-
const name =
|
|
10165
|
+
const name = basename8(file);
|
|
10162
10166
|
if (!/\.md$/i.test(name)) {
|
|
10163
10167
|
throw new UsageError(`a recipe is a markdown file \u2014 ${name} is not .md`);
|
|
10164
10168
|
}
|
|
@@ -11246,7 +11250,7 @@ async function cmdActionsScript(input, flags) {
|
|
|
11246
11250
|
// src/plugin/ingest.ts
|
|
11247
11251
|
import { existsSync as existsSync20 } from "fs";
|
|
11248
11252
|
import { copyFile, mkdir as mkdir10, readFile as readFile16, stat as stat4 } from "fs/promises";
|
|
11249
|
-
import { basename as
|
|
11253
|
+
import { basename as basename9, join as join24, resolve as resolve14 } from "path";
|
|
11250
11254
|
import { inflateRawSync } from "zlib";
|
|
11251
11255
|
import {
|
|
11252
11256
|
cursorFromPlaywrightTrace,
|
|
@@ -11327,7 +11331,7 @@ async function copyRecording(src, dest, ext) {
|
|
|
11327
11331
|
}
|
|
11328
11332
|
}
|
|
11329
11333
|
async function readTraceFile(path, offsetMs) {
|
|
11330
|
-
const kind = traceKindOf(
|
|
11334
|
+
const kind = traceKindOf(basename9(path));
|
|
11331
11335
|
if (!kind) {
|
|
11332
11336
|
throw new UsageError(
|
|
11333
11337
|
`${path}: not a trace the recorder reads (trace.zip, .trace, .jsonl, .json or .csv)`
|
|
@@ -11348,7 +11352,7 @@ async function readTraceFile(path, offsetMs) {
|
|
|
11348
11352
|
return cursorFromPlaywrightTrace(text2, { offsetMs });
|
|
11349
11353
|
}
|
|
11350
11354
|
const text = await readFile16(path, "utf8");
|
|
11351
|
-
return cursorFromTrace(
|
|
11355
|
+
return cursorFromTrace(basename9(path), text, { offsetMs });
|
|
11352
11356
|
}
|
|
11353
11357
|
function parseViewport(v) {
|
|
11354
11358
|
if (!v) return null;
|
|
@@ -11379,7 +11383,7 @@ async function cmdIngest(argv) {
|
|
|
11379
11383
|
"note: finished footage opens bare, so --background is not used (pass --as take for the screen-recording card and its ground)"
|
|
11380
11384
|
);
|
|
11381
11385
|
const backdrop = footage ? null : await takeBackdrop(flags, r);
|
|
11382
|
-
r.log(`probing ${
|
|
11386
|
+
r.log(`probing ${basename9(videoPath)}\u2026`);
|
|
11383
11387
|
const probed = await probeVideoFile(videoPath);
|
|
11384
11388
|
if (!(probed.durationMs > 0)) {
|
|
11385
11389
|
throw new UsageError(
|
|
@@ -11428,13 +11432,13 @@ async function cmdIngest(argv) {
|
|
|
11428
11432
|
const clicks = events.filter((e) => e.type === "down").length;
|
|
11429
11433
|
const seconds = (probed.durationMs / 1e3).toFixed(1);
|
|
11430
11434
|
const facts = `${seconds}s, ${probed.width}\xD7${probed.height} @ ${meta.fps} fps${probed.hasAudio ? ", audio" : ", no audio"}${remuxed ? "" : ", copied as is"}`;
|
|
11431
|
-
const cursorLine = trace ? `${events.length} cursor events (${clicks} clicks) from ${
|
|
11435
|
+
const cursorLine = trace ? `${events.length} cursor events (${clicks} clicks) from ${basename9(cursorPath)}${trace.dropped ? `, ${trace.dropped} not placed` : ""}; ${plan.zoomAuto} zoom${plan.zoomAuto === 1 ? "" : "s"} planned` : "no cursor track, so nothing was planned";
|
|
11432
11436
|
const opened = footage ? `opened as finished footage: no card, no browser bar, no drawn cursor, ${meta.fps > 30 ? 60 : 30} fps export (--as take for a screen recording's card)` : `opened as a screen recording: the card, its ground and the drawn cursor (--as footage to open it bare)`;
|
|
11433
11437
|
const next = footage && !trace ? `Next: vos push ${outDir} --wait \u2014 it lands as it is; trim or add to it in the studio` : trace ? `Next: vos digest ${outDir} \u2014 look before you cut; edit doc.json; vos push ${outDir}` : `Add --cursor <trace> recorded beside the video (a Playwright trace.zip, stamped JSON records, or a t,x,y,type CSV) to plan zooms from its clicks; else place them by eye: vos frames ${outDir} --times 0,25%,50%,75%,100%, then edit doc.json`;
|
|
11434
11438
|
r.done(
|
|
11435
11439
|
{
|
|
11436
11440
|
out: outDir,
|
|
11437
|
-
recording:
|
|
11441
|
+
recording: basename9(recording),
|
|
11438
11442
|
durationMs: probed.durationMs,
|
|
11439
11443
|
width: probed.width,
|
|
11440
11444
|
height: probed.height,
|
|
@@ -11443,7 +11447,7 @@ async function cmdIngest(argv) {
|
|
|
11443
11447
|
hasAudio: probed.hasAudio,
|
|
11444
11448
|
remuxed,
|
|
11445
11449
|
cursor: trace ? {
|
|
11446
|
-
file:
|
|
11450
|
+
file: basename9(cursorPath),
|
|
11447
11451
|
kind: trace.kind,
|
|
11448
11452
|
events: events.length,
|
|
11449
11453
|
clicks,
|
|
@@ -11455,7 +11459,7 @@ async function cmdIngest(argv) {
|
|
|
11455
11459
|
backdrop: plan.backdrop ?? null,
|
|
11456
11460
|
as: footage ? "footage" : "take"
|
|
11457
11461
|
},
|
|
11458
|
-
`Ingested ${
|
|
11462
|
+
`Ingested ${basename9(videoPath)} \u2192 ${outDir}/${basename9(recording)} (${facts})
|
|
11459
11463
|
${opened}
|
|
11460
11464
|
${cursorLine}
|
|
11461
11465
|
${next}`
|
|
@@ -14098,4 +14102,4 @@ export {
|
|
|
14098
14102
|
verbHelp,
|
|
14099
14103
|
run
|
|
14100
14104
|
};
|
|
14101
|
-
//# sourceMappingURL=chunk-
|
|
14105
|
+
//# sourceMappingURL=chunk-MTOCJ2LC.js.map
|