@spree/next 0.5.0 → 0.6.1

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 (42) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +43 -8
  3. package/dist/actions/cart.d.ts +18 -4
  4. package/dist/actions/cart.js +7 -6
  5. package/dist/actions/cart.js.map +1 -1
  6. package/dist/actions/locale.d.ts +10 -0
  7. package/dist/actions/locale.js +59 -0
  8. package/dist/actions/locale.js.map +1 -0
  9. package/dist/actions/orders.d.ts +2 -2
  10. package/dist/actions/orders.js.map +1 -1
  11. package/dist/data/countries.d.ts +2 -0
  12. package/dist/data/countries.js +26 -8
  13. package/dist/data/countries.js.map +1 -1
  14. package/dist/data/currencies.d.ts +1 -0
  15. package/dist/data/currencies.js +24 -4
  16. package/dist/data/currencies.js.map +1 -1
  17. package/dist/data/locales.d.ts +1 -0
  18. package/dist/data/locales.js +24 -4
  19. package/dist/data/locales.js.map +1 -1
  20. package/dist/data/products.d.ts +5 -2
  21. package/dist/data/products.js +28 -12
  22. package/dist/data/products.js.map +1 -1
  23. package/dist/data/store.d.ts +1 -0
  24. package/dist/data/store.js +24 -4
  25. package/dist/data/store.js.map +1 -1
  26. package/dist/data/taxonomies.d.ts +2 -0
  27. package/dist/data/taxonomies.js +26 -8
  28. package/dist/data/taxonomies.js.map +1 -1
  29. package/dist/data/taxons.d.ts +6 -3
  30. package/dist/data/taxons.js +28 -12
  31. package/dist/data/taxons.js.map +1 -1
  32. package/dist/index.d.ts +31 -8
  33. package/dist/index.js +65 -60
  34. package/dist/index.js.map +1 -1
  35. package/dist/locale.d.ts +12 -0
  36. package/dist/locale.js +52 -0
  37. package/dist/locale.js.map +1 -0
  38. package/dist/middleware.d.ts +26 -0
  39. package/dist/middleware.js +28 -0
  40. package/dist/middleware.js.map +1 -0
  41. package/dist/types.d.ts +8 -0
  42. package/package.json +10 -3
package/dist/types.d.ts CHANGED
@@ -7,16 +7,24 @@ interface SpreeNextConfig {
7
7
  cartCookieName?: string;
8
8
  /** Cookie name for the JWT access token (default: '_spree_jwt') */
9
9
  accessTokenCookieName?: string;
10
+ /** Cookie name for country (default: 'spree_country') */
11
+ countryCookieName?: string;
12
+ /** Cookie name for locale (default: 'spree_locale') */
13
+ localeCookieName?: string;
10
14
  /** Default locale for API requests */
11
15
  defaultLocale?: string;
12
16
  /** Default currency for API requests */
13
17
  defaultCurrency?: string;
18
+ /** Default country ISO code for market resolution */
19
+ defaultCountry?: string;
14
20
  }
15
21
  interface SpreeNextOptions {
16
22
  /** Locale for translated content (e.g., 'en', 'fr') */
17
23
  locale?: string;
18
24
  /** Currency for prices (e.g., 'USD', 'EUR') */
19
25
  currency?: string;
26
+ /** Country ISO code for market resolution (e.g., 'US', 'DE') */
27
+ country?: string;
20
28
  }
21
29
 
22
30
  export type { SpreeNextConfig, SpreeNextOptions };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spree/next",
3
- "version": "0.5.0",
3
+ "version": "0.6.1",
4
4
  "description": "Next.js integration for Spree Commerce — server actions, caching, and cookie-based auth",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -16,6 +16,13 @@
16
16
  "default": "./dist/index.js"
17
17
  },
18
18
  "default": "./dist/index.js"
19
+ },
20
+ "./middleware": {
21
+ "import": {
22
+ "types": "./dist/middleware.d.ts",
23
+ "default": "./dist/middleware.js"
24
+ },
25
+ "default": "./dist/middleware.js"
19
26
  }
20
27
  },
21
28
  "files": [
@@ -23,7 +30,7 @@
23
30
  "README.md"
24
31
  ],
25
32
  "scripts": {
26
- "build": "tsup",
33
+ "build": "rm -rf dist && tsup",
27
34
  "dev": "tsup --watch",
28
35
  "typecheck": "tsc --noEmit",
29
36
  "test": "vitest run",
@@ -55,7 +62,7 @@
55
62
  "url": "https://github.com/spree/spree/issues"
56
63
  },
57
64
  "peerDependencies": {
58
- "@spree/sdk": ">=0.5.0",
65
+ "@spree/sdk": ">=0.6.1",
59
66
  "next": ">=15.0.0",
60
67
  "react": ">=19.0.0"
61
68
  },