@cimplify/cli 0.6.14 → 0.6.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.
- package/dist/{add-6SPMUMSJ.mjs → add-BBVSJ5ZJ.mjs} +1 -1
- package/dist/chunk-F5EGUNQZ.mjs +5707 -0
- package/dist/{chunk-CNIFXKZV.mjs → chunk-GL2J7272.mjs} +1 -1
- package/dist/{chunk-RGF2RSSR.mjs → chunk-KCKMGRII.mjs} +2 -2
- package/dist/dispatcher.mjs +9 -9
- package/dist/{doctor-726TVOXT.mjs → doctor-T6NA3EMW.mjs} +2 -2
- package/dist/{explain-6BWR5MCK.mjs → explain-22NV6OL6.mjs} +2 -2
- package/dist/{introspect-4LD27NVX.mjs → introspect-QOW24PJF.mjs} +2 -2
- package/dist/{list-2YRVKBXY.mjs → list-JHUIIMC2.mjs} +1 -1
- package/dist/{update-J65Z6Q7E.mjs → update-IOMLDQEN.mjs} +1 -1
- package/package.json +2 -2
- package/templates/storefront-auto/app/categories/[slug]/page.tsx +2 -2
- package/templates/storefront-auto/app/collections/[slug]/page.tsx +2 -2
- package/templates/storefront-auto/app/llms.txt/route.ts +2 -2
- package/templates/storefront-auto/app/page.tsx +2 -2
- package/templates/storefront-auto/app/products/[slug]/page.tsx +9 -4
- package/templates/storefront-auto/app/shop/page.tsx +2 -2
- package/templates/storefront-auto/app/sitemap-page/page.tsx +2 -2
- package/templates/storefront-auto/bun.lock +10 -681
- package/templates/storefront-auto/package.json +1 -1
- package/templates/storefront-bakery/app/categories/[slug]/page.tsx +2 -2
- package/templates/storefront-bakery/app/collections/[slug]/page.tsx +2 -2
- package/templates/storefront-bakery/app/llms.txt/route.ts +2 -2
- package/templates/storefront-bakery/app/page.tsx +2 -2
- package/templates/storefront-bakery/app/shop/page.tsx +2 -2
- package/templates/storefront-bakery/app/sitemap-page/page.tsx +2 -2
- package/templates/storefront-bakery/bun.lock +10 -681
- package/templates/storefront-bakery/package.json +1 -1
- package/templates/storefront-fashion/app/categories/[slug]/page.tsx +2 -2
- package/templates/storefront-fashion/app/collections/[slug]/page.tsx +2 -2
- package/templates/storefront-fashion/app/llms.txt/route.ts +2 -2
- package/templates/storefront-fashion/app/page.tsx +2 -2
- package/templates/storefront-fashion/app/products/[slug]/page.tsx +9 -4
- package/templates/storefront-fashion/app/shop/page.tsx +2 -2
- package/templates/storefront-fashion/app/sitemap-page/page.tsx +2 -2
- package/templates/storefront-fashion/bun.lock +12 -683
- package/templates/storefront-fashion/package.json +1 -1
- package/templates/storefront-grocery/app/categories/[slug]/page.tsx +2 -2
- package/templates/storefront-grocery/app/collections/[slug]/page.tsx +2 -2
- package/templates/storefront-grocery/app/llms.txt/route.ts +2 -2
- package/templates/storefront-grocery/app/page.tsx +2 -2
- package/templates/storefront-grocery/app/shop/page.tsx +2 -2
- package/templates/storefront-grocery/app/sitemap-page/page.tsx +2 -2
- package/templates/storefront-grocery/bun.lock +10 -681
- package/templates/storefront-grocery/package.json +1 -1
- package/templates/storefront-pharmacy/app/categories/[slug]/page.tsx +2 -2
- package/templates/storefront-pharmacy/app/collections/[slug]/page.tsx +2 -2
- package/templates/storefront-pharmacy/app/llms.txt/route.ts +2 -2
- package/templates/storefront-pharmacy/app/page.tsx +2 -2
- package/templates/storefront-pharmacy/app/products/[slug]/page.tsx +9 -4
- package/templates/storefront-pharmacy/app/shop/page.tsx +2 -2
- package/templates/storefront-pharmacy/app/sitemap-page/page.tsx +2 -2
- package/templates/storefront-pharmacy/bun.lock +10 -681
- package/templates/storefront-pharmacy/package.json +1 -1
- package/templates/storefront-restaurant/app/categories/[slug]/page.tsx +2 -2
- package/templates/storefront-restaurant/app/collections/[slug]/page.tsx +2 -2
- package/templates/storefront-restaurant/app/llms.txt/route.ts +2 -2
- package/templates/storefront-restaurant/app/page.tsx +2 -2
- package/templates/storefront-restaurant/app/reservations/page.tsx +2 -2
- package/templates/storefront-restaurant/app/shop/page.tsx +2 -2
- package/templates/storefront-restaurant/app/sitemap-page/page.tsx +2 -2
- package/templates/storefront-restaurant/bun.lock +10 -681
- package/templates/storefront-restaurant/package.json +1 -1
- package/templates/storefront-retail/app/categories/[slug]/page.tsx +2 -2
- package/templates/storefront-retail/app/collections/[slug]/page.tsx +2 -2
- package/templates/storefront-retail/app/llms.txt/route.ts +2 -2
- package/templates/storefront-retail/app/page.tsx +2 -2
- package/templates/storefront-retail/app/products/[slug]/page.tsx +9 -4
- package/templates/storefront-retail/app/shop/page.tsx +2 -2
- package/templates/storefront-retail/app/sitemap-page/page.tsx +2 -2
- package/templates/storefront-retail/bun.lock +10 -681
- package/templates/storefront-retail/package.json +1 -1
- package/templates/storefront-services/app/book/page.tsx +2 -2
- package/templates/storefront-services/app/categories/[slug]/page.tsx +2 -2
- package/templates/storefront-services/app/collections/[slug]/page.tsx +2 -2
- package/templates/storefront-services/app/llms.txt/route.ts +2 -2
- package/templates/storefront-services/app/page.tsx +2 -2
- package/templates/storefront-services/app/shop/page.tsx +2 -2
- package/templates/storefront-services/app/sitemap-page/page.tsx +2 -2
- package/templates/storefront-services/bun.lock +10 -681
- package/templates/storefront-services/package.json +1 -1
- package/dist/chunk-RIOQDUQO.mjs +0 -5707
|
@@ -4,7 +4,7 @@ import Link from "next/link";
|
|
|
4
4
|
import { notFound } from "next/navigation";
|
|
5
5
|
import { cacheTag, cacheLife } from "next/cache";
|
|
6
6
|
import {
|
|
7
|
-
getServerClient,
|
|
7
|
+
CACHE_LIFE_DEFAULT, getServerClient,
|
|
8
8
|
tags,
|
|
9
9
|
type Category,
|
|
10
10
|
type Product,
|
|
@@ -20,7 +20,7 @@ interface CategoryData {
|
|
|
20
20
|
async function getCategory(slug: string): Promise<CategoryData | null> {
|
|
21
21
|
"use cache";
|
|
22
22
|
cacheTag(tags.categories());
|
|
23
|
-
cacheLife(
|
|
23
|
+
cacheLife(CACHE_LIFE_DEFAULT);
|
|
24
24
|
|
|
25
25
|
const client = getServerClient();
|
|
26
26
|
const catRes = await client.catalogue.getCategoryBySlug(slug);
|
|
@@ -4,7 +4,7 @@ import Link from "next/link";
|
|
|
4
4
|
import { notFound } from "next/navigation";
|
|
5
5
|
import { cacheTag, cacheLife } from "next/cache";
|
|
6
6
|
import {
|
|
7
|
-
getServerClient,
|
|
7
|
+
CACHE_LIFE_DEFAULT, getServerClient,
|
|
8
8
|
tags,
|
|
9
9
|
type Collection,
|
|
10
10
|
type Product,
|
|
@@ -20,7 +20,7 @@ interface CollectionData {
|
|
|
20
20
|
async function getCollection(slug: string): Promise<CollectionData | null> {
|
|
21
21
|
"use cache";
|
|
22
22
|
cacheTag(tags.collections());
|
|
23
|
-
cacheLife(
|
|
23
|
+
cacheLife(CACHE_LIFE_DEFAULT);
|
|
24
24
|
|
|
25
25
|
const client = getServerClient();
|
|
26
26
|
const colRes = await client.catalogue.getCollectionBySlug(slug);
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { cacheTag, cacheLife } from "next/cache";
|
|
2
|
-
import { getServerClient, tags, type Product } from "@cimplify/sdk/server";
|
|
2
|
+
import { CACHE_LIFE_DEFAULT, getServerClient, tags, type Product } from "@cimplify/sdk/server";
|
|
3
3
|
import { brand } from "@/lib/brand";
|
|
4
4
|
import { getSiteUrl } from "@/lib/site-url";
|
|
5
5
|
|
|
6
6
|
async function buildLlmsTxt(SITE_URL: string): Promise<string> {
|
|
7
7
|
"use cache";
|
|
8
8
|
cacheTag(tags.products(), tags.categories(), tags.collections());
|
|
9
|
-
cacheLife(
|
|
9
|
+
cacheLife(CACHE_LIFE_DEFAULT);
|
|
10
10
|
|
|
11
11
|
const client = getServerClient();
|
|
12
12
|
const [productsRes, categoriesRes, collectionsRes] = await Promise.all([
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Metadata } from "next";
|
|
2
2
|
import { Suspense } from "react";
|
|
3
3
|
import { cacheTag, cacheLife } from "next/cache";
|
|
4
|
-
import { getServerClient, tags, type Product } from "@cimplify/sdk/server";
|
|
4
|
+
import { CACHE_LIFE_DEFAULT, getServerClient, tags, type Product } from "@cimplify/sdk/server";
|
|
5
5
|
import { PharmacyHero } from "@/components/pharmacy-hero";
|
|
6
6
|
import { UrgentCtas } from "@/components/urgent-ctas";
|
|
7
7
|
import { SymptomFinder } from "@/components/symptom-finder";
|
|
@@ -20,7 +20,7 @@ export const metadata: Metadata = {
|
|
|
20
20
|
async function getHomeData() {
|
|
21
21
|
"use cache";
|
|
22
22
|
cacheTag(tags.products());
|
|
23
|
-
cacheLife(
|
|
23
|
+
cacheLife(CACHE_LIFE_DEFAULT);
|
|
24
24
|
|
|
25
25
|
const client = getServerClient();
|
|
26
26
|
const productsRes = await client.catalogue.getProducts({ limit: 12 });
|
|
@@ -4,7 +4,7 @@ import { notFound } from "next/navigation";
|
|
|
4
4
|
import Link from "next/link";
|
|
5
5
|
import { cacheTag, cacheLife } from "next/cache";
|
|
6
6
|
import {
|
|
7
|
-
getServerClient,
|
|
7
|
+
CACHE_LIFE_DEFAULT, getServerClient,
|
|
8
8
|
tags,
|
|
9
9
|
type Product,
|
|
10
10
|
type ProductWithDetails,
|
|
@@ -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(CACHE_LIFE_DEFAULT);
|
|
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
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Metadata } from "next";
|
|
2
2
|
import { Suspense } from "react";
|
|
3
3
|
import { cacheTag, cacheLife } from "next/cache";
|
|
4
|
-
import { getServerClient, tags } from "@cimplify/sdk/server";
|
|
4
|
+
import { CACHE_LIFE_DEFAULT, getServerClient, tags } from "@cimplify/sdk/server";
|
|
5
5
|
import { ShopClient } from "./shop-client";
|
|
6
6
|
import { brand } from "@/lib/brand";
|
|
7
7
|
|
|
@@ -13,7 +13,7 @@ export const metadata: Metadata = {
|
|
|
13
13
|
async function getShopData() {
|
|
14
14
|
"use cache";
|
|
15
15
|
cacheTag(tags.products(), tags.categories());
|
|
16
|
-
cacheLife(
|
|
16
|
+
cacheLife(CACHE_LIFE_DEFAULT);
|
|
17
17
|
|
|
18
18
|
const client = getServerClient();
|
|
19
19
|
const [p, c] = await Promise.all([
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Metadata } from "next";
|
|
2
2
|
import Link from "next/link";
|
|
3
3
|
import { cacheTag, cacheLife } from "next/cache";
|
|
4
|
-
import { getServerClient, tags, type Product } from "@cimplify/sdk/server";
|
|
4
|
+
import { CACHE_LIFE_DEFAULT, getServerClient, tags, type Product } from "@cimplify/sdk/server";
|
|
5
5
|
import { brand } from "@/lib/brand";
|
|
6
6
|
|
|
7
7
|
export const metadata: Metadata = {
|
|
@@ -18,7 +18,7 @@ interface SitemapData {
|
|
|
18
18
|
async function getSitemap(): Promise<SitemapData> {
|
|
19
19
|
"use cache";
|
|
20
20
|
cacheTag(tags.products(), tags.categories(), tags.collections());
|
|
21
|
-
cacheLife(
|
|
21
|
+
cacheLife(CACHE_LIFE_DEFAULT);
|
|
22
22
|
|
|
23
23
|
const client = getServerClient();
|
|
24
24
|
const [pRes, cRes, colRes] = await Promise.all([
|