1// Post-install deploy — run by base44.md STEP 1 with the target VERTICAL:2// node deploy.cjs <vertical> (storefront | bookings | blog | cms | portfolio | pricing-plans | events | members)3// ONE mechanism: recursively copy `app/` -> /app/src. The shared transport (app/rest/wix-client.js,4// wix-config.js) is copied always; then ONLY the chosen vertical's app/ (its UI + app/rest/ helpers).5// Deploying a single vertical is deliberate: every vertical's app/ has files at the SAME paths6// (components/…, pages/…), so copying all of them into one src/ would clobber and pile up. Two7// copies (not one) only because shared stays DRY. paths are the Base44 sandbox's /app. Re-running is8// non-destructive: it fills in only missing files, never overwriting the agent's edits (see COPY).9// No vertical arg -> deploys just the shared transport; re-run with the vertical once known.10// NOTE: .cjs on purpose — the app is an ESM package ("type":"module"); a .js here would load as ESM11// and require()/module.exports would throw.12const
34 deployed.note = 'no vertical given — deployed the shared transport only; re-run: node deploy.cjs <vertical>';
35}
36
37// Pin the skill location + project facts into AGENTS.md so later turns (after this doc leaves
38// context) still know the rules. Idempotent.
39const NOTE = `
40
41## This app — a Wix-managed headless frontend (built with the Wix skills)
42
43This project is the **frontend for a Wix-managed business** — a REST client that talks directly to a live Wix site over \`WIX_CLIENT_ID\`. The **Wix site is the source of truth** for all content and commerce; build and seed it only through the Wix connector and the skills below. **Do NOT use the Base44 commerce kit (or any Base44 solution kit).**
44
45The Wix skills live under \`.agents/skills/\` — on ANY turn, read them from that exact path (ignore stray copies like \`agent/skills/\`).
46
47- \`wix-vibe-headless\` — **how the CLIENT is built AND how the site is seeded**: your vertical's UI client + REST scaffolds are already deployed into \`src/\`; one vertical per capability under \`references/<vertical>/\` (storefront, bookings, events, blog, portfolio, restaurants, cms, pricing-plans, members), each with a \`seed/\` module that creates content over the connector.
48- \`wix-docs\` — **fallback** for **frontend code**, **backend code**, or **runtime / API management operations** alike: search + read the Wix API reference docs.
49`;
50const amd = '/app/AGENTS.md';
51const cur = existsSync(amd) ? readFileSync(amd, 'utf8') : '';