valaxy 0.16.3 → 0.17.0-beta.1

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,2 +1,2 @@
1
1
  import {createRequire as __createRequire} from 'module';var require=__createRequire(import.meta.url);
2
- var n=Object.create;var i=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var p=Object.getOwnPropertyNames;var c=Object.getPrototypeOf,f=Object.prototype.hasOwnProperty;var h=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,o)=>(typeof require<"u"?require:e)[o]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var l=(t,e)=>()=>(t&&(e=t(t=0)),e);var x=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var s=(t,e,o,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let m of p(e))!f.call(t,m)&&m!==o&&i(t,m,{get:()=>e[m],enumerable:!(r=a(e,m))||r.enumerable});return t};var u=(t,e,o)=>(o=t!=null?n(c(t)):{},s(e||!t||!t.__esModule?i(o,"default",{value:t,enumerable:!0}):o,t));import{fileURLToPath as _}from"url";var d,L,g=l(()=>{"use strict";d=()=>_(import.meta.url),L=d()});export{h as a,x as b,u as c,L as d,g as e};
2
+ var n=Object.create;var i=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var p=Object.getOwnPropertyNames;var c=Object.getPrototypeOf,f=Object.prototype.hasOwnProperty;var d=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,o)=>(typeof require<"u"?require:e)[o]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var l=(t,e)=>()=>(t&&(e=t(t=0)),e);var g=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var s=(t,e,o,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let m of p(e))!f.call(t,m)&&m!==o&&i(t,m,{get:()=>e[m],enumerable:!(r=a(e,m))||r.enumerable});return t};var h=(t,e,o)=>(o=t!=null?n(c(t)):{},s(e||!t||!t.__esModule?i(o,"default",{value:t,enumerable:!0}):o,t));var _=l(()=>{"use strict"});export{d as a,g as b,h as c,_ as d};
@@ -275,6 +275,10 @@ interface SocialLink {
275
275
  icon: string;
276
276
  color: string;
277
277
  }
278
+ interface RedirectRule {
279
+ to: string;
280
+ from: string | string[];
281
+ }
278
282
  interface SiteConfig {
279
283
  /**
280
284
  * enable auto (light/dark mode)
@@ -544,6 +548,11 @@ interface SiteConfig {
544
548
  * @description:zh-CN 限制代码块的高度,单位是 px
545
549
  */
546
550
  codeHeightLimit?: number;
551
+ /**
552
+ * @description:en-US client redirect rules
553
+ * @description:zh-CN 客户端重定向规则
554
+ */
555
+ redirects?: RedirectRule[];
547
556
  }
