next-sanity 13.0.0 → 13.0.1
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.
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use server";
|
|
2
2
|
import { t as parseTags } from "../../parseTags.js";
|
|
3
3
|
import { draftMode } from "next/headers";
|
|
4
|
-
import {
|
|
4
|
+
import { revalidateTag, updateTag } from "next/cache";
|
|
5
5
|
/**
|
|
6
6
|
* @internal CAUTION: this is an internal action and does not follow semver. Using it directly is at your own risk.
|
|
7
7
|
*/
|
|
8
8
|
async function revalidateSyncTagsAction(unsafeTags) {
|
|
9
9
|
if ((await draftMode()).isEnabled) {
|
|
10
|
-
console.warn(`<SanityLive /> action called in draft mode, cache is bypassed in draft mode so the refresh() function is called instead of revalidating tags`);
|
|
11
|
-
return refresh
|
|
10
|
+
console.warn(`<SanityLive /> action called in draft mode, cache is bypassed in draft mode so the router.refresh() function is called instead of revalidating tags`);
|
|
11
|
+
return "refresh";
|
|
12
12
|
}
|
|
13
13
|
const { tags } = parseTags(unsafeTags);
|
|
14
14
|
if (process.env.NODE_ENV === "development") {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../src/live/server-actions/index.ts"],"sourcesContent":["'use server'\n\nimport {
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../src/live/server-actions/index.ts"],"sourcesContent":["'use server'\n\nimport {revalidateTag, updateTag} from 'next/cache'\nimport {draftMode} from 'next/headers'\n\nimport {parseTags} from '#live/parseTags'\n\n/**\n * @internal CAUTION: this is an internal action and does not follow semver. Using it directly is at your own risk.\n */\nexport async function revalidateSyncTagsAction(unsafeTags: unknown): Promise<void | 'refresh'> {\n if ((await draftMode()).isEnabled) {\n console.warn(\n `<SanityLive /> action called in draft mode, cache is bypassed in draft mode so the router.refresh() function is called instead of revalidating tags`,\n )\n return 'refresh'\n }\n\n const {tags} = parseTags(unsafeTags)\n\n if (process.env.NODE_ENV === 'development') {\n for (const tag of tags) {\n updateTag(tag)\n }\n // oxlint-disable-next-line no-console\n console.log(\n `<SanityLive /> action called in dev mode, updated tags: ${tags.join(', ')}. In production revalidateTag(tag, 'max') will be used instead of updateTag(tag)`,\n )\n return undefined\n }\n\n for (const tag of tags) {\n revalidateTag(tag, 'max')\n }\n // oxlint-disable-next-line no-console\n console.log(`<SanityLive /> revalidated tags: ${tags.join(', ')} with cache profile \"max\" `)\n return 'refresh'\n}\n"],"mappings":";;;;;;;AAUA,eAAsB,yBAAyB,YAAgD;AAC7F,MAAK,MAAM,WAAW,EAAE,WAAW;AACjC,UAAQ,KACN,sJACD;AACD,SAAO;;CAGT,MAAM,EAAC,SAAQ,UAAU,WAAW;AAEpC,KAAI,QAAQ,IAAI,aAAa,eAAe;AAC1C,OAAK,MAAM,OAAO,KAChB,WAAU,IAAI;AAGhB,UAAQ,IACN,2DAA2D,KAAK,KAAK,KAAK,CAAC,kFAC5E;AACD;;AAGF,MAAK,MAAM,OAAO,KAChB,eAAc,KAAK,MAAM;AAG3B,SAAQ,IAAI,oCAAoC,KAAK,KAAK,KAAK,CAAC,4BAA4B;AAC5F,QAAO"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "next-sanity",
|
|
3
|
-
"version": "13.0.
|
|
3
|
+
"version": "13.0.1",
|
|
4
4
|
"description": "Sanity.io toolkit for Next.js",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"live",
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
"@vitest/coverage-v8": "^4.1.7",
|
|
80
80
|
"js-yaml": "^4.1.1",
|
|
81
81
|
"msw": "^2.14.6",
|
|
82
|
-
"next": "16.3.0-canary.
|
|
82
|
+
"next": "16.3.0-canary.25",
|
|
83
83
|
"publint": "^0.3.21",
|
|
84
84
|
"react": "^19.2.6",
|
|
85
85
|
"react-dom": "^19.2.6",
|