create-cartbase 0.1.7 → 0.1.8

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-cartbase",
3
- "version": "0.1.7",
3
+ "version": "0.1.8",
4
4
  "description": "Scaffold a Cartbase storefront: npm create cartbase my-store",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -23,7 +23,13 @@ Everything you need is local:
23
23
 
24
24
  House rules: totals and prices are SERVER truth (render them verbatim);
25
25
  always pass a pricing context; consent before tracking; the store API is
26
- proxied same-origin via next.config rewrites. Part one of the library (the
27
- part you build the store with) is yours to compose freely; part two (the
28
- part that takes the money: cart, checkout, payment) is locked and must be
29
- used, never reimplemented.
26
+ proxied same-origin via next.config rewrites.
27
+
28
+ What you may change: **everything except payments.** Payments are the one
29
+ thing that cannot be ejected. The cart and the checkout are yours to
30
+ shape, and you should rarely need to eject them: both are built to be
31
+ restyled through the theme tokens and their slots, which is the intended
32
+ route and keeps you on our updates. Eject when tokens genuinely are not
33
+ enough, and know what it means, because we say so at the moment you do
34
+ it: that file leaves our support, stops receiving our fixes, and its
35
+ safety is yours from then on.
@@ -23,7 +23,13 @@ Everything you need is local:
23
23
 
24
24
  House rules: totals and prices are SERVER truth (render them verbatim);
25
25
  always pass a pricing context; consent before tracking; the store API is
26
- proxied same-origin via next.config rewrites. Part one of the library (the
27
- part you build the store with) is yours to compose freely; part two (the
28
- part that takes the money: cart, checkout, payment) is locked and must be
29
- used, never reimplemented.
26
+ proxied same-origin via next.config rewrites.
27
+
28
+ What you may change: **everything except payments.** Payments are the one
29
+ thing that cannot be ejected. The cart and the checkout are yours to
30
+ shape, and you should rarely need to eject them: both are built to be
31
+ restyled through the theme tokens and their slots, which is the intended
32
+ route and keeps you on our updates. Eject when tokens genuinely are not
33
+ enough, and know what it means, because we say so at the moment you do
34
+ it: that file leaves our support, stops receiving our fixes, and its
35
+ safety is yours from then on.
@@ -217,7 +217,7 @@ pure UI over the theme tokens.
217
217
  ---
218
218
 
219
219
  ## Family: lib (`@cartbase/storefront/lib/*`)
220
- Pure helpers — no React except `dual-price`, no fetches. The SDK never
220
+ Pure helpers — no React except `price`, no fetches. The SDK never
221
221
  invents server truths: prices/totals arrive computed from the API
222
222
  (`variant.calculated_price`, `cart.total`); these helpers only select and
223
223
  format.
@@ -226,10 +226,11 @@ format.
226
226
  - `lib/money` — `convertToLocale({amount, currency_code, …})` Intl currency
227
227
  formatting (amounts are decimal EUR major units per the store contract);
228
228
  `noDivisionCurrencies`.
229
- - `lib/dual-price` — `<DualPrice amount currencyCode />`: EUR price with the
230
- statutory BGN dual display (1 EUR = 1.95583 лв., Bulgarian dual-display
231
- law through 2026-08); non-EUR currencies render single. Also exports
232
- `EUR_TO_BGN_RATE`.
229
+ - `lib/price` — `<Price amount currencyCode className />`: the amount in its
230
+ own currency, formatted through `convertToLocale`. Every price in the
231
+ library renders through it. It shows ONE currency; a store that wants a
232
+ second one displayed adds it in its own locale layer rather than in
233
+ every price.
233
234
  - `lib/cart-helpers` — `isProductLine` / `isFeeLine` / `productTotal` /
234
235
  `productItemCount` / `findFeeLine` + `COD_FEE_METADATA_KEY`. THE single
235
236
  source of truth for hiding the backend-injected COD-fee line in cart
@@ -412,7 +413,7 @@ code-first through the error-copy maps, never raw API strings.
412
413
  `fields.billingDetails.address` override — the strict-completeness
413
414
  IntegrationError fix). `PaymentButton` = the Buy button: re-entry-guarded
414
415
  click → `performBuyClick`, cycling processing narration, translated
415
- inline errors, DualPrice total.
416
+ inline errors, Price total.
416
417
  - **SDK calls** — renders `checkout.listPaymentProviders` results via the
417
418
  hook's `hasCard`/`hasCod`; the click path runs the hook's calls.
418
419
  - **Props contract** — hook state + `buyButtonNotReady(Reason?)`,
@@ -964,7 +965,7 @@ component also takes a `labels` prop pick.
964
965
  ### `<OrderTotals totals currencyCode items? methodFeeLabel? />` — `order/order-totals`
965
966
 
966
967
  - **Purpose** — the money breakdown: Subtotal / Shipping (FREE badge at
967
- 0) / COD fee / Discount (negated) / Tax / Total, all via `DualPrice`.
968
+ 0) / COD fee / Discount (negated) / Tax / Total, all via `Price`.
968
969
  - **Data seam** — `OrderTotalsSource` (the decorated cart satisfies it:
969
970
  `item_subtotal`, `shipping_subtotal`, `discount_total`, `tax_total`,
970
971
  `total`, `payment_method_fee_total`, `payment_method_fee_label`); the summary snapshot adapts
@@ -9,7 +9,7 @@
9
9
  "typecheck": "tsc --noEmit"
10
10
  },
11
11
  "dependencies": {
12
- "@cartbase/storefront": "^0.8.0",
12
+ "@cartbase/storefront": "^0.9.0",
13
13
  "next": "16.2.4",
14
14
  "react": "19.2.4",
15
15
  "react-dom": "19.2.4"