aem-eds-kit 0.4.12 → 0.4.16

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,50 @@ 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
9
+ ## [0.4.16] - 2026-10-08
10
+
11
+ ### Changed
12
+ - **`eds template new` is now authoring-aware.** It detects the model from
13
+ `fstab.yaml` / project markers (or `--authoring da|gdrive|sharepoint|ue`) and
14
+ routes the generated page: **DA** push (existing), an **importable doc** for
15
+ **Google Docs / SharePoint**, and for **Universal Editor** it registers the
16
+ seeded blocks in `component-filters.json` (so authors can add them) and points
17
+ to the AEM editable template. Completes the per-model template paths shown as
18
+ an infographic on the docs page.
19
+
20
+ ### Added
21
+ - **`eds template new <name>`** - generate EDS page **initial content** (the EDS
22
+ analog of an AEM template): a document of sections + chosen blocks + a metadata
23
+ block. Writes `templates/<name>.html` locally and, with `--push`, pushes it to
24
+ **DA (da.live)** via the source API (org/site from `.edsrc.json` or flags;
25
+ `DA_TOKEN` for protected projects). `--path`, `--title`, `--description`,
26
+ `--blocks`, `--area`. Also in the menu. (UE/crosswalk templates come next.)
27
+ - Docs: a **"From zero to a published page"** step-by-step command path.
28
+
29
+ ## [0.4.14] - 2026-10-08
30
+
31
+ ### Added
32
+ - **`eds schema block <name>` (JSON-LD)** - inject a schema.org structured-data
33
+ builder into a block's `decorate()`. Types: Article, FAQPage, BreadcrumbList,
34
+ Product, Organization, LocalBusiness, Event, VideoObject, Recipe, HowTo.
35
+ Idempotent, reads the block content via a `root` alias, appends a
36
+ `<script type="application/ld+json">` to the head. `--type`, interactive picker.
37
+ - **`eds scaffold helpers`** - write `scripts/utils.js`, picking the helpers you
38
+ want in an interactive checkbox (dependencies pulled in automatically) or by
39
+ name: `toCamelCase`, `getPagePath` / `getLanguageRootPath`, `getSiteArea`
40
+ (top-level area, e.g. blog), `getEnvironment`, `getContentTopic`, `isUEEdit` /
41
+ `isUEPreview` / `isUE`, `getMetadata`. Also in the `eds scaffold` picker.
42
+
43
+ ## [0.4.13] - 2026-10-08
44
+
45
+ ### Added
46
+ - **Model partials & helpers** - a library of reusable Universal Editor field
47
+ groups (heading, image, link, cta, cta-group, classes, eyebrow, richtext,
48
+ embed, teaser, card) built from typed field builders (correct `valueType` per
49
+ component), plus **`eds model add <block> [partials...]`** to compose them into
50
+ a block's `_<block>.json` (added by name, never duplicated). The from-design /
51
+ migrate prompt now lists the catalog so the agent reuses the standard groups
52
+ instead of inventing fields. Also in the menu.
10
53
 
11
54
  ### Added
