@wix/agent-skills 1.31.0 → 1.31.2
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/package.json +1 -1
- package/skills/wix-app/SKILL.md +7 -8
- package/skills/wix-app/references/DASHBOARD_PAGE.md +1 -1
- package/skills/wix-app/references/STORES_VERSIONING.md +1 -1
- package/skills/wix-app/references/WIX_PATTERNS_DOCS.md +11 -50
- package/skills/wix-app/references/dashboard-page/DATA_SOURCES.md +14 -10
- package/skills/wix-app/references/dashboard-page/DRAFT_TEMPLATE.md +5 -8
- package/skills/wix-app/references/dashboard-page/TABLE_STATE.md +5 -4
- package/skills/wix-headless-kit/SKILL.md +31 -14
- package/skills/wix-headless-kit/guides/api-run.md +116 -31
- package/skills/wix-headless-kit/guides/existing-site.md +9 -2
- package/skills/wix-headless-kit/guides/reference-mode.md +9 -1
- package/skills/wix-headless-kit/install/AGENTS.md +10 -7
- package/skills/wix-headless-kit/install/attach.mjs +35 -30
- package/skills/wix-headless-kit/install/background.mjs +32 -0
- package/skills/wix-headless-kit/install/bootstrap.mjs +28 -11
- package/skills/wix-headless-kit/install/check.mjs +2 -2
- package/skills/wix-headless-kit/install/context.mjs +62 -8
- package/skills/wix-headless-kit/install/deploy.mjs +36 -11
- package/skills/wix-headless-kit/install/env-ignore.mjs +16 -0
- package/skills/wix-headless-kit/install/install.mjs +95 -0
- package/skills/wix-headless-kit/install/pins.json +1 -1
- package/skills/wix-headless-kit/install/proc.mjs +46 -0
- package/skills/wix-headless-kit/install/setup.mjs +18 -27
- package/skills/wix-headless-kit/install/templates.mjs +4 -3
- package/skills/wix-headless-templates/blog/app/components/blog/RichContent.tsx +3 -2
- package/skills/wix-headless-templates/blog/project/package-lock.json +1287 -1299
- package/skills/wix-headless-templates/blog/project/package.json +1 -1
- package/skills/wix-headless-templates/blog/project/src/components/blog/RichContent.tsx +3 -2
- package/skills/wix-headless-templates/blog/rest/authors.ts +5 -5
- package/skills/wix-headless-templates/blog/rest/comments.ts +4 -4
- package/skills/wix-headless-templates/blog/rest/post-likes.ts +3 -3
- package/skills/wix-headless-templates/blog/rest/posts.ts +4 -4
- package/skills/wix-headless-templates/blog/rest/taxonomy.ts +5 -5
- package/skills/wix-headless-templates/blog/seed/SEED.md +1 -1
- package/skills/wix-headless-templates/blog/seed/seed-blog.mjs +4 -3
- package/skills/wix-headless-templates/bookings/rest/booking.ts +4 -4
- package/skills/wix-headless-templates/bookings/rest/services.ts +4 -4
- package/skills/wix-headless-templates/bookings/seed/SEED.md +1 -1
- package/skills/wix-headless-templates/bookings/seed/seed-bookings.mjs +4 -2
- package/skills/wix-headless-templates/cms/rest/collections.ts +3 -3
- package/skills/wix-headless-templates/cms/rest/items.ts +4 -4
- package/skills/wix-headless-templates/cms/seed/seed-cms.mjs +2 -1
- package/skills/wix-headless-templates/donations/rest/campaigns.ts +4 -4
- package/skills/wix-headless-templates/donations/rest/donate.ts +3 -3
- package/skills/wix-headless-templates/donations/seed/SEED.md +1 -1
- package/skills/wix-headless-templates/donations/seed/seed-donations.mjs +5 -3
- package/skills/wix-headless-templates/events/rest/events.ts +4 -4
- package/skills/wix-headless-templates/events/rest/orders.ts +4 -4
- package/skills/wix-headless-templates/events/rest/registration.ts +4 -4
- package/skills/wix-headless-templates/events/seed/SEED.md +1 -1
- package/skills/wix-headless-templates/events/seed/seed-events.mjs +5 -3
- package/skills/wix-headless-templates/faq/rest/faq.ts +4 -4
- package/skills/wix-headless-templates/faq/seed/seed-faq.mjs +2 -1
- package/skills/wix-headless-templates/forms/rest/forms.ts +4 -4
- package/skills/wix-headless-templates/forms/rest/submissions.ts +4 -4
- package/skills/wix-headless-templates/forms/seed/seed-forms.mjs +2 -1
- package/skills/wix-headless-templates/members/rest/auth.ts +3 -3
- package/skills/wix-headless-templates/members/rest/members.ts +4 -4
- package/skills/wix-headless-templates/members/seed/seed-members.mjs +2 -1
- package/skills/wix-headless-templates/portfolio/rest/portfolio.ts +4 -4
- package/skills/wix-headless-templates/portfolio/seed/SEED.md +4 -2
- package/skills/wix-headless-templates/portfolio/seed/seed-portfolio.mjs +8 -7
- package/skills/wix-headless-templates/pricing-plans/rest/plan-access.ts +3 -3
- package/skills/wix-headless-templates/pricing-plans/rest/plans.ts +4 -4
- package/skills/wix-headless-templates/pricing-plans/rest/purchase.ts +3 -3
- package/skills/wix-headless-templates/pricing-plans/seed/seed-pricing-plans.mjs +2 -1
- package/skills/wix-headless-templates/rentals/rest/rentals.ts +4 -4
- package/skills/wix-headless-templates/rentals/seed/SEED.md +1 -1
- package/skills/wix-headless-templates/rentals/seed/seed-rentals.mjs +4 -2
- package/skills/wix-headless-templates/restaurants/rest/menu.ts +4 -4
- package/skills/wix-headless-templates/restaurants/rest/ordering.ts +5 -5
- package/skills/wix-headless-templates/restaurants/rest/reservations.ts +4 -4
- package/skills/wix-headless-templates/restaurants/seed/SEED.md +1 -1
- package/skills/wix-headless-templates/restaurants/seed/seed-restaurants.mjs +6 -4
- package/skills/wix-headless-templates/shared/capabilities/site-search/rest/search.ts +4 -4
- package/skills/wix-headless-templates/shared/capabilities/site-search/seed/install.mjs +6 -4
- package/skills/wix-headless-templates/shared/seed/images.mjs +41 -5
- package/skills/wix-headless-templates/shared/seed/main.mjs +15 -0
- package/skills/wix-headless-templates/shared/seed/wix-cli.mjs +43 -11
- package/skills/wix-headless-templates/storefront/INSTRUCTIONS.md +1 -1
- package/skills/wix-headless-templates/storefront/rest/cart.ts +5 -5
- package/skills/wix-headless-templates/storefront/rest/catalog.ts +5 -5
- package/skills/wix-headless-templates/storefront/seed/SEED.md +44 -14
- package/skills/wix-headless-templates/storefront/seed/seed-store.mjs +23 -15
- package/skills/wix-manage/SKILL.md +28 -18
- package/skills/wix-manage/references/app-installation/install-wix-apps.md +5 -1
- package/skills/wix-manage/references/app-installation/list-installed-apps.md +19 -9
- package/skills/wix-manage/references/automations/activation-status.md +52 -0
- package/skills/wix-manage/references/automations/api-catalog.md +81 -0
- package/skills/wix-manage/references/automations/build-and-manage-automations.md +34 -0
- package/skills/wix-manage/references/bookings/booking-service-policy-setup.md +3 -0
- package/skills/wix-manage/references/bookings/create-and-update-booking-services.md +277 -363
- package/skills/wix-manage/references/bookings/external-calendar-integration.md +3 -0
- package/skills/wix-manage/references/bookings/multi-resource-service-creation.md +3 -0
- package/skills/wix-manage/references/cms/cms-data-items-crud.md +11 -2
- package/skills/wix-manage/references/cms/cms-publishing-flow.md +63 -16
- package/skills/wix-manage/references/custom-apps/use-app-skills-and-app-tools.md +3 -1
- package/skills/wix-manage/references/forms/update-form.md +3 -0
- package/skills/wix-manage/references/pricing-plans/create-and-update-pricing-plans.md +3 -0
- package/skills/wix-manage/references/restaurants/wix-restaurants-setup.md +3 -0
- package/skills/wix-manage/references/sites/create-headless-site.md +7 -50
- package/skills/wix-manage/references/sites/manage-oauth-apps.md +4 -4
- package/skills/wix-manage/references/sites/read-site-context.md +4 -0
- package/skills/wix-manage/references/sites/send-feedback-to-wix.md +92 -0
- package/skills/wix-manage/references/sites/upload-static-site.md +298 -283
- package/skills/wix-manage/references/stores/add-store-pages-to-site.md +3 -0
- package/skills/wix-manage/references/stores/change-store-currency.md +3 -0
- package/skills/wix-manage/references/stores/create-product-catalog-v3.md +3 -0
- package/skills/wix-manage/references/stores/find-products-query-and-search-catalog-v3.md +3 -0
- package/skills/wix-manage/references/stores/update-product-with-options.md +192 -22
- package/skills/wix-manage/references/bookings/create-appointment-service.md +0 -243
- package/skills/wix-manage/references/bookings/create-booking-service-from-prompt.md +0 -31
- package/skills/wix-manage/references/bookings/create-class-service.md +0 -222
- package/skills/wix-manage/references/bookings/create-course-service.md +0 -251
package/package.json
CHANGED
package/skills/wix-app/SKILL.md
CHANGED
|
@@ -28,9 +28,9 @@ Helps build extensions for Wix CLI applications. Covers all extension types: das
|
|
|
28
28
|
- [ ] **Every filter reaches the query**: declared in the collection hook's `filters` and read inside `fetchData`. Filter UI that never narrows the rows is a defect that looks like a feature.
|
|
29
29
|
|
|
30
30
|
A filtered table with no drill-in and no working filters is what gets built when nobody states the requirement — the most common way a generated dashboard disappoints. The aggregate is the judgment call; the drill-in and the filters are not.
|
|
31
|
-
- [ ] **🛑 Template-First Gate (MANDATORY, dashboard UI only, comes before writing any shell/provider/router):** Followed [DRAFT_TEMPLATE.md](references/dashboard-page/DRAFT_TEMPLATE.md): found the page templates the installed `@wix/patterns` ships, chose one with its `Page Templates.md` guide — which pages the workflow above needs, **and where the rows come from** (your own fetch, or a CMS collection) — read that template's page, and copied every file
|
|
32
|
-
- [ ] **🛑 Patterns Docs Gate (MANDATORY for any dashboard page UI):** Read [WIX_PATTERNS_DOCS.md](references/WIX_PATTERNS_DOCS.md) **before the first command that touches `node_modules/@wix/patterns`** — its discovery chain (`pkg-root.cjs`, the index, `Composition and Providers.md` once, `Collection Toolkit.md` for which component serves a need) lives only in that file, and this line is a summary of its step 1, not a substitute for opening it. Then
|
|
33
|
-
- [ ] **🛑 Component Docs Gate (MANDATORY, dashboard UI only):** For each patterns symbol you are about to write, decided **from the
|
|
31
|
+
- [ ] **🛑 Template-First Gate (MANDATORY, dashboard UI only, comes before writing any shell/provider/router):** Followed [DRAFT_TEMPLATE.md](references/dashboard-page/DRAFT_TEMPLATE.md): found the page templates the installed `@wix/patterns` ships, chose one with its `Page Templates.md` guide — which pages the workflow above needs, **and where the rows come from** (your own fetch, or a CMS collection) — read that template's page, and copied every file `--templates` lists for it. Composing the page shell, provider nesting, or router wiring from scratch when a template already shows it is the failure mode this gate exists to prevent — the Patterns/Component Docs gates below are for what the template doesn't cover, not a replacement for starting there. The reverse holds too: a template replaces composing the shell, never the discovery chain, so every symbol it doesn't show still goes through the next gate.
|
|
32
|
+
- [ ] **🛑 Patterns Docs Gate (MANDATORY for any dashboard page UI):** Read [WIX_PATTERNS_DOCS.md](references/WIX_PATTERNS_DOCS.md) **before the first command that touches `node_modules/@wix/patterns`** — its discovery chain (`pkg-root.cjs`, the index, `Composition and Providers.md` once, `Collection Toolkit.md` for which component serves a need) lives only in that file, and this line is a summary of its step 1, not a substitute for opening it. Then resolve every patterns name you plan to write in **one** `node <pkgRoot>/bin/patterns-lookup.cjs <name…>` call: per name, it prints the import, the examples and the one props file. Upgrade `@wix/patterns` if `dist/docs/index.json` is missing. Patterns API facts come only from the published `dist/docs/` (pages), `dist/examples/` (worked calls), `dist/dts-bundle/` (types) and `dist/templates/` (whole pages) trees — never from `src/`, `dist/esm/`, `dist/types/`, or any other path inside the package. A prop a bundle has stubbed is in the file its stub names (`Reading the Doc Indices.md`).
|
|
33
|
+
- [ ] **🛑 Component Docs Gate (MANDATORY, dashboard UI only):** For each patterns symbol you are about to write, decided **from the lookup output** which single artifact answers the question you actually have — the import line, an example, or the props file — and read only that one, per [Component Selection Order](#component-selection-order)'s "the short version". State which artifact you read per symbol, and why, before the first line of JSX. Reading a doc *and* its bundle for the same symbol, or opening a page for an import line the lookup already gave you, is the failure this gate exists to prevent.
|
|
34
34
|
|
|
35
35
|
For the object `useTableCollection()` returns, read [TABLE_STATE.md](references/dashboard-page/TABLE_STATE.md) — a state object you receive rather than construct, whose members are unobvious and several plausible ones absent.
|
|
36
36
|
- [ ] **Step 3:** Checked API references; used MCP discovery only for gaps
|
|
@@ -111,11 +111,10 @@ Whole pages are the package's too: the router wiring for a multi-page extension,
|
|
|
111
111
|
`@wix/patterns/schema`, where the schema supplies fetch, filters, columns and the form — both ship
|
|
112
112
|
as page templates. See [DRAFT_TEMPLATE.md](references/dashboard-page/DRAFT_TEMPLATE.md).
|
|
113
113
|
|
|
114
|
-
The short version
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
table. Read the one artifact your open question needs. Resolve `<pkgRoot>` once per session
|
|
114
|
+
The short version: list every patterns name you plan to write, and resolve them all in one
|
|
115
|
+
`node <pkgRoot>/bin/patterns-lookup.cjs <name…>` call, not one index probe per name.
|
|
116
|
+
Its output gives each name's import line (no read needed), its worked examples, and the one
|
|
117
|
+
file that holds its props. Read the one artifact your open question needs. Resolve `<pkgRoot>` once per session
|
|
119
118
|
([Prerequisites](references/WIX_PATTERNS_DOCS.md#prerequisites)) and reuse it.
|
|
120
119
|
|
|
121
120
|
**Opening one item from a collection uses an editable `EntityPage` by default; create/edit flows also use `EntityPage`, never a dashboard modal** — see
|
|
@@ -35,7 +35,7 @@ The CLI generates the folder, the page's component file (`<page>.tsx`, the build
|
|
|
35
35
|
|
|
36
36
|
**Before writing that UI:** copy in the installed `@wix/patterns` page template that matches, per [DRAFT_TEMPLATE.md](dashboard-page/DRAFT_TEMPLATE.md) — don't compose the shell from scratch.
|
|
37
37
|
|
|
38
|
-
**Then, for whatever the template doesn't cover:**
|
|
38
|
+
**Then, for whatever the template doesn't cover:** list every patterns name you'll add, and resolve them all in one `node <pkgRoot>/bin/patterns-lookup.cjs <name…>` call ([WIX_PATTERNS_DOCS.md § 1](WIX_PATTERNS_DOCS.md#1--the-index)). Its import, examples and props file decide whether you open anything else. Each Bash call is a fresh shell — re-set the path variable every time.
|
|
39
39
|
|
|
40
40
|
## Capabilities
|
|
41
41
|
|
|
@@ -130,4 +130,4 @@ Payload changes: V1 `changedFields` → V3 `modifiedFields`. Top-level `entityId
|
|
|
130
130
|
- [stores/INVENTORY.md](stores/INVENTORY.md) — inventory read and write operations
|
|
131
131
|
- [stores/CATEGORIES.md](stores/CATEGORIES.md) — collections (V1) ↔ categories (V3)
|
|
132
132
|
|
|
133
|
-
For methods not listed here, use `SearchWixSDKDocumentation` then `ReadFullDocsArticle
|
|
133
|
+
For methods not listed here, use `SearchWixSDKDocumentation` then `ReadFullDocsMethodSchema` (use `ReadFullDocsArticle` only for prose). Always return the required permission scopes to the user.
|
|
@@ -12,23 +12,21 @@ Then check the install, two ways: `ls <pkgRoot>/dist/dts-bundle/index.json`, and
|
|
|
12
12
|
|
|
13
13
|
**If either fails, stop and upgrade `@wix/patterns`.** "Which component serves this need" now lives in the package, so proceeding means guessing names; do not hunt elsewhere in `node_modules` for a substitute. Everything below degrades by version rather than breaking, so probe rather than version-check.
|
|
14
14
|
|
|
15
|
-
**Patterns API facts come from four published trees only:** `dist/docs/` (pages), `dist/dts-bundle/` (types), `dist/examples/` (worked calls), `dist/templates/` (whole pages). Never take a component, prop or type from `src/`, `dist/esm/` or `dist/cjs/`, or a deep path a bundle mentions — internals change without notice. `dist/types
|
|
15
|
+
**Patterns API facts come from four published trees only:** `dist/docs/` (pages), `dist/dts-bundle/` (types), `dist/examples/` (worked calls), `dist/templates/` (whole pages). Never take a component, prop or type from `src/`, `dist/esm/` or `dist/cjs/`, or a deep path a bundle mentions — internals change without notice. That includes `dist/types/`: `tsc` reads it, but its files import their props from sibling files, so it answers no props question in one read.
|
|
16
16
|
|
|
17
17
|
## The Discovery Chain
|
|
18
18
|
|
|
19
19
|
### 1 — The index
|
|
20
20
|
|
|
21
|
-
**
|
|
21
|
+
**Resolve every patterns name you plan to write in one call:**
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
- **Resolve against the keys *and* each entry's `symbols` aliases.** The index is keyed by Storybook title: `ExportButton` lives under `ExportTo`, `CollectionToolbarFilters` under `ToolbarFilters`. Matching is exact — scan for something close before concluding a name isn't covered.
|
|
27
|
-
- **`status: "deprecated"`** means use what `statusMessage` names. A deprecated component still renders, so nothing else stops you.
|
|
23
|
+
```bash
|
|
24
|
+
node <pkgRoot>/bin/patterns-lookup.cjs Table useTableCollection stringsArrayFilter DateRangeFilter
|
|
25
|
+
```
|
|
28
26
|
|
|
29
|
-
|
|
27
|
+
The package ships this script, so it matches the installed indices. For each name it prints the import, the examples and the **one** file for props. Its `summary` line usually answers the question, so step 4 needs no read. A name in neither index makes it exit 1, with near matches. `--templates` lists the page templates. **List the names first.** Each name you add later costs another round trip, and those round trips are this step's whole cost.
|
|
30
28
|
|
|
31
|
-
**
|
|
29
|
+
**If `<pkgRoot>/bin/patterns-lookup.cjs` is missing** (an older `@wix/patterns`), probe `<pkgRoot>/dist/docs/index.json` with one `grep`/`python3` call covering every symbol, and match keys and `symbols` aliases exactly. Never `Read` it whole: it truncates silently. A name not in it may still be in `dist/dts-bundle/index.json`.
|
|
32
30
|
|
|
33
31
|
### 2 — Composition, once per session
|
|
34
32
|
|
|
@@ -46,48 +44,11 @@ Each guide's index entry carries `relatedComponents`; every name in it resolves,
|
|
|
46
44
|
|
|
47
45
|
### 4 — Read only what answers your question, then stop
|
|
48
46
|
|
|
49
|
-
|
|
50
|
-
| --- | --- | --- |
|
|
51
|
-
| What is it, and how does it wire in? | **nothing** — the entry says | `summary` |
|
|
52
|
-
| Where do I import it from? | **nothing** — the entry says | `importPath` |
|
|
53
|
-
| How do I call it? | one **example**, or a call in a guide's prose | `dist/examples/<examples[i]>` · `dist/docs/<guide>.md` |
|
|
54
|
-
| What props, and which are optional? | the **example** first; then the **`.d.ts`** *or* the doc — never both | `bundle` present: `dist/dts-bundle/<bundle>` · absent: `dist/docs/<file>` |
|
|
55
|
-
| A setup requirement or gotcha? | the **doc's** prose | `dist/docs/<file>` |
|
|
56
|
-
|
|
57
|
-
Prefix the index's bare values with their tree — `file` → `dist/docs/`, `examples` → `dist/examples/`, `bundle` → `dist/dts-bundle/`, `templateFiles` → `dist/templates/` — and never rebuild a path from a symbol name.
|
|
58
|
-
|
|
59
|
-
**Those two middle rows are one question in practice.** You ask how to call it, start writing, and the question turns prop-shaped mid-call — where the second row sends you to a `.d.ts` that may be stubbed (step 5). Take the props off the example first; go to the `.d.ts` only for what it cannot show — optionality, union members, an exact callback signature.
|
|
60
|
-
|
|
61
|
-
**A guide's prose often holds the call.** `PrimaryActions`' bundle stubs its own props type, while `usePatternsNavigate.md` carries `<PrimaryActions label="Add shift" onClick={…} />` verbatim. Check what you have already read before opening anything.
|
|
62
|
-
|
|
63
|
-
**`bundle` and a doc props table are mutually exclusive.** With `bundle`, the page's `### Props` is only a pointer; without it, that table marks what is required. Reading both is one hop too many.
|
|
64
|
-
|
|
65
|
-
**A `.d.ts` names props; it never says what they do.** Wiring and defaults live in prose: `CollectionSearch`'s bundle lists four optional props and no behaviour, while its page says the search term reaches your `fetchData` via `query.search`. When a behaviour question outlives the `summary`, open the page.
|
|
66
|
-
|
|
67
|
-
**Artifact not listed?** No `examples` — a hook's usage is usually filed under the component it pairs with (`useEntityPage` → `EntityPage/basic.tsx`). No `importPath` — a guide, or documented but not exported. Nothing at all — a state object you receive rather than construct; its doc is the only source.
|
|
68
|
-
|
|
69
|
-
### 5 — Traps that make a read wrong
|
|
70
|
-
|
|
71
|
-
**Search inside the file an index named, never across the tree.** A shared shape is re-stubbed in every bundle referencing it, so a tree-wide `grep` returns mostly pointers, and the first hit is rarely the declaration.
|
|
72
|
-
|
|
73
|
-
**Most bundles stub the parent holding the props — 70 of the 105 curated entries do** — and the index says so per entry. **`dist/dts-bundle/index.json` is the triage surface, not merely a fallback for names the docs index lacks:** a component entry carries `ownProps` / `inheritedProps` beside `bytes` and `readWith`, so "is this file the whole answer" is a lookup, not an inspection.
|
|
74
|
-
|
|
75
|
-
- `Table` → `ownProps: 5, inheritedProps: 58`, `readWith` naming 3 files. Five of sixty-three.
|
|
76
|
-
- `PrimaryActions` → `ownProps: 0, inheritedProps: 12`. A 470-byte file declaring none of them.
|
|
77
|
-
- No `ownProps` on a component entry means no split — that file *is* the whole answer.
|
|
78
|
-
|
|
79
|
-
A split is not a dead end: the parent is a real file, `readWith` names it, and from 1.469.0 so does the stub inside the file (`Full shape: types/Filter.d.ts`). **Read that one file — one hop, not N.** The rest of `readWith` is types referenced *inside* it, opened only if needed. Judge by the entry's own `bytes`, never `readWithBytes` — `Table`'s are 5,277 against 31,731 — since the combined figure talks you out of a read you should just do. A `…Params` type built from `Pick<>`/`Omit<>` is the same trap in another shape.
|
|
80
|
-
|
|
81
|
-
**When you do need several `readWith` files, read them in one call** — one `Read` per file in a single message. Reads measure ~21 ms each, so ten is a fifth of a second and one round trip. Deciding is what costs: decide once, then batch, and never hop one file per turn. Batching is not a licence to skip the filter, though — a few deliberate reads beat dozens of just-in-case ones.
|
|
82
|
-
|
|
83
|
-
**If the parent is large, take the declaration `tsc` uses.** `dist/types/components/CollectionTable/CollectionTable.d.ts` is 5,919 B against the bundle's 20,802 B, carries JSDoc, and states `columns: TableColumn<T>[]` (required) outright. Nothing there is stubbed, so a `grep` for a prop name is reliable. This case only.
|
|
84
|
-
|
|
85
|
-
The generated files' conventions — which one-line stubs are answers rather than truncation, how entry-point files are scoped — are in `dist/docs/Reading the Doc Indices.md`, worth reading before your first `dist/dts-bundle/*.d.ts` of the session.
|
|
86
|
-
|
|
87
|
-
### Rules for the reads themselves
|
|
47
|
+
**`Read <pkgRoot>/dist/docs/Reading the Doc Indices.md` once per session**, before your first read past the lookup output. The package keeps it in step with its own indices. It says which file answers which question, what a one-line stub in a `.d.ts` means, and how to follow a stubbed prop to the file that declares it. The rules below are about how many reads you make:
|
|
88
48
|
|
|
89
|
-
- **
|
|
90
|
-
- **
|
|
49
|
+
- **Read the one artifact your open question needs.** Check what you have already read first: a guide's prose often holds the call.
|
|
50
|
+
- **Decide once, then batch.** When you need several files, read them in one message, one `Read` per file. Never hop one file per turn. Deciding is what costs, so a few deliberate reads beat dozens of just-in-case ones.
|
|
51
|
+
- **Extract from the file the lookup named.** If an extraction is empty or ambiguous, read the whole file rather than guess.
|
|
91
52
|
- **A `@wix/design-system` name is not yours to look up here.** Use the `wix-design-system` skill; never follow a deep `@wix/design-system/dist/...` path a bundle mentions.
|
|
92
53
|
- **If a name is in neither index, stop and say so**, naming the path that dead-ended. A wrong guess compiles and breaks at runtime.
|
|
93
54
|
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
# Finding the real SDK shape behind a dashboard page
|
|
2
2
|
|
|
3
|
-
> **Scope.** [DRAFT_TEMPLATE.md](DRAFT_TEMPLATE.md) gives you the page
|
|
4
|
-
>
|
|
5
|
-
>
|
|
6
|
-
> because it is the version your code will compile against.
|
|
3
|
+
> **Scope.** [DRAFT_TEMPLATE.md](DRAFT_TEMPLATE.md) gives you the page; this file finds the method
|
|
4
|
+
> and *field names* for its data. Read it before Step 3's MCP discovery. The installed package is
|
|
5
|
+
> the version your code compiles against.
|
|
7
6
|
|
|
8
7
|
## Where the types actually live
|
|
9
8
|
|
|
@@ -47,7 +46,14 @@ of them avoids an N+1 across the visible page.
|
|
|
47
46
|
## Confirming a field — the part that ships bugs
|
|
48
47
|
|
|
49
48
|
Once you have the entity, read the declaration for **every field you map into a column**, not just
|
|
50
|
-
the uncertain ones
|
|
49
|
+
the uncertain ones, **in one pass**. List the types and fields first, then print them with one call
|
|
50
|
+
per file. A grep per question is a round trip each:
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
awk '/^(interface|type) (Payment|RegularPaymentDetails)[ <{=]/,/^}/' $E/index.typings.d.mts
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Failure modes that recur:
|
|
51
57
|
|
|
52
58
|
**Deprecated fields still compile.** On `RegularPaymentDetails`, `paymentMethod` carries
|
|
53
59
|
`@deprecated Use paymentMethodName.buyerLanguageName instead` — the deprecated one is a bare code,
|
|
@@ -93,15 +99,13 @@ a batch endpoint given `[]` is a wasted round trip at best.
|
|
|
93
99
|
`searchOrders` takes a `CursorSearch`: `{ cursorPaging, filter, sort }`, where `filter` is a
|
|
94
100
|
Mongo-shaped `Record<string, any>` — `{ paymentStatus: { $in: [...] } }`,
|
|
95
101
|
`{ _createdDate: { $gte, $lte } }`, `{ number: { $startsWith } }`. Enum values come from the
|
|
96
|
-
declaration, not from memory: order payment status
|
|
97
|
-
`
|
|
98
|
-
`UNSPECIFIED`.
|
|
102
|
+
declaration, not from memory: order payment status has ten, `PENDING_MERCHANT` and
|
|
103
|
+
`PARTIALLY_REFUNDED` among them.
|
|
99
104
|
|
|
100
105
|
## The SDK is not the REST API
|
|
101
106
|
|
|
102
107
|
Docs search returns REST pages, and a dashboard page calls the **SDK**. Append `?apiView=SDK` to the
|
|
103
|
-
URL of whatever page you landed on and read that view — it answers two of the four differences
|
|
104
|
-
before you write a line.
|
|
108
|
+
URL of whatever page you landed on and read that view — it answers two of the four differences.
|
|
105
109
|
|
|
106
110
|
**1 and 2 — namespace and id naming. The SDK view states both.** It prints the package and namespace
|
|
107
111
|
outright (`SDK Package: @wix/members`, `SDK Namespace: customFields`), and uses `_id` in its own
|
|
@@ -6,17 +6,14 @@ Go through [WIX_PATTERNS_DOCS.md § Prerequisites](../WIX_PATTERNS_DOCS.md#prere
|
|
|
6
6
|
|
|
7
7
|
## 1. Find the templates
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
One call lists every page template with its files, plus the guide that chooses between them:
|
|
10
10
|
|
|
11
11
|
```bash
|
|
12
|
-
|
|
13
|
-
import json; i = json.load(open('<pkgRoot>/dist/docs/index.json'))
|
|
14
|
-
for k, e in i.items():
|
|
15
|
-
if e.get('category') == 'Templates' or e.get('relatedTemplates'):
|
|
16
|
-
print(k, '|', e.get('templateFiles') or e.get('relatedTemplates'), '|', e.get('summary', '')[:200])
|
|
17
|
-
"
|
|
12
|
+
node <pkgRoot>/bin/patterns-lookup.cjs --templates
|
|
18
13
|
```
|
|
19
14
|
|
|
15
|
+
It also takes names (`--templates Table useTableCollection …`), so the patterns names you already know you'll need can go in the same call ([WIX_PATTERNS_DOCS.md § 1](../WIX_PATTERNS_DOCS.md#1--the-index)). If the script is missing (an older `@wix/patterns`), list those entries from `<pkgRoot>/dist/docs/index.json` in one probe.
|
|
16
|
+
|
|
20
17
|
**No `Templates` entries means the install predates them — upgrade `@wix/patterns`.** Do not rebuild a page from memory or from an older copy of this skill instead: the templates exist so the shell, provider nesting and router wiring come from the package.
|
|
21
18
|
|
|
22
19
|
## 2. Choose, then read the chosen template's page
|
|
@@ -48,7 +45,7 @@ wix generate --params '{"extensionType":"DASHBOARD_PAGE","title":"<title>","rout
|
|
|
48
45
|
|
|
49
46
|
`route` takes no leading slash — `support-tickets`, not `/support-tickets`. See [Dashboard Page → Scaffold](../DASHBOARD_PAGE.md#scaffold).
|
|
50
47
|
|
|
51
|
-
Then copy **every** file
|
|
48
|
+
Then copy **every** file `--templates` lists for it into the generated folder (`src/extensions/dashboard/pages/<feature>/`). They import one another by relative path, so keep their names relative to each other; one file on its own does not compile.
|
|
52
49
|
|
|
53
50
|
- The template's `page.tsx` is the entry file, and the CLI generated none by that name: put its contents into the component file the builder's `component` path points at (e.g. `employee-shifts.tsx`), and add no separate `page.tsx`, which nothing loads. Leave the builder file and the `src/extensions.ts` registration as the CLI wrote them.
|
|
54
51
|
- Rename `Items` / `Item` to your feature and entity, in file names and identifiers alike.
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
## Why guessing here always fails
|
|
9
9
|
|
|
10
10
|
`useTableCollection()` returns a `TableState`. For the members themselves, read the declaration the
|
|
11
|
-
index names
|
|
11
|
+
index names: `patterns-lookup.cjs TableState`, alongside the other names you need, then the file it prints. Reading them is not the
|
|
12
12
|
hard part; the hard part is that several plausible members don't exist at all, and one that does
|
|
13
13
|
means something other than its name suggests (see
|
|
14
14
|
[Four that bite in practice](#four-that-bite-in-practice)).
|
|
@@ -24,7 +24,7 @@ That is a documentation abridgement, not the declaration your code compiles agai
|
|
|
24
24
|
`dist/types/index.d.ts`, which re-exports the **fully typed** `CollectionState` from
|
|
25
25
|
`@wix/bex-core` — no index signature. So `state.collection.…` is properly typed, a wrong member is a
|
|
26
26
|
compile error at the access, and reading `state.collection.status.status` to debug a stuck table is
|
|
27
|
-
sound. See
|
|
27
|
+
sound. See `<pkgRoot>/dist/docs/Reading the Doc Indices.md` for what a stub means.
|
|
28
28
|
|
|
29
29
|
Prefer a typed member on `TableState` itself anyway — it is the object the hook hands you, and the
|
|
30
30
|
table's own view of the collection.
|
|
@@ -129,5 +129,6 @@ cursor: response.pagingMetadata?.cursors?.next || undefined,
|
|
|
129
129
|
extend. Cursor mode also accepts a separate `fetchTotal`, since a cursor-paged response carries no
|
|
130
130
|
total; build its filter exactly as the page's or the count disagrees with the rows it counts.
|
|
131
131
|
|
|
132
|
-
Look any of these up yourself
|
|
133
|
-
|
|
132
|
+
Look any of these up yourself, all in one `patterns-lookup.cjs` call
|
|
133
|
+
([WIX_PATTERNS_DOCS.md § 1](../WIX_PATTERNS_DOCS.md#1--the-index)), and read the file it names. The
|
|
134
|
+
index is the single source of truth, and it moves between versions.
|
|
@@ -24,8 +24,9 @@ doesn't express — or once the site exists and the work turns to managing or ex
|
|
|
24
24
|
- **Shipped code is the implementation.** Every vertical ships in the repository's
|
|
25
25
|
`wix-headless-templates` skill (`skills/wix-headless-templates/<vertical>/`), not in this skill's
|
|
26
26
|
folder. `node <SKILL_ROOT>/install/templates.mjs` prints where that skill is: the sibling folder
|
|
27
|
-
`<SKILL_ROOT>/../wix-headless-templates/` when
|
|
28
|
-
|
|
27
|
+
`<SKILL_ROOT>/../wix-headless-templates/` when it was installed beside this skill (the cold start
|
|
28
|
+
installs both; a plugin may not), else a one-time fetch into `<SKILL_ROOT>/templates/` (a git
|
|
29
|
+
clone of the skill's repository, a second); every script below
|
|
29
30
|
resolves it the same way. **Every `templates/...` path in this document is relative to that
|
|
30
31
|
printed root** — there is no `templates/` folder inside this skill when the sibling exists.
|
|
31
32
|
The folder stays with the project (only the composed `project/` scaffolds are left out of its
|
|
@@ -100,11 +101,16 @@ cases of step 3, with the `next` for each) and the two identities a project has
|
|
|
100
101
|
as and whose dashboard manages the business). They are one site, except on a **migration preview**
|
|
101
102
|
(`guides/migration.md`), where the env names the site being migrated. Every script here reads that
|
|
102
103
|
context; the site a call targets is never guessed from the config alone. Then fetch the shipped
|
|
103
|
-
code once: `node <SKILL_ROOT>/install/templates.mjs`. It prints the folder;
|
|
104
|
-
|
|
104
|
+
code once: `node <SKILL_ROOT>/install/templates.mjs`. It prints the folder; the `templates/…`
|
|
105
|
+
paths below are relative to that folder, never assumed under `<SKILL_ROOT>`.
|
|
105
106
|
`node <SKILL_ROOT>/install/check.mjs` says whether the skill or its templates have a newer version
|
|
106
107
|
and prints the update commands; it changes nothing.
|
|
107
108
|
|
|
109
|
+
Throughout any run, keep the site working at every step so the user can try it as it grows. Steps
|
|
110
|
+
only the site owner can take never hold a flow back: drafted content is live, and anything that
|
|
111
|
+
takes money reaches Wix's checkout before payments are connected. The owner's steps go in the
|
|
112
|
+
closing with their links, as next steps the user can take or ask for.
|
|
113
|
+
|
|
108
114
|
Throughout any run: if the user asks to send feedback to Wix, complains or gets frustrated, or the
|
|
109
115
|
run hits friction of any kind: anything that cost more turns than it should have, whether or not
|
|
110
116
|
it ended in an error (a confusing error, a doc gap, a seed that had to be re-run, a shipped file
|
|
@@ -142,8 +148,9 @@ only after an explicit yes, never automatically. Step 5 ends with the same self-
|
|
|
142
148
|
`astro.config.mjs` `integrations: [wix(), react()]`, `adapter: wixHostingAdapter()`,
|
|
143
149
|
`output: "server"`, `security: { checkOrigin: false }`, `image.domains` with
|
|
144
150
|
`static.wixstatic.com`. An Astro project made without the CLI has none of that; add it
|
|
145
|
-
before deploying, and the site serves every route. The integration
|
|
146
|
-
|
|
151
|
+
before deploying, and the site serves every route. The integration's current major
|
|
152
|
+
(`@wix/astro` 3, as in this skill's templates) requires **Astro 7**: a project on an earlier
|
|
153
|
+
major moves to 7 first, or is connected as a React host.
|
|
147
154
|
- **React and other bundlers** release their own build as files. So routes are hash routes,
|
|
148
155
|
or one emitted HTML file per route linked by its file name — decided before the first route
|
|
149
156
|
is written; any URL handed to Wix as a return target must be one the host serves. Verify by
|
|
@@ -166,9 +173,9 @@ only after an explicit yes, never automatically. Step 5 ends with the same self-
|
|
|
166
173
|
folder's config does, the site holds the content already; the frontend reads what is there
|
|
167
174
|
(step 3's attach path), and only content the brief supplies or describes is added to it.
|
|
168
175
|
3. **Set up the project, in its folder** — one deterministic call, the same for an empty folder
|
|
169
|
-
and for a project already on disk; **the folder decides** what it does, from
|
|
176
|
+
and for a project already on disk; **the folder decides** what it does, from a few file facts:
|
|
170
177
|
`wix.config.json`, its `site.outputDirectory`, the migration variables in `.env.local`,
|
|
171
|
-
`package.json`, `index.html
|
|
178
|
+
`package.json`, `index.html` (at the root or in `public/`), `src/pages/`. `node <SKILL_ROOT>/install/context.mjs` prints the shape it reads
|
|
172
179
|
and the `next` for it. **The brief is the instruction**: what it asks to switch on is installed
|
|
173
180
|
on the site the folder names, without asking again. Ask only when acting would create a second
|
|
174
181
|
site for a folder that already has one, or when a cleanup seems needed.
|
|
@@ -188,9 +195,13 @@ only after an explicit yes, never automatically. Step 5 ends with the same self-
|
|
|
188
195
|
| a frontend, no config (a `package.json`, or `index.html` at the root: someone's Astro, Vite, Next, plain HTML) | **project** → adopt | `init` in place gives it a new, empty site, then deploys; `--stack` from step 1 is required; make the project what that stack needs on Wix hosting (step 1) before or right after | **yes**, from `--plan` |
|
|
189
196
|
| a config whose `.env.local` declares an active editor migration (`EDITOR_MIGRATION_STATUS=ACTIVE`), with or without the blank Astro starter the download carries | **migration** → migrate | the shipped code into the starter (or the composed template around a bare config), deployed with the migrated site's app as the client, the install starts; `ready_for_brand_layer` says `mode: "migrate"`, the parent as `siteId`, the child as `deploySiteId` (`guides/migration.md`) | no, ever |
|
|
190
197
|
| a config, no frontend | **config-only** → refuses | the site exists and has no frontend yet: `attach.mjs` (below) takes the site from the config, reuses its hosting, scaffolds and deploys. That config is what `init` leaves behind, and `init` always creates a site: this site was made for this run and is empty | **yes**: draft the plan as for create, then `attach.mjs --plan` |
|
|
191
|
-
| a config and a frontend (a `package.json`, or `index.html` inside the folder `site.outputDirectory` names) | **wix-project** → refuses | iterate: never scaffold, `init` or reseed. `deploy.mjs <vertical…> --stack <stack>` adds a solution (the client id comes from `.env.local`, the config as the fallback), then
|
|
198
|
+
| a config and a frontend (a `package.json`, or `index.html` inside the folder `site.outputDirectory` names) | **wix-project** → refuses | iterate: never scaffold, `init` or reseed. `deploy.mjs <vertical…> --stack <stack>` adds a solution (the client id comes from `.env.local`, the config as the fallback), then one install, `node <SKILL_ROOT>/install/install.mjs` (nothing when `node_modules` already satisfies the lock); a change is file edits; then release | no |
|
|
199
|
+
| a config, a `package.json`, `public/index.html` and no `src/pages/` (a site published through the drop flow, on its Wix Dev Machine) | **static-in-astro** → refuses | the pages stay plain files in `public/`: `deploy.mjs <vertical…> --stack static --out public` puts the REST layer in `public/js/wix/`, the pages are wired in place (reference mode), and no Astro pages are added; release with `build` then `release`, the URL stays | no |
|
|
200
|
+
| a config and the CLI's blank Astro starter with no work of its own (`wix-astro-blank`, only the blank template's packages: a Dev Machine's never-released site, a bare `wix create`) | **blank-starter** → refuses | `attach.mjs --business-name <brand> --vertical <v…> [--plan plan.json]` on the config's site: the vertical's composed template takes the starter's place (its lockfile with it), the install and the seed start detached; build the brand layer while they run | **yes**, from `--plan`: the site was made for this run and is empty, unless `read-site.mjs` shows content |
|
|
192
201
|
| a config, `index.html` at the root, no `package.json` (a site published through the drop flow and downloaded) | **published-static** | the config's site, no `init`: `site/` becomes the upload, the REST layer deploys into `site/js/wix/`; the `next` says to move the pages, styles and assets in; release keeps the URL | no |
|
|
193
202
|
|
|
203
|
+
A folder no row names is **wix-project**: the fill-only path — never scaffold, `init`, reseed or delete; deploy, edit, release. A wrong guess costs a slower run, never the user's work.
|
|
204
|
+
|
|
194
205
|
**Who decides the seed: where the site came from, never the brief's wording.** A site made
|
|
195
206
|
for this run is empty by construction, so it is always seeded — with the brief's content when
|
|
196
207
|
it supplies or describes any, otherwise with demo content the agent drafts per the vertical's
|
|
@@ -201,7 +212,8 @@ only after an explicit yes, never automatically. Step 5 ends with the same self-
|
|
|
201
212
|
id in the brief or by `--site`, a project linked to it, a migration's parent (attach reports
|
|
202
213
|
`siteOrigin: "given"`) — holds content the run did not make: seed only what the brief
|
|
203
214
|
**supplies or asks to add** (`attach.mjs --plan plan.json`, or the vertical's seed module from
|
|
204
|
-
the project root: `node <
|
|
215
|
+
the project root: `node <templates>/<vertical>/seed/seed-<vertical>.mjs plan.json`, `<templates>`
|
|
216
|
+
being the folder `install/templates.mjs` printed),
|
|
205
217
|
and never invent content for it. "A new storefront for my toy store" describes the business,
|
|
206
218
|
not content to add: nothing is seeded. Read an existing site first either way
|
|
207
219
|
(`seed/read-site.mjs`). Seeds are additive and idempotent by name; nothing on a site is ever
|
|
@@ -229,7 +241,7 @@ only after an explicit yes, never automatically. Step 5 ends with the same self-
|
|
|
229
241
|
It emits one JSON event per line and returns in **~35s**: **scaffolds** the project from the
|
|
230
242
|
vertical's composed template (`wix create` copies it: the code and its lockfile arrive with
|
|
231
243
|
the scaffold), **deploys** whatever the folder still lacks (patching `package.json` with every
|
|
232
|
-
dependency the code imports), then **starts two detached background jobs** — the dependency install (`npm ci --ignore-scripts || npm install --ignore-scripts`)
|
|
244
|
+
dependency the code imports), then **starts two detached background jobs** — the dependency install (`install/install.mjs`: nothing when `node_modules` already satisfies the lock, `npm install --ignore-scripts` over a tree that is there, else `npm ci --ignore-scripts || npm install --ignore-scripts`)
|
|
233
245
|
and the **seed** — whose logs and completion markers are in the events. The final
|
|
234
246
|
`ready_for_brand_layer` event carries the project dir, siteId, ready-made dashboard links,
|
|
235
247
|
and both markers. Relay notable events. On an `error` event, recover just that step via the
|
|
@@ -237,8 +249,8 @@ only after an explicit yes, never automatically. Step 5 ends with the same self-
|
|
|
237
249
|
|
|
238
250
|
**Recovering one step, or adding a solution later:** the pieces run on their own from the
|
|
239
251
|
project root — `node <SKILL_ROOT>/install/deploy.mjs <vertical…> --stack <stack>` (the client
|
|
240
|
-
id is read from `wix.config.json`), ONE `
|
|
241
|
-
|
|
252
|
+
id is read from `wix.config.json`), ONE `node <SKILL_ROOT>/install/install.mjs`
|
|
253
|
+
(**never a second npm install concurrently**: two npms in one
|
|
242
254
|
`node_modules` race and redo each other's work; setup already started one — wait on its
|
|
243
255
|
marker), the vertical's seed module per its `seed/SEED.md`.
|
|
244
256
|
A code change on an existing project is done when it is **released** (step 5) and the live
|
|
@@ -254,11 +266,16 @@ only after an explicit yes, never automatically. Step 5 ends with the same self-
|
|
|
254
266
|
`templates/shared/CONTENT.md` — now (not earlier — their contracts matter only from this
|
|
255
267
|
step on); the hook/DTO
|
|
256
268
|
contracts are inlined there, so don't open the shipped files themselves.
|
|
269
|
+
**A frontend that already exists gets the minimum.** When the run wires pages that were
|
|
270
|
+
there before it (a dropped mock, an adopted site, a published static site), do the least that
|
|
271
|
+
makes them work: connect each control the pages show to the shipped code, and add only what a
|
|
272
|
+
control can't work without. Anything more the vertical offers is added only when the brief
|
|
273
|
+
asks for it; name it in the closing message.
|
|
257
274
|
If the brief needs a core operation that shipped code does not cover, read
|
|
258
275
|
`templates/shared/CUSTOM_OPERATIONS.md` before writing it. Use one documented path and
|
|
259
276
|
implement it; do not reverse-engineer SDK internals.
|
|
260
277
|
5. **When both background jobs have completed** — the install's marker
|
|
261
|
-
(
|
|
278
|
+
(`.install-exit`, containing `0`) and the seed's (`.seed-exit`) both exist — **verify the
|
|
262
279
|
seed succeeded** (`.seed-exit` contains `0`; `seed-result.json` has the created counts for
|
|
263
280
|
your summary — if non-zero, read `seed.log` and re-run the seed module manually). Those two
|
|
264
281
|
seed files exist **only when setup started the seed** (attach runs none: only the install
|