aem-eds-kit 0.4.54 → 0.4.58
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 +40 -0
- package/README.md +58 -18
- package/dist/bin/eds.js +126 -111
- package/package.json +1 -1
- package/samples/hero.svg +46 -29
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,17 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
9
|
### Changed
|
|
10
|
+
- **Illustrations on the site** (EDS-077): design sources → `eds` → block,
|
|
11
|
+
the command workflow (start → build → check → ship), one per audit card,
|
|
12
|
+
`aem up` serves / `eds` writes, the three quick-start steps, an AEM dialog
|
|
13
|
+
mapped onto a UE model (migration guide), one cached Figma call and local
|
|
14
|
+
models (docs). Inline SVG in the hero's style, with titles and descriptions
|
|
15
|
+
for screen readers; on phones the wide ones scroll sideways.
|
|
16
|
+
- **`--sample` is the project's own example hero** (EDS-073), the same design
|
|
17
|
+
as `examples/figma-kit` and `site/example/`, instead of the third-party
|
|
18
|
+
"Kiri Bloom" hero (whose SVG wasn't valid XML: its comment held `--sample`).
|
|
19
|
+
New roadmap (Next / Then / Later) on the site and in the README; the README
|
|
20
|
+
opens with a 4-line quick start and a contents row.
|
|
10
21
|
- **Docs and site match the CLI again** (EDS-063). README screenshots of real
|
|
11
22
|
runs (the menu, `eds new`, `block from-design`, `migrate component`,
|
|
12
23
|
`block test` / `check`, the preview harness) and design-vs-block images;
|
|
@@ -18,6 +29,19 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
|
18
29
|
Version links point at npm; the GitHub release links never existed.
|
|
19
30
|
|
|
20
31
|
### Fixed
|
|
32
|
+
- **The site has a menu on phones** (EDS-079). Below 720px the nav links were
|
|
33
|
+
hidden with nothing to bring them back; a menu button (with `aria-expanded`,
|
|
34
|
+
closing on Esc, a link tap or widening the window) now opens them as a
|
|
35
|
+
full-width list on every page, with GitHub and npm inside it under 480px,
|
|
36
|
+
each with its mark (EDS-081).
|
|
37
|
+
- **Scraped designs keep section backgrounds and one-sided lines** (EDS-067).
|
|
38
|
+
A full-width band with no background of its own now carries the colour painted
|
|
39
|
+
behind it (`inheritedBackground`, usually the page background), which the prompt
|
|
40
|
+
tells the agent to put on the block's section; borders that differ per side
|
|
41
|
+
(a bottom rule only) are kept as `borderTop` / `borderBottom` etc., and the
|
|
42
|
+
`0px none` noise on most nodes is gone. `eds block preview` / `block test` /
|
|
43
|
+
`block check` now render the block inside the section > wrapper DOM aem.js
|
|
44
|
+
builds, so section styles show up there too.
|
|
21
45
|
- **`eds init --yes` no longer prompts for the authoring model** (EDS-061). It
|
|
22
46
|
detects it from the `fstab.yaml` mountpoint (AEM author → Universal Editor,
|
|
23
47
|
`content.da.live` → DA, Google Drive, SharePoint) or a crosswalk `paths.json`,
|
|
@@ -31,6 +55,22 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
|
31
55
|
where the Universal Editor boilerplate actually lives.
|
|
32
56
|
|
|
33
57
|
### Added
|
|
58
|
+
- **Drafts: review rounds before a block reaches the repository** (EDS-085).
|
|
59
|
+
`block from-design --draft` keeps the result as a version under
|
|
60
|
+
`tmp/eds-cli/drafts/<name>/` and leaves `blocks/` untouched; `eds draft
|
|
61
|
+
preview | refine "<feedback>" | accept [--commit|--branch] | discard | list`
|
|
62
|
+
reviews it, adds a version per round and, on accept, copies it into
|
|
63
|
+
`blocks/<name>/` and commits it with the rounds in the message.
|
|
64
|
+
- **A docs gate in CI** (EDS-083). On a PR, a change under `src/` fails without
|
|
65
|
+
a `CHANGELOG.md` entry, and a change to the CLI surface (`src/bin/eds.ts`) fails
|
|
66
|
+
without `README.md` (the npm page) and `site/docs.html` updates. Plus a PR
|
|
67
|
+
template with a docs checklist, and the rule in `CODING_STANDARDS.md` /
|
|
68
|
+
`CLAUDE.md`.
|
|
69
|
+
- **Any web page is a design source** (EDS-065). `block from-design` scrapes
|
|
70
|
+
every http(s) link that isn't Figma, Framer or Stitch (`--provider web`): a
|
|
71
|
+
live site you're rebuilding, an HTML mock-up, or the project's own example page
|
|
72
|
+
(`https://piotrgodycki.github.io/aem-eds-kit/example/ --name cards`). Before,
|
|
73
|
+
such a link was taken for a Figma URL and rejected.
|
|
34
74
|
- **`eds new [dir]`: clone the latest EDS boilerplate locally** (EDS-055). DA,
|
|
35
75
|
Universal Editor (crosswalk) or Commerce, or any repo / git URL; no GitHub auth.
|
|
36
76
|
Fresh git history by default, or `--keep-history` with an `upstream` remote;
|
package/README.md
CHANGED
|
@@ -12,13 +12,23 @@
|
|
|
12
12
|
|
|
13
13
|
**Turn a design into an EDS block** - JS, CSS and a Universal Editor model - without leaving your terminal.
|
|
14
14
|
|
|
15
|
-
`aem-eds-kit` gives you the `eds` command. Paste a design link
|
|
15
|
+
`aem-eds-kit` gives you the `eds` command. Paste a design link (a Figma frame, a Framer or Google Stitch page, or any web page) and it hands the design to the AI agent you already use: Claude Code, Cursor or Codex, or a local model through Ollama / oMLX. The agent writes the block straight into your repo. Figma is read through its REST API or MCP; web pages are **scraped with headless Chromium**, no token needed.
|
|
16
16
|
|
|
17
|
-
It lives next to `@adobe/aem-cli` (your
|
|
17
|
+
It lives next to `@adobe/aem-cli` (your `aem up` dev server) and handles everything around it: new projects, blocks, migration from AEM, previews, checks and publishing.
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
npm install -g aem-eds-kit
|
|
21
|
+
eds new my-site && cd my-site # the latest Adobe boilerplate
|
|
22
|
+
eds block from-design "<design link>" --name hero # design → blocks/hero/
|
|
23
|
+
eds block preview hero # see it in the browser
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
**Contents:** [What it does](#what-it-does) · [Install](#install) · [Try it](#try-it-in-30-seconds-no-figma-account-no-token) · [Interactive mode](#interactive-mode) · [Commands](#commands) · [Figma](#how-figma-integration-works) · [Local models](#local-models-ollama-omlx) · [Configuration](#configuration) · [Roadmap](#roadmap)
|
|
18
27
|
|
|
19
28
|
## What it does
|
|
20
29
|
|
|
21
|
-
- **
|
|
30
|
+
- **A new project in one command.** `eds new` clones Adobe's latest boilerplate (Document Authoring, Universal Editor or Commerce) without a GitHub login, and `eds init` sets it up for your authoring model.
|
|
31
|
+
- **Blocks from a design.** A Figma frame (REST or MCP), a Framer / Google Stitch page or any other web page (scraped with headless Chromium), or a local PNG / SVG export becomes `blocks/<name>/`: JS, CSS, a Universal Editor model and a preview mock. Works with Claude Code, Cursor and Codex, or a [local model](#local-models-ollama-omlx) through Ollama or oMLX. Content Fragment blocks (`--source cf` / `mixed`) get an async, fetching `decorate()`.
|
|
22
32
|
- **Migration from AEM.** `eds migrate component` turns a classic component's dialog into a block and a UE model, with no agent involved. It handles AEM as a Cloud Service proxy components (via `sling:resourceSuperType`, e.g. onto Core Components) and AEM 6.5 Classic UI `dialog.xml` files.
|
|
23
33
|
- **Within Figma's limits.** One REST or MCP call per block, then a cache. REST calls are paced per minute across parallel runs. A rate limit stops with the reset time; it never spends your MCP budget behind your back. [The limits](#how-figma-integration-works).
|
|
24
34
|
- **QA before review.** `eds block test` does visual regression on the block itself, plus a design↔render diff. `eds block check` covers content and a11y, including preview mocks nested deeper than real EDS markup. There are also `doctor`, loading and security audits.
|
|
@@ -89,24 +99,25 @@ eds block from-design --sample --name hero # generate it with your A
|
|
|
89
99
|
eds block preview hero # see it live in the browser
|
|
90
100
|
```
|
|
91
101
|
|
|
92
|
-
`--sample` uses
|
|
102
|
+
`--sample` uses the **hero of the project's example design**, bundled as an SVG and read straight from disk - **no Figma token, no MCP call, no network**. (`--dry-run` needs no AI agent either - it just prints the prompt.)
|
|
93
103
|
|
|
94
104
|
A real run (Claude Code): the agent's live log, a verification pass over the files it wrote, then a menu to refine, preview or finish.
|
|
95
105
|
|
|
96
|
-
<p align="center"><img src="https://raw.githubusercontent.com/piotrgodycki/aem-eds-kit/main/.github/assets/readme/cli-fd.png" alt="Terminal: eds block from-design --sample
|
|
106
|
+
<p align="center"><img src="https://raw.githubusercontent.com/piotrgodycki/aem-eds-kit/main/.github/assets/readme/cli-fd.png" alt="Terminal: eds block from-design --sample (the example hero), showing the design source, the agent's live log, the files it wrote, a verification table and the refine / preview / finish menu" width="760"></p>
|
|
97
107
|
|
|
98
108
|
`eds block preview` serves the block at the design's own widths, with live reload:
|
|
99
109
|
|
|
100
110
|
<p align="center"><img src="https://raw.githubusercontent.com/piotrgodycki/aem-eds-kit/main/.github/assets/readme/block-preview.webp" alt="Browser: the eds block preview harness showing the hero block at 1440 px with a breakpoint dropdown" width="100%"></p>
|
|
101
111
|
|
|
102
|
-
Ready for the real thing?
|
|
112
|
+
Ready for the real thing? The same example design exists as a page you can build every block from, and as a Figma file:
|
|
103
113
|
|
|
104
114
|
```bash
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
--name hero
|
|
115
|
+
# the example page (11 sections: hero, stats, cards, …) - read like a Framer / Stitch page
|
|
116
|
+
eds block from-design "https://piotrgodycki.github.io/aem-eds-kit/example/" --name cards
|
|
108
117
|
```
|
|
109
118
|
|
|
119
|
+
The Figma version is built by the plugin in [`examples/figma-kit`](https://github.com/piotrgodycki/aem-eds-kit/tree/main/examples/figma-kit) (run it once in Figma desktop); then pass any of its frame links.
|
|
120
|
+
|
|
110
121
|
## Interactive mode
|
|
111
122
|
|
|
112
123
|
Run `eds` with no command and it opens an **interactive menu** that stays open between actions (arrows to move, Enter to run, **Esc** to go back - or to quit from the menu itself; Ctrl+C quits anywhere). It walks you through every feature: new project (clone the boilerplate), set up project, page template, sandbox repo, block from design, migrate component, scaffold UE, empty block, integration, model fields, analytics, structured data, Universal Editor, preview block, pages (preview / publish), audits and Figma MCP.
|
|
@@ -369,7 +380,7 @@ The generated `_<name>.json` uses the EDS block-plugin (xwalk) format (`definiti
|
|
|
369
380
|
|
|
370
381
|
Translates a design - **a Figma URL, a Framer / Google Stitch page, or a local SVG/PNG export** - into an EDS block. Run with **no URL** for a step-by-step wizard (design source, name, link, content source, UE model, screenshot, run mode). It builds a prompt with EDS conventions + your project's design tokens and hands it to your AI agent (Claude Code, Cursor or Codex, or a [local model](#local-models-ollama-omlx)). *(This was `from-figma` before it went design-agnostic; Figma is the most battle-tested source and stays pixel-perfect.)*
|
|
371
382
|
|
|
372
|
-
**Figma vs. web sources.** Figma paints to a WebGL canvas, so it's read through the **REST API** (with a token) or **MCP**. Framer
|
|
383
|
+
**Figma vs. web sources.** Figma paints to a WebGL canvas, so it's read through the **REST API** (with a token) or **MCP**. Framer, Google Stitch and **any other web page** (a live site you're rebuilding, an HTML mock-up) render **real HTML**, so `eds` **scrapes** them with headless Chromium — reading computed layout, typography, colours and geometry straight off the page (no token, no MCP). On a page with several sections, the block is built from the one matching `--name`: try `eds block from-design https://piotrgodycki.github.io/aem-eds-kit/example/ --name cards`. Canva and Sketch are canvas/image-based and aren't scrapeable — export a frame and pass it as a local SVG/PNG. The provider is detected from the URL (Figma, Framer, Stitch, else a web page), or set with `--provider`.
|
|
373
384
|
|
|
374
385
|
**Gated sources (`--auth`).** A Google Stitch project (and a private Framer page) sits behind a login, so an anonymous scrape only sees the sign-in shell. Pass `--auth` and `eds` opens a **headed** browser once — you log in by hand, it saves the session, and every later scrape reuses it. The session (cookies/localStorage) is stored owner-only under `~/.eds/auth/<provider>.json`; re-login with `--auth-refresh`. (The saved session is a secret — it's never written to the repo.)
|
|
375
386
|
|
|
@@ -401,15 +412,16 @@ eds block from-design # interactive wizard
|
|
|
401
412
|
eds block from-design "<figma-url>" --name hero # non-interactive (REST if a token is set, else MCP)
|
|
402
413
|
eds block from-design "<framer-url>" --name hero # Framer/Stitch → scraped with headless Chromium
|
|
403
414
|
eds block from-design "<stitch-url>" --name hero --auth # gated source → log in once, reuse the session
|
|
415
|
+
eds block from-design "https://piotrgodycki.github.io/aem-eds-kit/example/" --name cards # any web page, one section
|
|
404
416
|
eds block from-design ./hero.svg --name hero # from a local export (no network)
|
|
405
|
-
eds block from-design --sample --name hero # bundled
|
|
417
|
+
eds block from-design --sample --name hero # bundled example hero (no token, no MCP)
|
|
406
418
|
eds block from-design "<figma-url>" --dry-run # just build the prompt
|
|
407
419
|
```
|
|
408
420
|
|
|
409
421
|
| Flag | Description |
|
|
410
422
|
|---|---|
|
|
411
423
|
| `--name <name>` | Override the inferred block name |
|
|
412
|
-
| `--provider <type>` | Design source: `figma` \| `framer` \| `stitch` (else detected from the URL) |
|
|
424
|
+
| `--provider <type>` | Design source: `figma` \| `framer` \| `stitch` \| `web` (else detected from the URL) |
|
|
413
425
|
| `--source <type>` | Content source: `document` \| `ue` \| `cf` \| `mixed` (`cf` / `mixed` default to the `sonnet` model) |
|
|
414
426
|
| `--widths <list>` | Design frame widths for preview breakpoints (e.g. `390,768,1440`) |
|
|
415
427
|
| `--agent <type>` | Force `claude` \| `cursor` \| `codex` \| `ollama` \| `omlx` \| `local` \| `none` (a prompt too large for one argument reaches Cursor / Codex as its file; see [Local models](#local-models-ollama-omlx)) |
|
|
@@ -421,8 +433,9 @@ eds block from-design "<figma-url>" --dry-run # just build the prompt
|
|
|
421
433
|
| `--auth` | Scrape with a logged-in session (Framer/Stitch): log in once, reuse it |
|
|
422
434
|
| `--auth-refresh` | Force a fresh scrape login even if a session is saved |
|
|
423
435
|
| `--refresh` | Ignore the cached snapshot and re-fetch |
|
|
424
|
-
| `--sample` | Use the bundled
|
|
436
|
+
| `--sample` | Use the bundled sample design, the example file's hero (no URL, token or MCP) |
|
|
425
437
|
| `--serve` | Auto-start the live preview (non-interactive runs only) |
|
|
438
|
+
| `--draft` | Generate a draft for review instead of writing `blocks/<name>/` (see [`eds draft`](#eds-draft)) |
|
|
426
439
|
| `--yes` | Skip confirmation prompts |
|
|
427
440
|
|
|
428
441
|
Set a **Figma Personal Access Token** (scope `file_content:read`) to use the REST path — via `FIGMA_TOKEN` env or `figma.token` in config. The block generation model defaults to the fastest (Haiku); override with `model` in config.
|
|
@@ -443,6 +456,21 @@ Interactive wizard that:
|
|
|
443
456
|
3. Shows install commands if not
|
|
444
457
|
4. Saves preferences to `~/.eds/config.json`
|
|
445
458
|
|
|
459
|
+
### `eds draft`
|
|
460
|
+
|
|
461
|
+
Review a block before it reaches the repository. With `--draft`, `block from-design` keeps its result as a **draft version** under `tmp/eds-cli/drafts/<name>/v1/`. `blocks/<name>/` stays exactly as it was: an existing block is set aside while the agent works and always put back. Each review round adds a version; nothing is written to `blocks/` until the draft is accepted, either right away or after a few rounds.
|
|
462
|
+
|
|
463
|
+
```bash
|
|
464
|
+
eds block from-design "<design link>" --name hero --draft # → draft v1
|
|
465
|
+
eds draft preview hero # review it (latest version)
|
|
466
|
+
eds draft refine hero "bigger headline, orange buttons" # one more round → v2
|
|
467
|
+
eds draft accept hero --branch feature/hero # → blocks/hero/, committed
|
|
468
|
+
eds draft list # drafts and their versions
|
|
469
|
+
eds draft discard hero # drop it; blocks/ untouched
|
|
470
|
+
```
|
|
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>`.
|
|
473
|
+
|
|
446
474
|
### `eds block list`
|
|
447
475
|
|
|
448
476
|
Lists all blocks in the project with their file status and Figma source info.
|
|
@@ -732,6 +760,8 @@ git clone https://github.com/piotrgodycki/aem-eds-kit.git && cd aem-eds-kit
|
|
|
732
760
|
npm install
|
|
733
761
|
```
|
|
734
762
|
|
|
763
|
+
Each change goes through an issue (`EDS-NNN`), a `feature/EDS-NNN` or `bug/EDS-NNN` branch and a PR, and **ships with its docs**: a `CHANGELOG.md` entry, `README.md` (this file is also the npm page) and the site pages it touches. CI's docs gate (`scripts/check-docs.mjs`) fails a PR that changes `src/` without a changelog entry, or the commands and flags in `src/bin/eds.ts` without `README.md` and `site/docs.html`. See [`CODING_STANDARDS.md`](https://github.com/piotrgodycki/aem-eds-kit/blob/main/CODING_STANDARDS.md).
|
|
764
|
+
|
|
735
765
|
### Scripts
|
|
736
766
|
|
|
737
767
|
```bash
|
|
@@ -800,11 +830,21 @@ Tests use fixtures in `tests/fixtures/` - a sample EDS project and recorded Figm
|
|
|
800
830
|
|
|
801
831
|
## Roadmap
|
|
802
832
|
|
|
803
|
-
|
|
804
|
-
- **
|
|
805
|
-
- **
|
|
806
|
-
- **
|
|
807
|
-
|
|
833
|
+
**Next**
|
|
834
|
+
- **Previews that look like the design.** The preview gets the design's real copy and images, so it matches 1:1; the block itself still reads authored content.
|
|
835
|
+
- **A self-check against the design.** Render the block, compare it with the Figma frame or the page, and fix what differs in a second pass.
|
|
836
|
+
- **Every breakpoint.** Read the design at mobile, tablet and desktop widths, not just one.
|
|
837
|
+
|
|
838
|
+
**Then**
|
|
839
|
+
- **Whole screens in one go.** Every section of a frame or page becomes a block, plus the page that puts them together.
|
|
840
|
+
- **Blocks that follow the design.** When the design changes, update the existing block instead of regenerating it.
|
|
841
|
+
- **Design tokens for the project.** Figma Variables become the CSS custom properties in `styles.css`.
|
|
842
|
+
|
|
843
|
+
**Later**
|
|
844
|
+
- **Deeper AEM migration.** HTL logic ported to `decorate()`, CSS taken from the rendered page, whole pages migrated.
|
|
845
|
+
- **Performance in the loop.** Lighthouse and real-user data (RUM) checked for every block.
|
|
846
|
+
|
|
847
|
+
Something missing? [Open an issue](https://github.com/piotrgodycki/aem-eds-kit/issues): the roadmap follows what people need.
|
|
808
848
|
|
|
809
849
|
## Trademarks & affiliation
|
|
810
850
|
|