valaxy 0.23.2 → 0.23.3
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-OXTCPOR5.js} +131 -101
- 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 +5 -5
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,10 +1,10 @@
|
|
|
1
1
|
// node/cli/index.ts
|
|
2
|
-
import
|
|
2
|
+
import process15 from "node: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.3";
|
|
8
8
|
|
|
9
9
|
// node/modules/fuse.ts
|
|
10
10
|
import path4 from "node:path";
|
|
@@ -1212,7 +1212,6 @@ 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";
|
|
@@ -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",
|
|
@@ -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
|
|
@@ -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),
|
|
@@ -4198,7 +4205,6 @@ async function createServer(valaxyApp, viteConfig = {}, serverOptions = {}) {
|
|
|
4198
4205
|
import os from "node:os";
|
|
4199
4206
|
import path12 from "node:path";
|
|
4200
4207
|
import process8 from "node:process";
|
|
4201
|
-
import * as readline from "node:readline";
|
|
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 () => {
|
|
@@ -4512,11 +4497,8 @@ function registerDeployCommand(cli2) {
|
|
|
4512
4497
|
}
|
|
4513
4498
|
|
|
4514
4499
|
// node/cli/dev.ts
|
|
4515
|
-
import { exec } from "node:child_process";
|
|
4516
|
-
import os2 from "node:os";
|
|
4517
4500
|
import path15 from "node:path";
|
|
4518
|
-
import
|
|
4519
|
-
import qrcode from "qrcode";
|
|
4501
|
+
import process13 from "node:process";
|
|
4520
4502
|
import { mergeConfig as mergeConfig5 } from "vite";
|
|
4521
4503
|
|
|
4522
4504
|
// node/utils/net.ts
|
|
@@ -4543,9 +4525,90 @@ function isPortFree(port) {
|
|
|
4543
4525
|
});
|
|
4544
4526
|
}
|
|
4545
4527
|
|
|
4528
|
+
// node/cli/utils/shortcuts.ts
|
|
4529
|
+
import { exec } from "node:child_process";
|
|
4530
|
+
import os2 from "node:os";
|
|
4531
|
+
import process12 from "node:process";
|
|
4532
|
+
import * as readline from "node: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,13 +4667,18 @@ 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
|
}
|
|
@@ -4658,13 +4688,13 @@ import { writeFile as writeFile2 } from "node:fs/promises";
|
|
|
4658
4688
|
import { join as join9, resolve as resolve14 } from "node: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 "node:process";
|
|
4697
|
+
var userRoot = process14.cwd();
|
|
4668
4698
|
var defaultPostTemplate = `---
|
|
4669
4699
|
layout: <%=layout%>
|
|
4670
4700
|
title: <%=title%>
|
|
@@ -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-OXTCPOR5.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.3",
|
|
5
5
|
"description": "📄 Vite & Vue powered static blog generator.",
|
|
6
6
|
"author": {
|
|
7
7
|
"email": "me@yunyoujun.cn",
|
|
@@ -122,17 +122,17 @@
|
|
|
122
122
|
"vanilla-lazyload": "^19.1.3",
|
|
123
123
|
"vite": "^6.3.3",
|
|
124
124
|
"vite-dev-rpc": "^1.0.7",
|
|
125
|
-
"vite-plugin-vue-devtools": "^7.7.
|
|
125
|
+
"vite-plugin-vue-devtools": "^7.7.6",
|
|
126
126
|
"vite-plugin-vue-layouts": "^0.11.0",
|
|
127
127
|
"vite-ssg": "^26.1.1",
|
|
128
128
|
"vite-ssg-sitemap": "^0.8.1",
|
|
129
129
|
"vitepress-plugin-group-icons": "^1.5.2",
|
|
130
130
|
"vue": "^3.5.13",
|
|
131
131
|
"vue-i18n": "^11.1.3",
|
|
132
|
-
"vue-router": "^4.5.
|
|
132
|
+
"vue-router": "^4.5.1",
|
|
133
133
|
"yargs": "^17.7.2",
|
|
134
|
-
"@valaxyjs/devtools": "0.23.
|
|
135
|
-
"@valaxyjs/utils": "0.23.
|
|
134
|
+
"@valaxyjs/devtools": "0.23.3",
|
|
135
|
+
"@valaxyjs/utils": "0.23.3"
|
|
136
136
|
},
|
|
137
137
|
"devDependencies": {
|
|
138
138
|
"@mdit-vue/plugin-component": "^2.1.4",
|