@glissade/cli 0.43.0-pre.0 → 0.43.0
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/build.js +20 -1
- package/package.json +10 -10
package/dist/build.js
CHANGED
|
@@ -80,6 +80,7 @@ var build_exports = /* @__PURE__ */ __exportAll({
|
|
|
80
80
|
renderDefaults: () => renderDefaults,
|
|
81
81
|
resolveScenes: () => resolveScenes,
|
|
82
82
|
sceneInputFiles: () => sceneInputFiles,
|
|
83
|
+
selectAffectedScenes: () => selectAffectedScenes,
|
|
83
84
|
stepInputs: () => stepInputs,
|
|
84
85
|
stepOutput: () => stepOutput,
|
|
85
86
|
stepSalt: () => stepSalt
|
|
@@ -236,6 +237,24 @@ function sceneInputFiles(scene) {
|
|
|
236
237
|
function affectedScenes(scenes, changedPaths) {
|
|
237
238
|
return scenes.filter((s) => sceneInputFiles(s).some((f) => changedPaths.has(f)));
|
|
238
239
|
}
|
|
240
|
+
const isCodeFile = (f) => /\.(ts|tsx|js|jsx|mjs|cjs)$/.test(f);
|
|
241
|
+
/**
|
|
242
|
+
* The `--affected` selector with a SAFE-BY-DEFAULT fallback. A scene's staleness is
|
|
243
|
+
* tracked by its own files (source + sidecars), but a scene `.ts` *imports* other
|
|
244
|
+
* modules — and a change to a shared `src/util.ts` (or the config, or any code file
|
|
245
|
+
* not attributable to a scene) affects scenes transitively, invisibly to the
|
|
246
|
+
* file-level diff. Silently narrowing that to nothing would ship stale renders — the
|
|
247
|
+
* exact silent-skip the rest of the system fails loud on. So: if the diff touched a
|
|
248
|
+
* CODE file (`.ts`/`.js`/…) that is NOT any scene's recognized input, we cannot
|
|
249
|
+
* attribute it, so we DON'T narrow — rebuild every scene (the per-step content hash
|
|
250
|
+
* still skips the genuinely-fresh ones). A diff of only non-code files (docs, an
|
|
251
|
+
* unrelated JSON) narrows normally. (Precise import-graph affectedness — rebuild only
|
|
252
|
+
* true dependents — is a follow-up; footgun-free-80% over precise-but-unshipped-100%.)
|
|
253
|
+
*/
|
|
254
|
+
function selectAffectedScenes(scenes, changedPaths) {
|
|
255
|
+
const accountedFor = new Set(scenes.flatMap(sceneInputFiles));
|
|
256
|
+
return [...changedPaths].some((f) => isCodeFile(f) && !accountedFor.has(f)) ? [...scenes] : affectedScenes(scenes, changedPaths);
|
|
257
|
+
}
|
|
239
258
|
/** The files changed since a git ref (`git diff --name-only <ref>`), as absolute paths. */
|
|
240
259
|
function gitChangedFiles(ref, root) {
|
|
241
260
|
const top = execFileSync("git", ["rev-parse", "--show-toplevel"], {
|
|
@@ -325,7 +344,7 @@ async function buildCommand(opts, deps = { runStep: defaultRunStep }) {
|
|
|
325
344
|
const allScenes = resolveScenes(cfg.scenes, root);
|
|
326
345
|
let renderScenes = allScenes;
|
|
327
346
|
if (opts.only?.length) renderScenes = renderScenes.filter((s) => opts.only.some((o) => s.includes(o)));
|
|
328
|
-
if (opts.affected !== void 0) renderScenes =
|
|
347
|
+
if (opts.affected !== void 0) renderScenes = selectAffectedScenes(renderScenes, gitChangedFiles(opts.affected, root));
|
|
329
348
|
const version = glissadeVersion();
|
|
330
349
|
const manifest = loadManifest(root);
|
|
331
350
|
const log = opts.onLog ?? (() => {});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@glissade/cli",
|
|
3
|
-
"version": "0.43.0
|
|
3
|
+
"version": "0.43.0",
|
|
4
4
|
"description": "glissade CLI: headless rendering via backend-skia (+ FFmpeg mux).",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"engines": {
|
|
@@ -28,15 +28,15 @@
|
|
|
28
28
|
"@napi-rs/canvas": "^0.1.65",
|
|
29
29
|
"esbuild": "0.28.0",
|
|
30
30
|
"jiti": "^2.4.2",
|
|
31
|
-
"@glissade/backend-skia": "0.43.0
|
|
32
|
-
"@glissade/core": "0.43.0
|
|
33
|
-
"@glissade/interact": "0.43.0
|
|
34
|
-
"@glissade/lottie": "0.43.0
|
|
35
|
-
"@glissade/narrate": "0.43.0
|
|
36
|
-
"@glissade/player": "0.43.0
|
|
37
|
-
"@glissade/scene": "0.43.0
|
|
38
|
-
"@glissade/sfx": "0.43.0
|
|
39
|
-
"@glissade/svg": "0.43.0
|
|
31
|
+
"@glissade/backend-skia": "0.43.0",
|
|
32
|
+
"@glissade/core": "0.43.0",
|
|
33
|
+
"@glissade/interact": "0.43.0",
|
|
34
|
+
"@glissade/lottie": "0.43.0",
|
|
35
|
+
"@glissade/narrate": "0.43.0",
|
|
36
|
+
"@glissade/player": "0.43.0",
|
|
37
|
+
"@glissade/scene": "0.43.0",
|
|
38
|
+
"@glissade/sfx": "0.43.0",
|
|
39
|
+
"@glissade/svg": "0.43.0"
|
|
40
40
|
},
|
|
41
41
|
"repository": {
|
|
42
42
|
"type": "git",
|