@nuxtjs/sitemap 7.4.8 → 7.4.10

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.
Files changed (33) hide show
  1. package/dist/client/200.html +1 -1
  2. package/dist/client/404.html +1 -1
  3. package/dist/client/_nuxt/{BD3NqoLn.js → CjT5ejtq.js} +1 -1
  4. package/dist/client/_nuxt/{CGPPaMu7.js → DBmpb9dG.js} +1 -1
  5. package/dist/client/_nuxt/{HdjdXzAy.js → FE81ed4p.js} +14 -16
  6. package/dist/client/_nuxt/builds/latest.json +1 -1
  7. package/dist/client/_nuxt/builds/meta/698c1660-7b4c-4db3-a9a5-6c0e6240b3a7.json +1 -0
  8. package/dist/client/_nuxt/error-404.DC9fsYfS.css +1 -0
  9. package/dist/client/_nuxt/error-500.DPVweS-0.css +1 -0
  10. package/dist/client/index.html +1 -1
  11. package/dist/client/sitemap.xml +1 -1
  12. package/dist/content.d.mts +36 -37
  13. package/dist/content.d.ts +36 -37
  14. package/dist/content.mjs +1 -1
  15. package/dist/module.json +1 -1
  16. package/dist/module.mjs +38 -28
  17. package/dist/runtime/server/plugins/nuxt-content-v2.js +6 -7
  18. package/dist/runtime/server/routes/__sitemap__/debug.js +3 -2
  19. package/dist/runtime/server/routes/__sitemap__/nuxt-content-urls-v2.d.ts +1 -1
  20. package/dist/runtime/server/routes/__sitemap__/nuxt-content-urls-v3.d.ts +3 -1
  21. package/dist/runtime/server/routes/__sitemap__/nuxt-content-urls-v3.js +7 -6
  22. package/dist/runtime/server/routes/sitemap/[sitemap].xml.js +1 -1
  23. package/dist/runtime/server/sitemap/builder/sitemap.js +67 -74
  24. package/dist/runtime/server/sitemap/builder/xml.js +81 -169
  25. package/dist/runtime/server/sitemap/nitro.js +4 -3
  26. package/dist/runtime/server/sitemap/urlset/normalise.js +29 -26
  27. package/dist/runtime/types.d.ts +8 -2
  28. package/dist/runtime/utils-pure.js +1 -1
  29. package/dist/utils.mjs +1 -2
  30. package/package.json +21 -13
  31. package/dist/client/_nuxt/builds/meta/61bb4b51-7d01-424f-91fb-0e4ca01f7b22.json +0 -1
  32. package/dist/client/_nuxt/error-404.i2ufnNET.css +0 -1
  33. package/dist/client/_nuxt/error-500.CIrNTbBE.css +0 -1
