@glissade/cli 0.41.0-pre.0 → 0.41.0-pre.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.
@@ -1,6 +1,6 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime.js";
2
- import { o as loadSceneModule } from "./render.js";
3
2
  import { t as glissadeVersion } from "./version.js";
3
+ import { o as loadSceneModule } from "./render.js";
4
4
  import { i as capsId, n as FrameCache, o as frameCacheKey } from "./frameCache.js";
5
5
  import { mkdtempSync, rmSync } from "node:fs";
6
6
  import { tmpdir } from "node:os";
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import { a as ffmpegAvailable, d as render, f as renderLocales, i as collectAudioClips, l as parseLocalesList, m as resolveLoudnessGainDb, n as SceneModuleError, o as loadSceneModule, r as buildMixWav, s as localeOutPath, t as LocaleArgsError, u as planFinalAudio } from "./render.js";
2
1
  import { t as glissadeVersion } from "./version.js";
2
+ import { a as ffmpegAvailable, d as render, f as renderLocales, i as collectAudioClips, l as parseLocalesList, m as resolveLoudnessGainDb, n as SceneModuleError, o as loadSceneModule, r as buildMixWav, s as localeOutPath, t as LocaleArgsError, u as planFinalAudio } from "./render.js";
3
3
  import { a as computeGainDb, d as parseLoudnormJson, f as peakClampBinds, i as PUBLISH_PROFILES, l as measureFile, m as resolveProfile, n as LOUDNESS_SCHEMA_VERSION, o as computeMixHash, p as readLoudness, r as LoudnessError, s as loudnessPathFor, t as DEFAULT_PROFILE_ID, u as measureLoudnessCommand } from "./loudness.js";
4
4
  import { i as masterCommand, n as MasterError, o as normalizeMasterConfig, r as masterAfChain, s as planMaster, t as DEFAULT_MAX_GR_DB } from "./master.js";
5
5
  import { a as pickEncoder, i as parseEncoderList, n as availableEncoders, t as NoEncoderError } from "./encoders.js";
package/dist/mcp.js CHANGED
@@ -1,5 +1,5 @@
1
- import { o as loadSceneModule } from "./render.js";
2
1
  import { t as glissadeVersion } from "./version.js";
2
+ import { o as loadSceneModule } from "./render.js";
3
3
  import { mkdtempSync, readFileSync, writeFileSync } from "node:fs";
4
4
  import { tmpdir } from "node:os";
5
5
  import { join } from "node:path";
package/dist/render.js CHANGED
@@ -1,4 +1,6 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime.js";
2
+ import { t as glissadeVersion } from "./version.js";
3
+ import { createRequire } from "node:module";
2
4
  import { spawnSync } from "node:child_process";
3
5
  import { existsSync, mkdirSync, mkdtempSync, readFileSync, renameSync, rmSync, writeFileSync } from "node:fs";
4
6
  import { tmpdir } from "node:os";
@@ -293,6 +295,45 @@ function parseFrameRange(flag) {
293
295
  if (b < a) throw new Error(`--range end (${b}) is before start (${a})`);
294
296
  return [a, b];
295
297
  }
