aem-eds-kit 0.4.12 → 0.4.22

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,106 @@ 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
+ ### Added
10
+ - **`eds init` writes a local-dev `.env` + `xwalk.json` by default.** `.env`
11
+ carries the `aem up` config (`AEM_OPEN=/`, `AEM_PORT=3007`, `AEM_PAGES_URL`
12
+ prefilled from the git remote); it's never overwritten and always gitignored.
13
+ `xwalk.json` (Universal Editor multi-field enabled) is written for UE projects.
14
+ Opt out with `--no-env` / `--no-xwalk`. Standalone `eds scaffold env` and
15
+ `eds scaffold xwalk` (re)generate either on demand.
16
+ - **`eds ue check` / `eds ue open` - light Universal Editor helpers.** No Docker,
17
+ no local AEM SDK, no local UE Service. `ue check` is an offline readiness
18
+ report (UE config files present + which blocks have a model, so you know which
19
+ are editable). `ue open [path]` builds and opens the hosted Universal Editor
20
+ deep link for your cloud author, deriving the preview host
21
+ (`main--<repo>--<owner>.aem.page`) from the git remote; `--org`, `--ref`,
22
+ `--url`, `--no-open` to tweak.
23
+ - **Sandbox never overwrites an existing repo.** `eds sandbox new` now checks
24
+ whether `<owner>/<name>` already exists and refuses up front with a clear
25
+ message (in addition to the GitHub template API, which never clobbers). Guards
26
+ both the API and `gh` paths.
27
+ - **Secure GitHub sandboxes guide** (site): least-privilege setup - a fine-grained
28
+ token scoped to a single repo, or a dedicated sandbox org via `--org` - plus the
29
+ minimal permissions, token storage, and the overwrite/teardown safety notes.
30
+ Linked from the docs and README; added to the sitemap.
31
+
32
+ ## [0.4.19] - 2026-10-08
33
+
34
+ ### Added
35
+ - **`eds sandbox login` / `logout` - GitHub auth without `gh`.** The sandbox now
36
+ authorizes GitHub itself: the OAuth **Device Flow** (browser authorize) when an
37
+ OAuth app is configured (`EDS_GITHUB_CLIENT_ID`), or a Personal Access Token
38
+ otherwise; `GITHUB_TOKEN`/`GH_TOKEN` and an authenticated `gh` are also accepted
39
+ (fallback). Repos are created/listed/deleted via the GitHub REST API. The token
40
+ is stored owner-only (mode 0600) in `~/.eds/github.json`. `login` guides you to
41
+ a **least-privilege fine-grained token** (ideally scoped to a dedicated sandbox
42
+ org via `--org`), so nothing outside your sandboxes is exposed. The CLI only
43
+ ever lists sandboxes (by the `eds-sandbox` topic) and targets named repos.
44
+
45
+ ## [0.4.18] - 2026-10-08
46
+
47
+ ### Added
48
+ - **`eds sandbox`** - spin up and tear down disposable EDS sandbox repos on
49
+ GitHub (via the `gh` CLI). `sandbox new <name>` creates a repo from a boilerplate
50
+ (Document Authoring or Universal Editor / crosswalk), tags it `eds-sandbox`, and
51
+ a guided wizard walks you through visibility, opening the AEM Code Sync install
52
+ page, and running `eds init`. `sandbox list` shows your sandboxes with their
53
+ preview URLs; `sandbox rm <name>` deletes one (with confirmation). From an empty
54
+ folder to a live EDS environment - and gone again - in seconds. Needs the
55
+ globally installed CLI and an authenticated `gh`.
56
+
57
+ ### Added
58
+ - **`eds template new` composes blocks in order.** The wizard adds blocks one by
59
+ one (repeats allowed) so you control the exact sequence and count, instead of
60
+ an unordered checkbox.
61
+ - **Universal Editor initial content.** For the UE model, `template new` now
62
+ writes `templates/<name>.json` - the page's initial content as an **ordered
63
+ list of components with default field values** read from each block's model
64
+ (`_<block>.json`), plus registers the blocks so authors can add them. The EDS
65
+ analog of an AEM editable template's initial content.
66
+
67
+ ### Changed
68
+ - **`eds template new` is now authoring-aware.** It detects the model from
69
+ `fstab.yaml` / project markers (or `--authoring da|gdrive|sharepoint|ue`) and
70
+ routes the generated page: **DA** push (existing), an **importable doc** for
71
+ **Google Docs / SharePoint**, and for **Universal Editor** it registers the
72
+ seeded blocks in `component-filters.json` (so authors can add them) and points
73
+ to the AEM editable template. Completes the per-model template paths shown as
74
+ an infographic on the docs page.
75
+
76
+ ### Added
77
+ - **`eds template new <name>`** - generate EDS page **initial content** (the EDS
78
+ analog of an AEM template): a document of sections + chosen blocks + a metadata
79
+ block. Writes `templates/<name>.html` locally and, with `--push`, pushes it to
80
+ **DA (da.live)** via the source API (org/site from `.edsrc.json` or flags;
81
+ `DA_TOKEN` for protected projects). `--path`, `--title`, `--description`,
82
+ `--blocks`, `--area`. Also in the menu. (UE/crosswalk templates come next.)
83
+ - Docs: a **"From zero to a published page"** step-by-step command path.
84
+
85
+ ## [0.4.14] - 2026-10-08
86
+
87
+ ### Added
88
+ - **`eds schema block <name>` (JSON-LD)** - inject a schema.org structured-data
89
+ builder into a block's `decorate()`. Types: Article, FAQPage, BreadcrumbList,
90
+ Product, Organization, LocalBusiness, Event, VideoObject, Recipe, HowTo.
91
+ Idempotent, reads the block content via a `root` alias, appends a
92
+ `<script type="application/ld+json">` to the head. `--type`, interactive picker.
93
+ - **`eds scaffold helpers`** - write `scripts/utils.js`, picking the helpers you
94
+ want in an interactive checkbox (dependencies pulled in automatically) or by
95
+ name: `toCamelCase`, `getPagePath` / `getLanguageRootPath`, `getSiteArea`
96
+ (top-level area, e.g. blog), `getEnvironment`, `getContentTopic`, `isUEEdit` /
97
+ `isUEPreview` / `isUE`, `getMetadata`. Also in the `eds scaffold` picker.
98
+
99
+ ## [0.4.13] - 2026-10-08
100
+
101
+ ### Added
102
+ - **Model partials & helpers** - a library of reusable Universal Editor field
103
+ groups (heading, image, link, cta, cta-group, classes, eyebrow, richtext,
104
+ embed, teaser, card) built from typed field builders (correct `valueType` per
105
+ component), plus **`eds model add <block> [partials...]`** to compose them into
106
+ a block's `_<block>.json` (added by name, never duplicated). The from-design /
107
+ migrate prompt now lists the catalog so the agent reuses the standard groups
108
+ instead of inventing fields. Also in the menu.
10
109
 
