@nuxtjs/sitemap 2.4.0 → 5.0.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.
Files changed (86) hide show
  1. package/README.md +60 -593
  2. package/dist/client/200.html +11 -0
  3. package/dist/client/404.html +11 -0
  4. package/dist/client/_nuxt/Icon.I3NdYkjC.css +1 -0
  5. package/dist/client/_nuxt/Icon.wdYGFqbO.js +1 -0
  6. package/dist/client/_nuxt/IconCSS.6oz918NR.css +1 -0
  7. package/dist/client/_nuxt/IconCSS.L-uj6Ouj.js +1 -0
  8. package/dist/client/_nuxt/builds/latest.json +1 -0
  9. package/dist/client/_nuxt/builds/meta/c3bdccb2-d4db-4a94-9e61-39b740a57bf8.json +1 -0
  10. package/dist/client/_nuxt/entry.Soe9IWze.js +15 -0
  11. package/dist/client/_nuxt/entry.UqhvG0ao.css +1 -0
  12. package/dist/client/_nuxt/error-404.DkXpI38i.css +1 -0
  13. package/dist/client/_nuxt/error-404.uz-DxZsp.js +1 -0
  14. package/dist/client/_nuxt/error-500.BsNDeZpL.js +1 -0
  15. package/dist/client/_nuxt/error-500.SLhS9LVu.css +1 -0
  16. package/dist/client/_nuxt/index.lSDm5iYo.js +1 -0
  17. package/dist/client/index.html +11 -0
  18. package/dist/module.cjs +5 -0
  19. package/dist/module.d.mts +350 -0
  20. package/dist/module.d.ts +350 -0
  21. package/dist/module.json +9 -0
  22. package/dist/module.mjs +994 -0
  23. package/dist/runtime/nitro/composables/asSitemapUrl.d.ts +2 -0
  24. package/dist/runtime/nitro/composables/asSitemapUrl.mjs +3 -0
  25. package/dist/runtime/nitro/composables/defineSitemapEventHandler.d.ts +3 -0
  26. package/dist/runtime/nitro/composables/defineSitemapEventHandler.mjs +2 -0
  27. package/dist/runtime/nitro/composables/getPathRobotConfigPolyfill.d.ts +4 -0
  28. package/dist/runtime/nitro/composables/getPathRobotConfigPolyfill.mjs +3 -0
  29. package/dist/runtime/nitro/kit.d.ts +3 -0
  30. package/dist/runtime/nitro/kit.mjs +23 -0
  31. package/dist/runtime/nitro/middleware/[sitemap]-sitemap.xml.d.ts +2 -0
  32. package/dist/runtime/nitro/middleware/[sitemap]-sitemap.xml.mjs +23 -0
  33. package/dist/runtime/nitro/plugins/compression.d.ts +2 -0
  34. package/dist/runtime/nitro/plugins/compression.mjs +8 -0
  35. package/dist/runtime/nitro/plugins/nuxt-content.d.ts +2 -0
  36. package/dist/runtime/nitro/plugins/nuxt-content.mjs +38 -0
  37. package/dist/runtime/nitro/plugins/warm-up.d.ts +2 -0
  38. package/dist/runtime/nitro/plugins/warm-up.mjs +23 -0
  39. package/dist/runtime/nitro/routes/__sitemap__/debug.d.ts +37 -0
  40. package/dist/runtime/nitro/routes/__sitemap__/debug.mjs +29 -0
  41. package/dist/runtime/nitro/routes/__sitemap__/nuxt-content-urls.d.ts +2 -0
  42. package/dist/runtime/nitro/routes/__sitemap__/nuxt-content-urls.mjs +6 -0
  43. package/dist/runtime/nitro/routes/sitemap.xml.d.ts +2 -0
  44. package/dist/runtime/nitro/routes/sitemap.xml.mjs +13 -0
  45. package/dist/runtime/nitro/routes/sitemap.xsl.d.ts +2 -0
  46. package/dist/runtime/nitro/routes/sitemap.xsl.mjs +230 -0
  47. package/dist/runtime/nitro/routes/sitemap_index.xml.d.ts +2 -0
  48. package/dist/runtime/nitro/routes/sitemap_index.xml.mjs +27 -0
  49. package/dist/runtime/nitro/sitemap/builder/sitemap-index.d.ts +2 -0
  50. package/dist/runtime/nitro/sitemap/builder/sitemap-index.mjs +86 -0
  51. package/dist/runtime/nitro/sitemap/builder/sitemap.d.ts +2 -0
  52. package/dist/runtime/nitro/sitemap/builder/sitemap.mjs +107 -0
  53. package/dist/runtime/nitro/sitemap/builder/xml.d.ts +4 -0
  54. package/dist/runtime/nitro/sitemap/builder/xml.mjs +83 -0
  55. package/dist/runtime/nitro/sitemap/nitro.d.ts +4 -0
  56. package/dist/runtime/nitro/sitemap/nitro.mjs +36 -0
  57. package/dist/runtime/nitro/sitemap/urlset/filter.d.ts +5 -0
  58. package/dist/runtime/nitro/sitemap/urlset/filter.mjs +50 -0
  59. package/dist/runtime/nitro/sitemap/urlset/i18n.d.ts +8 -0
  60. package/dist/runtime/nitro/sitemap/urlset/i18n.mjs +128 -0
  61. package/dist/runtime/nitro/sitemap/urlset/normalise.d.ts +3 -0
  62. package/dist/runtime/nitro/sitemap/urlset/normalise.mjs +77 -0
  63. package/dist/runtime/nitro/sitemap/urlset/sort.d.ts +2 -0
  64. package/dist/runtime/nitro/sitemap/urlset/sort.mjs +19 -0
  65. package/dist/runtime/nitro/sitemap/urlset/sources.d.ts +5 -0
  66. package/dist/runtime/nitro/sitemap/urlset/sources.mjs +82 -0
  67. package/dist/runtime/nitro/tsconfig.json +3 -0
  68. package/dist/runtime/nitro/utils.d.ts +4 -0
  69. package/dist/runtime/nitro/utils.mjs +13 -0
  70. package/dist/runtime/types.d.ts +355 -0
  71. package/dist/runtime/types.mjs +0 -0
  72. package/dist/runtime/utils-pure.d.ts +7 -0
  73. package/dist/runtime/utils-pure.mjs +32 -0
  74. package/dist/types.d.mts +18 -0
  75. package/dist/types.d.ts +18 -0
  76. package/package.json +79 -75
  77. package/CHANGELOG.md +0 -268
  78. package/LICENSE +0 -21
  79. package/lib/builder.js +0 -172
  80. package/lib/cache.js +0 -95
  81. package/lib/generator.js +0 -113
  82. package/lib/logger.js +0 -19
  83. package/lib/middleware.js +0 -195
  84. package/lib/module.js +0 -72
  85. package/lib/options.js +0 -135
  86. package/lib/routes.js +0 -55
