@wix/agent-skills 1.23.0 → 1.25.0
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/README.md +1 -0
- package/package.json +2 -1
- package/skills/wix-app/SKILL.md +4 -1
- package/skills/wix-app/references/BUSINESS_MANAGER_THEME.md +108 -0
- package/skills/wix-app/references/BUSINESS_MANAGER_TOKENS.md +81 -0
- package/skills/wix-app/references/DASHBOARD_MODAL.md +41 -0
- package/skills/wix-app/references/DASHBOARD_PAGE.md +2 -0
- package/skills/wix-app/references/DASHBOARD_PLUGIN.md +19 -4
- package/skills/wix-app/references/EDITOR_REACT_COMPONENT.md +64 -50
- package/skills/wix-app/references/dashboard-page/DRAFT_TEMPLATE.md +5 -4
- package/skills/wix-app/references/dashboard-page/DRAFT_TEMPLATE_ROUTER.md +8 -7
- package/skills/wix-app/references/dashboard-page/DYNAMIC_PARAMETERS.md +21 -38
- package/skills/wix-app/references/editor-react-component/ACCESSIBILITY.md +4 -3
- package/skills/wix-app/references/editor-react-component/ANIMATED-COMPONENTS.md +28 -25
- package/skills/wix-app/references/editor-react-component/BRANDED-COMPONENTS.md +8 -2
- package/skills/wix-app/references/editor-react-component/COMPONENT-CONTRACT.md +12 -14
- package/skills/wix-app/references/editor-react-component/CSS-GUIDELINES.md +4 -3
- package/skills/wix-app/references/editor-react-component/DESIGN-STATES.md +66 -9
- package/skills/wix-app/references/editor-react-component/EDITOR-EXTENSION-CONFIGURATION.md +25 -0
- package/skills/wix-app/references/editor-react-component/OVERFLOW.md +146 -0
- package/skills/wix-app/references/editor-react-component/PARTS.md +6 -0
- package/skills/wix-app/scripts/scan-a11y-eslint.cjs +25 -1
- package/skills/wix-headless/SKILL.md +0 -1
- package/skills/wix-headless/references/CAPABILITIES.md +3 -3
- package/skills/wix-headless/references/DISCOVERY.md +1 -1
- package/skills/wix-headless/references/SDK_HANDOFF.md +1 -1
- package/skills/wix-headless/references/SEED.md +1 -1
- package/skills/wix-headless/references/SETUP.md +1 -1
- package/skills/wix-headless/references/inline-recipes/how-to-code-restaurant-reservations.md +1 -1
- package/skills/wix-headless/references/inline-recipes/setup-restaurant-experiences.md +2 -2
- package/skills/wix-headless/references/managed/AUTHENTICATION.md +3 -14
- package/skills/wix-headless/scripts/bootstrap.mjs +156 -0
- package/skills/{wix-headless-fast → wix-headless-kit}/SKILL.md +83 -64
- package/skills/{wix-headless-fast → wix-headless-kit}/cold-start/bootstrap.mjs +2 -2
- package/skills/{wix-headless-fast → wix-headless-kit}/cold-start/cold-start.md +26 -35
- package/skills/wix-headless-kit/guides/capabilities.md +76 -0
- package/skills/wix-headless-kit/guides/feedback.md +98 -0
- package/skills/{wix-headless-fast → wix-headless-kit}/guides/migration.md +20 -9
- package/skills/{wix-headless-fast → wix-headless-kit}/install/AGENTS.md +5 -2
- package/skills/{wix-headless-fast → wix-headless-kit}/install/attach.mjs +5 -2
- package/skills/wix-headless-kit/install/bootstrap.mjs +156 -0
- package/skills/{wix-headless-fast → wix-headless-kit}/install/check.mjs +2 -2
- package/skills/wix-headless-kit/install/context.mjs +169 -0
- package/skills/{wix-headless-fast → wix-headless-kit}/install/deploy.mjs +17 -4
- package/skills/{wix-headless-fast → wix-headless-kit}/install/setup.mjs +89 -55
- package/skills/{wix-headless-fast → wix-headless-kit}/install/templates.mjs +1 -1
- package/skills/wix-manage/SKILL.md +2 -8
- package/skills/wix-manage/references/cms/cms-dashboard-navigation.md +2 -2
- package/skills/wix-manage/references/cms/cms-data-items-crud.md +263 -31
- package/skills/wix-manage/references/cms/cms-publishing-flow.md +15 -15
- package/skills/wix-manage/references/cms/cms-schema-management.md +58 -7
- package/skills/wix-manage/references/sites/query-sites.md +1 -8
- package/skills/wix-auth/SKILL.md +0 -12
- package/skills/wix-auth/references/device-flow.md +0 -140
- package/skills/wix-headless-fast/install/context.mjs +0 -126
- package/skills/wix-manage/references/cms/cms-data-operations-extended.md +0 -263
- package/skills/wix-manage/references/cms/cms-references-and-relationships.md +0 -162
- /package/skills/{wix-headless-fast → wix-headless-kit}/guides/existing-site.md +0 -0
- /package/skills/{wix-headless-fast → wix-headless-kit}/guides/reference-mode.md +0 -0
- /package/skills/{wix-headless-fast → wix-headless-kit}/install/agents-md.mjs +0 -0
- /package/skills/{wix-headless-fast → wix-headless-kit}/install/lock.mjs +0 -0
|
@@ -1,27 +1,30 @@
|
|
|
1
1
|
// Set up the project in the current folder — one deterministic call from "the folder and the
|
|
2
|
-
// brief" to "brand layer can start"
|
|
2
|
+
// brief" to "brand layer can start". The folder decides (install/context.mjs folderShape, five file
|
|
3
|
+
// facts: wix.config.json, its site.outputDirectory, the migration variables in .env.local,
|
|
4
|
+
// package.json, index.html):
|
|
3
5
|
//
|
|
4
|
-
// node <SKILL_ROOT>/install/setup.mjs --vertical <storefront|bookings|…> \
|
|
6
|
+
// node <SKILL_ROOT>/install/setup.mjs --vertical <storefront|bookings|…>[,<vertical>…] \
|
|
5
7
|
// [--plan plan.json] [--business-name "<Brand>"] [--stack astro|react|lib|static] \
|
|
6
8
|
// [--subfolder [--folder-name <npm-safe-name>]]
|
|
7
9
|
//
|
|
8
|
-
//
|
|
9
|
-
//
|
|
10
|
-
//
|
|
11
|
-
//
|
|
12
|
-
//
|
|
13
|
-
// the
|
|
14
|
-
//
|
|
15
|
-
//
|
|
16
|
-
//
|
|
17
|
-
//
|
|
18
|
-
//
|
|
19
|
-
//
|
|
10
|
+
// empty (or loose files: a CSV, a brief) → CREATE: `wix create` with the vertical's composed template
|
|
11
|
+
// (templates/<vertical>/project), placed in the current directory (`--business-name` required).
|
|
12
|
+
// a frontend, no wix.config.json (a package.json, or an index.html at the root) → ADOPT: `init` in
|
|
13
|
+
// place gives the project a new, empty site, then deploy. `--stack` required.
|
|
14
|
+
// CREATE and ADOPT are the two cases that seed: the run made the site, it is empty by construction,
|
|
15
|
+
// and the plan's content goes in (with --plan; without one the agent drafts a plan and seeds it, SKILL.md step 2).
|
|
16
|
+
// a config and no frontend, .env.local declaring a MIGRATION PREVIEW → MIGRATE: the composed template
|
|
17
|
+
// is copied in around the config, the code deploys with the parent's app as its client, the install
|
|
18
|
+
// starts. Nothing seeded: the parent owns its content.
|
|
19
|
+
// a config, index.html at the root, no package.json → PUBLISHED STATIC (a site published through the
|
|
20
|
+
// drop flow and downloaded): the config's site, no init; site/ becomes the upload, the REST layer
|
|
21
|
+
// deploys there, the pages move in (the agent's step). Nothing seeded.
|
|
22
|
+
// a config and a frontend (package.json, or index.html in the output folder) → refuses: iterate.
|
|
23
|
+
// a config and nothing else → refuses: attach.mjs's case.
|
|
20
24
|
//
|
|
21
|
-
//
|
|
22
|
-
//
|
|
23
|
-
//
|
|
24
|
-
// seed runs only when `--plan` is given: a brief that has not supplied any content gets no seed.
|
|
25
|
+
// Setup seeds only a site it created in this run. A site that existed before the run is never seeded
|
|
26
|
+
// by setup: the agent reads what the site holds (the vertical's read-site.mjs) and runs the seed module
|
|
27
|
+
// deliberately when the brief supplies or describes content. Seeds are additive and idempotent by name.
|
|
25
28
|
//
|
|
26
29
|
// Composes pieces that also remain individually runnable (deploy.mjs, the vertical's seed module)
|
|
27
30
|
// to recover one failed step. Emits ONE JSON event per line and exits in ~35s with the two long
|
|
@@ -33,7 +36,7 @@ import { basename, dirname, join, resolve } from "node:path";
|
|
|
33
36
|
import { fileURLToPath } from "node:url";
|
|
34
37
|
import { AGENT_CONFIG_FILES, writeAgentsMd } from "./agents-md.mjs";
|
|
35
38
|
import { listVerticals, templatesDir } from "./templates.mjs";
|
|
36
|
-
import { siteContext } from "./context.mjs";
|
|
39
|
+
import { folderShape, siteContext } from "./context.mjs";
|
|
37
40
|
|
|
38
41
|
const SKILL_ROOT = resolve(dirname(fileURLToPath(import.meta.url)), "..");
|
|
39
42
|
|
|
@@ -51,7 +54,12 @@ const flag = (name) => {
|
|
|
51
54
|
};
|
|
52
55
|
const businessName = flag("business-name");
|
|
53
56
|
const planPath = flag("plan");
|
|
54
|
-
|
|
57
|
+
// Every vertical the brief needs, comma-separated. The first one's composed template scaffolds the
|
|
58
|
+
// project and its seed runs from --plan; the others deploy in the same call so the ONE install covers
|
|
59
|
+
// them (adding a vertical after the install has started costs a second install). Their seeds run
|
|
60
|
+
// afterwards, each with its own plan, when the brief gives them content.
|
|
61
|
+
const verticals = (flag("vertical") ?? "").split(",").map((v) => v.trim()).filter(Boolean);
|
|
62
|
+
const vertical = verticals[0] ?? null;
|
|
55
63
|
const stackFlag = flag("stack");
|
|
56
64
|
// Opt-in: keep a CREATE's project in a subfolder instead of the current directory.
|
|
57
65
|
const subfolder = argv.includes("--subfolder");
|
|
@@ -59,11 +67,11 @@ const subfolder = argv.includes("--subfolder");
|
|
|
59
67
|
let TEMPLATES;
|
|
60
68
|
try { TEMPLATES = templatesDir(); } catch (e) { fail("templates", e.message); }
|
|
61
69
|
const knownVerticals = listVerticals(TEMPLATES);
|
|
62
|
-
const usage = `usage: setup.mjs --vertical <${knownVerticals.join("|")}> [--plan plan.json] [--business-name "<Brand>"] [--stack astro|react|lib|static] [--subfolder]`;
|
|
70
|
+
const usage = `usage: setup.mjs --vertical <${knownVerticals.join("|")}>[,<vertical>…] [--plan plan.json] [--business-name "<Brand>"] [--stack astro|react|lib|static] [--subfolder]`;
|
|
63
71
|
// --vertical is REQUIRED: a defaulted vertical deploys the wrong code and runs the wrong seed.
|
|
64
72
|
if (!vertical) fail("args", usage);
|
|
65
|
-
|
|
66
|
-
fail("args", `unknown vertical "${
|
|
73
|
+
for (const v of verticals) {
|
|
74
|
+
if (!knownVerticals.includes(v)) fail("args", `unknown vertical "${v}" — shipped verticals: ${knownVerticals.join(", ")}`);
|
|
67
75
|
}
|
|
68
76
|
if (stackFlag && !["astro", "react", "lib", "static"].includes(stackFlag)) {
|
|
69
77
|
fail("args", `unknown --stack "${stackFlag}" — astro, react, lib or static`);
|
|
@@ -74,22 +82,27 @@ if (planPath && !existsSync(planPath)) fail("args", `plan file not found: ${plan
|
|
|
74
82
|
const cwd = process.cwd();
|
|
75
83
|
const has = (p) => existsSync(join(cwd, p));
|
|
76
84
|
const pkg = has("package.json") ? JSON.parse(readFileSync(join(cwd, "package.json"), "utf8")) : null;
|
|
77
|
-
const hasProject = !!pkg || has("index.html");
|
|
78
|
-
// A config here: refuse, unless it is a migration preview with no project yet (the site context
|
|
79
|
-
// pulls .env.local when missing — that is where the migration is declared).
|
|
80
85
|
let ctx = null;
|
|
86
|
+
let shape = folderShape(cwd).shape;
|
|
81
87
|
if (has("wix.config.json")) {
|
|
82
|
-
ctx = siteContext({ cwd });
|
|
83
|
-
|
|
84
|
-
|
|
88
|
+
ctx = siteContext({ cwd }); // pulls .env.local when missing — where a migration is declared
|
|
89
|
+
shape = ctx.folder.shape;
|
|
90
|
+
if (shape !== "migration" && shape !== "published-static") {
|
|
91
|
+
fail("place", `this folder is already a Wix project (wix.config.json), shape "${shape}": nothing to set up. ${ctx.folder.next} (SKILL.md step 3)` + (ctx.pullError ? ` — note: env pull failed here (${ctx.pullError.slice(0, 120)})` : ""));
|
|
92
|
+
}
|
|
93
|
+
if (shape === "published-static" && stackFlag && stackFlag !== "static") {
|
|
94
|
+
fail("args", `a published static site (index.html beside wix.config.json, no package.json) is the static stack; --stack ${stackFlag} does not apply`);
|
|
85
95
|
}
|
|
86
96
|
}
|
|
87
|
-
const mode =
|
|
88
|
-
|
|
89
|
-
|
|
97
|
+
const mode = { migration: "migrate", "published-static": "published-static", project: "adopt", empty: "create" }[shape];
|
|
98
|
+
const migrating = mode === "migrate";
|
|
99
|
+
const publishedStatic = mode === "published-static";
|
|
100
|
+
const hasProject = shape === "project";
|
|
101
|
+
if (mode === "adopt" && !stackFlag) {
|
|
102
|
+
fail("args", "adopting a project on disk needs --stack astro|react|lib|static — the stack you resolved in SKILL.md step 1 for this project");
|
|
90
103
|
}
|
|
91
|
-
const stack = stackFlag ?? "astro";
|
|
92
|
-
emit("folder", { mode, stack, project: hasProject ? (pkg?.name ?? basename(cwd)) : null, ...(ctx ? {
|
|
104
|
+
const stack = publishedStatic ? "static" : (stackFlag ?? "astro");
|
|
105
|
+
emit("folder", { mode, shape, stack, project: hasProject ? (pkg?.name ?? basename(cwd)) : null, ...(ctx ? { deploySiteId: ctx.deploy.siteId, warnings: ctx.warnings } : {}), ...(migrating ? { migration: ctx.migration } : {}) });
|
|
93
106
|
|
|
94
107
|
let projectDir = cwd;
|
|
95
108
|
let folderName = null;
|
|
@@ -134,11 +147,13 @@ if (mode === "create") {
|
|
|
134
147
|
} else if (mode === "migrate") {
|
|
135
148
|
// ---- 1 · a migration preview: the config and credentials came with the folder -------------------
|
|
136
149
|
// No site is created and nothing is provisioned: `wix.config.json` already names the deploy site
|
|
137
|
-
// and its app, `.env.local` the parent's.
|
|
138
|
-
//
|
|
139
|
-
//
|
|
140
|
-
|
|
141
|
-
if (stack === "astro") {
|
|
150
|
+
// and its app, `.env.local` the parent's. The download usually carries the CLI's blank Astro
|
|
151
|
+
// starter beside the config: then the project is kept and deploy below adds the vertical's code and
|
|
152
|
+
// dependencies into it, as for an adopted project. A bare config (no package.json) gets the
|
|
153
|
+
// vertical's composed template copied in around it on managed Astro; any other stack is code-only.
|
|
154
|
+
if (stack === "astro" && has("package.json")) {
|
|
155
|
+
emit("migration_project_kept", { folder: cwd, project: pkg?.name ?? basename(cwd) });
|
|
156
|
+
} else if (stack === "astro") {
|
|
142
157
|
const template = join(templatesDir({ need: `${vertical}/project` }), vertical, "project");
|
|
143
158
|
emit("scaffolding", { folder: cwd, template, from: "migration preview" });
|
|
144
159
|
cpSync(template, cwd, { recursive: true, force: false, errorOnExist: false });
|
|
@@ -150,12 +165,18 @@ if (mode === "create") {
|
|
|
150
165
|
const gi = join(cwd, ".gitignore");
|
|
151
166
|
const cur = existsSync(gi) ? readFileSync(gi, "utf8") : "";
|
|
152
167
|
if (!/\.env/.test(cur)) writeFileSync(gi, cur + "\n# local env (pulled from Wix)\n.env.local\n.env\n");
|
|
168
|
+
} else if (publishedStatic) {
|
|
169
|
+
// ---- 1 · a published static site: the config came with the folder, the site exists -------------
|
|
170
|
+
// No init: `wix.config.json` already names the site the pages are published on (and its app). The
|
|
171
|
+
// pages stay where they are; the static handling below points the upload at site/ and the `next`
|
|
172
|
+
// says to move them in.
|
|
173
|
+
emit("preparing", { folder: cwd, siteId: ctx.deploy.siteId, from: "published static site" });
|
|
153
174
|
} else {
|
|
154
175
|
// ---- 1 · init in place --------------------------------------------------------------------------
|
|
155
176
|
// The CLI's `init` links the folder to a NEW site: creates the site and its OAuth app, writes
|
|
156
177
|
// wix.config.json and .env.local, touches nothing else. Non-interactive under CI=1; the site is
|
|
157
178
|
// named after the folder (rename it in the dashboard).
|
|
158
|
-
emit("
|
|
179
|
+
emit("adopting", { folder: cwd });
|
|
159
180
|
const init = spawnSync("npm", ["create", "@wix/new@latest", "--", "init"],
|
|
160
181
|
{ cwd, env: { ...process.env, CI: "1" }, encoding: "utf8", timeout: 300_000 });
|
|
161
182
|
if (init.status !== 0 || !has("wix.config.json")) {
|
|
@@ -172,17 +193,17 @@ if (stack === "static") {
|
|
|
172
193
|
wixConfig.site = { ...(wixConfig.site ?? {}), outputDirectory: `./${STATIC_OUT}` };
|
|
173
194
|
writeFileSync(join(projectDir, "wix.config.json"), JSON.stringify(wixConfig, null, 2) + "\n");
|
|
174
195
|
}
|
|
175
|
-
emit(
|
|
196
|
+
emit({ create: "scaffolded", migrate: "migration_preview", adopt: "adopted", "published-static": "prepared" }[mode], {
|
|
176
197
|
folder: folderName ?? cwd, stack,
|
|
177
|
-
...(
|
|
198
|
+
...(migrating ? { deploySiteId: ctx.deploy.siteId, contentSiteId: ctx.content.siteId } : { siteId }),
|
|
178
199
|
});
|
|
179
200
|
|
|
180
201
|
// ---- 2 · deploy shipped code + deps ---------------------------------------------------------------
|
|
181
202
|
// A CREATE from the composed template already holds the code and the lock: deploy adds nothing and
|
|
182
|
-
// reports the project;
|
|
203
|
+
// reports the project; an ADOPT gets the code and its dependencies here.
|
|
183
204
|
const deploy = spawnSync(
|
|
184
205
|
"node",
|
|
185
|
-
[join(SKILL_ROOT, "install", "deploy.mjs"),
|
|
206
|
+
[join(SKILL_ROOT, "install", "deploy.mjs"), ...verticals, "--stack", stack, ...(stack === "static" ? ["--out", STATIC_OUT] : []), ...(planPath ? ["--plan", resolve(planPath)] : [])],
|
|
186
207
|
{ cwd: projectDir, encoding: "utf8", timeout: 60_000 },
|
|
187
208
|
);
|
|
188
209
|
if (deploy.status !== 0) fail("deploy", deploy.stderr || deploy.stdout);
|
|
@@ -223,7 +244,7 @@ if (mode === "create" && !subfolder && projectDir !== cwd) {
|
|
|
223
244
|
// ---- 2d · the agent config files `wix create` would have written --------------------------------
|
|
224
245
|
// Skipped by the CLI because of --skip-install. Fill-only: a project that has its own AGENTS.md
|
|
225
246
|
// keeps it (the event says `kept`).
|
|
226
|
-
emit("agent_configs", writeAgentsMd(projectDir, { skill: basename(SKILL_ROOT), stack, ...(
|
|
247
|
+
emit("agent_configs", writeAgentsMd(projectDir, { skill: basename(SKILL_ROOT), stack, ...(migrating ? { migration: { parentSiteId: ctx.migration.parentSiteId, deploySiteId: ctx.deploy.siteId } } : {}) }));
|
|
227
248
|
|
|
228
249
|
// ---- 3 · start the dependency install, detached --------------------------------------------------
|
|
229
250
|
// ONE install, here, for any project with a package.json (deploy patched it). The static stack has
|
|
@@ -243,13 +264,19 @@ if (stack !== "static" && existsSync(join(projectDir, "package.json"))) {
|
|
|
243
264
|
emit("install_started", install);
|
|
244
265
|
}
|
|
245
266
|
|
|
246
|
-
// ---- 4 · start the seed, detached (
|
|
267
|
+
// ---- 4 · start the seed, detached (a site this run created, with a plan) ---------------------------
|
|
247
268
|
// The seed includes a Wix-side provisioning wait of unpredictable length (10-80s); running it in
|
|
248
269
|
// the caller's foreground would idle the agent for exactly that long. Detach it like the install:
|
|
249
|
-
// result JSON + exit-code marker land as files the caller syncs on before release.
|
|
250
|
-
//
|
|
270
|
+
// result JSON + exit-code marker land as files the caller syncs on before release. Only a site this
|
|
271
|
+
// run created is seeded here; every other site existed before the run and is read first, then the
|
|
272
|
+
// agent runs the seed module itself when the brief supplies content. Seeds are additive and
|
|
273
|
+
// idempotent by name.
|
|
274
|
+
const madeTheSite = mode === "create" || mode === "adopt";
|
|
251
275
|
let seed = null;
|
|
252
|
-
if (planPath &&
|
|
276
|
+
if (planPath && !madeTheSite) {
|
|
277
|
+
emit("seed_skipped", { reason: `${mode}: the site existed before this run; setup seeds only a site it created. Read what the site holds (templates/${vertical}/seed/read-site.mjs), then run templates/${vertical}/seed/seed-*.mjs ${planPath} yourself when the brief supplies or describes content` });
|
|
278
|
+
}
|
|
279
|
+
if (planPath && madeTheSite) {
|
|
253
280
|
const seedDir = join(TEMPLATES, vertical, "seed");
|
|
254
281
|
const seedName = existsSync(seedDir)
|
|
255
282
|
? readdirSync(seedDir).find((f) => f.startsWith("seed-") && f.endsWith(".mjs"))
|
|
@@ -264,7 +291,7 @@ if (planPath && mode !== "migrate") {
|
|
|
264
291
|
);
|
|
265
292
|
seedChild.unref();
|
|
266
293
|
seed = { resultFile: "seed-result.json", log: "seed.log", doneMarker: ".seed-exit", success: "file contains 0" };
|
|
267
|
-
emit("seeding_started", { vertical, ...seed });
|
|
294
|
+
emit("seeding_started", { vertical, ...seed, ...(verticals.length > 1 ? { note: `the plan seeds ${vertical}; the other verticals' seeds run afterwards, each with its own plan` } : {}) });
|
|
268
295
|
}
|
|
269
296
|
|
|
270
297
|
// ---- done ----------------------------------------------------------------------------------------
|
|
@@ -276,23 +303,30 @@ const release = {
|
|
|
276
303
|
}[stack];
|
|
277
304
|
// On a migration preview the links and `siteId` are the PARENT's — the site whose content the pages
|
|
278
305
|
// show and whose dashboard manages it; `deploySiteId` is where `wix release` goes.
|
|
306
|
+
const others = verticals.slice(1);
|
|
279
307
|
emit("ready_for_brand_layer", {
|
|
280
308
|
mode,
|
|
309
|
+
shape,
|
|
281
310
|
stack,
|
|
311
|
+
verticals,
|
|
282
312
|
projectDir,
|
|
283
|
-
siteId:
|
|
284
|
-
...(
|
|
313
|
+
siteId: migrating ? ctx.content.siteId : siteId,
|
|
314
|
+
...(migrating ? { deploySiteId: ctx.deploy.siteId, migration: { parentSiteId: ctx.migration.parentSiteId } } : {}),
|
|
285
315
|
dashboardUrl: deployResult.dashboardUrl,
|
|
286
316
|
productsUrl: deployResult.productsUrl,
|
|
287
317
|
categoriesUrl: deployResult.categoriesUrl,
|
|
288
318
|
install,
|
|
289
319
|
seed,
|
|
290
320
|
next:
|
|
321
|
+
(publishedStatic ? "a published static site: its pages are live on this site already and keep their URL; move index.html, the other pages, styles and assets into site/ (the root keeps the config, the plan, the seed output and the skills) and wire the solution into the page that needs it; " : "") +
|
|
291
322
|
(mode === "migrate"
|
|
292
323
|
? "a migration preview: the site being migrated owns its content (read it with the vertical's read-site.mjs when the brief allows probing; never seed it); theme + write the home page; "
|
|
293
|
-
:
|
|
294
|
-
? "theme + write the home page; "
|
|
295
|
-
:
|
|
324
|
+
: madeTheSite
|
|
325
|
+
? (planPath ? "theme + write the home page; " : "the site is new and empty and no plan was given, so nothing was seeded yet: seed it now (a plan per step 2 — the brief's content, or one drafted per the vertical's SEED.md — then the vertical's seed module), and name the placeholder content in the closing message; theme + write the home page; ")
|
|
326
|
+
: `nothing was seeded (setup seeds only a site it created): read what the site holds with templates/${vertical}/seed/read-site.mjs, then run templates/${vertical}/seed/seed-*.mjs <plan> when the brief supplies or describes content; theme + write the home page; `) +
|
|
327
|
+
(others.length && mode !== "migrate"
|
|
328
|
+
? `${others.join(", ")} deployed too, no further install needed: run each one's seed module (templates/<vertical>/seed/) with its own plan when the brief gives it content (the members seed installs the Members Area app and needs no plan); `
|
|
329
|
+
: "") +
|
|
296
330
|
(install || seed ? "then wait for the done markers" + (seed ? ", verify .seed-exit is 0 (else read seed.log and re-run the seed module)" : "") + "; " : "") +
|
|
297
331
|
`then ${release}` +
|
|
298
332
|
(mode === "migrate" ? "; the release is the PREVIEW on the deploy site — close with its URL and the parent's dashboard, say the original site is unchanged and that completing the migration is the user's next step in the Wix CLI once they approve" : ""),
|
|
@@ -142,7 +142,7 @@ function fetchTemplates(cache) {
|
|
|
142
142
|
|
|
143
143
|
// A sparse, shallow clone of templates/ at a ref (branch, tag, or commit id) into a temp dir.
|
|
144
144
|
function cloneSparse(repo, ref) {
|
|
145
|
-
const tmp = mkdtempSync(join(tmpdir(), "wix-headless-
|
|
145
|
+
const tmp = mkdtempSync(join(tmpdir(), "wix-headless-kit-templates-"));
|
|
146
146
|
let r;
|
|
147
147
|
if (ref && /^[0-9a-f]{40}$/i.test(ref)) {
|
|
148
148
|
// a commit: shallow-fetch just it (GitHub serves any reachable commit by id)
|
|
@@ -135,19 +135,13 @@ Uses Calendar Events API to create WORKING_HOURS events on the business schedule
|
|
|
135
135
|
## CMS
|
|
136
136
|
|
|
137
137
|
### [CMS Data Items CRUD](references/cms/cms-data-items-crud.md)
|
|
138
|
-
"Add, query, update, and delete items in CMS collections
|
|
139
|
-
|
|
140
|
-
### [CMS Data Operations Extended](references/cms/cms-data-operations-extended.md)
|
|
141
|
-
Additional CMS data operations including count, upsert (bulk save), and update by filter patterns.
|
|
138
|
+
"Add, query, update, and delete items in CMS collections, one at a time or in bulk. Also covers counting items, upserting with bulk save, truncating a collection, aggregating data with a pipeline, linking items through single- and multi-reference fields, and reading items with their referenced items expanded."
|
|
142
139
|
|
|
143
140
|
### [CMS eCommerce Catalog Integration](references/cms/cms-ecommerce-catalog-integration.md)
|
|
144
141
|
The recommended way to sell existing CMS collection items (tickets, bookings, memberships) through Wix checkout. Add the CATALOG plugin to convert any CMS collection into purchasable products with cart and payment integration.
|
|
145
142
|
|
|
146
|
-
### [CMS References And Relationships](references/cms/cms-references-and-relationships.md)
|
|
147
|
-
"Add, replace, or remove items from MULTI_REFERENCE fields. Use insert-references, replace-references, remove-references endpoints. Required for managing multi-reference relationships - these CANNOT be set via regular insert/update/patch operations. Also covers single references and querying with expanded references."
|
|
148
|
-
|
|
149
143
|
### [CMS Schema Management](references/cms/cms-schema-management.md)
|
|
150
|
-
Create and modify CMS collection structures. Covers listing collections, creating collections with fields, adding/removing fields, and updating collection settings.
|
|
144
|
+
Create and modify CMS collection structures. Covers listing collections, creating collections with fields, adding/removing fields (including single- and multi-reference fields that link two collections), and updating collection settings.
|
|
151
145
|
|
|
152
146
|
### [CMS Draft & Publish Workflow (Draft Items plugin)](references/cms/cms-publishing-flow.md)
|
|
153
147
|
"Interact with CMS collections that gate their items behind a draft/publish workflow via the Draft Items plugin. Covers detecting the plugin, locating the paired drafts collection, reading published vs draft items, authoring/editing drafts, and publishing, unpublishing, reverting, and deleting items. Key endpoints: /wix-data/v2/items/publish-draft, /wix-data/v2/items/unpublish, /wix-data/v2/collections/add-draft-items-plugin, and the paired drafts collection referenced by draftItemsPluginOptions.draftsCollectionId."
|
|
@@ -28,8 +28,8 @@ Fetch the entity via REST, then link the matching dashboard page. All calls use
|
|
|
28
28
|
|
|
29
29
|
| Entity | Read API | Dashboard link |
|
|
30
30
|
|---|---|---|
|
|
31
|
-
| Collection (schema) | `GET /wix-data/v2/collections/{collectionId}` · `GET /wix-data/v2/collections` (list) | `wix-cms/data/{collectionId}` |
|
|
32
|
-
| Data item | `POST /wix-data/v2/items/query` (body includes `dataCollectionId`) · `GET /wix-data/v2/items/{itemId}?dataCollectionId=...` | `wix-cms/data/{collectionId}` (the collection's items table) |
|
|
31
|
+
| Collection (schema) | `GET https://www.wixapis.com/wix-data/v2/collections/{collectionId}` · `GET https://www.wixapis.com/wix-data/v2/collections` (list) | `wix-cms/data/{collectionId}` |
|
|
32
|
+
| Data item | `POST https://www.wixapis.com/wix-data/v2/items/query` (body includes `dataCollectionId`) · `GET https://www.wixapis.com/wix-data/v2/items/{itemId}?dataCollectionId=...` | `wix-cms/data/{collectionId}` (the collection's items table) |
|
|
33
33
|
|
|
34
34
|
Example — after creating a collection and inserting items:
|
|
35
35
|
|