11
110
  ### Added
12
111
  - **Framer** as a design source for `block from-design` (alongside Figma, Google
@@ -208,7 +307,14 @@ harness, gradient ANSI logo. Not published (superseded by 0.3.0).
208
307
  Initial CLI scaffold: `block create`, `block from-figma`, `block list`,
209
308
  `figma setup`, `doctor`, `preview`, `publish`. Not published.
210
309
 
211
- [Unreleased]: https://github.com/piotrgodycki/aem-eds-kit/compare/v0.4.12...HEAD
310
+ [Unreleased]: https://github.com/piotrgodycki/aem-eds-kit/compare/v0.4.19...HEAD
311
+ [0.4.19]: https://github.com/piotrgodycki/aem-eds-kit/releases/tag/v0.4.19
312
+ [0.4.18]: https://github.com/piotrgodycki/aem-eds-kit/releases/tag/v0.4.18
313
+ [0.4.17]: https://github.com/piotrgodycki/aem-eds-kit/releases/tag/v0.4.17
314
+ [0.4.16]: https://github.com/piotrgodycki/aem-eds-kit/releases/tag/v0.4.16
315
+ [0.4.15]: https://github.com/piotrgodycki/aem-eds-kit/releases/tag/v0.4.15
316
+ [0.4.14]: https://github.com/piotrgodycki/aem-eds-kit/releases/tag/v0.4.14
317
+ [0.4.13]: https://github.com/piotrgodycki/aem-eds-kit/releases/tag/v0.4.13
212
318
  [0.4.12]: https://github.com/piotrgodycki/aem-eds-kit/releases/tag/v0.4.12
213
319
  [0.4.11]: https://github.com/piotrgodycki/aem-eds-kit/releases/tag/v0.4.11
214
320
  [0.4.10]: https://github.com/piotrgodycki/aem-eds-kit/releases/tag/v0.4.10
package/README.md CHANGED
@@ -87,12 +87,54 @@ 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`
93
128
 
94
129
  Adapt a freshly cloned EDS boilerplate to your setup in one interactive wizard. Pick the authoring model - **Universal Editor (crosswalk), DA (da.live), Google Drive or SharePoint** - and `eds` sets the project name (`package.json` + boilerplate placeholders), writes `fstab.yaml` **only when the model needs it** (UE/crosswalk doesn't), scaffolds the crosswalk config + `paths.json` for UE, optionally adds the CI workflow, then walks the **external steps** (AEM Code Sync app, content-source share, Sidekick) as a clickable checklist.
95
130
 
131
+ By default it also writes, out of the box:
132
+
133
+ - a local-dev **`.env`** for `aem up` (`AEM_OPEN=/`, `AEM_PORT=3007`, `AEM_PAGES_URL` prefilled from your git remote) - never overwritten, always gitignored;
134
+ - for Universal Editor projects, an **`xwalk.json`** enabling UE multi-field support.
135
+
136
+ Opt out with `--no-env` / `--no-xwalk`, or (re)generate either later with `eds scaffold env` / `eds scaffold xwalk`.
137
+
96
138
  ```bash
97
139
  eds init # interactive
98
140
  eds init --name my-site --authoring da --org my-org --site my-site --yes
@@ -105,8 +147,52 @@ eds init --name my-site --authoring da --org my-org --site my-site --yes
105
147
  | `--mountpoint <url>` | Content source URL (document models) |
106
148
  | `--org <org>` / `--site <site>` | DA org / site (`--authoring da`) |
107
149
  | `--no-ci` | Skip the GitHub Actions workflow |
150
+ | `--no-env` | Skip the local-dev `.env` (aem up config) |
151
+ | `--no-xwalk` | Skip `xwalk.json` (UE multi-field) |
108
152
  | `--yes` | Skip prompts; apply with flags/defaults |
109
153
 
154
+ ### `eds template new <name>`
155
+
156
+ Generate EDS page **initial content** - the EDS analog of an AEM template. In the wizard you **compose the blocks in order** (add them one by one, repeats allowed - you control the sequence and count). 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** → writes `templates/<name>.json` (the page's initial content: an ordered list of components with default field values from each block's model) and registers the blocks so authors can add them. Interactive when flags are omitted; `--blocks hero,cards,cards` keeps order and repeats non-interactively.
157
+
158
+ ```bash
159
+ eds template new homepage # interactive (blocks, DA push)
160
+ eds template new homepage --blocks hero,cards --push --org my-org --site my-site
161
+ ```
162
+
163
+ | Flag | Description |
164
+ |---|---|
165
+ | `--blocks <list>` | Comma-separated block ids to seed |
166
+ | `--title` / `--description` / `--area` | Page title, description, metadata label |
167
+ | `--path <path>` | Content path (default `/templates/<name>`) |
168
+ | `--authoring <model>` | Force `da` \| `gdrive` \| `sharepoint` \| `ue` (else detected) |
169
+ | `--push` | Push to DA (da.live) |
170
+ | `--org` / `--site` | DA org / site (else from `.edsrc.json`) |
171
+ | `--yes` | Skip prompts |
172
+
173
+ ### `eds sandbox`
174
+
175
+ Spin up and tear down **disposable EDS sandbox repos** on GitHub - a rapid, throwaway environment you can stand up and delete in seconds, straight from an empty folder.
176
+
177
+ **Authorize GitHub once** - no `gh` required: `eds sandbox login` runs the OAuth **Device Flow** (open `github.com/login/device`, enter the code) when an OAuth app is configured (`EDS_GITHUB_CLIENT_ID`), otherwise it accepts a Personal Access Token (scopes `repo`, `delete_repo`). A token in `GITHUB_TOKEN`/`GH_TOKEN` works too, and an authenticated `gh` is used as a fallback.
178
+
179
+ ```bash
180
+ eds sandbox login # authorize GitHub (device flow or token)
181
+ eds sandbox new my-test # guided: boilerplate, visibility, Code Sync, eds init
182
+ eds sandbox new my-test --ue --private --yes
183
+ eds sandbox list # your sandboxes (tagged eds-sandbox) + preview URLs
184
+ eds sandbox rm my-test # delete it (with confirmation)
185
+ ```
186
+
187
+ `sandbox new` creates the repo from a boilerplate (Document Authoring `adobe/aem-boilerplate` or Universal Editor `adobe/aem-boilerplate-xwalk`) via the GitHub API, clones it, tags it `eds-sandbox`, then walks you through opening the AEM Code Sync install page and running `eds init`. The preview URL is `https://main--<repo>--<owner>.aem.page/`.
188
+
189
+ Sandboxes are **throwaway test repos** - stand one up to debug or try an integration, then delete it; they work fine on a personal account. Two safety guarantees:
190
+
191
+ - **Never overwrites an existing repo.** `sandbox new` checks first and refuses if `<owner>/<name>` already exists (and the GitHub template API never clobbers either way).
192
+ - **Least privilege.** Scope the token to just your sandboxes - a fine-grained token limited to one repo, or a dedicated sandbox org used via `--org`. `eds sandbox login` links you straight to the token page with the minimal permissions. See the [Secure GitHub sandboxes guide](https://piotrgodycki.github.io/aem-eds-kit/secure-github-sandboxes.html).
193
+
194
+ The token is stored owner-only (mode `0600`) in `~/.eds/github.json`; `eds sandbox logout` removes it. `list` only ever shows `eds-sandbox` repos and `rm` deletes only the named repo, with confirmation.
195
+
110
196
  ### `eds migrate component [dir]`
111
197
 
112
198
  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 +215,44 @@ eds track block hero
129
215
  eds track block hero --no-submit # clicks only
130
216
  ```
131
217
 
218
+ ### `eds model add <block> [partials...]`
219
+
220
+ 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.
221
+
222
+ ```bash
223
+ eds model add hero teaser # image + eyebrow + title + text + cta
224
+ eds model add cards card cta-group # pick several
225
+ eds model add hero # interactive checkbox picker
226
+ ```
227
+
228
+ Built-in partials: `heading`, `eyebrow`, `image`, `richtext`, `link`, `cta`, `cta-group`, `classes` (section styles), `embed`, `teaser`, `card`.
229
+
230
+ ### `eds schema block <name>`
231
+
232
+ 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.
233
+
234
+ ```bash
235
+ eds schema block faq --type FAQPage
236
+ eds schema block article # interactive type picker
237
+ ```
238
+
239
+ ### `eds ue check` · `eds ue open [path]`
240
+
241
+ Light **Universal Editor** helpers - no Docker, no local AEM SDK, no local UE Service to stand up.
242
+
243
+ `eds ue check` is an **offline readiness report**: it confirms the project is UE-ready (`component-definition.json` + `component-models.json` + `component-filters.json`) and lists which blocks are actually **editable** - a block is editable when it has a model (`_<name>.json` or a `component-models.json` entry), so you catch a block that won't appear in the editor before you open it.
244
+
245
+ `eds ue open [path]` builds and opens the **deep link** into the hosted Universal Editor for your **cloud author**, pointing the editor canvas at your preview host (derived from the git remote as `main--<repo>--<owner>.aem.page`).
246
+
247
+ ```bash
248
+ eds ue check
249
+ eds ue open /products
250
+ eds ue open / --org my-org --ref dev
251
+ eds ue open /blog --url main--site--owner.aem.page --no-open
252
+ ```
253
+
254
+ Full workflow (proxy, `.env`, `xwalk.json`, editor deep link): [`docs/local-development.md`](docs/local-development.md).
255
+
132
256
  ### `eds block create <name>`
133
257
 
134
258
  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 +327,14 @@ Scaffold Universal Editor components deterministically (no agent). `eds scaffold
203
327
  ```bash
204
328
  eds scaffold ue
205
329
  eds scaffold blocks # all, or: eds scaffold blocks hero cards
330
+ eds scaffold helpers # scripts/utils.js with common EDS helpers
331
+ ```
332
+
333
+ `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`.
334
+
335
+ ```bash
336
+ eds scaffold helpers # interactive picker
337
+ eds scaffold helpers getSiteArea getEnvironment
206
338
  ```
207
339
 
208
340
  ### `eds scaffold ci`