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
package/template/app/AGENTS.md
CHANGED
|
@@ -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.
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
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.
|
package/template/app/CLAUDE.md
CHANGED
|
@@ -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.
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
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 `
|
|
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/
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
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,
|
|
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 `
|
|
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
|