aem-eds-kit 0.4.9 → 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,7 +6,35 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
- ## [0.4.9] - 2026-10-08
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.
10
38
 
11
39
  ### Added
12
40
  - `eds migrate component` now pulls the component's **clientlib CSS** off disk
@@ -180,7 +208,10 @@ harness, gradient ANSI logo. Not published (superseded by 0.3.0).
180
208
  Initial CLI scaffold: `block create`, `block from-figma`, `block list`,
181
209
  `figma setup`, `doctor`, `preview`, `publish`. Not published.
182
210
 
183
- [Unreleased]: https://github.com/piotrgodycki/aem-eds-kit/compare/v0.4.9...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
184
215
  [0.4.9]: https://github.com/piotrgodycki/aem-eds-kit/releases/tag/v0.4.9
185
216
  [0.4.8]: https://github.com/piotrgodycki/aem-eds-kit/releases/tag/v0.4.8
186
217
  [0.4.7]: https://github.com/piotrgodycki/aem-eds-kit/releases/tag/v0.4.7
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
 
@@ -94,6 +120,15 @@ eds migrate component ./components/hero --name hero --clientlib ./ui.apps/.../he
94
120
 
95
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.
96
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
+
97
132
  ### `eds block create <name>`
98
133
 
99
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.
@@ -107,7 +142,7 @@ The generated `_<name>.json` uses the EDS block-plugin (xwalk) format (`definiti
107
142
 
108
143
  ### `eds block from-design [design-url]`
109
144
 
110
- 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.)*
111
146
 
112
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**.
113
148
 
@@ -180,7 +215,7 @@ eds scaffold ci
180
215
 
181
216
  ### `eds integrate [type]`
182
217
 
183
- 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.
184
219
 
185
220
  ```bash
186
221
  eds integrate # interactive