@cimplify/sdk 0.44.12 → 0.44.16

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 (99) hide show
  1. package/dist/advanced.d.mts +1 -1
  2. package/dist/advanced.d.ts +1 -1
  3. package/dist/advanced.js +21 -21
  4. package/dist/advanced.mjs +2 -2
  5. package/dist/{chunk-6TVQQYQ5.mjs → chunk-6AZZ6AOF.mjs} +21 -1
  6. package/dist/{chunk-EZK2FXTM.mjs → chunk-7NML226B.mjs} +1 -1
  7. package/dist/{chunk-BAWKQRIB.js → chunk-CFD4J32N.js} +21 -21
  8. package/dist/{chunk-OMAP327U.js → chunk-MBGQP6FZ.js} +62 -61
  9. package/dist/{chunk-V2O5AO7I.js → chunk-MNIKXG7W.js} +26 -0
  10. package/dist/{chunk-3WD6U5RD.mjs → chunk-UXLQ7WXI.mjs} +4 -3
  11. package/dist/chunk-XL4CX75J.js +9370 -0
  12. package/dist/chunk-ZLEFMQC6.mjs +9318 -0
  13. package/dist/cli/commands/deploy.mjs +9 -1
  14. package/dist/{client-lvLvB1_K.d.ts → client-D6ZisKco.d.ts} +7 -0
  15. package/dist/{client-CkGlXZRd.d.mts → client-Dh-bHyhU.d.mts} +7 -0
  16. package/dist/index.d.mts +1 -1
  17. package/dist/index.d.ts +1 -1
  18. package/dist/index.js +106 -106
  19. package/dist/index.mjs +3 -3
  20. package/dist/mock/cli.mjs +172 -23
  21. package/dist/mock/library.d.mts +2 -2
  22. package/dist/mock/library.d.ts +2 -2
  23. package/dist/mock/library.js +172 -23
  24. package/dist/mock/library.mjs +172 -23
  25. package/dist/mock/msw.d.mts +1 -1
  26. package/dist/mock/msw.d.ts +1 -1
  27. package/dist/mock/msw.js +172 -23
  28. package/dist/mock/msw.mjs +172 -23
  29. package/dist/react.d.mts +1 -1
  30. package/dist/react.d.ts +1 -1
  31. package/dist/react.js +80 -80
  32. package/dist/react.mjs +3 -3
  33. package/dist/server-CWpUlLOQ.d.mts +1003 -0
  34. package/dist/server-CWpUlLOQ.d.ts +1003 -0
  35. package/dist/{server-CUbuQxOV.d.ts → server-CnECAQDQ.d.mts} +28 -6
  36. package/dist/{server-CUbuQxOV.d.mts → server-CnECAQDQ.d.ts} +28 -6
  37. package/dist/server.d.mts +2 -2
  38. package/dist/server.d.ts +2 -2
  39. package/dist/server.js +5 -5
  40. package/dist/server.mjs +3 -3
  41. package/dist/testing/suite.d.mts +60 -0
  42. package/dist/testing/suite.d.ts +60 -0
  43. package/dist/testing/suite.js +169 -0
  44. package/dist/testing/suite.mjs +165 -0
  45. package/dist/testing.d.mts +1359 -0
  46. package/dist/testing.d.ts +1359 -0
  47. package/dist/testing.js +213 -0
  48. package/dist/testing.mjs +4 -0
  49. package/dist/utils.js +28 -28
  50. package/dist/utils.mjs +1 -1
  51. package/package.json +18 -3
  52. package/registry/account.json +15 -0
  53. package/registry/billing-plan-selector.json +16 -0
  54. package/registry/cart-drawer.json +17 -0
  55. package/registry/currency-selector.json +15 -0
  56. package/registry/customer-input-fields.json +15 -0
  57. package/registry/delivery-estimate.json +16 -0
  58. package/registry/index.json +105 -0
  59. package/registry/location-picker.json +15 -0
  60. package/registry/recently-viewed.json +16 -0
  61. package/registry/recommendation-carousel.json +16 -0
  62. package/registry/resource-picker.json +15 -0
  63. package/registry/session-message-banner.json +15 -0
  64. package/templates/storefront-bakery/AGENTS.md +12 -0
  65. package/templates/storefront-bakery/__tests__/brand.test.ts +4 -0
  66. package/templates/storefront-bakery/__tests__/cart-flow.test.ts +4 -0
  67. package/templates/storefront-bakery/__tests__/contract.test.ts +4 -0
  68. package/templates/storefront-bakery/package.json +11 -3
  69. package/templates/storefront-bakery/vitest.config.ts +9 -0
  70. package/templates/storefront-fashion/AGENTS.md +21 -1
  71. package/templates/storefront-fashion/__tests__/brand.test.ts +4 -0
  72. package/templates/storefront-fashion/__tests__/cart-flow.test.ts +4 -0
  73. package/templates/storefront-fashion/__tests__/contract.test.ts +4 -0
  74. package/templates/storefront-fashion/package.json +11 -3
  75. package/templates/storefront-fashion/vitest.config.ts +9 -0
  76. package/templates/storefront-grocery/AGENTS.md +12 -0
  77. package/templates/storefront-grocery/__tests__/brand.test.ts +4 -0
  78. package/templates/storefront-grocery/__tests__/cart-flow.test.ts +4 -0
  79. package/templates/storefront-grocery/__tests__/contract.test.ts +4 -0
  80. package/templates/storefront-grocery/package.json +11 -3
  81. package/templates/storefront-grocery/vitest.config.ts +9 -0
  82. package/templates/storefront-restaurant/AGENTS.md +12 -0
  83. package/templates/storefront-restaurant/__tests__/brand.test.ts +4 -0
  84. package/templates/storefront-restaurant/__tests__/cart-flow.test.ts +4 -0
  85. package/templates/storefront-restaurant/__tests__/contract.test.ts +4 -0
  86. package/templates/storefront-restaurant/package.json +11 -3
  87. package/templates/storefront-restaurant/vitest.config.ts +9 -0
  88. package/templates/storefront-retail/AGENTS.md +12 -0
  89. package/templates/storefront-retail/__tests__/brand.test.ts +4 -0
  90. package/templates/storefront-retail/__tests__/cart-flow.test.ts +4 -0
  91. package/templates/storefront-retail/__tests__/contract.test.ts +4 -0
  92. package/templates/storefront-retail/package.json +11 -3
  93. package/templates/storefront-retail/vitest.config.ts +9 -0
  94. package/templates/storefront-services/AGENTS.md +12 -0
  95. package/templates/storefront-services/__tests__/brand.test.ts +4 -0
  96. package/templates/storefront-services/__tests__/cart-flow.test.ts +4 -0
  97. package/templates/storefront-services/__tests__/contract.test.ts +4 -0
  98. package/templates/storefront-services/package.json +11 -3
  99. package/templates/storefront-services/vitest.config.ts +9 -0
