@nuxtjs/sitemap 6.0.0-beta.1 → 6.0.0-beta.2

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 (99) hide show
  1. package/dist/client/200.html +61 -53
  2. package/dist/client/404.html +61 -53
  3. package/dist/client/_nuxt/{D7WeZTai.js → -0RnDExV.js} +1 -1
  4. package/dist/client/_nuxt/{DOtRmeXT.js → -4dSXLqG.js} +1 -1
  5. package/dist/client/_nuxt/458cWEat.js +3 -0
  6. package/dist/client/_nuxt/{CFF2d1j6.js → BEZjiGez.js} +1 -1
  7. package/dist/client/_nuxt/{B3g-KkBK.js → BHqu4VKd.js} +1 -1
  8. package/dist/client/_nuxt/{D33OKbkv.js → BM5XuWfj.js} +1 -1
  9. package/dist/client/_nuxt/BMRpS3Xo.js +1 -0
  10. package/dist/client/_nuxt/{1rqFXsGc.js → BUinYsBq.js} +2 -2
  11. package/dist/client/_nuxt/BXP-NDAE.js +1 -0
  12. package/dist/client/_nuxt/{kuh6G-Sk.js → BZ035FK2.js} +1 -1
  13. package/dist/client/_nuxt/{DrnZp123.js → B_kA2_jD.js} +1 -1
  14. package/dist/client/_nuxt/BgSQePf4.js +1 -0
  15. package/dist/client/_nuxt/{CdedUr_-.js → BiVAY1KT.js} +1 -1
  16. package/dist/client/_nuxt/BpDWT_aG.js +1 -0
  17. package/dist/client/_nuxt/BpJyBuO9.js +1 -0
  18. package/dist/client/_nuxt/{BnyYJeap.js → Bpum8voz.js} +1 -1
  19. package/dist/client/_nuxt/Br9pa-sp.js +1 -0
  20. package/dist/client/_nuxt/BspO9hSn.js +1 -0
  21. package/dist/client/_nuxt/{DAP_O-zg.js → Bx64mzUw.js} +1 -1
  22. package/dist/client/_nuxt/Bym0hRiG.js +1 -0
  23. package/dist/client/_nuxt/C8DXlOXe.js +1 -0
  24. package/dist/client/_nuxt/{ECt0lbkd.js → CBks_G0r.js} +1 -1
  25. package/dist/client/_nuxt/COBxEbHI.js +1 -0
  26. package/dist/client/_nuxt/CPw9RxLe.js +1 -0
  27. package/dist/client/_nuxt/{dIHJ9UdL.js → CRYtL1Hd.js} +1 -1
  28. package/dist/client/_nuxt/CX3ZWouj.js +229 -0
  29. package/dist/client/_nuxt/{0ooBkv16.js → CaGCoJJM.js} +1 -1
  30. package/dist/client/_nuxt/Ctb_e1-I.js +1 -0
  31. package/dist/client/_nuxt/{D-VsDbcJ.js → CuOLCh11.js} +1 -1
  32. package/dist/client/_nuxt/{JgH_6NEN.js → CxBHuulF.js} +1 -1
  33. package/dist/client/_nuxt/{CJIaz0BQ.js → CxLlwT--.js} +1 -1
  34. package/dist/client/_nuxt/{B6bHXiXE.js → D3VHKxjW.js} +1 -1
  35. package/dist/client/_nuxt/D46m5Xd3.js +1 -0
  36. package/dist/client/_nuxt/D5OoM2Ul.js +1 -0
  37. package/dist/client/_nuxt/D5lQfeOG.js +1 -0
  38. package/dist/client/_nuxt/D8V69RRQ.js +1 -0
  39. package/dist/client/_nuxt/{CX_FIdg1.js → DDK5Hw8n.js} +1 -1
  40. package/dist/client/_nuxt/{C1yTBzia.js → DIyf2Ztx.js} +1 -1
  41. package/dist/client/_nuxt/{BZfs-ost.js → DOv5BRyJ.js} +1 -1
  42. package/dist/client/_nuxt/DQ-rpzxz.js +1 -0
  43. package/dist/client/_nuxt/DUsrs60I.js +6 -0
  44. package/dist/client/_nuxt/DV9_Ze0W.js +1 -0
  45. package/dist/client/_nuxt/{Bxkoe-BC.js → EQHFthT6.js} +1 -1
  46. package/dist/client/_nuxt/Ev-gWqHG.js +1 -0
  47. package/dist/client/_nuxt/{BacI6-DX.js → FRbOFgZn.js} +1 -1
  48. package/dist/client/_nuxt/{CqYeW6XZ.js → Gme1ZbSQ.js} +1 -1
  49. package/dist/client/_nuxt/{Br6ll-O0.js → NrGJGX17.js} +1 -1
  50. package/dist/client/_nuxt/{CarfVElc.js → ULUzDaxg.js} +1 -1
  51. package/dist/client/_nuxt/USEQoosB.js +31 -0
  52. package/dist/client/_nuxt/{DGDuLtS6.js → V16qqttt.js} +1 -1
  53. package/dist/client/_nuxt/builds/latest.json +1 -1
  54. package/dist/client/_nuxt/builds/meta/99e0fea3-c4e8-45fe-88b0-f49b86d00f5b.json +1 -0
  55. package/dist/client/_nuxt/d42HzezM.js +1 -0
  56. package/dist/client/_nuxt/entry.BnSVD-Km.css +1 -0
  57. package/dist/client/_nuxt/error-404.BOXiSWAJ.css +1 -0
  58. package/dist/client/_nuxt/error-500.DmKlUOlN.css +1 -0
  59. package/dist/client/_nuxt/{BXR915QZ.js → ewRyznZJ.js} +1 -1
  60. package/dist/client/_nuxt/{BVLuctcA.js → vMuZBeRS.js} +1 -1
  61. package/dist/client/_nuxt/{Bj5xdiaE.js → xuIuMB9j.js} +1 -1
  62. package/dist/client/_nuxt/{ChMCFiS0.js → zIdFMUa4.js} +1 -1
  63. package/dist/client/_nuxt/{BVkeqZ59.js → zbShYgi7.js} +1 -1
  64. package/dist/client/index.html +61 -53
  65. package/dist/module.d.mts +355 -1
  66. package/dist/module.d.ts +355 -1
  67. package/dist/module.json +2 -2
  68. package/dist/module.mjs +121 -14
  69. package/dist/runtime/nitro/routes/__sitemap__/debug.d.ts +7 -6
  70. package/dist/runtime/nitro/routes/sitemap_index.xml.js +1 -1
  71. package/dist/runtime/nitro/sitemap/builder/sitemap-index.d.ts +1 -1
  72. package/dist/runtime/nitro/sitemap/builder/sitemap-index.js +2 -2
  73. package/dist/runtime/nitro/sitemap/builder/sitemap.d.ts +1 -1
  74. package/dist/runtime/nitro/sitemap/builder/sitemap.js +2 -2
  75. package/dist/runtime/nitro/sitemap/builder/xml.d.ts +1 -1
  76. package/dist/runtime/nitro/sitemap/builder/xml.js +2 -0
  77. package/dist/runtime/nitro/sitemap/nitro.js +2 -1
  78. package/dist/runtime/types.d.ts +10 -3
  79. package/package.json +21 -20
  80. package/dist/client/_nuxt/3ghuYFLd.js +0 -1
  81. package/dist/client/_nuxt/9B1nZgL-.js +0 -1
  82. package/dist/client/_nuxt/BIxS-Weu.js +0 -1
  83. package/dist/client/_nuxt/BYdKNJ10.js +0 -1
  84. package/dist/client/_nuxt/Bi43K_FX.js +0 -6
  85. package/dist/client/_nuxt/CBPJd_fO.js +0 -1
  86. package/dist/client/_nuxt/CCqFro8U.js +0 -3
  87. package/dist/client/_nuxt/CEfge3mM.js +0 -1
  88. package/dist/client/_nuxt/CSPeAESR.js +0 -1
  89. package/dist/client/_nuxt/CY7GV1Ne.js +0 -31
  90. package/dist/client/_nuxt/DGO8GyiP.js +0 -1
  91. package/dist/client/_nuxt/DOHBU7tp.js +0 -1
  92. package/dist/client/_nuxt/DVLwECkk.js +0 -1
  93. package/dist/client/_nuxt/Du6_OKDb.js +0 -159
  94. package/dist/client/_nuxt/builds/meta/8204446e-0708-4f8e-bc4a-e52330d54aba.json +0 -1
  95. package/dist/client/_nuxt/dsisXUEW.js +0 -1
  96. package/dist/client/_nuxt/eJfcURhx.js +0 -1
  97. package/dist/client/_nuxt/entry.CfxF9LiM.css +0 -1
  98. package/dist/client/_nuxt/error-404.D56ZPmHb.css +0 -1
  99. package/dist/client/_nuxt/error-500.BYEp4uQX.css +0 -1
package/dist/module.json CHANGED
@@ -5,9 +5,9 @@
5
5
  "bridge": false
6
6
  },
7
7
  "configKey": "sitemap",
8
- "version": "5.3.5",
8
+ "version": "6.0.0-beta.1",
9
9
  "builder": {
10
- "@nuxt/module-builder": "0.8.1",
10
+ "@nuxt/module-builder": "0.8.3",
11
11
  "unbuild": "2.0.0"
12
12
  }
