create-brainerce-store 1.42.0 → 1.43.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/index.js +1 -1
- package/package.json +1 -1
- package/templates/nextjs/base/scripts/fetch-store-info.mjs +10 -4
- package/templates/nextjs/base/src/app/checkout/page.tsx +982 -981
- package/templates/nextjs/base/src/app/products/[slug]/page.tsx +118 -117
- package/templates/nextjs/base/src/components/account/order-history.tsx +368 -367
- package/templates/nextjs/base/src/components/cart/cart-bundle-offer.tsx +111 -112
- package/templates/nextjs/base/src/components/cart/cart-item.tsx +152 -153
- package/templates/nextjs/base/src/components/cart/cart-summary.tsx +108 -108
- package/templates/nextjs/base/src/components/cart/cart-upgrade-banner.tsx +141 -142
- package/templates/nextjs/base/src/components/cart/free-shipping-bar.tsx +62 -59
- package/templates/nextjs/base/src/components/checkout/order-bump-card.tsx +242 -243
- package/templates/nextjs/base/src/components/checkout/pickup-step.tsx +198 -199
- package/templates/nextjs/base/src/components/checkout/shipping-step.tsx +109 -110
- package/templates/nextjs/base/src/components/checkout/tax-display.tsx +64 -65
- package/templates/nextjs/base/src/components/products/frequently-bought-together.tsx +203 -202
- package/templates/nextjs/base/src/components/products/product-card.tsx +226 -226
- package/templates/nextjs/base/src/components/products/variant-selector.tsx +291 -292
- package/templates/nextjs/base/src/components/seo/product-json-ld.tsx +129 -125
- package/templates/nextjs/base/src/components/shared/price-display.tsx +61 -65
- package/templates/nextjs/base/src/lib/resolve-currency.ts +25 -0
- package/templates/nextjs/base/src/lib/use-currency.ts +24 -0
package/dist/index.js
CHANGED
|
@@ -31,7 +31,7 @@ var require_package = __commonJS({
|
|
|
31
31
|
"package.json"(exports2, module2) {
|
|
32
32
|
module2.exports = {
|
|
33
33
|
name: "create-brainerce-store",
|
|
34
|
-
version: "1.
|
|
34
|
+
version: "1.43.0",
|
|
35
35
|
description: "Scaffold a production-ready e-commerce storefront connected to Brainerce",
|
|
36
36
|
bin: {
|
|
37
37
|
"create-brainerce-store": "dist/index.js"
|
package/package.json
CHANGED
|
@@ -73,15 +73,21 @@ if (!name) {
|
|
|
73
73
|
console.error('❌ Store info response has no `name` field:', storeInfo);
|
|
74
74
|
process.exit(1);
|
|
75
75
|
}
|
|
76
|
+
// Currency is NOT NULL in the backend schema — a response without it
|
|
77
|
+
// is a real backend bug, not a "use the default" signal. Fail loud rather
|
|
78
|
+
// than silently leaving the env stale (which would bake the previous
|
|
79
|
+
// value into the next client bundle build).
|
|
80
|
+
if (!currency) {
|
|
81
|
+
console.error('❌ Store info response has no `currency` field:', storeInfo);
|
|
82
|
+
process.exit(1);
|
|
83
|
+
}
|
|
76
84
|
|
|
77
85
|
let updated = envContent;
|
|
78
86
|
updated = setVar(updated, 'NEXT_PUBLIC_STORE_NAME', name);
|
|
79
|
-
|
|
80
|
-
updated = setVar(updated, 'NEXT_PUBLIC_STORE_CURRENCY', currency);
|
|
81
|
-
}
|
|
87
|
+
updated = setVar(updated, 'NEXT_PUBLIC_STORE_CURRENCY', currency);
|
|
82
88
|
|
|
83
89
|
writeFileSync(envPath, updated, 'utf-8');
|
|
84
90
|
|
|
85
91
|
console.log(`✓ NEXT_PUBLIC_STORE_NAME=${name}`);
|
|
86
|
-
|
|
92
|
+
console.log(`✓ NEXT_PUBLIC_STORE_CURRENCY=${currency}`);
|
|
87
93
|
console.log('Done. Restart the dev server for changes to take effect.');
|