@@ -0,0 +1,4 @@
1
+ import { createBrandSuite } from "@cimplify/sdk/testing/suite";
2
+ import { brand } from "../lib/brand";
3
+
4
+ createBrandSuite({ brand });
@@ -0,0 +1,4 @@
1
+ import { createCartFlowSuite } from "@cimplify/sdk/testing/suite";
2
+ import { brand } from "../lib/brand";
3
+
4
+ createCartFlowSuite({ seed: brand.mock.seed, businessId: brand.mock.businessId });
@@ -0,0 +1,4 @@
1
+ import { createContractSuite } from "@cimplify/sdk/testing/suite";
2
+ import { brand } from "../lib/brand";
3
+
4
+ createContractSuite({ seed: brand.mock.seed });
@@ -8,10 +8,17 @@
8
8
  "dev:mock": "bunx @cimplify/sdk --seed restaurant",
9
9
  "build": "next build",
10
10
  "start": "next start",
11
- "lint": "next lint"
11
+ "lint": "next lint",
12
+ "typecheck": "tsc --noEmit",
13
+ "test": "vitest",
14
+ "test:run": "vitest run",
15
+ "check:brand": "vitest run __tests__/brand.test.ts",
16
+ "check:cart": "vitest run __tests__/cart-flow.test.ts",
17
+ "check:contract": "vitest run __tests__/contract.test.ts",
18
+ "check": "bun run typecheck && bun run lint && bun run test:run"
12
19
  },
