@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.
- package/README.md +60 -593
- package/dist/client/200.html +11 -0
- package/dist/client/404.html +11 -0
- package/dist/client/_nuxt/Icon.I3NdYkjC.css +1 -0
- package/dist/client/_nuxt/Icon.wdYGFqbO.js +1 -0
- package/dist/client/_nuxt/IconCSS.6oz918NR.css +1 -0
- package/dist/client/_nuxt/IconCSS.L-uj6Ouj.js +1 -0
- package/dist/client/_nuxt/builds/latest.json +1 -0
- package/dist/client/_nuxt/builds/meta/c3bdccb2-d4db-4a94-9e61-39b740a57bf8.json +1 -0
- package/dist/client/_nuxt/entry.Soe9IWze.js +15 -0
- package/dist/client/_nuxt/entry.UqhvG0ao.css +1 -0
- package/dist/client/_nuxt/error-404.DkXpI38i.css +1 -0
- package/dist/client/_nuxt/error-404.uz-DxZsp.js +1 -0
- package/dist/client/_nuxt/error-500.BsNDeZpL.js +1 -0
- package/dist/client/_nuxt/error-500.SLhS9LVu.css +1 -0
- package/dist/client/_nuxt/index.lSDm5iYo.js +1 -0
- package/dist/client/index.html +11 -0
- package/dist/module.cjs +5 -0
- package/dist/module.d.mts +350 -0
- package/dist/module.d.ts +350 -0
- package/dist/module.json +9 -0
- package/dist/module.mjs +994 -0
- package/dist/runtime/nitro/composables/asSitemapUrl.d.ts +2 -0
- package/dist/runtime/nitro/composables/asSitemapUrl.mjs +3 -0
- package/dist/runtime/nitro/composables/defineSitemapEventHandler.d.ts +3 -0
- package/dist/runtime/nitro/composables/defineSitemapEventHandler.mjs +2 -0
- package/dist/runtime/nitro/composables/getPathRobotConfigPolyfill.d.ts +4 -0
- package/dist/runtime/nitro/composables/getPathRobotConfigPolyfill.mjs +3 -0
- package/dist/runtime/nitro/kit.d.ts +3 -0
- package/dist/runtime/nitro/kit.mjs +23 -0
- package/dist/runtime/nitro/middleware/[sitemap]-sitemap.xml.d.ts +2 -0
- package/dist/runtime/nitro/middleware/[sitemap]-sitemap.xml.mjs +23 -0
- package/dist/runtime/nitro/plugins/compression.d.ts +2 -0
- package/dist/runtime/nitro/plugins/compression.mjs +8 -0
- package/dist/runtime/nitro/plugins/nuxt-content.d.ts +2 -0
- package/dist/runtime/nitro/plugins/nuxt-content.mjs +38 -0
- package/dist/runtime/nitro/plugins/warm-up.d.ts +2 -0
- package/dist/runtime/nitro/plugins/warm-up.mjs +23 -0
- package/dist/runtime/nitro/routes/__sitemap__/debug.d.ts +37 -0
- package/dist/runtime/nitro/routes/__sitemap__/debug.mjs +29 -0
- package/dist/runtime/nitro/routes/__sitemap__/nuxt-content-urls.d.ts +2 -0
- package/dist/runtime/nitro/routes/__sitemap__/nuxt-content-urls.mjs +6 -0
- package/dist/runtime/nitro/routes/sitemap.xml.d.ts +2 -0
- package/dist/runtime/nitro/routes/sitemap.xml.mjs +13 -0
- package/dist/runtime/nitro/routes/sitemap.xsl.d.ts +2 -0
- package/dist/runtime/nitro/routes/sitemap.xsl.mjs +230 -0
- package/dist/runtime/nitro/routes/sitemap_index.xml.d.ts +2 -0
- package/dist/runtime/nitro/routes/sitemap_index.xml.mjs +27 -0
- package/dist/runtime/nitro/sitemap/builder/sitemap-index.d.ts +2 -0
- package/dist/runtime/nitro/sitemap/builder/sitemap-index.mjs +86 -0
- package/dist/runtime/nitro/sitemap/builder/sitemap.d.ts +2 -0
- package/dist/runtime/nitro/sitemap/builder/sitemap.mjs +107 -0
- package/dist/runtime/nitro/sitemap/builder/xml.d.ts +4 -0
- package/dist/runtime/nitro/sitemap/builder/xml.mjs +83 -0
- package/dist/runtime/nitro/sitemap/nitro.d.ts +4 -0
- package/dist/runtime/nitro/sitemap/nitro.mjs +36 -0
- package/dist/runtime/nitro/sitemap/urlset/filter.d.ts +5 -0
- package/dist/runtime/nitro/sitemap/urlset/filter.mjs +50 -0
- package/dist/runtime/nitro/sitemap/urlset/i18n.d.ts +8 -0
- package/dist/runtime/nitro/sitemap/urlset/i18n.mjs +128 -0
- package/dist/runtime/nitro/sitemap/urlset/normalise.d.ts +3 -0
- package/dist/runtime/nitro/sitemap/urlset/normalise.mjs +77 -0
- package/dist/runtime/nitro/sitemap/urlset/sort.d.ts +2 -0
- package/dist/runtime/nitro/sitemap/urlset/sort.mjs +19 -0
- package/dist/runtime/nitro/sitemap/urlset/sources.d.ts +5 -0
- package/dist/runtime/nitro/sitemap/urlset/sources.mjs +82 -0
- package/dist/runtime/nitro/tsconfig.json +3 -0
- package/dist/runtime/nitro/utils.d.ts +4 -0
- package/dist/runtime/nitro/utils.mjs +13 -0
- package/dist/runtime/types.d.ts +355 -0
- package/dist/runtime/types.mjs +0 -0
- package/dist/runtime/utils-pure.d.ts +7 -0
- package/dist/runtime/utils-pure.mjs +32 -0
- package/dist/types.d.mts +18 -0
- package/dist/types.d.ts +18 -0
- package/package.json +79 -75
- package/CHANGELOG.md +0 -268
- package/LICENSE +0 -21
- package/lib/builder.js +0 -172
- package/lib/cache.js +0 -95
- package/lib/generator.js +0 -113
- package/lib/logger.js +0 -19
- package/lib/middleware.js +0 -195
- package/lib/module.js +0 -72
- package/lib/options.js +0 -135
- package/lib/routes.js +0 -55
|
@@ -0,0 +1,355 @@
|
|
|
1
|
+
import type { FetchOptions } from 'ofetch';
|
|
2
|
+
import type { H3Event } from 'h3';
|
|
3
|
+
export interface ModuleOptions extends SitemapDefinition {
|
|
4
|
+
/**
|
|
5
|
+
* Whether the sitemap.xml should be generated.
|
|
6
|
+
*
|
|
7
|
+
* @default true
|
|
8
|
+
*/
|
|
9
|
+
enabled: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Enables debug logs and a debug endpoint.
|
|
12
|
+
*
|
|
13
|
+
* @default false
|
|
14
|
+
*/
|
|
15
|
+
debug: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Should lastmod be automatically added to the sitemap.
|
|
18
|
+
*
|
|
19
|
+
* Warning: This may not be following best practices for sitemaps.
|
|
20
|
+
*
|
|
21
|
+
* @see https://nuxtseo.com/sitemap/guides/best-practices.
|
|
22
|
+
* @default false
|
|
23
|
+
*/
|
|
24
|
+
autoLastmod: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Should pages be automatically added to the sitemap.
|
|
27
|
+
*
|
|
28
|
+
* @default true
|
|
29
|
+
* @deprecated If set to false, use `excludeAppSources: ['pages', 'route-rules', 'prerender']` instead. Otherwise, remove this.
|
|
30
|
+
*/
|
|
31
|
+
inferStaticPagesAsRoutes: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Sources to exclude from the sitemap.
|
|
34
|
+
*/
|
|
35
|
+
excludeAppSources: true | (AppSourceContext[]);
|
|
36
|
+
/**
|
|
37
|
+
* Multiple sitemap support for large sites.
|
|
38
|
+
*
|
|
39
|
+
* @default false
|
|
40
|
+
*/
|
|
41
|
+
sitemaps?: boolean | MultiSitemapsInput;
|
|
42
|
+
/**
|
|
43
|
+
* Path to the xsl that styles sitemap.xml.
|
|
44
|
+
*
|
|
45
|
+
* Set to `false` to disable styling.
|
|
46
|
+
*
|
|
47
|
+
* @default /__sitemap__/style.xsl
|
|
48
|
+
*/
|
|
49
|
+
xsl: string | false;
|
|
50
|
+
/**
|
|
51
|
+
* Toggle the tips displayed in the xsl.
|
|
52
|
+
*
|
|
53
|
+
* @default true
|
|
54
|
+
*/
|
|
55
|
+
xslTips: boolean;
|
|
56
|
+
/**
|
|
57
|
+
* Customised the columns displayed in the xsl.
|
|
58
|
+
*
|
|
59
|
+
* @default [{ label: 'URL', width: '50%', select: 'string' }, { label: 'Last Modified', width: '25%', select: 'lastmod' }, { label: 'Change Frequency', width: '25%', select: 'changefreq' }]
|
|
60
|
+
*/
|
|
61
|
+
xslColumns?: {
|
|
62
|
+
label: string;
|
|
63
|
+
width: `${string}%`;
|
|
64
|
+
select?: string;
|
|
65
|
+
}[];
|
|
66
|
+
/**
|
|
67
|
+
* When prerendering, should images be automatically be discovered and added to the sitemap.
|
|
68
|
+
*
|
|
69
|
+
* @default true
|
|
70
|
+
*/
|
|
71
|
+
discoverImages: boolean;
|
|
72
|
+
/**
|
|
73
|
+
* When chunking the sitemaps into multiple files, how many entries should each file contain.
|
|
74
|
+
*
|
|
75
|
+
* Set to `false` to disabling chunking completely.
|
|
76
|
+
*
|
|
77
|
+
* @default 1000
|
|
78
|
+
*/
|
|
79
|
+
defaultSitemapsChunkSize: number | false;
|
|
80
|
+
/**
|
|
81
|
+
* Modify the cache behavior.
|
|
82
|
+
*
|
|
83
|
+
* Passing a boolean will enable or disable the runtime cache with the default options.
|
|
84
|
+
*
|
|
85
|
+
* Providing a record will allow you to configure the runtime cache fully.
|
|
86
|
+
*
|
|
87
|
+
* @default true
|
|
88
|
+
* @see https://nitro.unjs.io/guide/storage#mountpoints
|
|
89
|
+
* @example { driver: 'redis', host: 'localhost', port: 6379, password: 'password' }
|
|
90
|
+
*/
|
|
91
|
+
runtimeCacheStorage: boolean | (Record<string, any> & {
|
|
92
|
+
driver: string;
|
|
93
|
+
});
|
|
94
|
+
/**
|
|
95
|
+
* Automatically add alternative links to the sitemap based on a prefix list.
|
|
96
|
+
* Is used by @nuxtjs/i18n to automatically add alternative links to the sitemap.
|
|
97
|
+
*/
|
|
98
|
+
autoI18n?: boolean | AutoI18nConfig;
|
|
99
|
+
/**
|
|
100
|
+
* Enable when your nuxt/content files match your pages. This will automatically add sitemap content to the sitemap.
|
|
101
|
+
*
|
|
102
|
+
* This is similar behavior to using `nuxt/content` with `documentDriven: true`.
|
|
103
|
+
*/
|
|
104
|
+
strictNuxtContentPaths: boolean;
|
|
105
|
+
/**
|
|
106
|
+
* Should the sitemap.xml display credits for the module.
|
|
107
|
+
*
|
|
108
|
+
* @default true
|
|
109
|
+
*/
|
|
110
|
+
credits: boolean;
|
|
111
|
+
/**
|
|
112
|
+
* How long, in milliseconds, should the sitemap be cached for.
|
|
113
|
+
*
|
|
114
|
+
* @default 1 hour
|
|
115
|
+
*
|
|
116
|
+
* @deprecated use cacheMaxAgeSeconds
|
|
117
|
+
*/
|
|
118
|
+
cacheTtl?: number | false;
|
|
119
|
+
/**
|
|
120
|
+
* How long, in seconds, should the sitemap be cached for.
|
|
121
|
+
*
|
|
122
|
+
* @default 600
|
|
123
|
+
*/
|
|
124
|
+
cacheMaxAgeSeconds: number | false;
|
|
125
|
+
/**
|
|
126
|
+
* Should the entries be sorted by loc.
|
|
127
|
+
*
|
|
128
|
+
* @default true
|
|
129
|
+
*/
|
|
130
|
+
sortEntries: boolean;
|
|
131
|
+
/**
|
|
132
|
+
* Warm up the sitemap route(s) cache when Nitro starts.
|
|
133
|
+
*
|
|
134
|
+
* May be implemented by default in a future minor version.
|
|
135
|
+
*
|
|
136
|
+
* @experimental Will be enabled by default in v5 (if stable)
|
|
137
|
+
*/
|
|
138
|
+
experimentalWarmUp?: boolean;
|
|
139
|
+
/**
|
|
140
|
+
* Send the Sitemap as a compressed stream supporting gzip, brolti, etc.
|
|
141
|
+
*
|
|
142
|
+
* @experimental Will be enabled by default in v5 (if stable)
|
|
143
|
+
*/
|
|
144
|
+
experimentalCompression?: boolean;
|
|
145
|
+
}
|
|
146
|
+
export interface IndexSitemapRemotes {
|
|
147
|
+
index?: (string | SitemapIndexEntry)[];
|
|
148
|
+
}
|
|
149
|
+
export interface MultiSitemapEntry {
|
|
150
|
+
[key: string]: Partial<SitemapDefinition>;
|
|
151
|
+
}
|
|
152
|
+
export type MultiSitemapsInput = Partial<MultiSitemapEntry & IndexSitemapRemotes>;
|
|
153
|
+
export type MaybeFunction<T> = T | (() => T);
|
|
154
|
+
export type MaybePromise<T> = T | Promise<T>;
|
|
155
|
+
export type SitemapUrlInput = SitemapUrl | string;
|
|
156
|
+
export interface SitemapSourceBase {
|
|
157
|
+
context: {
|
|
158
|
+
name: string;
|
|
159
|
+
description?: string;
|
|
160
|
+
tips?: string[];
|
|
161
|
+
};
|
|
162
|
+
fetch?: string | [string, FetchOptions];
|
|
163
|
+
urls?: SitemapUrlInput[];
|
|
164
|
+
sourceType?: 'app' | 'user';
|
|
165
|
+
}
|
|
166
|
+
export interface SitemapSourceResolved extends Omit<SitemapSourceBase, 'urls'> {
|
|
167
|
+
urls: SitemapUrlInput[];
|
|
168
|
+
error?: any;
|
|
169
|
+
timeTakenMs?: number;
|
|
170
|
+
}
|
|
171
|
+
export type AppSourceContext = 'nuxt:pages' | 'nuxt:prerender' | 'nuxt:route-rules' | '@nuxtjs/i18n:pages' | '@nuxt/content:document-driven';
|
|
172
|
+
export type SitemapSourceInput = string | SitemapSourceBase | SitemapSourceResolved;
|
|
173
|
+
export type NormalisedLocales = {
|
|
174
|
+
code: string;
|
|
175
|
+
iso?: string;
|
|
176
|
+
domain?: string;
|
|
177
|
+
}[];
|
|
178
|
+
export interface AutoI18nConfig {
|
|
179
|
+
differentDomains?: boolean;
|
|
180
|
+
locales: NormalisedLocales;
|
|
181
|
+
defaultLocale: string;
|
|
182
|
+
strategy: 'prefix' | 'prefix_except_default' | 'prefix_and_default' | 'no_prefix';
|
|
183
|
+
}
|
|
184
|
+
export interface ModuleRuntimeConfig extends Pick<ModuleOptions, 'cacheMaxAgeSeconds' | 'sitemapName' | 'excludeAppSources' | 'sortEntries' | 'defaultSitemapsChunkSize' | 'xslColumns' | 'xslTips' | 'debug' | 'discoverImages' | 'autoLastmod' | 'xsl' | 'credits'> {
|
|
185
|
+
version: string;
|
|
186
|
+
isNuxtContentDocumentDriven: boolean;
|
|
187
|
+
sitemaps: {
|
|
188
|
+
index?: Pick<SitemapDefinition, 'sitemapName' | '_route'> & {
|
|
189
|
+
sitemaps: SitemapIndexEntry[];
|
|
190
|
+
};
|
|
191
|
+
} & Record<string, Omit<SitemapDefinition, 'urls' | 'sources'> & {
|
|
192
|
+
_hasSourceChunk?: boolean;
|
|
193
|
+
}>;
|
|
194
|
+
autoI18n?: AutoI18nConfig;
|
|
195
|
+
isMultiSitemap: boolean;
|
|
196
|
+
isI18nMapped: boolean;
|
|
197
|
+
}
|
|
198
|
+
export interface SitemapIndexEntry {
|
|
199
|
+
sitemap: string;
|
|
200
|
+
lastmod?: string;
|
|
201
|
+
}
|
|
202
|
+
export type FilterInput = (string | RegExp | {
|
|
203
|
+
regex: string;
|
|
204
|
+
});
|
|
205
|
+
export type ResolvedSitemapUrl = Omit<SitemapUrl, 'url'> & Required<Pick<SitemapUrl, 'loc'>>;
|
|
206
|
+
export interface SitemapDefinition {
|
|
207
|
+
/**
|
|
208
|
+
* A collection include patterns for filtering which URLs end up in the sitemap.
|
|
209
|
+
*/
|
|
210
|
+
include?: FilterInput[];
|
|
211
|
+
/**
|
|
212
|
+
* A collection exclude patterns for filtering which URLs end up in the sitemap.
|
|
213
|
+
*/
|
|
214
|
+
exclude?: FilterInput[];
|
|
215
|
+
/**
|
|
216
|
+
* Should the sitemap be generated using global sources.
|
|
217
|
+
*
|
|
218
|
+
* This is enabled by default when using a single sitemap. Otherwise, it will be opt-in.
|
|
219
|
+
*/
|
|
220
|
+
includeAppSources?: boolean;
|
|
221
|
+
/**
|
|
222
|
+
* The root sitemap name.
|
|
223
|
+
* Only works when multiple sitemaps option `sitemaps` isn't used.
|
|
224
|
+
*
|
|
225
|
+
* @default `sitemap.xml`
|
|
226
|
+
*/
|
|
227
|
+
sitemapName: string;
|
|
228
|
+
/**
|
|
229
|
+
* A resolvable collection of URLs to include in the sitemap.
|
|
230
|
+
*
|
|
231
|
+
* Will be resolved when the sitemap is generated.
|
|
232
|
+
*/
|
|
233
|
+
urls?: MaybeFunction<MaybePromise<SitemapUrlInput[]>>;
|
|
234
|
+
/**
|
|
235
|
+
* Default options for all URLs in the sitemap.
|
|
236
|
+
*/
|
|
237
|
+
defaults?: Omit<SitemapUrl, 'loc'>;
|
|
238
|
+
/**
|
|
239
|
+
* Additional sources of URLs to include in the sitemap.
|
|
240
|
+
*/
|
|
241
|
+
sources?: SitemapSourceInput[];
|
|
242
|
+
/**
|
|
243
|
+
* The endpoint to fetch dynamic URLs from.
|
|
244
|
+
*
|
|
245
|
+
* @deprecated use `sources`
|
|
246
|
+
*/
|
|
247
|
+
dynamicUrlsApiEndpoint?: string | false;
|
|
248
|
+
/**
|
|
249
|
+
* @internal
|
|
250
|
+
*/
|
|
251
|
+
_route?: string;
|
|
252
|
+
}
|
|
253
|
+
export interface SitemapRenderCtx {
|
|
254
|
+
sitemapName: string;
|
|
255
|
+
urls: ResolvedSitemapUrl[];
|
|
256
|
+
}
|
|
257
|
+
export interface SitemapOutputHookCtx {
|
|
258
|
+
sitemapName: string;
|
|
259
|
+
sitemap: string;
|
|
260
|
+
}
|
|
261
|
+
export type Changefreq = 'always' | 'hourly' | 'daily' | 'weekly' | 'monthly' | 'yearly' | 'never';
|
|
262
|
+
export interface SitemapUrl {
|
|
263
|
+
loc: string;
|
|
264
|
+
lastmod?: string | Date;
|
|
265
|
+
changefreq?: Changefreq;
|
|
266
|
+
priority?: 0 | 0.1 | 0.2 | 0.3 | 0.4 | 0.5 | 0.6 | 0.7 | 0.8 | 0.9 | 1;
|
|
267
|
+
alternatives?: Array<AlternativeEntry>;
|
|
268
|
+
news?: GoogleNewsEntry;
|
|
269
|
+
images?: Array<ImageEntry>;
|
|
270
|
+
videos?: Array<VideoEntry>;
|
|
271
|
+
_i18nTransform?: boolean;
|
|
272
|
+
_sitemap?: string;
|
|
273
|
+
/**
|
|
274
|
+
* @deprecated use `loc`
|
|
275
|
+
*/
|
|
276
|
+
url?: string;
|
|
277
|
+
}
|
|
278
|
+
export interface AlternativeEntry {
|
|
279
|
+
hreflang: string;
|
|
280
|
+
href: string | URL;
|
|
281
|
+
}
|
|
282
|
+
export interface GoogleNewsEntry {
|
|
283
|
+
/**
|
|
284
|
+
* The title of the news article.
|
|
285
|
+
* @example "Companies A, B in Merger Talks"
|
|
286
|
+
*/
|
|
287
|
+
title: string;
|
|
288
|
+
/**
|
|
289
|
+
* The article publication date in W3C format. Specify the original date and time when the article was first
|
|
290
|
+
* published on your site. Don't specify the time when you added the article to your sitemap.
|
|
291
|
+
* @example "2008-12-23"
|
|
292
|
+
*/
|
|
293
|
+
publication_date: Date | string;
|
|
294
|
+
publication: {
|
|
295
|
+
/**
|
|
296
|
+
* The <news:name> tag is the name of the news publication.
|
|
297
|
+
* It must exactly match the name as it appears on your articles on news.google.com, omitting anything in parentheses.
|
|
298
|
+
* @example "The Example Times"
|
|
299
|
+
*/
|
|
300
|
+
name: string;
|
|
301
|
+
/**
|
|
302
|
+
* The <news:language> tag is the language of your publication. Use an ISO 639 language code (two or three letters).
|
|
303
|
+
* @example en
|
|
304
|
+
*/
|
|
305
|
+
language: string;
|
|
306
|
+
};
|
|
307
|
+
}
|
|
308
|
+
export interface ImageEntry {
|
|
309
|
+
loc: string | URL;
|
|
310
|
+
caption?: string;
|
|
311
|
+
geoLocation?: string;
|
|
312
|
+
title?: string;
|
|
313
|
+
license?: string | URL;
|
|
314
|
+
}
|
|
315
|
+
export interface VideoEntry {
|
|
316
|
+
title: string;
|
|
317
|
+
thumbnail_loc: string | URL;
|
|
318
|
+
description: string;
|
|
319
|
+
content_loc?: string | URL;
|
|
320
|
+
player_loc?: string | URL;
|
|
321
|
+
duration?: number;
|
|
322
|
+
expiration_date?: Date | string;
|
|
323
|
+
rating?: number;
|
|
324
|
+
view_count?: number;
|
|
325
|
+
publication_date?: Date | string;
|
|
326
|
+
family_friendly?: 'yes' | 'no' | boolean;
|
|
327
|
+
restriction?: Restriction;
|
|
328
|
+
platform?: Platform;
|
|
329
|
+
price?: ({
|
|
330
|
+
price?: number | string;
|
|
331
|
+
currency?: string;
|
|
332
|
+
type?: 'rent' | 'purchase' | 'package' | 'subscription';
|
|
333
|
+
})[];
|
|
334
|
+
requires_subscription?: 'yes' | 'no' | boolean;
|
|
335
|
+
uploader?: {
|
|
336
|
+
uploader: string;
|
|
337
|
+
info?: string | URL;
|
|
338
|
+
};
|
|
339
|
+
live?: 'yes' | 'no' | boolean;
|
|
340
|
+
tag?: string | string[];
|
|
341
|
+
}
|
|
342
|
+
export interface Restriction {
|
|
343
|
+
relationship: 'allow' | 'deny';
|
|
344
|
+
restriction: string;
|
|
345
|
+
}
|
|
346
|
+
export interface Platform {
|
|
347
|
+
relationship: 'allow' | 'deny';
|
|
348
|
+
platform: string;
|
|
349
|
+
}
|
|
350
|
+
export interface NitroUrlResolvers {
|
|
351
|
+
event: H3Event;
|
|
352
|
+
canonicalUrlResolver: (path: string) => string;
|
|
353
|
+
relativeBaseUrlResolver: (path: string) => string;
|
|
354
|
+
fixSlashes: (path: string) => string;
|
|
355
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { FilterInput } from './types';
|
|
2
|
+
export declare function mergeOnKey<T, K extends keyof T>(arr: T[], key: K): T[];
|
|
3
|
+
export declare function splitForLocales(path: string, locales: string[]): (string | null)[];
|
|
4
|
+
/**
|
|
5
|
+
* Transform a literal notation string regex to RegExp
|
|
6
|
+
*/
|
|
7
|
+
export declare function normalizeRuntimeFilters(input?: FilterInput[]): (RegExp | string)[];
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { createDefu } from "defu";
|
|
2
|
+
import { withLeadingSlash } from "ufo";
|
|
3
|
+
const merger = createDefu((obj, key, value) => {
|
|
4
|
+
if (Array.isArray(obj[key]) && Array.isArray(value))
|
|
5
|
+
obj[key] = Array.from(/* @__PURE__ */ new Set([...obj[key], ...value]));
|
|
6
|
+
return obj[key];
|
|
7
|
+
});
|
|
8
|
+
export function mergeOnKey(arr, key) {
|
|
9
|
+
const res = {};
|
|
10
|
+
arr.forEach((item) => {
|
|
11
|
+
const k = item[key];
|
|
12
|
+
res[k] = merger(item, res[k] || {});
|
|
13
|
+
});
|
|
14
|
+
return Object.values(res);
|
|
15
|
+
}
|
|
16
|
+
export function splitForLocales(path, locales) {
|
|
17
|
+
const prefix = withLeadingSlash(path).split("/")[1];
|
|
18
|
+
if (locales.includes(prefix))
|
|
19
|
+
return [prefix, path.replace(`/${prefix}`, "")];
|
|
20
|
+
return [null, path];
|
|
21
|
+
}
|
|
22
|
+
const StringifiedRegExpPattern = /\/(.*?)\/([gimsuy]*)$/;
|
|
23
|
+
export function normalizeRuntimeFilters(input) {
|
|
24
|
+
return (input || []).map((rule) => {
|
|
25
|
+
if (rule instanceof RegExp || typeof rule === "string")
|
|
26
|
+
return rule;
|
|
27
|
+
const match = rule.regex.match(StringifiedRegExpPattern);
|
|
28
|
+
if (match)
|
|
29
|
+
return new RegExp(match[1], match[2]);
|
|
30
|
+
return false;
|
|
31
|
+
}).filter(Boolean);
|
|
32
|
+
}
|
package/dist/types.d.mts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
|
|
2
|
+
import type { ModuleOptions, ModuleHooks } from './module.js'
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
declare module '@nuxt/schema' {
|
|
6
|
+
interface NuxtConfig { ['sitemap']?: Partial<ModuleOptions> }
|
|
7
|
+
interface NuxtOptions { ['sitemap']?: ModuleOptions }
|
|
8
|
+
interface NuxtHooks extends ModuleHooks {}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
declare module 'nuxt/schema' {
|
|
12
|
+
interface NuxtConfig { ['sitemap']?: Partial<ModuleOptions> }
|
|
13
|
+
interface NuxtOptions { ['sitemap']?: ModuleOptions }
|
|
14
|
+
interface NuxtHooks extends ModuleHooks {}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
export type { ModuleHooks, ModuleOptions, default } from './module.js'
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
|
|
2
|
+
import type { ModuleOptions, ModuleHooks } from './module'
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
declare module '@nuxt/schema' {
|
|
6
|
+
interface NuxtConfig { ['sitemap']?: Partial<ModuleOptions> }
|
|
7
|
+
interface NuxtOptions { ['sitemap']?: ModuleOptions }
|
|
8
|
+
interface NuxtHooks extends ModuleHooks {}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
declare module 'nuxt/schema' {
|
|
12
|
+
interface NuxtConfig { ['sitemap']?: Partial<ModuleOptions> }
|
|
13
|
+
interface NuxtOptions { ['sitemap']?: ModuleOptions }
|
|
14
|
+
interface NuxtHooks extends ModuleHooks {}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
export type { ModuleHooks, ModuleOptions, default } from './module'
|
package/package.json
CHANGED
|
@@ -1,87 +1,91 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nuxtjs/sitemap",
|
|
3
|
-
"
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
|
|
12
|
-
"ssr"
|
|
13
|
-
],
|
|
14
|
-
"repository": "https://github.com/nuxt-community/sitemap-module",
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "5.0.0",
|
|
5
|
+
"packageManager": "pnpm@8.14.0",
|
|
6
|
+
"description": "Powerfully flexible XML Sitemaps that integrate seamlessly, for Nuxt.",
|
|
7
|
+
"author": {
|
|
8
|
+
"name": "Harlan Wilton",
|
|
9
|
+
"email": "harlan@harlanzw.com",
|
|
10
|
+
"url": "https://harlanzw.com/"
|
|
11
|
+
},
|
|
15
12
|
"license": "MIT",
|
|
16
|
-
"
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
"name": "Pooya Parsa"
|
|
22
|
-
}
|
|
23
|
-
],
|
|
24
|
-
"files": [
|
|
25
|
-
"lib"
|
|
26
|
-
],
|
|
27
|
-
"main": "lib/module.js",
|
|
28
|
-
"scripts": {
|
|
29
|
-
"build": "nuxt build test/fixture",
|
|
30
|
-
"dev": "nuxt test/fixture",
|
|
31
|
-
"format": "yarn lint --fix",
|
|
32
|
-
"generate": "nuxt generate test/fixture",
|
|
33
|
-
"lint": "eslint . --ext js,vue",
|
|
34
|
-
"preview": "standard-version --dry-run",
|
|
35
|
-
"release": "standard-version && git push --follow-tags && npm publish",
|
|
36
|
-
"start": "nuxt start test/fixture",
|
|
37
|
-
"test": "yarn lint && yarn unit",
|
|
38
|
-
"unit": "jest"
|
|
13
|
+
"funding": "https://github.com/sponsors/harlan-zw",
|
|
14
|
+
"homepage": "https://github.com/nuxt-modules/sitemap#readme",
|
|
15
|
+
"repository": {
|
|
16
|
+
"type": "git",
|
|
17
|
+
"url": "git+https://github.com/nuxt-modules/sitemap.git"
|
|
39
18
|
},
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS",
|
|
43
|
-
"pre-commit": "lint-staged",
|
|
44
|
-
"pre-push": "yarn test"
|
|
45
|
-
}
|
|
19
|
+
"bugs": {
|
|
20
|
+
"url": "https://github.com/nuxt-modules/sitemap/issues"
|
|
46
21
|
},
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
|
|
22
|
+
"exports": {
|
|
23
|
+
".": {
|
|
24
|
+
"types": "./dist/types.d.ts",
|
|
25
|
+
"import": "./dist/module.mjs",
|
|
26
|
+
"require": "./dist/module.cjs"
|
|
27
|
+
}
|
|
51
28
|
},
|
|
29
|
+
"main": "./dist/module.cjs",
|
|
30
|
+
"types": "./dist/types.d.ts",
|
|
31
|
+
"files": [
|
|
32
|
+
"dist"
|
|
33
|
+
],
|
|
52
34
|
"dependencies": {
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"
|
|
35
|
+
"@nuxt/devtools-kit": "^1.0.6",
|
|
36
|
+
"@nuxt/devtools-ui-kit": "^1.0.6",
|
|
37
|
+
"@nuxt/kit": "^3.9.1",
|
|
38
|
+
"@vueuse/core": "^10.7.1",
|
|
39
|
+
"chalk": "^5.3.0",
|
|
40
|
+
"defu": "^6.1.4",
|
|
41
|
+
"floating-vue": "2.0.0-beta.24",
|
|
42
|
+
"h3-compression": "^0.3.2",
|
|
43
|
+
"nuxt-site-config": "^2.2.0",
|
|
44
|
+
"nuxt-site-config-kit": "^2.2.0",
|
|
45
|
+
"ofetch": "^1.3.3",
|
|
46
|
+
"pathe": "^1.1.1",
|
|
47
|
+
"radix3": "^1.1.0",
|
|
48
|
+
"semver": "^7.5.4",
|
|
49
|
+
"sirv": "^2.0.4",
|
|
50
|
+
"site-config-stack": "^2.2.0",
|
|
51
|
+
"ufo": "^1.3.2"
|
|
62
52
|
},
|
|
63
53
|
"devDependencies": {
|
|
64
|
-
"@
|
|
65
|
-
"@
|
|
66
|
-
"@
|
|
67
|
-
"
|
|
68
|
-
"
|
|
69
|
-
"
|
|
70
|
-
"eslint-
|
|
71
|
-
"
|
|
72
|
-
"
|
|
73
|
-
"
|
|
74
|
-
"
|
|
75
|
-
"nuxt
|
|
76
|
-
"
|
|
77
|
-
"
|
|
78
|
-
"
|
|
54
|
+
"@antfu/eslint-config": "^2.6.1",
|
|
55
|
+
"@nuxt/content": "^2.10.0",
|
|
56
|
+
"@nuxt/kit": "^3.9.1",
|
|
57
|
+
"@nuxt/module-builder": "^0.5.5",
|
|
58
|
+
"@nuxt/test-utils": "^3.9.0",
|
|
59
|
+
"@nuxt/ui": "^2.11.1",
|
|
60
|
+
"@nuxtjs/eslint-config-typescript": "^12.1.0",
|
|
61
|
+
"@nuxtjs/i18n": "8.0.0",
|
|
62
|
+
"bumpp": "^9.2.1",
|
|
63
|
+
"eslint": "8.56.0",
|
|
64
|
+
"execa": "^8.0.1",
|
|
65
|
+
"nuxt": "^3.9.1",
|
|
66
|
+
"nuxt-icon": "^0.6.8",
|
|
67
|
+
"nuxt-simple-robots": "^4.0.0-rc.9",
|
|
68
|
+
"typescript": "^5.3.3",
|
|
69
|
+
"vitest": "^1.1.3"
|
|
79
70
|
},
|
|
80
|
-
"
|
|
81
|
-
"
|
|
82
|
-
|
|
71
|
+
"build": {
|
|
72
|
+
"externals": [
|
|
73
|
+
"h3",
|
|
74
|
+
"std-env",
|
|
75
|
+
"nitropack"
|
|
76
|
+
]
|
|
83
77
|
},
|
|
84
|
-
"
|
|
85
|
-
"
|
|
78
|
+
"scripts": {
|
|
79
|
+
"lint": "eslint . --fix",
|
|
80
|
+
"client:build": "nuxi generate client",
|
|
81
|
+
"client:dev": "nuxi dev client --port 3300",
|
|
82
|
+
"build": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxt-module-build build && npm run client:build",
|
|
83
|
+
"dev": "nuxi dev .playground",
|
|
84
|
+
"dev:devtool": "nuxi dev .playground-devtools",
|
|
85
|
+
"dev:build": "nuxi build .playground",
|
|
86
|
+
"dev:prepare": "nuxt-module-build --stub && nuxi prepare .playground",
|
|
87
|
+
"release": "pnpm build && bumpp && pnpm -r publish",
|
|
88
|
+
"typecheck": "tsc --noEmit ",
|
|
89
|
+
"test": "vitest"
|
|
86
90
|
}
|
|
87
|
-
}
|
|
91
|
+
}
|