aem-eds-kit 0.4.7 → 0.4.12

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,59 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.4.12] - 2026-10-08
10
+
11
+ ### Added
12
+ - **Framer** as a design source for `block from-design` (alongside Figma, Google
13
+ Stitch, Canva and Sketch) - the agent reads the project through its Framer MCP
14
+ connection. Also added a copy-paste **AI-agent setup prompt** to the landing +
15
+ README (checks Node 20+, installs the CLI, verifies).
16
+
17
+ ### Changed
18
+ - Landing version pill shows `v0.4` (minor) instead of chasing every patch.
19
+
20
+ ### Added
21
+ - **`eds track block <name>`** - instrument a block's `decorate()` with dataLayer
22
+ tracking on demand: delegated `block_click` (links/buttons, label from
23
+ `data-track` or text) and `form_submit`, pushed via `trackEvent` from
24
+ `scripts/analytics.js`. Adds the import and injects at the top of decorate,
25
+ idempotent, keeps the real parameter name. `--no-click` / `--no-submit`. Also
26
+ offered right after `block from-design` and `migrate component`, and in the menu.
27
+
28
+ ## [0.4.10] - 2026-10-08
29
+
30
+ ### Changed
31
+ - **`eds integrate gtm`** now emits a proper module instead of the inline IIFE:
32
+ `scripts/analytics.js` (exports `trackEvent` / `loadGTM`, **initialises the
33
+ dataLayer**, reads the id from `gtm-id` metadata with a configured fallback,
34
+ idempotent, `Date.now()`, no dead `<noscript>` iframe) and `scripts/page-meta.js`
35
+ (default-exported `pageMetaPush`). `delayed.js` imports both and pushes page
36
+ metadata before GTM initialises. Fixes the "dataLayer is undefined" crash of
37
+ the old snippet.
38
+
39
+ ### Added
40
+ - `eds migrate component` now pulls the component's **clientlib CSS** off disk
41
+ into the block's CSS (auto-detected, or `--clientlib <dir>`): honours
42
+ `css.txt` ordering + `#base=`, concatenates the `.css`, and flags any
43
+ LESS/SCSS that needs a build. A starting point to review and scope under
44
+ `.<block>` (the faithful, rendered-CSS path comes in a later phase).
45
+
46
+ ## [0.4.8] - 2026-10-07
47
+
48
+ ### Added
49
+ - **`eds migrate component <dir>`** - start migrating a classic AEM component to
50
+ EDS. Phase 1 (deterministic, no agent/network): parses the Touch UI dialog
51
+ (`_cq_dialog/.content.xml`) and maps its Granite/Coral fields onto the 17
52
+ Universal Editor field types - selects keep their options, multifields become
53
+ repeatable containers, tabs are preserved - then writes `blocks/<name>/` with
54
+ a UE model, a decorator stub, and a scoped CSS file to fill from the clientlib
55
+ or rendered page. Also in the `eds` menu.
56
+
57
+ ## [0.4.7] - 2026-10-07
58
+
59
+ ### Changed
60
+ - Consistent "no EDS project markers found" message across every command.
61
+
9
62
  ## [0.4.6] - 2026-10-07
10
63
 
11
64
  ### Added
@@ -155,7 +208,13 @@ harness, gradient ANSI logo. Not published (superseded by 0.3.0).
155
208
  Initial CLI scaffold: `block create`, `block from-figma`, `block list`,
156
209
  `figma setup`, `doctor`, `preview`, `publish`. Not published.
157
210
 
158
- [Unreleased]: https://github.com/piotrgodycki/aem-eds-kit/compare/v0.4.6...HEAD
211
+ [Unreleased]: https://github.com/piotrgodycki/aem-eds-kit/compare/v0.4.12...HEAD
212
+ [0.4.12]: https://github.com/piotrgodycki/aem-eds-kit/releases/tag/v0.4.12
213
+ [0.4.11]: https://github.com/piotrgodycki/aem-eds-kit/releases/tag/v0.4.11
214
+ [0.4.10]: https://github.com/piotrgodycki/aem-eds-kit/releases/tag/v0.4.10
215
+ [0.4.9]: https://github.com/piotrgodycki/aem-eds-kit/releases/tag/v0.4.9
216
+ [0.4.8]: https://github.com/piotrgodycki/aem-eds-kit/releases/tag/v0.4.8
217
+ [0.4.7]: https://github.com/piotrgodycki/aem-eds-kit/releases/tag/v0.4.7
159
218
  [0.4.6]: https://github.com/piotrgodycki/aem-eds-kit/releases/tag/v0.4.6
