valaxy 0.17.0-beta.3 → 0.17.0

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.
@@ -563,6 +563,12 @@ type PartialDeep<T> = {
563
563
  interface RuntimeConfig {
564
564
  addons: Record<string, ValaxyAddon>;
565
565
  }
566
+ interface Pkg {
567
+ name: string;
568
+ version: string;
569
+ homepage?: string;
570
+ [key: string]: any;
571
+ }
566
572
  interface ValaxyConfig<ThemeConfig = DefaultTheme.Config> {
567
573
  siteConfig: SiteConfig;
568
574
  /**
@@ -575,12 +581,7 @@ interface ValaxyConfig<ThemeConfig = DefaultTheme.Config> {
575
581
  * @description 主题配置
576
582
  */
577
583
  themeConfig: ThemeConfig & {
578
- pkg: {
579
- name: string;
580
- version: string;
581
- homepage?: string;
582
- [key: string]: any;
583
- };
584
+ pkg: Pkg;
584
585
  };
585
586
  /**
586
587
  * generated by runtime
@@ -603,4 +604,4 @@ type UserSiteConfig = PartialDeep<SiteConfig>;
603
604
  */
604
605
  type UserValaxyConfig<ThemeConfig = DefaultTheme.Config> = PartialDeep<ValaxyConfig<ThemeConfig>>;
605
606
 
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 };
607
+ export { type Album as A, DefaultTheme as D, type ExcerptType as E, type FuseListItem as F, type PartialDeep as P, type RedirectRule as R, type SocialLink as S, type UserSiteConfig as U, type ValaxyAddon as V, type Post as a, type SiteConfig as b, type RuntimeConfig as c, type Pkg as d, type ValaxyConfig as e, type UserValaxyConfig as f, type Photo as g, type PageFrontMatter as h, type PostFrontMatter as i, type Page as j };
@@ -563,6 +563,12 @@ type PartialDeep<T> = {
563
563
  interface RuntimeConfig {
564
564
  addons: Record<string, ValaxyAddon>;
565
565
  }
566
+ interface Pkg {
567
+ name: string;
568
+ version: string;
569
+ homepage?: string;
570
+ [key: string]: any;
571
+ }
566
572
  interface ValaxyConfig<ThemeConfig = DefaultTheme.Config> {
567
573
  siteConfig: SiteConfig;
568
574
  /**
@@ -575,12 +581,7 @@ interface ValaxyConfig<ThemeConfig = DefaultTheme.Config> {
575
581
  * @description 主题配置
576
582
  */
577
583
  themeConfig: ThemeConfig & {
578
- pkg: {
579
- name: string;
580
- version: string;
581
- homepage?: string;
582
- [key: string]: any;
583
- };
584
+ pkg: Pkg;
584
585
  };
585
586
  /**
586
587
  * generated by runtime
@@ -603,4 +604,4 @@ type UserSiteConfig = PartialDeep<SiteConfig>;
603
604
  */
604
605
  type UserValaxyConfig<ThemeConfig = DefaultTheme.Config> = PartialDeep<ValaxyConfig<ThemeConfig>>;
605
606
 
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 };
607
+ export { type Album as A, DefaultTheme as D, type ExcerptType as E, type FuseListItem as F, type PartialDeep as P, type RedirectRule as R, type SocialLink as S, type UserSiteConfig as U, type ValaxyAddon as V, type Post as a, type SiteConfig as b, type RuntimeConfig as c, type Pkg as d, type ValaxyConfig as e, type UserValaxyConfig as f, type Photo as g, type PageFrontMatter as h, type PostFrontMatter as i, type Page as j };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk45B2VOLUcjs = require('../../chunk-45B2VOLU.cjs');require('../../chunk-GXMNHGBP.cjs');exports.cli = _chunk45B2VOLUcjs.G; exports.run = _chunk45B2VOLUcjs.H;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkO4TV2H4Ocjs = require('../../chunk-O4TV2H4O.cjs');require('../../chunk-TEOGEXZQ.cjs');exports.cli = _chunkO4TV2H4Ocjs.M; exports.run = _chunkO4TV2H4Ocjs.N;
@@ -1,2 +1,2 @@
1
1
  import {createRequire as __createRequire} from 'module';var require=__createRequire(import.meta.url);
2
- import{G as a,H as b}from"../../chunk-2HLMSZO4.mjs";import"../../chunk-WSC7UAH5.mjs";export{a as cli,b as run};
2
+ import{M as a,N as b}from"../../chunk-ALNY7KGH.mjs";import"../../chunk-ZO24WTQL.mjs";export{a as cli,b as run};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk45B2VOLUcjs = require('../chunk-45B2VOLU.cjs');require('../chunk-GXMNHGBP.cjs');exports.build = _chunk45B2VOLUcjs.B; exports.cli = _chunk45B2VOLUcjs.G; exports.createServer = _chunk45B2VOLUcjs.F; exports.defaultSiteConfig = _chunk45B2VOLUcjs.t; exports.defaultValaxyConfig = _chunk45B2VOLUcjs.u; exports.defineAddon = _chunk45B2VOLUcjs.n; exports.defineConfig = _chunk45B2VOLUcjs.s; exports.defineSiteConfig = _chunk45B2VOLUcjs.q; exports.defineTheme = _chunk45B2VOLUcjs.p; exports.defineUnoSetup = _chunk45B2VOLUcjs.v; exports.defineValaxyAddon = _chunk45B2VOLUcjs.m; exports.defineValaxyConfig = _chunk45B2VOLUcjs.r; exports.defineValaxyTheme = _chunk45B2VOLUcjs.o; exports.ensurePrefix = _chunk45B2VOLUcjs.d; exports.generateClientRedirects = _chunk45B2VOLUcjs.E; exports.getGitTimestamp = _chunk45B2VOLUcjs.a; exports.getIndexHtml = _chunk45B2VOLUcjs.A; exports.isExternal = _chunk45B2VOLUcjs.b; exports.isPath = _chunk45B2VOLUcjs.f; exports.mergeValaxyConfig = _chunk45B2VOLUcjs.g; exports.mergeViteConfigs = _chunk45B2VOLUcjs.z; exports.postProcessForSSG = _chunk45B2VOLUcjs.D; exports.processValaxyOptions = _chunk45B2VOLUcjs.w; exports.resolveAddonConfig = _chunk45B2VOLUcjs.j; exports.resolveImportPath = _chunk45B2VOLUcjs.l; exports.resolveOptions = _chunk45B2VOLUcjs.x; exports.resolveThemeValaxyConfig = _chunk45B2VOLUcjs.y; exports.resolveValaxyConfig = _chunk45B2VOLUcjs.i; exports.resolveValaxyConfigFromRoot = _chunk45B2VOLUcjs.h; exports.run = _chunk45B2VOLUcjs.H; exports.slash = _chunk45B2VOLUcjs.c; exports.ssgBuild = _chunk45B2VOLUcjs.C; exports.toAtFS = _chunk45B2VOLUcjs.e; exports.transformObject = _chunk45B2VOLUcjs.k;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkO4TV2H4Ocjs = require('../chunk-O4TV2H4O.cjs');require('../chunk-TEOGEXZQ.cjs');exports.build = _chunkO4TV2H4Ocjs.H; exports.cli = _chunkO4TV2H4Ocjs.M; exports.createServer = _chunkO4TV2H4Ocjs.L; exports.defaultSiteConfig = _chunkO4TV2H4Ocjs.k; exports.defaultValaxyConfig = _chunkO4TV2H4Ocjs.o; exports.defineAddon = _chunkO4TV2H4Ocjs.v; exports.defineConfig = _chunkO4TV2H4Ocjs.q; exports.defineSiteConfig = _chunkO4TV2H4Ocjs.l; exports.defineTheme = _chunkO4TV2H4Ocjs.A; exports.defineUnoSetup = _chunkO4TV2H4Ocjs.B; exports.defineValaxyAddon = _chunkO4TV2H4Ocjs.u; exports.defineValaxyConfig = _chunkO4TV2H4Ocjs.p; exports.defineValaxyTheme = _chunkO4TV2H4Ocjs.z; exports.ensurePrefix = _chunkO4TV2H4Ocjs.e; exports.generateClientRedirects = _chunkO4TV2H4Ocjs.K; exports.getGitTimestamp = _chunkO4TV2H4Ocjs.a; exports.getIndexHtml = _chunkO4TV2H4Ocjs.G; exports.isExternal = _chunkO4TV2H4Ocjs.c; exports.isPath = _chunkO4TV2H4Ocjs.g; exports.loadConfig = _chunkO4TV2H4Ocjs.i; exports.loadConfigFromFile = _chunkO4TV2H4Ocjs.j; exports.mergeValaxyConfig = _chunkO4TV2H4Ocjs.s; exports.mergeViteConfigs = _chunkO4TV2H4Ocjs.F; exports.postProcessForSSG = _chunkO4TV2H4Ocjs.J; exports.processValaxyOptions = _chunkO4TV2H4Ocjs.C; exports.resolveAddonConfig = _chunkO4TV2H4Ocjs.w; exports.resolveImportPath = _chunkO4TV2H4Ocjs.b; exports.resolveOptions = _chunkO4TV2H4Ocjs.D; exports.resolveSiteConfig = _chunkO4TV2H4Ocjs.n; exports.resolveSiteConfigFromRoot = _chunkO4TV2H4Ocjs.m; exports.resolveThemeConfigFromRoot = _chunkO4TV2H4Ocjs.x; exports.resolveThemeValaxyConfig = _chunkO4TV2H4Ocjs.E; exports.resolveUserThemeConfig = _chunkO4TV2H4Ocjs.y; exports.resolveValaxyConfig = _chunkO4TV2H4Ocjs.t; exports.resolveValaxyConfigFromRoot = _chunkO4TV2H4Ocjs.r; exports.run = _chunkO4TV2H4Ocjs.N; exports.slash = _chunkO4TV2H4Ocjs.d; exports.ssgBuild = _chunkO4TV2H4Ocjs.I; exports.toAtFS = _chunkO4TV2H4Ocjs.f; exports.transformObject = _chunkO4TV2H4Ocjs.h;
@@ -2,11 +2,13 @@ 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-OaNeBI1c.cjs';
5
+ import * as valaxy_types from 'valaxy/types';
6
+ import { DefaultTheme, ValaxyConfig, PartialDeep, ValaxyAddon, RuntimeConfig, SiteConfig, UserSiteConfig } from 'valaxy/types';
6
7
  import Vue from '@vitejs/plugin-vue';
7
8
  import Components from 'unplugin-vue-components/vite';
9
+ import Layouts from 'vite-plugin-vue-layouts';
10
+ import Router from 'unplugin-vue-router/vite';
8
11
  import { VitePluginConfig } from 'unocss/vite';
9
- import VueRouter from 'unplugin-vue-router/vite';
10
12
  import { EditableTreeNode } from 'unplugin-vue-router';
11
13
  import { presetUno, presetAttributify, presetIcons, presetTypography } from 'unocss';
12
14
  import { Hookable } from 'hookable';
@@ -21,6 +23,7 @@ import { TocPluginOptions } from '@mdit-vue/plugin-toc';
21
23
  import { ComponentPluginOptions } from '@mdit-vue/plugin-component';
22
24
  import { Awaitable } from '@antfu/utils';
23
25
  import * as defu from 'defu';
26
+ import { P as PartialDeep$1 } from '../config-hKSeaczj.cjs';
24
27
  import 'yargs';
25
28
  import 'medium-zoom';
26
29
  import '@vueuse/integrations/useFuse';
@@ -123,6 +126,10 @@ type HookResult = Promise<void> | void;
123
126
  interface ValaxyHooks {
124
127
  'options:resolved': () => HookResult;
125
128
  'config:init': () => HookResult;
129
+ /**
130
+ * @see valaxy/node/plugins/vueRouter.ts extendRoute
131
+ */
132
+ 'vue-router:extendRoute': (route: EditableTreeNode) => HookResult;
126
133
  'build:before': () => HookResult;
127
134
  'build:after': () => HookResult;
128
135
  }
@@ -156,6 +163,8 @@ interface ValaxyExtendConfig {
156
163
  vite?: UserConfig;
157
164
  vue?: Parameters<typeof Vue>[0];
158
165
  components?: Parameters<typeof Components>[0];
166
+ layouts?: Parameters<typeof Layouts>[0];
167
+ router?: Parameters<typeof Router>[0];
159
168
  unocss?: VitePluginConfig;
160
169
  /**
161
170
  * unocss presets
@@ -166,10 +175,10 @@ interface ValaxyExtendConfig {
166
175
  icons?: Parameters<typeof presetIcons>[0];
167
176
  typography?: Parameters<typeof presetTypography>[0];
168
177
  };
169
- vueRouter?: Parameters<typeof VueRouter>[0];
170
178
  /**
171
179
  * @experimental
172
180
  * Enable Vue Devtools & Valaxy Devtools
181
+ * @see https://devtools-next.vuejs.org/
173
182
  */
174
183
  devtools?: boolean;
175
184
  /**
@@ -234,7 +243,7 @@ interface ResolvedValaxyOptions<ThemeConfig = DefaultTheme.Config> {
234
243
  */
235
244
  addonRoots: string[];
236
245
  /**
237
- * Theme name
246
+ * clientRoot, themeRoot, ...addonRoots, userRoot
238
247
  */
239
248
  roots: string[];
240
249
  theme: string;
@@ -298,12 +307,90 @@ declare function ssgBuild(options: ResolvedValaxyOptions, viteConfig?: InlineCon
298
307
  declare function postProcessForSSG(options: ResolvedValaxyOptions): Promise<void>;
299
308
  declare function generateClientRedirects(options: ResolvedValaxyOptions): Promise<void>;
300
309
 
310
+ interface LoadConfigFromFileOptions {
311
+ cwd?: string;
312
+ valaxyOptions?: ResolvedValaxyOptions;
313
+ }
314
+ type UserInputConfig = Record<string, any>;
315
+ interface ResolvedConfig<T extends UserInputConfig = UserInputConfig> {
316
+ config: T;
317
+ configFile: string;
318
+ }
319
+ declare function loadConfig<T extends UserInputConfig = UserInputConfig>(options: {
320
+ name: string;
321
+ cwd: string;
322
+ }): ResolvedConfig<T>;
323
+ declare function loadConfigFromFile<T extends UserInputConfig>(file: string, options?: LoadConfigFromFileOptions): Promise<ResolvedConfig<T>>;
324
+
325
+ declare const defaultValaxyConfig: ValaxyNodeConfig;
326
+ /**
327
+ * Type helper for valaxy.config.ts
328
+ */
329
+ declare function defineValaxyConfig<ThemeConfig>(config: UserValaxyNodeConfig<ThemeConfig>): PartialDeep$1<ValaxyNodeConfig<ThemeConfig>>;
330
+ declare const defineConfig: typeof defineValaxyConfig;
331
+ declare function resolveValaxyConfigFromRoot(root: string, options?: ResolvedValaxyOptions): Promise<ResolvedConfig<ValaxyNodeConfig>>;
332
+ /**
333
+ * merge valaxy.config
334
+ * (source, default)
335
+ */
336
+ declare const mergeValaxyConfig: <Source extends {
337
+ [x: string]: any;
338
+ [x: number]: any;
339
+ [x: symbol]: any;
340
+ }, Defaults extends ({
341
+ [x: string]: any;
342
+ [x: number]: any;
343
+ [x: symbol]: any;
344
+ } | (number | boolean | any[] | Record<never, any> | null | undefined))[]>(source: Source, ...defaults: Defaults) => defu.Defu<Source, Defaults>;
345
+ /**
346
+ * resolve user valaxy config
347
+ * options only have userRoot
348
+ * @param options
349
+ */
350
+ declare function resolveValaxyConfig(options: ValaxyEntryOptions): Promise<{
351
+ config: ValaxyNodeConfig;
352
+ configFile: string;
353
+ theme: string;
354
+ }>;
355
+
301
356
  declare function defineValaxyAddon<AddonOptions = object>(addonFunc: (addonOptions?: AddonOptions, valaxyOptions?: ResolvedValaxyOptions) => ValaxyAddon & {
302
357
  setup?: ValaxyAddonResolver['setup'];
303
358
  }): (addonOptions?: AddonOptions, valaxyOptions?: ResolvedValaxyOptions) => ValaxyAddon & {
304
359
  setup?: ValaxyAddonResolver['setup'];
305
360
  };
306
361
  declare const defineAddon: typeof defineValaxyAddon;
362
+ declare function resolveAddonConfig(addons: ValaxyAddonResolver[], _options?: ResolvedValaxyOptions): Promise<ValaxyNodeConfig>;
363
+
364
+ declare const defaultSiteConfig: SiteConfig;
365
+ /**
366
+ * Type helper for site.config.ts
367
+ * @param config
368
+ */
369
+ declare function defineSiteConfig(config: UserSiteConfig): valaxy_types.PartialDeep<SiteConfig>;
370
+ /**
371
+ * resolve valaxy config from special root
372
+ */
373
+ declare function resolveSiteConfigFromRoot(root: string): Promise<ResolvedConfig<valaxy_types.PartialDeep<SiteConfig>>>;
374
+ /**
375
+ * resolve site.config.ts and merge with default
376
+ * @param root
377
+ */
378
+ declare function resolveSiteConfig(root: string): Promise<{
379
+ siteConfig: valaxy_types.PartialDeep<SiteConfig>;
380
+ siteConfigFile: string;
381
+ }>;
382
+
383
+ /**
384
+ * resolve theme config from special root
385
+ */
386
+ declare function resolveThemeConfigFromRoot(root: string): Promise<ResolvedConfig<DefaultTheme.Config>>;
387
+ /**
388
+ * resolve theme.config.ts and merge with default
389
+ */
390
+ declare function resolveUserThemeConfig(options: ResolvedValaxyOptions): Promise<{
391
+ themeConfig: DefaultTheme.Config;
392
+ themeConfigFile: string;
393
+ }>;
307
394
  type ValaxyConfigExtendKey = 'vite' | 'vue' | 'unocss' | 'unocssPresets' | 'markdown' | 'extendMd' | 'addons';
308
395
  type ValaxyPickConfig = Pick<ValaxyNodeConfig, ValaxyConfigExtendKey>;
309
396
  type ValaxyTheme<ThemeConfig = DefaultTheme.Config> = ValaxyPickConfig & {
@@ -312,18 +399,6 @@ type ValaxyTheme<ThemeConfig = DefaultTheme.Config> = ValaxyPickConfig & {
312
399
  declare function defineValaxyTheme<ThemeConfig = DefaultTheme.Config>(theme: ValaxyTheme<ThemeConfig> | ((options: ResolvedValaxyOptions<ThemeConfig>) => ValaxyTheme<ThemeConfig>)): ValaxyTheme<ThemeConfig> | ((options: ResolvedValaxyOptions<ThemeConfig>) => ValaxyTheme<ThemeConfig>);
313
400
  declare const defineTheme: typeof defineValaxyTheme;
314
401
 
315
- /**
316
- * Type helper for site.config.ts
317
- * @param config
318
- */
319
- declare function defineSiteConfig(config: UserSiteConfig): PartialDeep<SiteConfig>;
320
- /**
321
- * Type helper for valaxy.config.ts
322
- */
323
- declare function defineValaxyConfig<ThemeConfig>(config: UserValaxyNodeConfig<ThemeConfig>): PartialDeep<ValaxyNodeConfig<ThemeConfig>>;
324
- declare const defineConfig: typeof defineValaxyConfig;
325
- declare const defaultSiteConfig: SiteConfig;
326
- declare const defaultValaxyConfig: ValaxyNodeConfig;
327
402
  type UnoSetup = () => Awaitable<Partial<VitePluginConfig> | undefined>;
328
403
  declare function defineUnoSetup(fn: UnoSetup): UnoSetup;
329
404
 
@@ -331,6 +406,8 @@ declare function createServer(options: ResolvedValaxyOptions, viteConfig?: Inlin
331
406
 
332
407
  declare function getGitTimestamp(file: string, type?: 'created' | 'updated'): Promise<number>;
333
408
 
409
+ declare function resolveImportPath(importName: string, ensure?: true): string;
410
+
334
411
  /**
335
412
  * is url external (http/https:)
336
413
  * @param str
@@ -344,44 +421,10 @@ declare function slash(str: string): string;
344
421
  declare function ensurePrefix(prefix: string, str: string): string;
345
422
  declare function toAtFS(path: string): string;
346
423
  declare function isPath(name: string): boolean;
347
-
348
- /**
349
- * merge valaxy.config
350
- * (source, default)
351
- */
352
- declare const mergeValaxyConfig: <Source extends {
353
- [x: string]: any;
354
- [x: number]: any;
355
- [x: symbol]: any;
356
- }, Defaults extends ({
357
- [x: string]: any;
358
- [x: number]: any;
359
- [x: symbol]: any;
360
- } | (number | boolean | any[] | Record<never, any> | null | undefined))[]>(source: Source, ...defaults: Defaults) => defu.Defu<Source, Defaults>;
361
- /**
362
- * resolve valaxy config from special root
363
- */
364
- declare function resolveValaxyConfigFromRoot(root: string, options?: ResolvedValaxyOptions): Promise<{
365
- config: ValaxyNodeConfig;
366
- configFile: string;
367
- }>;
368
- /**
369
- * resolve user valaxy config
370
- * options only have userRoot
371
- * @param options
372
- */
373
- declare function resolveValaxyConfig(options: ValaxyEntryOptions): Promise<{
374
- config: ValaxyNodeConfig;
375
- configFile: string;
376
- theme: string;
377
- }>;
378
- declare function resolveAddonConfig(addons: ValaxyAddonResolver[], options?: ResolvedValaxyOptions): Promise<ValaxyNodeConfig>;
379
-
380
424
  /**
381
425
  * transform obj for vite code
382
426
  * @param obj
383
427
  */
384
428
  declare function transformObject(obj: any): string;
385
- declare function resolveImportPath(importName: string, ensure?: true): string;
386
429
 
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 };
430
+ export { type HookResult, type LoadConfigFromFileOptions, type ResolvedConfig, type ResolvedValaxyOptions, type UnoSetup, type UserInputConfig, 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, loadConfig, loadConfigFromFile, mergeValaxyConfig, mergeViteConfigs, postProcessForSSG, processValaxyOptions, resolveAddonConfig, resolveImportPath, resolveOptions, resolveSiteConfig, resolveSiteConfigFromRoot, resolveThemeConfigFromRoot, resolveThemeValaxyConfig, resolveUserThemeConfig, resolveValaxyConfig, resolveValaxyConfigFromRoot, slash, ssgBuild, toAtFS, transformObject };
@@ -2,11 +2,13 @@ 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-OaNeBI1c.js';
5
+ import * as valaxy_types from 'valaxy/types';
6
+ import { DefaultTheme, ValaxyConfig, PartialDeep, ValaxyAddon, RuntimeConfig, SiteConfig, UserSiteConfig } from 'valaxy/types';
6
7
  import Vue from '@vitejs/plugin-vue';
7
8
  import Components from 'unplugin-vue-components/vite';
9
+ import Layouts from 'vite-plugin-vue-layouts';
10
+ import Router from 'unplugin-vue-router/vite';
8
11
  import { VitePluginConfig } from 'unocss/vite';
9
- import VueRouter from 'unplugin-vue-router/vite';
10
12
  import { EditableTreeNode } from 'unplugin-vue-router';
11
13
  import { presetUno, presetAttributify, presetIcons, presetTypography } from 'unocss';
12
14
  import { Hookable } from 'hookable';
@@ -21,6 +23,7 @@ import { TocPluginOptions } from '@mdit-vue/plugin-toc';
21
23
  import { ComponentPluginOptions } from '@mdit-vue/plugin-component';
22
24
  import { Awaitable } from '@antfu/utils';
23
25
  import * as defu from 'defu';
26
+ import { P as PartialDeep$1 } from '../config-hKSeaczj.js';
24
27
  import 'yargs';
25
28
  import 'medium-zoom';
26
29
  import '@vueuse/integrations/useFuse';
@@ -123,6 +126,10 @@ type HookResult = Promise<void> | void;
123
126
  interface ValaxyHooks {
124
127
  'options:resolved': () => HookResult;
125
128
  'config:init': () => HookResult;
129
+ /**
130
+ * @see valaxy/node/plugins/vueRouter.ts extendRoute
131
+ */
132
+ 'vue-router:extendRoute': (route: EditableTreeNode) => HookResult;
126
133
  'build:before': () => HookResult;
127
134
  'build:after': () => HookResult;
128
135
  }
@@ -156,6 +163,8 @@ interface ValaxyExtendConfig {
156
163
  vite?: UserConfig;
157
164
  vue?: Parameters<typeof Vue>[0];
158
165
  components?: Parameters<typeof Components>[0];
166
+ layouts?: Parameters<typeof Layouts>[0];
167
+ router?: Parameters<typeof Router>[0];
159
168
  unocss?: VitePluginConfig;
160
169
  /**
161
170
  * unocss presets
@@ -166,10 +175,10 @@ interface ValaxyExtendConfig {
166
175
  icons?: Parameters<typeof presetIcons>[0];
167
176
  typography?: Parameters<typeof presetTypography>[0];
168
177
  };
169
- vueRouter?: Parameters<typeof VueRouter>[0];
170
178
  /**
171
179
  * @experimental
172
180
  * Enable Vue Devtools & Valaxy Devtools
181
+ * @see https://devtools-next.vuejs.org/
173
182
  */
174
183
  devtools?: boolean;
175
184
  /**
@@ -234,7 +243,7 @@ interface ResolvedValaxyOptions<ThemeConfig = DefaultTheme.Config> {
234
243
  */
235
244
  addonRoots: string[];
236
245
  /**
237
- * Theme name
246
+ * clientRoot, themeRoot, ...addonRoots, userRoot
238
247
  */
239
248
  roots: string[];
240
249
  theme: string;
@@ -298,12 +307,90 @@ declare function ssgBuild(options: ResolvedValaxyOptions, viteConfig?: InlineCon
298
307
  declare function postProcessForSSG(options: ResolvedValaxyOptions): Promise<void>;
299
308
  declare function generateClientRedirects(options: ResolvedValaxyOptions): Promise<void>;
300
309
 
310
+ interface LoadConfigFromFileOptions {
311
+ cwd?: string;
312
+ valaxyOptions?: ResolvedValaxyOptions;
313
+ }
314
+ type UserInputConfig = Record<string, any>;
315
+ interface ResolvedConfig<T extends UserInputConfig = UserInputConfig> {
316
+ config: T;
317
+ configFile: string;
318
+ }
319
+ declare function loadConfig<T extends UserInputConfig = UserInputConfig>(options: {
320
+ name: string;
321
+ cwd: string;
322
+ }): ResolvedConfig<T>;
323
+ declare function loadConfigFromFile<T extends UserInputConfig>(file: string, options?: LoadConfigFromFileOptions): Promise<ResolvedConfig<T>>;
324
+
325
+ declare const defaultValaxyConfig: ValaxyNodeConfig;
326
+ /**
327
+ * Type helper for valaxy.config.ts
328
+ */
329
+ declare function defineValaxyConfig<ThemeConfig>(config: UserValaxyNodeConfig<ThemeConfig>): PartialDeep$1<ValaxyNodeConfig<ThemeConfig>>;
330
+ declare const defineConfig: typeof defineValaxyConfig;
331
+ declare function resolveValaxyConfigFromRoot(root: string, options?: ResolvedValaxyOptions): Promise<ResolvedConfig<ValaxyNodeConfig>>;
332
+ /**
333
+ * merge valaxy.config
334
+ * (source, default)
335
+ */
336
+ declare const mergeValaxyConfig: <Source extends {
337
+ [x: string]: any;
338
+ [x: number]: any;
339
+ [x: symbol]: any;
340
+ }, Defaults extends ({
341
+ [x: string]: any;
342
+ [x: number]: any;
343
+ [x: symbol]: any;
344
+ } | (number | boolean | any[] | Record<never, any> | null | undefined))[]>(source: Source, ...defaults: Defaults) => defu.Defu<Source, Defaults>;
345
+ /**
346
+ * resolve user valaxy config
347
+ * options only have userRoot
348
+ * @param options
349
+ */
350
+ declare function resolveValaxyConfig(options: ValaxyEntryOptions): Promise<{
351
+ config: ValaxyNodeConfig;
352
+ configFile: string;
353
+ theme: string;
354
+ }>;
355
+
301
356
  declare function defineValaxyAddon<AddonOptions = object>(addonFunc: (addonOptions?: AddonOptions, valaxyOptions?: ResolvedValaxyOptions) => ValaxyAddon & {
302
357
  setup?: ValaxyAddonResolver['setup'];
303
358
  }): (addonOptions?: AddonOptions, valaxyOptions?: ResolvedValaxyOptions) => ValaxyAddon & {
304
359
  setup?: ValaxyAddonResolver['setup'];
305
360
  };
306
361
  declare const defineAddon: typeof defineValaxyAddon;
362
+ declare function resolveAddonConfig(addons: ValaxyAddonResolver[], _options?: ResolvedValaxyOptions): Promise<ValaxyNodeConfig>;
363
+
364
+ declare const defaultSiteConfig: SiteConfig;
365
+ /**
366
+ * Type helper for site.config.ts
367
+ * @param config
368
+ */
369
+ declare function defineSiteConfig(config: UserSiteConfig): valaxy_types.PartialDeep<SiteConfig>;
370
+ /**
371
+ * resolve valaxy config from special root
372
+ */
373
+ declare function resolveSiteConfigFromRoot(root: string): Promise<ResolvedConfig<valaxy_types.PartialDeep<SiteConfig>>>;
374
+ /**
375
+ * resolve site.config.ts and merge with default
376
+ * @param root
377
+ */
378
+ declare function resolveSiteConfig(root: string): Promise<{
379
+ siteConfig: valaxy_types.PartialDeep<SiteConfig>;
380
+ siteConfigFile: string;
381
+ }>;
382
+
383
+ /**
384
+ * resolve theme config from special root
385
+ */
386
+ declare function resolveThemeConfigFromRoot(root: string): Promise<ResolvedConfig<DefaultTheme.Config>>;
387
+ /**
388
+ * resolve theme.config.ts and merge with default
389
+ */
390
+ declare function resolveUserThemeConfig(options: ResolvedValaxyOptions): Promise<{
391
+ themeConfig: DefaultTheme.Config;
392
+ themeConfigFile: string;
393
+ }>;
307
394
  type ValaxyConfigExtendKey = 'vite' | 'vue' | 'unocss' | 'unocssPresets' | 'markdown' | 'extendMd' | 'addons';
308
395
  type ValaxyPickConfig = Pick<ValaxyNodeConfig, ValaxyConfigExtendKey>;
309
396
  type ValaxyTheme<ThemeConfig = DefaultTheme.Config> = ValaxyPickConfig & {
@@ -312,18 +399,6 @@ type ValaxyTheme<ThemeConfig = DefaultTheme.Config> = ValaxyPickConfig & {
312
399
  declare function defineValaxyTheme<ThemeConfig = DefaultTheme.Config>(theme: ValaxyTheme<ThemeConfig> | ((options: ResolvedValaxyOptions<ThemeConfig>) => ValaxyTheme<ThemeConfig>)): ValaxyTheme<ThemeConfig> | ((options: ResolvedValaxyOptions<ThemeConfig>) => ValaxyTheme<ThemeConfig>);
313
400
  declare const defineTheme: typeof defineValaxyTheme;
314
401
 
315
- /**
316
- * Type helper for site.config.ts
317
- * @param config
318
- */
319
- declare function defineSiteConfig(config: UserSiteConfig): PartialDeep<SiteConfig>;
320
- /**
321
- * Type helper for valaxy.config.ts
322
- */
323
- declare function defineValaxyConfig<ThemeConfig>(config: UserValaxyNodeConfig<ThemeConfig>): PartialDeep<ValaxyNodeConfig<ThemeConfig>>;
324
- declare const defineConfig: typeof defineValaxyConfig;
325
- declare const defaultSiteConfig: SiteConfig;
326
- declare const defaultValaxyConfig: ValaxyNodeConfig;
327
402
  type UnoSetup = () => Awaitable<Partial<VitePluginConfig> | undefined>;
328
403
  declare function defineUnoSetup(fn: UnoSetup): UnoSetup;
329
404
 
@@ -331,6 +406,8 @@ declare function createServer(options: ResolvedValaxyOptions, viteConfig?: Inlin
331
406
 
332
407
  declare function getGitTimestamp(file: string, type?: 'created' | 'updated'): Promise<number>;
333
408
 
409
+ declare function resolveImportPath(importName: string, ensure?: true): string;
410
+
334
411
  /**
335
412
  * is url external (http/https:)
336
413
  * @param str
@@ -344,44 +421,10 @@ declare function slash(str: string): string;
344
421
  declare function ensurePrefix(prefix: string, str: string): string;
345
422
  declare function toAtFS(path: string): string;
346
423
  declare function isPath(name: string): boolean;
347
-
348
- /**
349
- * merge valaxy.config
350
- * (source, default)
351
- */
352
- declare const mergeValaxyConfig: <Source extends {
353
- [x: string]: any;
354
- [x: number]: any;
355
- [x: symbol]: any;
356
- }, Defaults extends ({
357
- [x: string]: any;
358
- [x: number]: any;
359
- [x: symbol]: any;
360
- } | (number | boolean | any[] | Record<never, any> | null | undefined))[]>(source: Source, ...defaults: Defaults) => defu.Defu<Source, Defaults>;
361
- /**
362
- * resolve valaxy config from special root
363
- */
364
- declare function resolveValaxyConfigFromRoot(root: string, options?: ResolvedValaxyOptions): Promise<{
365
- config: ValaxyNodeConfig;
366
- configFile: string;
367
- }>;
368
- /**
369
- * resolve user valaxy config
370
- * options only have userRoot
371
- * @param options
372
- */
373
- declare function resolveValaxyConfig(options: ValaxyEntryOptions): Promise<{
374
- config: ValaxyNodeConfig;
375
- configFile: string;
376
- theme: string;
377
- }>;
378
- declare function resolveAddonConfig(addons: ValaxyAddonResolver[], options?: ResolvedValaxyOptions): Promise<ValaxyNodeConfig>;
379
-
380
424
  /**
381
425
  * transform obj for vite code
382
426
  * @param obj
383
427
  */
384
428
  declare function transformObject(obj: any): string;
385
- declare function resolveImportPath(importName: string, ensure?: true): string;
386
429
 
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 };
430
+ export { type HookResult, type LoadConfigFromFileOptions, type ResolvedConfig, type ResolvedValaxyOptions, type UnoSetup, type UserInputConfig, 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, loadConfig, loadConfigFromFile, mergeValaxyConfig, mergeViteConfigs, postProcessForSSG, processValaxyOptions, resolveAddonConfig, resolveImportPath, resolveOptions, resolveSiteConfig, resolveSiteConfigFromRoot, resolveThemeConfigFromRoot, resolveThemeValaxyConfig, resolveUserThemeConfig, 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,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-2HLMSZO4.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};
2
+ import{A,B,C,D,E,F,G,H,I,J,K,L,M,N,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-ALNY7KGH.mjs";import"../chunk-ZO24WTQL.mjs";export{H as build,M as cli,L as createServer,k as defaultSiteConfig,o as defaultValaxyConfig,v as defineAddon,q as defineConfig,l as defineSiteConfig,A as defineTheme,B as defineUnoSetup,u as defineValaxyAddon,p as defineValaxyConfig,z as defineValaxyTheme,e as ensurePrefix,K as generateClientRedirects,a as getGitTimestamp,G as getIndexHtml,c as isExternal,g as isPath,i as loadConfig,j as loadConfigFromFile,s as mergeValaxyConfig,F as mergeViteConfigs,J as postProcessForSSG,C as processValaxyOptions,w as resolveAddonConfig,b as resolveImportPath,D as resolveOptions,n as resolveSiteConfig,m as resolveSiteConfigFromRoot,x as resolveThemeConfigFromRoot,E as resolveThemeValaxyConfig,y as resolveUserThemeConfig,t as resolveValaxyConfig,r as resolveValaxyConfigFromRoot,N as run,d as slash,I as ssgBuild,f as toAtFS,h as transformObject};
@@ -1 +1 @@
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
+ "use strict";var _chunkTEOGEXZQcjs = require('../chunk-TEOGEXZQ.cjs');_chunkTEOGEXZQcjs.e.call(void 0, );_chunkTEOGEXZQcjs.e.call(void 0, );_chunkTEOGEXZQcjs.e.call(void 0, );_chunkTEOGEXZQcjs.e.call(void 0, );_chunkTEOGEXZQcjs.e.call(void 0, );_chunkTEOGEXZQcjs.e.call(void 0, );_chunkTEOGEXZQcjs.e.call(void 0, );
@@ -1,5 +1,5 @@
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';
1
+ import { a as Post } from '../config-hKSeaczj.cjs';
2
+ export { A as Album, D as DefaultTheme, E as ExcerptType, F as FuseListItem, j as Page, h as PageFrontMatter, P as PartialDeep, g as Photo, d as Pkg, i as PostFrontMatter, R as RedirectRule, c as RuntimeConfig, b as SiteConfig, S as SocialLink, U as UserSiteConfig, f as UserValaxyConfig, V as ValaxyAddon, e as ValaxyConfig } from '../config-hKSeaczj.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-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';
1
+ import { a as Post } from '../config-hKSeaczj.js';
2
+ export { A as Album, D as DefaultTheme, E as ExcerptType, F as FuseListItem, j as Page, h as PageFrontMatter, P as PartialDeep, g as Photo, d as Pkg, i as PostFrontMatter, R as RedirectRule, c as RuntimeConfig, b as SiteConfig, S as SocialLink, U as UserSiteConfig, f as UserValaxyConfig, V as ValaxyAddon, e as ValaxyConfig } from '../config-hKSeaczj.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{d as e}from"../chunk-WSC7UAH5.mjs";e();e();e();e();e();e();e();
2
+ import{d as e}from"../chunk-ZO24WTQL.mjs";e();e();e();e();e();e();e();