@opendesign-plus-test/plugins 0.0.1-rc.16 → 0.0.1-rc.17
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,7 +1,7 @@
|
|
|
1
1
|
import { defineNuxtModule as y, addVitePlugin as S } from "nuxt/kit";
|
|
2
2
|
import { g as j, m as w } from "../../generate-lastmod-changefreq-Wk3kOITw.js";
|
|
3
3
|
import { existsSync as $, readFileSync as b, createWriteStream as x, readdirSync as A } from "node:fs";
|
|
4
|
-
import
|
|
4
|
+
import r from "node:path";
|
|
5
5
|
import { pipeline as O } from "node:stream/promises";
|
|
6
6
|
const q = y({
|
|
7
7
|
meta: {
|
|
@@ -17,12 +17,10 @@ const q = y({
|
|
|
17
17
|
...t.lastmodAndChangefreqOptions
|
|
18
18
|
})
|
|
19
19
|
);
|
|
20
|
-
const
|
|
20
|
+
const p = Array.isArray(t.ignore) ? t.ignore : typeof t.ignore == "string" ? [t.ignore] : [], f = t.base.endsWith("/") ? t.base.slice(0, -1) : t.base;
|
|
21
21
|
s.hook("close", async () => {
|
|
22
|
-
var
|
|
23
|
-
|
|
24
|
-
return;
|
|
25
|
-
const a = i.join(s.options.rootDir, ".output", "public");
|
|
22
|
+
var u;
|
|
23
|
+
const a = r.join(s.options.rootDir, ".output", "public");
|
|
26
24
|
if (!$(a))
|
|
27
25
|
return;
|
|
28
26
|
const m = [], c = (e) => {
|
|
@@ -32,19 +30,19 @@ const q = y({
|
|
|
32
30
|
});
|
|
33
31
|
for (const n of o) {
|
|
34
32
|
if (n.isDirectory()) {
|
|
35
|
-
c(
|
|
33
|
+
c(r.join(e, n.name));
|
|
36
34
|
continue;
|
|
37
35
|
}
|
|
38
36
|
if (n.name === "index.html") {
|
|
39
|
-
const
|
|
40
|
-
for (const l of
|
|
41
|
-
w(
|
|
42
|
-
m.push(
|
|
37
|
+
const i = `/${r.relative(a, e).replace(/\\/g, "/")}`;
|
|
38
|
+
for (const l of p)
|
|
39
|
+
w(i, l);
|
|
40
|
+
m.push(i);
|
|
43
41
|
}
|
|
44
42
|
}
|
|
45
43
|
};
|
|
46
44
|
c(a), console.log("[module:generate-sitemap] collect html done");
|
|
47
|
-
const g = ((
|
|
45
|
+
const g = ((u = t.lastmodAndChangefreqOptions) == null ? void 0 : u.outputFile) || r.join(s.options.dir.app, "last-modified.json"), d = JSON.parse(b(g, "utf-8")), h = x(r.join(a, "sitemap.xml"), "utf-8");
|
|
48
46
|
try {
|
|
49
47
|
await O(function* () {
|
|
50
48
|
yield `<?xml version="1.0" encoding="UTF-8"?>
|
|
@@ -60,7 +58,7 @@ const q = y({
|
|
|
60
58
|
...o
|
|
61
59
|
};
|
|
62
60
|
yield ` <url>
|
|
63
|
-
${Object.entries(n).map(([
|
|
61
|
+
${Object.entries(n).map(([i, l]) => ` <${i}>${l}</${i}>`).join(`
|
|
64
62
|
`)}
|
|
65
63
|
</url>
|
|
66
64
|
`;
|
|
@@ -10,7 +10,7 @@ export interface LastModifiedPluginOptions {
|
|
|
10
10
|
/** Path to the git repository root. */
|
|
11
11
|
rootDir?: string;
|
|
12
12
|
/** Absolute path for the output JSON file.
|
|
13
|
-
* Default: `<
|
|
13
|
+
* Default: `<viteConfig.root>/last-modified.json` */
|
|
14
14
|
outputFile?: string;
|
|
15
15
|
/** Max number of concurrent `git log` processes. Default: 20. */
|
|
16
16
|
concurrency?: number;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opendesign-plus-test/plugins",
|
|
3
|
-
"version": "0.0.1-rc.
|
|
3
|
+
"version": "0.0.1-rc.17",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public",
|
|
@@ -20,17 +20,12 @@
|
|
|
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"
|
|
27
23
|
}
|
|
28
24
|
},
|
|
29
25
|
"devDependencies": {
|
|
30
26
|
"typescript": "~5.8.2",
|
|
31
27
|
"vite": "^6.2.3",
|
|
32
|
-
"vite-plugin-dts": "^4.5.3"
|
|
33
|
-
"@nuxt/kit": "^3.21.2"
|
|
28
|
+
"vite-plugin-dts": "^4.5.3"
|
|
34
29
|
},
|
|
35
30
|
"dependencies": {
|
|
36
31
|
"@opensig/open-analytics": "^1.0.1",
|