13
20
  "dependencies": {
14
- "@cimplify/sdk": "^0.44.4",
21
+ "@cimplify/sdk": "^0.44.14",
15
22
  "next": "^16.2.4",
16
23
  "react": "^19.0.0",
17
24
  "react-dom": "^19.0.0"
@@ -23,6 +30,7 @@
23
30
  "@types/react-dom": "^19.0.0",
24
31
  "concurrently": "^9.0.0",
25
32
  "tailwindcss": "^4.2.4",
26
- "typescript": "^5.9.3"
33
+ "typescript": "^5.9.3",
34
+ "vitest": "^4.1.5"
27
35
  }
28
36
  }
@@ -0,0 +1,9 @@
1
+ import { defineConfig } from "vitest/config";
2
+
3
+ export default defineConfig({
4
+ test: {
5
+ environment: "node",
6
+ include: ["__tests__/**/*.test.ts"],
7
+ globals: false,
8
+ },
9
+ });
@@ -95,6 +95,18 @@ app/
95
95
 
96
96
  Wired to `--seed retail` (Currents Electronics). Edit `dev:mock` in `package.json` to preview another seed.
97
97
 
98
+ ## Customizing SDK components
99
+
100
+ For anything beyond `lib/brand.ts` + `app/globals.css`, lean on the SDK's prebuilt components rather than reinvent. **Especially for product customization** (variants, add-ons, bundles, composites, services with scheduling) — the SDK already gets price math, axis matching, and cart payload contracts right. Default to ejecting and restyling:
101
+
102
+ ```bash
103
+ bunx @cimplify/sdk add cart-drawer
104
+ bunx @cimplify/sdk add variant-selector
105
+ bunx @cimplify/sdk add product-page
106
+ ```
107
+
108
+ Then edit the local copy. **Don't change the cart payload shape** unless you're also touching the SDK mock + backend lens. Full ejection rules and the customizer contract are in the SDK-level [`AGENTS.md`](../../AGENTS.md) → "Don't reinvent product customization".
109
+
98
110
  ## Quick start
99
111
 
100
112
  ```bash
@@ -0,0 +1,4 @@
1
+ import { createBrandSuite } from "@cimplify/sdk/testing/suite";
2
+ import { brand } from "../lib/brand";
3
+
4
+ createBrandSuite({ brand });
@@ -0,0 +1,4 @@
1
+ import { createCartFlowSuite } from "@cimplify/sdk/testing/suite";
2
+ import { brand } from "../lib/brand";
3
+
4
+ createCartFlowSuite({ seed: brand.mock.seed, businessId: brand.mock.businessId });
@@ -0,0 +1,4 @@
1
+ import { createContractSuite } from "@cimplify/sdk/testing/suite";
2
+ import { brand } from "../lib/brand";
3
+
4
+ createContractSuite({ seed: brand.mock.seed });
@@ -8,10 +8,17 @@
8
8
  "dev:mock": "bunx @cimplify/sdk --seed retail",
9
9
  "build": "next build",
10
10
  "start": "next start",
11
- "lint": "next lint"
11
+ "lint": "next lint",
12
+ "typecheck": "tsc --noEmit",
13
+ "test": "vitest",
14
+ "test:run": "vitest run",
15
+ "check:brand": "vitest run __tests__/brand.test.ts",
16
+ "check:cart": "vitest run __tests__/cart-flow.test.ts",
17
+ "check:contract": "vitest run __tests__/contract.test.ts",
18
+ "check": "bun run typecheck && bun run lint && bun run test:run"
12
19
  },
13
20
  "dependencies": {
14
- "@cimplify/sdk": "^0.44.4",
21
+ "@cimplify/sdk": "^0.44.14",
15
22
  "next": "^16.2.4",
16
23
  "react": "^19.0.0",
17
24
  "react-dom": "^19.0.0"
@@ -23,6 +30,7 @@
23
30
  "@types/react-dom": "^19.0.0",
24
31
  "concurrently": "^9.0.0",
25
32
  "tailwindcss": "^4.2.4",
26
- "typescript": "^5.9.3"
33
+ "typescript": "^5.9.3",
34
+ "vitest": "^4.1.5"
27
35
  }
28
36
  }
@@ -0,0 +1,9 @@
1
+ import { defineConfig } from "vitest/config";
2
+
3
+ export default defineConfig({
4
+ test: {
5
+ environment: "node",
6
+ include: ["__tests__/**/*.test.ts"],
7
+ globals: false,
8
+ },
9
+ });
@@ -79,6 +79,18 @@ app/
79
79
  - `/book` widget shows every slot as available. For production, wire `useAvailableSlots({ serviceId, date })` from `@cimplify/sdk/react` to filter to genuinely-free windows.
80
80
  - Contact + newsletter fake submits.
81
81
 
82
+ ## Customizing SDK components
83
+
84
+ For anything beyond `lib/brand.ts` + `app/globals.css`, lean on the SDK's prebuilt components rather than reinvent. **Especially for service scheduling, booking widgets, and add-on selectors** — the SDK already gets price math, slot matching, and cart payload contracts right. Default to ejecting and restyling:
85
+
86
+ ```bash
87
+ bunx @cimplify/sdk add cart-drawer
88
+ bunx @cimplify/sdk add product-page
89
+ bunx @cimplify/sdk add booking-card
90
+ ```
91
+
92
+ Then edit the local copy. **Don't change the cart payload shape** (`scheduled_start`, `scheduled_end`, `staff_id`, `customer_inputs`, etc.) unless you're also touching the SDK mock + backend lens. Full ejection rules and the customizer contract are in the SDK-level [`AGENTS.md`](../../AGENTS.md) → "Don't reinvent product customization".
93
+
82
94
  ## Quick start
83
95
 
84
96
  ```bash