548
557
  type PartialDeep<T> = {
549
558
  [P in keyof T]?: T[P] extends object ? PartialDeep<T[P]> : T[P];
@@ -594,4 +603,4 @@ type UserSiteConfig = PartialDeep<SiteConfig>;
594
603
  */
595
604
  type UserValaxyConfig<ThemeConfig = DefaultTheme.Config> = PartialDeep<ValaxyConfig<ThemeConfig>>;
596
605
 
597
- export { type Album as A, DefaultTheme as D, type ExcerptType as E, type FuseListItem as F, type PartialDeep as P, type RuntimeConfig as R, type SiteConfig as S, type UserSiteConfig as U, type ValaxyConfig as V, type ValaxyAddon as a, type Post as b, type SocialLink as c, type UserValaxyConfig as d, type Photo as e, type PageFrontMatter as f, type PostFrontMatter as g, type Page as h };
606
+ export { type Album as A, DefaultTheme as D, type ExcerptType as E, type FuseListItem as F, type PartialDeep as P, type RuntimeConfig as R, type SiteConfig as S, type UserSiteConfig as U, type ValaxyConfig as V, type ValaxyAddon as a, type Post as b, type SocialLink as c, type RedirectRule as d, type UserValaxyConfig as e, type Photo as f, type PageFrontMatter as g, type PostFrontMatter as h, type Page as i };
@@ -275,6 +275,10 @@ interface SocialLink {
275
275
  icon: string;
276
276
  color: string;
277
277
  }
278
+ interface RedirectRule {
279
+ to: string;
280
+ from: string | string[];
281
+ }
278
282
  interface SiteConfig {
279
283
  /**
280
284
  * enable auto (light/dark mode)
@@ -544,6 +548,11 @@ interface SiteConfig {
544
548
  * @description:zh-CN 限制代码块的高度,单位是 px
545
549
  */
546
550
  codeHeightLimit?: number;
551
+ /**
552
+ * @description:en-US client redirect rules
553
+ * @description:zh-CN 客户端重定向规则
554
+ */
555
+ redirects?: RedirectRule[];
547
556
  }
548
557
  type PartialDeep<T> = {
549
558
  [P in keyof T]?: T[P] extends object ? PartialDeep<T[P]> : T[P];
@@ -594,4 +603,4 @@ type UserSiteConfig = PartialDeep<SiteConfig>;
594
603
  */
595
604
  type UserValaxyConfig<ThemeConfig = DefaultTheme.Config> = PartialDeep<ValaxyConfig<ThemeConfig>>;
596
605
 
597
- export { type Album as A, DefaultTheme as D, type ExcerptType as E, type FuseListItem as F, type PartialDeep as P, type RuntimeConfig as R, type SiteConfig as S, type UserSiteConfig as U, type ValaxyConfig as V, type ValaxyAddon as a, type Post as b, type SocialLink as c, type UserValaxyConfig as d, type Photo as e, type PageFrontMatter as f, type PostFrontMatter as g, type Page as h };
606
+ export { type Album as A, DefaultTheme as D, type ExcerptType as E, type FuseListItem as F, type PartialDeep as P, type RuntimeConfig as R, type SiteConfig as S, type UserSiteConfig as U, type ValaxyConfig as V, type ValaxyAddon as a, type Post as b, type SocialLink as c, type RedirectRule as d, type UserValaxyConfig as e, type Photo as f, type PageFrontMatter as g, type PostFrontMatter as h, type Page as i };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkO6VYMTHEcjs = require('../../chunk-O6VYMTHE.cjs');require('../../chunk-R6EC3UMQ.cjs');exports.cli = _chunkO6VYMTHEcjs.F; exports.run = _chunkO6VYMTHEcjs.G;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkI374XGD2cjs = require('../../chunk-I374XGD2.cjs');require('../../chunk-GXMNHGBP.cjs');exports.cli = _chunkI374XGD2cjs.G; exports.run = _chunkI374XGD2cjs.H;
@@ -1,2 +1,2 @@
1
1
  import {createRequire as __createRequire} from 'module';var require=__createRequire(import.meta.url);
2
- import{F as a,G as b}from"../../chunk-KMYBWFOB.mjs";import"../../chunk-YTQABADX.mjs";export{a as cli,b as run};
2
+ import{G as a,H as b}from"../../chunk-EG3RHL6A.mjs";import"../../chunk-WSC7UAH5.mjs";export{a as cli,b as run};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkO6VYMTHEcjs = require('../chunk-O6VYMTHE.cjs');require('../chunk-R6EC3UMQ.cjs');exports.build = _chunkO6VYMTHEcjs.B; exports.cli = _chunkO6VYMTHEcjs.F; exports.createServer = _chunkO6VYMTHEcjs.E; exports.defaultSiteConfig = _chunkO6VYMTHEcjs.t; exports.defaultValaxyConfig = _chunkO6VYMTHEcjs.u; exports.defineAddon = _chunkO6VYMTHEcjs.n; exports.defineConfig = _chunkO6VYMTHEcjs.s; exports.defineSiteConfig = _chunkO6VYMTHEcjs.q; exports.defineTheme = _chunkO6VYMTHEcjs.p; exports.defineUnoSetup = _chunkO6VYMTHEcjs.v; exports.defineValaxyAddon = _chunkO6VYMTHEcjs.m; exports.defineValaxyConfig = _chunkO6VYMTHEcjs.r; exports.defineValaxyTheme = _chunkO6VYMTHEcjs.o; exports.ensurePrefix = _chunkO6VYMTHEcjs.d; exports.getGitTimestamp = _chunkO6VYMTHEcjs.a; exports.getIndexHtml = _chunkO6VYMTHEcjs.A; exports.isExternal = _chunkO6VYMTHEcjs.b; exports.isPath = _chunkO6VYMTHEcjs.f; exports.mergeValaxyConfig = _chunkO6VYMTHEcjs.g; exports.mergeViteConfigs = _chunkO6VYMTHEcjs.z; exports.postProcessForSSG = _chunkO6VYMTHEcjs.D; exports.processValaxyOptions = _chunkO6VYMTHEcjs.w; exports.resolveAddonConfig = _chunkO6VYMTHEcjs.j; exports.resolveImportPath = _chunkO6VYMTHEcjs.l; exports.resolveOptions = _chunkO6VYMTHEcjs.x; exports.resolveThemeValaxyConfig = _chunkO6VYMTHEcjs.y; exports.resolveValaxyConfig = _chunkO6VYMTHEcjs.i; exports.resolveValaxyConfigFromRoot = _chunkO6VYMTHEcjs.h; exports.run = _chunkO6VYMTHEcjs.G; exports.slash = _chunkO6VYMTHEcjs.c; exports.ssgBuild = _chunkO6VYMTHEcjs.C; exports.toAtFS = _chunkO6VYMTHEcjs.e; exports.transformObject = _chunkO6VYMTHEcjs.k;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkI374XGD2cjs = require('../chunk-I374XGD2.cjs');require('../chunk-GXMNHGBP.cjs');exports.build = _chunkI374XGD2cjs.B; exports.cli = _chunkI374XGD2cjs.G; exports.createServer = _chunkI374XGD2cjs.F; exports.defaultSiteConfig = _chunkI374XGD2cjs.t; exports.defaultValaxyConfig = _chunkI374XGD2cjs.u; exports.defineAddon = _chunkI374XGD2cjs.n; exports.defineConfig = _chunkI374XGD2cjs.s; exports.defineSiteConfig = _chunkI374XGD2cjs.q; exports.defineTheme = _chunkI374XGD2cjs.p; exports.defineUnoSetup = _chunkI374XGD2cjs.v; exports.defineValaxyAddon = _chunkI374XGD2cjs.m; exports.defineValaxyConfig = _chunkI374XGD2cjs.r; exports.defineValaxyTheme = _chunkI374XGD2cjs.o; exports.ensurePrefix = _chunkI374XGD2cjs.d; exports.generateClientRedirects = _chunkI374XGD2cjs.E; exports.getGitTimestamp = _chunkI374XGD2cjs.a; exports.getIndexHtml = _chunkI374XGD2cjs.A; exports.isExternal = _chunkI374XGD2cjs.b; exports.isPath = _chunkI374XGD2cjs.f; exports.mergeValaxyConfig = _chunkI374XGD2cjs.g; exports.mergeViteConfigs = _chunkI374XGD2cjs.z; exports.postProcessForSSG = _chunkI374XGD2cjs.D; exports.processValaxyOptions = _chunkI374XGD2cjs.w; exports.resolveAddonConfig = _chunkI374XGD2cjs.j; exports.resolveImportPath = _chunkI374XGD2cjs.l; exports.resolveOptions = _chunkI374XGD2cjs.x; exports.resolveThemeValaxyConfig = _chunkI374XGD2cjs.y; exports.resolveValaxyConfig = _chunkI374XGD2cjs.i; exports.resolveValaxyConfigFromRoot = _chunkI374XGD2cjs.h; exports.run = _chunkI374XGD2cjs.H; exports.slash = _chunkI374XGD2cjs.c; exports.ssgBuild = _chunkI374XGD2cjs.C; exports.toAtFS = _chunkI374XGD2cjs.e; exports.transformObject = _chunkI374XGD2cjs.k;
@@ -2,11 +2,12 @@ import { ViteSSGOptions } from 'vite-ssg';
2
2
  export { cli, run } from './cli/index.cjs';
3
3
  import * as vite from 'vite';
4
4
  import { UserConfig, InlineConfig } from 'vite';
5
- import { D as DefaultTheme, V as ValaxyConfig, P as PartialDeep, a as ValaxyAddon, R as RuntimeConfig, U as UserSiteConfig, S as SiteConfig } from '../config-tjZfKSoC.cjs';
5
+ import { D as DefaultTheme, V as ValaxyConfig, P as PartialDeep, a as ValaxyAddon, R as RuntimeConfig, U as UserSiteConfig, S as SiteConfig } from '../config-OaNeBI1c.cjs';
6
6
  import Vue from '@vitejs/plugin-vue';
7
7
  import Components from 'unplugin-vue-components/vite';
8
8
  import { VitePluginConfig } from 'unocss/vite';
9
- import Pages from 'vite-plugin-pages';
9
+ import VueRouter from 'unplugin-vue-router/vite';
10
+ import { EditableTreeNode } from 'unplugin-vue-router';
10
11
  import { presetUno, presetAttributify, presetIcons, presetTypography } from 'unocss';
11
12
  import { Hookable } from 'hookable';
12
13
  import MarkdownIt from 'markdown-it';
@@ -165,20 +166,18 @@ interface ValaxyExtendConfig {
165
166
  icons?: Parameters<typeof presetIcons>[0];
166
167
  typography?: Parameters<typeof presetTypography>[0];
167
168
  };
168
- pages?: Parameters<typeof Pages>[0];
169
+ vueRouter?: Parameters<typeof VueRouter>[0];
170
+ /**
171
+ * @experimental
172
+ * Enable Vue Devtools & Valaxy Devtools
173
+ */
174
+ devtools?: boolean;
169
175
  /**
170
176
  * for markdown
171
177
  */
172
178
  markdown?: MarkdownOptions;
173
179
  extendMd?: (ctx: {
174
- route: {
175
- meta: {
176
- frontmatter: Record<string, any>;
177
- layout?: string;
178
- } & object;
179
- path: string;
180
- component: string;
181
- };
180
+ route: EditableTreeNode;
182
181
  data: Readonly<Record<string, any>>;
183
182
  content: string;
184
183
  excerpt?: string;
@@ -286,16 +285,18 @@ declare function mergeViteConfigs({ userRoot, themeRoot }: ResolvedValaxyOptions
286
285
  * generate index.html from user/theme/client
287
286
  * @internal
288
287
  */
289
- declare function getIndexHtml({ clientRoot, themeRoot, userRoot, config }: ResolvedValaxyOptions): Promise<string>;
288
+ declare function getIndexHtml({ clientRoot, themeRoot, userRoot, config }: ResolvedValaxyOptions, rawHtml: string): Promise<string>;
290
289
 
291
290
  declare function build(options: ResolvedValaxyOptions, viteConfig?: InlineConfig): Promise<void>;
292
291
  declare function ssgBuild(options: ResolvedValaxyOptions, viteConfig?: InlineConfig): Promise<void>;
293
292
  /**
294
293
  * post process for ssg fix extra string like `/html>` `ml>` `l>`
294
+ * handle tasks after ssg build
295
295
  * todo find why
296
296
  * @param options
297
297
  */
298
298
  declare function postProcessForSSG(options: ResolvedValaxyOptions): Promise<void>;
299
+ declare function generateClientRedirects(options: ResolvedValaxyOptions): Promise<void>;
299
300
 
300
301
  declare function defineValaxyAddon<AddonOptions = object>(addonFunc: (addonOptions?: AddonOptions, valaxyOptions?: ResolvedValaxyOptions) => ValaxyAddon & {
301
302
  setup?: ValaxyAddonResolver['setup'];
@@ -383,4 +384,4 @@ declare function resolveAddonConfig(addons: ValaxyAddonResolver[], options?: Res
383
384
  declare function transformObject(obj: any): string;
384
385
  declare function resolveImportPath(importName: string, ensure?: true): string;
385
386
 
386
- export { type HookResult, type ResolvedValaxyOptions, type UnoSetup, type UserValaxyNodeConfig, type ValaxyAddonExport, type ValaxyAddonFn, type ValaxyAddonLike, type ValaxyAddonResolver, type ValaxyAddons, type ValaxyConfigExport, type ValaxyConfigExtendKey, type ValaxyConfigFn, type ValaxyEntryOptions, type ValaxyExtendConfig, type ValaxyHooks, type ValaxyNode, type ValaxyNodeConfig, type ValaxyPickConfig, type ValaxyServerOptions, type ValaxyTheme, build, createServer, defaultSiteConfig, defaultValaxyConfig, defineAddon, defineConfig, defineSiteConfig, defineTheme, defineUnoSetup, defineValaxyAddon, defineValaxyConfig, defineValaxyTheme, ensurePrefix, getGitTimestamp, getIndexHtml, isExternal, isPath, mergeValaxyConfig, mergeViteConfigs, postProcessForSSG, processValaxyOptions, resolveAddonConfig, resolveImportPath, resolveOptions, resolveThemeValaxyConfig, resolveValaxyConfig, resolveValaxyConfigFromRoot, slash, ssgBuild, toAtFS, transformObject };
387
+ export { type HookResult, type ResolvedValaxyOptions, type UnoSetup, type UserValaxyNodeConfig, type ValaxyAddonExport, type ValaxyAddonFn, type ValaxyAddonLike, type ValaxyAddonResolver, type ValaxyAddons, type ValaxyConfigExport, type ValaxyConfigExtendKey, type ValaxyConfigFn, type ValaxyEntryOptions, type ValaxyExtendConfig, type ValaxyHooks, type ValaxyNode, type ValaxyNodeConfig, type ValaxyPickConfig, type ValaxyServerOptions, type ValaxyTheme, build, createServer, defaultSiteConfig, defaultValaxyConfig, defineAddon, defineConfig, defineSiteConfig, defineTheme, defineUnoSetup, defineValaxyAddon, defineValaxyConfig, defineValaxyTheme, ensurePrefix, generateClientRedirects, getGitTimestamp, getIndexHtml, isExternal, isPath, mergeValaxyConfig, mergeViteConfigs, postProcessForSSG, processValaxyOptions, resolveAddonConfig, resolveImportPath, resolveOptions, resolveThemeValaxyConfig, resolveValaxyConfig, resolveValaxyConfigFromRoot, slash, ssgBuild, toAtFS, transformObject };
@@ -2,11 +2,12 @@ import { ViteSSGOptions } from 'vite-ssg';
2
2
  export { cli, run } from './cli/index.js';
3
3
  import * as vite from 'vite';
4
4
  import { UserConfig, InlineConfig } from 'vite';
5
- import { D as DefaultTheme, V as ValaxyConfig, P as PartialDeep, a as ValaxyAddon, R as RuntimeConfig, U as UserSiteConfig, S as SiteConfig } from '../config-tjZfKSoC.js';
5
+ import { D as DefaultTheme, V as ValaxyConfig, P as PartialDeep, a as ValaxyAddon, R as RuntimeConfig, U as UserSiteConfig, S as SiteConfig } from '../config-OaNeBI1c.js';
6
6
  import Vue from '@vitejs/plugin-vue';
7
7
  import Components from 'unplugin-vue-components/vite';
8
8
  import { VitePluginConfig } from 'unocss/vite';
9
- import Pages from 'vite-plugin-pages';
9
+ import VueRouter from 'unplugin-vue-router/vite';
10
+ import { EditableTreeNode } from 'unplugin-vue-router';
10
11
  import { presetUno, presetAttributify, presetIcons, presetTypography } from 'unocss';
11
12
  import { Hookable } from 'hookable';
12
13
  import MarkdownIt from 'markdown-it';
@@ -165,20 +166,18 @@ interface ValaxyExtendConfig {
165
166
  icons?: Parameters<typeof presetIcons>[0];
166
167
  typography?: Parameters<typeof presetTypography>[0];
167
168
  };
168
- pages?: Parameters<typeof Pages>[0];
169
+ vueRouter?: Parameters<typeof VueRouter>[0];
170
+ /**
171
+ * @experimental
172
+ * Enable Vue Devtools & Valaxy Devtools
173
+ */
174
+ devtools?: boolean;
169
175
  /**
170
176
  * for markdown
171
177
  */
172
178
  markdown?: MarkdownOptions;
173
179
  extendMd?: (ctx: {
174
- route: {
175
- meta: {
176
- frontmatter: Record<string, any>;
177
- layout?: string;
178
- } & object;
179
- path: string;
180
- component: string;
181
- };
180
+ route: EditableTreeNode;
182
181
  data: Readonly<Record<string, any>>;
183
182
  content: string;
184
183
  excerpt?: string;
@@ -286,16 +285,18 @@ declare function mergeViteConfigs({ userRoot, themeRoot }: ResolvedValaxyOptions
286
285
  * generate index.html from user/theme/client
287
286
  * @internal
288
287
  */
289
- declare function getIndexHtml({ clientRoot, themeRoot, userRoot, config }: ResolvedValaxyOptions): Promise<string>;
288
+ declare function getIndexHtml({ clientRoot, themeRoot, userRoot, config }: ResolvedValaxyOptions, rawHtml: string): Promise<string>;
290
289
 
291
290
  declare function build(options: ResolvedValaxyOptions, viteConfig?: InlineConfig): Promise<void>;
292
291
  declare function ssgBuild(options: ResolvedValaxyOptions, viteConfig?: InlineConfig): Promise<void>;
293
292
  /**
294
293
  * post process for ssg fix extra string like `/html>` `ml>` `l>`
294
+ * handle tasks after ssg build
295
295
  * todo find why
296
296
  * @param options
297
297
  */
298
298
  declare function postProcessForSSG(options: ResolvedValaxyOptions): Promise<void>;
299
+ declare function generateClientRedirects(options: ResolvedValaxyOptions): Promise<void>;
299
300
 
300
301
  declare function defineValaxyAddon<AddonOptions = object>(addonFunc: (addonOptions?: AddonOptions, valaxyOptions?: ResolvedValaxyOptions) => ValaxyAddon & {
301
302
  setup?: ValaxyAddonResolver['setup'];
@@ -383,4 +384,4 @@ declare function resolveAddonConfig(addons: ValaxyAddonResolver[], options?: Res
383
384
  declare function transformObject(obj: any): string;
384
385
  declare function resolveImportPath(importName: string, ensure?: true): string;
385
386
 
386
- export { type HookResult, type ResolvedValaxyOptions, type UnoSetup, type UserValaxyNodeConfig, type ValaxyAddonExport, type ValaxyAddonFn, type ValaxyAddonLike, type ValaxyAddonResolver, type ValaxyAddons, type ValaxyConfigExport, type ValaxyConfigExtendKey, type ValaxyConfigFn, type ValaxyEntryOptions, type ValaxyExtendConfig, type ValaxyHooks, type ValaxyNode, type ValaxyNodeConfig, type ValaxyPickConfig, type ValaxyServerOptions, type ValaxyTheme, build, createServer, defaultSiteConfig, defaultValaxyConfig, defineAddon, defineConfig, defineSiteConfig, defineTheme, defineUnoSetup, defineValaxyAddon, defineValaxyConfig, defineValaxyTheme, ensurePrefix, getGitTimestamp, getIndexHtml, isExternal, isPath, mergeValaxyConfig, mergeViteConfigs, postProcessForSSG, processValaxyOptions, resolveAddonConfig, resolveImportPath, resolveOptions, resolveThemeValaxyConfig, resolveValaxyConfig, resolveValaxyConfigFromRoot, slash, ssgBuild, toAtFS, transformObject };
387
+ export { type HookResult, type ResolvedValaxyOptions, type UnoSetup, type UserValaxyNodeConfig, type ValaxyAddonExport, type ValaxyAddonFn, type ValaxyAddonLike, type ValaxyAddonResolver, type ValaxyAddons, type ValaxyConfigExport, type ValaxyConfigExtendKey, type ValaxyConfigFn, type ValaxyEntryOptions, type ValaxyExtendConfig, type ValaxyHooks, type ValaxyNode, type ValaxyNodeConfig, type ValaxyPickConfig, type ValaxyServerOptions, type ValaxyTheme, build, createServer, defaultSiteConfig, defaultValaxyConfig, defineAddon, defineConfig, defineSiteConfig, defineTheme, defineUnoSetup, defineValaxyAddon, defineValaxyConfig, defineValaxyTheme, ensurePrefix, generateClientRedirects, getGitTimestamp, getIndexHtml, isExternal, isPath, mergeValaxyConfig, mergeViteConfigs, postProcessForSSG, processValaxyOptions, resolveAddonConfig, resolveImportPath, resolveOptions, resolveThemeValaxyConfig, resolveValaxyConfig, resolveValaxyConfigFromRoot, slash, ssgBuild, toAtFS, transformObject };
@@ -1,2 +1,2 @@
1
1
  import {createRequire as __createRequire} from 'module';var require=__createRequire(import.meta.url);
2
- import{A,B,C,D,E,F,G,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}from"../chunk-KMYBWFOB.mjs";import"../chunk-YTQABADX.mjs";export{B as build,F as cli,E as createServer,t as defaultSiteConfig,u as defaultValaxyConfig,n as defineAddon,s as defineConfig,q as defineSiteConfig,p as defineTheme,v as defineUnoSetup,m as defineValaxyAddon,r as defineValaxyConfig,o as defineValaxyTheme,d as ensurePrefix,a as getGitTimestamp,A as getIndexHtml,b as isExternal,f as isPath,g as mergeValaxyConfig,z as mergeViteConfigs,D as postProcessForSSG,w as processValaxyOptions,j as resolveAddonConfig,l as resolveImportPath,x as resolveOptions,y as resolveThemeValaxyConfig,i as resolveValaxyConfig,h as resolveValaxyConfigFromRoot,G as run,c as slash,C as ssgBuild,e as toAtFS,k as transformObject};
2
+ import{A,B,C,D,E,F,G,H,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}from"../chunk-EG3RHL6A.mjs";import"../chunk-WSC7UAH5.mjs";export{B as build,G as cli,F as createServer,t as defaultSiteConfig,u as defaultValaxyConfig,n as defineAddon,s as defineConfig,q as defineSiteConfig,p as defineTheme,v as defineUnoSetup,m as defineValaxyAddon,r as defineValaxyConfig,o as defineValaxyTheme,d as ensurePrefix,E as generateClientRedirects,a as getGitTimestamp,A as getIndexHtml,b as isExternal,f as isPath,g as mergeValaxyConfig,z as mergeViteConfigs,D as postProcessForSSG,w as processValaxyOptions,j as resolveAddonConfig,l as resolveImportPath,x as resolveOptions,y as resolveThemeValaxyConfig,i as resolveValaxyConfig,h as resolveValaxyConfigFromRoot,H as run,c as slash,C as ssgBuild,e as toAtFS,k as transformObject};
@@ -1 +1 @@
1
- "use strict";var _chunkR6EC3UMQcjs = require('../chunk-R6EC3UMQ.cjs');_chunkR6EC3UMQcjs.d.call(void 0, );_chunkR6EC3UMQcjs.d.call(void 0, );_chunkR6EC3UMQcjs.d.call(void 0, );_chunkR6EC3UMQcjs.d.call(void 0, );_chunkR6EC3UMQcjs.d.call(void 0, );_chunkR6EC3UMQcjs.d.call(void 0, );_chunkR6EC3UMQcjs.d.call(void 0, );
1
+ "use strict";var _chunkGXMNHGBPcjs = require('../chunk-GXMNHGBP.cjs');_chunkGXMNHGBPcjs.e.call(void 0, );_chunkGXMNHGBPcjs.e.call(void 0, );_chunkGXMNHGBPcjs.e.call(void 0, );_chunkGXMNHGBPcjs.e.call(void 0, );_chunkGXMNHGBPcjs.e.call(void 0, );_chunkGXMNHGBPcjs.e.call(void 0, );_chunkGXMNHGBPcjs.e.call(void 0, );
@@ -1,5 +1,5 @@
1
- import { b as Post } from '../config-tjZfKSoC.cjs';
2
- export { A as Album, D as DefaultTheme, E as ExcerptType, F as FuseListItem, h as Page, f as PageFrontMatter, P as PartialDeep, e as Photo, g as PostFrontMatter, R as RuntimeConfig, S as SiteConfig, c as SocialLink, U as UserSiteConfig, d as UserValaxyConfig, a as ValaxyAddon, V as ValaxyConfig } from '../config-tjZfKSoC.cjs';
1
+ import { b as Post } from '../config-OaNeBI1c.cjs';
2
+ export { A as Album, D as DefaultTheme, E as ExcerptType, F as FuseListItem, i as Page, g as PageFrontMatter, P as PartialDeep, f as Photo, h as PostFrontMatter, d as RedirectRule, R as RuntimeConfig, S as SiteConfig, c as SocialLink, U as UserSiteConfig, e as UserValaxyConfig, a as ValaxyAddon, V as ValaxyConfig } from '../config-OaNeBI1c.cjs';
3
3
  import 'medium-zoom';
4
4
  import '@vueuse/integrations/useFuse';
5
5
  import 'vanilla-lazyload';
@@ -1,5 +1,5 @@
1
- import { b as Post } from '../config-tjZfKSoC.js';
2
- export { A as Album, D as DefaultTheme, E as ExcerptType, F as FuseListItem, h as Page, f as PageFrontMatter, P as PartialDeep, e as Photo, g as PostFrontMatter, R as RuntimeConfig, S as SiteConfig, c as SocialLink, U as UserSiteConfig, d as UserValaxyConfig, a as ValaxyAddon, V as ValaxyConfig } from '../config-tjZfKSoC.js';
1
+ import { b as Post } from '../config-OaNeBI1c.js';
2
+ export { A as Album, D as DefaultTheme, E as ExcerptType, F as FuseListItem, i as Page, g as PageFrontMatter, P as PartialDeep, f as Photo, h as PostFrontMatter, d as RedirectRule, R as RuntimeConfig, S as SiteConfig, c as SocialLink, U as UserSiteConfig, e as UserValaxyConfig, a as ValaxyAddon, V as ValaxyConfig } from '../config-OaNeBI1c.js';
3
3
  import 'medium-zoom';
4
4
  import '@vueuse/integrations/useFuse';
5
5
  import 'vanilla-lazyload';
@@ -1,2 +1,2 @@
1
1
  import {createRequire as __createRequire} from 'module';var require=__createRequire(import.meta.url);
2
- import{e}from"../chunk-YTQABADX.mjs";e();e();e();e();e();e();e();
2
+ import{d as e}from"../chunk-WSC7UAH5.mjs";e();e();e();e();e();e();e();
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "valaxy",
3
3
  "type": "module",
4
- "version": "0.16.3",
4
+ "version": "0.17.0-beta.1",
5
5
  "description": "📄 Vite & Vue powered static blog generator.",
6
6
  "author": {
7
7
  "email": "me@yunyoujun.cn",
@@ -35,7 +35,7 @@
35
35
  "./types": "./dist/types/index.d.ts",
36
36
  "./*": "./*"
37
37
  },
38
- "main": "dist/node/index.cjs",
38
+ "main": "dist/node/index.mjs",
39
39
  "module": "dist/node/index.mjs",
40
40
  "types": "index.d.ts",
41
41
  "bin": {
@@ -65,16 +65,17 @@
65
65
  "@unhead/addons": "^1.8.9",
66
66
  "@unhead/schema-org": "^1.8.9",
67
67
  "@unhead/vue": "^1.8.9",
68
- "@vitejs/plugin-vue": "^5.0.2",
69
- "@vueuse/core": "^10.7.1",
70
- "@vueuse/integrations": "^10.7.1",
68
+ "@vitejs/plugin-vue": "^5.0.3",
69
+ "@vue/devtools-api": "^7.0.10",
70
+ "@vueuse/core": "^10.7.2",
71
+ "@vueuse/integrations": "^10.7.2",
71
72
  "body-scroll-lock": "4.0.0-beta.0",
72
73
  "consola": "^3.2.3",
73
74
  "critters": "^0.0.20",
74
75
  "cross-spawn": "^7.0.3",
75
76
  "css-i18n": "^0.0.2",
76
77
  "dayjs": "^1.11.10",
77
- "defu": "^6.1.3",
78
+ "defu": "^6.1.4",
78
79
  "ejs": "^3.1.9",
79
80
  "escape-html": "^1.0.3",
80
81
  "feed": "^4.2.2",
@@ -97,25 +98,26 @@
97
98
  "markdown-it-task-lists": "^2.1.1",
98
99
  "medium-zoom": "^1.1.0",
99
100
  "nprogress": "^0.2.0",
100
- "open": "10.0.2",
101
- "ora": "^7.0.1",
101
+ "open": "10.0.3",
102
+ "ora": "^8.0.1",
102
103
  "pascalcase": "^2.0.0",
103
104
  "pinia": "^2.1.7",
104
105
  "qrcode": "^1.5.3",
105
- "sass": "^1.69.6",
106
+ "sass": "^1.69.7",
106
107
  "shiki": "^0.14.7",
107
108
  "star-markdown-css": "^0.4.2",
108
109
  "unconfig": "^0.3.11",
109
- "unocss": "^0.58.2",
110
+ "unocss": "^0.58.3",
110
111
  "unplugin-vue-components": "^0.26.0",
112
+ "unplugin-vue-router": "^0.7.0",
111
113
  "vanilla-lazyload": "^17.8.5",
112
- "vite": "^5.0.10",
113
- "vite-plugin-pages": "^0.32.0",
114
+ "vite": "^5.0.11",
115
+ "vite-plugin-vue-devtools": "^7.0.10",
114
116
  "vite-plugin-vue-layouts": "0.11.0",
115
117
  "vite-ssg": "0.23.6",
116
118
  "vite-ssg-sitemap": "0.6.1",
117
- "vue": "^3.4.3",
118
- "vue-i18n": "^9.8.0",
119
+ "vue": "^3.4.13",
120
+ "vue-i18n": "^9.9.0",
119
121
  "vue-router": "^4.2.5",
120
122
  "yargs": "^17.7.2"
121
123
  },
package/types/config.ts CHANGED
@@ -22,6 +22,11 @@ export interface SocialLink {
22
22
  color: string
23
23
  }
24
24
 
25
+ export interface RedirectRule {
26
+ to: string
27
+ from: string | string[]
28
+ }
29
+
25
30
  // shared with valaxy node and client
26
31
  export interface SiteConfig {
27
32
  /**
@@ -313,6 +318,12 @@ export interface SiteConfig {
313
318
  * @description:zh-CN 限制代码块的高度,单位是 px
314
319
  */
315
320
  codeHeightLimit?: number
321
+
322
+ /**
323
+ * @description:en-US client redirect rules
324
+ * @description:zh-CN 客户端重定向规则
325
+ */
326
+ redirects?: RedirectRule[]
316
327
  }
317
328
 
318
329
  export type PartialDeep<T> = {
@@ -1,39 +0,0 @@
1
- <script lang="ts" setup>
2
- // (Component as any) will crush page rendering
3
- import { asAny } from 'valaxy'
4
- </script>
5
-
6
- <template>
7
- <RouterView v-slot="{ Component }">
8
- <Component :is="asAny(Component)">
9
- <template #main-header>
10
- <slot name="main-header" />
11
- </template>
12
-
13
- <template #main-header-after>
14
- <slot name="main-header-after" />
15
- </template>
16
- <template #main>
17
- <slot name="main" />
18
- </template>
19
- <template #main-content>
20
- <slot name="main-content" />
21
- </template>
22
- <template #main-content-after>
23
- <slot name="main-content-after" />
24
- </template>
25
- <template #main-nav-before>
26
- <slot name="main-nav-before" />
27
- </template>
28
- <template #main-nav-after>
29
- <slot name="main-nav-after" />
30
- </template>
31
- <template #aside-custom>
32
- <slot name="aside-custom" />
33
- </template>
34
- <template #footer>
35
- <slot name="footer" />
36
- </template>
37
- </Component>
38
- </RouterView>
39
- </template>