@nuxtjs/sitemap 7.4.10 → 7.4.11
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/client/200.html +1 -1
- package/dist/client/404.html +1 -1
- package/dist/client/_nuxt/builds/latest.json +1 -1
- package/dist/client/_nuxt/builds/meta/ef370d03-581a-4487-a7bd-237af16aab04.json +1 -0
- package/dist/client/index.html +1 -1
- package/dist/client/sitemap.xml +1 -1
- package/dist/module.json +1 -1
- package/dist/runtime/server/sitemap/builder/sitemap-index.js +1 -2
- package/dist/runtime/server/sitemap/builder/sitemap.js +1 -2
- package/dist/runtime/server/sitemap/urlset/sources.d.ts +2 -2
- package/dist/runtime/server/sitemap/urlset/sources.js +8 -6
- package/dist/runtime/utils-pure.js +28 -18
- package/package.json +2 -2
- package/dist/client/_nuxt/builds/meta/698c1660-7b4c-4db3-a9a5-6c0e6240b3a7.json +0 -1
package/dist/client/200.html
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><link rel="stylesheet" href="/__sitemap__/devtools/_nuxt/entry.Ci1pP-eR.css" crossorigin><link rel="modulepreload" as="script" crossorigin href="/__sitemap__/devtools/_nuxt/FE81ed4p.js"><script type="module" src="/__sitemap__/devtools/_nuxt/FE81ed4p.js" crossorigin></script></head><body><div id="__nuxt"></div><div id="teleports"></div><script>window.__NUXT_SITE_CONFIG__={_priority:{name:-10,env:-15},env:"production",name:"@nuxtjs\u002Fsitemap-client"}</script><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"prerenderedAt":1,"serverRendered":2},
|
|
1
|
+
<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><link rel="stylesheet" href="/__sitemap__/devtools/_nuxt/entry.Ci1pP-eR.css" crossorigin><link rel="modulepreload" as="script" crossorigin href="/__sitemap__/devtools/_nuxt/FE81ed4p.js"><script type="module" src="/__sitemap__/devtools/_nuxt/FE81ed4p.js" crossorigin></script></head><body><div id="__nuxt"></div><div id="teleports"></div><script>window.__NUXT_SITE_CONFIG__={_priority:{name:-10,env:-15},env:"production",name:"@nuxtjs\u002Fsitemap-client"}</script><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"prerenderedAt":1,"serverRendered":2},1765864560063,false]</script><script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__sitemap__/devtools",buildId:"ef370d03-581a-4487-a7bd-237af16aab04",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body></html>
|
package/dist/client/404.html
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><link rel="stylesheet" href="/__sitemap__/devtools/_nuxt/entry.Ci1pP-eR.css" crossorigin><link rel="modulepreload" as="script" crossorigin href="/__sitemap__/devtools/_nuxt/FE81ed4p.js"><script type="module" src="/__sitemap__/devtools/_nuxt/FE81ed4p.js" crossorigin></script></head><body><div id="__nuxt"></div><div id="teleports"></div><script>window.__NUXT_SITE_CONFIG__={_priority:{name:-10,env:-15},env:"production",name:"@nuxtjs\u002Fsitemap-client"}</script><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"prerenderedAt":1,"serverRendered":2},
|
|
1
|
+
<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><link rel="stylesheet" href="/__sitemap__/devtools/_nuxt/entry.Ci1pP-eR.css" crossorigin><link rel="modulepreload" as="script" crossorigin href="/__sitemap__/devtools/_nuxt/FE81ed4p.js"><script type="module" src="/__sitemap__/devtools/_nuxt/FE81ed4p.js" crossorigin></script></head><body><div id="__nuxt"></div><div id="teleports"></div><script>window.__NUXT_SITE_CONFIG__={_priority:{name:-10,env:-15},env:"production",name:"@nuxtjs\u002Fsitemap-client"}</script><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"prerenderedAt":1,"serverRendered":2},1765864560063,false]</script><script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__sitemap__/devtools",buildId:"ef370d03-581a-4487-a7bd-237af16aab04",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body></html>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"id":"
|
|
1
|
+
{"id":"ef370d03-581a-4487-a7bd-237af16aab04","timestamp":1765864553677}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"id":"ef370d03-581a-4487-a7bd-237af16aab04","timestamp":1765864553677,"matcher":{"static":{},"wildcard":{},"dynamic":{}},"prerendered":[]}
|
package/dist/client/index.html
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><link rel="stylesheet" href="/__sitemap__/devtools/_nuxt/entry.Ci1pP-eR.css" crossorigin><link rel="modulepreload" as="script" crossorigin href="/__sitemap__/devtools/_nuxt/FE81ed4p.js"><script type="module" src="/__sitemap__/devtools/_nuxt/FE81ed4p.js" crossorigin></script></head><body><div id="__nuxt"></div><div id="teleports"></div><script>window.__NUXT_SITE_CONFIG__={_priority:{name:-10,env:-15},env:"production",name:"@nuxtjs\u002Fsitemap-client"}</script><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"prerenderedAt":1,"serverRendered":2},
|
|
1
|
+
<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><link rel="stylesheet" href="/__sitemap__/devtools/_nuxt/entry.Ci1pP-eR.css" crossorigin><link rel="modulepreload" as="script" crossorigin href="/__sitemap__/devtools/_nuxt/FE81ed4p.js"><script type="module" src="/__sitemap__/devtools/_nuxt/FE81ed4p.js" crossorigin></script></head><body><div id="__nuxt"></div><div id="teleports"></div><script>window.__NUXT_SITE_CONFIG__={_priority:{name:-10,env:-15},env:"production",name:"@nuxtjs\u002Fsitemap-client"}</script><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"prerenderedAt":1,"serverRendered":2},1765864560063,false]</script><script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__sitemap__/devtools",buildId:"ef370d03-581a-4487-a7bd-237af16aab04",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body></html>
|
package/dist/client/sitemap.xml
CHANGED
package/dist/module.json
CHANGED
|
@@ -107,8 +107,7 @@ async function buildSitemapIndexInternal(resolvers, runtimeConfig, nitro) {
|
|
|
107
107
|
const sitemapConfig = sitemaps[sitemapName];
|
|
108
108
|
if (sitemapName !== "index" && sitemapConfig._isChunking) {
|
|
109
109
|
const chunkSize = sitemapConfig._chunkSize || defaultSitemapsChunkSize || 1e3;
|
|
110
|
-
let sourcesInput = sitemapConfig.includeAppSources ? await globalSitemapSources() :
|
|
111
|
-
sourcesInput.push(...await childSitemapSources(sitemapConfig));
|
|
110
|
+
let sourcesInput = sitemapConfig.includeAppSources ? [...await globalSitemapSources(), ...await childSitemapSources(sitemapConfig)] : await childSitemapSources(sitemapConfig);
|
|
112
111
|
if (nitro && resolvers.event) {
|
|
113
112
|
const ctx = {
|
|
114
113
|
event: resolvers.event,
|
|
@@ -196,8 +196,7 @@ export async function buildSitemapUrls(sitemap, resolvers, runtimeConfig, nitro)
|
|
|
196
196
|
if (chunkInfo.isChunked && baseSitemapName !== sitemap.sitemapName && sitemaps[baseSitemapName]) {
|
|
197
197
|
effectiveSitemap = sitemaps[baseSitemapName];
|
|
198
198
|
}
|
|
199
|
-
let sourcesInput = effectiveSitemap.includeAppSources ? await globalSitemapSources() :
|
|
200
|
-
sourcesInput.push(...await childSitemapSources(effectiveSitemap));
|
|
199
|
+
let sourcesInput = effectiveSitemap.includeAppSources ? [...await globalSitemapSources(), ...await childSitemapSources(effectiveSitemap)] : await childSitemapSources(effectiveSitemap);
|
|
201
200
|
if (nitro && resolvers.event) {
|
|
202
201
|
const ctx = {
|
|
203
202
|
event: resolvers.event,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { H3Event } from 'h3';
|
|
2
2
|
import type { ModuleRuntimeConfig, SitemapSourceBase, SitemapSourceResolved } from '../../../types.js';
|
|
3
3
|
export declare function fetchDataSource(input: SitemapSourceBase | SitemapSourceResolved, event?: H3Event): Promise<SitemapSourceResolved>;
|
|
4
|
-
export declare function globalSitemapSources(): Promise<any>;
|
|
5
|
-
export declare function childSitemapSources(definition: ModuleRuntimeConfig['sitemaps'][string]): Promise<any>;
|
|
4
|
+
export declare function globalSitemapSources(): Promise<any[]>;
|
|
5
|
+
export declare function childSitemapSources(definition: ModuleRuntimeConfig['sitemaps'][string]): Promise<any[]>;
|
|
6
6
|
export declare function resolveSitemapSources(sources: (SitemapSourceBase | SitemapSourceResolved)[], event?: H3Event): Promise<SitemapSourceResolved[]>;
|
|
@@ -120,11 +120,12 @@ export async function globalSitemapSources() {
|
|
|
120
120
|
if (import.meta.prerender) {
|
|
121
121
|
const { readSourcesFromFilesystem } = await import("#sitemap-virtual/read-sources.mjs");
|
|
122
122
|
const sources = await readSourcesFromFilesystem("global-sources.json");
|
|
123
|
-
if (sources)
|
|
124
|
-
return sources;
|
|
123
|
+
if (sources) {
|
|
124
|
+
return [...sources];
|
|
125
|
+
}
|
|
125
126
|
}
|
|
126
127
|
const m = await import("#sitemap-virtual/global-sources.mjs");
|
|
127
|
-
return m.sources;
|
|
128
|
+
return [...m.sources];
|
|
128
129
|
}
|
|
129
130
|
export async function childSitemapSources(definition) {
|
|
130
131
|
if (!definition?._hasSourceChunk)
|
|
@@ -132,11 +133,12 @@ export async function childSitemapSources(definition) {
|
|
|
132
133
|
if (import.meta.prerender) {
|
|
133
134
|
const { readSourcesFromFilesystem } = await import("#sitemap-virtual/read-sources.mjs");
|
|
134
135
|
const allSources = await readSourcesFromFilesystem("child-sources.json");
|
|
135
|
-
if (allSources)
|
|
136
|
-
return allSources[definition.sitemapName] || [];
|
|
136
|
+
if (allSources) {
|
|
137
|
+
return [...allSources[definition.sitemapName] || []];
|
|
138
|
+
}
|
|
137
139
|
}
|
|
138
140
|
const m = await import("#sitemap-virtual/child-sources.mjs");
|
|
139
|
-
return m.sources[definition.sitemapName] || [];
|
|
141
|
+
return [...m.sources[definition.sitemapName] || []];
|
|
140
142
|
}
|
|
141
143
|
export async function resolveSitemapSources(sources, event) {
|
|
142
144
|
return (await Promise.all(
|
|
@@ -26,7 +26,8 @@ export function mergeOnKey(arr, key) {
|
|
|
26
26
|
result[resultLength++] = item;
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
|
-
|
|
29
|
+
result.length = resultLength;
|
|
30
|
+
return result;
|
|
30
31
|
}
|
|
31
32
|
export function splitForLocales(path, locales) {
|
|
32
33
|
const prefix = withLeadingSlash(path).split("/")[1];
|
|
@@ -62,24 +63,33 @@ export function createFilter(options = {}) {
|
|
|
62
63
|
const exclude = options.exclude || [];
|
|
63
64
|
if (include.length === 0 && exclude.length === 0)
|
|
64
65
|
return () => true;
|
|
66
|
+
const excludeRegex = exclude.filter((r) => r instanceof RegExp);
|
|
67
|
+
const includeRegex = include.filter((r) => r instanceof RegExp);
|
|
68
|
+
const excludeStrings = exclude.filter((r) => typeof r === "string");
|
|
69
|
+
const includeStrings = include.filter((r) => typeof r === "string");
|
|
70
|
+
const excludeMatcher = excludeStrings.length > 0 ? toRouteMatcher(createRouter({
|
|
71
|
+
routes: Object.fromEntries(excludeStrings.map((r) => [r, true])),
|
|
72
|
+
strictTrailingSlash: false
|
|
73
|
+
})) : null;
|
|
74
|
+
const includeMatcher = includeStrings.length > 0 ? toRouteMatcher(createRouter({
|
|
75
|
+
routes: Object.fromEntries(includeStrings.map((r) => [r, true])),
|
|
76
|
+
strictTrailingSlash: false
|
|
77
|
+
})) : null;
|
|
78
|
+
const excludeExact = new Set(excludeStrings);
|
|
79
|
+
const includeExact = new Set(includeStrings);
|
|
65
80
|
return function(path) {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
const routeRulesMatcher = toRouteMatcher(createRouter({ routes, strictTrailingSlash: false }));
|
|
79
|
-
if (routeRulesMatcher.matchAll(path).length > 0)
|
|
80
|
-
return Boolean(v.result);
|
|
81
|
-
}
|
|
82
|
-
}
|
|
81
|
+
if (excludeRegex.some((r) => r.test(path)))
|
|
82
|
+
return false;
|
|
83
|
+
if (excludeExact.has(path))
|
|
84
|
+
return false;
|
|
85
|
+
if (excludeMatcher && excludeMatcher.matchAll(path).length > 0)
|
|
86
|
+
return false;
|
|
87
|
+
if (includeRegex.some((r) => r.test(path)))
|
|
88
|
+
return true;
|
|
89
|
+
if (includeExact.has(path))
|
|
90
|
+
return true;
|
|
91
|
+
if (includeMatcher && includeMatcher.matchAll(path).length > 0)
|
|
92
|
+
return true;
|
|
83
93
|
return include.length === 0;
|
|
84
94
|
};
|
|
85
95
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nuxtjs/sitemap",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "7.4.
|
|
4
|
+
"version": "7.4.11",
|
|
5
5
|
"description": "Powerfully flexible XML Sitemaps that integrate seamlessly, for Nuxt.",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Harlan Wilton",
|
|
@@ -93,7 +93,7 @@
|
|
|
93
93
|
"typescript": "^5.9.3",
|
|
94
94
|
"vitest": "3.2.4",
|
|
95
95
|
"vue-tsc": "^3.1.8",
|
|
96
|
-
"@nuxtjs/sitemap": "7.4.
|
|
96
|
+
"@nuxtjs/sitemap": "7.4.11"
|
|
97
97
|
},
|
|
98
98
|
"scripts": {
|
|
99
99
|
"lint": "eslint .",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"id":"698c1660-7b4c-4db3-a9a5-6c0e6240b3a7","timestamp":1765851593006,"matcher":{"static":{},"wildcard":{},"dynamic":{}},"prerendered":[]}
|