@cimplify/cli 0.6.12 → 0.6.15

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 (41) hide show
  1. package/dist/{add-UZRM3FSU.mjs → add-6KEKFXOW.mjs} +1 -1
  2. package/dist/{assets-EBEMMENZ.mjs → assets-74SK63TR.mjs} +73 -24
  3. package/dist/chunk-DEWCHGWU.mjs +5707 -0
  4. package/dist/{chunk-A2L5IV57.mjs → chunk-JLSDFVML.mjs} +1 -1
  5. package/dist/{chunk-E7P6GL73.mjs → chunk-OSS47KZP.mjs} +2 -2
  6. package/dist/dispatcher.mjs +10 -10
  7. package/dist/{doctor-Q6DWYG4D.mjs → doctor-WL25JRS3.mjs} +2 -2
  8. package/dist/{explain-RA3PQCUF.mjs → explain-NY5A533M.mjs} +8 -1
  9. package/dist/{introspect-HKNLBZ73.mjs → introspect-J7GVKQK7.mjs} +2 -2
  10. package/dist/{list-U67HVMX5.mjs → list-FXOFYX4H.mjs} +1 -1
  11. package/dist/{update-UT46Z6X4.mjs → update-WNZKECFJ.mjs} +1 -1
  12. package/package.json +2 -2
  13. package/templates/storefront-auto/app/api/revalidate/route.ts +5 -0
  14. package/templates/storefront-auto/app/products/[slug]/page.tsx +8 -3
  15. package/templates/storefront-auto/bun.lock +10 -681
  16. package/templates/storefront-auto/package.json +1 -1
  17. package/templates/storefront-bakery/app/api/revalidate/route.ts +5 -0
  18. package/templates/storefront-bakery/bun.lock +10 -681
  19. package/templates/storefront-bakery/package.json +1 -1
  20. package/templates/storefront-fashion/app/api/revalidate/route.ts +5 -0
  21. package/templates/storefront-fashion/app/products/[slug]/page.tsx +8 -3
  22. package/templates/storefront-fashion/bun.lock +12 -683
  23. package/templates/storefront-fashion/package.json +1 -1
  24. package/templates/storefront-grocery/app/api/revalidate/route.ts +5 -0
  25. package/templates/storefront-grocery/bun.lock +10 -681
  26. package/templates/storefront-grocery/package.json +1 -1
  27. package/templates/storefront-pharmacy/app/api/revalidate/route.ts +5 -0
  28. package/templates/storefront-pharmacy/app/products/[slug]/page.tsx +8 -3
  29. package/templates/storefront-pharmacy/bun.lock +10 -681
  30. package/templates/storefront-pharmacy/package.json +1 -1
  31. package/templates/storefront-restaurant/app/api/revalidate/route.ts +5 -0
  32. package/templates/storefront-restaurant/bun.lock +10 -681
  33. package/templates/storefront-restaurant/package.json +1 -1
  34. package/templates/storefront-retail/app/api/revalidate/route.ts +5 -0
  35. package/templates/storefront-retail/app/products/[slug]/page.tsx +8 -3
  36. package/templates/storefront-retail/bun.lock +10 -681
  37. package/templates/storefront-retail/package.json +1 -1
  38. package/templates/storefront-services/app/api/revalidate/route.ts +5 -0
  39. package/templates/storefront-services/bun.lock +10 -681
  40. package/templates/storefront-services/package.json +1 -1
  41. package/dist/chunk-VOQJ7GYE.mjs +0 -5707
@@ -17,7 +17,7 @@
17
17
  "check": "bun run typecheck && bun run test:run"
18
18
  },
19
19
  "dependencies": {
20
- "@cimplify/sdk": "^0.48.2",
20
+ "@cimplify/sdk": "^0.49.1",
21
21
  "next": "^16.2.6",
22
22
  "react": "^19.0.0",
23
23
  "react-dom": "^19.0.0"
@@ -0,0 +1,5 @@
1
+ import { revalidateRouteHandler } from "@cimplify/sdk/server";
2
+
3
+ export async function POST(req: Request): Promise<Response> {
4
+ return revalidateRouteHandler(req);
5
+ }
@@ -43,12 +43,17 @@ interface ProductData {
43
43
 
44
44
  async function getProduct(slug: string): Promise<ProductData | null> {
45
45
  "use cache";
46
- cacheTag(tags.product(slug), tags.products());
47
- cacheLife("hours");
46
+ cacheLife("max");
48
47
 
49
48
  const client = getServerClient();
50
49
  const r = await client.catalogue.getProductBySlug(slug);
51
- if (!r.ok) return null;
50
+ if (!r.ok) {
51
+ cacheTag(tags.products());
52
+ return null;
53
+ }
54
+ // Tag with the resolved ID — Cimplify dispatches tags.product(id), not slug.
55
+ // See https://cimplify.dev/docs/sdk/revalidation#dynamic-routes--tag-by-id-never-by-slug
56
+ cacheTag(tags.product(r.value.id), tags.products());
52
57
 
53
58
  const related = r.value.category_id
54
59
  ? await client.catalogue