@markdy/cli 1.0.18 → 1.0.19

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/README.md CHANGED
@@ -54,7 +54,7 @@ markdy check-all . --arch-rules # batch lint entire workspace
54
54
  ## Notes
55
55
 
56
56
  - The CLI resolves `import "file.markdy" as ns` from disk before parsing.
57
- - `fmt` prints a canonicalized scene and may expand higher-level sugar into its parsed form.
57
+ - `fmt` canonicalizes aliases and indentation, places optional `player:` configuration last, and preserves its behavior; it may expand higher-level scene sugar into parsed form.
58
58
  - `render --out` writes a self-contained HTML preview to the exact path you pass in.
59
59
  - If the path is relative, it is resolved from the current working directory.
60
60
  - If you see `zsh: command not found: markdy`, the package is installed locally but that directory is not on your PATH.
package/dist/index.js CHANGED
@@ -52,9 +52,63 @@ function formatScene(ast) {
52
52
  lines.push(formatBeat(beat));
53
53
  lines.push("");
54
54
  }
55
+ const player = formatPlayer(ast.meta.player);
56
+ if (player.length > 0) {
57
+ if (lines.at(-1) !== "") lines.push("");
58
+ lines.push(...player);
59
+ }
55
60
  return `${lines.join("\n").trim()}
56
61
  `;
57
62
  }
63
+ function formatPlayer(player) {
64
+ if (!player) return [];
65
+ const groups = [
66
+ ["playback", [
67
+ ["autoplay", player.playback?.autoplay],
68
+ ["loop", player.playback?.loop],
69
+ ["rate", player.playback?.rate]
70
+ ]],
71
+ ["controls", [
72
+ ["play", player.controls?.play],
73
+ ["restart", player.controls?.restart],
74
+ ["prev_beat", player.controls?.prevBeat],
75
+ ["next_beat", player.controls?.nextBeat],
76
+ ["seek", player.controls?.seek],
77
+ ["speed", player.controls?.speed],
78
+ ["speeds", player.controls?.speeds?.join(" ")],
79
+ ["fit", player.controls?.fit],
80
+ ["reset_view", player.controls?.resetView],
81
+ ["fullscreen", player.controls?.fullscreen],
82
+ ["svg", player.controls?.svg],
83
+ ["share", player.controls?.share],
84
+ ["code", player.controls?.code],
85
+ ["theme", player.controls?.theme]
86
+ ]],
87
+ ["interaction", [
88
+ ["zoom", player.interaction?.zoom],
89
+ ["pan", player.interaction?.pan],
90
+ ["click_to_play", player.interaction?.clickToPlay],
91
+ ["double_click_to_reset", player.interaction?.doubleClickToReset],
92
+ ["keyboard", player.interaction?.keyboard]
93
+ ]],
94
+ ["chrome", [
95
+ ["badge", player.chrome?.badge],
96
+ ["progress", player.chrome?.progress],
97
+ ["color", player.chrome?.progressColor]
98
+ ]]
99
+ ];
100
+ const lines = ["player:"];
101
+ for (const [group, settings] of groups) {
102
+ const configured = settings.filter(([, value]) => value !== void 0);
103
+ if (configured.length === 0) continue;
104
+ lines.push(` ${group}:`);
105
+ for (const [key, value] of configured) {
106
+ const formatted = typeof value === "string" && key !== "progress" ? JSON.stringify(value) : String(value);
107
+ lines.push(` ${key} ${formatted}`);
108
+ }
109
+ }
110
+ return lines.length > 1 ? lines : [];
111
+ }
58
112
  function formatStyle(style) {
59
113
  const props = Object.entries(style.props).map(([k, v]) => `${k}=${formatValue(v)}`).join(" ");
60
114
  return `style ${style.name} = ${props}`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@markdy/cli",
3
- "version": "1.0.18",
3
+ "version": "1.0.19",
4
4
  "description": "First-party CLI for diagram-native MarkdyScript diagrams: lint, format, explain, render, and preview.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -42,10 +42,10 @@
42
42
  "access": "public"
43
43
  },
44
44
  "dependencies": {
45
- "@markdy/core": "1.0.18",
46
- "@markdy/compat": "1.0.18",
47
- "@markdy/stdlib-systems": "1.0.18",
48
- "@markdy/renderer-dom": "1.0.18"
45
+ "@markdy/core": "1.0.19",
46
+ "@markdy/compat": "1.0.19",
47
+ "@markdy/stdlib-systems": "1.0.19",
48
+ "@markdy/renderer-dom": "1.0.19"
49
49
  },
50
50
  "devDependencies": {
51
51
  "@types/node": "^25.9.5",