160
219
  [0.4.5]: https://github.com/piotrgodycki/aem-eds-kit/releases/tag/v0.4.5
161
220
  [0.4.4]: https://github.com/piotrgodycki/aem-eds-kit/releases/tag/v0.4.4
package/README.md CHANGED
@@ -10,7 +10,7 @@
10
10
 
11
11
  **Turn a design into an EDS block** - JS, CSS and a Universal Editor model - without leaving your terminal.
12
12
 
13
- `aem-eds-kit` gives you the `eds` command. Paste a design link - Figma, Google Stitch, Canva or Sketch - and it hands the design to the AI agent you already use (Claude Code, Cursor or Codex); the agent reads it through MCP and writes production-ready code straight into your repo. It also scaffolds blocks, previews them in your browser, and keeps your project healthy with a few quick audits.
13
+ `aem-eds-kit` gives you the `eds` command. Paste a design link - Figma, Google Stitch, Canva, Sketch or Framer - and it hands the design to the AI agent you already use (Claude Code, Cursor or Codex); the agent reads it through MCP and writes production-ready code straight into your repo. It also scaffolds blocks, previews them in your browser, and keeps your project healthy with a few quick audits.
14
14
 
15
15
  It lives next to `@adobe/aem-cli` (your local dev server) and handles everything around it.
16
16
 
@@ -20,6 +20,32 @@ It lives next to `@adobe/aem-cli` (your local dev server) and handles everything
20
20
  npm install -g aem-eds-kit
21
21
  ```
22
22
 
23
+ <details>
24
+ <summary><strong>Or let your AI agent install it</strong> (copy-paste prompt)</summary>
25
+
26
+ ```text
27
+ Goal:
28
+ Ensure Node.js v20 or newer is installed, then install the aem-eds-kit CLI and verify it.
29
+
30
+ Check first: run `node --version`. If the major version is 20 or higher, do not install or modify Node.js.
31
+ If Node.js is missing or older than v20, install an official Node.js release (major version 20 or higher).
32
+
33
+ Install policy: use an existing package manager only if it is already installed. Do not install Homebrew,
34
+ winget, Chocolatey, Scoop, nvm, fnm, or another package manager just for this task.
35
+ - macOS: Homebrew if already installed, otherwise the official Node.js `.pkg` installer.
36
+ - Windows: winget if already installed, otherwise the official Node.js `.msi` installer.
37
+ - Linux: the system package manager if it can install v20+, otherwise NodeSource (Debian/Ubuntu, RHEL/Fedora)
38
+ or the official Node.js standalone Linux binary. Downloads: https://nodejs.org/download/release/latest/
39
+
40
+ Verify Node: run `node --version` again; only continue if the major version is 20 or higher.
41
+ Install the CLI: run `npm install -g aem-eds-kit`. Verify: run `eds --version`.
42
+
43
+ Final step: from inside an EDS project (a folder with fstab.yaml, head.html, or scripts/scripts.js), run `eds`
44
+ for the interactive menu, or `eds init` to set up a freshly cloned Adobe EDS boilerplate.
45
+ ```
46
+
47
+ </details>
48
+
23
49
  Node.js 20 or newer. That's all the setup there is - `eds` now works in **any folder**. Step into your EDS project (anywhere with a `fstab.yaml`) and the CLI finds the project root for you:
24
50
 
25
51
  ```bash
@@ -32,7 +58,7 @@ eds block from-design "<figma-url>" --name hero
32
58
 
33
59
  ## Interactive mode
34
60
 
35
- Run `eds` with no command and it opens an **interactive menu** that walks you through every feature (generate a block from a design, scaffold, create a block, add an integration, preview, Admin API, audits, Figma setup). Most commands are also interactive on their own when you omit arguments - e.g. `eds block from-design` (wizard), `eds scaffold`, `eds integrate`, `eds preview`. Flags and subcommands still work for CI / power users.
61
+ Run `eds` with no command and it opens an **interactive menu** that walks you through every feature (set up the project, generate a block from a design, migrate a classic AEM component, scaffold, create a block, add an integration, preview, Admin API, audits, Figma setup). Most commands are also interactive on their own when you omit arguments - e.g. `eds init`, `eds block from-design` (wizard), `eds migrate component`, `eds scaffold`, `eds integrate`, `eds preview`. Flags and subcommands still work for CI / power users.
36
62
 
37
63
  A full A-Z reference of every command lives on the docs page: **https://piotrgodycki.github.io/aem-eds-kit/docs.html**
