@wix/agent-skills 1.20.0 → 1.20.1
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-headless-fast/SKILL.md +200 -34
- package/skills/wix-headless-fast/entry/skill.md +10 -2
- package/skills/wix-headless-fast/install/attach.mjs +253 -0
- package/skills/wix-headless-fast/install/deploy.mjs +109 -9
- package/skills/wix-headless-fast/install/fast-path.mjs +29 -34
- package/skills/wix-headless-fast/references/blog/INSTRUCTIONS.md +224 -60
- package/skills/wix-headless-fast/references/blog/app/components/blog/BlogFeedView.tsx +2 -3
- package/skills/wix-headless-fast/references/blog/app/components/blog/PostView.tsx +2 -3
- package/skills/wix-headless-fast/references/blog/app/hooks/blog/useBlogFeed.ts +24 -116
- package/skills/wix-headless-fast/references/blog/app/hooks/blog/usePost.ts +16 -64
- package/skills/wix-headless-fast/references/blog/app/wix/blog/blog-feed-store.ts +137 -0
- package/skills/wix-headless-fast/references/blog/app/wix/blog/post-store.ts +78 -0
- package/skills/wix-headless-fast/references/blog/app/wix/blog/posts-core.ts +117 -0
- package/skills/wix-headless-fast/references/blog/app/wix/blog/posts.ts +13 -60
- package/skills/wix-headless-fast/references/blog/app/wix/blog/taxonomy-core.ts +47 -0
- package/skills/wix-headless-fast/references/blog/app/wix/blog/taxonomy.ts +10 -28
- package/skills/wix-headless-fast/references/blog/app-astro/pages/blog/[...slug].astro +2 -4
- package/skills/wix-headless-fast/references/blog/rest/posts.ts +42 -0
- package/skills/wix-headless-fast/references/blog/rest/taxonomy.ts +62 -0
- package/skills/wix-headless-fast/references/blog/seed/SEED.md +9 -0
- package/skills/wix-headless-fast/references/bookings/INSTRUCTIONS.md +179 -33
- package/skills/wix-headless-fast/references/bookings/app/components/bookings/ServiceBookingView.tsx +2 -1
- package/skills/wix-headless-fast/references/bookings/app/hooks/bookings/useBookingFlow.ts +26 -132
- package/skills/wix-headless-fast/references/bookings/app/hooks/bookings/useServices.ts +18 -49
- package/skills/wix-headless-fast/references/bookings/app/wix/bookings/booking-core.ts +218 -0
- package/skills/wix-headless-fast/references/bookings/app/wix/bookings/booking-flow-store.ts +169 -0
- package/skills/wix-headless-fast/references/bookings/app/wix/bookings/booking.ts +57 -142
- package/skills/wix-headless-fast/references/bookings/app/wix/bookings/services-core.ts +92 -0
- package/skills/wix-headless-fast/references/bookings/app/wix/bookings/services-store.ts +90 -0
- package/skills/wix-headless-fast/references/bookings/app/wix/bookings/services.ts +22 -61
- package/skills/wix-headless-fast/references/bookings/app/wix/bookings/types.ts +3 -1
- package/skills/wix-headless-fast/references/bookings/rest/booking.ts +113 -0
- package/skills/wix-headless-fast/references/bookings/rest/services.ts +55 -0
- package/skills/wix-headless-fast/references/bookings/seed/SEED.md +10 -0
- package/skills/wix-headless-fast/references/cms/INSTRUCTIONS.md +236 -62
- package/skills/wix-headless-fast/references/cms/app/hooks/cms/useCollection.ts +19 -52
- package/skills/wix-headless-fast/references/cms/app/hooks/cms/useItem.ts +16 -36
- package/skills/wix-headless-fast/references/cms/app/wix/cms/collection-store.ts +158 -0
- package/skills/wix-headless-fast/references/cms/app/wix/cms/item-store.ts +93 -0
- package/skills/wix-headless-fast/references/cms/app/wix/cms/items-core.ts +177 -0
- package/skills/wix-headless-fast/references/cms/app/wix/cms/items.ts +13 -41
- package/skills/wix-headless-fast/references/cms/rest/items.ts +125 -0
- package/skills/wix-headless-fast/references/cms/seed/SEED.md +9 -0
- package/skills/wix-headless-fast/references/events/INSTRUCTIONS.md +239 -83
- package/skills/wix-headless-fast/references/events/app/components/events/EventConfirmationView.tsx +1 -1
- package/skills/wix-headless-fast/references/events/app/components/events/EventRegistrationView.tsx +7 -5
- package/skills/wix-headless-fast/references/events/app/components/events/EventsView.tsx +2 -2
- package/skills/wix-headless-fast/references/events/app/hooks/events/useEventRegistration.ts +28 -110
- package/skills/wix-headless-fast/references/events/app/hooks/events/useEvents.ts +19 -54
- package/skills/wix-headless-fast/references/events/app/wix/events/events-core.ts +130 -0
- package/skills/wix-headless-fast/references/events/app/wix/events/events-store.ts +97 -0
- package/skills/wix-headless-fast/references/events/app/wix/events/events.ts +13 -94
- package/skills/wix-headless-fast/references/events/app/wix/events/registration-core.ts +113 -0
- package/skills/wix-headless-fast/references/events/app/wix/events/registration-store.ts +156 -0
- package/skills/wix-headless-fast/references/events/app/wix/events/registration.ts +38 -69
- package/skills/wix-headless-fast/references/events/rest/events.ts +57 -0
- package/skills/wix-headless-fast/references/events/rest/registration.ts +83 -0
- package/skills/wix-headless-fast/references/events/seed/SEED.md +9 -0
- package/skills/wix-headless-fast/references/forms/INSTRUCTIONS.md +214 -26
- package/skills/wix-headless-fast/references/forms/app/hooks/forms/useWixForm.ts +35 -267
- package/skills/wix-headless-fast/references/forms/app/wix/forms/form-store.ts +332 -0
- package/skills/wix-headless-fast/references/forms/app/wix/forms/forms-core.ts +238 -0
- package/skills/wix-headless-fast/references/forms/app/wix/forms/forms.ts +28 -243
- package/skills/wix-headless-fast/references/forms/app/wix/forms/submissions-core.ts +216 -0
- package/skills/wix-headless-fast/references/forms/app/wix/forms/submissions.ts +32 -204
- package/skills/wix-headless-fast/references/forms/rest/forms.ts +34 -0
- package/skills/wix-headless-fast/references/forms/rest/submissions.ts +56 -0
- package/skills/wix-headless-fast/references/forms/seed/SEED.md +8 -0
- package/skills/wix-headless-fast/references/forms/seed/seed-forms.mjs +15 -8
- package/skills/wix-headless-fast/references/members/INSTRUCTIONS.md +314 -63
- package/skills/wix-headless-fast/references/members/app/components/members/LoginForm.tsx +1 -1
- package/skills/wix-headless-fast/references/members/app/wix/members/auth-core.ts +105 -0
- package/skills/wix-headless-fast/references/members/app/wix/members/auth.ts +36 -65
- package/skills/wix-headless-fast/references/members/app/wix/members/client.ts +1 -1
- package/skills/wix-headless-fast/references/members/app/wix/members/members-core.ts +43 -0
- package/skills/wix-headless-fast/references/members/app/wix/members/members.ts +11 -32
- package/skills/wix-headless-fast/references/members/rest/auth.ts +215 -0
- package/skills/wix-headless-fast/references/members/rest/members.ts +26 -0
- package/skills/wix-headless-fast/references/portfolio/INSTRUCTIONS.md +238 -59
- package/skills/wix-headless-fast/references/portfolio/app/components/portfolio/CollectionProjectsView.tsx +2 -2
- package/skills/wix-headless-fast/references/portfolio/app/components/portfolio/CollectionsView.tsx +2 -2
- package/skills/wix-headless-fast/references/portfolio/app/components/portfolio/GalleryMedia.tsx +35 -0
- package/skills/wix-headless-fast/references/portfolio/app/components/portfolio/ProjectDetailView.tsx +8 -38
- package/skills/wix-headless-fast/references/portfolio/app/hooks/portfolio/useCollectionProjects.ts +23 -50
- package/skills/wix-headless-fast/references/portfolio/app/hooks/portfolio/useCollections.ts +16 -34
- package/skills/wix-headless-fast/references/portfolio/app/hooks/portfolio/useProjectDetail.ts +22 -49
- package/skills/wix-headless-fast/references/portfolio/app/wix/portfolio/collection-projects-store.ts +82 -0
- package/skills/wix-headless-fast/references/portfolio/app/wix/portfolio/collections-store.ts +58 -0
- package/skills/wix-headless-fast/references/portfolio/app/wix/portfolio/portfolio-core.ts +177 -0
- package/skills/wix-headless-fast/references/portfolio/app/wix/portfolio/portfolio.ts +31 -118
- package/skills/wix-headless-fast/references/portfolio/app/wix/portfolio/project-detail-store.ts +81 -0
- package/skills/wix-headless-fast/references/portfolio/rest/portfolio.ts +75 -0
- package/skills/wix-headless-fast/references/portfolio/seed/SEED.md +8 -0
- package/skills/wix-headless-fast/references/pricing-plans/INSTRUCTIONS.md +212 -51
- package/skills/wix-headless-fast/references/pricing-plans/app/components/pricing-plans/PlanDetailView.tsx +9 -20
- package/skills/wix-headless-fast/references/pricing-plans/app/components/pricing-plans/PlansView.tsx +7 -32
- package/skills/wix-headless-fast/references/pricing-plans/app/components/pricing-plans/SubscribeButton.tsx +41 -0
- package/skills/wix-headless-fast/references/pricing-plans/app/hooks/pricing-plans/usePlanPurchase.ts +12 -33
- package/skills/wix-headless-fast/references/pricing-plans/app/hooks/pricing-plans/usePlans.ts +17 -34
- package/skills/wix-headless-fast/references/pricing-plans/app/wix/pricing-plans/plan-purchase-store.ts +54 -0
- package/skills/wix-headless-fast/references/pricing-plans/app/wix/pricing-plans/plans-core.ts +106 -0
- package/skills/wix-headless-fast/references/pricing-plans/app/wix/pricing-plans/plans-store.ts +64 -0
- package/skills/wix-headless-fast/references/pricing-plans/app/wix/pricing-plans/plans.ts +7 -55
- package/skills/wix-headless-fast/references/pricing-plans/app/wix/pricing-plans/purchase-core.ts +43 -0
- package/skills/wix-headless-fast/references/pricing-plans/app/wix/pricing-plans/purchase.ts +11 -34
- package/skills/wix-headless-fast/references/pricing-plans/rest/plans.ts +31 -0
- package/skills/wix-headless-fast/references/pricing-plans/rest/purchase.ts +20 -0
- package/skills/wix-headless-fast/references/pricing-plans/seed/SEED.md +8 -0
- package/skills/wix-headless-fast/references/restaurants/INSTRUCTIONS.md +240 -47
- package/skills/wix-headless-fast/references/restaurants/app/components/restaurants/MenuView.tsx +2 -2
- package/skills/wix-headless-fast/references/restaurants/app/components/restaurants/OrderCartDrawer.tsx +2 -2
- package/skills/wix-headless-fast/references/restaurants/app/hooks/restaurants/useMenus.ts +14 -35
- package/skills/wix-headless-fast/references/restaurants/app/hooks/restaurants/useReservation.ts +28 -171
- package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/menu-core.ts +155 -0
- package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/menu-store.ts +89 -0
- package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/menu.ts +23 -117
- package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/ordering-core.ts +124 -0
- package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/ordering.ts +45 -114
- package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/reservation-store.ts +193 -0
- package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/reservations-core.ts +94 -0
- package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/reservations.ts +15 -87
- package/skills/wix-headless-fast/references/restaurants/rest/menu.ts +60 -0
- package/skills/wix-headless-fast/references/restaurants/rest/ordering.ts +169 -0
- package/skills/wix-headless-fast/references/restaurants/rest/reservations.ts +68 -0
- package/skills/wix-headless-fast/references/restaurants/seed/SEED.md +8 -0
- package/skills/wix-headless-fast/references/shared/SUPPLIED-CONTENT.md +23 -0
- package/skills/wix-headless-fast/references/shared/app/wix/media.ts +45 -4
- package/skills/wix-headless-fast/references/shared/app/wix/sdk.ts +13 -0
- package/skills/wix-headless-fast/references/shared/rest/client.ts +155 -0
- package/skills/wix-headless-fast/references/shared/rest/config.ts +3 -0
- package/skills/wix-headless-fast/references/shared/rest/media.ts +65 -0
- package/skills/wix-headless-fast/references/storefront/INSTRUCTIONS.md +182 -63
- package/skills/wix-headless-fast/references/storefront/app/components/storefront/OptionPicker.tsx +95 -0
- package/skills/wix-headless-fast/references/storefront/app/components/storefront/QuickAdd.tsx +29 -58
- package/skills/wix-headless-fast/references/storefront/app/hooks/storefront/useProductDetail.ts +29 -163
- package/skills/wix-headless-fast/references/storefront/app/hooks/storefront/useShop.ts +26 -300
- package/skills/wix-headless-fast/references/storefront/app/wix/storefront/cart-core.ts +121 -0
- package/skills/wix-headless-fast/references/storefront/app/wix/storefront/cart.ts +49 -162
- package/skills/wix-headless-fast/references/storefront/app/wix/storefront/catalog-core.ts +309 -0
- package/skills/wix-headless-fast/references/storefront/app/wix/storefront/catalog.ts +47 -370
- package/skills/wix-headless-fast/references/storefront/app/wix/storefront/product-detail-store.ts +147 -0
- package/skills/wix-headless-fast/references/storefront/app/wix/storefront/shop-store.ts +289 -0
- package/skills/wix-headless-fast/references/storefront/rest/cart.ts +132 -0
- package/skills/wix-headless-fast/references/storefront/rest/catalog.ts +123 -0
- package/skills/wix-headless-fast/references/storefront/seed/SEED.md +25 -9
- package/skills/wix-headless-fast/references/storefront/seed/seed-store.mjs +6 -35
- package/skills/wix-manage/references/ecommerce/ecom-shipping.md +1 -1
- package/skills/wix-vibe-headless/references/storefront/INSTRUCTIONS.md +0 -40
- package/skills/wix-vibe-headless/references/storefront/seed/SEED.md +3 -0
- package/skills/wix-vibe-headless/references/storefront/seed/seed-store.cjs +6 -0
- package/skills/wix-headless-fast/install/pin-agents-md.mjs +0 -57
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Storefront seed — a BUILD-TIME script, never shipped in the app. Run it from the project
|
|
2
2
|
// root (where wix.config.json lives) with a plan file:
|
|
3
3
|
//
|
|
4
|
-
// node <SKILL_ROOT>/references/storefront/seed/seed-store.mjs plan.json
|
|
4
|
+
// node <SKILL_ROOT>/references/storefront/seed/seed-store.mjs plan.json
|
|
5
5
|
//
|
|
6
6
|
// It mints its own site token via the Wix CLI (the token never leaves this process), installs
|
|
7
7
|
// the Wix Stores app if needed, waits for the V3 catalog, bulk-creates products (variants
|
|
@@ -367,23 +367,6 @@ export async function createCategories(ctx, names) {
|
|
|
367
367
|
return out;
|
|
368
368
|
}
|
|
369
369
|
|
|
370
|
-
// The Stores install drops sample products ("I'm a product") into every new catalog. On a site the
|
|
371
|
-
// fast path JUST created nothing else can exist, so they are deleted before seeding — otherwise the
|
|
372
|
-
// storefront ships with the samples between the real products. Only called with --fresh-site; a
|
|
373
|
-
// seed against an existing site never deletes anything (SEED.md: seeding is additive).
|
|
374
|
-
// docs: https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/products-v3/bulk-delete-products.md
|
|
375
|
-
export async function deleteAllProducts(ctx) {
|
|
376
|
-
let deleted = 0;
|
|
377
|
-
for (let pass = 0; pass < 10; pass++) {
|
|
378
|
-
const r = await req(ctx, "/stores/v3/products/query", { body: { query: { cursorPaging: { limit: 100 } } } });
|
|
379
|
-
const ids = (r.products ?? []).map((p) => p.id).filter(Boolean);
|
|
380
|
-
if (!ids.length) break;
|
|
381
|
-
await req(ctx, "/stores/v3/bulk/products/delete", { body: { productIds: ids } });
|
|
382
|
-
deleted += ids.length;
|
|
383
|
-
if (ids.length < 100) break;
|
|
384
|
-
}
|
|
385
|
-
return deleted;
|
|
386
|
-
}
|
|
387
370
|
|
|
388
371
|
// docs: https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/categories/bulk-add-items-to-category.md
|
|
389
372
|
export async function addProductsToCategories(ctx, mapping) {
|
|
@@ -462,22 +445,12 @@ async function setSiteCurrency(ctx, currency) {
|
|
|
462
445
|
* threaded in memory. This is the default path — call it once instead of the individual
|
|
463
446
|
* functions.
|
|
464
447
|
*/
|
|
465
|
-
export async function setupStore(ctx, { products = [], categories = {}, currency } = {}
|
|
448
|
+
export async function setupStore(ctx, { products = [], categories = {}, currency } = {}) {
|
|
466
449
|
validateProducts(products);
|
|
467
450
|
await installStoresApp(ctx);
|
|
468
451
|
// Before any product exists: a product's price is stored in the site currency at create time,
|
|
469
452
|
// so switching afterwards leaves the catalog priced in the old one.
|
|
470
453
|
if (currency) await setSiteCurrency(ctx, currency);
|
|
471
|
-
// A just-created site holds only the install's sample products — clear them (never on an
|
|
472
|
-
// existing site: the flag is the fast path's, set only when it created the site itself).
|
|
473
|
-
let samplesDeleted = 0;
|
|
474
|
-
if (freshSite) {
|
|
475
|
-
try {
|
|
476
|
-
samplesDeleted = await deleteAllProducts(ctx);
|
|
477
|
-
} catch (e) {
|
|
478
|
-
console.error(`sample cleanup failed (seeding on top): ${String(e.message).slice(0, 120)}`);
|
|
479
|
-
}
|
|
480
|
-
}
|
|
481
454
|
|
|
482
455
|
// Idempotent by name: an errored bulk create (429/5xx) may still have applied server-side,
|
|
483
456
|
// and SKILL.md tells the agent to re-run a failed seed — creating only the names that don't
|
|
@@ -529,23 +502,21 @@ export async function setupStore(ctx, { products = [], categories = {}, currency
|
|
|
529
502
|
// failures is part of the result, not an exception: a partial seed still leaves a usable
|
|
530
503
|
// store, and the agent needs the names to report rather than silently shipping a short
|
|
531
504
|
// catalog. Re-run the seed to retry them — existing names are skipped, not duplicated.
|
|
532
|
-
return { products: withNames, categories: cats, imagesAttached,
|
|
505
|
+
return { products: withNames, categories: cats, imagesAttached, failures };
|
|
533
506
|
}
|
|
534
507
|
|
|
535
508
|
// ---- CLI entry ----------------------------------------------------------------------------------
|
|
536
509
|
|
|
537
510
|
const invokedDirectly = process.argv[1] && import.meta.url.endsWith(process.argv[1].split("/").pop());
|
|
538
511
|
if (invokedDirectly) {
|
|
539
|
-
const
|
|
540
|
-
const freshSite = args.includes("--fresh-site");
|
|
541
|
-
const planPath = args.find((a) => !a.startsWith("--"));
|
|
512
|
+
const planPath = process.argv[2];
|
|
542
513
|
if (!planPath) {
|
|
543
|
-
console.error("usage: node seed-store.mjs <plan.json>
|
|
514
|
+
console.error("usage: node seed-store.mjs <plan.json> (run from the project root)");
|
|
544
515
|
process.exit(1);
|
|
545
516
|
}
|
|
546
517
|
const plan = JSON.parse(readFileSync(planPath, "utf8"));
|
|
547
518
|
const ctx = makeCtx();
|
|
548
|
-
setupStore(ctx, plan
|
|
519
|
+
setupStore(ctx, plan)
|
|
549
520
|
.then((result) => console.log(JSON.stringify(result, null, 2)))
|
|
550
521
|
.catch((e) => {
|
|
551
522
|
console.error(e.message);
|
|
@@ -29,7 +29,7 @@ Set up and tune how a store ships — what rates to charge, which regions are co
|
|
|
29
29
|
|
|
30
30
|
> - [Set up shipping rates / rules](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/skills/shipping-set-up-rates) — tags: `[intent:setup-rates]` · priority 0
|
|
31
31
|
> - [Set up delivery regions / coverage](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/skills/shipping-set-up-regions) — tags: `[intent:setup-regions]` · priority 0
|
|
32
|
-
> - [Set up store pickup / local delivery](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/skills/local-delivery) — tags: `[intent:setup-pickup]` · priority 0
|
|
32
|
+
> - [Set up store pickup / local delivery](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/skills/shipping-set-up-pickup-local-delivery) — tags: `[intent:setup-pickup]` · priority 0
|
|
33
33
|
> - [Add free shipping over $X](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/skills/shipping-add-free-shipping) — tags: `[intent:free-shipping]` · priority 0
|
|
34
34
|
|
|
35
35
|
### Optimize & fix
|
|
@@ -235,24 +235,6 @@ export default function ProductDetail() {
|
|
|
235
235
|
- Render the PDP gallery from `images` — every image reachable (thumbnails, arrows, or a swipeable rail), not just the first; a single-image product gets no empty strip.
|
|
236
236
|
- `submit()` resets `adding` after completion and preserves the cart result: `undefined` on success, `null` on failure. Add failures live in `useCart().error`, not the PDP load `error`; the shipped drawer opens to display them.
|
|
237
237
|
|
|
238
|
-
For an optional **add and check out** shortcut, check the add result before checkout:
|
|
239
|
-
```jsx
|
|
240
|
-
// Inside ProductDetail, with the other hooks above any conditional returns:
|
|
241
|
-
const { checkout, loading: cartLoading } = useCart(); // named import from @/context/CartContext
|
|
242
|
-
async function addAndCheckout() {
|
|
243
|
-
if (!d.product || !d.canAdd || d.adding || cartLoading) return;
|
|
244
|
-
const result = await d.submit();
|
|
245
|
-
if (result === null) return; // add failed; preserve its error and do not check out the old cart
|
|
246
|
-
await checkout();
|
|
247
|
-
}
|
|
248
|
-
// <button disabled={!d.canAdd || d.adding || cartLoading} onClick={addAndCheckout}>Add and check out</button>
|
|
249
|
-
```
|
|
250
|
-
This adds to the shopper's **current cart** and checks that cart out — so label it that way. A true
|
|
251
|
-
**Buy Now** (skip the cart, buy just this item) needs a standalone cart handed to the redirect session;
|
|
252
|
-
it is not shipped, and routing "Buy now" through the current cart is wrong (it would carry whatever the
|
|
253
|
-
cart already holds). For direct `addToCart(...)` calls, use the same `result === null` check before checkout.
|
|
254
|
-
A resolved promise alone does not mean success; a truthiness check also rejects successful `undefined`.
|
|
255
|
-
|
|
256
238
|
### Variant and modifier controls
|
|
257
239
|
The product-detail example above provides both groups:
|
|
258
240
|
```js
|
|
@@ -475,28 +457,6 @@ Path params are `$name` in both the filename and the route path; `useParams()` f
|
|
|
475
457
|
reads them unchanged. Full pattern, including `ssr: false` for per-user routes:
|
|
476
458
|
[`../_shared/routing.md`](../_shared/routing.md).
|
|
477
459
|
|
|
478
|
-
## What a complete storefront shows
|
|
479
|
-
|
|
480
|
-
The wiring above is necessary, not sufficient. These are defaults for when the brief doesn't say
|
|
481
|
-
otherwise — whatever the user asked for in their prompt wins over any line here. Look at the
|
|
482
|
-
catalog before designing — categories, assortment size, media, options, sales — and design for this
|
|
483
|
-
store, not for a stereotype of its category. Then:
|
|
484
|
-
|
|
485
|
-
- **Home:** what the store sells and one shopping action in the first screen; real products from
|
|
486
|
-
the catalog under truthful headings; not a repeat of the shop page.
|
|
487
|
-
- **Shop:** a real product card — image, name, price, link — in the first screen; sort and the
|
|
488
|
-
filters the catalog supports; loading, empty, no-results, and error states that look different.
|
|
489
|
-
- **Product page:** image, name, price, the first choice, and the buy button with `blockedReason`
|
|
490
|
-
in the first screen; every ribbon; every image reachable in the gallery.
|
|
491
|
-
- **Cart:** the shipped drawer — it opens after every add, and checkout is a button in it.
|
|
492
|
-
- **Overlays you build** (quick-add, mobile nav, filters): mount at the document root, lock
|
|
493
|
-
background scroll, close on Escape, return focus on close — as the shipped `CartDrawer` does.
|
|
494
|
-
- **Copy:** nothing the merchant didn't supply — no invented reviews, scarcity, or delivery
|
|
495
|
-
promises; no Wix IDs or technical words in visible text.
|
|
496
|
-
|
|
497
|
-
Pre-order ships (`isPreorder`). Subscriptions, product groups, promotions, and notify-me are built
|
|
498
|
-
only when the catalog has them — never fabricated; consult the documentation skill for their endpoints.
|
|
499
|
-
|
|
500
460
|
## Missing capabilities
|
|
501
461
|
For anything these interfaces do not cover, consult the official Wix API documentation using
|
|
502
462
|
the documentation skill available in your environment.
|
|
@@ -41,6 +41,9 @@ const result = await seed.setupStore(ctx, {
|
|
|
41
41
|
// currency: { requested, actual, status, warnings } }
|
|
42
42
|
```
|
|
43
43
|
|
|
44
|
+
A product `name` is at most **80 characters** — Wix rejects the whole batch over that, so keep
|
|
45
|
+
names short and put the detail in `description`.
|
|
46
|
+
|
|
44
47
|
The optional `currency` sets the site's payment currency before product creation. Pass it only when
|
|
45
48
|
the user explicitly asked for a currency, or when it's obvious for the store — otherwise omit it. Do
|
|
46
49
|
not infer a currency from the builder's country/region or the brief's language; when in doubt, leave
|
|
@@ -174,6 +174,12 @@ function buildOptions(options = []) {
|
|
|
174
174
|
function validateProducts(products) {
|
|
175
175
|
const seen = new Map();
|
|
176
176
|
for (const product of products) {
|
|
177
|
+
// Wix caps a product name at 80 characters and the bulk create rejects the WHOLE batch over it
|
|
178
|
+
// ("name has size 175, expected 80 or less"), so the 81st character costs the entire seed.
|
|
179
|
+
if (typeof product.name === "string" && product.name.length > 80) {
|
|
180
|
+
throw new Error(`Product "${product.name.slice(0, 48)}…": the name is ${product.name.length} characters and Wix allows 80. ` +
|
|
181
|
+
`Shorten it and move the detail into description. No products were created by this call.`);
|
|
182
|
+
}
|
|
177
183
|
if (product.inStock !== undefined && typeof product.inStock !== "boolean") {
|
|
178
184
|
throw new Error(`Product "${product.name}": inStock must be a boolean. No products were created by this call.`);
|
|
179
185
|
}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
// Record what this project is in its agent instruction files, so a later session — which has
|
|
2
|
-
// none of the build conversation and may never open SKILL.md — still knows the Wix site is the
|
|
3
|
-
// source of truth and which skill answers which kind of question.
|
|
4
|
-
//
|
|
5
|
-
// node <SKILL_ROOT>/install/pin-agents-md.mjs --vertical <name> [--stack astro]
|
|
6
|
-
//
|
|
7
|
-
// Run from the project root. Kept out of deploy.mjs on purpose: "copy a vertical's files" and
|
|
8
|
-
// "record the project's ground rules" are separate concerns with separate reasons to change.
|
|
9
|
-
// APPENDS to each file — a template's or the user's own content is never overwritten — and is
|
|
10
|
-
// idempotent via the heading sentinel, so re-running fast-path.mjs writes at most once.
|
|
11
|
-
// Project facts that live in the repo (site id, app id) are NOT copied here; they would go
|
|
12
|
-
// stale against wix.config.json, which is the one place that owns them.
|
|
13
|
-
import { appendFileSync, existsSync, readFileSync } from "node:fs";
|
|
14
|
-
import { join } from "node:path";
|
|
15
|
-
|
|
16
|
-
const argv = process.argv.slice(2);
|
|
17
|
-
const flag = (n, d) => { const i = argv.indexOf(`--${n}`); return i >= 0 ? argv[i + 1] : d; };
|
|
18
|
-
|
|
19
|
-
const vertical = flag("vertical");
|
|
20
|
-
const stack = flag("stack", "astro");
|
|
21
|
-
// "astro" means the Wix-managed flavour (ambient auth), which is worth naming. Any other stack
|
|
22
|
-
// is echoed as given rather than mapped, so adding one can't silently mislabel the project.
|
|
23
|
-
const frontend = stack === "astro" ? "Wix-managed Astro" : stack.charAt(0).toUpperCase() + stack.slice(1);
|
|
24
|
-
|
|
25
|
-
const SENTINEL = "## This app — a Wix Headless frontend";
|
|
26
|
-
const note = `
|
|
27
|
-
${SENTINEL}
|
|
28
|
-
|
|
29
|
-
A ${frontend} frontend for a live Wix site; \`wix.config.json\` identifies the site. Built on
|
|
30
|
-
the **${vertical}** Wix business solution — more can be added to this same app. **The Wix site
|
|
31
|
-
owns the content and commerce** — read and write it through the Wix APIs, never hardcode what
|
|
32
|
-
it holds.
|
|
33
|
-
|
|
34
|
-
The Wix skills are installed at \`.agents/skills/\` — read them from that exact path:
|
|
35
|
-
|
|
36
|
-
- **\`wix-headless-fast\`** — the code already deployed in \`src/\` and how to extend it. Every
|
|
37
|
-
business solution it ships sits under \`references/<solution>/\`: \`INSTRUCTIONS.md\` is that
|
|
38
|
-
solution's playbook, \`seed/\` creates its content. To add one to this app, run from the
|
|
39
|
-
project root:
|
|
40
|
-
\`node .agents/skills/wix-headless-fast/install/deploy.mjs <solution> --stack ${stack}\`
|
|
41
|
-
- **\`wix-docs\`** — the Wix API reference. Confirm any endpoint, request shape, field, or enum
|
|
42
|
-
here before writing code against it, frontend or backend. Never infer a contract from
|
|
43
|
-
generated SDK types or \`node_modules\`.
|
|
44
|
-
- **\`wix-manage\`** — recipes for managing the live site itself, as opposed to changing this
|
|
45
|
-
codebase. No recipe for the task? Fall back to \`wix-docs\`.
|
|
46
|
-
`;
|
|
47
|
-
|
|
48
|
-
// Both files, independently — a project may have either, both, or neither, and agents differ
|
|
49
|
-
// in which one they read.
|
|
50
|
-
const pinned = ["AGENTS.md", "CLAUDE.md"].map((name) => {
|
|
51
|
-
const file = join(process.cwd(), name);
|
|
52
|
-
const existing = existsSync(file) ? readFileSync(file, "utf8") : "";
|
|
53
|
-
const wrote = !existing.includes(SENTINEL);
|
|
54
|
-
if (wrote) appendFileSync(file, (existing && !existing.endsWith("\n") ? "\n" : "") + note);
|
|
55
|
-
return { file: name, wrote, created: wrote && !existing };
|
|
56
|
-
});
|
|
57
|
-
console.log(JSON.stringify({ event: "agents_md", pinned }));
|