Skip to content

Art and animation, written as code. Illustrations, loops, interactive web art, launch-videos and scored films in dozens of styles, identical on every render.

sync plugin folder

Alex Greenshpunf3cf9fe704b0
diff --git a/plugins/anidoodle/skills/anidoodle/engine/tools/scaffold.mjs b/plugins/anidoodle/skills/anidoodle/engine/tools/scaffold.mjs
index d647f19..6cb76dd 100644
--- a/plugins/anidoodle/skills/anidoodle/engine/tools/scaffold.mjs
+++ b/plugins/anidoodle/skills/anidoodle/engine/tools/scaffold.mjs
@@ -55,7 +55,8 @@ const ownFilmFiles = () => {
const walk = (d) => readdirSync(d).flatMap((n) => { const p = join(d, n); return statSync(p).isDirectory() ? walk(p) : p.endsWith(".ts") ? [p] : []; });
const files = walk(SRC);
const res = (from, spec) => { const b = resolve(dirname(from), spec); for (const e of ["", ".ts", "/index.ts"]) { const c = resolve(b + e); if (existsSync(c) && statSync(c).isFile()) return c; } return null; }; // resolve(): on Windows "dir/index.ts" must become "dir\index.ts" to match the walked file list
- const imp = new Map(files.map((f) => [f, new Set([...readFileSync(f, "utf8").matchAll(/(?:from|import)\s*\(?\s*"(\.[^"]+)"/g)].map((m) => res(f, m[1])).filter(Boolean))]));
+ const known = new Set(files); // a film can import a font or a JSON file by path: only .ts modules are graph nodes
+ const imp = new Map(files.map((f) => [f, new Set([...readFileSync(f, "utf8").matchAll(/(?:from|import)\s*\(?\s*"(\.[^"]+)"/g)].map((m) => res(f, m[1])).filter((t) => t && known.has(t)))]));
const page = (f) => join(SRC, "hosts", `page-${f.slice(f.lastIndexOf(sep) + 1)}`);
const out = new Set(OWN_FILMS.map((n) => join(SRC, "canvas-core", `${n}.ts`)));
for (let grew = true; grew;) { grew = false; for (const f of files) if (!out.has(f) && [...imp.get(f)].some((t) => out.has(t))) { out.add(f); grew = true; } }