13
13
  }
package/dist/module.mjs CHANGED
@@ -1,18 +1,81 @@
1
1
  import { useNuxt, loadNuxtModuleInstance, createResolver, addTemplate, extendPages, defineNuxtModule, useLogger, hasNuxtModule, getNuxtModuleVersion, hasNuxtModuleCompatibility, addServerImports, addServerPlugin, addServerHandler, findPath, addPrerenderRoutes } from '@nuxt/kit';
2
- import { withHttps, withBase, parseURL, joinURL, withoutLeadingSlash, withoutTrailingSlash, withLeadingSlash } from 'ufo';
2
+ import { withLeadingSlash, parseURL, withHttps, withBase, joinURL, withoutLeadingSlash, withoutTrailingSlash } from 'ufo';
3
3
  import { assertSiteConfig, installNuxtSiteConfig } from 'nuxt-site-config-kit';
4
- import { defu } from 'defu';
4
+ import { createDefu, defu } from 'defu';
5
5
  import { readPackageJSON } from 'pkg-types';
6
6
  import { statSync, existsSync } from 'node:fs';
7
7
  import { extname, relative, dirname } from 'pathe';
8
- import { createPathFilter, splitForLocales, mergeOnKey } from '../dist/runtime/utils-pure.js';
8
+ import { toRouteMatcher, createRouter } from 'radix3';
9
+ import { createConsola } from 'consola';
9
10
  import { provider, env } from 'std-env';
10
11
  import { mkdir, writeFile } from 'node:fs/promises';
11
12
  import { join } from 'node:path';
12
13
  import chalk from 'chalk';
13
14
  import { build } from 'nitropack';
14
15
  import { withSiteUrl } from 'nuxt-site-config-kit/urls';
15
- import { normaliseDate } from '../dist/runtime/nitro/sitemap/urlset/normalise.js';
16
+
17
+ createConsola({
18
+ defaults: {
19
+ tag: "@nuxt/sitemap"
20
+ }
21
+ });
22
+ const merger = createDefu((obj, key, value) => {
23
+ if (Array.isArray(obj[key]) && Array.isArray(value))
24
+ obj[key] = Array.from(/* @__PURE__ */ new Set([...obj[key], ...value]));
25
+ return obj[key];
26
+ });
27
+ function mergeOnKey(arr, key) {
28
+ const res = {};
29
+ arr.forEach((item) => {
30
+ const k = item[key];
31
+ res[k] = merger(item, res[k] || {});
32
+ });
33
+ return Object.values(res);
34
+ }
35
+ function splitForLocales(path, locales) {
36
+ const prefix = withLeadingSlash(path).split("/")[1];
37
+ if (locales.includes(prefix))
38
+ return [prefix, path.replace(`/${prefix}`, "")];
39
+ return [null, path];
40
+ }
41
+ function createPathFilter(options = {}) {
42
+ const urlFilter = createFilter(options);
43
+ return (loc) => {
44
+ let path = loc;
45
+ try {
46
+ path = parseURL(loc).pathname;
47
+ } catch {
48
+ return false;
49
+ }
50
+ return urlFilter(path);
51
+ };
52
+ }
53
+ function createFilter(options = {}) {
54
+ const include = options.include || [];
55
+ const exclude = options.exclude || [];
56
+ if (include.length === 0 && exclude.length === 0)
57
+ return () => true;
58
+ return function(path) {
59
+ for (const v of [{ rules: exclude, result: false }, { rules: include, result: true }]) {
60
+ const regexRules = v.rules.filter((r) => r instanceof RegExp);
61
+ if (regexRules.some((r) => r.test(path)))
62
+ return v.result;
63
+ const stringRules = v.rules.filter((r) => typeof r === "string");
64
+ if (stringRules.length > 0) {
65
+ const routes = {};
66
+ for (const r of stringRules) {
67
+ if (r === path)
68
+ return v.result;
69
+ routes[r] = true;
70
+ }
71
+ const routeRulesMatcher = toRouteMatcher(createRouter({ routes, strictTrailingSlash: false }));
72
+ if (routeRulesMatcher.matchAll(path).length > 0)
73
+ return Boolean(v.result);
74
+ }
75
+ }
76
+ return include.length === 0;
77
+ };
78
+ }
16
79
 
17
80
  async function resolveUrls(urls, ctx) {
18
81
  if (typeof urls === "function")
@@ -483,6 +546,38 @@ function setupDevToolsUI(options, resolve, nuxt = useNuxt()) {
483
546
  });
484
547
  }
485
548
 
549
+ const IS_VALID_W3C_DATE = [
550
+ /(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))/,
551
+ /^\d{4}-[01]\d-[0-3]\d$/,
552
+ /^\d{4}-[01]\d$/,
553
+ /^\d{4}$/
554
+ ];
555
+ function isValidW3CDate(d) {
556
+ return IS_VALID_W3C_DATE.some((r) => r.test(d));
557
+ }
558
+ function normaliseDate(d) {
559
+ if (typeof d === "string") {
560
+ if (d.includes("T")) {
561
+ const t = d.split("T")[1];
562
+ if (!t.includes("+") && !t.includes("-") && !t.includes("Z")) {
563
+ d += "Z";
564
+ }
565
+ }
566
+ if (!isValidW3CDate(d))
567
+ return false;
568
+ d = new Date(d);
569
+ d.setMilliseconds(0);
570
+ if (Number.isNaN(d.getTime()))
571
+ return false;
572
+ }
573
+ const z = (n) => `0${n}`.slice(-2);
574
+ const date = `${d.getUTCFullYear()}-${z(d.getUTCMonth() + 1)}-${z(d.getUTCDate())}`;
575
+ if (d.getUTCHours() > 0 || d.getUTCMinutes() > 0 || d.getUTCSeconds() > 0) {
576
+ return `${date}T${z(d.getUTCHours())}:${z(d.getUTCMinutes())}:${z(d.getUTCSeconds())}Z`;
577
+ }
578
+ return date;
579
+ }
580
+
486
581
  function splitPathForI18nLocales(path, autoI18n) {
487
582
  const locales = autoI18n.strategy === "prefix_except_default" ? autoI18n.locales.filter((l) => l.code !== autoI18n.defaultLocale) : autoI18n.locales;
488
583
  if (typeof path !== "string" || path.startsWith("/_"))
@@ -496,6 +591,13 @@ function splitPathForI18nLocales(path, autoI18n) {
496
591
  ...locales.map((l) => `/${l.code}${path}`)
497
592
  ];
498
593
  }