@@ -0,0 +1,350 @@
1
+ import * as _nuxt_schema from '@nuxt/schema';
2
+ import { FetchOptions } from 'ofetch';
3
+
4
+ interface ModuleOptions$1 extends SitemapDefinition {
5
+ /**
6
+ * Whether the sitemap.xml should be generated.
7
+ *
8
+ * @default true
9
+ */
10
+ enabled: boolean;
11
+ /**
12
+ * Enables debug logs and a debug endpoint.
13
+ *
14
+ * @default false
15
+ */
16
+ debug: boolean;
17
+ /**
18
+ * Should lastmod be automatically added to the sitemap.
19
+ *
20
+ * Warning: This may not be following best practices for sitemaps.
21
+ *
22
+ * @see https://nuxtseo.com/sitemap/guides/best-practices.
23
+ * @default false
24
+ */
25
+ autoLastmod: boolean;
26
+ /**
27
+ * Should pages be automatically added to the sitemap.
28
+ *
29
+ * @default true
30
+ * @deprecated If set to false, use `excludeAppSources: ['pages', 'route-rules', 'prerender']` instead. Otherwise, remove this.
31
+ */
32
+ inferStaticPagesAsRoutes: boolean;
33
+ /**
34
+ * Sources to exclude from the sitemap.
35
+ */
36
+ excludeAppSources: true | (AppSourceContext[]);
37
+ /**
38
+ * Multiple sitemap support for large sites.
39
+ *
40
+ * @default false
41
+ */
42
+ sitemaps?: boolean | MultiSitemapsInput;
43
+ /**
44
+ * Path to the xsl that styles sitemap.xml.
45
+ *
46
+ * Set to `false` to disable styling.
47
+ *
48
+ * @default /__sitemap__/style.xsl
49
+ */
50
+ xsl: string | false;
51
+ /**
52
+ * Toggle the tips displayed in the xsl.
53
+ *
54
+ * @default true
55
+ */
56
+ xslTips: boolean;
57
+ /**
58
+ * Customised the columns displayed in the xsl.
59
+ *
60
+ * @default [{ label: 'URL', width: '50%', select: 'string' }, { label: 'Last Modified', width: '25%', select: 'lastmod' }, { label: 'Change Frequency', width: '25%', select: 'changefreq' }]
61
+ */
62
+ xslColumns?: {
63
+ label: string;
64
+ width: `${string}%`;
65
+ select?: string;
66
+ }[];
67
+ /**
68
+ * When prerendering, should images be automatically be discovered and added to the sitemap.
69
+ *
70
+ * @default true
71
+ */
72
+ discoverImages: boolean;
73
+ /**
74
+ * When chunking the sitemaps into multiple files, how many entries should each file contain.
75
+ *
76
+ * Set to `false` to disabling chunking completely.
77
+ *
78
+ * @default 1000
79
+ */
80
+ defaultSitemapsChunkSize: number | false;
81
+ /**
82
+ * Modify the cache behavior.
83
+ *
84
+ * Passing a boolean will enable or disable the runtime cache with the default options.
85
+ *
86
+ * Providing a record will allow you to configure the runtime cache fully.
87
+ *
88
+ * @default true
89
+ * @see https://nitro.unjs.io/guide/storage#mountpoints
90
+ * @example { driver: 'redis', host: 'localhost', port: 6379, password: 'password' }
91
+ */
92
+ runtimeCacheStorage: boolean | (Record<string, any> & {
93
+ driver: string;
94
+ });
95
+ /**
96
+ * Automatically add alternative links to the sitemap based on a prefix list.
97
+ * Is used by @nuxtjs/i18n to automatically add alternative links to the sitemap.
98
+ */
99
+ autoI18n?: boolean | AutoI18nConfig;
100
+ /**
101
+ * Enable when your nuxt/content files match your pages. This will automatically add sitemap content to the sitemap.
102
+ *
103
+ * This is similar behavior to using `nuxt/content` with `documentDriven: true`.
104
+ */
105
+ strictNuxtContentPaths: boolean;
106
+ /**
107
+ * Should the sitemap.xml display credits for the module.
108
+ *
109
+ * @default true
110
+ */
111
+ credits: boolean;
112
+ /**
113
+ * How long, in milliseconds, should the sitemap be cached for.
114
+ *
115
+ * @default 1 hour
116
+ *
117
+ * @deprecated use cacheMaxAgeSeconds
118
+ */
119
+ cacheTtl?: number | false;
120
+ /**
121
+ * How long, in seconds, should the sitemap be cached for.
122
+ *
123
+ * @default 600
124
+ */
125
+ cacheMaxAgeSeconds: number | false;
126
+ /**
127
+ * Should the entries be sorted by loc.
128
+ *
129
+ * @default true
130
+ */
131
+ sortEntries: boolean;
132
+ /**
133
+ * Warm up the sitemap route(s) cache when Nitro starts.
134
+ *
135
+ * May be implemented by default in a future minor version.
136
+ *
137
+ * @experimental Will be enabled by default in v5 (if stable)
138
+ */
139
+ experimentalWarmUp?: boolean;
140
+ /**
141
+ * Send the Sitemap as a compressed stream supporting gzip, brolti, etc.
142
+ *
143
+ * @experimental Will be enabled by default in v5 (if stable)
144
+ */
145
+ experimentalCompression?: boolean;
146
+ }
147
+ interface IndexSitemapRemotes {
148
+ index?: (string | SitemapIndexEntry)[];
149
+ }
150
+ interface MultiSitemapEntry {
151
+ [key: string]: Partial<SitemapDefinition>;
152
+ }
153
+ type MultiSitemapsInput = Partial<MultiSitemapEntry & IndexSitemapRemotes>;
154
+ type MaybeFunction<T> = T | (() => T);
155
+ type MaybePromise<T> = T | Promise<T>;
156
+ type SitemapUrlInput = SitemapUrl | string;
157
+ interface SitemapSourceBase {
158
+ context: {
159
+ name: string;
160
+ description?: string;
161
+ tips?: string[];
162
+ };
163
+ fetch?: string | [string, FetchOptions];
164
+ urls?: SitemapUrlInput[];
165
+ sourceType?: 'app' | 'user';
166
+ }
167
+ interface SitemapSourceResolved extends Omit<SitemapSourceBase, 'urls'> {
168
+ urls: SitemapUrlInput[];
169
+ error?: any;
170
+ timeTakenMs?: number;
171
+ }
172
+ type AppSourceContext = 'nuxt:pages' | 'nuxt:prerender' | 'nuxt:route-rules' | '@nuxtjs/i18n:pages' | '@nuxt/content:document-driven';
173
+ type SitemapSourceInput = string | SitemapSourceBase | SitemapSourceResolved;
174
+ type NormalisedLocales = {
175
+ code: string;
176
+ iso?: string;
177
+ domain?: string;
178
+ }[];
179
+ interface AutoI18nConfig {
180
+ differentDomains?: boolean;
181
+ locales: NormalisedLocales;
182
+ defaultLocale: string;
183
+ strategy: 'prefix' | 'prefix_except_default' | 'prefix_and_default' | 'no_prefix';
184
+ }
185
+ interface SitemapIndexEntry {
186
+ sitemap: string;
187
+ lastmod?: string;
188
+ }
189
+ type FilterInput = (string | RegExp | {
190
+ regex: string;
191
+ });
192
+ type ResolvedSitemapUrl = Omit<SitemapUrl, 'url'> & Required<Pick<SitemapUrl, 'loc'>>;
193
+ interface SitemapDefinition {
194
+ /**
195
+ * A collection include patterns for filtering which URLs end up in the sitemap.
196
+ */
197
+ include?: FilterInput[];
198
+ /**
199
+ * A collection exclude patterns for filtering which URLs end up in the sitemap.
200
+ */
201
+ exclude?: FilterInput[];
202
+ /**
203
+ * Should the sitemap be generated using global sources.
204
+ *
205
+ * This is enabled by default when using a single sitemap. Otherwise, it will be opt-in.
206
+ */
207
+ includeAppSources?: boolean;
208
+ /**
209
+ * The root sitemap name.
210
+ * Only works when multiple sitemaps option `sitemaps` isn't used.
211
+ *
212
+ * @default `sitemap.xml`
213
+ */
214
+ sitemapName: string;
215
+ /**
216
+ * A resolvable collection of URLs to include in the sitemap.
217
+ *
218
+ * Will be resolved when the sitemap is generated.
219
+ */
220
+ urls?: MaybeFunction<MaybePromise<SitemapUrlInput[]>>;
221
+ /**
222
+ * Default options for all URLs in the sitemap.
223
+ */
224
+ defaults?: Omit<SitemapUrl, 'loc'>;
225
+ /**
226
+ * Additional sources of URLs to include in the sitemap.
227
+ */
228
+ sources?: SitemapSourceInput[];
229
+ /**
230
+ * The endpoint to fetch dynamic URLs from.
231
+ *
232
+ * @deprecated use `sources`
233
+ */
234
+ dynamicUrlsApiEndpoint?: string | false;
235
+ /**
236
+ * @internal
237
+ */
238
+ _route?: string;
239
+ }
240
+ interface SitemapRenderCtx {
241
+ sitemapName: string;
242
+ urls: ResolvedSitemapUrl[];
243
+ }
244
+ interface SitemapOutputHookCtx {
245
+ sitemapName: string;
246
+ sitemap: string;
247
+ }
248
+ type Changefreq = 'always' | 'hourly' | 'daily' | 'weekly' | 'monthly' | 'yearly' | 'never';
249
+ interface SitemapUrl {
250
+ loc: string;
251
+ lastmod?: string | Date;
252
+ changefreq?: Changefreq;
253
+ priority?: 0 | 0.1 | 0.2 | 0.3 | 0.4 | 0.5 | 0.6 | 0.7 | 0.8 | 0.9 | 1;
254
+ alternatives?: Array<AlternativeEntry>;
255
+ news?: GoogleNewsEntry;
256
+ images?: Array<ImageEntry>;
257
+ videos?: Array<VideoEntry>;
258
+ _i18nTransform?: boolean;
259
+ _sitemap?: string;
260
+ /**
261
+ * @deprecated use `loc`
262
+ */
263
+ url?: string;
264
+ }
265
+ interface AlternativeEntry {
266
+ hreflang: string;
267
+ href: string | URL;
268
+ }
269
+ interface GoogleNewsEntry {
270
+ /**
271
+ * The title of the news article.
272
+ * @example "Companies A, B in Merger Talks"
273
+ */
274
+ title: string;
275
+ /**
276
+ * The article publication date in W3C format. Specify the original date and time when the article was first
277
+ * published on your site. Don't specify the time when you added the article to your sitemap.
278
+ * @example "2008-12-23"
279
+ */
280
+ publication_date: Date | string;
281
+ publication: {
282
+ /**
283
+ * The <news:name> tag is the name of the news publication.
284
+ * It must exactly match the name as it appears on your articles on news.google.com, omitting anything in parentheses.
285
+ * @example "The Example Times"
286
+ */
287
+ name: string;
288
+ /**
289
+ * The <news:language> tag is the language of your publication. Use an ISO 639 language code (two or three letters).
290
+ * @example en
291
+ */
292
+ language: string;
293
+ };
294
+ }
295
+ interface ImageEntry {
296
+ loc: string | URL;
297
+ caption?: string;
298
+ geoLocation?: string;
299
+ title?: string;
300
+ license?: string | URL;
301
+ }
302
+ interface VideoEntry {
303
+ title: string;
304
+ thumbnail_loc: string | URL;
305
+ description: string;
306
+ content_loc?: string | URL;
307
+ player_loc?: string | URL;
308
+ duration?: number;
309
+ expiration_date?: Date | string;
310
+ rating?: number;
311
+ view_count?: number;
312
+ publication_date?: Date | string;
313
+ family_friendly?: 'yes' | 'no' | boolean;
314
+ restriction?: Restriction;
315
+ platform?: Platform;
316
+ price?: ({
317
+ price?: number | string;
318
+ currency?: string;
319
+ type?: 'rent' | 'purchase' | 'package' | 'subscription';
320
+ })[];
321
+ requires_subscription?: 'yes' | 'no' | boolean;
322
+ uploader?: {
323
+ uploader: string;
324
+ info?: string | URL;
325
+ };
326
+ live?: 'yes' | 'no' | boolean;
327
+ tag?: string | string[];
328
+ }
329
+ interface Restriction {
330
+ relationship: 'allow' | 'deny';
331
+ restriction: string;
332
+ }
333
+ interface Platform {
334
+ relationship: 'allow' | 'deny';
335
+ platform: string;
336
+ }
337
+
338
+ interface ModuleOptions extends ModuleOptions$1 {
339
+ }
340
+ interface ModuleHooks {
341
+ /**
342
+ * @deprecated use `sitemap:resolved` or `sitemap:output`
343
+ */
344
+ 'sitemap:prerender': (ctx: SitemapRenderCtx) => Promise<void> | void;
345
+ 'sitemap:resolved': (ctx: SitemapRenderCtx) => Promise<void> | void;
346
+ 'sitemap:output': (ctx: SitemapOutputHookCtx) => Promise<void> | void;
347
+ }
348
+ declare const _default: _nuxt_schema.NuxtModule<ModuleOptions>;
349
+
350
+ export { type ModuleHooks, type ModuleOptions, _default as default };
@@ -0,0 +1,9 @@
1
+ {
2
+ "name": "@nuxtjs/sitemap",
3
+ "compatibility": {
4
+ "nuxt": "^3.9.0",
5
+ "bridge": false
6
+ },
7
+ "configKey": "sitemap",
8
+ "version": "4.4.1"
9
+ }