valaxy 0.0.9 → 0.1.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "valaxy",
3
- "version": "0.0.9",
3
+ "version": "0.1.0",
4
4
  "description": "📄 Vite & Vue powered static blog generator.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -82,8 +82,8 @@
82
82
  "vite-ssg-sitemap": "^0.2.0"
83
83
  },
84
84
  "scripts": {
85
- "build": "tsup",
86
- "dev": "tsup --watch",
85
+ "build": "tsup --splitting",
86
+ "dev": "tsup --watch --splitting",
87
87
  "lint": "eslint \"**/*.{vue,ts,js}\"",
88
88
  "preview": "vite preview",
89
89
  "preview-https": "serve dist",
@@ -124,6 +124,7 @@ export function ViteValaxyPlugins(
124
124
 
125
125
  // allow auto import and register components used in markdown
126
126
  include: [/\.vue$/, /\.vue\?vue/, /\.md$/],
127
+ exclude: [],
127
128
 
128
129
  // allow override
129
130
  allowOverrides: true,
package/src/node/vite.ts CHANGED
@@ -30,9 +30,10 @@ export function createViteConfig(options: ResolvedValaxyOptions, serverOptions:
30
30
  server: {
31
31
  fs: {
32
32
  allow: [
33
- searchForWorkspaceRoot(options.clientRoot),
33
+ // not need to search workspace root
34
+ options.clientRoot,
35
+ options.themeRoot,
34
36
  searchForWorkspaceRoot(options.userRoot),
35
- searchForWorkspaceRoot(options.themeRoot),
36
37
  ],
37
38
  },
38
39
  },
package/tsup.config.ts CHANGED
@@ -5,10 +5,10 @@ export default defineConfig((options) => {
5
5
  entry: [
6
6
  'src/node/index.ts',
7
7
  'src/node/cli.ts',
8
- 'src/index.ts',
9
8
  ],
10
- // splitting: true,
11
- splitting: false,
9
+ // https://tsup.egoist.sh/#code-splitting
10
+ // Code splitting currently only works with the esm output format, and it's enabled by default. If you want code splitting for cjs output format as well, try using --splitting flag which is an experimental feature to get rid of the limitation in esbuild.
11
+ splitting: true,
12
12
  clean: true,
13
13
  dts: true,
14
14
  format: ['cjs', 'esm'],
@@ -1,174 +0,0 @@
1
- import { PartialDeep } from 'type-fest';
2
- import { VitePluginConfig } from 'unocss/vite';
3
- import MarkdownIt from 'markdown-it';
4
- import Anchor from 'markdown-it-anchor';
5
- import { KatexOptions } from 'katex';
6
- import Markdown from 'vite-plugin-md';
7
-
8
- interface MarkdownOptions extends MarkdownIt.Options {
9
- config?: (md: MarkdownIt) => void;
10
- anchor?: {
11
- permalink?: Anchor.AnchorOptions['permalink'];
12
- };
13
- toc?: any;
14
- katex?: KatexOptions;
15
- }
16
-
17
- declare type ViteMdOptions = Parameters<typeof Markdown>[0];
18
-
19
- declare type ValaxyThemeConfig = Record<string, any>;
20
- interface SocialLink {
21
- /**
22
- * The title of your link
23
- */
24
- name: string;
25
- link: string;
26
- /**
27
- * 图标名称
28
- * https://icones.js.org/
29
- */
30
- icon: string;
31
- color: string;
32
- }
33
- interface ValaxyConfig<T = ValaxyThemeConfig> {
34
- /**
35
- * Default language
36
- * @description 默认语言
37
- * @default 'en'
38
- */
39
- lang: string;
40
- /**
41
- * You site url in web, required for ssg, do not add / in end
42
- * @description 站点的 URL,SSG 需要(譬如生成版权处文章永久链接),不要在末尾添加 /
43
- */
44
- url: string;
45
- /**
46
- * Site title
47
- * @description 站点标题
48
- */
49
- title: string;
50
- /**
51
- * 副标题
52
- */
53
- subtitle: string;
54
- /**
55
- * 站点描述
56
- */
57
- description: string;
58
- /**
59
- * The owner of this blog
60
- * @description 博客作者
61
- */
62
- author: {
63
- /**
64
- * Your name
65
- * @description 你的名字
66
- */
67
- name: string;
68
- avatar: string;
69
- /**
70
- * The status of you
71
- * @description 状态
72
- */
73
- status: {
74
- emoji: string;
75
- /**
76
- * show when hover emoji
77
- * @description 当鼠标悬浮在图标上时显示
78
- */
79
- message: string;
80
- };
81
- };
82
- /**
83
- * 社交链接
84
- */
85
- social: SocialLink[];
86
- /**
87
- * search
88
- */
89
- search: {
90
- algolia: {
91
- enable: boolean;
92
- appId: string;
93
- apiKey: string;
94
- indexName: string;
95
- chunkSize: number;
96
- };
97
- };
98
- /**
99
- * comment: waline/...
100
- */
101
- comment: {
102
- waline: {
103
- enable: boolean;
104
- serverURL: string;
105
- };
106
- };
107
- /**
108
- * The name of theme
109
- * @description 主题名称
110
- */
111
- theme: string;
112
- /**
113
- * The config of theme
114
- * @description 主题配置
115
- */
116
- themeConfig: T;
117
- /**
118
- * Unocss Config
119
- */
120
- unocss: VitePluginConfig;
121
- /**
122
- * The license of your posts
123
- * @description 文章所使用的协议,默认使用 Creative Commons
124
- * @default https://creativecommons.org/licenses/
125
- */
126
- license: {
127
- /**
128
- * Whether to show at the bottom of the article
129
- * @description 是否显示在文章底部
130
- * @default true
131
- */
132
- enabled: boolean;
133
- /**
134
- * Creative License Language, same with your config.lang
135
- * when lang === 'zh-CN', use 'zh'
136
- * @description 默认与站点语言相同
137
- * @default 'en'
138
- */
139
- language: string;
140
- /**
141
- * Type of license
142
- * @description 证书类型
143
- * @default 'by-nc-sa'
144
- */
145
- type: 'zero' | 'by-sa' | 'by-nd' | 'by-nc' | 'by-nc-sa' | 'by-nc-nd';
146
- };
147
- /**
148
- * donate for author
149
- * @description 打赏/赞助
150
- */
151
- sponsor: {
152
- enable: boolean;
153
- title: string;
154
- methods: {
155
- name: string;
156
- url: string;
157
- color: string;
158
- icon: string;
159
- }[];
160
- };
161
- /**
162
- * for markdown
163
- */
164
- markdown: ViteMdOptions;
165
- markdownIt: MarkdownOptions;
166
- }
167
- /**
168
- * Valaxy User Config
169
- * @description Valaxy 用户配置
170
- */
171
- declare type UserConfig<T = ValaxyThemeConfig> = PartialDeep<ValaxyConfig<T>>;
172
- declare const defaultValaxyConfig: ValaxyConfig;
173
-
174
- export { SocialLink as S, UserConfig as U, ValaxyConfig as V, ValaxyThemeConfig as a, defaultValaxyConfig as d };