594
+ function getExcludedLocalesFromI18nConfig(nuxtI18nConfig) {
595
+ const onlyLocales = nuxtI18nConfig?.bundle?.onlyLocales;
596
+ if (!onlyLocales)
597
+ return [];
598
+ const excludedLocales = typeof onlyLocales === "string" ? [onlyLocales] : onlyLocales;
599
+ return excludedLocales;
600
+ }
499
601
  function generatePathForI18nPages(ctx) {
500
602
  const { localeCode, pageLocales, nuxtI18nConfig, forcedStrategy, normalisedLocales } = ctx;
501
603
  const locale = normalisedLocales.find((l) => l.code === localeCode);
@@ -545,6 +647,7 @@ const module = defineNuxtModule({
545
647
  credits: true,
546
648
  cacheMaxAgeSeconds: 60 * 10,
547
649
  // cache for 10 minutes
650
+ minify: false,
548
651
  debug: false,
549
652
  defaultSitemapsChunkSize: 1e3,
550
653
  autoLastmod: false,
@@ -598,15 +701,17 @@ const module = defineNuxtModule({
598
701
  if (!nuxt.options._prepare && Object.keys(normalizedSitemaps).length) {
599
702
  const isSitemapIndexOnly = typeof normalizedSitemaps?.index !== "undefined" && Object.keys(normalizedSitemaps).length === 1;
600
703
  if (!isSitemapIndexOnly) {
601
- const invalidRootKeys = [
602
- "includeAppSources",
603
- "sources"
604
- ];
605
- for (const key of invalidRootKeys) {
606
- if (Object.keys(config).includes(key)) {
607
- logger.warn(`You are using multiple-sitemaps but have provided \`sitemap.${key}\` in your Nuxt config. This will be ignored, please move it to the child sitemap config.`);
608
- logger.warn("Learn more at: https://nuxtseo.com/sitemap/guides/multi-sitemaps");
609
- }
704
+ const warnForIgnoredKey = (key) => {
705
+ logger.warn(`You are using multiple-sitemaps but have provided \`sitemap.${key}\` in your Nuxt config. This will be ignored, please move it to the child sitemap config.`);
706
+ logger.warn("Learn more at: https://nuxtseo.com/sitemap/guides/multi-sitemaps");
707
+ };
708
+ switch (true) {
709
+ case config?.sources?.length !== 0:
710
+ warnForIgnoredKey("sources");
711
+ break;
712
+ case config?.includeAppSources !== void 0:
713
+ warnForIgnoredKey("includeAppSources");
714
+ break;
610
715
  }
611
716
  }
612
717
  }
@@ -636,7 +741,8 @@ const module = defineNuxtModule({
636
741
  if (!await hasNuxtModuleCompatibility("@nuxtjs/i18n", ">=8"))
637
742
  logger.warn(`You are using @nuxtjs/i18n v${i18nVersion}. For the best compatibility, please upgrade to @nuxtjs/i18n v8.0.0 or higher.`);
638
743
  nuxtI18nConfig = await getNuxtModuleOptions("@nuxtjs/i18n") || {};
639
- normalisedLocales = mergeOnKey((nuxtI18nConfig.locales || []).map((locale) => typeof locale === "string" ? { code: locale } : locale), "code");
744
+ const excludedLocales = getExcludedLocalesFromI18nConfig(nuxtI18nConfig);
745
+ normalisedLocales = mergeOnKey((nuxtI18nConfig.locales || []).map((locale) => typeof locale === "string" ? { code: locale } : locale), "code").filter((locale) => !excludedLocales.includes(locale.code));
640
746
  usingI18nPages = !!Object.keys(nuxtI18nConfig.pages || {}).length;
641
747
  if (usingI18nPages && !hasDisabledAutoI18n) {
642
748
  const i18nPagesSources = {
@@ -939,6 +1045,7 @@ declare module 'vue-router' {
939
1045
  cacheMaxAgeSeconds: nuxt.options.dev ? 0 : config.cacheMaxAgeSeconds,
940
1046
  autoLastmod: config.autoLastmod,
941
1047
  defaultSitemapsChunkSize: config.defaultSitemapsChunkSize,
1048
+ minify: config.minify,
942
1049
  sortEntries: config.sortEntries,
943
1050
  debug: config.debug,
944
1051
  // needed for nuxt/content integration and prerendering
@@ -6,25 +6,25 @@ declare const _default: import("h3").EventHandler<import("h3").EventHandlerReque
6
6
  version: string;
7
7
  isNuxtContentDocumentDriven: boolean;
8
8
  sitemaps: {
9
- index?: (Pick<SitemapDefinition, "sitemapName" | "_route"> & {
9
+ index?: Pick<SitemapDefinition, "sitemapName" | "_route"> & {
10
10
  sitemaps: import("../../../types").SitemapIndexEntry[];
11
- }) | undefined;
11
+ };
12
12
  } & Record<string, Omit<SitemapDefinition, "urls"> & {
13
- _hasSourceChunk?: boolean | undefined;
13
+ _hasSourceChunk?: boolean;
14
14
  }>;
15
- autoI18n?: import("../../../types").AutoI18nConfig | undefined;
15
+ autoI18n?: import("../../../types").AutoI18nConfig;
16
16
  isMultiSitemap: boolean;
17
17
  isI18nMapped: boolean;
18
18
  sitemapsPathPrefix: string;
19
19
  cacheMaxAgeSeconds: number | false;
20
20
  sitemapName: string;
21
- excludeAppSources: true | import("../../../types").AppSourceContext[];
21
+ excludeAppSources: true | (import("../../../types").AppSourceContext[]);
22
22
  sortEntries: boolean;
23
23
  defaultSitemapsChunkSize: number | false;
24
24
  xslColumns?: {
25
25
  label: string;
26
26
  width: `${string}%`;
27
- select?: string | undefined;
27
+ select?: string;
28
28
  }[] | undefined;
29
29
  xslTips: boolean;
30
30
  debug: boolean;
@@ -33,6 +33,7 @@ declare const _default: import("h3").EventHandler<import("h3").EventHandlerReque
33
33
  autoLastmod: boolean;
34
34
  xsl: string | false;
35
35
  credits: boolean;
36
+ minify: boolean;
36
37
  };
37
38
  globalSources: import("../../../types").SitemapSourceResolved[];
38
39
  }>>;
@@ -1,9 +1,9 @@
1
1
  import { appendHeader, defineEventHandler, setHeader } from "h3";
2
2
  import { joinURL } from "ufo";
3
+ import { useNitroApp } from "nitropack/runtime";
3
4
  import { useSimpleSitemapRuntimeConfig } from "../utils.js";
4
5
  import { buildSitemapIndex, urlsToIndexXml } from "../sitemap/builder/sitemap-index.js";
5
6
  import { useNitroUrlResolvers } from "../sitemap/nitro.js";
6
- import { useNitroApp } from "#imports";
7
7
  export default defineEventHandler(async (e) => {
8
8
  const runtimeConfig = useSimpleSitemapRuntimeConfig();
9
9
  const nitro = useNitroApp();
@@ -1,3 +1,3 @@
1
1
  import type { ModuleRuntimeConfig, NitroUrlResolvers, SitemapIndexEntry } from '../../../types.js';
2
2
  export declare function buildSitemapIndex(resolvers: NitroUrlResolvers, runtimeConfig: ModuleRuntimeConfig): Promise<SitemapIndexEntry[]>;
3
- export declare function urlsToIndexXml(sitemaps: SitemapIndexEntry[], resolvers: NitroUrlResolvers, { version, xsl, credits }: Pick<ModuleRuntimeConfig, 'version' | 'xsl' | 'credits'>): string;
3
+ export declare function urlsToIndexXml(sitemaps: SitemapIndexEntry[], resolvers: NitroUrlResolvers, { version, xsl, credits, minify }: Pick<ModuleRuntimeConfig, 'version' | 'xsl' | 'credits' | 'minify'>): string;
@@ -63,7 +63,7 @@ export async function buildSitemapIndex(resolvers, runtimeConfig) {
63
63
  }
64
64
  return entries;
65
65
  }
66
- export function urlsToIndexXml(sitemaps, resolvers, { version, xsl, credits }) {
66
+ export function urlsToIndexXml(sitemaps, resolvers, { version, xsl, credits, minify }) {
67
67
  const sitemapXml = sitemaps.map((e) => [
68
68
  " <sitemap>",
69
69
  ` <loc>${escapeValueForXml(e.sitemap)}</loc>`,
@@ -75,5 +75,5 @@ export function urlsToIndexXml(sitemaps, resolvers, { version, xsl, credits }) {
75
75
  '<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">',
76
76
  sitemapXml,
77
77
  "</sitemapindex>"
78
- ], resolvers, { version, xsl, credits });
78
+ ], resolvers, { version, xsl, credits, minify });
79
79
  }
@@ -6,4 +6,4 @@ export interface NormalizedI18n extends ResolvedSitemapUrl {
6
6
  }
7
7
  export declare function resolveSitemapEntries(sitemap: SitemapDefinition, sources: SitemapSourceResolved[], runtimeConfig: Pick<ModuleRuntimeConfig, 'autoI18n' | 'isI18nMapped'>): ResolvedSitemapUrl[];
8
8
  export declare function buildSitemapUrls(sitemap: SitemapDefinition, resolvers: NitroUrlResolvers, runtimeConfig: ModuleRuntimeConfig): Promise<ResolvedSitemapUrl[]>;
9
- export declare function urlsToXml(urls: ResolvedSitemapUrl[], resolvers: NitroUrlResolvers, { version, xsl, credits }: Pick<ModuleRuntimeConfig, 'version' | 'xsl' | 'credits'>): string;
9
+ export declare function urlsToXml(urls: ResolvedSitemapUrl[], resolvers: NitroUrlResolvers, { version, xsl, credits, minify }: Pick<ModuleRuntimeConfig, 'version' | 'xsl' | 'credits' | 'minify'>): string;
@@ -186,7 +186,7 @@ export async function buildSitemapUrls(sitemap, resolvers, runtimeConfig) {
186
186
  const sortedUrls = maybeSort(filteredUrls);
187
187
  return maybeSlice(sortedUrls);
188
188
  }
189
- export function urlsToXml(urls, resolvers, { version, xsl, credits }) {
189
+ export function urlsToXml(urls, resolvers, { version, xsl, credits, minify }) {
190
190
  const urlset = urls.map((e) => {
191
191
  const keys = Object.keys(e).filter((k) => !k.startsWith("_"));
192
192
  return [
@@ -199,5 +199,5 @@ export function urlsToXml(urls, resolvers, { version, xsl, credits }) {
199
199
  '<urlset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:video="http://www.google.com/schemas/sitemap-video/1.1" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" xmlns:news="http://www.google.com/schemas/sitemap-news/0.9" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd http://www.google.com/schemas/sitemap-image/1.1 http://www.google.com/schemas/sitemap-image/1.1/sitemap-image.xsd" xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">',
200
200
  urlset.join("\n"),
201
201
  "</urlset>"
202
- ], resolvers, { version, xsl, credits });
202
+ ], resolvers, { version, xsl, credits, minify });
203
203
  }
@@ -1,4 +1,4 @@
1
1
  import type { ModuleRuntimeConfig, NitroUrlResolvers } from '../../../types.js';
2
2
  export declare function handleEntry(k: string, e: Record<string, any> | (string | Record<string, any>)[]): string | false;
3
- export declare function wrapSitemapXml(input: string[], resolvers: NitroUrlResolvers, options: Pick<ModuleRuntimeConfig, 'version' | 'xsl' | 'credits'>): string;
3
+ export declare function wrapSitemapXml(input: string[], resolvers: NitroUrlResolvers, options: Pick<ModuleRuntimeConfig, 'version' | 'xsl' | 'credits' | 'minify'>): string;
4
4
  export declare function escapeValueForXml(value: boolean | string | number): string;
@@ -74,6 +74,8 @@ export function wrapSitemapXml(input, resolvers, options) {
74
74
  input.unshift(`<?xml version="1.0" encoding="UTF-8"?>${xsl ? `<?xml-stylesheet type="text/xsl" href="${xsl}"?>` : ""}`);
75
75
  if (credits)
76
76
  input.push(`<!-- XML Sitemap generated by @nuxtjs/sitemap v${options.version} at ${(/* @__PURE__ */ new Date()).toISOString()} -->`);
77
+ if (options.minify)
78
+ return input.join("").replace(/(?<!<[^>]*)\s(?![^<]*>)/g, "");
77
79
  return input.join("\n");
78
80
  }
79
81
  export function escapeValueForXml(value) {
@@ -1,12 +1,13 @@
1
1
  import { getQuery, setHeader } from "h3";
2
2
  import { fixSlashes } from "site-config-stack/urls";
3
3
  import { defu } from "defu";
4
+ import { useNitroApp } from "nitropack/runtime";
4
5
  import { mergeOnKey, splitForLocales } from "../../utils-pure.js";
5
6
  import { createNitroRouteRuleMatcher } from "../kit.js";
6
7
  import { buildSitemapUrls, urlsToXml } from "./builder/sitemap.js";
7
8
  import { normaliseEntry } from "./urlset/normalise.js";
8
9
  import { sortSitemapUrls } from "./urlset/sort.js";
9
- import { createSitePathResolver, getPathRobotConfig, useNitroApp, useSiteConfig } from "#imports";
10
+ import { createSitePathResolver, getPathRobotConfig, useSiteConfig } from "#imports";
10
11
  export function useNitroUrlResolvers(e) {
11
12
  const canonicalQuery = getQuery(e).canonical;
12
13
  const isShowingCanonical = typeof canonicalQuery !== "undefined" && canonicalQuery !== "false";
@@ -14,6 +14,12 @@ export interface ModuleOptions extends SitemapDefinition {
14
14
  * @default false
15
15
  */
16
16
  debug: boolean;
17
+ /**
18
+ * Minify the sitemap xml
19
+ *
20
+ * @default false
21
+ */
22
+ minify: boolean;
17
23
  /**
18
24
  * Should lastmod be automatically added to the sitemap.
19
25
  *
@@ -189,18 +195,19 @@ export interface SitemapSourceResolved extends Omit<SitemapSourceBase, 'urls'> {
189
195
  }
190
196
  export type AppSourceContext = 'nuxt:pages' | 'nuxt:prerender' | 'nuxt:route-rules' | '@nuxtjs/i18n:pages' | '@nuxt/content:document-driven';
191
197
  export type SitemapSourceInput = string | [string, FetchOptions] | SitemapSourceBase | SitemapSourceResolved;
192
- export type NormalisedLocales = {
198
+ export interface NormalisedLocale {
193
199
  code: string;
194
200
  iso?: string;
195
201
  domain?: string;
196
- }[];
202
+ }
203
+ export type NormalisedLocales = NormalisedLocale[];
197
204
  export interface AutoI18nConfig {
198
205
  differentDomains?: boolean;
199
206
  locales: NormalisedLocales;
200
207
  defaultLocale: string;
201
208
  strategy: 'prefix' | 'prefix_except_default' | 'prefix_and_default' | 'no_prefix';
202
209
  }
203
- export interface ModuleRuntimeConfig extends Pick<ModuleOptions, 'sitemapsPathPrefix' | 'cacheMaxAgeSeconds' | 'sitemapName' | 'excludeAppSources' | 'sortEntries' | 'defaultSitemapsChunkSize' | 'xslColumns' | 'xslTips' | 'debug' | 'discoverImages' | 'discoverVideos' | 'autoLastmod' | 'xsl' | 'credits'> {
210
+ export interface ModuleRuntimeConfig extends Pick<ModuleOptions, 'sitemapsPathPrefix' | 'cacheMaxAgeSeconds' | 'sitemapName' | 'excludeAppSources' | 'sortEntries' | 'defaultSitemapsChunkSize' | 'xslColumns' | 'xslTips' | 'debug' | 'discoverImages' | 'discoverVideos' | 'autoLastmod' | 'xsl' | 'credits' | 'minify'> {
204
211
  version: string;
205
212
  isNuxtContentDocumentDriven: boolean;
206
213
  sitemaps: {
package/package.json CHANGED
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "name": "@nuxtjs/sitemap",
3
3
  "type": "module",
4
- "version": "6.0.0-beta.1",
4
+ "version": "6.0.0-beta.2",
5
+ "packageManager": "pnpm@9.5.0",
5
6
  "description": "Powerfully flexible XML Sitemaps that integrate seamlessly, for Nuxt.",
6
7
  "author": {
7
8
  "name": "Harlan Wilton",
@@ -35,7 +36,7 @@
35
36
  ],
36
37
  "dependencies": {
37
38
  "@nuxt/devtools-kit": "^1.3.9",
38
- "@nuxt/kit": "^3.12.3",
39
+ "@nuxt/kit": "^3.12.4",
39
40
  "chalk": "^5.3.0",
40
41
  "defu": "^6.1.4",
41
42
  "h3-compression": "^0.3.2",
@@ -45,33 +46,33 @@
45
46
  "pathe": "^1.1.2",
46
47
  "pkg-types": "^1.1.3",
47
48
  "radix3": "^1.1.2",
48
- "semver": "^7.6.2",
49
+ "semver": "^7.6.3",
49
50
  "sirv": "^2.0.4",
50
51
  "site-config-stack": "^2.2.15",
51
- "ufo": "^1.5.3"
52
+ "ufo": "^1.5.4"
52
53
  },
53
54
  "devDependencies": {
54
- "@nuxt/content": "^2.13.1",
55
- "@nuxt/eslint-config": "^0.3.13",
56
- "@nuxt/kit": "^3.12.3",
57
- "@nuxt/module-builder": "0.8.1",
58
- "@nuxt/test-utils": "^3.13.1",
59
- "@nuxt/ui": "^2.17.0",
60
- "@nuxtjs/i18n": "8.3.1",
61
- "@nuxtjs/robots": "4.0.0-rc.22",
62
- "bumpp": "^9.4.1",
63
- "eslint": "9.6.0",
64
- "eslint-plugin-n": "^17.9.0",
65
- "execa": "^9.3.0",
66
- "nuxt": "^3.12.3",
67
- "typescript": "5.4.5",
68
- "vitest": "^2.0.3"
55
+ "@nuxt/content": "^2.13.2",
56
+ "@nuxt/eslint-config": "^0.5.0",
57
+ "@nuxt/module-builder": "0.8.3",
58
+ "@nuxt/test-utils": "^3.14.1",
59
+ "@nuxt/ui": "^2.18.4",
60
+ "@nuxtjs/i18n": "8.4.0",
61
+ "@nuxtjs/robots": "4.0.2",
62
+ "bumpp": "^9.5.1",
63
+ "eslint": "9.9.0",
64
+ "eslint-plugin-n": "^17.10.2",
65
+ "execa": "^9.3.1",
66
+ "nuxt": "^3.12.4",
67
+ "typescript": "5.5.4",
68
+ "vitest": "^2.0.5"
69
69
  },
70
70
  "build": {
71
71
  "externals": [
72
72
  "h3",
73
73
  "std-env",
74
- "nitropack"
74
+ "nitropack",
75
+ "consola"
75
76
  ]
76
77
  },
77
78
  "scripts": {
@@ -1 +0,0 @@
1
- const e=Object.freeze({displayName:"Bicep",fileTypes:[".bicep"],name:"bicep",patterns:[{include:"#expression"},{include:"#comments"}],repository:{"array-literal":{begin:"\\[(?!(?:[ \\t\\r\\n]|\\/\\*(?:\\*(?!\\/)|[^*])*\\*\\/)*\\bfor\\b)",end:"]",name:"meta.array-literal.bicep",patterns:[{include:"#expression"},{include:"#comments"}]},"block-comment":{begin:"/\\*",end:"\\*/",name:"comment.block.bicep"},comments:{patterns:[{include:"#line-comment"},{include:"#block-comment"}]},decorator:{begin:"@(?:[ \\t\\r\\n]|\\/\\*(?:\\*(?!\\/)|[^*])*\\*\\/)*(?=\\b[_$[:alpha:]][_$[:alnum:]]*\\b)",end:"",name:"meta.decorator.bicep",patterns:[{include:"#expression"},{include:"#comments"}]},directive:{begin:"#\\b[_a-zA-Z-0-9]+\\b",end:"$",name:"meta.directive.bicep",patterns:[{include:"#directive-variable"},{include:"#comments"}]},"directive-variable":{match:"\\b[_a-zA-Z-0-9]+\\b",name:"keyword.control.declaration.bicep"},"escape-character":{match:"\\\\(u{[0-9A-Fa-f]+}|n|r|t|\\\\|'|\\${)",name:"constant.character.escape.bicep"},expression:{patterns:[{include:"#string-literal"},{include:"#string-verbatim"},{include:"#numeric-literal"},{include:"#named-literal"},{include:"#object-literal"},{include:"#array-literal"},{include:"#keyword"},{include:"#identifier"},{include:"#function-call"},{include:"#decorator"},{include:"#lambda-start"},{include:"#directive"}]},"function-call":{begin:"(\\b[_$[:alpha:]][_$[:alnum:]]*\\b)(?:[ \\t\\r\\n]|\\/\\*(?:\\*(?!\\/)|[^*])*\\*\\/)*\\(",beginCaptures:{1:{name:"entity.name.function.bicep"}},end:"\\)",name:"meta.function-call.bicep",patterns:[{include:"#expression"},{include:"#comments"}]},identifier:{match:"\\b[_$[:alpha:]][_$[:alnum:]]*\\b(?!(?:[ \\t\\r\\n]|\\/\\*(?:\\*(?!\\/)|[^*])*\\*\\/)*\\()",name:"variable.other.readwrite.bicep"},keyword:{match:"\\b(metadata|targetScope|resource|module|param|var|output|for|in|if|existing|import|as|type|with|using|func|assert|provider)\\b",name:"keyword.control.declaration.bicep"},"lambda-start":{begin:"(\\((?:[ \\t\\r\\n]|\\/\\*(?:\\*(?!\\/)|[^*])*\\*\\/)*\\b[_$[:alpha:]][_$[:alnum:]]*\\b(?:[ \\t\\r\\n]|\\/\\*(?:\\*(?!\\/)|[^*])*\\*\\/)*(,(?:[ \\t\\r\\n]|\\/\\*(?:\\*(?!\\/)|[^*])*\\*\\/)*\\b[_$[:alpha:]][_$[:alnum:]]*\\b(?:[ \\t\\r\\n]|\\/\\*(?:\\*(?!\\/)|[^*])*\\*\\/)*)*\\)|\\((?:[ \\t\\r\\n]|\\/\\*(?:\\*(?!\\/)|[^*])*\\*\\/)*\\)|(?:[ \\t\\r\\n]|\\/\\*(?:\\*(?!\\/)|[^*])*\\*\\/)*\\b[_$[:alpha:]][_$[:alnum:]]*\\b(?:[ \\t\\r\\n]|\\/\\*(?:\\*(?!\\/)|[^*])*\\*\\/)*)(?=(?:[ \\t\\r\\n]|\\/\\*(?:\\*(?!\\/)|[^*])*\\*\\/)*=>)",beginCaptures:{1:{name:"meta.undefined.bicep",patterns:[{include:"#identifier"},{include:"#comments"}]}},end:"(?:[ \\t\\r\\n]|\\/\\*(?:\\*(?!\\/)|[^*])*\\*\\/)*=>",name:"meta.lambda-start.bicep"},"line-comment":{match:"//.*(?=$)",name:"comment.line.double-slash.bicep"},"named-literal":{match:"\\b(true|false|null)\\b",name:"constant.language.bicep"},"numeric-literal":{match:"[0-9]+",name:"constant.numeric.bicep"},"object-literal":{begin:"{",end:"}",name:"meta.object-literal.bicep",patterns:[{include:"#object-property-key"},{include:"#expression"},{include:"#comments"}]},"object-property-key":{match:"\\b[_$[:alpha:]][_$[:alnum:]]*\\b(?=(?:[ \\t\\r\\n]|\\/\\*(?:\\*(?!\\/)|[^*])*\\*\\/)*:)",name:"variable.other.property.bicep"},"string-literal":{begin:"'(?!'')",end:"'",name:"string.quoted.single.bicep",patterns:[{include:"#escape-character"},{include:"#string-literal-subst"}]},"string-literal-subst":{begin:"(?<!\\\\)(\\${)",beginCaptures:{1:{name:"punctuation.definition.template-expression.begin.bicep"}},end:"(})",endCaptures:{1:{name:"punctuation.definition.template-expression.end.bicep"}},name:"meta.string-literal-subst.bicep",patterns:[{include:"#expression"},{include:"#comments"}]},"string-verbatim":{begin:"'''",end:"'''(?!')",name:"string.quoted.multi.bicep",patterns:[]}},scopeName:"source.bicep"});var n=[e];export{n as default};
@@ -1 +0,0 @@
1
- var e=Object.freeze({colors:{"activityBar.activeBackground":"#BD93F910","activityBar.activeBorder":"#FF79C680","activityBar.background":"#343746","activityBar.foreground":"#f6f6f4","activityBar.inactiveForeground":"#7b7f8b","activityBarBadge.background":"#f286c4","activityBarBadge.foreground":"#f6f6f4","badge.background":"#44475A","badge.foreground":"#f6f6f4","breadcrumb.activeSelectionForeground":"#f6f6f4","breadcrumb.background":"#282A36","breadcrumb.focusForeground":"#f6f6f4","breadcrumb.foreground":"#7b7f8b","breadcrumbPicker.background":"#191A21","button.background":"#44475A","button.foreground":"#f6f6f4","button.secondaryBackground":"#282A36","button.secondaryForeground":"#f6f6f4","button.secondaryHoverBackground":"#343746","debugToolBar.background":"#262626","diffEditor.insertedTextBackground":"#50FA7B20","diffEditor.removedTextBackground":"#FF555550","dropdown.background":"#343746","dropdown.border":"#191A21","dropdown.foreground":"#f6f6f4","editor.background":"#282A36","editor.findMatchBackground":"#FFB86C80","editor.findMatchHighlightBackground":"#FFFFFF40","editor.findRangeHighlightBackground":"#44475A75","editor.foldBackground":"#21222C80","editor.foreground":"#f6f6f4","editor.hoverHighlightBackground":"#8BE9FD50","editor.lineHighlightBorder":"#44475A","editor.rangeHighlightBackground":"#BD93F915","editor.selectionBackground":"#44475A","editor.selectionHighlightBackground":"#424450","editor.snippetFinalTabstopHighlightBackground":"#282A36","editor.snippetFinalTabstopHighlightBorder":"#62e884","editor.snippetTabstopHighlightBackground":"#282A36","editor.snippetTabstopHighlightBorder":"#7b7f8b","editor.wordHighlightBackground":"#8BE9FD50","editor.wordHighlightStrongBackground":"#50FA7B50","editorBracketHighlight.foreground1":"#f6f6f4","editorBracketHighlight.foreground2":"#f286c4","editorBracketHighlight.foreground3":"#97e1f1","editorBracketHighlight.foreground4":"#62e884","editorBracketHighlight.foreground5":"#bf9eee","editorBracketHighlight.foreground6":"#FFB86C","editorBracketHighlight.unexpectedBracket.foreground":"#ee6666","editorCodeLens.foreground":"#7b7f8b","editorError.foreground":"#ee6666","editorGroup.border":"#bf9eee","editorGroup.dropBackground":"#44475A70","editorGroupHeader.tabsBackground":"#191A21","editorGutter.addedBackground":"#50FA7B80","editorGutter.deletedBackground":"#FF555580","editorGutter.modifiedBackground":"#8BE9FD80","editorHoverWidget.background":"#282A36","editorHoverWidget.border":"#7b7f8b","editorIndentGuide.activeBackground":"#FFFFFF45","editorIndentGuide.background":"#FFFFFF1A","editorLineNumber.foreground":"#7b7f8b","editorLink.activeForeground":"#97e1f1","editorMarkerNavigation.background":"#262626","editorOverviewRuler.addedForeground":"#50FA7B80","editorOverviewRuler.border":"#191A21","editorOverviewRuler.currentContentForeground":"#62e884","editorOverviewRuler.deletedForeground":"#FF555580","editorOverviewRuler.errorForeground":"#FF555580","editorOverviewRuler.incomingContentForeground":"#bf9eee","editorOverviewRuler.infoForeground":"#8BE9FD80","editorOverviewRuler.modifiedForeground":"#8BE9FD80","editorOverviewRuler.selectionHighlightForeground":"#FFB86C","editorOverviewRuler.warningForeground":"#FFB86C80","editorOverviewRuler.wordHighlightForeground":"#97e1f1","editorOverviewRuler.wordHighlightStrongForeground":"#62e884","editorRuler.foreground":"#FFFFFF1A","editorSuggestWidget.background":"#262626","editorSuggestWidget.foreground":"#f6f6f4","editorSuggestWidget.selectedBackground":"#44475A","editorWarning.foreground":"#97e1f1","editorWhitespace.foreground":"#FFFFFF1A","editorWidget.background":"#262626",errorForeground:"#ee6666","extensionButton.prominentBackground":"#50FA7B90","extensionButton.prominentForeground":"#f6f6f4","extensionButton.prominentHoverBackground":"#50FA7B60",focusBorder:"#7b7f8b",foreground:"#f6f6f4","gitDecoration.conflictingResourceForeground":"#FFB86C","gitDecoration.deletedResourceForeground":"#ee6666","gitDecoration.ignoredResourceForeground":"#7b7f8b","gitDecoration.modifiedResourceForeground":"#97e1f1","gitDecoration.untrackedResourceForeground":"#62e884","inlineChat.regionHighlight":"#343746","input.background":"#282A36","input.border":"#191A21","input.foreground":"#f6f6f4","input.placeholderForeground":"#7b7f8b","inputOption.activeBorder":"#bf9eee","inputValidation.errorBorder":"#ee6666","inputValidation.infoBorder":"#f286c4","inputValidation.warningBorder":"#FFB86C","list.activeSelectionBackground":"#44475A","list.activeSelectionForeground":"#f6f6f4","list.dropBackground":"#44475A","list.errorForeground":"#ee6666","list.focusBackground":"#44475A75","list.highlightForeground":"#97e1f1","list.hoverBackground":"#44475A75","list.inactiveSelectionBackground":"#44475A75","list.warningForeground":"#FFB86C","listFilterWidget.background":"#343746","listFilterWidget.noMatchesOutline":"#ee6666","listFilterWidget.outline":"#424450","merge.currentHeaderBackground":"#50FA7B90","merge.incomingHeaderBackground":"#BD93F990","panel.background":"#282A36","panel.border":"#bf9eee","panelTitle.activeBorder":"#f286c4","panelTitle.activeForeground":"#f6f6f4","panelTitle.inactiveForeground":"#7b7f8b","peekView.border":"#44475A","peekViewEditor.background":"#282A36","peekViewEditor.matchHighlightBackground":"#F1FA8C80","peekViewResult.background":"#262626","peekViewResult.fileForeground":"#f6f6f4","peekViewResult.lineForeground":"#f6f6f4","peekViewResult.matchHighlightBackground":"#F1FA8C80","peekViewResult.selectionBackground":"#44475A","peekViewResult.selectionForeground":"#f6f6f4","peekViewTitle.background":"#191A21","peekViewTitleDescription.foreground":"#7b7f8b","peekViewTitleLabel.foreground":"#f6f6f4","pickerGroup.border":"#bf9eee","pickerGroup.foreground":"#97e1f1","progressBar.background":"#f286c4","selection.background":"#bf9eee","settings.checkboxBackground":"#262626","settings.checkboxBorder":"#191A21","settings.checkboxForeground":"#f6f6f4","settings.dropdownBackground":"#262626","settings.dropdownBorder":"#191A21","settings.dropdownForeground":"#f6f6f4","settings.headerForeground":"#f6f6f4","settings.modifiedItemIndicator":"#FFB86C","settings.numberInputBackground":"#262626","settings.numberInputBorder":"#191A21","settings.numberInputForeground":"#f6f6f4","settings.textInputBackground":"#262626","settings.textInputBorder":"#191A21","settings.textInputForeground":"#f6f6f4","sideBar.background":"#262626","sideBarSectionHeader.background":"#282A36","sideBarSectionHeader.border":"#191A21","sideBarTitle.foreground":"#f6f6f4","statusBar.background":"#191A21","statusBar.debuggingBackground":"#ee6666","statusBar.debuggingForeground":"#191A21","statusBar.foreground":"#f6f6f4","statusBar.noFolderBackground":"#191A21","statusBar.noFolderForeground":"#f6f6f4","statusBarItem.prominentBackground":"#ee6666","statusBarItem.prominentHoverBackground":"#FFB86C","statusBarItem.remoteBackground":"#bf9eee","statusBarItem.remoteForeground":"#282A36","tab.activeBackground":"#282A36","tab.activeBorderTop":"#FF79C680","tab.activeForeground":"#f6f6f4","tab.border":"#191A21","tab.inactiveBackground":"#262626","tab.inactiveForeground":"#7b7f8b","terminal.ansiBlack":"#262626","terminal.ansiBlue":"#bf9eee","terminal.ansiBrightBlack":"#7b7f8b","terminal.ansiBrightBlue":"#d6b4f7","terminal.ansiBrightCyan":"#adf6f6","terminal.ansiBrightGreen":"#78f09a","terminal.ansiBrightMagenta":"#f49dda","terminal.ansiBrightRed":"#f07c7c","terminal.ansiBrightWhite":"#ffffff","terminal.ansiBrightYellow":"#f6f6ae","terminal.ansiCyan":"#97e1f1","terminal.ansiGreen":"#62e884","terminal.ansiMagenta":"#f286c4","terminal.ansiRed":"#ee6666","terminal.ansiWhite":"#f6f6f4","terminal.ansiYellow":"#e7ee98","terminal.background":"#282A36","terminal.foreground":"#f6f6f4","titleBar.activeBackground":"#262626","titleBar.activeForeground":"#f6f6f4","titleBar.inactiveBackground":"#191A21","titleBar.inactiveForeground":"#7b7f8b","walkThrough.embeddedEditorBackground":"#262626"},displayName:"Dracula Soft",name:"dracula-soft",semanticHighlighting:!0,tokenColors:[{scope:["emphasis"],settings:{fontStyle:"italic"}},{scope:["strong"],settings:{fontStyle:"bold"}},{scope:["header"],settings:{foreground:"#bf9eee"}},{scope:["meta.diff","meta.diff.header"],settings:{foreground:"#7b7f8b"}},{scope:["markup.inserted"],settings:{foreground:"#62e884"}},{scope:["markup.deleted"],settings:{foreground:"#ee6666"}},{scope:["markup.changed"],settings:{foreground:"#FFB86C"}},{scope:["invalid"],settings:{fontStyle:"underline italic",foreground:"#ee6666"}},{scope:["invalid.deprecated"],settings:{fontStyle:"underline italic",foreground:"#f6f6f4"}},{scope:["entity.name.filename"],settings:{foreground:"#e7ee98"}},{scope:["markup.error"],settings:{foreground:"#ee6666"}},{scope:["markup.underline"],settings:{fontStyle:"underline"}},{scope:["markup.bold"],settings:{fontStyle:"bold",foreground:"#FFB86C"}},{scope:["markup.heading"],settings:{fontStyle:"bold",foreground:"#bf9eee"}},{scope:["markup.italic"],settings:{fontStyle:"italic",foreground:"#e7ee98"}},{scope:["beginning.punctuation.definition.list.markdown","beginning.punctuation.definition.quote.markdown","punctuation.definition.link.restructuredtext"],settings:{foreground:"#97e1f1"}},{scope:["markup.inline.raw","markup.raw.restructuredtext"],settings:{foreground:"#62e884"}},{scope:["markup.underline.link","markup.underline.link.image"],settings:{foreground:"#97e1f1"}},{scope:["meta.link.reference.def.restructuredtext","punctuation.definition.directive.restructuredtext","string.other.link.description","string.other.link.title"],settings:{foreground:"#f286c4"}},{scope:["entity.name.directive.restructuredtext","markup.quote"],settings:{fontStyle:"italic",foreground:"#e7ee98"}},{scope:["meta.separator.markdown"],settings:{foreground:"#7b7f8b"}},{scope:["fenced_code.block.language","markup.raw.inner.restructuredtext","markup.fenced_code.block.markdown punctuation.definition.markdown"],settings:{foreground:"#62e884"}},{scope:["punctuation.definition.constant.restructuredtext"],settings:{foreground:"#bf9eee"}},{scope:["markup.heading.markdown punctuation.definition.string.begin","markup.heading.markdown punctuation.definition.string.end"],settings:{foreground:"#bf9eee"}},{scope:["meta.paragraph.markdown punctuation.definition.string.begin","meta.paragraph.markdown punctuation.definition.string.end"],settings:{foreground:"#f6f6f4"}},{scope:["markup.quote.markdown meta.paragraph.markdown punctuation.definition.string.begin","markup.quote.markdown meta.paragraph.markdown punctuation.definition.string.end"],settings:{foreground:"#e7ee98"}},{scope:["entity.name.type.class","entity.name.class"],settings:{fontStyle:"normal",foreground:"#97e1f1"}},{scope:["keyword.expressions-and-types.swift","keyword.other.this","variable.language","variable.language punctuation.definition.variable.php","variable.other.readwrite.instance.ruby","variable.parameter.function.language.special"],settings:{fontStyle:"italic",foreground:"#bf9eee"}},{scope:["entity.other.inherited-class"],settings:{fontStyle:"italic",foreground:"#97e1f1"}},{scope:["comment","punctuation.definition.comment","unused.comment","wildcard.comment"],settings:{foreground:"#7b7f8b"}},{scope:["comment keyword.codetag.notation","comment.block.documentation keyword","comment.block.documentation storage.type.class"],settings:{foreground:"#f286c4"}},{scope:["comment.block.documentation entity.name.type"],settings:{fontStyle:"italic",foreground:"#97e1f1"}},{scope:["comment.block.documentation entity.name.type punctuation.definition.bracket"],settings:{foreground:"#97e1f1"}},{scope:["comment.block.documentation variable"],settings:{fontStyle:"italic",foreground:"#FFB86C"}},{scope:["constant","variable.other.constant"],settings:{foreground:"#bf9eee"}},{scope:["constant.character.escape","constant.character.string.escape","constant.regexp"],settings:{foreground:"#f286c4"}},{scope:["entity.name.tag"],settings:{foreground:"#f286c4"}},{scope:["entity.other.attribute-name.parent-selector"],settings:{foreground:"#f286c4"}},{scope:["entity.other.attribute-name"],settings:{fontStyle:"italic",foreground:"#62e884"}},{scope:["entity.name.function","meta.function-call.object","meta.function-call.php","meta.function-call.static","meta.method-call.java meta.method","meta.method.groovy","support.function.any-method.lua","keyword.operator.function.infix"],settings:{foreground:"#62e884"}},{scope:["entity.name.variable.parameter","meta.at-rule.function variable","meta.at-rule.mixin variable","meta.function.arguments variable.other.php","meta.selectionset.graphql meta.arguments.graphql variable.arguments.graphql","variable.parameter"],settings:{fontStyle:"italic",foreground:"#FFB86C"}},{scope:["meta.decorator variable.other.readwrite","meta.decorator variable.other.property"],settings:{fontStyle:"italic",foreground:"#62e884"}},{scope:["meta.decorator variable.other.object"],settings:{foreground:"#62e884"}},{scope:["keyword","punctuation.definition.keyword"],settings:{foreground:"#f286c4"}},{scope:["keyword.control.new","keyword.operator.new"],settings:{fontStyle:"bold"}},{scope:["meta.selector"],settings:{foreground:"#f286c4"}},{scope:["support"],settings:{fontStyle:"italic",foreground:"#97e1f1"}},{scope:["support.function.magic","support.variable","variable.other.predefined"],settings:{fontStyle:"regular",foreground:"#bf9eee"}},{scope:["support.function","support.type.property-name"],settings:{fontStyle:"regular"}},{scope:["constant.other.symbol.hashkey punctuation.definition.constant.ruby","entity.other.attribute-name.placeholder punctuation","entity.other.attribute-name.pseudo-class punctuation","entity.other.attribute-name.pseudo-element punctuation","meta.group.double.toml","meta.group.toml","meta.object-binding-pattern-variable punctuation.destructuring","punctuation.colon.graphql","punctuation.definition.block.scalar.folded.yaml","punctuation.definition.block.scalar.literal.yaml","punctuation.definition.block.sequence.item.yaml","punctuation.definition.entity.other.inherited-class","punctuation.function.swift","punctuation.separator.dictionary.key-value","punctuation.separator.hash","punctuation.separator.inheritance","punctuation.separator.key-value","punctuation.separator.key-value.mapping.yaml","punctuation.separator.namespace","punctuation.separator.pointer-access","punctuation.separator.slice","string.unquoted.heredoc punctuation.definition.string","support.other.chomping-indicator.yaml","punctuation.separator.annotation"],settings:{foreground:"#f286c4"}},{scope:["keyword.operator.other.powershell","keyword.other.statement-separator.powershell","meta.brace.round","meta.function-call punctuation","punctuation.definition.arguments.begin","punctuation.definition.arguments.end","punctuation.definition.entity.begin","punctuation.definition.entity.end","punctuation.definition.tag.cs","punctuation.definition.type.begin","punctuation.definition.type.end","punctuation.section.scope.begin","punctuation.section.scope.end","punctuation.terminator.expression.php","storage.type.generic.java","string.template meta.brace","string.template punctuation.accessor"],settings:{foreground:"#f6f6f4"}},{scope:["meta.string-contents.quoted.double punctuation.definition.variable","punctuation.definition.interpolation.begin","punctuation.definition.interpolation.end","punctuation.definition.template-expression.begin","punctuation.definition.template-expression.end","punctuation.section.embedded.begin","punctuation.section.embedded.coffee","punctuation.section.embedded.end","punctuation.section.embedded.end source.php","punctuation.section.embedded.end source.ruby","punctuation.definition.variable.makefile"],settings:{foreground:"#f286c4"}},{scope:["entity.name.function.target.makefile","entity.name.section.toml","entity.name.tag.yaml","variable.other.key.toml"],settings:{foreground:"#97e1f1"}},{scope:["constant.other.date","constant.other.timestamp"],settings:{foreground:"#FFB86C"}},{scope:["variable.other.alias.yaml"],settings:{fontStyle:"italic underline",foreground:"#62e884"}},{scope:["storage","meta.implementation storage.type.objc","meta.interface-or-protocol storage.type.objc","source.groovy storage.type.def"],settings:{fontStyle:"regular",foreground:"#f286c4"}},{scope:["entity.name.type","keyword.primitive-datatypes.swift","keyword.type.cs","meta.protocol-list.objc","meta.return-type.objc","source.go storage.type","source.groovy storage.type","source.java storage.type","source.powershell entity.other.attribute-name","storage.class.std.rust","storage.type.attribute.swift","storage.type.c","storage.type.core.rust","storage.type.cs","storage.type.groovy","storage.type.objc","storage.type.php","storage.type.haskell","storage.type.ocaml"],settings:{fontStyle:"italic",foreground:"#97e1f1"}},{scope:["entity.name.type.type-parameter","meta.indexer.mappedtype.declaration entity.name.type","meta.type.parameters entity.name.type"],settings:{foreground:"#FFB86C"}},{scope:["storage.modifier"],settings:{foreground:"#f286c4"}},{scope:["string.regexp","constant.other.character-class.set.regexp","constant.character.escape.backslash.regexp"],settings:{foreground:"#e7ee98"}},{scope:["punctuation.definition.group.capture.regexp"],settings:{foreground:"#f286c4"}},{scope:["string.regexp punctuation.definition.string.begin","string.regexp punctuation.definition.string.end"],settings:{foreground:"#ee6666"}},{scope:["punctuation.definition.character-class.regexp"],settings:{foreground:"#97e1f1"}},{scope:["punctuation.definition.group.regexp"],settings:{foreground:"#FFB86C"}},{scope:["punctuation.definition.group.assertion.regexp","keyword.operator.negation.regexp"],settings:{foreground:"#ee6666"}},{scope:["meta.assertion.look-ahead.regexp"],settings:{foreground:"#62e884"}},{scope:["string"],settings:{foreground:"#e7ee98"}},{scope:["punctuation.definition.string.begin","punctuation.definition.string.end"],settings:{foreground:"#dee492"}},{scope:["punctuation.support.type.property-name.begin","punctuation.support.type.property-name.end"],settings:{foreground:"#97e2f2"}},{scope:["string.quoted.docstring.multi","string.quoted.docstring.multi.python punctuation.definition.string.begin","string.quoted.docstring.multi.python punctuation.definition.string.end","string.quoted.docstring.multi.python constant.character.escape"],settings:{foreground:"#7b7f8b"}},{scope:["variable","constant.other.key.perl","support.variable.property","variable.other.constant.js","variable.other.constant.ts","variable.other.constant.tsx"],settings:{foreground:"#f6f6f4"}},{scope:["meta.import variable.other.readwrite","meta.variable.assignment.destructured.object.coffee variable"],settings:{fontStyle:"italic",foreground:"#FFB86C"}},{scope:["meta.import variable.other.readwrite.alias","meta.export variable.other.readwrite.alias","meta.variable.assignment.destructured.object.coffee variable variable"],settings:{fontStyle:"normal",foreground:"#f6f6f4"}},{scope:["meta.selectionset.graphql variable"],settings:{foreground:"#e7ee98"}},{scope:["meta.selectionset.graphql meta.arguments variable"],settings:{foreground:"#f6f6f4"}},{scope:["entity.name.fragment.graphql","variable.fragment.graphql"],settings:{foreground:"#97e1f1"}},{scope:["constant.other.symbol.hashkey.ruby","keyword.operator.dereference.java","keyword.operator.navigation.groovy","meta.scope.for-loop.shell punctuation.definition.string.begin","meta.scope.for-loop.shell punctuation.definition.string.end","meta.scope.for-loop.shell string","storage.modifier.import","punctuation.section.embedded.begin.tsx","punctuation.section.embedded.end.tsx","punctuation.section.embedded.begin.jsx","punctuation.section.embedded.end.jsx","punctuation.separator.list.comma.css","constant.language.empty-list.haskell"],settings:{foreground:"#f6f6f4"}},{scope:["source.shell variable.other"],settings:{foreground:"#bf9eee"}},{scope:["support.constant"],settings:{fontStyle:"normal",foreground:"#bf9eee"}},{scope:["meta.scope.prerequisites.makefile"],settings:{foreground:"#e7ee98"}},{scope:["meta.attribute-selector.scss"],settings:{foreground:"#e7ee98"}},{scope:["punctuation.definition.attribute-selector.end.bracket.square.scss","punctuation.definition.attribute-selector.begin.bracket.square.scss"],settings:{foreground:"#f6f6f4"}},{scope:["meta.preprocessor.haskell"],settings:{foreground:"#7b7f8b"}},{scope:["log.error"],settings:{fontStyle:"bold",foreground:"#ee6666"}},{scope:["log.warning"],settings:{fontStyle:"bold",foreground:"#e7ee98"}}],type:"dark"});export{e as default};
@@ -1 +0,0 @@
1
- const e=Object.freeze({displayName:"Kotlin",fileTypes:["kt","kts"],name:"kotlin",patterns:[{include:"#import"},{include:"#package"},{include:"#code"}],repository:{"annotation-simple":{match:"(?<!\\w)@[\\w\\.]+\\b(?!:)",name:"entity.name.type.annotation.kotlin"},"annotation-site":{begin:"(?<!\\w)(@\\w+):\\s*(?!\\[)",beginCaptures:{1:{name:"entity.name.type.annotation-site.kotlin"}},end:"$",patterns:[{include:"#unescaped-annotation"}]},"annotation-site-list":{begin:"(?<!\\w)(@\\w+):\\s*\\[",beginCaptures:{1:{name:"entity.name.type.annotation-site.kotlin"}},end:"\\]",patterns:[{include:"#unescaped-annotation"}]},"binary-literal":{match:"0(b|B)[01][01_]*",name:"constant.numeric.binary.kotlin"},"boolean-literal":{match:"\\b(true|false)\\b",name:"constant.language.boolean.kotlin"},character:{begin:"'",end:"'",name:"string.quoted.single.kotlin",patterns:[{match:"\\\\.",name:"constant.character.escape.kotlin"}]},"class-declaration":{captures:{1:{name:"storage.type.class.kotlin"},2:{name:"entity.name.type.class.kotlin"},3:{patterns:[{include:"#type-parameter"}]}},match:"\\b(class|(?:fun\\s+)?interface)\\s+(\\b\\w+\\b|`[^`]+`)\\s*(?<GROUP><([^<>]|\\g<GROUP>)+>)?"},code:{patterns:[{include:"#comments"},{include:"#keywords"},{include:"#annotation-simple"},{include:"#annotation-site-list"},{include:"#annotation-site"},{include:"#class-declaration"},{include:"#object"},{include:"#type-alias"},{include:"#function"},{include:"#variable-declaration"},{include:"#type-constraint"},{include:"#type-annotation"},{include:"#function-call"},{include:"#method-reference"},{include:"#key"},{include:"#string"},{include:"#string-empty"},{include:"#string-multiline"},{include:"#character"},{include:"#lambda-arrow"},{include:"#operators"},{include:"#self-reference"},{include:"#decimal-literal"},{include:"#hex-literal"},{include:"#binary-literal"},{include:"#boolean-literal"},{include:"#null-literal"}]},"comment-block":{begin:"/\\*(?!\\*)",end:"\\*/",name:"comment.block.kotlin"},"comment-javadoc":{patterns:[{begin:"/\\*\\*",end:"\\*/",name:"comment.block.javadoc.kotlin",patterns:[{match:"@(return|constructor|receiver|sample|see|author|since|suppress)\\b",name:"keyword.other.documentation.javadoc.kotlin"},{captures:{1:{name:"keyword.other.documentation.javadoc.kotlin"},2:{name:"variable.parameter.kotlin"}},match:"(@param|@property)\\s+(\\S+)"},{captures:{1:{name:"keyword.other.documentation.javadoc.kotlin"},2:{name:"variable.parameter.kotlin"}},match:"(@param)\\[(\\S+)\\]"},{captures:{1:{name:"keyword.other.documentation.javadoc.kotlin"},2:{name:"entity.name.type.class.kotlin"}},match:"(@(?:exception|throws))\\s+(\\S+)"},{captures:{1:{name:"keyword.other.documentation.javadoc.kotlin"},2:{name:"entity.name.type.class.kotlin"},3:{name:"variable.parameter.kotlin"}},match:"{(@link)\\s+(\\S+)?#([\\w$]+\\s*\\([^\\(\\)]*\\)).*}"}]}]},"comment-line":{begin:"//",end:"$",name:"comment.line.double-slash.kotlin"},comments:{patterns:[{include:"#comment-line"},{include:"#comment-block"},{include:"#comment-javadoc"}]},"control-keywords":{match:"\\b(if|else|while|do|when|try|throw|break|continue|return|for)\\b",name:"keyword.control.kotlin"},"decimal-literal":{match:"\\b\\d[\\d_]*(\\.[\\d_]+)?((e|E)\\d+)?(u|U)?(L|F|f)?\\b",name:"constant.numeric.decimal.kotlin"},function:{captures:{1:{name:"storage.type.function.kotlin"},2:{patterns:[{include:"#type-parameter"}]},4:{name:"entity.name.type.class.extension.kotlin"},5:{name:"entity.name.function.declaration.kotlin"}},match:"\\b(fun)\\b\\s*(?<GROUP><([^<>]|\\g<GROUP>)+>)?\\s*(?:(?:(\\w+)\\.)?(\\b\\w+\\b|`[^`]+`))?"},"function-call":{captures:{1:{name:"entity.name.function.call.kotlin"},2:{patterns:[{include:"#type-parameter"}]}},match:"\\??\\.?(\\b\\w+\\b|`[^`]+`)\\s*(?<GROUP><([^<>]|\\g<GROUP>)+>)?\\s*(?=[({])"},"hard-keywords":{match:"\\b(as|typeof|is|in)\\b",name:"keyword.hard.kotlin"},"hex-literal":{match:"0(x|X)[A-Fa-f0-9][A-Fa-f0-9_]*(u|U)?",name:"constant.numeric.hex.kotlin"},import:{begin:"\\b(import)\\b\\s*",beginCaptures:{1:{name:"storage.type.import.kotlin"}},contentName:"entity.name.package.kotlin",end:";|$",name:"meta.import.kotlin",patterns:[{include:"#comments"},{include:"#hard-keywords"},{match:"\\*",name:"variable.language.wildcard.kotlin"}]},key:{captures:{1:{name:"variable.parameter.kotlin"},2:{name:"keyword.operator.assignment.kotlin"}},match:"\\b(\\w=)\\s*(=)"},keywords:{patterns:[{include:"#prefix-modifiers"},{include:"#postfix-modifiers"},{include:"#soft-keywords"},{include:"#hard-keywords"},{include:"#control-keywords"}]},"lambda-arrow":{match:"->",name:"storage.type.function.arrow.kotlin"},"method-reference":{captures:{1:{name:"entity.name.function.reference.kotlin"}},match:"\\??::(\\b\\w+\\b|`[^`]+`)"},"null-literal":{match:"\\bnull\\b",name:"constant.language.null.kotlin"},object:{captures:{1:{name:"storage.type.object.kotlin"},2:{name:"entity.name.type.object.kotlin"}},match:"\\b(object)(?:\\s+(\\b\\w+\\b|`[^`]+`))?"},operators:{patterns:[{match:"(===?|\\!==?|<=|>=|<|>)",name:"keyword.operator.comparison.kotlin"},{match:"([+*/%-]=)",name:"keyword.operator.assignment.arithmetic.kotlin"},{match:"(=)",name:"keyword.operator.assignment.kotlin"},{match:"([+*/%-])",name:"keyword.operator.arithmetic.kotlin"},{match:"(!|&&|\\|\\|)",name:"keyword.operator.logical.kotlin"},{match:"(--|\\+\\+)",name:"keyword.operator.increment-decrement.kotlin"},{match:"(\\.\\.)",name:"keyword.operator.range.kotlin"}]},package:{begin:"\\b(package)\\b\\s*",beginCaptures:{1:{name:"storage.type.package.kotlin"}},contentName:"entity.name.package.kotlin",end:";|$",name:"meta.package.kotlin",patterns:[{include:"#comments"}]},"postfix-modifiers":{match:"\\b(where|by|get|set)\\b",name:"storage.modifier.other.kotlin"},"prefix-modifiers":{match:"\\b(abstract|final|enum|open|annotation|sealed|data|override|final|lateinit|private|protected|public|internal|inner|companion|noinline|crossinline|vararg|reified|tailrec|operator|infix|inline|external|const|suspend|value)\\b",name:"storage.modifier.other.kotlin"},"self-reference":{match:"\\b(this|super)(@\\w+)?\\b",name:"variable.language.this.kotlin"},"soft-keywords":{match:"\\b(catch|finally|field)\\b",name:"keyword.soft.kotlin"},string:{begin:'(?<!")"(?!")',end:'"',name:"string.quoted.double.kotlin",patterns:[{match:"\\\\.",name:"constant.character.escape.kotlin"},{include:"#string-escape-simple"},{include:"#string-escape-bracketed"}]},"string-empty":{match:'(?<!")""(?!")',name:"string.quoted.double.kotlin"},"string-escape-bracketed":{begin:"(?<!\\\\)(\\$\\{)",beginCaptures:{1:{name:"punctuation.definition.template-expression.begin"}},end:"(\\})",endCaptures:{1:{name:"punctuation.definition.template-expression.end"}},name:"meta.template.expression.kotlin",patterns:[{include:"#code"}]},"string-escape-simple":{match:"(?<!\\\\)\\$\\w+\\b",name:"variable.string-escape.kotlin"},"string-multiline":{begin:'"""',end:'"""',name:"string.quoted.double.kotlin",patterns:[{match:"\\\\.",name:"constant.character.escape.kotlin"},{include:"#string-escape-simple"},{include:"#string-escape-bracketed"}]},"type-alias":{captures:{1:{name:"storage.type.alias.kotlin"},2:{name:"entity.name.type.kotlin"},3:{patterns:[{include:"#type-parameter"}]}},match:"\\b(typealias)\\s+(\\b\\w+\\b|`[^`]+`)\\s*(?<GROUP><([^<>]|\\g<GROUP>)+>)?"},"type-annotation":{captures:{0:{patterns:[{include:"#type-parameter"}]}},match:`(?<![:?]):\\s*(\\w|\\?|\\s|->|(?<GROUP>[<(]([^<>()"']|\\g<GROUP>)+[)>]))+`},"type-parameter":{patterns:[{match:"\\b\\w+\\b",name:"entity.name.type.kotlin"},{match:"\\b(in|out)\\b",name:"storage.modifier.kotlin"}]},"unescaped-annotation":{match:"\\b[\\w\\.]+\\b",name:"entity.name.type.annotation.kotlin"},"variable-declaration":{captures:{1:{name:"storage.type.variable.kotlin"},2:{patterns:[{include:"#type-parameter"}]}},match:"\\b(val|var)\\b\\s*(?<GROUP><([^<>]|\\g<GROUP>)+>)?"}},scopeName:"source.kotlin",aliases:["kt","kts"]});var t=[e];export{t as default};