38
64
 
@@ -81,6 +107,28 @@ eds init --name my-site --authoring da --org my-org --site my-site --yes
81
107
  | `--no-ci` | Skip the GitHub Actions workflow |
82
108
  | `--yes` | Skip prompts; apply with flags/defaults |
83
109
 
110
+ ### `eds migrate component [dir]`
111
+
112
+ Start migrating a **classic AEM component** to EDS. Phase 1 is deterministic (no agent, no network): it parses the component's Touch UI dialog (`_cq_dialog/.content.xml`) and maps its Granite/Coral fields onto the **17 Universal Editor field types** - selects keep their options, multifields become repeatable containers, tabs are preserved - then writes `blocks/<name>/` with a UE model (`_<name>.json`), a `decorate()` stub (port the HTL logic), and a scoped CSS file to fill from the component's clientlib or its rendered page.
113
+
114
+ It also pulls the component's **clientlib CSS** off disk into the block's CSS when it can find one (auto-detected, or `--clientlib <dir>`): it honours `css.txt` ordering (and `#base=`), concatenates the `.css`, and flags any LESS/SCSS that needs a build. Treat it as a starting point - review the selectors and scope them under `.<block>`.
115
+
116
+ ```bash
117
+ eds migrate component /path/to/apps/myproject/components/hero
118
+ eds migrate component ./components/hero --name hero --clientlib ./ui.apps/.../hero/clientlib --yes
119
+ ```
120
+
121
+ Dialogs map cleanly because Granite's `sling:resourceType` set is finite. The most faithful CSS actually comes from the **rendered page** (resolves LESS vars + cascade) - that capture lands in a later phase; for now the clientlib source gets you most of the way.
122
+
123
+ ### `eds track block <name>`
124
+
125
+ Instrument a block's `decorate()` with **dataLayer** tracking on demand: a delegated `block_click` (links/buttons, label from `data-track` or the element text) and `form_submit`, both pushed through `trackEvent` from `scripts/analytics.js` (created by `eds integrate gtm`). It adds the import, injects at the top of `decorate()`, is idempotent, and keeps the real parameter name. You're also offered it right after `block from-design` and `migrate component`.
126
+
127
+ ```bash
128
+ eds track block hero
129
+ eds track block hero --no-submit # clicks only
130
+ ```
131
+
84
132
  ### `eds block create <name>`
85
133
 
86
134
  Scaffolds `blocks/<name>/` with `<name>.js`, `<name>.css`, **and a Universal Editor model `_<name>.json` by default** - so the block is authorable in UE the moment it's created. Validates kebab-case naming and checks for collisions.
@@ -94,7 +142,7 @@ The generated `_<name>.json` uses the EDS block-plugin (xwalk) format (`definiti
94
142
 
95
143
  ### `eds block from-design [design-url]`
96
144
 
97
- Translates a design - **Figma, Google Stitch, Canva or Sketch** - 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). *(This was `from-figma` before it went design-agnostic; Figma is the most battle-tested source and stays pixel-perfect.)*
145
+ Translates a design - **Figma, Google Stitch, Canva, Sketch or Framer** - 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). *(This was `from-figma` before it went design-agnostic; Figma is the most battle-tested source and stays pixel-perfect.)*
98
146
 
99
147
  The agent reads the design through its MCP connection (for Figma: `get_design_context`, `get_variable_defs`, `get_screenshot`), generates pixel-perfect code (JS + CSS) **and its Universal Editor model** by default, uses lightweight **placeholders** for not-yet-authored content (so the block is visible before Universal Editor takes over), then self-verifies. You see a **live, colour-coded log** with per-phase timings, and on success the **live preview starts automatically**.
100
148
 
@@ -167,7 +215,7 @@ eds scaffold ci
167
215
 
168
216
  ### `eds integrate [type]`
169
217
 
170
- Add a third-party service to `scripts/delayed.js` (the EDS-correct place - delayed phase, after LCP, zero CWV impact). Chat widgets use the facade pattern.
218
+ Add a third-party service to `scripts/delayed.js` (the EDS-correct place - delayed phase, after LCP, zero CWV impact). Chat widgets use the facade pattern. **GTM** gets a `scripts/analytics.js` module (exports `trackEvent` / `loadGTM`, initialises the dataLayer, reads the container id from the `gtm-id` metadata) plus a `scripts/page-meta.js` (default-exported `pageMetaPush`); `delayed.js` imports both and pushes page metadata before GTM initialises.
171
219
 
172
220
  ```bash
173
221
  eds integrate # interactive