valaxy 0.9.2 → 0.10.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.
- package/client/App.vue +11 -3
- package/client/components/ValaxyAddons.vue +10 -0
- package/client/components/ValaxyMd.vue +0 -10
- package/client/components/ValaxyOverlay.vue +1 -1
- package/client/composables/category.ts +5 -0
- package/client/composables/common.ts +1 -1
- package/client/composables/outline.ts +1 -1
- package/client/composables/post.ts +24 -24
- package/client/composables/sidebar.ts +1 -1
- package/client/config.ts +25 -15
- package/client/layouts/404.vue +1 -1
- package/client/modules/valaxy.ts +3 -3
- package/client/styles/common/markdown.scss +9 -0
- package/client/styles/common/sidebar.scss +1 -1
- package/client/styles/global/reset.scss +0 -2
- package/client/styles/mixins/size.scss +12 -13
- package/client/styles/palette.scss +1 -1
- package/client/styles/vars.scss +1 -1
- package/dist/{chunk-LHTMHTJP.mjs → chunk-LPNZDKS7.mjs} +207 -204
- package/dist/{chunk-V4YNXOMI.js → chunk-ZTROIOLH.js} +207 -204
- package/dist/{config-1d2e9ebd.d.ts → config-1d500fb4.d.ts} +4 -4
- package/dist/node/cli.js +7 -7
- package/dist/node/cli.mjs +7 -7
- package/dist/node/index.d.ts +74 -48
- package/dist/node/index.js +1 -1
- package/dist/node/index.mjs +1 -1
- package/dist/types/index.d.ts +2 -7
- package/dist/types/index.js +1 -1
- package/dist/types/index.mjs +0 -1
- package/package.json +7 -6
- package/types/config.ts +4 -5
- package/types/index.ts +1 -1
- package/dist/chunk-B2L4QLCB.mjs +0 -1
- package/dist/chunk-KRHFRLOW.js +0 -1
- package/types/setups.ts +0 -8
package/dist/node/index.d.ts
CHANGED
|
@@ -1,16 +1,23 @@
|
|
|
1
1
|
import { ViteSSGOptions } from 'vite-ssg';
|
|
2
|
+
import * as vite from 'vite';
|
|
3
|
+
import { UserConfig as UserConfig$1, InlineConfig } from 'vite';
|
|
4
|
+
import { D as DefaultThemeConfig, U as UserSiteConfig, P as PartialDeep, S as SiteConfig } from '../config-1d500fb4.js';
|
|
2
5
|
import Vue from '@vitejs/plugin-vue';
|
|
3
6
|
import Components from 'unplugin-vue-components/vite';
|
|
4
7
|
import { VitePluginConfig } from 'unocss/vite';
|
|
5
8
|
import Pages from 'vite-plugin-pages';
|
|
6
|
-
import * as vite from 'vite';
|
|
7
|
-
import { UserConfig, InlineConfig } from 'vite';
|
|
8
9
|
import { presetUno, presetAttributify, presetIcons, presetTypography } from 'unocss';
|
|
9
|
-
import { V as ValaxyConfig, U as UserConfig$1, P as PartialDeep, a as ValaxyThemeConfig } from '../config-1d2e9ebd.js';
|
|
10
10
|
import MarkdownIt from 'markdown-it';
|
|
11
11
|
import { Theme } from 'shiki';
|
|
12
12
|
import Anchor from 'markdown-it-anchor';
|
|
13
13
|
import { KatexOptions } from 'katex';
|
|
14
|
+
import { Awaitable } from '@antfu/utils';
|
|
15
|
+
|
|
16
|
+
declare module 'vite' {
|
|
17
|
+
interface UserConfig {
|
|
18
|
+
ssgOptions?: ViteSSGOptions;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
14
21
|
|
|
15
22
|
interface BlockItem {
|
|
16
23
|
text?: string;
|
|
@@ -62,14 +69,10 @@ interface MarkdownOptions {
|
|
|
62
69
|
blocks?: Blocks;
|
|
63
70
|
}
|
|
64
71
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
theme?: string;
|
|
70
|
-
userRoot?: string;
|
|
71
|
-
}
|
|
72
|
-
interface ValaxyPluginOptions {
|
|
72
|
+
declare type ValaxyConfig<ThemeConfig = DefaultThemeConfig> = UserSiteConfig<ThemeConfig> & ValaxyExtendConfig;
|
|
73
|
+
declare type UserConfig<ThemeConfig = DefaultThemeConfig> = ValaxyConfig<ThemeConfig>;
|
|
74
|
+
interface ValaxyExtendConfig {
|
|
75
|
+
vite?: UserConfig$1;
|
|
73
76
|
vue?: Parameters<typeof Vue>[0];
|
|
74
77
|
components?: Parameters<typeof Components>[0];
|
|
75
78
|
unocss?: VitePluginConfig;
|
|
@@ -93,11 +96,33 @@ interface ValaxyPluginOptions {
|
|
|
93
96
|
excerpt?: string;
|
|
94
97
|
path: string;
|
|
95
98
|
}) => void;
|
|
99
|
+
addons?: ValaxyAddonOptions;
|
|
100
|
+
}
|
|
101
|
+
interface ValaxyAddon {
|
|
102
|
+
global?: boolean;
|
|
103
|
+
props?: Record<string, any>;
|
|
104
|
+
options?: Record<string, any>;
|
|
96
105
|
}
|
|
97
|
-
|
|
98
|
-
|
|
106
|
+
declare type ValaxyAddonLike = ValaxyAddon | false | null | undefined;
|
|
107
|
+
declare type ValaxyAddonOptions = ([string, ValaxyAddonLike] | string)[] | Record<string, ValaxyAddonLike>;
|
|
108
|
+
interface ValaxyAddonResolver {
|
|
109
|
+
name: string;
|
|
110
|
+
root: string;
|
|
111
|
+
enable: boolean;
|
|
112
|
+
global: boolean;
|
|
113
|
+
props: Record<string, any>;
|
|
114
|
+
options: Record<string, any>;
|
|
115
|
+
configFile?: string;
|
|
99
116
|
}
|
|
100
|
-
|
|
117
|
+
|
|
118
|
+
interface ValaxyEntryOptions {
|
|
119
|
+
/**
|
|
120
|
+
* theme name
|
|
121
|
+
*/
|
|
122
|
+
theme?: string;
|
|
123
|
+
userRoot?: string;
|
|
124
|
+
}
|
|
125
|
+
interface ResolvedValaxyOptions<ThemeConfig = DefaultThemeConfig> {
|
|
101
126
|
mode: 'dev' | 'build';
|
|
102
127
|
/**
|
|
103
128
|
* package.json root
|
|
@@ -117,6 +142,10 @@ interface ResolvedValaxyOptions {
|
|
|
117
142
|
* Theme root path
|
|
118
143
|
*/
|
|
119
144
|
themeRoot: string;
|
|
145
|
+
/**
|
|
146
|
+
* Addon root path
|
|
147
|
+
*/
|
|
148
|
+
addonRoots: string[];
|
|
120
149
|
/**
|
|
121
150
|
* Theme name
|
|
122
151
|
*/
|
|
@@ -125,55 +154,52 @@ interface ResolvedValaxyOptions {
|
|
|
125
154
|
/**
|
|
126
155
|
* Valaxy Config
|
|
127
156
|
*/
|
|
128
|
-
config: ValaxyConfig
|
|
157
|
+
config: ValaxyConfig<ThemeConfig>;
|
|
129
158
|
/**
|
|
130
159
|
* config file path
|
|
131
160
|
*/
|
|
132
161
|
configFile: string;
|
|
133
162
|
pages: string[];
|
|
163
|
+
/**
|
|
164
|
+
* all addons
|
|
165
|
+
* Record<package-name, OptionResolver>
|
|
166
|
+
*/
|
|
167
|
+
addons: ValaxyAddonResolver[];
|
|
134
168
|
}
|
|
135
169
|
interface ValaxyServerOptions {
|
|
136
170
|
onConfigReload?: (newConfig: ValaxyConfig, config: ValaxyConfig, force?: boolean) => void;
|
|
137
171
|
}
|
|
138
|
-
declare function
|
|
139
|
-
/**
|
|
140
|
-
* get theme roots
|
|
141
|
-
* @param name
|
|
142
|
-
* @param entry
|
|
143
|
-
* @returns
|
|
144
|
-
*/
|
|
145
|
-
declare function getThemeRoot(name: string, entry: string): string;
|
|
146
|
-
declare function resolveOptions(options: ValaxyEntryOptions, mode?: ResolvedValaxyOptions['mode']): Promise<ResolvedValaxyOptions>;
|
|
172
|
+
declare function resolveOptions(options: ValaxyEntryOptions, mode?: ResolvedValaxyOptions['mode']): Promise<ResolvedValaxyOptions<DefaultThemeConfig>>;
|
|
147
173
|
|
|
148
|
-
declare
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
* @see ./options.ts'
|
|
154
|
-
*/
|
|
155
|
-
valaxy?: ValaxyPluginOptions;
|
|
156
|
-
ssgOptions?: ViteSSGOptions;
|
|
157
|
-
}
|
|
158
|
-
}
|
|
174
|
+
declare function mergeViteConfigs({ userRoot, themeRoot }: ResolvedValaxyOptions, command: 'serve' | 'build'): Promise<InlineConfig>;
|
|
175
|
+
declare function getIndexHtml({ clientRoot, themeRoot, userRoot, config }: ResolvedValaxyOptions): Promise<string>;
|
|
176
|
+
|
|
177
|
+
declare function build(options: ResolvedValaxyOptions, viteConfig?: InlineConfig): Promise<void>;
|
|
178
|
+
declare function ssgBuild(options: ResolvedValaxyOptions, viteConfig?: InlineConfig): Promise<void>;
|
|
159
179
|
|
|
160
180
|
/**
|
|
161
|
-
* Type
|
|
181
|
+
* Type site helper
|
|
162
182
|
*/
|
|
163
|
-
declare function
|
|
183
|
+
declare function defineSite<ThemeConfig>(config: UserSiteConfig<ThemeConfig>): PartialDeep<SiteConfig<ThemeConfig>>;
|
|
164
184
|
/**
|
|
165
|
-
* Type
|
|
185
|
+
* Type site helper for custom theme site
|
|
166
186
|
*/
|
|
167
|
-
declare function
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
declare type
|
|
174
|
-
declare type
|
|
175
|
-
|
|
187
|
+
declare function defineSiteWithTheme<ThemeConfig>(config: UserSiteConfig<ThemeConfig>): PartialDeep<SiteConfig<ThemeConfig>>;
|
|
188
|
+
/**
|
|
189
|
+
* Type valaxy config helper
|
|
190
|
+
*/
|
|
191
|
+
declare function defineConfig<ThemeConfig>(config: UserConfig<ThemeConfig>): UserConfig<ThemeConfig>;
|
|
192
|
+
declare type ValaxyConfigExtendKey = 'vite' | 'vue' | 'unocss' | 'unocssPresets' | 'markdown' | 'extendMd';
|
|
193
|
+
declare type ValaxyPickConfig = Pick<ValaxyConfig, ValaxyConfigExtendKey>;
|
|
194
|
+
declare type ValaxyTheme<ThemeConfig = DefaultThemeConfig> = ValaxyPickConfig & {
|
|
195
|
+
themeConfig?: ThemeConfig;
|
|
196
|
+
};
|
|
197
|
+
declare function defineTheme<ThemeConfig = DefaultThemeConfig>(theme: ValaxyTheme<ThemeConfig> | ((options: ResolvedValaxyOptions<ThemeConfig>) => ValaxyTheme<ThemeConfig>)): ValaxyTheme<ThemeConfig> | ((options: ResolvedValaxyOptions<ThemeConfig>) => ValaxyTheme<ThemeConfig>);
|
|
198
|
+
declare function defineAddon(addon: ValaxyPickConfig | ((addonOptions: ValaxyAddonResolver, valaxyOptions: ResolvedValaxyOptions) => ValaxyPickConfig)): ValaxyPickConfig | ((addonOptions: ValaxyAddonResolver, valaxyOptions: ResolvedValaxyOptions) => ValaxyPickConfig);
|
|
199
|
+
declare const defaultSiteConfig: SiteConfig;
|
|
200
|
+
declare type UnoSetup = () => Awaitable<Partial<VitePluginConfig> | undefined>;
|
|
201
|
+
declare function defineUnoSetup(fn: UnoSetup): UnoSetup;
|
|
176
202
|
|
|
177
203
|
declare function createServer(options: ResolvedValaxyOptions, viteConfig?: InlineConfig, serverOptions?: ValaxyServerOptions): Promise<vite.ViteDevServer>;
|
|
178
204
|
|
|
179
|
-
export { ResolvedValaxyOptions,
|
|
205
|
+
export { ResolvedValaxyOptions, UnoSetup, ValaxyConfigExtendKey, ValaxyEntryOptions, ValaxyPickConfig, ValaxyServerOptions, ValaxyTheme, build, createServer, defaultSiteConfig, defineAddon, defineConfig, defineSite, defineSiteWithTheme, defineTheme, defineUnoSetup, getIndexHtml, mergeViteConfigs, resolveOptions, ssgBuild };
|
package/dist/node/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkZTROIOLHjs = require('../chunk-ZTROIOLH.js');exports.build = _chunkZTROIOLHjs.q; exports.createServer = _chunkZTROIOLHjs.s; exports.defaultSiteConfig = _chunkZTROIOLHjs.n; exports.defineAddon = _chunkZTROIOLHjs.m; exports.defineConfig = _chunkZTROIOLHjs.k; exports.defineSite = _chunkZTROIOLHjs.i; exports.defineSiteWithTheme = _chunkZTROIOLHjs.j; exports.defineTheme = _chunkZTROIOLHjs.l; exports.defineUnoSetup = _chunkZTROIOLHjs.o; exports.getIndexHtml = _chunkZTROIOLHjs.f; exports.mergeViteConfigs = _chunkZTROIOLHjs.e; exports.resolveOptions = _chunkZTROIOLHjs.p; exports.ssgBuild = _chunkZTROIOLHjs.r;
|
package/dist/node/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{e as o,f as r,i as m,j as p,k as t,l as e,m as f,n as x,o as i,p as a,q as b,r as c,s as d}from"../chunk-LPNZDKS7.mjs";export{b as build,d as createServer,x as defaultSiteConfig,f as defineAddon,t as defineConfig,m as defineSite,p as defineSiteWithTheme,e as defineTheme,i as defineUnoSetup,r as getIndexHtml,o as mergeViteConfigs,a as resolveOptions,c as ssgBuild};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
export { A as AlgoliaSearchOptions,
|
|
2
|
-
import { VitePluginConfig } from 'unocss/vite';
|
|
3
|
-
import { Awaitable } from '@antfu/utils';
|
|
1
|
+
export { A as AlgoliaSearchOptions, D as DefaultThemeConfig, P as PartialDeep, S as SiteConfig, a as SocialLink, U as UserSiteConfig } from '../config-1d500fb4.js';
|
|
4
2
|
|
|
5
3
|
interface Post extends Record<string, any> {
|
|
6
4
|
/**
|
|
@@ -153,7 +151,4 @@ interface PageDataPayload {
|
|
|
153
151
|
}
|
|
154
152
|
declare type HeadConfig = [string, Record<string, string>] | [string, Record<string, string>, string];
|
|
155
153
|
|
|
156
|
-
|
|
157
|
-
declare function defineUnoSetup(fn: UnoSetup): UnoSetup;
|
|
158
|
-
|
|
159
|
-
export { HeadConfig, Header, PageData, PageDataPayload, Post, UnoSetup, defineUnoSetup };
|
|
154
|
+
export { HeadConfig, Header, PageData, PageDataPayload, Post };
|
package/dist/types/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
package/dist/types/index.mjs
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"../chunk-B2L4QLCB.mjs";function t(o){return o}export{t as defineUnoSetup};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "valaxy",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.1",
|
|
4
4
|
"description": "📄 Vite & Vue powered static blog generator.",
|
|
5
5
|
"author": {
|
|
6
6
|
"email": "me@yunyoujun.cn",
|
|
@@ -57,14 +57,14 @@
|
|
|
57
57
|
"@ctrl/tinycolor": "^3.4.1",
|
|
58
58
|
"@iconify-json/carbon": "^1.1.6",
|
|
59
59
|
"@iconify-json/ri": "^1.1.3",
|
|
60
|
-
"@intlify/vite-plugin-vue-i18n": "^
|
|
60
|
+
"@intlify/vite-plugin-vue-i18n": "^5.0.0",
|
|
61
61
|
"@vitejs/plugin-vue": "^2.3.3",
|
|
62
|
-
"@vueuse/core": "^8.9.
|
|
62
|
+
"@vueuse/core": "^8.9.4",
|
|
63
63
|
"@vueuse/head": "^0.7.6",
|
|
64
64
|
"consola": "^2.15.3",
|
|
65
65
|
"critters": "^0.0.16",
|
|
66
66
|
"cross-spawn": "^7.0.3",
|
|
67
|
-
"dayjs": "^1.11.
|
|
67
|
+
"dayjs": "^1.11.4",
|
|
68
68
|
"ejs": "^3.1.8",
|
|
69
69
|
"escape-html": "^1.0.3",
|
|
70
70
|
"feed": "^4.2.2",
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
"is-installed-globally": "^0.4.0",
|
|
74
74
|
"katex": "^0.16.0",
|
|
75
75
|
"kolorist": "^1.5.1",
|
|
76
|
-
"lru-cache": "^7.13.
|
|
76
|
+
"lru-cache": "^7.13.1",
|
|
77
77
|
"markdown-it": "^13.0.1",
|
|
78
78
|
"markdown-it-anchor": "^8.6.4",
|
|
79
79
|
"markdown-it-attrs": "^4.1.4",
|
|
@@ -84,12 +84,13 @@
|
|
|
84
84
|
"markdown-it-task-lists": "^2.1.1",
|
|
85
85
|
"nprogress": "^0.2.0",
|
|
86
86
|
"open": "^8.4.0",
|
|
87
|
+
"pascal-case": "^3.1.2",
|
|
87
88
|
"pinia": "^2.0.16",
|
|
88
89
|
"sass": "^1.53.0",
|
|
89
90
|
"shiki": "^0.10.1",
|
|
90
91
|
"star-markdown-css": "^0.4.0",
|
|
91
92
|
"unconfig": "^0.3.5",
|
|
92
|
-
"unocss": "^0.44.
|
|
93
|
+
"unocss": "^0.44.5",
|
|
93
94
|
"unplugin-vue-components": "^0.21.1",
|
|
94
95
|
"vite": "^2.9.14",
|
|
95
96
|
"vite-plugin-pages": "^0.25.0",
|
package/types/config.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type
|
|
1
|
+
export type DefaultThemeConfig = Record<string, any>
|
|
2
2
|
|
|
3
3
|
export interface SocialLink {
|
|
4
4
|
/**
|
|
@@ -25,8 +25,8 @@ export interface AlgoliaSearchOptions {
|
|
|
25
25
|
initialQuery?: string
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
//
|
|
29
|
-
export interface
|
|
28
|
+
// shared with valaxy node and client
|
|
29
|
+
export interface SiteConfig<T = DefaultThemeConfig> {
|
|
30
30
|
/**
|
|
31
31
|
* enable auto (light/dark mode)
|
|
32
32
|
* @default 'auto'
|
|
@@ -226,5 +226,4 @@ export type PartialDeep<T> = {
|
|
|
226
226
|
* Valaxy User Config
|
|
227
227
|
* @description Valaxy 用户配置
|
|
228
228
|
*/
|
|
229
|
-
export type
|
|
230
|
-
|
|
229
|
+
export type UserSiteConfig<ThemeConfig = DefaultThemeConfig> = PartialDeep<SiteConfig<ThemeConfig>>
|
package/types/index.ts
CHANGED
package/dist/chunk-B2L4QLCB.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var g=Object.create;var f=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var i=Object.getOwnPropertyNames;var j=Object.getPrototypeOf,k=Object.prototype.hasOwnProperty;var m=(a=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(a,{get:(b,c)=>(typeof require!="undefined"?require:b)[c]}):a)(function(a){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+a+'" is not supported')});var n=(a,b)=>()=>(b||a((b={exports:{}}).exports,b),b.exports);var l=(a,b,c,e)=>{if(b&&typeof b=="object"||typeof b=="function")for(let d of i(b))!k.call(a,d)&&d!==c&&f(a,d,{get:()=>b[d],enumerable:!(e=h(b,d))||e.enumerable});return a};var o=(a,b,c)=>(c=a!=null?g(j(a)):{},l(b||!a||!a.__esModule?f(c,"default",{value:a,enumerable:!0}):c,a));export{m as a,n as b,o as c};
|
package/dist/chunk-KRHFRLOW.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var g=Object.create;var f=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var i=Object.getOwnPropertyNames;var j=Object.getPrototypeOf,k=Object.prototype.hasOwnProperty;var m=(a=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(a,{get:(b,c)=>(typeof require!="undefined"?require:b)[c]}):a)(function(a){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+a+'" is not supported')});var n=(a,b)=>()=>(b||a((b={exports:{}}).exports,b),b.exports);var l=(a,b,c,e)=>{if(b&&typeof b=="object"||typeof b=="function")for(let d of i(b))!k.call(a,d)&&d!==c&&f(a,d,{get:()=>b[d],enumerable:!(e=h(b,d))||e.enumerable});return a};var o=(a,b,c)=>(c=a!=null?g(j(a)):{},l(b||!a||!a.__esModule?f(c,"default",{value:a,enumerable:!0}):c,a));exports.a = m; exports.b = n; exports.c = o;
|
package/types/setups.ts
DELETED