@@ -0,0 +1,4 @@
1
+ import { createBrandSuite } from "@cimplify/sdk/testing/suite";
2
+ import { brand } from "../lib/brand";
3
+
4
+ createBrandSuite({ brand });
@@ -0,0 +1,4 @@
1
+ import { createCartFlowSuite } from "@cimplify/sdk/testing/suite";
2
+ import { brand } from "../lib/brand";
3
+
4
+ createCartFlowSuite({ seed: brand.mock.seed, businessId: brand.mock.businessId });
@@ -0,0 +1,4 @@
1
+ import { createContractSuite } from "@cimplify/sdk/testing/suite";
2
+ import { brand } from "../lib/brand";
3
+
4
+ createContractSuite({ seed: brand.mock.seed });
@@ -8,10 +8,17 @@
8
8
  "dev:mock": "bunx @cimplify/sdk --seed services",
9
9
  "build": "next build",
10
10
  "start": "next start",
11
- "lint": "next lint"
11
+ "lint": "next lint",
12
+ "typecheck": "tsc --noEmit",
13
+ "test": "vitest",
14
+ "test:run": "vitest run",
15
+ "check:brand": "vitest run __tests__/brand.test.ts",
16
+ "check:cart": "vitest run __tests__/cart-flow.test.ts",
17
+ "check:contract": "vitest run __tests__/contract.test.ts",
18
+ "check": "bun run typecheck && bun run lint && bun run test:run"
12
19
  },
13
20
  "dependencies": {
14
- "@cimplify/sdk": "^0.44.4",
21
+ "@cimplify/sdk": "^0.44.14",
15
22
  "next": "^16.2.4",
16
23
  "react": "^19.0.0",
17
24
  "react-dom": "^19.0.0"
@@ -23,6 +30,7 @@
23
30
  "@types/react-dom": "^19.0.0",
24
31
  "concurrently": "^9.0.0",
25
32
  "tailwindcss": "^4.2.4",
26
- "typescript": "^5.9.3"
33
+ "typescript": "^5.9.3",
34
+ "vitest": "^4.1.5"
27
35
  }
28
36
  }
@@ -0,0 +1,9 @@
1
+ import { defineConfig } from "vitest/config";
2
+
3
+ export default defineConfig({
4
+ test: {
5
+ environment: "node",
6
+ include: ["__tests__/**/*.test.ts"],
7
+ globals: false,
8
+ },
9
+ });