valaxy 0.9.3 → 0.10.2
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/config.ts +25 -15
- package/client/layouts/404.vue +1 -1
- package/client/layouts/default.vue +3 -0
- package/client/layouts/layout.vue +34 -0
- package/client/layouts/post.vue +3 -0
- package/client/modules/valaxy.ts +3 -3
- package/client/setups.ts +1 -1
- 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/client/{index.html → template.html} +0 -6
- package/dist/chunk-6PDG5NQV.mjs +102 -0
- package/dist/chunk-S7EBKLNL.js +102 -0
- 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 +88 -45
- package/dist/node/index.js +1 -1
- package/dist/node/index.mjs +1 -1
- package/dist/types/index.d.ts +1 -1
- package/package.json +9 -11
- package/types/config.ts +4 -5
- package/dist/chunk-4ICNZPIN.js +0 -2326
- package/dist/chunk-WXYDKT6O.mjs +0 -2326
package/dist/node/index.d.ts
CHANGED
|
@@ -1,18 +1,24 @@
|
|
|
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
14
|
import { Awaitable } from '@antfu/utils';
|
|
15
15
|
|
|
16
|
+
declare module 'vite' {
|
|
17
|
+
interface UserConfig {
|
|
18
|
+
ssgOptions?: ViteSSGOptions;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
16
22
|
interface BlockItem {
|
|
17
23
|
text?: string;
|
|
18
24
|
icon?: string;
|
|
@@ -63,14 +69,15 @@ interface MarkdownOptions {
|
|
|
63
69
|
blocks?: Blocks;
|
|
64
70
|
}
|
|
65
71
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
interface
|
|
72
|
+
declare type ValaxyConfig<ThemeConfig = DefaultThemeConfig> = UserSiteConfig<ThemeConfig> & ValaxyExtendConfig;
|
|
73
|
+
declare type UserConfig<ThemeConfig = DefaultThemeConfig> = ValaxyConfig<ThemeConfig>;
|
|
74
|
+
/**
|
|
75
|
+
* fn with options for theme config
|
|
76
|
+
*/
|
|
77
|
+
declare type ValaxyConfigFn<ThemeConfig = DefaultThemeConfig> = (options: ResolvedValaxyOptions<ThemeConfig>) => ValaxyConfig | Promise<ValaxyConfig>;
|
|
78
|
+
declare type ValaxyConfigExport<ThemeConfig = DefaultThemeConfig> = ValaxyConfig<ThemeConfig> | ValaxyConfigFn<ThemeConfig>;
|
|
79
|
+
interface ValaxyExtendConfig {
|
|
80
|
+
vite?: UserConfig$1;
|
|
74
81
|
vue?: Parameters<typeof Vue>[0];
|
|
75
82
|
components?: Parameters<typeof Components>[0];
|
|
76
83
|
unocss?: VitePluginConfig;
|
|
@@ -94,11 +101,35 @@ interface ValaxyPluginOptions {
|
|
|
94
101
|
excerpt?: string;
|
|
95
102
|
path: string;
|
|
96
103
|
}) => void;
|
|
104
|
+
addons?: ValaxyAddonOptions;
|
|
97
105
|
}
|
|
98
|
-
interface
|
|
99
|
-
|
|
106
|
+
interface ValaxyAddon {
|
|
107
|
+
global?: boolean;
|
|
108
|
+
props?: Record<string, any>;
|
|
109
|
+
options?: Record<string, any>;
|
|
110
|
+
}
|
|
111
|
+
declare type ValaxyAddonLike = ValaxyAddon | false | null | undefined;
|
|
112
|
+
declare type ValaxyAddonOptions = ([string, ValaxyAddonLike] | string)[] | Record<string, ValaxyAddonLike>;
|
|
113
|
+
declare type ValaxyAddonFn<ThemeConfig = DefaultThemeConfig> = (addonOptions: ValaxyAddonResolver, valaxyOptions: ResolvedValaxyOptions<ThemeConfig>) => ValaxyConfig | Promise<ValaxyConfig>;
|
|
114
|
+
declare type ValaxyAddonExport<ThemeConfig = DefaultThemeConfig> = ValaxyConfig<ThemeConfig> | ValaxyAddonFn<ThemeConfig>;
|
|
115
|
+
interface ValaxyAddonResolver {
|
|
116
|
+
name: string;
|
|
117
|
+
root: string;
|
|
118
|
+
enable: boolean;
|
|
119
|
+
global: boolean;
|
|
120
|
+
props: Record<string, any>;
|
|
121
|
+
options: Record<string, any>;
|
|
122
|
+
configFile?: string;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
interface ValaxyEntryOptions {
|
|
126
|
+
/**
|
|
127
|
+
* theme name
|
|
128
|
+
*/
|
|
129
|
+
theme?: string;
|
|
130
|
+
userRoot?: string;
|
|
100
131
|
}
|
|
101
|
-
interface ResolvedValaxyOptions {
|
|
132
|
+
interface ResolvedValaxyOptions<ThemeConfig = DefaultThemeConfig> {
|
|
102
133
|
mode: 'dev' | 'build';
|
|
103
134
|
/**
|
|
104
135
|
* package.json root
|
|
@@ -118,6 +149,10 @@ interface ResolvedValaxyOptions {
|
|
|
118
149
|
* Theme root path
|
|
119
150
|
*/
|
|
120
151
|
themeRoot: string;
|
|
152
|
+
/**
|
|
153
|
+
* Addon root path
|
|
154
|
+
*/
|
|
155
|
+
addonRoots: string[];
|
|
121
156
|
/**
|
|
122
157
|
* Theme name
|
|
123
158
|
*/
|
|
@@ -126,57 +161,65 @@ interface ResolvedValaxyOptions {
|
|
|
126
161
|
/**
|
|
127
162
|
* Valaxy Config
|
|
128
163
|
*/
|
|
129
|
-
config: ValaxyConfig
|
|
164
|
+
config: ValaxyConfig<ThemeConfig>;
|
|
130
165
|
/**
|
|
131
166
|
* config file path
|
|
132
167
|
*/
|
|
133
168
|
configFile: string;
|
|
134
169
|
pages: string[];
|
|
170
|
+
/**
|
|
171
|
+
* all addons
|
|
172
|
+
* Record<package-name, OptionResolver>
|
|
173
|
+
*/
|
|
174
|
+
addons: ValaxyAddonResolver[];
|
|
135
175
|
}
|
|
136
176
|
interface ValaxyServerOptions {
|
|
137
177
|
onConfigReload?: (newConfig: ValaxyConfig, config: ValaxyConfig, force?: boolean) => void;
|
|
138
178
|
}
|
|
139
|
-
declare function
|
|
179
|
+
declare function resolveOptions(options: ValaxyEntryOptions, mode?: ResolvedValaxyOptions['mode']): Promise<ResolvedValaxyOptions<DefaultThemeConfig>>;
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* merge vite.config.ts (user & theme)
|
|
183
|
+
* @internal
|
|
184
|
+
* @param param
|
|
185
|
+
* @param command
|
|
186
|
+
* @returns
|
|
187
|
+
*/
|
|
188
|
+
declare function mergeViteConfigs({ userRoot, themeRoot }: ResolvedValaxyOptions, command: 'serve' | 'build'): Promise<InlineConfig>;
|
|
140
189
|
/**
|
|
141
|
-
*
|
|
142
|
-
* @
|
|
143
|
-
* @param
|
|
190
|
+
* generate index.html from user/theme/client
|
|
191
|
+
* @internal
|
|
192
|
+
* @param
|
|
144
193
|
* @returns
|
|
145
194
|
*/
|
|
146
|
-
declare function
|
|
147
|
-
declare function resolveOptions(options: ValaxyEntryOptions, mode?: ResolvedValaxyOptions['mode']): Promise<ResolvedValaxyOptions>;
|
|
195
|
+
declare function getIndexHtml({ clientRoot, themeRoot, userRoot, config }: ResolvedValaxyOptions): Promise<string>;
|
|
148
196
|
|
|
149
|
-
declare
|
|
150
|
-
|
|
151
|
-
/**
|
|
152
|
-
* Custom internal plugin options for Valaxy (advanced)
|
|
153
|
-
*
|
|
154
|
-
* @see ./options.ts'
|
|
155
|
-
*/
|
|
156
|
-
valaxy?: ValaxyPluginOptions;
|
|
157
|
-
ssgOptions?: ViteSSGOptions;
|
|
158
|
-
}
|
|
159
|
-
}
|
|
197
|
+
declare function build(options: ResolvedValaxyOptions, viteConfig?: InlineConfig): Promise<void>;
|
|
198
|
+
declare function ssgBuild(options: ResolvedValaxyOptions, viteConfig?: InlineConfig): Promise<void>;
|
|
160
199
|
|
|
161
200
|
/**
|
|
162
|
-
* Type
|
|
201
|
+
* Type site helper
|
|
163
202
|
*/
|
|
164
|
-
declare function
|
|
203
|
+
declare function defineSite<ThemeConfig>(config: UserSiteConfig<ThemeConfig>): PartialDeep<SiteConfig<ThemeConfig>>;
|
|
165
204
|
/**
|
|
166
|
-
* Type
|
|
205
|
+
* Type site helper for custom theme site
|
|
167
206
|
*/
|
|
168
|
-
declare function
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
declare type
|
|
175
|
-
declare type
|
|
176
|
-
|
|
207
|
+
declare function defineSiteWithTheme<ThemeConfig>(config: UserSiteConfig<ThemeConfig>): PartialDeep<SiteConfig<ThemeConfig>>;
|
|
208
|
+
/**
|
|
209
|
+
* Type valaxy config helper
|
|
210
|
+
*/
|
|
211
|
+
declare function defineConfig<ThemeConfig>(config: UserConfig<ThemeConfig>): UserConfig<ThemeConfig>;
|
|
212
|
+
declare type ValaxyConfigExtendKey = 'vite' | 'vue' | 'unocss' | 'unocssPresets' | 'markdown' | 'extendMd';
|
|
213
|
+
declare type ValaxyPickConfig = Pick<ValaxyConfig, ValaxyConfigExtendKey>;
|
|
214
|
+
declare type ValaxyTheme<ThemeConfig = DefaultThemeConfig> = ValaxyPickConfig & {
|
|
215
|
+
themeConfig?: ThemeConfig;
|
|
216
|
+
};
|
|
217
|
+
declare function defineTheme<ThemeConfig = DefaultThemeConfig>(theme: ValaxyTheme<ThemeConfig> | ((options: ResolvedValaxyOptions<ThemeConfig>) => ValaxyTheme<ThemeConfig>)): ValaxyTheme<ThemeConfig> | ((options: ResolvedValaxyOptions<ThemeConfig>) => ValaxyTheme<ThemeConfig>);
|
|
218
|
+
declare function defineAddon(addon: ValaxyPickConfig | ((addonOptions: ValaxyAddonResolver, valaxyOptions: ResolvedValaxyOptions) => ValaxyPickConfig)): ValaxyPickConfig | ((addonOptions: ValaxyAddonResolver, valaxyOptions: ResolvedValaxyOptions) => ValaxyPickConfig);
|
|
219
|
+
declare const defaultSiteConfig: SiteConfig;
|
|
177
220
|
declare type UnoSetup = () => Awaitable<Partial<VitePluginConfig> | undefined>;
|
|
178
221
|
declare function defineUnoSetup(fn: UnoSetup): UnoSetup;
|
|
179
222
|
|
|
180
223
|
declare function createServer(options: ResolvedValaxyOptions, viteConfig?: InlineConfig, serverOptions?: ValaxyServerOptions): Promise<vite.ViteDevServer>;
|
|
181
224
|
|
|
182
|
-
export { ResolvedValaxyOptions,
|
|
225
|
+
export { ResolvedValaxyOptions, UnoSetup, UserConfig, ValaxyAddon, ValaxyAddonExport, ValaxyAddonFn, ValaxyAddonLike, ValaxyAddonOptions, ValaxyAddonResolver, ValaxyConfig, ValaxyConfigExport, ValaxyConfigExtendKey, ValaxyConfigFn, ValaxyEntryOptions, ValaxyExtendConfig, 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 _chunkS7EBKLNLjs = require('../chunk-S7EBKLNL.js');exports.build = _chunkS7EBKLNLjs.q; exports.createServer = _chunkS7EBKLNLjs.s; exports.defaultSiteConfig = _chunkS7EBKLNLjs.n; exports.defineAddon = _chunkS7EBKLNLjs.m; exports.defineConfig = _chunkS7EBKLNLjs.k; exports.defineSite = _chunkS7EBKLNLjs.i; exports.defineSiteWithTheme = _chunkS7EBKLNLjs.j; exports.defineTheme = _chunkS7EBKLNLjs.l; exports.defineUnoSetup = _chunkS7EBKLNLjs.o; exports.getIndexHtml = _chunkS7EBKLNLjs.f; exports.mergeViteConfigs = _chunkS7EBKLNLjs.e; exports.resolveOptions = _chunkS7EBKLNLjs.p; exports.ssgBuild = _chunkS7EBKLNLjs.r;
|
package/dist/node/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as o,f as r,
|
|
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-6PDG5NQV.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,4 +1,4 @@
|
|
|
1
|
-
export { A as AlgoliaSearchOptions,
|
|
1
|
+
export { A as AlgoliaSearchOptions, D as DefaultThemeConfig, P as PartialDeep, S as SiteConfig, a as SocialLink, U as UserSiteConfig } from '../config-1d500fb4.js';
|
|
2
2
|
|
|
3
3
|
interface Post extends Record<string, any> {
|
|
4
4
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "valaxy",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.2",
|
|
4
4
|
"description": "📄 Vite & Vue powered static blog generator.",
|
|
5
5
|
"author": {
|
|
6
6
|
"email": "me@yunyoujun.cn",
|
|
@@ -22,11 +22,7 @@
|
|
|
22
22
|
"import": "./dist/node/index.mjs"
|
|
23
23
|
},
|
|
24
24
|
"./client/*": "./client/*",
|
|
25
|
-
"./client":
|
|
26
|
-
"types": "./dist/client/index.d.ts",
|
|
27
|
-
"require": "./dist/client/index.js",
|
|
28
|
-
"import": "./dist/client/index.mjs"
|
|
29
|
-
},
|
|
25
|
+
"./client": "./client/index.ts",
|
|
30
26
|
"./node": {
|
|
31
27
|
"types": "./dist/node/index.d.ts",
|
|
32
28
|
"require": "./dist/node/index.js",
|
|
@@ -57,23 +53,24 @@
|
|
|
57
53
|
"@ctrl/tinycolor": "^3.4.1",
|
|
58
54
|
"@iconify-json/carbon": "^1.1.6",
|
|
59
55
|
"@iconify-json/ri": "^1.1.3",
|
|
60
|
-
"@intlify/vite-plugin-vue-i18n": "^
|
|
56
|
+
"@intlify/vite-plugin-vue-i18n": "^5.0.0",
|
|
61
57
|
"@vitejs/plugin-vue": "^2.3.3",
|
|
62
|
-
"@vueuse/core": "^8.9.
|
|
58
|
+
"@vueuse/core": "^8.9.4",
|
|
63
59
|
"@vueuse/head": "^0.7.6",
|
|
64
60
|
"consola": "^2.15.3",
|
|
65
61
|
"critters": "^0.0.16",
|
|
66
62
|
"cross-spawn": "^7.0.3",
|
|
67
|
-
"dayjs": "^1.11.
|
|
63
|
+
"dayjs": "^1.11.4",
|
|
68
64
|
"ejs": "^3.1.8",
|
|
69
65
|
"escape-html": "^1.0.3",
|
|
70
66
|
"feed": "^4.2.2",
|
|
71
67
|
"global-dirs": "^3.0.0",
|
|
72
68
|
"gray-matter": "^4.0.3",
|
|
73
69
|
"is-installed-globally": "^0.4.0",
|
|
70
|
+
"jiti": "^1.14.0",
|
|
74
71
|
"katex": "^0.16.0",
|
|
75
72
|
"kolorist": "^1.5.1",
|
|
76
|
-
"lru-cache": "^7.13.
|
|
73
|
+
"lru-cache": "^7.13.1",
|
|
77
74
|
"markdown-it": "^13.0.1",
|
|
78
75
|
"markdown-it-anchor": "^8.6.4",
|
|
79
76
|
"markdown-it-attrs": "^4.1.4",
|
|
@@ -84,12 +81,13 @@
|
|
|
84
81
|
"markdown-it-task-lists": "^2.1.1",
|
|
85
82
|
"nprogress": "^0.2.0",
|
|
86
83
|
"open": "^8.4.0",
|
|
84
|
+
"pascal-case": "^3.1.2",
|
|
87
85
|
"pinia": "^2.0.16",
|
|
88
86
|
"sass": "^1.53.0",
|
|
89
87
|
"shiki": "^0.10.1",
|
|
90
88
|
"star-markdown-css": "^0.4.0",
|
|
91
89
|
"unconfig": "^0.3.5",
|
|
92
|
-
"unocss": "^0.44.
|
|
90
|
+
"unocss": "^0.44.5",
|
|
93
91
|
"unplugin-vue-components": "^0.21.1",
|
|
94
92
|
"vite": "^2.9.14",
|
|
95
93
|
"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>>
|