@nuxtjs/sitemap 8.0.9 → 8.0.12
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/content.mjs +30 -2
- package/dist/devtools/200.html +1 -1
- package/dist/devtools/404.html +1 -1
- package/dist/devtools/_nuxt/-aUy0TC4.js +154 -0
- package/dist/devtools/_nuxt/BFIcOmri.js +1 -0
- package/dist/devtools/_nuxt/{D-UTvDIa.js → BGX4BIlp.js} +1 -1
- package/dist/devtools/_nuxt/Bi9TcosG.js +23 -0
- package/dist/devtools/_nuxt/{PuCOIcxk.js → CXQtxZOi.js} +1 -1
- package/dist/devtools/_nuxt/Cax5AHW4.js +1 -0
- package/dist/devtools/_nuxt/D5_CWcJg.js +1 -0
- package/dist/devtools/_nuxt/DC1C2xmT.js +3 -0
- package/dist/devtools/_nuxt/DRr-E6D6.js +1 -0
- package/dist/devtools/_nuxt/{DR46qabg.js → DVdDkikE.js} +1 -1
- package/dist/devtools/_nuxt/DevtoolsAlert.Cc1j0rFh.css +1 -0
- package/dist/devtools/_nuxt/DevtoolsEmptyState.C_JszSPw.css +1 -0
- package/dist/devtools/_nuxt/DevtoolsSnippet.BMHEZhbx.css +1 -0
- package/dist/devtools/_nuxt/Dn-g3ZEt.js +6 -0
- package/dist/devtools/_nuxt/QPjoaMYX.js +1 -0
- package/dist/devtools/_nuxt/{Source.BcF6xQwF.css → Source.C8X9kLw1.css} +1 -1
- package/dist/devtools/_nuxt/ZIb9ujn-.js +1 -0
- package/dist/devtools/_nuxt/builds/latest.json +1 -1
- package/dist/devtools/_nuxt/builds/meta/61a2dc5e-e379-4bcd-a2a4-fe6a8a2bf7ae.json +1 -0
- package/dist/devtools/_nuxt/entry.W5GE0Meb.css +2 -0
- package/dist/devtools/_nuxt/pages.RvpSKGhd.css +1 -0
- package/dist/devtools/_nuxt/shiki.C9dc3IDa.css +1 -0
- package/dist/devtools/_nuxt/{Cut3vIGD.js → vh1cNZ6L.js} +1 -1
- package/dist/devtools/app-sources/index.html +1 -1
- package/dist/devtools/debug/index.html +1 -1
- package/dist/devtools/docs/index.html +1 -1
- package/dist/devtools/index.html +1 -1
- package/dist/devtools/user-sources/index.html +1 -1
- package/dist/module.json +1 -1
- package/dist/module.mjs +7 -9
- package/package.json +15 -15
- package/dist/devtools/_nuxt/BGdXPJA8.js +0 -154
- package/dist/devtools/_nuxt/Brri76xk.js +0 -23
- package/dist/devtools/_nuxt/C3JdQOO8.js +0 -1
- package/dist/devtools/_nuxt/CIN7gmGG.js +0 -6
- package/dist/devtools/_nuxt/CSlSVEd2.js +0 -1
- package/dist/devtools/_nuxt/CmDrQj9k.js +0 -3
- package/dist/devtools/_nuxt/CuHrjcYl.js +0 -1
- package/dist/devtools/_nuxt/DevtoolsEmptyState.CcbXJO4n.css +0 -1
- package/dist/devtools/_nuxt/DevtoolsSnippet.CbDLE91n.css +0 -1
- package/dist/devtools/_nuxt/Dpv--hsK.js +0 -1
- package/dist/devtools/_nuxt/builds/meta/f363f11d-47da-46fc-9bf1-bcc9e45c10df.json +0 -1
- package/dist/devtools/_nuxt/entry.BOoaiYxv.css +0 -2
- package/dist/devtools/_nuxt/pages.C_cPkFex.css +0 -1
- package/dist/devtools/_nuxt/shiki.DvoA-JTs.css +0 -1
- /package/dist/devtools/_nuxt/{1yQIC0dC.js → C5jzcy9i.js} +0 -0
- /package/dist/devtools/_nuxt/{DCQDLH1H.js → CCTv7mmB.js} +0 -0
- /package/dist/devtools/_nuxt/{DOc8G8F-.js → CuJezOxb.js} +0 -0
- /package/dist/devtools/_nuxt/{Dgofxk7X.js → E8AZ6HoH.js} +0 -0
- /package/dist/devtools/_nuxt/{Dit0uxj2.js → O5eLyffU.js} +0 -0
package/dist/content.mjs
CHANGED
|
@@ -11,10 +11,11 @@ const { defineSchema, asCollection, schema } = createContentSchemaFactory({
|
|
|
11
11
|
fieldName: "sitemap",
|
|
12
12
|
label: "sitemap",
|
|
13
13
|
docsUrl: "https://nuxtseo.com/sitemap/guides/content",
|
|
14
|
-
buildSchema: () => buildSitemapObjectSchema(
|
|
14
|
+
buildSchema: (_z) => buildSitemapObjectSchema(_z),
|
|
15
15
|
onDefineSchema: (options) => {
|
|
16
16
|
if ("type" in options || "source" in options)
|
|
17
17
|
throw new Error("[sitemap] `defineSitemapSchema()` returns a schema field, not a collection wrapper. Use it inside your schema: `schema: z.object({ sitemap: defineSitemapSchema() })`. See https://nuxtseo.com/sitemap/guides/content");
|
|
18
|
+
warnIfZodMismatch(options?.z);
|
|
18
19
|
if (options?.filter || options?.onUrl) {
|
|
19
20
|
if (!options.name)
|
|
20
21
|
throw new Error("[sitemap] `name` is required when using `filter` or `onUrl` in defineSitemapSchema()");
|
|
@@ -34,7 +35,34 @@ function asSitemapCollection(collection, options) {
|
|
|
34
35
|
if (options.onUrl)
|
|
35
36
|
collectionOnUrlFns.set(options.name, options.onUrl);
|
|
36
37
|
}
|
|
37
|
-
|
|
38
|
+
try {
|
|
39
|
+
return asCollection(collection);
|
|
40
|
+
} catch (e) {
|
|
41
|
+
console.warn(
|
|
42
|
+
`[sitemap] Failed to apply sitemap schema to collection. This is likely a Zod version mismatch.`,
|
|
43
|
+
`Pass your Zod instance explicitly: \`defineSitemapSchema({ z })\`. See https://nuxtseo.com/sitemap/guides/content`,
|
|
44
|
+
`Error: ${e.message}`
|
|
45
|
+
);
|
|
46
|
+
return collection;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
let _hasWarnedZodMismatch = false;
|
|
50
|
+
function warnIfZodMismatch(userZ) {
|
|
51
|
+
if (_hasWarnedZodMismatch || userZ)
|
|
52
|
+
return;
|
|
53
|
+
const testSchema = z.object({});
|
|
54
|
+
const hasV3 = "_def" in testSchema && !("def" in testSchema);
|
|
55
|
+
const hasV4 = "def" in testSchema;
|
|
56
|
+
if (hasV3 || hasV4) {
|
|
57
|
+
if (hasV3) {
|
|
58
|
+
_hasWarnedZodMismatch = true;
|
|
59
|
+
console.warn(
|
|
60
|
+
`[sitemap] Zod 3 detected but @nuxt/content v3 expects Zod 4.`,
|
|
61
|
+
`Pass your zod instance explicitly: \`defineSitemapSchema({ z })\`.`,
|
|
62
|
+
`See https://nuxtseo.com/sitemap/guides/content`
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
38
66
|
}
|
|
39
67
|
function buildSitemapObjectSchema(_z) {
|
|
40
68
|
return _z.object({
|
package/dist/devtools/200.html
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><script type="importmap">{"imports":{"#entry":"/__nuxt-sitemap/_nuxt/
|
|
1
|
+
<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><script type="importmap">{"imports":{"#entry":"/__nuxt-sitemap/_nuxt/Bi9TcosG.js"}}</script><link rel="stylesheet" href="/__nuxt-sitemap/_nuxt/entry.W5GE0Meb.css" crossorigin><link rel="stylesheet" href="/__nuxt-sitemap/_nuxt/shiki.C9dc3IDa.css" crossorigin><link rel="stylesheet" href="/__nuxt-sitemap/_nuxt/DevtoolsAlert.Cc1j0rFh.css" crossorigin><link rel="modulepreload" as="script" crossorigin href="/__nuxt-sitemap/_nuxt/Bi9TcosG.js"><link rel="modulepreload" as="script" crossorigin href="/__nuxt-sitemap/_nuxt/CHHO6nw6.js"><link rel="modulepreload" as="script" crossorigin href="/__nuxt-sitemap/_nuxt/DC1C2xmT.js"><link rel="modulepreload" as="script" crossorigin href="/__nuxt-sitemap/_nuxt/-aUy0TC4.js"><link rel="modulepreload" as="script" crossorigin href="/__nuxt-sitemap/_nuxt/Dn-g3ZEt.js"><link rel="modulepreload" as="script" crossorigin href="/__nuxt-sitemap/_nuxt/QPjoaMYX.js"><link rel="modulepreload" as="script" crossorigin href="/__nuxt-sitemap/_nuxt/Cax5AHW4.js"><script type="module" src="/__nuxt-sitemap/_nuxt/Bi9TcosG.js" crossorigin></script><script>"use strict";(()=>{const t=window,e=document.documentElement,c=["dark","light"],n=getStorageValue("localStorage","nuxt-color-mode")||"system";let i=n==="system"?u():n;const r=e.getAttribute("data-color-mode-forced");r&&(i=r),l(i),t["__NUXT_COLOR_MODE__"]={preference:n,value:i,getColorScheme:u,addColorScheme:l,removeColorScheme:d};function l(o){const s=""+o+"",a="";e.classList?e.classList.add(s):e.className+=" "+s,a&&e.setAttribute("data-"+a,o)}function d(o){const s=""+o+"",a="";e.classList?e.classList.remove(s):e.className=e.className.replace(new RegExp(s,"g"),""),a&&e.removeAttribute("data-"+a)}function f(o){return t.matchMedia("(prefers-color-scheme"+o+")")}function u(){if(t.matchMedia&&f("").media!=="not all"){for(const o of c)if(f(":"+o).matches)return o}return"light"}})();function getStorageValue(t,e){switch(t){case"localStorage":return window.localStorage.getItem(e);case"sessionStorage":return window.sessionStorage.getItem(e);case"cookie":return getCookie(e);default:return null}}function getCookie(t){const c=("; "+window.document.cookie).split("; "+t+"=");if(c.length===2)return c.pop()?.split(";").shift()}</script></head><body><div id="__nuxt" class="isolate"></div><div id="teleports"></div><script>window.__NUXT_SITE_CONFIG__={_priority:{env:-15},env:"production"}</script><script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__nuxt-sitemap",buildId:"61a2dc5e-e379-4bcd-a2a4-fe6a8a2bf7ae",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"prerenderedAt":1,"serverRendered":2},1775568124556,false]</script></body></html>
|
package/dist/devtools/404.html
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><script type="importmap">{"imports":{"#entry":"/__nuxt-sitemap/_nuxt/
|
|
1
|
+
<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><script type="importmap">{"imports":{"#entry":"/__nuxt-sitemap/_nuxt/Bi9TcosG.js"}}</script><link rel="stylesheet" href="/__nuxt-sitemap/_nuxt/entry.W5GE0Meb.css" crossorigin><link rel="stylesheet" href="/__nuxt-sitemap/_nuxt/shiki.C9dc3IDa.css" crossorigin><link rel="stylesheet" href="/__nuxt-sitemap/_nuxt/DevtoolsAlert.Cc1j0rFh.css" crossorigin><link rel="modulepreload" as="script" crossorigin href="/__nuxt-sitemap/_nuxt/Bi9TcosG.js"><link rel="modulepreload" as="script" crossorigin href="/__nuxt-sitemap/_nuxt/CHHO6nw6.js"><link rel="modulepreload" as="script" crossorigin href="/__nuxt-sitemap/_nuxt/DC1C2xmT.js"><link rel="modulepreload" as="script" crossorigin href="/__nuxt-sitemap/_nuxt/-aUy0TC4.js"><link rel="modulepreload" as="script" crossorigin href="/__nuxt-sitemap/_nuxt/Dn-g3ZEt.js"><link rel="modulepreload" as="script" crossorigin href="/__nuxt-sitemap/_nuxt/QPjoaMYX.js"><link rel="modulepreload" as="script" crossorigin href="/__nuxt-sitemap/_nuxt/Cax5AHW4.js"><script type="module" src="/__nuxt-sitemap/_nuxt/Bi9TcosG.js" crossorigin></script><script>"use strict";(()=>{const t=window,e=document.documentElement,c=["dark","light"],n=getStorageValue("localStorage","nuxt-color-mode")||"system";let i=n==="system"?u():n;const r=e.getAttribute("data-color-mode-forced");r&&(i=r),l(i),t["__NUXT_COLOR_MODE__"]={preference:n,value:i,getColorScheme:u,addColorScheme:l,removeColorScheme:d};function l(o){const s=""+o+"",a="";e.classList?e.classList.add(s):e.className+=" "+s,a&&e.setAttribute("data-"+a,o)}function d(o){const s=""+o+"",a="";e.classList?e.classList.remove(s):e.className=e.className.replace(new RegExp(s,"g"),""),a&&e.removeAttribute("data-"+a)}function f(o){return t.matchMedia("(prefers-color-scheme"+o+")")}function u(){if(t.matchMedia&&f("").media!=="not all"){for(const o of c)if(f(":"+o).matches)return o}return"light"}})();function getStorageValue(t,e){switch(t){case"localStorage":return window.localStorage.getItem(e);case"sessionStorage":return window.sessionStorage.getItem(e);case"cookie":return getCookie(e);default:return null}}function getCookie(t){const c=("; "+window.document.cookie).split("; "+t+"=");if(c.length===2)return c.pop()?.split(";").shift()}</script></head><body><div id="__nuxt" class="isolate"></div><div id="teleports"></div><script>window.__NUXT_SITE_CONFIG__={_priority:{env:-15},env:"production"}</script><script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__nuxt-sitemap",buildId:"61a2dc5e-e379-4bcd-a2a4-fe6a8a2bf7ae",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"prerenderedAt":1,"serverRendered":2},1775568124556,false]</script></body></html>
|