@motionskit/cli 0.2.3 → 0.2.4

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/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { FixtureEntry, SourceVersion, MotionVersion, Json } from '@motionskit/kernel';
1
+ import { FixtureEntry, SourceVersion, MotionVersion, Json, MotionHandleWarning } from '@motionskit/kernel';
2
2
 
3
3
  /** `tenant.yaml`'s `sources.fixtures` switch and every entry of `fixtures/sources/*.json`, in the order the gateway matches them. */
4
4
  type TenantFixtures = {
@@ -50,4 +50,12 @@ declare function compileMotion(tenant: {
50
50
  }, dir: string): Promise<Compiled>;
51
51
  declare function compileTenant(tenantDir: string): Promise<Tenant>;
52
52
 
53
- export { type Compiled, type CompiledSource, type Tenant, compileMotion, compileSource, compileSources, compileTenant, findTenantDir, monorepoTenants, tenantIdentity, tenantsDir };
53
+ type PublishWarningsInput = {
54
+ warning?: string;
55
+ unknownHandles?: MotionHandleWarning[];
56
+ memberHandles?: string[];
57
+ };
58
+ /** Formats non-blocking warnings returned when publishing a motion version. */
59
+ declare function formatPublishWarnings(tenant: string, motion: string, out: PublishWarningsInput): string[];
60
+
61
+ export { type Compiled, type CompiledSource, type PublishWarningsInput, type Tenant, compileMotion, compileSource, compileSources, compileTenant, findTenantDir, formatPublishWarnings, monorepoTenants, tenantIdentity, tenantsDir };
package/dist/index.js CHANGED
@@ -557,12 +557,28 @@ async function compileTenant(tenantDir) {
557
557
  }
558
558
  return { id: id2, title: meta.title ?? id2, timezone, connection, seed, sources: await compileSources(dir, id2), fixtures, motions };
559
559
  }
560
+
561
+ // src/publish.ts
562
+ function formatPublishWarnings(tenant, motion, out) {
563
+ const lines = [];
564
+ if (out.warning) lines.push(`warning: ${out.warning}`);
565
+ const unknown = out.unknownHandles ?? [];
566
+ if (!unknown.length) return lines;
567
+ const noun = unknown.length === 1 ? "handle" : "handles";
568
+ const members = out.memberHandles?.length ? `members: ${out.memberHandles.map((h) => `@${h}`).join(", ")}` : `no members in ${tenant}`;
569
+ lines.push(`warning: unknown member ${noun} in ${tenant}/${motion} (${members}):`);
570
+ for (const item of unknown) {
571
+ lines.push(` @${item.handle} is not a member of ${tenant} (${item.references.join(", ")})`);
572
+ }
573
+ return lines;
574
+ }
560
575
  export {
561
576
  compileMotion,
562
577
  compileSource,
563
578
  compileSources,
564
579
  compileTenant,
565
580
  findTenantDir,
581
+ formatPublishWarnings,
566
582
  monorepoTenants,
567
583
  tenantIdentity,
568
584
  tenantsDir
package/dist/main.js CHANGED
@@ -983,6 +983,21 @@ function origin(dir, env = process.env) {
983
983
  return { kind: "cli", ...repo ? { repo } : {}, commit, dirty: !!git(dir, "status", "--porcelain", "--", ".") };
984
984
  }
985
985
 
986
+ // src/publish.ts
987
+ function formatPublishWarnings(tenant, motion, out) {
988
+ const lines = [];
989
+ if (out.warning) lines.push(`warning: ${out.warning}`);
990
+ const unknown = out.unknownHandles ?? [];
991
+ if (!unknown.length) return lines;
992
+ const noun = unknown.length === 1 ? "handle" : "handles";
993
+ const members = out.memberHandles?.length ? `members: ${out.memberHandles.map((h) => `@${h}`).join(", ")}` : `no members in ${tenant}`;
994
+ lines.push(`warning: unknown member ${noun} in ${tenant}/${motion} (${members}):`);
995
+ for (const item of unknown) {
996
+ lines.push(` @${item.handle} is not a member of ${tenant} (${item.references.join(", ")})`);
997
+ }
998
+ return lines;
999
+ }
1000
+
986
1001
  // src/tree.ts
987
1002
  import { existsSync as existsSync6, readFileSync as readFileSync6 } from "fs";
988
1003
  import { join as join7, relative as relative3, resolve as resolve4, sep as sep3 } from "path";
@@ -1164,7 +1179,7 @@ async function pushDirs(dirs, live) {
1164
1179
  });
1165
1180
  console.log(`${tenant.id}/${manifest.motion} @ ${manifest.sha.slice(0, 10)} (${out.created ? "new" : "unchanged"}, ${out.live ? "live" : "draft"})`);
1166
1181
  console.log(` ${versionLink(tenant.id, manifest.motion, manifest.sha)}`);
1167
- if (out.warning) console.log(`warning: ${out.warning}`);
1182
+ for (const line of formatPublishWarnings(tenant.id, manifest.motion, out)) console.log(line);
1168
1183
  }
1169
1184
  }
1170
1185
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@motionskit/cli",
3
- "version": "0.2.3",
3
+ "version": "0.2.4",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "repository": {
@@ -29,7 +29,7 @@
29
29
  "esbuild": "^0.28.2",
30
30
  "yaml": "^2.9.1",
31
31
  "zod": "^4.6.7",
32
- "@motionskit/kernel": "0.2.3"
32
+ "@motionskit/kernel": "0.2.4"
33
33
  },
34
34
  "devDependencies": {
35
35
  "@types/node": "^22.19.0",