@opendesign-plus-test/plugins 0.0.1-rc.10 → 0.0.1-rc.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,7 +1,6 @@
1
- import f from "./__vite-browser-external-BDMct_Gn.js";
2
- import { i as K, o as O, v as z } from "./plugin-lvjNLBe-.js";
3
- import { g as H } from "./generate-lastmod-changefreq-CYV0c6WF.js";
4
- const $ = `
1
+ import { i as B, o as K, v as O } from "./plugin-lvjNLBe-.js";
2
+ import { g as j } from "./generate-lastmod-changefreq-Wk3kOITw.js";
3
+ const f = {}, $ = `
5
4
  (function () {
6
5
  function getCookie(key) {
7
6
  const name = encodeURIComponent(key) + '=';
@@ -27,7 +26,7 @@ const $ = `
27
26
  }
28
27
  })();
29
28
  `.trim();
30
- function I(e) {
29
+ function R(e) {
31
30
  const {
32
31
  cookieKey: n,
33
32
  lightValue: t = "light",
@@ -299,7 +298,7 @@ function S(e) {
299
298
  return n.call(window, t, ...r);
300
299
  };
301
300
  }
302
- function V(e = {}) {
301
+ function I(e = {}) {
303
302
  return {
304
303
  install() {
305
304
  typeof window > "u" || (U(e), S(e));
@@ -307,10 +306,10 @@ function V(e = {}) {
307
306
  };
308
307
  }
309
308
  export {
310
- I as CheckThemePlugin,
311
- V as createExternalLinkGuard,
312
- H as generateLastmodAndChangefreq,
313
- K as initOpenDesignAnalytics,
314
- O as oaReport,
315
- z as vAnalytics
309
+ R as CheckThemePlugin,
310
+ I as createExternalLinkGuard,
311
+ j as generateLastmodAndChangefreq,
312
+ B as initOpenDesignAnalytics,
313
+ K as oaReport,
314
+ O as vAnalytics
316
315
  };
@@ -0,0 +1,70 @@
1
+ import { defineNuxtModule as h, addVitePlugin as y } from "nuxt/kit";
2
+ import { g as S, m as j } from "../../generate-lastmod-changefreq-Wk3kOITw.js";
3
+ import { existsSync as w, readFileSync as $, createWriteStream as b, readdirSync as x } from "node:fs";
4
+ import i from "node:path";
5
+ import { pipeline as A } from "node:stream/promises";
6
+ const v = h({
7
+ meta: {
8
+ name: "generate-sitemap",
9
+ configKey: "generateSitemap"
10
+ },
11
+ setup(t, a) {
12
+ y(S(t.lastmodAndChangefreqOptions));
13
+ const u = Array.isArray(t.ignore) ? t.ignore : typeof t.ignore == "string" ? [t.ignore] : [], f = t.base.endsWith("/") ? t.base.slice(0, -1) : t.base;
14
+ a.hook("close", async () => {
15
+ const s = i.join(a.options.rootDir, ".output", "public");
16
+ if (!w(s))
17
+ return;
18
+ const m = [], c = (e) => {
19
+ const o = x(e, {
20
+ withFileTypes: !0,
21
+ encoding: "utf-8"
22
+ });
23
+ for (const n of o) {
24
+ if (n.isDirectory()) {
25
+ c(i.join(e, n.name));
26
+ continue;
27
+ }
28
+ if (n.name === "index.html") {
29
+ const r = `/${i.relative(s, e).replace(/\\/g, "/")}`;
30
+ for (const l of u)
31
+ j(r, l);
32
+ m.push(r);
33
+ }
34
+ }
35
+ };
36
+ c(s), console.log("[module:generate-sitemap] collect html done");
37
+ const g = t.lastmodAndChangefreqOptions.outputFile || i.join(a.options.rootDir, "last-modified.json"), d = JSON.parse($(g, "utf-8")), p = b(i.join(s, "sitemap.xml"), "utf-8");
38
+ try {
39
+ await A(function* () {
40
+ yield `<?xml version="1.0" encoding="UTF-8"?>
41
+ <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
42
+ `;
43
+ for (const e of m) {
44
+ if (!e.startsWith("/"))
45
+ continue;
46
+ const o = d[`pages${e}/index.vue`] || d[`pages${e}.md`];
47
+ o != null && o.lastmod && (o.lastmod = new Date(o.lastmod).toISOString());
48
+ const n = {
49
+ loc: f + e,
50
+ ...o
51
+ };
52
+ yield ` <url>
53
+ ${Object.entries(n).map(([r, l]) => ` <${r}>${l}</${r}>`).join(`
54
+ `)}
55
+ </url>
56
+ `;
57
+ }
58
+ yield "</urlset>";
59
+ }, p);
60
+ } catch (e) {
61
+ console.log("[module:generate-sitemap] error", e);
62
+ return;
63
+ }
64
+ console.log("[module:generate-sitemap] generate done");
65
+ });
66
+ }
67
+ });
68
+ export {
69
+ v as default
70
+ };
@@ -0,0 +1,2 @@
1
+ declare const _default: any;
2
+ export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opendesign-plus-test/plugins",
3
- "version": "0.0.1-rc.10",
3
+ "version": "0.0.1-rc.12",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public",
@@ -20,6 +20,10 @@
20
20
  "./analytics": {
21
21
  "types": "./dist/analytics/analytics.d.ts",
22
22
  "import": "./dist/analytics/index.js"
23
+ },
24
+ "./nuxt/*": {
25
+ "import": "./dist/nuxt/*/index.js",
26
+ "types": "./dist/nuxt/*.d.ts"
23
27
  }
24
28
  },
25
29
  "devDependencies": {
@@ -1,4 +0,0 @@
1
- const t = {};
2
- export {
3
- t as default
4
- };
@@ -1,2 +0,0 @@
1
- declare const _default: NuxtModule<TOptions, TOptions, false>;
2
- export default _default;
@@ -1 +0,0 @@
1
- export * from './generate-sitemap';
@@ -1,64 +0,0 @@
1
- import { defineNuxtModule as $, addVitePlugin as b } from "@nuxt/kit";
2
- import { g as x, m as A } from "../generate-lastmod-changefreq-CYV0c6WF.js";
3
- $({
4
- meta: {
5
- name: "generate-sitemap",
6
- configKey: "generateSitemap"
7
- },
8
- setup(t, a) {
9
- b(x(t.lastmodAndChangefreqOptions));
10
- const u = Array.isArray(t.ignore) ? t.ignore : typeof t.ignore == "string" ? [t.ignore] : [], g = t.base.endsWith("/") ? t.base.slice(0, -1) : t.base;
11
- a.hook("close", async () => {
12
- const { createWriteStream: f, existsSync: p, readdirSync: h, readFileSync: y } = await import("../__vite-browser-external-BDMct_Gn.js"), { pipeline: w } = await import("../__vite-browser-external-BDMct_Gn.js"), n = await import("../__vite-browser-external-BDMct_Gn.js"), s = n.join(a.options.rootDir, ".output", "public");
13
- if (!p(s))
14
- return;
15
- const c = [], m = (e) => {
16
- const o = h(e, {
17
- withFileTypes: !0,
18
- encoding: "utf-8"
19
- });
20
- for (const i of o) {
21
- if (i.isDirectory()) {
22
- m(n.join(e, i.name));
23
- continue;
24
- }
25
- if (i.name === "index.html") {
26
- const r = `/${n.relative(s, e).replace(/\\/g, "/")}`;
27
- for (const l of u)
28
- A(r, l);
29
- c.push(r);
30
- }
31
- }
32
- };
33
- m(s), console.log("[module:generate-sitemap] collect html done");
34
- const S = t.lastmodAndChangefreqOptions.outputFile || n.join(a.options.rootDir, "last-modified.json"), d = JSON.parse(y(S, "utf-8")), j = f(n.join(s, "sitemap.xml"), "utf-8");
35
- try {
36
- await w(function* () {
37
- yield `<?xml version="1.0" encoding="UTF-8"?>
38
- <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
39
- `;
40
- for (const e of c) {
41
- if (!e.startsWith("/"))
42
- continue;
43
- const o = d[`pages${e}/index.vue`] || d[`pages${e}.md`];
44
- o != null && o.lastmod && (o.lastmod = new Date(o.lastmod).toISOString());
45
- const i = {
46
- loc: g + e,
47
- ...o
48
- };
49
- yield ` <url>
50
- ${Object.entries(i).map(([r, l]) => ` <${r}>${l}</${r}>`).join(`
51
- `)}
52
- </url>
53
- `;
54
- }
55
- yield "</urlset>";
56
- }, j);
57
- } catch (e) {
58
- console.log("[module:generate-sitemap] error", e);
59
- return;
60
- }
61
- console.log("[module:generate-sitemap] generate done");
62
- });
63
- }
64
- });