valaxy 0.23.2 → 0.23.4
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/client/app/data.ts +3 -1
- package/client/composables/common.ts +4 -4
- package/client/modules/valaxy.ts +3 -2
- package/dist/{chunk-3X26KX5G.js → chunk-VMMD3G2Q.js} +195 -165
- package/dist/node/cli/index.d.ts +2 -2
- package/dist/node/cli/index.js +1 -1
- package/dist/node/index.d.ts +2 -2
- package/dist/node/index.js +3 -3
- package/package.json +28 -28
package/client/app/data.ts
CHANGED
|
@@ -3,8 +3,9 @@ import type { Router } from 'vue-router'
|
|
|
3
3
|
import type { PageData } from '../../types'
|
|
4
4
|
import { computed } from 'vue'
|
|
5
5
|
|
|
6
|
-
export interface ValaxyData {
|
|
6
|
+
export interface ValaxyData<FM = PageData['frontmatter']> {
|
|
7
7
|
page: Ref<PageData>
|
|
8
|
+
frontmatter: Ref<FM & PageData['frontmatter']>
|
|
8
9
|
}
|
|
9
10
|
|
|
10
11
|
/**
|
|
@@ -15,5 +16,6 @@ export function initData(router: Router): ValaxyData {
|
|
|
15
16
|
page: computed(() => (router.currentRoute.value as unknown as {
|
|
16
17
|
data: PageData
|
|
17
18
|
}).data),
|
|
19
|
+
frontmatter: computed(() => router.currentRoute.value.meta.frontmatter),
|
|
18
20
|
}
|
|
19
21
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { PostFrontMatter } from '../../types'
|
|
2
2
|
import type { ValaxyData } from '../app/data'
|
|
3
|
-
import { isClient } from '@vueuse/core'
|
|
4
3
|
|
|
4
|
+
import { isClient } from '@vueuse/core'
|
|
5
5
|
import { computed, inject } from 'vue'
|
|
6
6
|
import { useRoute } from 'vue-router'
|
|
7
7
|
import { dataSymbol, useSiteConfig } from '../config'
|
|
@@ -23,11 +23,11 @@ import { dataSymbol, useSiteConfig } from '../config'
|
|
|
23
23
|
* console.log(fm.value.custom)
|
|
24
24
|
* ```
|
|
25
25
|
*/
|
|
26
|
-
export function useFrontmatter<
|
|
26
|
+
export function useFrontmatter<FM extends Record<string, any>>() {
|
|
27
27
|
// inject not in app root
|
|
28
28
|
const route = useRoute()
|
|
29
29
|
const frontmatter = computed(() => {
|
|
30
|
-
return route.meta.frontmatter as Partial<PostFrontMatter &
|
|
30
|
+
return route.meta.frontmatter as Partial<(PostFrontMatter & FM)> || {}
|
|
31
31
|
})
|
|
32
32
|
return frontmatter
|
|
33
33
|
}
|
|
@@ -72,7 +72,7 @@ export function useEncryptedPhotos() {
|
|
|
72
72
|
/**
|
|
73
73
|
* inject pageData
|
|
74
74
|
*/
|
|
75
|
-
export function useData(): ValaxyData {
|
|
75
|
+
export function useData<FM = Record<string, any>>(): ValaxyData<FM> {
|
|
76
76
|
const data = inject(dataSymbol, {} as any)
|
|
77
77
|
if (!data) {
|
|
78
78
|
throw new Error('Valaxy data not properly injected in app')
|
package/client/modules/valaxy.ts
CHANGED
|
@@ -37,8 +37,9 @@ import valaxyMessages from '/@valaxyjs/locales'
|
|
|
37
37
|
// import en from '../../../../../demo/yun/locales/en.yml'
|
|
38
38
|
|
|
39
39
|
function shouldHotReload(payload: PageDataPayload): boolean {
|
|
40
|
-
const payloadPath = payload.path.replace(/(
|
|
41
|
-
const locationPath = location.pathname
|
|
40
|
+
const payloadPath = payload.path.replace(/(?:(^|\/)index)?\.md$/, '$1')
|
|
41
|
+
const locationPath = location.pathname
|
|
42
|
+
.replace(/(?:(^|\/)index)?\.html$/, '')
|
|
42
43
|
return ensureSuffix('/', encodeURI(payloadPath)) === ensureSuffix('/', encodeURI(locationPath))
|
|
43
44
|
}
|
|
44
45
|
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
// node/cli/index.ts
|
|
2
|
-
import
|
|
2
|
+
import process15 from "process";
|
|
3
3
|
import yargs from "yargs";
|
|
4
4
|
import { hideBin } from "yargs/helpers";
|
|
5
5
|
|
|
6
6
|
// package.json
|
|
7
|
-
var version = "0.23.
|
|
7
|
+
var version = "0.23.4";
|
|
8
8
|
|
|
9
9
|
// node/modules/fuse.ts
|
|
10
|
-
import path4 from "
|
|
10
|
+
import path4 from "path";
|
|
11
11
|
import { consola as consola9 } from "consola";
|
|
12
12
|
import { colors as colors7 } from "consola/utils";
|
|
13
13
|
import fg2 from "fast-glob";
|
|
@@ -34,8 +34,8 @@ function commonOptions(args) {
|
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
// node/options.ts
|
|
37
|
-
import { dirname as dirname2 } from "
|
|
38
|
-
import process4 from "
|
|
37
|
+
import { dirname as dirname2 } from "path";
|
|
38
|
+
import process4 from "process";
|
|
39
39
|
import { ensureSuffix, uniq } from "@antfu/utils";
|
|
40
40
|
import { consola as consola7 } from "consola";
|
|
41
41
|
import { colors as colors6 } from "consola/utils";
|
|
@@ -45,7 +45,7 @@ import fs5 from "fs-extra";
|
|
|
45
45
|
import { resolve as resolve4 } from "pathe";
|
|
46
46
|
|
|
47
47
|
// node/build/bundle.ts
|
|
48
|
-
import path from "
|
|
48
|
+
import path from "path";
|
|
49
49
|
var cache = /* @__PURE__ */ new Map();
|
|
50
50
|
var cacheTheme = /* @__PURE__ */ new Map();
|
|
51
51
|
function escapeRegExp(str) {
|
|
@@ -151,11 +151,11 @@ function getRollupOptions(options) {
|
|
|
151
151
|
}
|
|
152
152
|
|
|
153
153
|
// node/config/addon.ts
|
|
154
|
-
import path2 from "
|
|
154
|
+
import path2 from "path";
|
|
155
155
|
import fs2 from "fs-extra";
|
|
156
156
|
|
|
157
157
|
// node/config/valaxy.ts
|
|
158
|
-
import process2 from "
|
|
158
|
+
import process2 from "process";
|
|
159
159
|
import { isFunction } from "@antfu/utils";
|
|
160
160
|
import { consola as consola4 } from "consola";
|
|
161
161
|
import { colors as colors2 } from "consola/utils";
|
|
@@ -176,13 +176,13 @@ function countPerformanceTime() {
|
|
|
176
176
|
}
|
|
177
177
|
|
|
178
178
|
// node/config/site.ts
|
|
179
|
-
import { webcrypto } from "
|
|
179
|
+
import { webcrypto } from "crypto";
|
|
180
180
|
import { consola as consola3 } from "consola";
|
|
181
181
|
import { colors } from "consola/utils";
|
|
182
182
|
import { options as floatingVueOptions } from "floating-vue";
|
|
183
183
|
|
|
184
184
|
// node/config/utils.ts
|
|
185
|
-
import process from "
|
|
185
|
+
import process from "process";
|
|
186
186
|
import { consola as consola2 } from "consola";
|
|
187
187
|
import fs from "fs-extra";
|
|
188
188
|
import { createJiti } from "jiti";
|
|
@@ -601,7 +601,7 @@ async function resolveImportPath(importName, ensure = false) {
|
|
|
601
601
|
}
|
|
602
602
|
|
|
603
603
|
// node/utils/addons.ts
|
|
604
|
-
import process3 from "
|
|
604
|
+
import process3 from "process";
|
|
605
605
|
import { colors as colors5 } from "consola/utils";
|
|
606
606
|
import defu2 from "defu";
|
|
607
607
|
import fs4 from "fs-extra";
|
|
@@ -609,7 +609,7 @@ import ora2 from "ora";
|
|
|
609
609
|
import { resolve as resolve3 } from "pathe";
|
|
610
610
|
|
|
611
611
|
// node/utils/root.ts
|
|
612
|
-
import { dirname } from "
|
|
612
|
+
import { dirname } from "path";
|
|
613
613
|
import fs3 from "fs-extra";
|
|
614
614
|
import { resolve as resolve2 } from "pathe";
|
|
615
615
|
async function getModuleRoot(name, entry) {
|
|
@@ -677,7 +677,7 @@ async function getAddonRoot(name, entry) {
|
|
|
677
677
|
}
|
|
678
678
|
|
|
679
679
|
// node/utils/clientRedirects.ts
|
|
680
|
-
import { writeFile } from "
|
|
680
|
+
import { writeFile } from "fs/promises";
|
|
681
681
|
import { ensureFile } from "fs-extra";
|
|
682
682
|
function handleRoute(route) {
|
|
683
683
|
if (route === "/")
|
|
@@ -857,8 +857,8 @@ var matterOptions = {
|
|
|
857
857
|
};
|
|
858
858
|
|
|
859
859
|
// node/utils/env.ts
|
|
860
|
-
import path3 from "
|
|
861
|
-
import process5 from "
|
|
860
|
+
import path3 from "path";
|
|
861
|
+
import process5 from "process";
|
|
862
862
|
import { consola as consola8 } from "consola";
|
|
863
863
|
import fs6 from "fs-extra";
|
|
864
864
|
function isProd() {
|
|
@@ -974,19 +974,19 @@ var fuseModule = defineValaxyModule({
|
|
|
974
974
|
});
|
|
975
975
|
|
|
976
976
|
// node/modules/rss/utils.ts
|
|
977
|
-
import { readFile } from "
|
|
978
|
-
import { dirname as dirname3, join, resolve as resolve5 } from "
|
|
977
|
+
import { readFile } from "fs/promises";
|
|
978
|
+
import { dirname as dirname3, join, resolve as resolve5 } from "path";
|
|
979
979
|
import { ensurePrefix as ensurePrefix2 } from "@antfu/utils";
|
|
980
980
|
import { consola as consola10 } from "consola";
|
|
981
981
|
import { colors as colors8 } from "consola/utils";
|
|
982
982
|
import dayjs from "dayjs";
|
|
983
983
|
import fg3 from "fast-glob";
|
|
984
|
-
import { Feed } from "feed";
|
|
985
984
|
import fs9 from "fs-extra";
|
|
986
985
|
import matter2 from "gray-matter";
|
|
987
986
|
import MarkdownIt from "markdown-it";
|
|
988
987
|
import ora3 from "ora";
|
|
989
988
|
import { getBorderCharacters, table } from "table";
|
|
989
|
+
import { createFeed, generateAtom1, generateJson1, generateRss2 } from "zfeed";
|
|
990
990
|
|
|
991
991
|
// node/utils/date.ts
|
|
992
992
|
import fs8 from "fs-extra";
|
|
@@ -1029,11 +1029,10 @@ async function build(options) {
|
|
|
1029
1029
|
id: siteUrl || "valaxy",
|
|
1030
1030
|
link: siteUrl,
|
|
1031
1031
|
copyright: `CC ${siteConfig.license?.type?.toUpperCase()} ${ccVersion} ${(/* @__PURE__ */ new Date()).getFullYear()} \xA9 ${siteConfig.author?.name}`,
|
|
1032
|
-
|
|
1032
|
+
feed: Object.fromEntries(
|
|
1033
|
+
Object.entries(feedNameMap).map(([key, value]) => [key, `${siteUrl}${value}`])
|
|
1034
|
+
)
|
|
1033
1035
|
};
|
|
1034
|
-
Object.keys(feedNameMap).forEach((key) => {
|
|
1035
|
-
feedOptions.feedLinks[key] = `${siteUrl}${feedNameMap[key]}`;
|
|
1036
|
-
});
|
|
1037
1036
|
const DOMAIN = siteConfig.url.slice(0, -1);
|
|
1038
1037
|
const files = await fg3(`${options.userRoot}/pages/posts/**/*.md`);
|
|
1039
1038
|
const posts = await getPosts({
|
|
@@ -1091,22 +1090,23 @@ async function getPosts(params, options) {
|
|
|
1091
1090
|
const link = DOMAIN + path17.replace(`${options.userRoot}/pages`, "").replace(/\.md$/, "");
|
|
1092
1091
|
const tip = `<br/><p>${lang === "zh-CN" ? `\u8BBF\u95EE <a href="${link}" target="_blank">${link}</a> ${fullText ? "\u67E5\u770B\u539F\u6587" : "\u9605\u8BFB\u5168\u6587"}\u3002` : `Visit <a href="${link}" target="_blank">${link}</a> to ${fullText ? "view original article" : "read more"}.`}</p>`;
|
|
1093
1092
|
posts.push({
|
|
1094
|
-
title:
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
published: new Date(data.updated || data.date),
|
|
1093
|
+
title: data.title,
|
|
1094
|
+
updatedAt: new Date(data.date),
|
|
1095
|
+
publishedAt: new Date(data.updated || data.date),
|
|
1098
1096
|
content: html + tip,
|
|
1099
|
-
author
|
|
1100
|
-
id: data.id
|
|
1097
|
+
author,
|
|
1098
|
+
id: data.id || link,
|
|
1101
1099
|
link
|
|
1102
1100
|
});
|
|
1103
1101
|
}
|
|
1104
|
-
posts.sort((a, b) => +
|
|
1102
|
+
posts.sort((a, b) => +(b.publishedAt || b.updatedAt) - +(a.publishedAt || a.updatedAt));
|
|
1105
1103
|
return posts;
|
|
1106
1104
|
}
|
|
1107
1105
|
async function writeFeed(feedOptions, posts, options, feedNameMap) {
|
|
1108
|
-
const feed =
|
|
1109
|
-
|
|
1106
|
+
const feed = createFeed({
|
|
1107
|
+
...feedOptions,
|
|
1108
|
+
items: posts
|
|
1109
|
+
});
|
|
1110
1110
|
await fs9.ensureDir(dirname3(`./dist/${feedNameMap.atom}`));
|
|
1111
1111
|
const path17 = resolve5(options.userRoot, "./dist");
|
|
1112
1112
|
const publicFolder = resolve5(options.userRoot, "public");
|
|
@@ -1123,11 +1123,11 @@ async function writeFeed(feedOptions, posts, options, feedNameMap) {
|
|
|
1123
1123
|
let data = "";
|
|
1124
1124
|
const distFeedPath = `${path17}/${feedNameMap[type]}`;
|
|
1125
1125
|
if (type === "rss")
|
|
1126
|
-
data = feed
|
|
1126
|
+
data = generateRss2(feed);
|
|
1127
1127
|
else if (type === "atom")
|
|
1128
|
-
data = feed
|
|
1128
|
+
data = generateAtom1(feed);
|
|
1129
1129
|
else if (type === "json")
|
|
1130
|
-
data = feed
|
|
1130
|
+
data = generateJson1(feed);
|
|
1131
1131
|
await fs9.writeFile(distFeedPath, data, "utf-8");
|
|
1132
1132
|
consola10.debug(`[${colors8.cyan(type)}] dist: ${colors8.dim(distFeedPath)}`);
|
|
1133
1133
|
tableData.push([colors8.cyan(type), colors8.yellow("dist"), colors8.dim(distFeedPath)]);
|
|
@@ -1194,14 +1194,14 @@ var rssModule = defineValaxyModule({
|
|
|
1194
1194
|
});
|
|
1195
1195
|
|
|
1196
1196
|
// node/cli/build.ts
|
|
1197
|
-
import path13 from "
|
|
1198
|
-
import process9 from "
|
|
1197
|
+
import path13 from "path";
|
|
1198
|
+
import process9 from "process";
|
|
1199
1199
|
import { consola as consola16 } from "consola";
|
|
1200
1200
|
import { colors as colors15 } from "consola/utils";
|
|
1201
1201
|
import { mergeConfig as mergeConfig4 } from "vite";
|
|
1202
1202
|
|
|
1203
1203
|
// node/build.ts
|
|
1204
|
-
import { join as join8, resolve as resolve13 } from "
|
|
1204
|
+
import { join as join8, resolve as resolve13 } from "path";
|
|
1205
1205
|
import { consola as consola14 } from "consola";
|
|
1206
1206
|
import { colors as colors12 } from "consola/utils";
|
|
1207
1207
|
import fs21 from "fs-extra";
|
|
@@ -1212,19 +1212,18 @@ import { build as viteSsgBuild } from "vite-ssg/node";
|
|
|
1212
1212
|
// node/plugins/preset.ts
|
|
1213
1213
|
import VueI18n from "@intlify/unplugin-vue-i18n/vite";
|
|
1214
1214
|
import UnheadVite from "@unhead/addons/vite";
|
|
1215
|
-
import Vue from "@vitejs/plugin-vue";
|
|
1216
1215
|
import { consola as consola13 } from "consola";
|
|
1217
1216
|
import { resolve as resolve12 } from "pathe";
|
|
1218
1217
|
import Components from "unplugin-vue-components/vite";
|
|
1219
1218
|
import Layouts from "vite-plugin-vue-layouts";
|
|
1220
1219
|
|
|
1221
1220
|
// node/plugins/extendConfig.ts
|
|
1222
|
-
import { dirname as dirname4, join as join3, resolve as resolve6 } from "
|
|
1221
|
+
import { dirname as dirname4, join as join3, resolve as resolve6 } from "path";
|
|
1223
1222
|
import { uniq as uniq3 } from "@antfu/utils";
|
|
1224
1223
|
import { mergeConfig as mergeConfig2, searchForWorkspaceRoot } from "vite";
|
|
1225
1224
|
|
|
1226
1225
|
// node/common.ts
|
|
1227
|
-
import { join as join2 } from "
|
|
1226
|
+
import { join as join2 } from "path";
|
|
1228
1227
|
import { uniq as uniq2 } from "@antfu/utils";
|
|
1229
1228
|
import fs10 from "fs-extra";
|
|
1230
1229
|
import { loadConfigFromFile as loadConfigFromFile2, mergeConfig } from "vite";
|
|
@@ -1337,6 +1336,8 @@ var EXCLUDE = [
|
|
|
1337
1336
|
"meting",
|
|
1338
1337
|
// internal
|
|
1339
1338
|
"valaxy",
|
|
1339
|
+
"virtual:valaxy-addons:empty",
|
|
1340
|
+
"@valaxyjs/devtools",
|
|
1340
1341
|
"/@valaxyjs/config",
|
|
1341
1342
|
"/@valaxyjs/context",
|
|
1342
1343
|
"/@valaxyjs/addons",
|
|
@@ -1465,7 +1466,7 @@ import {
|
|
|
1465
1466
|
import { colors as colors9 } from "consola/utils";
|
|
1466
1467
|
|
|
1467
1468
|
// ../../node_modules/.pnpm/nanoid@5.1.5/node_modules/nanoid/index.js
|
|
1468
|
-
import { webcrypto as crypto } from "
|
|
1469
|
+
import { webcrypto as crypto } from "crypto";
|
|
1469
1470
|
|
|
1470
1471
|
// ../../node_modules/.pnpm/nanoid@5.1.5/node_modules/nanoid/url-alphabet/index.js
|
|
1471
1472
|
var urlAlphabet = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
|
|
@@ -1956,7 +1957,7 @@ import imageFigures from "markdown-it-image-figures";
|
|
|
1956
1957
|
import TaskLists from "markdown-it-task-lists";
|
|
1957
1958
|
|
|
1958
1959
|
// node/plugins/markdown/plugins/link.ts
|
|
1959
|
-
import { URL as URL2 } from "
|
|
1960
|
+
import { URL as URL2 } from "url";
|
|
1960
1961
|
var indexRE = /(^|.*\/)index.md(.*)$/i;
|
|
1961
1962
|
function linkPlugin(md3, externalAttrs, base) {
|
|
1962
1963
|
md3.renderer.rules.link_open = (tokens, idx, options, env, self) => {
|
|
@@ -2645,7 +2646,7 @@ import { slash as slash2 } from "@antfu/utils";
|
|
|
2645
2646
|
import path7 from "pathe";
|
|
2646
2647
|
|
|
2647
2648
|
// node/plugins/markdown/utils/html.ts
|
|
2648
|
-
import process6 from "
|
|
2649
|
+
import process6 from "process";
|
|
2649
2650
|
var KNOWN_EXTENSIONS = /* @__PURE__ */ new Set();
|
|
2650
2651
|
function treatAsHtml(filename) {
|
|
2651
2652
|
if (KNOWN_EXTENSIONS.size === 0) {
|
|
@@ -2657,7 +2658,7 @@ function treatAsHtml(filename) {
|
|
|
2657
2658
|
}
|
|
2658
2659
|
|
|
2659
2660
|
// node/plugins/markdown/utils/processInclude.ts
|
|
2660
|
-
import path6 from "
|
|
2661
|
+
import path6 from "path";
|
|
2661
2662
|
import fs12 from "fs-extra";
|
|
2662
2663
|
function processIncludes(srcDir, src, file) {
|
|
2663
2664
|
const includesRE = /<!--\s*@include:\s*(.*?)\s*-->/g;
|
|
@@ -2820,8 +2821,8 @@ function createFixPlugins(options) {
|
|
|
2820
2821
|
}
|
|
2821
2822
|
|
|
2822
2823
|
// node/plugins/setupClient.ts
|
|
2823
|
-
import { existsSync } from "
|
|
2824
|
-
import { join as join4, resolve as resolve7 } from "
|
|
2824
|
+
import { existsSync } from "fs";
|
|
2825
|
+
import { join as join4, resolve as resolve7 } from "path";
|
|
2825
2826
|
import { slash as slash3, uniq as uniq4 } from "@antfu/utils";
|
|
2826
2827
|
function createClientSetupPlugin({ clientRoot, themeRoot, userRoot: userRoot2 }) {
|
|
2827
2828
|
const setupEntry = slash3(resolve7(clientRoot, "setup"));
|
|
@@ -2863,7 +2864,7 @@ function createClientSetupPlugin({ clientRoot, themeRoot, userRoot: userRoot2 })
|
|
|
2863
2864
|
}
|
|
2864
2865
|
|
|
2865
2866
|
// node/plugins/unocss.ts
|
|
2866
|
-
import { resolve as resolve9 } from "
|
|
2867
|
+
import { resolve as resolve9 } from "path";
|
|
2867
2868
|
import defu3 from "defu";
|
|
2868
2869
|
import fs14 from "fs-extra";
|
|
2869
2870
|
import { createJiti as createJiti3 } from "jiti";
|
|
@@ -2877,7 +2878,7 @@ import {
|
|
|
2877
2878
|
} from "unocss";
|
|
2878
2879
|
|
|
2879
2880
|
// node/plugins/setupNode.ts
|
|
2880
|
-
import { resolve as resolve8 } from "
|
|
2881
|
+
import { resolve as resolve8 } from "path";
|
|
2881
2882
|
import { isObject } from "@antfu/utils";
|
|
2882
2883
|
import fs13 from "fs-extra";
|
|
2883
2884
|
import { createJiti as createJiti2 } from "jiti";
|
|
@@ -3103,8 +3104,8 @@ var templateLocales = {
|
|
|
3103
3104
|
};
|
|
3104
3105
|
|
|
3105
3106
|
// node/virtual/styles.ts
|
|
3106
|
-
import { existsSync as existsSync2 } from "
|
|
3107
|
-
import { join as join6 } from "
|
|
3107
|
+
import { existsSync as existsSync2 } from "fs";
|
|
3108
|
+
import { join as join6 } from "path";
|
|
3108
3109
|
var templateStyles = {
|
|
3109
3110
|
id: "/@valaxyjs/styles",
|
|
3110
3111
|
async getContent({ clientRoot, roots, config }) {
|
|
@@ -3261,7 +3262,7 @@ function createScanDeadLinks(options) {
|
|
|
3261
3262
|
}
|
|
3262
3263
|
|
|
3263
3264
|
// node/utils/encrypt.ts
|
|
3264
|
-
import { webcrypto as webcrypto2 } from "
|
|
3265
|
+
import { webcrypto as webcrypto2 } from "crypto";
|
|
3265
3266
|
function getKeyMaterial(password) {
|
|
3266
3267
|
const enc = new TextEncoder();
|
|
3267
3268
|
return webcrypto2.subtle.importKey(
|
|
@@ -3413,7 +3414,7 @@ function transformHexoTags(code, id) {
|
|
|
3413
3414
|
}
|
|
3414
3415
|
|
|
3415
3416
|
// node/plugins/markdown/transform/markdown.ts
|
|
3416
|
-
import path9 from "
|
|
3417
|
+
import path9 from "path";
|
|
3417
3418
|
import fs18 from "fs-extra";
|
|
3418
3419
|
function genProvideCode(name, data) {
|
|
3419
3420
|
return [
|
|
@@ -3432,7 +3433,6 @@ function injectPageDataCode(pageData) {
|
|
|
3432
3433
|
"const route = useRoute()",
|
|
3433
3434
|
// $frontmatter contain runtime added data, will be deleted (for example, $frontmatter.partiallyEncryptedContents)
|
|
3434
3435
|
`const $frontmatter = Object.assign(route.meta.frontmatter || {}, pageData.value?.frontmatter || {})
|
|
3435
|
-
route.meta.frontmatter = $frontmatter
|
|
3436
3436
|
router.currentRoute.value.data = pageData.value
|
|
3437
3437
|
|
|
3438
3438
|
provide('valaxy:frontmatter', $frontmatter)
|
|
@@ -3607,7 +3607,7 @@ function generateAppVue(root) {
|
|
|
3607
3607
|
];
|
|
3608
3608
|
return scripts.join("\n");
|
|
3609
3609
|
}
|
|
3610
|
-
async function
|
|
3610
|
+
async function createValaxyPlugin(options, serverOptions = {}) {
|
|
3611
3611
|
let { config: valaxyConfig } = options;
|
|
3612
3612
|
const valaxyPrefix2 = "/@valaxy";
|
|
3613
3613
|
let hasDeadLinks = false;
|
|
@@ -3625,8 +3625,10 @@ async function createValaxyLoader(options, serverOptions = {}) {
|
|
|
3625
3625
|
);
|
|
3626
3626
|
},
|
|
3627
3627
|
configureServer(server) {
|
|
3628
|
+
if (options.configFile) {
|
|
3629
|
+
server.watcher.add(options.configFile);
|
|
3630
|
+
}
|
|
3628
3631
|
server.watcher.add([
|
|
3629
|
-
options.configFile,
|
|
3630
3632
|
options.clientRoot,
|
|
3631
3633
|
options.themeRoot,
|
|
3632
3634
|
options.userRoot
|
|
@@ -3764,7 +3766,7 @@ import { resolve as resolve11 } from "pathe";
|
|
|
3764
3766
|
import VueRouter from "unplugin-vue-router/vite";
|
|
3765
3767
|
|
|
3766
3768
|
// node/plugins/presets/statistics.ts
|
|
3767
|
-
import { existsSync as existsSync3, readFileSync } from "
|
|
3769
|
+
import { existsSync as existsSync3, readFileSync } from "fs";
|
|
3768
3770
|
function count(content) {
|
|
3769
3771
|
const cn = (content.match(/[\u4E00-\u9FA5]/g) || []).length;
|
|
3770
3772
|
const en = (content.replace(/[\u4E00-\u9FA5]/g, "").match(/[\w\u0392-\u03C9\u0400-\u04FF]+|[\u4E00-\u9FFF\u3400-\u4DBF\uF900-\uFAFF\u3040-\u309F\uAC00-\uD7AF\u0400-\u04FF]+|[\u00E4\u00C4\u00E5\u00C5\u00F6\u00D6]+/g) || []).length;
|
|
@@ -3958,17 +3960,17 @@ async function ViteValaxyPlugins(valaxyApp, serverOptions = {}) {
|
|
|
3958
3960
|
const { options } = valaxyApp;
|
|
3959
3961
|
const { roots, config: valaxyConfig } = options;
|
|
3960
3962
|
const MarkdownPlugin = await createMarkdownPlugin(options);
|
|
3961
|
-
const
|
|
3963
|
+
const ValaxyPlugin = await createValaxyPlugin(options, serverOptions);
|
|
3962
3964
|
const componentsDirs = roots.map((root) => `${root}/components`).concat(["src/components", "components"]);
|
|
3963
|
-
const
|
|
3964
|
-
|
|
3965
|
-
|
|
3966
|
-
createClientSetupPlugin(options),
|
|
3967
|
-
Vue({
|
|
3968
|
-
include: [/\.vue$/, /\.md$/],
|
|
3965
|
+
const vuePlugin = await import("@vitejs/plugin-vue").then(
|
|
3966
|
+
(r) => r.default({
|
|
3967
|
+
include: /\.(?:vue|md)$/,
|
|
3969
3968
|
exclude: [],
|
|
3969
|
+
...valaxyConfig.vue,
|
|
3970
3970
|
template: {
|
|
3971
|
+
...valaxyConfig.vue?.template,
|
|
3971
3972
|
compilerOptions: {
|
|
3973
|
+
...valaxyConfig.vue?.template?.compilerOptions,
|
|
3972
3974
|
isCustomElement: (tag) => {
|
|
3973
3975
|
let is = customElements.has(tag);
|
|
3974
3976
|
valaxyConfig.vue?.isCustomElement?.forEach((fn) => {
|
|
@@ -3977,10 +3979,15 @@ async function ViteValaxyPlugins(valaxyApp, serverOptions = {}) {
|
|
|
3977
3979
|
return is;
|
|
3978
3980
|
}
|
|
3979
3981
|
}
|
|
3980
|
-
}
|
|
3981
|
-
|
|
3982
|
-
|
|
3983
|
-
|
|
3982
|
+
}
|
|
3983
|
+
})
|
|
3984
|
+
);
|
|
3985
|
+
const plugins = [
|
|
3986
|
+
MarkdownPlugin,
|
|
3987
|
+
ValaxyPlugin,
|
|
3988
|
+
vuePlugin,
|
|
3989
|
+
createConfigPlugin(options),
|
|
3990
|
+
createClientSetupPlugin(options),
|
|
3984
3991
|
UnheadVite(),
|
|
3985
3992
|
// https://github.com/posva/unplugin-vue-router
|
|
3986
3993
|
await createRouterPlugin(valaxyApp),
|
|
@@ -4162,7 +4169,7 @@ async function generateClientRedirects(options) {
|
|
|
4162
4169
|
}
|
|
4163
4170
|
|
|
4164
4171
|
// node/server.ts
|
|
4165
|
-
import process7 from "
|
|
4172
|
+
import process7 from "process";
|
|
4166
4173
|
import { colors as colors13 } from "consola/utils";
|
|
4167
4174
|
import { createServer as createViteServer, mergeConfig as mergeViteConfig3 } from "vite";
|
|
4168
4175
|
function getServerInfoText(msg) {
|
|
@@ -4195,10 +4202,9 @@ async function createServer(valaxyApp, viteConfig = {}, serverOptions = {}) {
|
|
|
4195
4202
|
}
|
|
4196
4203
|
|
|
4197
4204
|
// node/cli/utils/cli.ts
|
|
4198
|
-
import os from "
|
|
4199
|
-
import path12 from "
|
|
4200
|
-
import process8 from "
|
|
4201
|
-
import * as readline from "node:readline";
|
|
4205
|
+
import os from "os";
|
|
4206
|
+
import path12 from "path";
|
|
4207
|
+
import process8 from "process";
|
|
4202
4208
|
import { consola as consola15 } from "consola";
|
|
4203
4209
|
import { colors as colors14 } from "consola/utils";
|
|
4204
4210
|
import ora4 from "ora";
|
|
@@ -4253,7 +4259,7 @@ async function initServer(valaxyApp, viteConfig) {
|
|
|
4253
4259
|
viteConfig
|
|
4254
4260
|
);
|
|
4255
4261
|
try {
|
|
4256
|
-
|
|
4262
|
+
GLOBAL_STATE.server = await createServer(valaxyApp, viteConfigs, {
|
|
4257
4263
|
async onConfigReload(newConfig, config, force = false) {
|
|
4258
4264
|
if (force) {
|
|
4259
4265
|
vLogger.info(`${colors14.yellow("force")} reload the server`);
|
|
@@ -4266,9 +4272,9 @@ async function initServer(valaxyApp, viteConfig) {
|
|
|
4266
4272
|
initServer(valaxyApp, viteConfig);
|
|
4267
4273
|
}
|
|
4268
4274
|
});
|
|
4275
|
+
const server = GLOBAL_STATE.server;
|
|
4269
4276
|
await server.listen();
|
|
4270
4277
|
serverSpinner.succeed(`${valaxyPrefix} ${colors14.green("server ready.")}`);
|
|
4271
|
-
GLOBAL_STATE.server = server;
|
|
4272
4278
|
return server;
|
|
4273
4279
|
} catch (e) {
|
|
4274
4280
|
consola15.error("failed to start server. error:\n");
|
|
@@ -4276,27 +4282,6 @@ async function initServer(valaxyApp, viteConfig) {
|
|
|
4276
4282
|
process8.exit(1);
|
|
4277
4283
|
}
|
|
4278
4284
|
}
|
|
4279
|
-
function bindShortcut(SHORTCUTS) {
|
|
4280
|
-
process8.stdin.resume();
|
|
4281
|
-
process8.stdin.setEncoding("utf8");
|
|
4282
|
-
readline.emitKeypressEvents(process8.stdin);
|
|
4283
|
-
if (process8.stdin.isTTY)
|
|
4284
|
-
process8.stdin.setRawMode(true);
|
|
4285
|
-
process8.stdin.on("keypress", (str, key) => {
|
|
4286
|
-
if (key.ctrl && key.name === "c") {
|
|
4287
|
-
process8.exit();
|
|
4288
|
-
} else {
|
|
4289
|
-
const [sh] = SHORTCUTS.filter((item) => item.name === str);
|
|
4290
|
-
if (sh) {
|
|
4291
|
-
try {
|
|
4292
|
-
sh.action();
|
|
4293
|
-
} catch (err) {
|
|
4294
|
-
console.error(`Failed to execute shortcut ${sh.fullName}`, err);
|
|
4295
|
-
}
|
|
4296
|
-
}
|
|
4297
|
-
}
|
|
4298
|
-
});
|
|
4299
|
-
}
|
|
4300
4285
|
if (import.meta.hot) {
|
|
4301
4286
|
await import.meta.hot.data.stopping;
|
|
4302
4287
|
let reload = async () => {
|
|
@@ -4397,13 +4382,13 @@ function registerBuildCommand(cli2) {
|
|
|
4397
4382
|
}
|
|
4398
4383
|
|
|
4399
4384
|
// node/cli/clean.ts
|
|
4400
|
-
import path14 from "
|
|
4401
|
-
import process10 from "
|
|
4385
|
+
import path14 from "path";
|
|
4386
|
+
import process10 from "process";
|
|
4402
4387
|
import { consola as consola17 } from "consola";
|
|
4403
4388
|
import fs22 from "fs-extra";
|
|
4404
4389
|
|
|
4405
4390
|
// node/cli/utils/fs.ts
|
|
4406
|
-
import { access } from "
|
|
4391
|
+
import { access } from "fs/promises";
|
|
4407
4392
|
async function exists(path17) {
|
|
4408
4393
|
try {
|
|
4409
4394
|
await access(path17);
|
|
@@ -4464,7 +4449,7 @@ function registerDebugCommand(cli2) {
|
|
|
4464
4449
|
}
|
|
4465
4450
|
|
|
4466
4451
|
// node/cli/deploy.ts
|
|
4467
|
-
import process11 from "
|
|
4452
|
+
import process11 from "process";
|
|
4468
4453
|
import { confirm, intro, outro, select } from "@clack/prompts";
|
|
4469
4454
|
function registerDeployCommand(cli2) {
|
|
4470
4455
|
cli2.command("deploy", "deploy your blog to the cloud", async () => {
|
|
@@ -4512,15 +4497,12 @@ function registerDeployCommand(cli2) {
|
|
|
4512
4497
|
}
|
|
4513
4498
|
|
|
4514
4499
|
// node/cli/dev.ts
|
|
4515
|
-
import
|
|
4516
|
-
import
|
|
4517
|
-
import path15 from "node:path";
|
|
4518
|
-
import process12 from "node:process";
|
|
4519
|
-
import qrcode from "qrcode";
|
|
4500
|
+
import path15 from "path";
|
|
4501
|
+
import process13 from "process";
|
|
4520
4502
|
import { mergeConfig as mergeConfig5 } from "vite";
|
|
4521
4503
|
|
|
4522
4504
|
// node/utils/net.ts
|
|
4523
|
-
import net from "
|
|
4505
|
+
import net from "net";
|
|
4524
4506
|
async function findFreePort(start) {
|
|
4525
4507
|
if (await isPortFree(start))
|
|
4526
4508
|
return start;
|
|
@@ -4543,9 +4525,90 @@ function isPortFree(port) {
|
|
|
4543
4525
|
});
|
|
4544
4526
|
}
|
|
4545
4527
|
|
|
4528
|
+
// node/cli/utils/shortcuts.ts
|
|
4529
|
+
import { exec } from "child_process";
|
|
4530
|
+
import os2 from "os";
|
|
4531
|
+
import process12 from "process";
|
|
4532
|
+
import * as readline from "readline";
|
|
4533
|
+
import { colors as colors16 } from "consola/utils";
|
|
4534
|
+
import qrcode from "qrcode";
|
|
4535
|
+
var SHORTCUTS = [
|
|
4536
|
+
{
|
|
4537
|
+
key: "r",
|
|
4538
|
+
description: "restart",
|
|
4539
|
+
async action(server, createDevServer) {
|
|
4540
|
+
await server.close();
|
|
4541
|
+
setTimeout(async () => {
|
|
4542
|
+
await createDevServer();
|
|
4543
|
+
}, 100);
|
|
4544
|
+
}
|
|
4545
|
+
},
|
|
4546
|
+
{
|
|
4547
|
+
key: "o",
|
|
4548
|
+
description: "open",
|
|
4549
|
+
async action(server) {
|
|
4550
|
+
const { default: openBrowser } = await import("open");
|
|
4551
|
+
openBrowser(`http://localhost:${server.config.server.port}/`);
|
|
4552
|
+
}
|
|
4553
|
+
},
|
|
4554
|
+
{
|
|
4555
|
+
key: "q",
|
|
4556
|
+
description: "qr",
|
|
4557
|
+
action(server) {
|
|
4558
|
+
const addresses = Object.values(os2.networkInterfaces()).flat().filter((details) => details?.family === "IPv4" && !details.address.includes("127.0.0.1"));
|
|
4559
|
+
const port = server.config.server.port;
|
|
4560
|
+
const remoteUrl = `http://${addresses[0]?.address || "localhost"}:${port}`;
|
|
4561
|
+
qrcode.toString(remoteUrl, { type: "terminal" }, (err, qrCode) => {
|
|
4562
|
+
if (err)
|
|
4563
|
+
throw err;
|
|
4564
|
+
console.log(qrCode);
|
|
4565
|
+
});
|
|
4566
|
+
}
|
|
4567
|
+
},
|
|
4568
|
+
{
|
|
4569
|
+
key: "e",
|
|
4570
|
+
description: "edit",
|
|
4571
|
+
action() {
|
|
4572
|
+
exec(`code "${process12.cwd()}"`, (err) => {
|
|
4573
|
+
if (err)
|
|
4574
|
+
console.error("Failed to open editor", err);
|
|
4575
|
+
});
|
|
4576
|
+
}
|
|
4577
|
+
}
|
|
4578
|
+
];
|
|
4579
|
+
function bindShortcuts(server, createDevServer) {
|
|
4580
|
+
if (!server.httpServer || process12.env.CI) {
|
|
4581
|
+
console.log("restart server to enable shortcuts", server.httpServer, process12.stdin.isTTY, process12.env.CI);
|
|
4582
|
+
return;
|
|
4583
|
+
}
|
|
4584
|
+
process12.stdin.resume();
|
|
4585
|
+
process12.stdin.setEncoding("utf8");
|
|
4586
|
+
readline.emitKeypressEvents(process12.stdin);
|
|
4587
|
+
if (process12.stdin.isTTY)
|
|
4588
|
+
process12.stdin.setRawMode(true);
|
|
4589
|
+
async function onKeyPress(str, key) {
|
|
4590
|
+
if (key.ctrl && key.name === "c") {
|
|
4591
|
+
process12.exit();
|
|
4592
|
+
} else {
|
|
4593
|
+
const shortcut = SHORTCUTS.find((shortcut2) => shortcut2.key === str);
|
|
4594
|
+
if (!shortcut)
|
|
4595
|
+
return;
|
|
4596
|
+
try {
|
|
4597
|
+
await shortcut.action(server, createDevServer);
|
|
4598
|
+
} catch (error) {
|
|
4599
|
+
console.error(colors16.red("Error executing shortcut:"), key, error);
|
|
4600
|
+
}
|
|
4601
|
+
}
|
|
4602
|
+
}
|
|
4603
|
+
process12.stdin.on("keypress", onKeyPress);
|
|
4604
|
+
server.httpServer.on("close", () => {
|
|
4605
|
+
process12.stdin.off("keypress", onKeyPress);
|
|
4606
|
+
});
|
|
4607
|
+
}
|
|
4608
|
+
|
|
4546
4609
|
// node/cli/dev.ts
|
|
4547
4610
|
async function startValaxyDev({
|
|
4548
|
-
root =
|
|
4611
|
+
root = process13.cwd(),
|
|
4549
4612
|
port,
|
|
4550
4613
|
remote,
|
|
4551
4614
|
log,
|
|
@@ -4553,7 +4616,7 @@ async function startValaxyDev({
|
|
|
4553
4616
|
}) {
|
|
4554
4617
|
setEnv();
|
|
4555
4618
|
if (!isPagesDirExist(root))
|
|
4556
|
-
|
|
4619
|
+
process13.exit(0);
|
|
4557
4620
|
port = port || await findFreePort(4859);
|
|
4558
4621
|
const resolvedOptions = await resolveOptions({ userRoot: root });
|
|
4559
4622
|
setTimezone(resolvedOptions.config.siteConfig.timezone);
|
|
@@ -4576,47 +4639,9 @@ async function startValaxyDev({
|
|
|
4576
4639
|
},
|
|
4577
4640
|
logLevel: log
|
|
4578
4641
|
}, resolvedOptions.config.vite || {});
|
|
4579
|
-
await initServer(valaxyApp, viteConfig);
|
|
4642
|
+
const server = await initServer(valaxyApp, viteConfig);
|
|
4580
4643
|
printInfo(resolvedOptions, port, remote);
|
|
4581
|
-
|
|
4582
|
-
{
|
|
4583
|
-
name: "r",
|
|
4584
|
-
fullName: "restart",
|
|
4585
|
-
async action() {
|
|
4586
|
-
await initServer(valaxyApp, viteConfig);
|
|
4587
|
-
printInfo(resolvedOptions, port, remote);
|
|
4588
|
-
}
|
|
4589
|
-
},
|
|
4590
|
-
{
|
|
4591
|
-
name: "o",
|
|
4592
|
-
fullName: "open",
|
|
4593
|
-
async action() {
|
|
4594
|
-
const { default: openBrowser } = await import("open");
|
|
4595
|
-
openBrowser(`http://localhost:${port}`);
|
|
4596
|
-
}
|
|
4597
|
-
},
|
|
4598
|
-
{
|
|
4599
|
-
name: "q",
|
|
4600
|
-
fullName: "qr",
|
|
4601
|
-
action() {
|
|
4602
|
-
const addresses = Object.values(os2.networkInterfaces()).flat().filter((details) => details?.family === "IPv4" && !details.address.includes("127.0.0.1"));
|
|
4603
|
-
const remoteUrl = `http://${addresses[0]?.address || "localhost"}:${port}`;
|
|
4604
|
-
qrcode.toString(remoteUrl, { type: "terminal" }, (err, qrCode) => {
|
|
4605
|
-
if (err)
|
|
4606
|
-
throw err;
|
|
4607
|
-
console.log(qrCode);
|
|
4608
|
-
});
|
|
4609
|
-
}
|
|
4610
|
-
},
|
|
4611
|
-
{
|
|
4612
|
-
name: "e",
|
|
4613
|
-
fullName: "edit",
|
|
4614
|
-
action() {
|
|
4615
|
-
exec(`code "${root}"`);
|
|
4616
|
-
}
|
|
4617
|
-
}
|
|
4618
|
-
];
|
|
4619
|
-
bindShortcut(SHORTCUTS);
|
|
4644
|
+
return server;
|
|
4620
4645
|
}
|
|
4621
4646
|
function registerDevCommand(cli2) {
|
|
4622
4647
|
cli2.command(
|
|
@@ -4642,29 +4667,34 @@ function registerDevCommand(cli2) {
|
|
|
4642
4667
|
describe: "log level"
|
|
4643
4668
|
}).strict().help(),
|
|
4644
4669
|
async ({ root, port, open, remote, log }) => {
|
|
4645
|
-
|
|
4646
|
-
|
|
4647
|
-
|
|
4648
|
-
|
|
4649
|
-
|
|
4650
|
-
|
|
4651
|
-
|
|
4670
|
+
let server;
|
|
4671
|
+
const createDevServer = async () => {
|
|
4672
|
+
server = await startValaxyDev({
|
|
4673
|
+
root,
|
|
4674
|
+
open,
|
|
4675
|
+
port,
|
|
4676
|
+
remote,
|
|
4677
|
+
log
|
|
4678
|
+
});
|
|
4679
|
+
bindShortcuts(server, createDevServer);
|
|
4680
|
+
};
|
|
4681
|
+
createDevServer();
|
|
4652
4682
|
}
|
|
4653
4683
|
);
|
|
4654
4684
|
}
|
|
4655
4685
|
|
|
4656
4686
|
// node/cli/utils/post.ts
|
|
4657
|
-
import { writeFile as writeFile2 } from "
|
|
4658
|
-
import { join as join9, resolve as resolve14 } from "
|
|
4687
|
+
import { writeFile as writeFile2 } from "fs/promises";
|
|
4688
|
+
import { join as join9, resolve as resolve14 } from "path";
|
|
4659
4689
|
import { ensureSuffix as ensureSuffix2 } from "@antfu/utils";
|
|
4660
4690
|
import { consola as consola19 } from "consola";
|
|
4661
|
-
import { colors as
|
|
4691
|
+
import { colors as colors17 } from "consola/utils";
|
|
4662
4692
|
import dayjs2 from "dayjs";
|
|
4663
4693
|
import { render } from "ejs";
|
|
4664
4694
|
|
|
4665
4695
|
// node/cli/utils/constants.ts
|
|
4666
|
-
import
|
|
4667
|
-
var userRoot =
|
|
4696
|
+
import process14 from "process";
|
|
4697
|
+
var userRoot = process14.cwd();
|
|
4668
4698
|
var defaultPostTemplate = `---
|
|
4669
4699
|
layout: <%=layout%>
|
|
4670
4700
|
title: <%=title%>
|
|
@@ -4673,8 +4703,8 @@ date: <%=date%>
|
|
|
4673
4703
|
`;
|
|
4674
4704
|
|
|
4675
4705
|
// node/cli/utils/scaffold.ts
|
|
4676
|
-
import { readFile as readFile2 } from "
|
|
4677
|
-
import path16 from "
|
|
4706
|
+
import { readFile as readFile2 } from "fs/promises";
|
|
4707
|
+
import path16 from "path";
|
|
4678
4708
|
async function getTemplate(layout) {
|
|
4679
4709
|
const { clientRoot, themeRoot } = await resolveOptions({ userRoot });
|
|
4680
4710
|
const roots = [userRoot, themeRoot, clientRoot];
|
|
@@ -4704,11 +4734,11 @@ async function create(data) {
|
|
|
4704
4734
|
const content = await genLayoutTemplate(data);
|
|
4705
4735
|
try {
|
|
4706
4736
|
await writeFile2(destinationPath, content, "utf-8");
|
|
4707
|
-
consola19.success(`[valaxy new]: successfully generated file ${
|
|
4737
|
+
consola19.success(`[valaxy new]: successfully generated file ${colors17.magenta(destinationPath)}`);
|
|
4708
4738
|
} catch (e) {
|
|
4709
4739
|
console.log(e);
|
|
4710
4740
|
consola19.error(`[valaxy new]: failed to write file ${destinationPath}`);
|
|
4711
|
-
consola19.warn(`You should run ${
|
|
4741
|
+
consola19.warn(`You should run ${colors17.green("valaxy new")} in your valaxy project root directory.`);
|
|
4712
4742
|
}
|
|
4713
4743
|
return destinationPath;
|
|
4714
4744
|
}
|
|
@@ -4763,7 +4793,7 @@ function registerNewCommand(cli2) {
|
|
|
4763
4793
|
}
|
|
4764
4794
|
|
|
4765
4795
|
// node/cli/index.ts
|
|
4766
|
-
var cli = yargs(hideBin(
|
|
4796
|
+
var cli = yargs(hideBin(process15.argv)).scriptName("valaxy").usage("$0 [args]").version(version).showHelpOnFail(false).alias("h", "help").alias("v", "version");
|
|
4767
4797
|
registerDevCommand(cli);
|
|
4768
4798
|
registerBuildCommand(cli);
|
|
4769
4799
|
registerNewCommand(cli);
|
|
@@ -4822,7 +4852,7 @@ export {
|
|
|
4822
4852
|
processValaxyOptions,
|
|
4823
4853
|
resolveOptions,
|
|
4824
4854
|
resolveThemeValaxyConfig,
|
|
4825
|
-
|
|
4855
|
+
createValaxyPlugin,
|
|
4826
4856
|
ViteValaxyPlugins,
|
|
4827
4857
|
build2 as build,
|
|
4828
4858
|
ssgBuild,
|
package/dist/node/cli/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as yargs from 'yargs';
|
|
2
2
|
import { Argv } from 'yargs';
|
|
3
|
-
import { LogLevel } from 'vite';
|
|
3
|
+
import { LogLevel, ViteDevServer } from 'vite';
|
|
4
4
|
|
|
5
5
|
declare function startValaxyDev({ root, port, remote, log, open, }: {
|
|
6
6
|
root?: string;
|
|
@@ -8,7 +8,7 @@ declare function startValaxyDev({ root, port, remote, log, open, }: {
|
|
|
8
8
|
remote?: boolean;
|
|
9
9
|
log?: LogLevel;
|
|
10
10
|
open?: boolean;
|
|
11
|
-
}): Promise<
|
|
11
|
+
}): Promise<ViteDevServer>;
|
|
12
12
|
declare function registerDevCommand(cli: Argv): void;
|
|
13
13
|
|
|
14
14
|
declare const cli: yargs.Argv<{}>;
|
package/dist/node/cli/index.js
CHANGED
package/dist/node/index.d.ts
CHANGED
|
@@ -628,7 +628,7 @@ declare function ViteValaxyPlugins(valaxyApp: ValaxyNode, serverOptions?: Valaxy
|
|
|
628
628
|
* @param options
|
|
629
629
|
* @param serverOptions
|
|
630
630
|
*/
|
|
631
|
-
declare function
|
|
631
|
+
declare function createValaxyPlugin(options: ResolvedValaxyOptions, serverOptions?: ValaxyServerOptions): Promise<Plugin[]>;
|
|
632
632
|
|
|
633
633
|
/**
|
|
634
634
|
* with valaxyPrefix
|
|
@@ -665,4 +665,4 @@ declare function toAtFS(path: string): string;
|
|
|
665
665
|
declare function resolveImportPath(importName: string, ensure?: true): Promise<string>;
|
|
666
666
|
declare function resolveImportPath(importName: string, ensure?: boolean): Promise<string | undefined>;
|
|
667
667
|
|
|
668
|
-
export { ALL_ROUTE, EXCERPT_SEPARATOR, EXTERNAL_URL_RE, type HookResult, type LoadConfigFromFileOptions, PATHNAME_PROTOCOL_RE, type ResolvedConfig, type ResolvedValaxyOptions, type UnoSetup, type UserInputConfig, type UserValaxyNodeConfig, type ValaxyAddonExport, type ValaxyAddonFn, type ValaxyAddonLike, type ValaxyAddonResolver, type ValaxyAddons, type ValaxyApp, type ValaxyConfigExport, type ValaxyConfigExtendKey, type ValaxyConfigFn, type ValaxyEntryOptions, type ValaxyExtendConfig, type ValaxyHooks, type ValaxyNode, type ValaxyNodeConfig, type ValaxyPickConfig, type ValaxyServerOptions, type ValaxyTheme, ViteValaxyPlugins, build, createServer,
|
|
668
|
+
export { ALL_ROUTE, EXCERPT_SEPARATOR, EXTERNAL_URL_RE, type HookResult, type LoadConfigFromFileOptions, PATHNAME_PROTOCOL_RE, type ResolvedConfig, type ResolvedValaxyOptions, type UnoSetup, type UserInputConfig, type UserValaxyNodeConfig, type ValaxyAddonExport, type ValaxyAddonFn, type ValaxyAddonLike, type ValaxyAddonResolver, type ValaxyAddons, type ValaxyApp, type ValaxyConfigExport, type ValaxyConfigExtendKey, type ValaxyConfigFn, type ValaxyEntryOptions, type ValaxyExtendConfig, type ValaxyHooks, type ValaxyNode, type ValaxyNodeConfig, type ValaxyPickConfig, type ValaxyServerOptions, type ValaxyTheme, ViteValaxyPlugins, build, createServer, createValaxyPlugin, customElements, defaultSiteConfig, defaultValaxyConfig, defaultViteConfig, defineAddon, defineConfig, defineSiteConfig, defineTheme, defineUnoSetup, defineValaxyAddon, defineValaxyConfig, defineValaxyTheme, generateClientRedirects, getGitTimestamp, getIndexHtml, getServerInfoText, isExternal, isInstalledGlobally, isPath, loadConfig, loadConfigFromFile, mergeValaxyConfig, mergeViteConfigs, postProcessForSSG, processValaxyOptions, resolveAddonsConfig, resolveImportPath, resolveImportUrl, resolveOptions, resolveSiteConfig, resolveSiteConfigFromRoot, resolveThemeConfigFromRoot, resolveThemeValaxyConfig, resolveUserThemeConfig, resolveValaxyConfig, resolveValaxyConfigFromRoot, ssgBuild, toAtFS, transformObject };
|
package/dist/node/index.js
CHANGED
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
build,
|
|
8
8
|
cli,
|
|
9
9
|
createServer,
|
|
10
|
-
|
|
10
|
+
createValaxyPlugin,
|
|
11
11
|
customElements,
|
|
12
12
|
defaultSiteConfig,
|
|
13
13
|
defaultValaxyConfig,
|
|
@@ -50,7 +50,7 @@ import {
|
|
|
50
50
|
startValaxyDev,
|
|
51
51
|
toAtFS,
|
|
52
52
|
transformObject
|
|
53
|
-
} from "../chunk-
|
|
53
|
+
} from "../chunk-VMMD3G2Q.js";
|
|
54
54
|
export {
|
|
55
55
|
ALL_ROUTE,
|
|
56
56
|
EXCERPT_SEPARATOR,
|
|
@@ -60,7 +60,7 @@ export {
|
|
|
60
60
|
build,
|
|
61
61
|
cli,
|
|
62
62
|
createServer,
|
|
63
|
-
|
|
63
|
+
createValaxyPlugin,
|
|
64
64
|
customElements,
|
|
65
65
|
defaultSiteConfig,
|
|
66
66
|
defaultValaxyConfig,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "valaxy",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.23.
|
|
4
|
+
"version": "0.23.4",
|
|
5
5
|
"description": "📄 Vite & Vue powered static blog generator.",
|
|
6
6
|
"author": {
|
|
7
7
|
"email": "me@yunyoujun.cn",
|
|
@@ -52,32 +52,31 @@
|
|
|
52
52
|
"node": "^14.18.0 || >=16.0.0"
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
|
-
"@antfu/install-pkg": "^1.
|
|
55
|
+
"@antfu/install-pkg": "^1.1.0",
|
|
56
56
|
"@antfu/utils": "^9.2.0",
|
|
57
|
-
"@clack/prompts": "^0.
|
|
57
|
+
"@clack/prompts": "^0.11.0",
|
|
58
58
|
"@iconify-json/ri": "^1.2.5",
|
|
59
59
|
"@intlify/unplugin-vue-i18n": "^6.0.8",
|
|
60
|
-
"@shikijs/transformers": "^3.
|
|
60
|
+
"@shikijs/transformers": "^3.4.2",
|
|
61
61
|
"@types/katex": "^0.16.7",
|
|
62
|
-
"@unhead/addons": "^2.0.
|
|
63
|
-
"@unhead/schema-org": "^2.0.
|
|
64
|
-
"@unhead/vue": "^2.0.
|
|
65
|
-
"@vitejs/plugin-vue": "^5.2.
|
|
62
|
+
"@unhead/addons": "^2.0.10",
|
|
63
|
+
"@unhead/schema-org": "^2.0.10",
|
|
64
|
+
"@unhead/vue": "^2.0.10",
|
|
65
|
+
"@vitejs/plugin-vue": "^5.2.4",
|
|
66
66
|
"@vue/devtools-api": "7.7.2",
|
|
67
|
-
"@vueuse/core": "^13.
|
|
68
|
-
"@vueuse/integrations": "^13.
|
|
69
|
-
"beasties": "^0.3.
|
|
67
|
+
"@vueuse/core": "^13.2.0",
|
|
68
|
+
"@vueuse/integrations": "^13.2.0",
|
|
69
|
+
"beasties": "^0.3.4",
|
|
70
70
|
"birpc": "^2.3.0",
|
|
71
71
|
"consola": "^3.4.2",
|
|
72
72
|
"cross-spawn": "^7.0.6",
|
|
73
73
|
"css-i18n": "^0.0.5",
|
|
74
74
|
"dayjs": "^1.11.13",
|
|
75
|
-
"debug": "^4.4.
|
|
75
|
+
"debug": "^4.4.1",
|
|
76
76
|
"defu": "^6.1.4",
|
|
77
77
|
"ejs": "^3.1.10",
|
|
78
78
|
"escape-html": "^1.0.3",
|
|
79
79
|
"fast-glob": "^3.3.3",
|
|
80
|
-
"feed": "^4.2.2",
|
|
81
80
|
"floating-vue": "^5.2.2",
|
|
82
81
|
"fs-extra": "^11.3.0",
|
|
83
82
|
"fuse.js": "^7.1.0",
|
|
@@ -110,29 +109,30 @@
|
|
|
110
109
|
"pinia": "^3.0.2",
|
|
111
110
|
"qrcode": "^1.5.4",
|
|
112
111
|
"resolve-global": "^2.0.0",
|
|
113
|
-
"sass": "^1.
|
|
114
|
-
"shiki": "^3.
|
|
112
|
+
"sass": "^1.89.0",
|
|
113
|
+
"shiki": "^3.4.2",
|
|
115
114
|
"star-markdown-css": "^0.5.3",
|
|
116
115
|
"table": "^6.9.0",
|
|
117
|
-
"unhead": "^2.0.
|
|
118
|
-
"unocss": "^66.1.
|
|
116
|
+
"unhead": "^2.0.10",
|
|
117
|
+
"unocss": "^66.1.2",
|
|
119
118
|
"unplugin-vue-components": "28.0.0",
|
|
120
119
|
"unplugin-vue-markdown": "^28.3.1",
|
|
121
120
|
"unplugin-vue-router": "^0.12.0",
|
|
122
121
|
"vanilla-lazyload": "^19.1.3",
|
|
123
|
-
"vite": "^6.3.
|
|
122
|
+
"vite": "^6.3.5",
|
|
124
123
|
"vite-dev-rpc": "^1.0.7",
|
|
125
|
-
"vite-plugin-vue-devtools": "^7.7.
|
|
124
|
+
"vite-plugin-vue-devtools": "^7.7.6",
|
|
126
125
|
"vite-plugin-vue-layouts": "^0.11.0",
|
|
127
|
-
"vite-ssg": "^
|
|
128
|
-
"vite-ssg-sitemap": "^0.
|
|
129
|
-
"vitepress-plugin-group-icons": "^1.5.
|
|
130
|
-
"vue": "^3.5.
|
|
131
|
-
"vue-i18n": "^11.1.
|
|
132
|
-
"vue-router": "^4.5.
|
|
126
|
+
"vite-ssg": "^27.0.1",
|
|
127
|
+
"vite-ssg-sitemap": "^0.9.0",
|
|
128
|
+
"vitepress-plugin-group-icons": "^1.5.5",
|
|
129
|
+
"vue": "^3.5.14",
|
|
130
|
+
"vue-i18n": "^11.1.4",
|
|
131
|
+
"vue-router": "^4.5.1",
|
|
133
132
|
"yargs": "^17.7.2",
|
|
134
|
-
"
|
|
135
|
-
"@valaxyjs/utils": "0.23.
|
|
133
|
+
"zfeed": "^0.2.2",
|
|
134
|
+
"@valaxyjs/utils": "0.23.4",
|
|
135
|
+
"@valaxyjs/devtools": "0.23.4"
|
|
136
136
|
},
|
|
137
137
|
"devDependencies": {
|
|
138
138
|
"@mdit-vue/plugin-component": "^2.1.4",
|
|
@@ -157,7 +157,7 @@
|
|
|
157
157
|
"diacritics": "^1.3.0",
|
|
158
158
|
"gh-pages": "^6.3.0",
|
|
159
159
|
"https-localhost": "^4.7.1",
|
|
160
|
-
"rollup-plugin-visualizer": "^
|
|
160
|
+
"rollup-plugin-visualizer": "^6.0.0"
|
|
161
161
|
},
|
|
162
162
|
"scripts": {
|
|
163
163
|
"clean": "rimraf dist",
|