298
+ /**
299
+ * Resolve the `@glissade/core` version the SCENE will bind to (anchored at the
300
+ * scene's own directory, so it's the copy in the user's project), by resolving
301
+ * core's entry and walking up to its package root — `@glissade/core/package.json`
302
+ * isn't an exported subpath, so it can't be required directly. Returns undefined
303
+ * if it can't be resolved (an unusual layout) — the caller then skips the check.
304
+ */
305
+ function resolveSceneCoreVersion(scenePath) {
306
+ try {
307
+ let dir = dirname(createRequire(pathToFileURL(scenePath)).resolve("@glissade/core"));
308
+ for (let i = 0; i < 8; i++) {
309
+ const pkgPath = join(dir, "package.json");
310
+ if (existsSync(pkgPath)) {
311
+ const pkg = JSON.parse(readFileSync(pkgPath, "utf8"));
312
+ if (pkg.name === "@glissade/core") return pkg.version;
313
+ }
314
+ const parent = dirname(dir);
315
+ if (parent === dir) break;
316
+ dir = parent;
317
+ }
318
+ } catch {}
319
+ }
320
+ /**
321
+ * Warn (once, loudly) on a `@glissade/*` version SKEW between the running `gs`
322
+ * (cli) and the `@glissade/core` the scene resolves. glissade is lockstep, and
323
+ * the subpath side-effect registries (`/expr`'s sampler, Yoga `layout`) register
324
+ * per-package-INSTANCE — so under a skew a correctly-imported `@glissade/core/expr`
325
+ * or `layout` still fails with a misleading "expr tracks need import …" / "no
326
+ * LayoutEngine registered". Naming the skew up front turns a confusing failure
327
+ * into an actionable one. A warning, never a throw: legitimate edge layouts exist,
328
+ * and the check must never break a render (video-canary 0.41 adopt finding).
329
+ */
330
+ function warnOnVersionSkew(scenePath) {
331
+ const cliVer = glissadeVersion();
332
+ if (cliVer === "0.0.0") return;
333
+ const coreVer = resolveSceneCoreVersion(scenePath);
334
+ if (coreVer === void 0 || coreVer === cliVer) return;
335
+ process.stderr.write(`warning: @glissade version skew — gs (@glissade/cli@${cliVer}) is rendering a scene that resolves @glissade/core@${coreVer}.\n glissade is LOCKSTEP: subpath features register per-package-instance (the /expr sampler, Yoga layout), so under a skew a\n correctly-imported '@glissade/core/expr' or 'layout' can still fail with "need import" / "no LayoutEngine registered".\n Align every @glissade/* dependency to ${cliVer} (e.g. npm i @glissade/core@${cliVer} @glissade/scene@${cliVer}).\n`);
336
+ }
296
337
  async function loadSceneModule(modulePath, locale) {
297
338
  const { setMessageTable } = await import("@glissade/core/i18n");
298
339
  if (locale !== void 0 && locale !== "") {
@@ -300,13 +341,15 @@ async function loadSceneModule(modulePath, locale) {
300
341
  setMessageTable(loadMessageTable(modulePath, locale));
301
342
  } else setMessageTable(void 0);
302
343
  const abs = isAbsolute(modulePath) ? modulePath : resolve(process.cwd(), modulePath);
303
- if (![
344
+ const candidates = [
304
345
  abs,
305
346
  abs.replace(/\.js$/, ".ts"),
306
347
  abs.replace(/\.ts$/, ".js"),
307
348
  `${abs}.ts`,
308
349
  `${abs}.js`
309
- ].some((c) => existsSync(c))) throw new SceneModuleError(modulePath, "scene module not found (check the path)");
350
+ ];
351
+ if (!candidates.some((c) => existsSync(c))) throw new SceneModuleError(modulePath, "scene module not found (check the path)");
352
+ warnOnVersionSkew(candidates.find((c) => existsSync(c)) ?? abs);
310
353
  const loaded = await createJiti(pathToFileURL(process.cwd() + "/").href).import(pathToFileURL(abs).href, { default: true });
311
354
  if (typeof loaded?.createScene !== "function" || loaded?.timeline === void 0) throw new SceneModuleError(modulePath, "default export is not a SceneModule");
312
355
  return loaded;
@@ -456,7 +499,6 @@ async function render(opts) {
456
499
  const cacheOn = !!(opts.cache && opts.cache.mode !== "off");
457
500
  if (cacheOn || opts.incremental) {
458
501
  const { capsId, combineAssetDigests } = await import("./frameCache.js").then((n) => n.s);
459
- const { glissadeVersion } = await import("./version.js").then((n) => n.n);
460
502
  keyCtx = {
461
503
  version: glissadeVersion(),
462
504
  capsId: capsId(backend.caps),
package/dist/version.js CHANGED
@@ -1,4 +1,3 @@
1
- import { t as __exportAll } from "./rolldown-runtime.js";
2
1
  import { createRequire } from "node:module";
3
2
  //#region src/version.ts
4
3
  /**
@@ -10,7 +9,6 @@ import { createRequire } from "node:module";
10
9
  * single source of truth) rather than hard-coded so it can never drift from the
11
10
  * published version.
12
11
  */
13
- var version_exports = /* @__PURE__ */ __exportAll({ glissadeVersion: () => glissadeVersion });
14
12
  let cached;
15
13
  /** The @glissade/cli package version (the glissade VERSION for the cache key). */
16
14
  function glissadeVersion() {
@@ -23,4 +21,4 @@ function glissadeVersion() {
23
21
  return cached;
24
22
  }
25
23
  //#endregion
26
- export { version_exports as n, glissadeVersion as t };
24
+ export { glissadeVersion as t };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@glissade/cli",
3
- "version": "0.41.0-pre.0",
3
+ "version": "0.41.0-pre.1",
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.41.0-pre.0",
32
- "@glissade/core": "0.41.0-pre.0",
33
- "@glissade/interact": "0.41.0-pre.0",
34
- "@glissade/lottie": "0.41.0-pre.0",
35
- "@glissade/narrate": "0.41.0-pre.0",
36
- "@glissade/player": "0.41.0-pre.0",
37
- "@glissade/scene": "0.41.0-pre.0",
38
- "@glissade/sfx": "0.41.0-pre.0",
39
- "@glissade/svg": "0.41.0-pre.0"
31
+ "@glissade/backend-skia": "0.41.0-pre.1",
32
+ "@glissade/core": "0.41.0-pre.1",
33
+ "@glissade/interact": "0.41.0-pre.1",
34
+ "@glissade/lottie": "0.41.0-pre.1",
35
+ "@glissade/narrate": "0.41.0-pre.1",
36
+ "@glissade/player": "0.41.0-pre.1",
37
+ "@glissade/scene": "0.41.0-pre.1",
38
+ "@glissade/sfx": "0.41.0-pre.1",
39
+ "@glissade/svg": "0.41.0-pre.1"
40
40
  },
41
41
  "repository": {
42
42
  "type": "git",