@cimplify/sdk 0.42.1 → 0.44.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/dist/dispatcher.mjs +1 -1
- package/dist/mock/cli.mjs +439 -2
- package/dist/mock/library.d.mts +2 -2
- package/dist/mock/library.d.ts +2 -2
- package/dist/mock/library.js +438 -1
- package/dist/mock/library.mjs +438 -1
- package/dist/mock/msw.d.mts +1 -1
- package/dist/mock/msw.d.ts +1 -1
- package/dist/mock/msw.js +438 -1
- package/dist/mock/msw.mjs +438 -1
- package/dist/{server-CVEsjECc.d.mts → server-DD-Cd1Ob.d.mts} +1 -1
- package/dist/{server-CVEsjECc.d.ts → server-DD-Cd1Ob.d.ts} +1 -1
- package/package.json +1 -1
- package/templates/storefront-bakery/.claude/skills/cimplify-storefront/SKILL.md +145 -0
- package/templates/storefront-bakery/.cursor/rules/cimplify-storefront.mdc +25 -0
- package/templates/storefront-bakery/CLAUDE.md +22 -0
- package/templates/storefront-fashion/.claude/skills/cimplify-storefront/SKILL.md +145 -0
- package/templates/storefront-fashion/.cursor/rules/cimplify-storefront.mdc +25 -0
- package/templates/storefront-fashion/.env.example +2 -2
- package/templates/storefront-fashion/CLAUDE.md +22 -0
- package/templates/storefront-fashion/lib/brand.ts +2 -2
- package/templates/storefront-fashion/package.json +3 -3
- package/templates/storefront-grocery/.claude/skills/cimplify-storefront/SKILL.md +145 -0
- package/templates/storefront-grocery/.cursor/rules/cimplify-storefront.mdc +25 -0
- package/templates/storefront-grocery/CLAUDE.md +22 -0
- package/templates/storefront-restaurant/.claude/skills/cimplify-storefront/SKILL.md +145 -0
- package/templates/storefront-restaurant/.cursor/rules/cimplify-storefront.mdc +25 -0
- package/templates/storefront-restaurant/CLAUDE.md +22 -0
- package/templates/storefront-retail/.claude/skills/cimplify-storefront/SKILL.md +145 -0
- package/templates/storefront-retail/.cursor/rules/cimplify-storefront.mdc +25 -0
- package/templates/storefront-retail/CLAUDE.md +22 -0
- package/templates/storefront-services/.claude/skills/cimplify-storefront/SKILL.md +145 -0
- package/templates/storefront-services/.cursor/rules/cimplify-storefront.mdc +25 -0
- package/templates/storefront-services/CLAUDE.md +22 -0
package/dist/mock/msw.mjs
CHANGED
|
@@ -7990,6 +7990,442 @@ function seedGrocery(registry) {
|
|
|
7990
7990
|
return { businessId };
|
|
7991
7991
|
}
|
|
7992
7992
|
|
|
7993
|
+
// src/mock/seeds/fashion.ts
|
|
7994
|
+
var ISO8 = "2026-01-01T00:00:00.000Z";
|
|
7995
|
+
var img3 = (id) => `https://images.unsplash.com/photo-${id}?w=900&h=1200&fit=crop&auto=format&q=80`;
|
|
7996
|
+
var PHOTO2 = {
|
|
7997
|
+
"heavyweight-hoodie-charcoal": "1556905055-8f358a7a47b2",
|
|
7998
|
+
"heavyweight-hoodie-cream": "1576566588028-4147f3842f27",
|
|
7999
|
+
"heavyweight-hoodie-cobalt": "1542838686-37da4a9fd1b3",
|
|
8000
|
+
"studio-tee-black": "1521572163474-6864f9cf17ab",
|
|
8001
|
+
"studio-tee-natural": "1485518882345-15568b007407",
|
|
8002
|
+
"graphic-tee-frx-mark": "1521223890158-f9f7c3d5d504",
|
|
8003
|
+
"carbon-bomber": "1591047139829-d91aecb6caea",
|
|
8004
|
+
"field-jacket-olive": "1564859228273-274232fdb516",
|
|
8005
|
+
"wide-leg-trouser": "1542272604-787c3835535d",
|
|
8006
|
+
"track-pant-charcoal": "1604176354204-9268737828e4",
|
|
8007
|
+
"studio-cap": "1620799140408-edc6dcb6d633",
|
|
8008
|
+
"tote-natural": "1591195853828-11db59a44f6b",
|
|
8009
|
+
"knit-beanie": "1542838132-92c53300491e",
|
|
8010
|
+
"studio-sock-3pack": "1602810318383-e386cc2a3ccf"
|
|
8011
|
+
};
|
|
8012
|
+
var photoFor2 = (slug) => img3(PHOTO2[slug] ?? "1556905055-8f358a7a47b2");
|
|
8013
|
+
var SIZES = ["XS", "S", "M", "L", "XL", "2XL"];
|
|
8014
|
+
function seedFashion(registry) {
|
|
8015
|
+
const businessId = "bus_studio_frx";
|
|
8016
|
+
const business = {
|
|
8017
|
+
id: businessId,
|
|
8018
|
+
name: "Studio FRX",
|
|
8019
|
+
handle: "studiofrx",
|
|
8020
|
+
business_type: "retail",
|
|
8021
|
+
email: "hello@studiofrx.test",
|
|
8022
|
+
default_currency: "GHS",
|
|
8023
|
+
default_phone: "+233244000000",
|
|
8024
|
+
default_address: "Osu Oxford Street, Accra",
|
|
8025
|
+
default_offers_table_service: false,
|
|
8026
|
+
default_accepts_online_orders: true,
|
|
8027
|
+
image: img3("1490481651871-ab68de25d43d"),
|
|
8028
|
+
status: "active",
|
|
8029
|
+
created_at: ISO8,
|
|
8030
|
+
updated_at: ISO8,
|
|
8031
|
+
created_by: "seed",
|
|
8032
|
+
preferences: {
|
|
8033
|
+
tagline: "Limited-run streetwear from Accra",
|
|
8034
|
+
description: "Heavyweight cotton, garment-dyed in Tema, hand-screened. Each drop is a closed run \u2014 when it's gone, it's gone.",
|
|
8035
|
+
instagram: "https://instagram.com/studiofrx",
|
|
8036
|
+
theme: "monochrome",
|
|
8037
|
+
checkout: { allow_guest: true }
|
|
8038
|
+
},
|
|
8039
|
+
is_online_only: false,
|
|
8040
|
+
enabled_payment_types: ["card", "mobile_money"],
|
|
8041
|
+
default_location_settings: {},
|
|
8042
|
+
country_code: "GH",
|
|
8043
|
+
timezone: "Africa/Accra"
|
|
8044
|
+
};
|
|
8045
|
+
registry.businesses.put(businessId, business);
|
|
8046
|
+
const categories = [
|
|
8047
|
+
{ slug: "new-arrivals", name: "New Arrivals", description: "Just dropped \u2014 the latest from the studio." },
|
|
8048
|
+
{ slug: "hoodies", name: "Hoodies", description: "Heavyweight 500gsm, garment-dyed in Tema." },
|
|
8049
|
+
{ slug: "tees", name: "Tees", description: "14oz cotton, oversized cut, hand-screened." },
|
|
8050
|
+
{ slug: "outerwear", name: "Outerwear", description: "Bombers, field jackets, made for layering." },
|
|
8051
|
+
{ slug: "bottoms", name: "Bottoms", description: "Wide-leg trousers and track pants." },
|
|
8052
|
+
{ slug: "accessories", name: "Accessories", description: "Caps, totes, beanies, socks." }
|
|
8053
|
+
];
|
|
8054
|
+
const catIds = /* @__PURE__ */ new Map();
|
|
8055
|
+
for (const c of categories) {
|
|
8056
|
+
const id = `cat_${c.slug}`;
|
|
8057
|
+
catIds.set(c.slug, id);
|
|
8058
|
+
const cat = {
|
|
8059
|
+
id,
|
|
8060
|
+
business_id: businessId,
|
|
8061
|
+
name: c.name,
|
|
8062
|
+
slug: c.slug,
|
|
8063
|
+
description: c.description,
|
|
8064
|
+
product_ids: [],
|
|
8065
|
+
display_order: 0,
|
|
8066
|
+
is_active: true,
|
|
8067
|
+
created_at: ISO8,
|
|
8068
|
+
updated_at: ISO8
|
|
8069
|
+
};
|
|
8070
|
+
registry.categories.put(id, cat);
|
|
8071
|
+
}
|
|
8072
|
+
const products = [
|
|
8073
|
+
// Hoodies
|
|
8074
|
+
{
|
|
8075
|
+
slug: "heavyweight-hoodie-charcoal",
|
|
8076
|
+
name: "Heavyweight Hoodie \xB7 Charcoal",
|
|
8077
|
+
price: "650.00",
|
|
8078
|
+
category: "hoodies",
|
|
8079
|
+
description: "500gsm garment-dyed cotton, hand-screened FRX seal at chest. Numbered run of 600. Oversized fit; size down for regular cut.",
|
|
8080
|
+
tags: ["hoodie", "signature", "drop-04"],
|
|
8081
|
+
isSignature: true
|
|
8082
|
+
},
|
|
8083
|
+
{
|
|
8084
|
+
slug: "heavyweight-hoodie-cream",
|
|
8085
|
+
name: "Heavyweight Hoodie \xB7 Cream",
|
|
8086
|
+
price: "650.00",
|
|
8087
|
+
category: "hoodies",
|
|
8088
|
+
description: "500gsm garment-dyed cotton in natural cream. Numbered run of 600.",
|
|
8089
|
+
tags: ["hoodie", "drop-04"],
|
|
8090
|
+
isNew: true
|
|
8091
|
+
},
|
|
8092
|
+
{
|
|
8093
|
+
slug: "heavyweight-hoodie-cobalt",
|
|
8094
|
+
name: "Heavyweight Hoodie \xB7 Cobalt",
|
|
8095
|
+
price: "650.00",
|
|
8096
|
+
category: "hoodies",
|
|
8097
|
+
description: "Limited cobalt-blue colourway. 500gsm garment-dyed cotton. Numbered run of 200.",
|
|
8098
|
+
tags: ["hoodie", "limited", "drop-04"],
|
|
8099
|
+
isNew: true
|
|
8100
|
+
},
|
|
8101
|
+
// Tees
|
|
8102
|
+
{
|
|
8103
|
+
slug: "studio-tee-black",
|
|
8104
|
+
name: "Studio Tee \xB7 Black",
|
|
8105
|
+
price: "220.00",
|
|
8106
|
+
category: "tees",
|
|
8107
|
+
description: "14oz heavyweight cotton, garment-dyed. Dropped shoulder, oversized fit. The everyday FRX.",
|
|
8108
|
+
tags: ["tee", "signature"],
|
|
8109
|
+
isSignature: true
|
|
8110
|
+
},
|
|
8111
|
+
{
|
|
8112
|
+
slug: "studio-tee-natural",
|
|
8113
|
+
name: "Studio Tee \xB7 Natural",
|
|
8114
|
+
price: "220.00",
|
|
8115
|
+
category: "tees",
|
|
8116
|
+
description: "14oz heavyweight cotton in undyed natural. Softens beautifully with wear.",
|
|
8117
|
+
tags: ["tee"]
|
|
8118
|
+
},
|
|
8119
|
+
{
|
|
8120
|
+
slug: "graphic-tee-frx-mark",
|
|
8121
|
+
name: "Graphic Tee \xB7 FRX Mark",
|
|
8122
|
+
price: "260.00",
|
|
8123
|
+
category: "tees",
|
|
8124
|
+
description: "Hand-screened FRX seal, oversized fit. 14oz cotton. Numbered run of 400.",
|
|
8125
|
+
tags: ["tee", "graphic", "drop-04"],
|
|
8126
|
+
isNew: true
|
|
8127
|
+
},
|
|
8128
|
+
// Outerwear
|
|
8129
|
+
{
|
|
8130
|
+
slug: "carbon-bomber",
|
|
8131
|
+
name: "Carbon Bomber",
|
|
8132
|
+
price: "1200.00",
|
|
8133
|
+
category: "outerwear",
|
|
8134
|
+
description: "Waxed cotton outer, ribbed cuffs, two-way zip. Cut for layering over a hoodie.",
|
|
8135
|
+
tags: ["outerwear", "premium"],
|
|
8136
|
+
isSignature: true
|
|
8137
|
+
},
|
|
8138
|
+
{
|
|
8139
|
+
slug: "field-jacket-olive",
|
|
8140
|
+
name: "Field Jacket \xB7 Olive",
|
|
8141
|
+
price: "1450.00",
|
|
8142
|
+
category: "outerwear",
|
|
8143
|
+
description: "Garment-dyed military canvas, four utility pockets, drawcord hem. A workhorse.",
|
|
8144
|
+
tags: ["outerwear", "premium", "drop-04"],
|
|
8145
|
+
isNew: true
|
|
8146
|
+
},
|
|
8147
|
+
// Bottoms
|
|
8148
|
+
{
|
|
8149
|
+
slug: "wide-leg-trouser",
|
|
8150
|
+
name: "Wide-Leg Trouser",
|
|
8151
|
+
price: "480.00",
|
|
8152
|
+
category: "bottoms",
|
|
8153
|
+
description: "Heavy twill cotton, pleated front, side pockets. Cut for an oversized silhouette.",
|
|
8154
|
+
tags: ["bottom"]
|
|
8155
|
+
},
|
|
8156
|
+
{
|
|
8157
|
+
slug: "track-pant-charcoal",
|
|
8158
|
+
name: "Track Pant \xB7 Charcoal",
|
|
8159
|
+
price: "380.00",
|
|
8160
|
+
category: "bottoms",
|
|
8161
|
+
description: "Heavyweight loopback fleece, tapered leg, elasticated cuffs. The bottom half of the hoodie set.",
|
|
8162
|
+
tags: ["bottom"]
|
|
8163
|
+
},
|
|
8164
|
+
// Accessories
|
|
8165
|
+
{
|
|
8166
|
+
slug: "studio-cap",
|
|
8167
|
+
name: "Studio Cap",
|
|
8168
|
+
price: "120.00",
|
|
8169
|
+
category: "accessories",
|
|
8170
|
+
description: "Brushed cotton 6-panel, embroidered FRX. Adjustable strap.",
|
|
8171
|
+
tags: ["accessory"]
|
|
8172
|
+
},
|
|
8173
|
+
{
|
|
8174
|
+
slug: "tote-natural",
|
|
8175
|
+
name: "Studio Tote \xB7 Natural",
|
|
8176
|
+
price: "150.00",
|
|
8177
|
+
category: "accessories",
|
|
8178
|
+
description: "12oz natural canvas, screen-printed FRX seal. Roomy.",
|
|
8179
|
+
tags: ["accessory"]
|
|
8180
|
+
},
|
|
8181
|
+
{
|
|
8182
|
+
slug: "knit-beanie",
|
|
8183
|
+
name: "Knit Beanie",
|
|
8184
|
+
price: "140.00",
|
|
8185
|
+
category: "accessories",
|
|
8186
|
+
description: "Merino wool blend, woven label. Two colourways.",
|
|
8187
|
+
tags: ["accessory"]
|
|
8188
|
+
},
|
|
8189
|
+
{
|
|
8190
|
+
slug: "studio-sock-3pack",
|
|
8191
|
+
name: "Studio Sock \xB7 3-pack",
|
|
8192
|
+
price: "180.00",
|
|
8193
|
+
category: "accessories",
|
|
8194
|
+
description: "Heavy-cuff crew socks, 3-pack. Cotton-rich blend.",
|
|
8195
|
+
tags: ["accessory"]
|
|
8196
|
+
}
|
|
8197
|
+
];
|
|
8198
|
+
for (const p of products) {
|
|
8199
|
+
const id = `prod_${p.slug}`;
|
|
8200
|
+
const catId = catIds.get(p.category);
|
|
8201
|
+
const product = {
|
|
8202
|
+
id,
|
|
8203
|
+
business_id: businessId,
|
|
8204
|
+
name: p.name,
|
|
8205
|
+
slug: p.slug,
|
|
8206
|
+
description: p.description,
|
|
8207
|
+
product_type: "product",
|
|
8208
|
+
base_price: p.price,
|
|
8209
|
+
currency: "GHS",
|
|
8210
|
+
image: photoFor2(p.slug),
|
|
8211
|
+
images: [photoFor2(p.slug)],
|
|
8212
|
+
is_available: true,
|
|
8213
|
+
category_ids: [catId],
|
|
8214
|
+
collection_ids: [],
|
|
8215
|
+
add_on_ids: [],
|
|
8216
|
+
variant_ids: [],
|
|
8217
|
+
tags: p.tags ?? [],
|
|
8218
|
+
is_signature: p.isSignature ?? false,
|
|
8219
|
+
is_new: p.isNew ?? false,
|
|
8220
|
+
render_hint: "physical",
|
|
8221
|
+
created_at: ISO8,
|
|
8222
|
+
updated_at: ISO8
|
|
8223
|
+
};
|
|
8224
|
+
registry.products.put(id, product);
|
|
8225
|
+
const cat = registry.categories.get(catId);
|
|
8226
|
+
cat.product_ids.push(id);
|
|
8227
|
+
registry.categories.put(catId, cat);
|
|
8228
|
+
}
|
|
8229
|
+
for (const p of products) {
|
|
8230
|
+
const productId = `prod_${p.slug}`;
|
|
8231
|
+
const axis = {
|
|
8232
|
+
id: `axis_${p.slug}_size`,
|
|
8233
|
+
business_id: businessId,
|
|
8234
|
+
product_id: productId,
|
|
8235
|
+
name: "Size",
|
|
8236
|
+
display_order: 0,
|
|
8237
|
+
affects_recipe: false,
|
|
8238
|
+
values: SIZES.map((s, i) => ({
|
|
8239
|
+
id: `axv_${p.slug}_size_${s.toLowerCase()}`,
|
|
8240
|
+
business_id: businessId,
|
|
8241
|
+
axis_id: `axis_${p.slug}_size`,
|
|
8242
|
+
name: s,
|
|
8243
|
+
display_order: i,
|
|
8244
|
+
created_at: ISO8,
|
|
8245
|
+
updated_at: ISO8
|
|
8246
|
+
})),
|
|
8247
|
+
created_at: ISO8,
|
|
8248
|
+
updated_at: ISO8
|
|
8249
|
+
};
|
|
8250
|
+
registry.variantAxes.put(axis.id, axis);
|
|
8251
|
+
const variantIds = [];
|
|
8252
|
+
let firstVariant = true;
|
|
8253
|
+
for (const sz of axis.values) {
|
|
8254
|
+
const variantId = `var_${p.slug}_size_${sz.name.toLowerCase()}`;
|
|
8255
|
+
const variant = {
|
|
8256
|
+
id: variantId,
|
|
8257
|
+
product_id: productId,
|
|
8258
|
+
business_id: businessId,
|
|
8259
|
+
name: sz.name,
|
|
8260
|
+
sku: `${p.slug.toUpperCase()}-${sz.name}`,
|
|
8261
|
+
price_adjustment: "0.00",
|
|
8262
|
+
component_multiplier: "1.00",
|
|
8263
|
+
is_default: firstVariant,
|
|
8264
|
+
is_active: true,
|
|
8265
|
+
axis_value_ids: [sz.id],
|
|
8266
|
+
created_at: ISO8,
|
|
8267
|
+
updated_at: ISO8
|
|
8268
|
+
};
|
|
8269
|
+
registry.variants.put(variantId, variant);
|
|
8270
|
+
variantIds.push(variantId);
|
|
8271
|
+
firstVariant = false;
|
|
8272
|
+
}
|
|
8273
|
+
const product = registry.products.get(productId);
|
|
8274
|
+
product.variant_ids = variantIds;
|
|
8275
|
+
registry.products.put(productId, product);
|
|
8276
|
+
}
|
|
8277
|
+
const drop04 = {
|
|
8278
|
+
id: "col_drop_04",
|
|
8279
|
+
business_id: businessId,
|
|
8280
|
+
name: "Drop 04",
|
|
8281
|
+
slug: "drop-04",
|
|
8282
|
+
description: "Spring 2026 capsule. 412 pieces left.",
|
|
8283
|
+
product_ids: [
|
|
8284
|
+
"prod_heavyweight-hoodie-charcoal",
|
|
8285
|
+
"prod_heavyweight-hoodie-cream",
|
|
8286
|
+
"prod_heavyweight-hoodie-cobalt",
|
|
8287
|
+
"prod_graphic-tee-frx-mark",
|
|
8288
|
+
"prod_field-jacket-olive"
|
|
8289
|
+
],
|
|
8290
|
+
is_active: true,
|
|
8291
|
+
created_at: ISO8,
|
|
8292
|
+
updated_at: ISO8
|
|
8293
|
+
};
|
|
8294
|
+
const bestSellers = {
|
|
8295
|
+
id: "col_best_sellers",
|
|
8296
|
+
business_id: businessId,
|
|
8297
|
+
name: "Best Sellers",
|
|
8298
|
+
slug: "best-sellers",
|
|
8299
|
+
description: "What everyone's buying.",
|
|
8300
|
+
product_ids: [
|
|
8301
|
+
"prod_studio-tee-black",
|
|
8302
|
+
"prod_heavyweight-hoodie-charcoal",
|
|
8303
|
+
"prod_carbon-bomber",
|
|
8304
|
+
"prod_studio-cap",
|
|
8305
|
+
"prod_track-pant-charcoal"
|
|
8306
|
+
],
|
|
8307
|
+
is_active: true,
|
|
8308
|
+
created_at: ISO8,
|
|
8309
|
+
updated_at: ISO8
|
|
8310
|
+
};
|
|
8311
|
+
registry.collections.put(drop04.id, drop04);
|
|
8312
|
+
registry.collections.put(bestSellers.id, bestSellers);
|
|
8313
|
+
for (const col of [drop04, bestSellers]) {
|
|
8314
|
+
for (const pid of col.product_ids) {
|
|
8315
|
+
const p = registry.products.get(pid);
|
|
8316
|
+
if (p) {
|
|
8317
|
+
p.collection_ids.push(col.id);
|
|
8318
|
+
registry.products.put(pid, p);
|
|
8319
|
+
}
|
|
8320
|
+
}
|
|
8321
|
+
}
|
|
8322
|
+
const tags = [
|
|
8323
|
+
{ id: "tag_signature", business_id: businessId, name: "Signature", slug: "signature", color: "#0a0a0a", sort_order: 0, usage_count: 3, created_at: ISO8, updated_at: ISO8 },
|
|
8324
|
+
{ id: "tag_drop_04", business_id: businessId, name: "Drop 04", slug: "drop-04", color: "#dc2626", sort_order: 1, usage_count: 5, created_at: ISO8, updated_at: ISO8 },
|
|
8325
|
+
{ id: "tag_limited", business_id: businessId, name: "Limited", slug: "limited", color: "#dc2626", sort_order: 2, usage_count: 1, created_at: ISO8, updated_at: ISO8 },
|
|
8326
|
+
{ id: "tag_premium", business_id: businessId, name: "Premium", slug: "premium", color: "#7c3aed", sort_order: 3, usage_count: 2, created_at: ISO8, updated_at: ISO8 }
|
|
8327
|
+
];
|
|
8328
|
+
for (const t of tags) registry.tags.put(t.id, t);
|
|
8329
|
+
const apparel = {
|
|
8330
|
+
id: "tax_apparel",
|
|
8331
|
+
business_id: businessId,
|
|
8332
|
+
name: "Apparel",
|
|
8333
|
+
slug: "apparel",
|
|
8334
|
+
path: ["Apparel"],
|
|
8335
|
+
attribute_template_ids: ["attr_fabric", "attr_country_of_origin"],
|
|
8336
|
+
created_at: ISO8,
|
|
8337
|
+
updated_at: ISO8
|
|
8338
|
+
};
|
|
8339
|
+
registry.taxonomies.put(apparel.id, apparel);
|
|
8340
|
+
const attrs = [
|
|
8341
|
+
{
|
|
8342
|
+
id: "attr_fabric",
|
|
8343
|
+
business_id: businessId,
|
|
8344
|
+
namespace: "core",
|
|
8345
|
+
name: "Fabric",
|
|
8346
|
+
slug: "fabric",
|
|
8347
|
+
description: 'Material composition (e.g. "100% cotton, 500gsm").',
|
|
8348
|
+
attribute_type: "text",
|
|
8349
|
+
is_required: false,
|
|
8350
|
+
is_filterable: true,
|
|
8351
|
+
visibility: "public",
|
|
8352
|
+
display_order: 0,
|
|
8353
|
+
applies_to: "product",
|
|
8354
|
+
created_at: ISO8,
|
|
8355
|
+
updated_at: ISO8
|
|
8356
|
+
},
|
|
8357
|
+
{
|
|
8358
|
+
id: "attr_country_of_origin",
|
|
8359
|
+
business_id: businessId,
|
|
8360
|
+
namespace: "core",
|
|
8361
|
+
name: "Country of origin",
|
|
8362
|
+
slug: "country-of-origin",
|
|
8363
|
+
attribute_type: "text",
|
|
8364
|
+
is_required: false,
|
|
8365
|
+
is_filterable: true,
|
|
8366
|
+
visibility: "public",
|
|
8367
|
+
display_order: 1,
|
|
8368
|
+
applies_to: "product",
|
|
8369
|
+
created_at: ISO8,
|
|
8370
|
+
updated_at: ISO8
|
|
8371
|
+
},
|
|
8372
|
+
{
|
|
8373
|
+
id: "attr_fit",
|
|
8374
|
+
business_id: businessId,
|
|
8375
|
+
namespace: "core",
|
|
8376
|
+
name: "Fit",
|
|
8377
|
+
slug: "fit",
|
|
8378
|
+
attribute_type: "single_select",
|
|
8379
|
+
options: ["regular", "oversized", "relaxed", "slim"],
|
|
8380
|
+
is_required: false,
|
|
8381
|
+
is_filterable: true,
|
|
8382
|
+
visibility: "public",
|
|
8383
|
+
display_order: 2,
|
|
8384
|
+
applies_to: "product",
|
|
8385
|
+
created_at: ISO8,
|
|
8386
|
+
updated_at: ISO8
|
|
8387
|
+
}
|
|
8388
|
+
];
|
|
8389
|
+
for (const a of attrs) registry.attributeDefs.put(a.id, a);
|
|
8390
|
+
const articles = [
|
|
8391
|
+
{
|
|
8392
|
+
id: "kb_sizing",
|
|
8393
|
+
business_id: businessId,
|
|
8394
|
+
title: "Sizing & fit",
|
|
8395
|
+
slug: "sizing",
|
|
8396
|
+
content: "Our pieces are cut for an oversized, dropped-shoulder fit. Order true to size for the intended fit; size down for a regular cut. Charts on every product page.",
|
|
8397
|
+
category: "products",
|
|
8398
|
+
tags: ["sizing", "fit"],
|
|
8399
|
+
created_at: ISO8,
|
|
8400
|
+
updated_at: ISO8
|
|
8401
|
+
},
|
|
8402
|
+
{
|
|
8403
|
+
id: "kb_drops",
|
|
8404
|
+
business_id: businessId,
|
|
8405
|
+
title: "Drops & restocks",
|
|
8406
|
+
slug: "drops",
|
|
8407
|
+
content: "Each drop is a closed, numbered run. We don't restock. The FRX list gets a 24-hour head start before each drop opens to the public.",
|
|
8408
|
+
category: "general",
|
|
8409
|
+
tags: ["drops", "restocks"],
|
|
8410
|
+
created_at: ISO8,
|
|
8411
|
+
updated_at: ISO8
|
|
8412
|
+
},
|
|
8413
|
+
{
|
|
8414
|
+
id: "kb_returns",
|
|
8415
|
+
business_id: businessId,
|
|
8416
|
+
title: "Returns",
|
|
8417
|
+
slug: "returns",
|
|
8418
|
+
content: "Free returns within 30 days from the US, UK, and EU. Item must be unworn with original tags. Underwear and final-sale items aren't returnable.",
|
|
8419
|
+
category: "logistics",
|
|
8420
|
+
tags: ["returns"],
|
|
8421
|
+
created_at: ISO8,
|
|
8422
|
+
updated_at: ISO8
|
|
8423
|
+
}
|
|
8424
|
+
];
|
|
8425
|
+
for (const a of articles) registry.knowledgeArticles.put(a.id, a);
|
|
8426
|
+
return { businessId };
|
|
8427
|
+
}
|
|
8428
|
+
|
|
7993
8429
|
// src/mock/seeds/registry.ts
|
|
7994
8430
|
var SEEDS = {
|
|
7995
8431
|
default: seedDefault,
|
|
@@ -7998,7 +8434,8 @@ var SEEDS = {
|
|
|
7998
8434
|
restaurant: seedRestaurant,
|
|
7999
8435
|
retail: seedRetail,
|
|
8000
8436
|
services: seedServices,
|
|
8001
|
-
grocery: seedGrocery
|
|
8437
|
+
grocery: seedGrocery,
|
|
8438
|
+
fashion: seedFashion
|
|
8002
8439
|
};
|
|
8003
8440
|
function applySeed(registry, name) {
|
|
8004
8441
|
const fn = SEEDS[name];
|
|
@@ -883,7 +883,7 @@ interface LiteService {
|
|
|
883
883
|
getMenuCategory(categoryId: string): unknown;
|
|
884
884
|
}
|
|
885
885
|
|
|
886
|
-
type SeedName = "default" | "empty" | "reesa-storefront" | "restaurant" | "retail" | "services" | "grocery";
|
|
886
|
+
type SeedName = "default" | "empty" | "reesa-storefront" | "restaurant" | "retail" | "services" | "grocery" | "fashion";
|
|
887
887
|
declare function applySeed(registry: StateRegistry, name: SeedName): {
|
|
888
888
|
businessId: string;
|
|
889
889
|
};
|
|
@@ -883,7 +883,7 @@ interface LiteService {
|
|
|
883
883
|
getMenuCategory(categoryId: string): unknown;
|
|
884
884
|
}
|
|
885
885
|
|
|
886
|
-
type SeedName = "default" | "empty" | "reesa-storefront" | "restaurant" | "retail" | "services" | "grocery";
|
|
886
|
+
type SeedName = "default" | "empty" | "reesa-storefront" | "restaurant" | "retail" | "services" | "grocery" | "fashion";
|
|
887
887
|
declare function applySeed(registry: StateRegistry, name: SeedName): {
|
|
888
888
|
businessId: string;
|
|
889
889
|
};
|
package/package.json
CHANGED
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: cimplify-storefront
|
|
3
|
+
description: Build, customize, rebrand, or deploy a Cimplify-scaffolded storefront. Triggers when the user asks to create a storefront, rebrand a Cimplify template, change the palette, add a page, deploy to Cimplify, or works in a project containing `lib/brand.ts` and `next.config.ts` with `cacheComponents`.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Cimplify Storefront skill
|
|
7
|
+
|
|
8
|
+
You're working on a project scaffolded from `bunx @cimplify/sdk init`. The architecture is opinionated and the rebrand surface is intentionally small. Read `AGENTS.md` at the project root for the file ↔ brand-field map for *this template's* industry; this skill gives you the playbook that's the same across all six.
|
|
9
|
+
|
|
10
|
+
## The contract — never break
|
|
11
|
+
|
|
12
|
+
1. **`lib/brand.ts` is the only place for content edits.** Every visible string reads from this file. If a string isn't in `brand`, *add a field* to the `Brand` interface — don't hardcode it in a page or component.
|
|
13
|
+
2. **`app/globals.css` `@theme { … }`** holds palette + radius + font references. To re-skin the entire site, edit only this block.
|
|
14
|
+
3. **Server Components are cached** via `'use cache'` + `cacheTag(tags.X())` + `cacheLife("hours")`. Don't downgrade them to `"use client"` to avoid an issue — fix the issue.
|
|
15
|
+
4. **Client islands** (anything reading `useSearchParams`, `usePathname`, `useRouter`, `useState`) live behind `<Suspense>`.
|
|
16
|
+
5. **`cacheComponents: true`** in `next.config.ts` is non-negotiable. Don't turn it off.
|
|
17
|
+
6. **`bun run test:run` (vitest)** is the canonical test runner. `bun test` will show false failures because Bun's `vi` shim is incomplete.
|
|
18
|
+
7. **Cart, checkout, orders stay client.** They're session-bound. Don't try to SSR them.
|
|
19
|
+
|
|
20
|
+
## The brand-field schema (in `lib/brand.ts`)
|
|
21
|
+
|
|
22
|
+
```
|
|
23
|
+
identity: name, shortName, microTag, description, schemaType, currency, locale
|
|
24
|
+
contact: address, streetAddress, city, countryCode, phone, phoneTel, email, privacyEmail, hours
|
|
25
|
+
socials: [{ label, href, icon }] // icon ∈ instagram|x|tiktok|facebook|youtube|linkedin|whatsapp
|
|
26
|
+
header: { nav: [{ label, href }] }
|
|
27
|
+
hero: { badge, title, subtitle, primaryCtaLabel, secondaryCtaLabel?, secondaryCtaHref? }
|
|
28
|
+
optional: trustItems[]?, brandStrip?, promo?, tradeIn? // render conditionally
|
|
29
|
+
newsletter: { eyebrow, title, body, placeholder, submitLabel, successLabel }
|
|
30
|
+
about: { eyebrow, title, paragraphs[], sections[{ heading, body }] }
|
|
31
|
+
faq: { eyebrow, title, sections[{ title, items[{ q, a }] }], contactPrompt, contactEmail }
|
|
32
|
+
terms,
|
|
33
|
+
privacy,
|
|
34
|
+
shipping,
|
|
35
|
+
returns,
|
|
36
|
+
accessibility: { eyebrow, title, lastUpdated, sections[{ heading, body | { intro, bullets[] } }] }
|
|
37
|
+
account: eyebrows + titles for /account, /login, /signup
|
|
38
|
+
contactPage: { eyebrow, title, body, reasons[], directLines[{ label, value, href }] }
|
|
39
|
+
trackOrder: { eyebrow, title, body }
|
|
40
|
+
footer: { blurb, sitemap[{ title, links[] }], poweredBy? }
|
|
41
|
+
llms: { summary } // opens /llms.txt
|
|
42
|
+
mock: { seed, businessId }
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Playbook — common tasks
|
|
46
|
+
|
|
47
|
+
### Rebrand a storefront for a new merchant
|
|
48
|
+
|
|
49
|
+
1. Edit `lib/brand.ts`. Replace every field with the merchant's content. Use the brief / context the user gave you.
|
|
50
|
+
2. Edit `app/globals.css` `@theme { … }`. Change `--color-primary`, `--color-background`, `--color-foreground`, optionally `--radius`. Use OKLCH; if the brand only gave hex, convert.
|
|
51
|
+
3. (Optional) Swap fonts in `app/layout.tsx` — `next/font/google` import + the variable wired into the `<html>` className.
|
|
52
|
+
4. Set `.env.local`: `NEXT_PUBLIC_CIMPLIFY_API_URL`, `NEXT_PUBLIC_CIMPLIFY_PUBLIC_KEY`, `NEXT_PUBLIC_CIMPLIFY_BUSINESS_ID`, `NEXT_PUBLIC_SITE_URL`.
|
|
53
|
+
|
|
54
|
+
Don't touch any other file. If the rebrand needs content not in the schema, add the field to `Brand` first, populate it, then read it from the page.
|
|
55
|
+
|
|
56
|
+
### Add a new section / component
|
|
57
|
+
|
|
58
|
+
1. Build it as a Server Component in `components/` (or a client island in `*-client.tsx` if interactive).
|
|
59
|
+
2. Read merchant copy from `brand`. Add new fields to the `Brand` interface if needed.
|
|
60
|
+
3. Wrap interactive bits in `<Suspense fallback={…}>` so the cached chrome streams.
|
|
61
|
+
4. Compose into the page.
|
|
62
|
+
|
|
63
|
+
### Wire a Server Action that mutates data
|
|
64
|
+
|
|
65
|
+
```ts
|
|
66
|
+
"use server";
|
|
67
|
+
import { getServerClient, revalidateProducts } from "@cimplify/sdk/server";
|
|
68
|
+
|
|
69
|
+
export async function createProduct(input: ProductInput) {
|
|
70
|
+
await getServerClient().catalogue.createProduct(input);
|
|
71
|
+
revalidateProducts();
|
|
72
|
+
}
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
After every mutation, call the matching `revalidate*` helper from `@cimplify/sdk/server`: `revalidateProducts`, `revalidateProduct(id)`, `revalidateCategories`, `revalidateCategory(id)`, `revalidateCollections`, `revalidateCollection(id)`, `revalidateBusiness`.
|
|
76
|
+
|
|
77
|
+
### Add a Server Component data fetch
|
|
78
|
+
|
|
79
|
+
```ts
|
|
80
|
+
import { cacheTag, cacheLife } from "next/cache";
|
|
81
|
+
import { getServerClient, tags } from "@cimplify/sdk/server";
|
|
82
|
+
|
|
83
|
+
async function getX() {
|
|
84
|
+
"use cache";
|
|
85
|
+
cacheTag(tags.products());
|
|
86
|
+
cacheLife("hours");
|
|
87
|
+
const r = await getServerClient().catalogue.getProducts({ limit: 24 });
|
|
88
|
+
if (!r.ok) throw new Error(r.error.message);
|
|
89
|
+
return r.value.items;
|
|
90
|
+
}
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### Eject an SDK component for deeper customization
|
|
94
|
+
|
|
95
|
+
Try `classNames`, `renderImage`, `renderLink`, slot props first. If those run out:
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
bunx @cimplify/sdk eject --list
|
|
99
|
+
bunx @cimplify/sdk eject product-card --dir src/components/cimplify
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
Once ejected, the file is yours. Hooks/types still come from `@cimplify/sdk`.
|
|
103
|
+
|
|
104
|
+
### Deploy
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
bunx @cimplify/sdk login
|
|
108
|
+
bunx @cimplify/sdk projects create my-store
|
|
109
|
+
bunx @cimplify/sdk link <project-id>
|
|
110
|
+
bunx @cimplify/sdk env push
|
|
111
|
+
bunx @cimplify/sdk deploy --prod
|
|
112
|
+
bunx @cimplify/sdk logs --follow
|
|
113
|
+
bunx @cimplify/sdk domains add my-store.com
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
## Pitfalls — explicit ❌ list
|
|
117
|
+
|
|
118
|
+
- ❌ Hardcoding any visible string in a page or component. Always `brand.X`.
|
|
119
|
+
- ❌ Disabling `cacheComponents: true` to silence a warning. Fix the warning by wrapping the dynamic call in `<Suspense>`.
|
|
120
|
+
- ❌ Using `unstable_cache` — Next 16's canonical primitive is `'use cache'` + `cacheTag` + `cacheLife`.
|
|
121
|
+
- ❌ Bypassing `getServerClient()` and calling `createCimplifyClient` directly in a Server Component — loses per-request memoization.
|
|
122
|
+
- ❌ Mutating data without calling the matching `revalidate*` helper.
|
|
123
|
+
- ❌ Adding an `app/error.tsx` handler that calls `reset()` without logging — silently swallowed errors hide bugs.
|
|
124
|
+
- ❌ Running `bun test` and reporting failures. Use `bun run test:run` (vitest).
|
|
125
|
+
- ❌ Editing the per-template `AGENTS.md` to remove notes about TODOs (contact form, newsletter fake submits) — they're real.
|
|
126
|
+
|
|
127
|
+
## Where things live
|
|
128
|
+
|
|
129
|
+
| Need | Look here |
|
|
130
|
+
|---|---|
|
|
131
|
+
| Which page reads which `brand.X` field | `AGENTS.md` at project root |
|
|
132
|
+
| Architectural rules | `AGENTS.md` at project root + this skill |
|
|
133
|
+
| Running locally | `bun dev` (boots mock + Next together) |
|
|
134
|
+
| Switching mock seed | edit `dev:mock` in `package.json` and `NEXT_PUBLIC_CIMPLIFY_BUSINESS_ID` in `.env.local` |
|
|
135
|
+
| Full SDK reference | `docs/sdk/storefronts.md` in the Cimplify repo |
|
|
136
|
+
|
|
137
|
+
## What to do when the user asks something out-of-scope
|
|
138
|
+
|
|
139
|
+
If the user asks for something the template doesn't support out of the box:
|
|
140
|
+
|
|
141
|
+
1. **Check first** — is there an SDK component or hook that does it? `@cimplify/sdk/react` has 50+ components, 30+ hooks. Search `node_modules/@cimplify/sdk/dist/react.d.mts` if needed.
|
|
142
|
+
2. **Compose from existing parts** before authoring new ones.
|
|
143
|
+
3. **If genuinely missing** — build the new component, hoist its strings into `brand.ts`, document in `AGENTS.md`.
|
|
144
|
+
|
|
145
|
+
Don't introduce competing patterns (a new caching strategy, a new auth flow, a new theming system). The template's opinions are intentional.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Cimplify storefront — architectural rules and rebrand contract for a project scaffolded from `bunx @cimplify/sdk init`. Triggers when files like lib/brand.ts, app/globals.css, components/header.tsx, or .cimplify/project.json are in the workspace.
|
|
3
|
+
globs: ["lib/brand.ts", "app/**", "components/**", ".env.local", "next.config.ts"]
|
|
4
|
+
alwaysApply: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Cimplify storefront
|
|
8
|
+
|
|
9
|
+
This project was scaffolded from a Cimplify template. Read `AGENTS.md` at the project root for the file ↔ `brand.X` field map and `.claude/skills/cimplify-storefront/SKILL.md` for the full playbook.
|
|
10
|
+
|
|
11
|
+
## The contract
|
|
12
|
+
|
|
13
|
+
1. **`lib/brand.ts`** — every visible string. If something isn't there, add a field to the `Brand` interface; don't hardcode.
|
|
14
|
+
2. **`app/globals.css` `@theme` block** — palette, radius, font references.
|
|
15
|
+
3. **Server Components are cached** via `'use cache'` + `cacheTag(tags.X())` + `cacheLife("hours")`. Don't downgrade to client to silence a warning.
|
|
16
|
+
4. **Client islands** behind `<Suspense>`.
|
|
17
|
+
5. **`cacheComponents: true`** in `next.config.ts` is non-negotiable.
|
|
18
|
+
6. Use **`bun run test:run`** (vitest), not `bun test`.
|
|
19
|
+
|
|
20
|
+
## Don't
|
|
21
|
+
|
|
22
|
+
- Hardcode visible strings in pages/components.
|
|
23
|
+
- Use `unstable_cache` (Next 16 uses `'use cache'`).
|
|
24
|
+
- Bypass `getServerClient()` (loses per-request memoization).
|
|
25
|
+
- Mutate without calling the matching `revalidate*` helper from `@cimplify/sdk/server`.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# CLAUDE.md
|
|
2
|
+
|
|
3
|
+
This project was scaffolded from a Cimplify storefront template (`bunx @cimplify/sdk init`).
|
|
4
|
+
|
|
5
|
+
## Read these first
|
|
6
|
+
|
|
7
|
+
- **`AGENTS.md`** at the project root — the file ↔ `brand.X` field map for *this template's* industry, plus the architectural rules.
|
|
8
|
+
- **`.claude/skills/cimplify-storefront/SKILL.md`** — the playbook for common tasks (rebrand, add a section, wire a Server Action, deploy, eject a component). Invoke it whenever you're asked to change content, palette, copy, or routing.
|
|
9
|
+
|
|
10
|
+
## The two-line summary
|
|
11
|
+
|
|
12
|
+
1. **Edit `lib/brand.ts`** for any visible string.
|
|
13
|
+
2. **Edit `app/globals.css` `@theme` block** for any palette / radius / font change.
|
|
14
|
+
|
|
15
|
+
That covers ~95% of what merchants ask for. For anything else, follow the `cimplify-storefront` skill.
|
|
16
|
+
|
|
17
|
+
## Don't do
|
|
18
|
+
|
|
19
|
+
- Hardcode strings in pages or components.
|
|
20
|
+
- Disable `cacheComponents: true` in `next.config.ts`.
|
|
21
|
+
- Use `unstable_cache` — Next 16's canonical primitive is `'use cache'`.
|
|
22
|
+
- Run `bun test` (Bun's `vi` shim is incomplete) — use `bun run test:run`.
|