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.
Files changed (22) hide show
  1. package/dist/index.js +1 -1
  2. package/package.json +1 -1
  3. package/templates/nextjs/base/scripts/fetch-store-info.mjs +10 -4
  4. package/templates/nextjs/base/src/app/checkout/page.tsx +982 -981
  5. package/templates/nextjs/base/src/app/products/[slug]/page.tsx +118 -117
  6. package/templates/nextjs/base/src/components/account/order-history.tsx +368 -367
  7. package/templates/nextjs/base/src/components/cart/cart-bundle-offer.tsx +111 -112
  8. package/templates/nextjs/base/src/components/cart/cart-item.tsx +152 -153
  9. package/templates/nextjs/base/src/components/cart/cart-summary.tsx +108 -108
  10. package/templates/nextjs/base/src/components/cart/cart-upgrade-banner.tsx +141 -142
  11. package/templates/nextjs/base/src/components/cart/free-shipping-bar.tsx +62 -59
  12. package/templates/nextjs/base/src/components/checkout/order-bump-card.tsx +242 -243
  13. package/templates/nextjs/base/src/components/checkout/pickup-step.tsx +198 -199
  14. package/templates/nextjs/base/src/components/checkout/shipping-step.tsx +109 -110
  15. package/templates/nextjs/base/src/components/checkout/tax-display.tsx +64 -65
  16. package/templates/nextjs/base/src/components/products/frequently-bought-together.tsx +203 -202
  17. package/templates/nextjs/base/src/components/products/product-card.tsx +226 -226
  18. package/templates/nextjs/base/src/components/products/variant-selector.tsx +291 -292
  19. package/templates/nextjs/base/src/components/seo/product-json-ld.tsx +129 -125
  20. package/templates/nextjs/base/src/components/shared/price-display.tsx +61 -65
  21. package/templates/nextjs/base/src/lib/resolve-currency.ts +25 -0
  22. 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.42.0",
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-brainerce-store",
3
- "version": "1.42.0",
3
+ "version": "1.43.0",
4
4
  "description": "Scaffold a production-ready e-commerce storefront connected to Brainerce",
5
5
  "bin": {
6
6
  "create-brainerce-store": "dist/index.js"
@@ -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
- if (currency) {
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
- if (currency) console.log(`✓ NEXT_PUBLIC_STORE_CURRENCY=${currency}`);
92
+ console.log(`✓ NEXT_PUBLIC_STORE_CURRENCY=${currency}`);
87
93
  console.log('Done. Restart the dev server for changes to take effect.');