@se-studio/contentful-rest-api 1.24.0 → 1.25.0

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @se-studio/contentful-rest-api
2
2
 
3
+ ## 1.25.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 8e94be2: Support Next.js 16.3 while remaining compatible with Next.js 15.5 (peer `>=15.5.0 <17`). CMS webhooks call `revalidateTag(tag, { expire: 0 })` so published content is not served stale. Template apps use `proxy.ts` on Next 16. Not-found metadata uses `title.absolute` so layout `title.template` does not produce duplicated site names.
8
+
3
9
  ## 1.24.0
4
10
 
5
11
  ### Minor Changes
@@ -1,4 +1,13 @@
1
1
  import 'server-only';
2
+ /**
3
+ * Immediate cache-tag expiry for Contentful webhooks.
4
+ *
5
+ * Next.js 16 requires a second argument. `'max'` is stale-while-revalidate and
6
+ * would leave published CMS content stale for the next visitor. `{ expire: 0 }`
7
+ * is the documented webhook/third-party path. Next 15.5 ignores the extra
8
+ * argument and keeps the previous immediate behaviour.
9
+ */
10
+ export declare function revalidateCacheTag(tag: string): void;
2
11
  /**
3
12
  * Revalidates multiple Next.js cache tags.
4
13
  *
@@ -1 +1 @@
1
- {"version":3,"file":"server-utils.d.ts","sourceRoot":"","sources":["../../src/revalidation/server-utils.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,CAAC;AAGrB;;;;;;;;GAQG;AACH,wBAAsB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAQlF;AAED;;;;;;;;GAQG;AACH,wBAAsB,mBAAmB,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAIpF"}
1
+ {"version":3,"file":"server-utils.d.ts","sourceRoot":"","sources":["../../src/revalidation/server-utils.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,CAAC;AAGrB;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAEpD;AAED;;;;;;;;GAQG;AACH,wBAAsB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAQlF;AAED;;;;;;;;GAQG;AACH,wBAAsB,mBAAmB,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAIpF"}
@@ -1,5 +1,16 @@
1
1
  import 'server-only';
2
2
  import { revalidateTag } from 'next/cache';
3
+ /**
4
+ * Immediate cache-tag expiry for Contentful webhooks.
5
+ *
6
+ * Next.js 16 requires a second argument. `'max'` is stale-while-revalidate and
7
+ * would leave published CMS content stale for the next visitor. `{ expire: 0 }`
8
+ * is the documented webhook/third-party path. Next 15.5 ignores the extra
9
+ * argument and keeps the previous immediate behaviour.
10
+ */
11
+ export function revalidateCacheTag(tag) {
12
+ revalidateTag(tag, { expire: 0 });
13
+ }
3
14
  /**
4
15
  * Revalidates multiple Next.js cache tags.
5
16
  *
@@ -15,7 +26,7 @@ export async function revalidateTags(tags, reason) {
15
26
  for (const tag of tags) {
16
27
  if (process.env.LOG_CMS)
17
28
  console.log(`Revalidating tag: ${tag} - ${reason}`);
18
- revalidateTag(tag);
29
+ revalidateCacheTag(tag);
19
30
  }
20
31
  }
21
32
  /**
@@ -31,7 +42,7 @@ export async function revalidateSingleTag(tag, reason) {
31
42
  await delay(500);
32
43
  if (process.env.LOG_CMS)
33
44
  console.log(`Revalidating single tag: ${tag} - ${reason}`);
34
- revalidateTag(tag);
45
+ revalidateCacheTag(tag);
35
46
  }
36
47
  /**
37
48
  * Utility delay function
@@ -1 +1 @@
1
- {"version":3,"file":"server-utils.js","sourceRoot":"","sources":["../../src/revalidation/server-utils.ts"],"names":[],"mappings":"AAAA,OAAO,aAA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AAE,MAAc;IACjE,uDAAuD;IACvD,MAAM,KAAK,CAAC,GAAG,CAAC,CAAC;IAEjB,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACvB,IAAI,OAAO,CAAC,GAAG,CAAC,OAAO;YAAE,OAAO,CAAC,GAAG,CAAC,qBAAqB,GAAG,MAAM,MAAM,EAAE,CAAC,CAAC;QAC7E,kBAAkB,CAAC,GAAG,CAAC,CAAC;IAC1B,CAAC;AACH,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAC,GAAW,EAAE,MAAc;IACnE,MAAM,KAAK,CAAC,GAAG,CAAC,CAAC;IACjB,IAAI,OAAO,CAAC,GAAG,CAAC,OAAO;QAAE,OAAO,CAAC,GAAG,CAAC,4BAA4B,GAAG,MAAM,MAAM,EAAE,CAAC,CAAC;IACpF,kBAAkB,CAAC,GAAG,CAAC,CAAC;AAC1B,CAAC;AAED;;;GAGG;AACH,SAAS,KAAK,CAAC,EAAU;IACvB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;AAC3D,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@se-studio/contentful-rest-api",
3
- "version": "1.24.0",
3
+ "version": "1.25.0",
4
4
  "description": "Type-safe Contentful REST API client with caching and rate limiting for Next.js applications",
5
5
  "repository": {
6
6
  "type": "git",
@@ -65,12 +65,12 @@
65
65
  "@se-studio/core-data-types": "1.12.0"
66
66
  },
67
67
  "peerDependencies": {
68
- "next": ">=15.5.0 <16"
68
+ "next": ">=15.5.0 <17"
69
69
  },
70
70
  "devDependencies": {
71
71
  "@biomejs/biome": "^2.5.5",
72
72
  "@types/node": "^24.13.3",
73
- "next": "^15.5.21",
73
+ "next": "^16.3.1",
74
74
  "typescript": "^6.0.3",
75
75
  "vitest": "^4.1.10"
76
76
  },