@opendesign-plus-test/plugins 0.0.1-rc.22 → 0.0.1-rc.24

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.
@@ -1,17 +1,17 @@
1
- import { defineNuxtModule as S, addVitePlugin as O } from "nuxt/kit";
2
- import { g as v, m as A } from "../../generate-lastmod-changefreq-Wk3kOITw.js";
1
+ import { defineNuxtModule as S, addVitePlugin as A } from "nuxt/kit";
2
+ import { g as O, m as v } from "../../generate-lastmod-changefreq-Wk3kOITw.js";
3
3
  import { existsSync as b, readFileSync as D, createWriteStream as q, writeFileSync as C, readdirSync as T } from "node:fs";
4
4
  import m, { join as z } from "node:path";
5
5
  import { pipeline as J } from "node:stream/promises";
6
- const I = S({
6
+ const H = S({
7
7
  meta: {
8
8
  name: "sitemap",
9
9
  configKey: "sitemap"
10
10
  },
11
11
  setup(t, f) {
12
- O(
13
- v({
14
- rootDir: f.options.dir.app,
12
+ A(
13
+ O({
14
+ rootDir: t.nuxtAppRoot || f.options.dir.app,
15
15
  // @ts-ignore
16
16
  pageEntryPattern: "**/pages/**/*.vue",
17
17
  ...t.lastmodAndChangefreqOptions
@@ -42,14 +42,14 @@ const I = S({
42
42
  if (o.name === "index.html") {
43
43
  const l = `/${m.relative(r, e).replace(/\\/g, "/")}`;
44
44
  for (const i of w)
45
- A(l, i);
45
+ v(l, i);
46
46
  for (const i in s)
47
47
  l.startsWith(i) && s[i].push(l);
48
48
  }
49
49
  }
50
50
  };
51
51
  d(r), console.log("[module:generate-sitemap] collect html done");
52
- const W = ((u = t.lastmodAndChangefreqOptions) == null ? void 0 : u.outputFile) || m.join(f.options.dir.app, "last-modified.json"), p = JSON.parse(D(W, "utf-8"));
52
+ const j = ((u = t.lastmodAndChangefreqOptions) == null ? void 0 : u.outputFile) || m.join(t.nuxtAppRoot || f.options.dir.app, "last-modified.json"), p = JSON.parse(D(j, "utf-8"));
53
53
  await Promise.all(
54
54
  (((x = t.index) == null ? void 0 : x.items) ?? [{ pathPrefix: "/", filename: "sitemap.xml" }]).filter((e) => e.pathPrefix && e.filename).map(async (e) => {
55
55
  const n = e.pathPrefix.startsWith("/") ? e.pathPrefix : `/${e.pathPrefix}`, o = e.filename.endsWith(".xml") ? e.filename : `${e.filename}.xml`, l = q(m.join(r, n, o), "utf-8");
@@ -63,12 +63,12 @@ const I = S({
63
63
  continue;
64
64
  const a = p[`pages${i.endsWith("/") ? i.slice(0, -1) : i}/index.vue`] || p[`pages${i}.md`];
65
65
  a != null && a.lastmod && (a.lastmod = new Date(a.lastmod).toISOString());
66
- const j = {
66
+ const W = {
67
67
  loc: c + i,
68
68
  ...a
69
69
  };
70
70
  yield ` <url>
71
- ${Object.entries(j).map(([$, F]) => ` <${$}>${F}</${$}>`).join(`
71
+ ${Object.entries(W).map(([$, F]) => ` <${$}>${F}</${$}>`).join(`
72
72
  `)}
73
73
  </url>
74
74
  `;
@@ -89,7 +89,7 @@ ${Object.entries(j).map(([$, F]) => ` <${$}>${F}</${$}>`).join(`
89
89
  return n.endsWith("/") && (n = n.slice(0, -1)), `<sitemap>
90
90
  <loc>${e.filename ? `${c}${n}/${e.filename}` : e.loc}</loc>
91
91
  </sitemap>`;
92
- })}
92
+ }).join("")}
93
93
  </sitemapindex>
94
94
  `,
95
95
  "utf-8"
@@ -98,5 +98,5 @@ ${Object.entries(j).map(([$, F]) => ` <${$}>${F}</${$}>`).join(`
98
98
  }
99
99
  });
100
100
  export {
101
- I as default
101
+ H as default
102
102
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opendesign-plus-test/plugins",
3
- "version": "0.0.1-rc.22",
3
+ "version": "0.0.1-rc.24",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public",