aem-eds-kit 0.4.58 → 0.4.61

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/CHANGELOG.md CHANGED
@@ -6,6 +6,13 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ### Fixed
10
+ - **`eds` run by Electron as Node** (EDS-093), as the aem-eds-studio desktop
11
+ app does, failed every command with "unknown command '…/eds.js'": commander
12
+ read the script path as the command. argv is now always parsed Node-style.
13
+
14
+ ## [0.4.60] - 2026-11-06
15
+
9
16
  ### Changed
10
17
  - **Illustrations on the site** (EDS-077): design sources → `eds` → block,
11
18
  the command workflow (start → build → check → ship), one per audit card,
@@ -29,6 +36,11 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
29
36
  Version links point at npm; the GitHub release links never existed.
30
37
 
31
38
  ### Fixed
39
+ - **`eds draft preview|accept|refine --version` printed the CLI version**
40
+ (EDS-089) instead of picking a draft version: the program's own `--version`
41
+ flag won. The version is now an argument (`eds draft preview hero 2`,
42
+ `eds draft accept hero 1 --branch feature/hero`) and `refine` takes
43
+ `--from <n>`.
32
44
  - **The site has a menu on phones** (EDS-079). Below 720px the nav links were
33
45
  hidden with nothing to bring them back; a menu button (with `aria-expanded`,
34
46
  closing on Esc, a link tap or widening the window) now opens them as a
@@ -55,6 +67,13 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
55
67
  where the Universal Editor boilerplate actually lives.
56
68
 
57
69
  ### Added
70
+ - **`--json` event stream** (EDS-087) for `block from-design` and the `draft`
71
+ commands: one JSON object per line on stdout (`v`, `type`), the usual output
72
+ on stderr, ending with a `result`. Events: `start`, `log`, `agent` (each tool
73
+ call), `agent-result` (duration and cost), `draft`, `drafts`, `preview`,
74
+ `accepted`, `discarded`, `prompt`, `result`. With `--json` nothing prompts,
75
+ no browser opens, and an agent's own stdout goes to stderr. This is the
76
+ interface aem-eds-studio uses.
58
77
  - **Drafts: review rounds before a block reaches the repository** (EDS-085).
59
78
  `block from-design --draft` keeps the result as a version under
60
79
  `tmp/eds-cli/drafts/<name>/` and leaves `blocks/` untouched; `eds draft
@@ -521,6 +540,7 @@ Initial CLI scaffold: `block create`, `block from-figma`, `block list`,
521
540
  `figma setup`, `doctor`, `preview`, `publish`. Not published.
522
541
 
523
542
  [Unreleased]: https://github.com/piotrgodycki/aem-eds-kit/commits/main
543
+ [0.4.60]: https://www.npmjs.com/package/aem-eds-kit/v/0.4.60
524
544
  [0.4.48]: https://www.npmjs.com/package/aem-eds-kit/v/0.4.48
525
545
  [0.4.26]: https://www.npmjs.com/package/aem-eds-kit/v/0.4.26
526
546
  [0.4.25]: https://www.npmjs.com/package/aem-eds-kit/v/0.4.25
package/README.md CHANGED
@@ -469,7 +469,32 @@ eds draft list # drafts and their v
469
469
  eds draft discard hero # drop it; blocks/ untouched
470
470
  ```
471
471
 
472
- `accept --commit` (or `--branch <name>`, created if missing) commits only `blocks/<name>/`, with the review rounds in the message (`v1: first version`, `v2: "bigger headline, orange buttons"`). `refine` reuses the agent and model that made the draft unless you pass `--agent` / `--model`; `preview` and `accept` take `--version <n>`.
472
+ `accept --commit` (or `--branch <name>`, created if missing) commits only `blocks/<name>/`, with the review rounds in the message (`v1: first version`, `v2: "bigger headline, orange buttons"`). `preview` and `accept` take a version (`eds draft preview hero 2`, `eds draft accept hero 1 --branch feature/hero`; default: the latest). `refine` starts from the latest version, or `--from <n>`, and reuses the agent and model that made the draft unless you pass `--agent` / `--model`.
473
+
474
+ **For tools: `--json`.** `block from-design` and the `draft` commands take the global `--json` flag and print **one JSON event per line on stdout** (the usual output stays on stderr). It never prompts, so pass the design, the name and `--draft`. Every event has `v` (the schema version, currently `1`) and `type`, and the stream ends with one `result`. [aem-eds-studio](https://github.com/piotrgodycki/aem-eds-studio) reads it. A tool can run `dist/bin/eds.js` with Node or with Electron as Node (`ELECTRON_RUN_AS_NODE=1`), as the studio's desktop app does.
475
+
476
+ ```bash
477
+ eds --json block from-design "<design link>" --name hero --draft
478
+ ```
479
+ ```jsonl
480
+ {"v":1,"type":"start","command":"block from-design","cli":"0.4.59"}
481
+ {"v":1,"type":"agent","tool":"Write","label":"✎ blocks/hero/hero.css","durationMs":18}
482
+ {"v":1,"type":"agent-result","durationMs":152455,"costUsd":0.031}
483
+ {"v":1,"type":"draft","name":"hero","version":1,"ok":true,"dir":"tmp/eds-cli/drafts/hero/v1","files":["hero.css","hero.js"]}
484
+ {"v":1,"type":"result","ok":true,"exitCode":0}
485
+ ```
486
+
487
+ | Event | When |
488
+ |---|---|
489
+ | `start` | first line: the command and the CLI version |
490
+ | `log` | every message the command prints (`level`: debug, info, success, warn, error), as plain text |
491
+ | `agent` / `agent-result` | each tool call the agent made, then its duration and cost (Claude Code) |
492
+ | `draft` | a version was stored: `name`, `version`, `ok` (checks passed), `dir`, `files`, `feedback` |
493
+ | `drafts` | `draft list`: every draft with its versions |
494
+ | `preview` | `draft preview`: the server is up at `url` (no browser is opened) |
495
+ | `accepted` / `discarded` | `draft accept` (with `commit`, `branch`) / `draft discard` |
496
+ | `prompt` | `--dry-run`: where the prompt was saved |
497
+ | `result` | last line: `ok` and `exitCode` |
473
498
 
474
499
  ### `eds block list`
475
500
 
@@ -750,7 +775,7 @@ Priority: CLI flags → env vars → `.edsrc.json` (project) → `~/.eds/config.
750
775
  |---|---|
751
776
  | `--verbose` | Debug-level output |
752
777
  | `--quiet` | Errors only |
753
- | `--json` | Machine-readable JSON output (`doctor`, `audit loading`, `audit security`, `block list`) |
778
+ | `--json` | Machine-readable output: one JSON document (`doctor`, `audit loading`, `audit security`, `block list`), or JSON-lines events (`block from-design`, `draft`; see [`eds draft`](#eds-draft)) |
754
779
  | `--no-color` | Disable colors (also respects `NO_COLOR` env) |
755
780
 
756
781
  ## Development