@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.
- package/dist/{add-UZRM3FSU.mjs → add-6KEKFXOW.mjs} +1 -1
- package/dist/{assets-EBEMMENZ.mjs → assets-74SK63TR.mjs} +73 -24
- package/dist/chunk-DEWCHGWU.mjs +5707 -0
- package/dist/{chunk-A2L5IV57.mjs → chunk-JLSDFVML.mjs} +1 -1
- package/dist/{chunk-E7P6GL73.mjs → chunk-OSS47KZP.mjs} +2 -2
- package/dist/dispatcher.mjs +10 -10
- package/dist/{doctor-Q6DWYG4D.mjs → doctor-WL25JRS3.mjs} +2 -2
- package/dist/{explain-RA3PQCUF.mjs → explain-NY5A533M.mjs} +8 -1
- package/dist/{introspect-HKNLBZ73.mjs → introspect-J7GVKQK7.mjs} +2 -2
- package/dist/{list-U67HVMX5.mjs → list-FXOFYX4H.mjs} +1 -1
- package/dist/{update-UT46Z6X4.mjs → update-WNZKECFJ.mjs} +1 -1
- package/package.json +2 -2
- package/templates/storefront-auto/app/api/revalidate/route.ts +5 -0
- package/templates/storefront-auto/app/products/[slug]/page.tsx +8 -3
- package/templates/storefront-auto/bun.lock +10 -681
- package/templates/storefront-auto/package.json +1 -1
- package/templates/storefront-bakery/app/api/revalidate/route.ts +5 -0
- package/templates/storefront-bakery/bun.lock +10 -681
- package/templates/storefront-bakery/package.json +1 -1
- package/templates/storefront-fashion/app/api/revalidate/route.ts +5 -0
- package/templates/storefront-fashion/app/products/[slug]/page.tsx +8 -3
- package/templates/storefront-fashion/bun.lock +12 -683
- package/templates/storefront-fashion/package.json +1 -1
- package/templates/storefront-grocery/app/api/revalidate/route.ts +5 -0
- package/templates/storefront-grocery/bun.lock +10 -681
- package/templates/storefront-grocery/package.json +1 -1
- package/templates/storefront-pharmacy/app/api/revalidate/route.ts +5 -0
- package/templates/storefront-pharmacy/app/products/[slug]/page.tsx +8 -3
- package/templates/storefront-pharmacy/bun.lock +10 -681
- package/templates/storefront-pharmacy/package.json +1 -1
- package/templates/storefront-restaurant/app/api/revalidate/route.ts +5 -0
- package/templates/storefront-restaurant/bun.lock +10 -681
- package/templates/storefront-restaurant/package.json +1 -1
- package/templates/storefront-retail/app/api/revalidate/route.ts +5 -0
- package/templates/storefront-retail/app/products/[slug]/page.tsx +8 -3
- package/templates/storefront-retail/bun.lock +10 -681
- package/templates/storefront-retail/package.json +1 -1
- package/templates/storefront-services/app/api/revalidate/route.ts +5 -0
- package/templates/storefront-services/bun.lock +10 -681
- package/templates/storefront-services/package.json +1 -1
- package/dist/chunk-VOQJ7GYE.mjs +0 -5707
|
@@ -43,12 +43,17 @@ interface ProductData {
|
|
|
43
43
|
|
|
44
44
|
async function getProduct(slug: string): Promise<ProductData | null> {
|
|
45
45
|
"use cache";
|
|
46
|
-
|
|
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)
|
|
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
|