12
55
  - **Framer** as a design source for `block from-design` (alongside Figma, Google
@@ -208,7 +251,11 @@ harness, gradient ANSI logo. Not published (superseded by 0.3.0).
208
251
  Initial CLI scaffold: `block create`, `block from-figma`, `block list`,
209
252
  `figma setup`, `doctor`, `preview`, `publish`. Not published.
210
253
 
211
- [Unreleased]: https://github.com/piotrgodycki/aem-eds-kit/compare/v0.4.12...HEAD
254
+ [Unreleased]: https://github.com/piotrgodycki/aem-eds-kit/compare/v0.4.16...HEAD
255
+ [0.4.16]: https://github.com/piotrgodycki/aem-eds-kit/releases/tag/v0.4.16
256
+ [0.4.15]: https://github.com/piotrgodycki/aem-eds-kit/releases/tag/v0.4.15
257
+ [0.4.14]: https://github.com/piotrgodycki/aem-eds-kit/releases/tag/v0.4.14
258
+ [0.4.13]: https://github.com/piotrgodycki/aem-eds-kit/releases/tag/v0.4.13
212
259
  [0.4.12]: https://github.com/piotrgodycki/aem-eds-kit/releases/tag/v0.4.12
213
260
  [0.4.11]: https://github.com/piotrgodycki/aem-eds-kit/releases/tag/v0.4.11
214
261
  [0.4.10]: https://github.com/piotrgodycki/aem-eds-kit/releases/tag/v0.4.10
package/README.md CHANGED
@@ -87,6 +87,41 @@ eds integrate
87
87
  eds doctor
88
88
  ```
89
89
 
90
+ ## From zero to a published page
91
+
92
+ The full path, command by command. This example targets **DA (da.live)** authoring.
93
+
94
+ ```bash
95
+ # 1. Install the CLI
96
+ npm i -g aem-eds-kit
97
+
98
+ # 2. Set up the project (pick DA, enter org + site). Writes fstab + CI + naming.
99
+ eds init --authoring da --org my-org --site my-site
100
+
101
+ # 3. Scaffold the Universal Editor config + helper functions
102
+ eds scaffold ue
103
+ eds scaffold helpers
104
+
105
+ # 4. Build blocks - from a design, from scratch, or migrated from classic AEM
106
+ eds block from-design # paste a Figma/Stitch/Canva/Sketch/Framer link
107
+ # eds block create hero
108
+ # eds migrate component ./components/hero
109
+
110
+ # 5. Enrich a block (optional)
111
+ eds model add hero teaser # add reusable field-group partials
112
+ eds schema block hero --type Article # JSON-LD structured data
113
+ eds track block hero # dataLayer click + form-submit tracking
114
+
115
+ # 6. Generate the page (initial content) and push it to DA
116
+ eds template new homepage --blocks hero,cards --push --org my-org --site my-site
117
+
118
+ # 7. Preview, then publish
119
+ eds preview /templates/homepage
120
+ eds publish /templates/homepage
121
+ ```
122
+
123
+ Every step is also interactive when you omit the flags - run `eds` for the menu.
124
+
90
125
  ## Commands
91
126
 
92
127
  ### `eds init`
@@ -107,6 +142,25 @@ eds init --name my-site --authoring da --org my-org --site my-site --yes
107
142
  | `--no-ci` | Skip the GitHub Actions workflow |
108
143
  | `--yes` | Skip prompts; apply with flags/defaults |
109
144
 
145
+ ### `eds template new <name>`
146
+
147
+ Generate EDS page **initial content** - the EDS analog of an AEM template: a document of sections + chosen blocks + a metadata block. It always writes `templates/<name>.html`, then **routes by your authoring model** (detected from `fstab.yaml` / project markers, or `--authoring`): **DA** → push to da.live (`--push`, org/site from `.edsrc.json`/flags, `DA_TOKEN` for protected projects); **Google Docs / SharePoint** → importable doc + the external steps; **Universal Editor** → registers the seeded blocks in `component-filters.json` and points you to the AEM editable template. Interactive when flags are omitted.
148
+
149
+ ```bash
150
+ eds template new homepage # interactive (blocks, DA push)
151
+ eds template new homepage --blocks hero,cards --push --org my-org --site my-site
152
+ ```
153
+
154
+ | Flag | Description |
155
+ |---|---|
156
+ | `--blocks <list>` | Comma-separated block ids to seed |
157
+ | `--title` / `--description` / `--area` | Page title, description, metadata label |
158
+ | `--path <path>` | Content path (default `/templates/<name>`) |
159
+ | `--authoring <model>` | Force `da` \| `gdrive` \| `sharepoint` \| `ue` (else detected) |
160
+ | `--push` | Push to DA (da.live) |
161
+ | `--org` / `--site` | DA org / site (else from `.edsrc.json`) |
162
+ | `--yes` | Skip prompts |
163
+
110
164
  ### `eds migrate component [dir]`
111
165
 
112
166
  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.
@@ -129,6 +183,27 @@ eds track block hero
129
183
  eds track block hero --no-submit # clicks only
130
184
  ```
131
185
 
186
+ ### `eds model add <block> [partials...]`
187
+
188
+ Compose **reusable field groups (partials)** into a block's Universal Editor model (`_<block>.json`) instead of hand-writing fields. Fields are added **by name**, so re-running never duplicates. Partials are built from typed field helpers (each sets the right `valueType`), and the same catalog is referenced in the `from-design` / `migrate` prompt so the agent reuses the standard groups.
189
+
190
+ ```bash
191
+ eds model add hero teaser # image + eyebrow + title + text + cta
192
+ eds model add cards card cta-group # pick several
193
+ eds model add hero # interactive checkbox picker
194
+ ```
195
+
196
+ Built-in partials: `heading`, `eyebrow`, `image`, `richtext`, `link`, `cta`, `cta-group`, `classes` (section styles), `embed`, `teaser`, `card`.
197
+
198
+ ### `eds schema block <name>`
199
+
200
+ Inject a **JSON-LD (schema.org) structured-data** builder into a block's `decorate()` for SEO / rich results. Pick a type - `Article`, `FAQPage`, `BreadcrumbList`, `Product`, `Organization`, `LocalBusiness`, `Event`, `VideoObject`, `Recipe`, `HowTo` - and it appends a `<script type="application/ld+json">` to the head, built from the block's content (aliased to `root`, so it's independent of the parameter name). Idempotent; some fields are heuristic or `TODO`, so review and validate with Google's Rich Results test.
201
+
202
+ ```bash
203
+ eds schema block faq --type FAQPage
204
+ eds schema block article # interactive type picker
205
+ ```
206
+
132
207
  ### `eds block create <name>`
133
208
 
134
209
  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.
@@ -203,6 +278,14 @@ Scaffold Universal Editor components deterministically (no agent). `eds scaffold
203
278
  ```bash
204
279
  eds scaffold ue
205
280
  eds scaffold blocks # all, or: eds scaffold blocks hero cards
281
+ eds scaffold helpers # scripts/utils.js with common EDS helpers
282
+ ```
283
+
284
+ `eds scaffold helpers` writes `scripts/utils.js` - **tick the helpers you want** in an interactive checkbox (dependencies are pulled in automatically), or pass names. Available: `toCamelCase`, `getPagePath` / `getLanguageRootPath`, `getSiteArea` (top-level area like `blog`), `getEnvironment`, `getContentTopic`, `isUEEdit` / `isUEPreview` / `isUE`, and `getMetadata`.
285
+
286
+ ```bash
287
+ eds scaffold helpers # interactive picker
288
+ eds scaffold helpers getSiteArea getEnvironment
206
289
  ```
207
290
 
208
291
  ### `eds scaffold ci`