@@ -11,36 +11,39 @@ import {
11
11
  import { defu } from "defu";
12
12
  import { mergeOnKey } from "../../../utils-pure.js";
13
13
  function resolve(s, resolvers) {
14
- if (typeof s === "undefined" || !resolvers)
15
- return s;
16
- s = typeof s === "string" ? s : s.toString();
17
- if (hasProtocol(s, { acceptRelative: true, strict: false }))
18
- return resolvers.fixSlashes(s);
19
- return resolvers.canonicalUrlResolver(s);
14
+ if (typeof s === "undefined")
15
+ return void 0;
16
+ const str = typeof s === "string" ? s : s.toString();
17
+ if (!resolvers)
18
+ return str;
19
+ if (hasProtocol(str, { acceptRelative: true, strict: false }))
20
+ return resolvers.fixSlashes(str);
21
+ return resolvers.canonicalUrlResolver(str);
20
22
  }
21
23
  function removeTrailingSlash(s) {
22
24
  return s.replace(/\/(\?|#|$)/, "$1");
23
25
  }
24
26
  export function preNormalizeEntry(_e, resolvers) {
25
- const e = typeof _e === "string" ? { loc: _e } : { ..._e };
26
- if (e.url && !e.loc) {
27
- e.loc = e.url;
28
- delete e.url;
27
+ const input = typeof _e === "string" ? { loc: _e } : { ..._e };
28
+ if (input.url && !input.loc) {
29
+ input.loc = input.url;
29
30
  }
30
- if (typeof e.loc !== "string") {
31
- e.loc = "";
31
+ delete input.url;
32
+ if (typeof input.loc !== "string") {
33
+ input.loc = "";
32
34
  }
35
+ const e = input;
33
36
  e.loc = removeTrailingSlash(e.loc);
34
37
  e._abs = hasProtocol(e.loc, { acceptRelative: false, strict: false });
35
38
  try {
36
39
  e._path = e._abs ? parseURL(e.loc) : parsePath(e.loc);
37
- } catch (e2) {
38
- e2._path = null;
40
+ } catch {
41
+ e._path = null;
39
42
  }
40
43
  if (e._path) {
41
- const query = parseQuery(e._path.search);
42
- const qs = stringifyQuery(query);
43
- e._relativeLoc = `${encodePath(e._path?.pathname)}${qs.length ? `?${qs}` : ""}`;
44
+ const search = e._path.search;
45
+ const qs = search && search.length > 1 ? stringifyQuery(parseQuery(search)) : "";
46
+ e._relativeLoc = `${encodePath(e._path.pathname)}${qs.length ? `?${qs}` : ""}`;
44
47
  if (e._path.host) {
45
48
  e.loc = stringifyParsedURL(e._path);
46
49
  } else {
@@ -76,8 +79,7 @@ export function normaliseEntry(_e, defaults, resolvers) {
76
79
  e.loc = resolve(e.loc, resolvers);
77
80
  if (e.alternatives) {
78
81
  const alternatives = e.alternatives.map((a) => ({ ...a }));
79
- for (let i = 0; i < alternatives.length; i++) {
80
- const alt = alternatives[i];
82
+ for (const alt of alternatives) {
81
83
  if (typeof alt.href === "string") {
82
84
  alt.href = resolve(alt.href, resolvers);
83
85
  } else if (typeof alt.href === "object" && alt.href) {
@@ -88,16 +90,16 @@ export function normaliseEntry(_e, defaults, resolvers) {
88
90
  }
89
91
  if (e.images) {
90
92
  const images = e.images.map((i) => ({ ...i }));
91
- for (let i = 0; i < images.length; i++) {
92
- images[i].loc = resolve(images[i].loc, resolvers);
93
+ for (const img of images) {
94
+ img.loc = resolve(img.loc, resolvers);
93
95
  }
94
96
  e.images = mergeOnKey(images, "loc");
95
97
  }
96
98
  if (e.videos) {
97
99
  const videos = e.videos.map((v) => ({ ...v }));
98
- for (let i = 0; i < videos.length; i++) {
99
- if (videos[i].content_loc) {
100
- videos[i].content_loc = resolve(videos[i].content_loc, resolvers);
100
+ for (const video of videos) {
101
+ if (video.content_loc) {
102
+ video.content_loc = resolve(video.content_loc, resolvers);
101
103
  }
102
104
  }
103
105
  e.videos = mergeOnKey(videos, "content_loc");
@@ -115,8 +117,9 @@ export function isValidW3CDate(d) {
115
117
  }
116
118
  export function normaliseDate(d) {
117
119
  if (typeof d === "string") {
118
- if (d.includes("T")) {
119
- const t = d.split("T")[1];
120
+ const tIdx = d.indexOf("T");
121
+ if (tIdx !== -1) {
122
+ const t = d.slice(tIdx + 1);
120
123
  if (!t.includes("+") && !t.includes("-") && !t.includes("Z")) {
121
124
  d += "Z";
122
125
  }
@@ -247,7 +247,7 @@ export type ResolvedSitemapUrl = Omit<SitemapUrl, 'url'> & Required<Pick<Sitemap
247
247
  /**
248
248
  * @internal
249
249
  */
250
- _path: ParsedURL;
250
+ _path: ParsedURL | null;
251
251
  /**
252
252
  * @internal
253
253
  */
@@ -362,6 +362,10 @@ export interface SitemapSourcesHookCtx extends NitroBaseHook {
362
362
  export type Changefreq = 'always' | 'hourly' | 'daily' | 'weekly' | 'monthly' | 'yearly' | 'never';
363
363
  export interface SitemapUrl {
364
364
  loc: string;
365
+ /**
366
+ * Alias for `loc`. Will be normalized to `loc`.
367
+ */
368
+ url?: string;
365
369
  lastmod?: string | Date;
366
370
  changefreq?: Changefreq;
367
371
  priority?: 0 | 0.1 | 0.2 | 0.3 | 0.4 | 0.5 | 0.6 | 0.7 | 0.8 | 0.9 | 1;
@@ -406,7 +410,7 @@ export interface GoogleNewsEntry {
406
410
  export interface ImageEntry {
407
411
  loc: string | URL;
408
412
  caption?: string;
409
- geoLocation?: string;
413
+ geo_location?: string;
410
414
  title?: string;
411
415
  license?: string | URL;
412
416
  }
@@ -436,6 +440,8 @@ export interface VideoEntry {
436
440
  };
437
441
  live?: 'yes' | 'no' | boolean;
438
442
  tag?: string | string[];
443
+ category?: string;
444
+ gallery_loc?: string | URL;
439
445
  }
440
446
  export interface Restriction {
441
447
  relationship: 'allow' | 'deny';
@@ -30,7 +30,7 @@ export function mergeOnKey(arr, key) {
30
30
  }
31
31
  export function splitForLocales(path, locales) {
32
32
  const prefix = withLeadingSlash(path).split("/")[1];
33
- if (locales.includes(prefix))
33
+ if (prefix && locales.includes(prefix))
34
34
  return [prefix, path.replace(`/${prefix}`, "")];
35
35
  return [null, path];
36
36
  }
package/dist/utils.mjs CHANGED
@@ -319,12 +319,11 @@ function extractUrlFromParsedElement(urlElement, warnings) {
319
319
  });
320
320
  }
321
321
  }
322
- const filteredUrlObj = Object.fromEntries(
322
+ return Object.fromEntries(
323
323
  Object.entries(urlObj).filter(
324
324
  ([_, value]) => value != null && (!Array.isArray(value) || value.length > 0)
325
325
  )
326
326
  );
327
- return filteredUrlObj;
328
327
  }
329
328
  async function parseSitemapXml(xml) {
330
329
  const warnings = [];
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@nuxtjs/sitemap",
3
3
  "type": "module",
4
- "version": "7.4.8",
4
+ "version": "7.4.10",
5
5
  "description": "Powerfully flexible XML Sitemaps that integrate seamlessly, for Nuxt.",
6
6
  "author": {
7
7
  "name": "Harlan Wilton",
@@ -49,12 +49,12 @@
49
49
  },
50
50
  "dependencies": {
51
51
  "@nuxt/devtools-kit": "^3.1.1",
52
- "@nuxt/kit": "^4.2.1",
52
+ "@nuxt/kit": "^4.2.2",
53
53
  "chalk": "^5.6.2",
54
54
  "defu": "^6.1.4",
55
- "fast-xml-parser": "^5.3.2",
55
+ "fast-xml-parser": "^5.3.3",
56
56
  "h3-compression": "^0.3.2",
57
- "nuxt-site-config": "^3.2.11",
57
+ "nuxt-site-config": "^3.2.14",
58
58
  "ofetch": "^1.5.1",
59
59
  "pathe": "^2.0.3",
60
60
  "pkg-types": "^2.3.0",
@@ -65,27 +65,35 @@
65
65
  "ufo": "^1.6.1",
66
66
  "ultrahtml": "^1.6.0"
67
67
  },
68
+ "peerDependencies": {
69
+ "zod": ">=3"
70
+ },
71
+ "peerDependenciesMeta": {
72
+ "zod": {
73
+ "optional": true
74
+ }
75
+ },
68
76
  "devDependencies": {
69
77
  "@arethetypeswrong/cli": "^0.18.2",
70
78
  "@nuxt/content": "^3.9.0",
71
- "@nuxt/eslint-config": "^1.11.0",
79
+ "@nuxt/eslint-config": "^1.12.1",
72
80
  "@nuxt/module-builder": "^1.0.2",
73
81
  "@nuxt/test-utils": "^3.21.0",
74
82
  "@nuxt/ui": "^4.2.1",
75
83
  "@nuxtjs/i18n": "^10.2.1",
76
- "@nuxtjs/robots": "^5.6.0",
84
+ "@nuxtjs/robots": "^5.6.7",
77
85
  "better-sqlite3": "^12.5.0",
78
86
  "bumpp": "^10.3.2",
79
- "eslint": "^9.39.1",
87
+ "eslint": "^9.39.2",
80
88
  "eslint-plugin-n": "^17.23.1",
81
89
  "execa": "^9.6.1",
82
90
  "happy-dom": "^20.0.11",
83
- "nuxt": "^4.2.1",
84
- "nuxt-i18n-micro": "^2.13.0",
91
+ "nuxt": "^4.2.2",
92
+ "nuxt-i18n-micro": "^2.15.2",
85
93
  "typescript": "^5.9.3",
86
- "vitest": "^3.2.4",
87
- "vue-tsc": "^3.1.5",
88
- "@nuxtjs/sitemap": "7.4.8"
94
+ "vitest": "3.2.4",
95
+ "vue-tsc": "^3.1.8",
96
+ "@nuxtjs/sitemap": "7.4.10"
89
97
  },
90
98
  "scripts": {
91
99
  "lint": "eslint .",
@@ -102,6 +110,6 @@
102
110
  "test": "vitest run && pnpm run test:attw",
103
111
  "test:unit": "vitest --project=unit",
104
112
  "test:attw": "attw --pack",
105
- "typecheck": "vue-tsc --noEmit"
113
+ "typecheck": "nuxt typecheck"
106
114
  }
107
115
  }
@@ -1 +0,0 @@
1
- {"id":"61bb4b51-7d01-424f-91fb-0e4ca01f7b22","timestamp":1764878513805,"matcher":{"static":{},"wildcard":{},"dynamic":{}},"prerendered":[]}
@@ -1 +0,0 @@
1
- .grid[data-v-7b03c9df]{display:grid}.mb-2[data-v-7b03c9df]{margin-bottom:.5rem}.mb-4[data-v-7b03c9df]{margin-bottom:1rem}.max-w-520px[data-v-7b03c9df]{max-width:520px}.min-h-screen[data-v-7b03c9df]{min-height:100vh}.w-full[data-v-7b03c9df]{width:100%}.flex[data-v-7b03c9df]{display:flex}.place-content-center[data-v-7b03c9df]{place-content:center}.items-center[data-v-7b03c9df]{align-items:center}.justify-center[data-v-7b03c9df]{justify-content:center}.overflow-hidden[data-v-7b03c9df]{overflow:hidden}.bg-white[data-v-7b03c9df]{--un-bg-opacity:1;background-color:rgb(255 255 255/var(--un-bg-opacity))}.px-2[data-v-7b03c9df]{padding-left:.5rem;padding-right:.5rem}.text-center[data-v-7b03c9df]{text-align:center}.text-\[80px\][data-v-7b03c9df]{font-size:80px}.text-2xl[data-v-7b03c9df]{font-size:1.5rem;line-height:2rem}.text-sm[data-v-7b03c9df]{font-size:.875rem;line-height:1.25rem}.text-\[\#020420\][data-v-7b03c9df]{--un-text-opacity:1;color:rgb(2 4 32/var(--un-text-opacity))}.text-\[\#64748B\][data-v-7b03c9df]{--un-text-opacity:1;color:rgb(100 116 139/var(--un-text-opacity))}.hover\:text-\[\#00DC82\][data-v-7b03c9df]:hover{--un-text-opacity:1;color:rgb(0 220 130/var(--un-text-opacity))}.font-medium[data-v-7b03c9df]{font-weight:500}.font-semibold[data-v-7b03c9df]{font-weight:600}.leading-none[data-v-7b03c9df]{line-height:1}.tracking-wide[data-v-7b03c9df]{letter-spacing:.025em}.font-sans[data-v-7b03c9df]{font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji}.tabular-nums[data-v-7b03c9df]{--un-numeric-spacing:tabular-nums;font-variant-numeric:var(--un-ordinal) var(--un-slashed-zero) var(--un-numeric-figure) var(--un-numeric-spacing) var(--un-numeric-fraction)}.underline[data-v-7b03c9df]{text-decoration-line:underline}.underline-offset-3[data-v-7b03c9df]{text-underline-offset:3px}.antialiased[data-v-7b03c9df]{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}@media(prefers-color-scheme:dark){.dark\:bg-\[\#020420\][data-v-7b03c9df]{--un-bg-opacity:1;background-color:rgb(2 4 32/var(--un-bg-opacity))}.dark\:text-white[data-v-7b03c9df]{--un-text-opacity:1;color:rgb(255 255 255/var(--un-text-opacity))}}@media(min-width:640px){.sm\:text-\[110px\][data-v-7b03c9df]{font-size:110px}.sm\:text-3xl[data-v-7b03c9df]{font-size:1.875rem;line-height:2.25rem}}
@@ -1 +0,0 @@
1
- .grid[data-v-b5d03260]{display:grid}.mb-2[data-v-b5d03260]{margin-bottom:.5rem}.mb-4[data-v-b5d03260]{margin-bottom:1rem}.max-w-520px[data-v-b5d03260]{max-width:520px}.min-h-screen[data-v-b5d03260]{min-height:100vh}.place-content-center[data-v-b5d03260]{place-content:center}.overflow-hidden[data-v-b5d03260]{overflow:hidden}.bg-white[data-v-b5d03260]{--un-bg-opacity:1;background-color:rgb(255 255 255/var(--un-bg-opacity))}.px-2[data-v-b5d03260]{padding-left:.5rem;padding-right:.5rem}.text-center[data-v-b5d03260]{text-align:center}.text-\[80px\][data-v-b5d03260]{font-size:80px}.text-2xl[data-v-b5d03260]{font-size:1.5rem;line-height:2rem}.text-\[\#020420\][data-v-b5d03260]{--un-text-opacity:1;color:rgb(2 4 32/var(--un-text-opacity))}.text-\[\#64748B\][data-v-b5d03260]{--un-text-opacity:1;color:rgb(100 116 139/var(--un-text-opacity))}.font-semibold[data-v-b5d03260]{font-weight:600}.leading-none[data-v-b5d03260]{line-height:1}.tracking-wide[data-v-b5d03260]{letter-spacing:.025em}.font-sans[data-v-b5d03260]{font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji}.tabular-nums[data-v-b5d03260]{--un-numeric-spacing:tabular-nums;font-variant-numeric:var(--un-ordinal) var(--un-slashed-zero) var(--un-numeric-figure) var(--un-numeric-spacing) var(--un-numeric-fraction)}.antialiased[data-v-b5d03260]{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}@media(prefers-color-scheme:dark){.dark\:bg-\[\#020420\][data-v-b5d03260]{--un-bg-opacity:1;background-color:rgb(2 4 32/var(--un-bg-opacity))}.dark\:text-white[data-v-b5d03260]{--un-text-opacity:1;color:rgb(255 255 255/var(--un-text-opacity))}}@media(min-width:640px){.sm\:text-\[110px\][data-v-b5d03260]{font-size:110px}.sm\:text-3xl[data-v-b5d03260]{font-size:1.875rem;line-height:2.25rem}}