@meng-xi/vite-plugin 0.1.0 → 0.1.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/README-en.md +264 -533
- package/README.md +253 -522
- package/dist/common/format/index.cjs +1 -0
- package/dist/common/format/index.d.cts +156 -0
- package/dist/common/format/index.d.mts +156 -0
- package/dist/common/format/index.d.ts +156 -0
- package/dist/common/format/index.mjs +1 -0
- package/dist/common/fs/index.cjs +1 -0
- package/dist/common/fs/index.d.cts +150 -0
- package/dist/common/fs/index.d.mts +150 -0
- package/dist/common/fs/index.d.ts +150 -0
- package/dist/common/fs/index.mjs +1 -0
- package/dist/common/html/index.cjs +2 -0
- package/dist/common/html/index.d.cts +109 -0
- package/dist/common/html/index.d.mts +109 -0
- package/dist/common/html/index.d.ts +109 -0
- package/dist/common/html/index.mjs +2 -0
- package/dist/common/index.cjs +1 -1
- package/dist/common/index.d.cts +7 -417
- package/dist/common/index.d.mts +7 -417
- package/dist/common/index.d.ts +7 -417
- package/dist/common/index.mjs +1 -1
- package/dist/common/object/index.cjs +1 -0
- package/dist/common/object/index.d.cts +30 -0
- package/dist/common/object/index.d.mts +30 -0
- package/dist/common/object/index.d.ts +30 -0
- package/dist/common/object/index.mjs +1 -0
- package/dist/common/script/index.cjs +1 -0
- package/dist/common/script/index.d.cts +54 -0
- package/dist/common/script/index.d.mts +54 -0
- package/dist/common/script/index.d.ts +54 -0
- package/dist/common/script/index.mjs +1 -0
- package/dist/common/validation/index.cjs +1 -0
- package/dist/common/validation/index.d.cts +93 -0
- package/dist/common/validation/index.d.mts +93 -0
- package/dist/common/validation/index.d.ts +93 -0
- package/dist/common/validation/index.mjs +1 -0
- package/dist/factory/index.cjs +1 -1
- package/dist/factory/index.d.cts +1 -1
- package/dist/factory/index.d.mts +1 -1
- package/dist/factory/index.d.ts +1 -1
- package/dist/factory/index.mjs +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +16 -3
- package/dist/index.d.mts +16 -3
- package/dist/index.d.ts +16 -3
- package/dist/index.mjs +1 -1
- package/dist/plugins/buildProgress/index.cjs +2 -0
- package/dist/plugins/buildProgress/index.d.cts +187 -0
- package/dist/plugins/buildProgress/index.d.mts +187 -0
- package/dist/plugins/buildProgress/index.d.ts +187 -0
- package/dist/plugins/buildProgress/index.mjs +2 -0
- package/dist/plugins/compressAssets/index.cjs +1 -0
- package/dist/plugins/compressAssets/index.d.cts +132 -0
- package/dist/plugins/compressAssets/index.d.mts +132 -0
- package/dist/plugins/compressAssets/index.d.ts +132 -0
- package/dist/plugins/compressAssets/index.mjs +1 -0
- package/dist/plugins/copyFile/index.cjs +1 -0
- package/dist/plugins/copyFile/index.d.cts +78 -0
- package/dist/plugins/copyFile/index.d.mts +78 -0
- package/dist/plugins/copyFile/index.d.ts +78 -0
- package/dist/plugins/copyFile/index.mjs +1 -0
- package/dist/plugins/faviconManager/index.cjs +1 -0
- package/dist/plugins/faviconManager/index.d.cts +143 -0
- package/dist/plugins/faviconManager/index.d.mts +143 -0
- package/dist/plugins/faviconManager/index.d.ts +143 -0
- package/dist/plugins/faviconManager/index.mjs +1 -0
- package/dist/plugins/generateRouter/index.cjs +35 -0
- package/dist/plugins/generateRouter/index.d.cts +215 -0
- package/dist/plugins/generateRouter/index.d.mts +215 -0
- package/dist/plugins/generateRouter/index.d.ts +215 -0
- package/dist/plugins/generateRouter/index.mjs +35 -0
- package/dist/plugins/generateVersion/index.cjs +1 -0
- package/dist/plugins/generateVersion/index.d.cts +184 -0
- package/dist/plugins/generateVersion/index.d.mts +184 -0
- package/dist/plugins/generateVersion/index.d.ts +184 -0
- package/dist/plugins/generateVersion/index.mjs +1 -0
- package/dist/plugins/htmlInject/index.cjs +7 -0
- package/dist/plugins/htmlInject/index.d.cts +278 -0
- package/dist/plugins/htmlInject/index.d.mts +278 -0
- package/dist/plugins/htmlInject/index.d.ts +278 -0
- package/dist/plugins/htmlInject/index.mjs +7 -0
- package/dist/plugins/index.cjs +1 -1
- package/dist/plugins/index.d.cts +11 -1714
- package/dist/plugins/index.d.mts +11 -1714
- package/dist/plugins/index.d.ts +11 -1714
- package/dist/plugins/index.mjs +1 -1
- package/dist/plugins/loadingManager/index.cjs +487 -0
- package/dist/plugins/loadingManager/index.d.cts +769 -0
- package/dist/plugins/loadingManager/index.d.mts +769 -0
- package/dist/plugins/loadingManager/index.d.ts +769 -0
- package/dist/plugins/loadingManager/index.mjs +487 -0
- package/dist/plugins/versionUpdateChecker/index.cjs +185 -0
- package/dist/plugins/versionUpdateChecker/index.d.cts +200 -0
- package/dist/plugins/versionUpdateChecker/index.d.mts +200 -0
- package/dist/plugins/versionUpdateChecker/index.d.ts +200 -0
- package/dist/plugins/versionUpdateChecker/index.mjs +185 -0
- package/dist/shared/vite-plugin.Bcg6RW2N.cjs +3 -0
- package/dist/shared/{vite-plugin.CiHfwMiN.d.ts → vite-plugin.DRRlWY8P.d.cts} +50 -0
- package/dist/shared/{vite-plugin.CiHfwMiN.d.cts → vite-plugin.DRRlWY8P.d.mts} +50 -0
- package/dist/shared/{vite-plugin.CiHfwMiN.d.mts → vite-plugin.DRRlWY8P.d.ts} +50 -0
- package/dist/shared/{vite-plugin.B88RyRN8.mjs → vite-plugin.DcExl6jd.mjs} +2 -2
- package/package.json +80 -3
- package/dist/shared/vite-plugin.CawoITTT.cjs +0 -1
- package/dist/shared/vite-plugin.D6Law9Ke.mjs +0 -706
- package/dist/shared/vite-plugin.D8L9KzuW.cjs +0 -706
- package/dist/shared/vite-plugin.DFjf9wFM.mjs +0 -2
- package/dist/shared/vite-plugin.DSb6XzBn.mjs +0 -1
- package/dist/shared/vite-plugin.IGZeStMa.cjs +0 -3
- package/dist/shared/vite-plugin.Tab4qcIM.cjs +0 -2
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
import { BasePluginOptions, PluginFactory } from '../../factory/index.mjs';
|
|
2
|
+
import 'vite';
|
|
3
|
+
import '../../shared/vite-plugin.CLr0ttuO.mjs';
|
|
4
|
+
import '../../shared/vite-plugin.DRRlWY8P.mjs';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* 路由元信息
|
|
8
|
+
*/
|
|
9
|
+
interface RouteMeta {
|
|
10
|
+
/** 页面标题 */
|
|
11
|
+
title?: string;
|
|
12
|
+
/** 是否为TabBar页面 */
|
|
13
|
+
isTab?: boolean;
|
|
14
|
+
/** 是否需要登录 */
|
|
15
|
+
requireAuth?: boolean;
|
|
16
|
+
/** 自定义扩展字段 */
|
|
17
|
+
[key: string]: unknown;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* 路由配置项
|
|
21
|
+
*/
|
|
22
|
+
interface RouteConfig {
|
|
23
|
+
/** 路由路径 */
|
|
24
|
+
path: string;
|
|
25
|
+
/** 路由名称(用于命名路由导航) */
|
|
26
|
+
name?: string;
|
|
27
|
+
/** 路由元信息 */
|
|
28
|
+
meta?: RouteMeta;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* uni-app pages.json 中的页面配置项
|
|
32
|
+
*/
|
|
33
|
+
interface UniAppPageConfig {
|
|
34
|
+
/** 页面路径 */
|
|
35
|
+
path: string;
|
|
36
|
+
/** 页面样式 */
|
|
37
|
+
style?: {
|
|
38
|
+
/** 导航栏标题 */
|
|
39
|
+
navigationBarTitleText?: string;
|
|
40
|
+
/** 是否需要登录 */
|
|
41
|
+
requireAuth?: boolean;
|
|
42
|
+
/** 其他自定义属性 */
|
|
43
|
+
[key: string]: unknown;
|
|
44
|
+
};
|
|
45
|
+
/** 其他属性 */
|
|
46
|
+
[key: string]: unknown;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* uni-app pages.json 中的 tabBar 配置
|
|
50
|
+
*/
|
|
51
|
+
interface UniAppTabBarConfig {
|
|
52
|
+
/** tabBar 列表 */
|
|
53
|
+
list?: Array<{
|
|
54
|
+
/** 页面路径 */
|
|
55
|
+
pagePath: string;
|
|
56
|
+
/** 文字 */
|
|
57
|
+
text?: string;
|
|
58
|
+
/** 图标路径 */
|
|
59
|
+
iconPath?: string;
|
|
60
|
+
/** 选中图标路径 */
|
|
61
|
+
selectedIconPath?: string;
|
|
62
|
+
}>;
|
|
63
|
+
/** 其他属性 */
|
|
64
|
+
[key: string]: unknown;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* uni-app pages.json 结构
|
|
68
|
+
*/
|
|
69
|
+
interface UniAppPagesJson {
|
|
70
|
+
/** 页面列表 */
|
|
71
|
+
pages: UniAppPageConfig[];
|
|
72
|
+
/** 子包 */
|
|
73
|
+
subPackages?: Array<{
|
|
74
|
+
root: string;
|
|
75
|
+
pages: UniAppPageConfig[];
|
|
76
|
+
}>;
|
|
77
|
+
/** tabBar 配置 */
|
|
78
|
+
tabBar?: UniAppTabBarConfig;
|
|
79
|
+
/** 全局样式 */
|
|
80
|
+
globalStyle?: Record<string, unknown>;
|
|
81
|
+
/** 其他属性 */
|
|
82
|
+
[key: string]: unknown;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* 输出文件格式类型
|
|
86
|
+
*/
|
|
87
|
+
type OutputFormat = 'ts' | 'js';
|
|
88
|
+
/**
|
|
89
|
+
* 路由名称生成策略
|
|
90
|
+
*/
|
|
91
|
+
type NameStrategy = 'path' | 'camelCase' | 'pascalCase' | 'custom';
|
|
92
|
+
/**
|
|
93
|
+
* 生成路由配置插件选项
|
|
94
|
+
*/
|
|
95
|
+
interface GenerateRouterOptions extends BasePluginOptions {
|
|
96
|
+
/**
|
|
97
|
+
* pages.json 文件路径(相对于项目根目录)
|
|
98
|
+
*
|
|
99
|
+
* @default 'src/pages.json'
|
|
100
|
+
*/
|
|
101
|
+
pagesJsonPath?: string;
|
|
102
|
+
/**
|
|
103
|
+
* 输出文件路径(相对于项目根目录)
|
|
104
|
+
*
|
|
105
|
+
* @default 'src/router.config.ts'
|
|
106
|
+
*/
|
|
107
|
+
outputPath?: string;
|
|
108
|
+
/**
|
|
109
|
+
* 输出文件格式
|
|
110
|
+
*
|
|
111
|
+
* @default 'ts'
|
|
112
|
+
*/
|
|
113
|
+
outputFormat?: OutputFormat;
|
|
114
|
+
/**
|
|
115
|
+
* 路由名称生成策略
|
|
116
|
+
*
|
|
117
|
+
* @default 'camelCase'
|
|
118
|
+
*/
|
|
119
|
+
nameStrategy?: NameStrategy;
|
|
120
|
+
/**
|
|
121
|
+
* 自定义路由名称生成函数
|
|
122
|
+
*
|
|
123
|
+
* @param path - 页面路径
|
|
124
|
+
* @returns 路由名称
|
|
125
|
+
*/
|
|
126
|
+
customNameGenerator?: (path: string) => string;
|
|
127
|
+
/**
|
|
128
|
+
* 是否包含子包路由
|
|
129
|
+
*
|
|
130
|
+
* @default true
|
|
131
|
+
*/
|
|
132
|
+
includeSubPackages?: boolean;
|
|
133
|
+
/**
|
|
134
|
+
* 是否监听 pages.json 变化并自动重新生成
|
|
135
|
+
*
|
|
136
|
+
* @default true
|
|
137
|
+
*/
|
|
138
|
+
watch?: boolean;
|
|
139
|
+
/**
|
|
140
|
+
* 额外的元信息字段映射
|
|
141
|
+
*
|
|
142
|
+
* @description 将 pages.json 中 style 的字段映射到 meta 中
|
|
143
|
+
* @example { 'navigationBarTitleText': 'title', 'requireAuth': 'requireAuth' }
|
|
144
|
+
*/
|
|
145
|
+
metaMapping?: Record<string, string>;
|
|
146
|
+
/**
|
|
147
|
+
* 是否导出类型定义
|
|
148
|
+
*
|
|
149
|
+
* @default true
|
|
150
|
+
*/
|
|
151
|
+
exportTypes?: boolean;
|
|
152
|
+
/**
|
|
153
|
+
* 是否保留用户对 routes 配置的修改
|
|
154
|
+
*
|
|
155
|
+
* @description 开启后,用户在 routes 数组中修改的字段将被保留
|
|
156
|
+
* @default true
|
|
157
|
+
*/
|
|
158
|
+
preserveRouteChanges?: boolean;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* 生成路由配置插件
|
|
163
|
+
*
|
|
164
|
+
* @param {GenerateRouterOptions} options - 插件配置选项
|
|
165
|
+
* @returns {Plugin} 一个 Vite 插件实例
|
|
166
|
+
*
|
|
167
|
+
* @example
|
|
168
|
+
* ```typescript
|
|
169
|
+
* // 基本使用 - 使用默认配置
|
|
170
|
+
* generateRouter()
|
|
171
|
+
*
|
|
172
|
+
* // 自定义 pages.json 路径
|
|
173
|
+
* generateRouter({
|
|
174
|
+
* pagesJsonPath: 'pages.json'
|
|
175
|
+
* })
|
|
176
|
+
*
|
|
177
|
+
* // 输出 JavaScript 文件
|
|
178
|
+
* generateRouter({
|
|
179
|
+
* outputFormat: 'js',
|
|
180
|
+
* outputPath: 'src/router.config.js'
|
|
181
|
+
* })
|
|
182
|
+
*
|
|
183
|
+
* // 使用帕斯卡命名策略
|
|
184
|
+
* generateRouter({
|
|
185
|
+
* nameStrategy: 'pascalCase'
|
|
186
|
+
* })
|
|
187
|
+
*
|
|
188
|
+
* // 自定义路由名称生成
|
|
189
|
+
* generateRouter({
|
|
190
|
+
* nameStrategy: 'custom',
|
|
191
|
+
* customNameGenerator: (path) => `route_${path.replace(/\//g, '_')}`
|
|
192
|
+
* })
|
|
193
|
+
*
|
|
194
|
+
* // 自定义元信息映射
|
|
195
|
+
* generateRouter({
|
|
196
|
+
* metaMapping: {
|
|
197
|
+
* navigationBarTitleText: 'title',
|
|
198
|
+
* requireAuth: 'requireAuth',
|
|
199
|
+
* customField: 'custom'
|
|
200
|
+
* }
|
|
201
|
+
* })
|
|
202
|
+
* ```
|
|
203
|
+
*
|
|
204
|
+
* @remarks
|
|
205
|
+
* 该插件会读取 uni-app 项目的 pages.json 文件,自动生成路由配置文件:
|
|
206
|
+
* - 支持主包和子包页面
|
|
207
|
+
* - 自动识别 tabBar 页面
|
|
208
|
+
* - 支持多种路由名称生成策略
|
|
209
|
+
* - 支持自定义元信息字段映射
|
|
210
|
+
* - 开发模式下自动监听 pages.json 变化并重新生成
|
|
211
|
+
*/
|
|
212
|
+
declare const generateRouter: PluginFactory<GenerateRouterOptions, GenerateRouterOptions>;
|
|
213
|
+
|
|
214
|
+
export { generateRouter };
|
|
215
|
+
export type { GenerateRouterOptions, NameStrategy, OutputFormat, RouteConfig, RouteMeta, UniAppPageConfig, UniAppPagesJson, UniAppTabBarConfig };
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
import { BasePluginOptions, PluginFactory } from '../../factory/index.js';
|
|
2
|
+
import 'vite';
|
|
3
|
+
import '../../shared/vite-plugin.CLr0ttuO.js';
|
|
4
|
+
import '../../shared/vite-plugin.DRRlWY8P.js';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* 路由元信息
|
|
8
|
+
*/
|
|
9
|
+
interface RouteMeta {
|
|
10
|
+
/** 页面标题 */
|
|
11
|
+
title?: string;
|
|
12
|
+
/** 是否为TabBar页面 */
|
|
13
|
+
isTab?: boolean;
|
|
14
|
+
/** 是否需要登录 */
|
|
15
|
+
requireAuth?: boolean;
|
|
16
|
+
/** 自定义扩展字段 */
|
|
17
|
+
[key: string]: unknown;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* 路由配置项
|
|
21
|
+
*/
|
|
22
|
+
interface RouteConfig {
|
|
23
|
+
/** 路由路径 */
|
|
24
|
+
path: string;
|
|
25
|
+
/** 路由名称(用于命名路由导航) */
|
|
26
|
+
name?: string;
|
|
27
|
+
/** 路由元信息 */
|
|
28
|
+
meta?: RouteMeta;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* uni-app pages.json 中的页面配置项
|
|
32
|
+
*/
|
|
33
|
+
interface UniAppPageConfig {
|
|
34
|
+
/** 页面路径 */
|
|
35
|
+
path: string;
|
|
36
|
+
/** 页面样式 */
|
|
37
|
+
style?: {
|
|
38
|
+
/** 导航栏标题 */
|
|
39
|
+
navigationBarTitleText?: string;
|
|
40
|
+
/** 是否需要登录 */
|
|
41
|
+
requireAuth?: boolean;
|
|
42
|
+
/** 其他自定义属性 */
|
|
43
|
+
[key: string]: unknown;
|
|
44
|
+
};
|
|
45
|
+
/** 其他属性 */
|
|
46
|
+
[key: string]: unknown;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* uni-app pages.json 中的 tabBar 配置
|
|
50
|
+
*/
|
|
51
|
+
interface UniAppTabBarConfig {
|
|
52
|
+
/** tabBar 列表 */
|
|
53
|
+
list?: Array<{
|
|
54
|
+
/** 页面路径 */
|
|
55
|
+
pagePath: string;
|
|
56
|
+
/** 文字 */
|
|
57
|
+
text?: string;
|
|
58
|
+
/** 图标路径 */
|
|
59
|
+
iconPath?: string;
|
|
60
|
+
/** 选中图标路径 */
|
|
61
|
+
selectedIconPath?: string;
|
|
62
|
+
}>;
|
|
63
|
+
/** 其他属性 */
|
|
64
|
+
[key: string]: unknown;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* uni-app pages.json 结构
|
|
68
|
+
*/
|
|
69
|
+
interface UniAppPagesJson {
|
|
70
|
+
/** 页面列表 */
|
|
71
|
+
pages: UniAppPageConfig[];
|
|
72
|
+
/** 子包 */
|
|
73
|
+
subPackages?: Array<{
|
|
74
|
+
root: string;
|
|
75
|
+
pages: UniAppPageConfig[];
|
|
76
|
+
}>;
|
|
77
|
+
/** tabBar 配置 */
|
|
78
|
+
tabBar?: UniAppTabBarConfig;
|
|
79
|
+
/** 全局样式 */
|
|
80
|
+
globalStyle?: Record<string, unknown>;
|
|
81
|
+
/** 其他属性 */
|
|
82
|
+
[key: string]: unknown;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* 输出文件格式类型
|
|
86
|
+
*/
|
|
87
|
+
type OutputFormat = 'ts' | 'js';
|
|
88
|
+
/**
|
|
89
|
+
* 路由名称生成策略
|
|
90
|
+
*/
|
|
91
|
+
type NameStrategy = 'path' | 'camelCase' | 'pascalCase' | 'custom';
|
|
92
|
+
/**
|
|
93
|
+
* 生成路由配置插件选项
|
|
94
|
+
*/
|
|
95
|
+
interface GenerateRouterOptions extends BasePluginOptions {
|
|
96
|
+
/**
|
|
97
|
+
* pages.json 文件路径(相对于项目根目录)
|
|
98
|
+
*
|
|
99
|
+
* @default 'src/pages.json'
|
|
100
|
+
*/
|
|
101
|
+
pagesJsonPath?: string;
|
|
102
|
+
/**
|
|
103
|
+
* 输出文件路径(相对于项目根目录)
|
|
104
|
+
*
|
|
105
|
+
* @default 'src/router.config.ts'
|
|
106
|
+
*/
|
|
107
|
+
outputPath?: string;
|
|
108
|
+
/**
|
|
109
|
+
* 输出文件格式
|
|
110
|
+
*
|
|
111
|
+
* @default 'ts'
|
|
112
|
+
*/
|
|
113
|
+
outputFormat?: OutputFormat;
|
|
114
|
+
/**
|
|
115
|
+
* 路由名称生成策略
|
|
116
|
+
*
|
|
117
|
+
* @default 'camelCase'
|
|
118
|
+
*/
|
|
119
|
+
nameStrategy?: NameStrategy;
|
|
120
|
+
/**
|
|
121
|
+
* 自定义路由名称生成函数
|
|
122
|
+
*
|
|
123
|
+
* @param path - 页面路径
|
|
124
|
+
* @returns 路由名称
|
|
125
|
+
*/
|
|
126
|
+
customNameGenerator?: (path: string) => string;
|
|
127
|
+
/**
|
|
128
|
+
* 是否包含子包路由
|
|
129
|
+
*
|
|
130
|
+
* @default true
|
|
131
|
+
*/
|
|
132
|
+
includeSubPackages?: boolean;
|
|
133
|
+
/**
|
|
134
|
+
* 是否监听 pages.json 变化并自动重新生成
|
|
135
|
+
*
|
|
136
|
+
* @default true
|
|
137
|
+
*/
|
|
138
|
+
watch?: boolean;
|
|
139
|
+
/**
|
|
140
|
+
* 额外的元信息字段映射
|
|
141
|
+
*
|
|
142
|
+
* @description 将 pages.json 中 style 的字段映射到 meta 中
|
|
143
|
+
* @example { 'navigationBarTitleText': 'title', 'requireAuth': 'requireAuth' }
|
|
144
|
+
*/
|
|
145
|
+
metaMapping?: Record<string, string>;
|
|
146
|
+
/**
|
|
147
|
+
* 是否导出类型定义
|
|
148
|
+
*
|
|
149
|
+
* @default true
|
|
150
|
+
*/
|
|
151
|
+
exportTypes?: boolean;
|
|
152
|
+
/**
|
|
153
|
+
* 是否保留用户对 routes 配置的修改
|
|
154
|
+
*
|
|
155
|
+
* @description 开启后,用户在 routes 数组中修改的字段将被保留
|
|
156
|
+
* @default true
|
|
157
|
+
*/
|
|
158
|
+
preserveRouteChanges?: boolean;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* 生成路由配置插件
|
|
163
|
+
*
|
|
164
|
+
* @param {GenerateRouterOptions} options - 插件配置选项
|
|
165
|
+
* @returns {Plugin} 一个 Vite 插件实例
|
|
166
|
+
*
|
|
167
|
+
* @example
|
|
168
|
+
* ```typescript
|
|
169
|
+
* // 基本使用 - 使用默认配置
|
|
170
|
+
* generateRouter()
|
|
171
|
+
*
|
|
172
|
+
* // 自定义 pages.json 路径
|
|
173
|
+
* generateRouter({
|
|
174
|
+
* pagesJsonPath: 'pages.json'
|
|
175
|
+
* })
|
|
176
|
+
*
|
|
177
|
+
* // 输出 JavaScript 文件
|
|
178
|
+
* generateRouter({
|
|
179
|
+
* outputFormat: 'js',
|
|
180
|
+
* outputPath: 'src/router.config.js'
|
|
181
|
+
* })
|
|
182
|
+
*
|
|
183
|
+
* // 使用帕斯卡命名策略
|
|
184
|
+
* generateRouter({
|
|
185
|
+
* nameStrategy: 'pascalCase'
|
|
186
|
+
* })
|
|
187
|
+
*
|
|
188
|
+
* // 自定义路由名称生成
|
|
189
|
+
* generateRouter({
|
|
190
|
+
* nameStrategy: 'custom',
|
|
191
|
+
* customNameGenerator: (path) => `route_${path.replace(/\//g, '_')}`
|
|
192
|
+
* })
|
|
193
|
+
*
|
|
194
|
+
* // 自定义元信息映射
|
|
195
|
+
* generateRouter({
|
|
196
|
+
* metaMapping: {
|
|
197
|
+
* navigationBarTitleText: 'title',
|
|
198
|
+
* requireAuth: 'requireAuth',
|
|
199
|
+
* customField: 'custom'
|
|
200
|
+
* }
|
|
201
|
+
* })
|
|
202
|
+
* ```
|
|
203
|
+
*
|
|
204
|
+
* @remarks
|
|
205
|
+
* 该插件会读取 uni-app 项目的 pages.json 文件,自动生成路由配置文件:
|
|
206
|
+
* - 支持主包和子包页面
|
|
207
|
+
* - 自动识别 tabBar 页面
|
|
208
|
+
* - 支持多种路由名称生成策略
|
|
209
|
+
* - 支持自定义元信息字段映射
|
|
210
|
+
* - 开发模式下自动监听 pages.json 变化并重新生成
|
|
211
|
+
*/
|
|
212
|
+
declare const generateRouter: PluginFactory<GenerateRouterOptions, GenerateRouterOptions>;
|
|
213
|
+
|
|
214
|
+
export { generateRouter };
|
|
215
|
+
export type { GenerateRouterOptions, NameStrategy, OutputFormat, RouteConfig, RouteMeta, UniAppPageConfig, UniAppPagesJson, UniAppTabBarConfig };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import{createPluginFactory as p,BasePlugin as h}from"../../factory/index.mjs";import{readFileContent as i,writeFileContent as l}from"../../common/fs/index.mjs";import{toCamelCase as g,toPascalCase as F,stripJsonComments as m}from"../../common/format/index.mjs";import{resolve as r}from"path";import{existsSync as n,watch as f}from"fs";import"../../logger/index.mjs";import"../../common/object/index.mjs";import"../../shared/vite-plugin.DcExl6jd.mjs";import"crypto";class E extends h{projectRoot=process.cwd();tabBarPages=new Set;watcher=null;getDefaultOptions(){return{pagesJsonPath:"src/pages.json",outputPath:"src/router.config.ts",outputFormat:"ts",nameStrategy:"camelCase",includeSubPackages:!0,watch:!0,exportTypes:!0,preserveRouteChanges:!0,metaMapping:{navigationBarTitleText:"title",requireAuth:"requireAuth"}}}validateOptions(){if(this.validator.field("pagesJsonPath").string().field("outputPath").string().field("outputFormat").enum(["ts","js"]).field("nameStrategy").enum(["path","camelCase","pascalCase","custom"]).validate(),this.options.nameStrategy==="custom"&&!this.options.customNameGenerator)throw new Error("\u5F53 nameStrategy \u4E3A custom \u65F6\uFF0C\u5FC5\u987B\u63D0\u4F9B customNameGenerator")}getPluginName(){return"generate-router"}generateRouteName(t){switch(this.options.nameStrategy){case"path":return t.replace(/\//g,"_").replace(/^_/,"");case"camelCase":return g(t);case"pascalCase":return F(t);case"custom":return this.options.customNameGenerator(t);default:return g(t)}}extractMeta(t,u){const e={},s=t.style||{},a=this.options.metaMapping||{};for(const[o,c]of Object.entries(a))s[o]!==void 0&&(e[c]=s[o]);return this.tabBarPages.has(u)&&(e.isTab=!0),e}parsePageToRoute(t,u=""){const e=u?`/${u}/${t.path}`:`/${t.path}`,s=this.generateRouteName(e),a=this.extractMeta(t,e.replace(/^\//,"")),o={path:e,name:s};return Object.keys(a).length>0&&(o.meta=a),o}parsePagesJson(t){const u=[];if(!t.pages||!Array.isArray(t.pages)||t.pages.length===0)return this.logger.warn("pages.json \u4E2D\u6CA1\u6709\u6709\u6548\u7684\u9875\u9762\u914D\u7F6E"),u;if(this.tabBarPages.clear(),t.tabBar?.list)for(const e of t.tabBar.list)this.tabBarPages.add(e.pagePath);for(const e of t.pages)u.push(this.parsePageToRoute(e));if(this.options.includeSubPackages&&t.subPackages){for(const e of t.subPackages)if(e.pages&&Array.isArray(e.pages))for(const s of e.pages)u.push(this.parsePageToRoute(s,e.root))}return u}generateTypeDefinitions(){return!this.options.exportTypes||this.options.outputFormat==="js"?"":`
|
|
2
|
+
/**
|
|
3
|
+
* \u8DEF\u7531\u5143\u4FE1\u606F
|
|
4
|
+
*/
|
|
5
|
+
export interface RouteMeta {
|
|
6
|
+
/** \u9875\u9762\u6807\u9898 */
|
|
7
|
+
title?: string
|
|
8
|
+
/** \u662F\u5426\u4E3ATabBar\u9875\u9762 */
|
|
9
|
+
isTab?: boolean
|
|
10
|
+
/** \u662F\u5426\u9700\u8981\u767B\u5F55 */
|
|
11
|
+
requireAuth?: boolean
|
|
12
|
+
/** \u81EA\u5B9A\u4E49\u6269\u5C55\u5B57\u6BB5 */
|
|
13
|
+
[key: string]: unknown
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* \u8DEF\u7531\u914D\u7F6E\u9879
|
|
18
|
+
*/
|
|
19
|
+
export interface RouteConfig {
|
|
20
|
+
/** \u8DEF\u7531\u8DEF\u5F84 */
|
|
21
|
+
path: string
|
|
22
|
+
/** \u8DEF\u7531\u540D\u79F0\uFF08\u7528\u4E8E\u547D\u540D\u8DEF\u7531\u5BFC\u822A\uFF09 */
|
|
23
|
+
name?: string
|
|
24
|
+
/** \u8DEF\u7531\u5143\u4FE1\u606F */
|
|
25
|
+
meta?: RouteMeta
|
|
26
|
+
}
|
|
27
|
+
`}generateFileContent(t){const u=this.generateTypeDefinitions(),e=this.options.outputFormat==="ts",s=JSON.stringify(t,null," ").replace(/"(\w+)":/g,"$1:").replace(/: "([^"]+)"/g,": '$1'");return`${u}
|
|
28
|
+
/**
|
|
29
|
+
* \u8DEF\u7531\u914D\u7F6E\u5217\u8868
|
|
30
|
+
* @description \u7531 pages.json \u81EA\u52A8\u751F\u6210
|
|
31
|
+
*/
|
|
32
|
+
export const routes${e?": RouteConfig[]":""} = ${s}
|
|
33
|
+
|
|
34
|
+
export default routes
|
|
35
|
+
`}async readPagesJson(){const t=r(this.projectRoot,this.options.pagesJsonPath);if(!n(t))return this.logger.warn(`pages.json \u6587\u4EF6\u4E0D\u5B58\u5728: ${t}`),null;try{const u=await i(t),e=m(u);return JSON.parse(e)}catch(u){return this.logger.error(`\u89E3\u6790 pages.json \u5931\u8D25: ${u.message}`),null}}extractExistingRoutes(t){const u=new Map,e=t.match(/export const routes[^=]*=\s*(\[[\s\S]*?\](?=\s*\n|\s*$|\s*\/\/))/);if(!e)return u;try{let s=e[1].replace(/(\w+)(?=\s*:)/g,'"$1"').replace(/'([^']*)'/g,'"$1"').replace(/,\s*([\]\}])/g,"$1");const a=JSON.parse(s);for(const o of a)o.path&&u.set(o.path,o)}catch{this.logger.warn("\u89E3\u6790\u73B0\u6709 routes \u914D\u7F6E\u5931\u8D25\uFF0C\u5C06\u5B8C\u5168\u91CD\u65B0\u751F\u6210")}return u}mergeRoutes(t,u){return t.map(e=>{const s=u.get(e.path);if(!s)return e;const a={};return e.meta&&Object.assign(a,e.meta),s.meta&&Object.assign(a,s.meta),{...s,path:e.path,meta:Object.keys(a).length>0?a:void 0}})}async generateRouterConfig(){const t=await this.readPagesJson();if(!t)return;let u=this.parsePagesJson(t);const e=r(this.projectRoot,this.options.outputPath);if(this.options.preserveRouteChanges&&n(e))try{const a=await i(e),o=this.extractExistingRoutes(a);o.size>0&&(u=this.mergeRoutes(u,o),this.logger.info("\u5DF2\u5408\u5E76\u7528\u6237\u5BF9\u8DEF\u7531\u914D\u7F6E\u7684\u4FEE\u6539"))}catch{}const s=this.generateFileContent(u);await l(e,s),this.logger.success(`\u8DEF\u7531\u914D\u7F6E\u6587\u4EF6\u5DF2\u751F\u6210: ${e}`),this.logger.info(`\u5171\u751F\u6210 ${u.length} \u6761\u8DEF\u7531\u914D\u7F6E`)}startWatching(){if(!this.options.watch)return;const t=r(this.projectRoot,this.options.pagesJsonPath);n(t)&&(this.watcher=f(t,async u=>{u==="change"&&(this.logger.info("\u68C0\u6D4B\u5230 pages.json \u53D8\u5316\uFF0C\u91CD\u65B0\u751F\u6210\u8DEF\u7531\u914D\u7F6E..."),await this.safeExecute(()=>this.generateRouterConfig(),"\u91CD\u65B0\u751F\u6210\u8DEF\u7531\u914D\u7F6E"))}),this.logger.info(`\u6B63\u5728\u76D1\u542C pages.json \u53D8\u5316: ${t}`))}stopWatching(){this.watcher&&(this.watcher.close(),this.watcher=null)}addPluginHooks(t){t.configResolved=async u=>{this.projectRoot=u.root,await this.safeExecute(()=>this.generateRouterConfig(),"\u751F\u6210\u8DEF\u7531\u914D\u7F6E"),u.command==="serve"&&this.startWatching()}}destroy(){super.destroy(),this.stopWatching()}}const D=p(E);export{D as generateRouter};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const factory_index=require("../../factory/index.cjs"),common_format_index=require("../../common/format/index.cjs"),common_fs_index=require("../../common/fs/index.cjs"),u=require("path");require("../../logger/index.cjs"),require("../../common/object/index.cjs"),require("../../shared/vite-plugin.Bcg6RW2N.cjs"),require("crypto"),require("fs");class f extends factory_index.BasePlugin{version="";buildTime=new Date;getDefaultOptions(){return{format:"timestamp",semverBase:"1.0.0",outputType:"file",outputFile:"version.json",defineName:"__APP_VERSION__",hashLength:8,prefix:"",suffix:""}}validateOptions(){if(this.validator.field("format").enum(["timestamp","date","datetime","semver","hash","custom"]).field("outputType").enum(["file","define","both"]).field("hashLength").number().minValue(1).maxValue(32).validate(),this.options.format==="custom"&&!this.options.customFormat)throw new Error("\u5F53 format \u4E3A custom \u65F6\uFF0C\u5FC5\u987B\u63D0\u4F9B customFormat")}getPluginName(){return"generate-version"}generateVersion(){const e=common_format_index.getDateFormatParams(this.buildTime),t=common_format_index.generateRandomHash(this.options.hashLength);let i;switch(this.options.format){case"timestamp":i=`${e.YYYY}${e.MM}${e.DD}${e.HH}${e.mm}${e.ss}`;break;case"date":i=`${e.YYYY}.${e.MM}.${e.DD}`;break;case"datetime":i=`${e.YYYY}.${e.MM}.${e.DD}.${e.HH}${e.mm}${e.ss}`;break;case"semver":i=this.options.semverBase||"1.0.0";break;case"hash":i=t;break;case"custom":i=this.parseCustomFormat({...e,hash:t});break;default:i=e.timestamp}const s=this.options.prefix||"",o=this.options.suffix||"";return`${s}${i}${o}`}parseCustomFormat(e){const t={...e};if(this.options.semverBase){const[i,s,o]=this.options.semverBase.split(".");t.major=i||"1",t.minor=s||"0",t.patch=o||"0"}return common_format_index.parseTemplate(this.options.customFormat||"",t)}generateVersionInfo(){return{version:this.version,buildTime:this.buildTime.toISOString(),timestamp:this.buildTime.getTime(),format:this.options.format,...this.options.extra}}async writeVersionFile(e){const t=u.join(e,this.options.outputFile||"version.json"),i=this.generateVersionInfo();await common_fs_index.writeFileContent(t,JSON.stringify(i,null,2)),this.logger.success(`\u7248\u672C\u6587\u4EF6\u5DF2\u751F\u6210: ${t}`)}addPluginHooks(e){e.configResolved=()=>{this.buildTime=new Date,this.version=this.generateVersion(),this.logger.info(`\u751F\u6210\u7248\u672C\u53F7: ${this.version}`)},(this.options.outputType==="define"||this.options.outputType==="both")&&(e.config=()=>{this.version||(this.buildTime=new Date,this.version=this.generateVersion());const t=this.options.defineName||"__APP_VERSION__";return this.logger.info(`\u6CE8\u5165\u5168\u5C40\u53D8\u91CF: ${t} = "${this.version}"`),{define:{[t]:JSON.stringify(this.version),[`${t}_INFO`]:JSON.stringify(this.generateVersionInfo())}}}),(this.options.outputType==="file"||this.options.outputType==="both")&&(e.writeBundle=async()=>{this.viteConfig&&await this.safeExecute(async()=>{const t=this.viteConfig.build.outDir;await this.writeVersionFile(t)},"\u5199\u5165\u7248\u672C\u6587\u4EF6")})}}const generateVersion=factory_index.createPluginFactory(f);exports.generateVersion=generateVersion;
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import { BasePluginOptions, PluginFactory } from '../../factory/index.cjs';
|
|
2
|
+
import 'vite';
|
|
3
|
+
import '../../shared/vite-plugin.CLr0ttuO.cjs';
|
|
4
|
+
import '../../shared/vite-plugin.DRRlWY8P.cjs';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* 版本号格式类型
|
|
8
|
+
*
|
|
9
|
+
* @description
|
|
10
|
+
* - 'timestamp': 时间戳格式,如 '20260203153000'
|
|
11
|
+
* - 'date': 日期格式,如 '2026.02.03'
|
|
12
|
+
* - 'datetime': 日期时间格式,如 '2026.02.03.153000'
|
|
13
|
+
* - 'semver': 语义化版本格式,如 '1.0.0'
|
|
14
|
+
* - 'hash': 随机哈希格式,如 'a1b2c3d4'
|
|
15
|
+
* - 'custom': 自定义格式,需要配合 customFormat 使用
|
|
16
|
+
*/
|
|
17
|
+
type VersionFormat = 'timestamp' | 'date' | 'datetime' | 'semver' | 'hash' | 'custom';
|
|
18
|
+
/**
|
|
19
|
+
* 版本号输出类型
|
|
20
|
+
*
|
|
21
|
+
* @description
|
|
22
|
+
* - 'file': 输出到文件
|
|
23
|
+
* - 'define': 通过 Vite 的 define 注入到代码中
|
|
24
|
+
* - 'both': 同时输出到文件和注入代码
|
|
25
|
+
*/
|
|
26
|
+
type OutputType = 'file' | 'define' | 'both';
|
|
27
|
+
/**
|
|
28
|
+
* 版本信息接口
|
|
29
|
+
*
|
|
30
|
+
* @description generateVersion 插件生成的版本信息对象类型,
|
|
31
|
+
* 通过 define 注入到代码中后可通过 `__APP_VERSION___INFO` 全局变量访问
|
|
32
|
+
*/
|
|
33
|
+
interface VersionInfo {
|
|
34
|
+
/** 版本号字符串 */
|
|
35
|
+
version: string;
|
|
36
|
+
/** 构建时间(ISO 8601 格式) */
|
|
37
|
+
buildTime: string;
|
|
38
|
+
/** 构建时间戳(毫秒) */
|
|
39
|
+
timestamp: number;
|
|
40
|
+
/** 版本号格式 */
|
|
41
|
+
format: VersionFormat;
|
|
42
|
+
/** 通过 extra 选项附加的自定义字段 */
|
|
43
|
+
[key: string]: unknown;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* 自动生成版本号插件的配置选项接口
|
|
47
|
+
*
|
|
48
|
+
* @interface GenerateVersionOptions
|
|
49
|
+
*/
|
|
50
|
+
interface GenerateVersionOptions extends BasePluginOptions {
|
|
51
|
+
/**
|
|
52
|
+
* 版本号格式
|
|
53
|
+
*
|
|
54
|
+
* @default 'timestamp'
|
|
55
|
+
*/
|
|
56
|
+
format?: VersionFormat;
|
|
57
|
+
/**
|
|
58
|
+
* 自定义格式模板,仅当 format 为 'custom' 时有效
|
|
59
|
+
*
|
|
60
|
+
* @description 支持以下占位符:
|
|
61
|
+
* - {YYYY}: 四位年份
|
|
62
|
+
* - {MM}: 两位月份
|
|
63
|
+
* - {DD}: 两位日期
|
|
64
|
+
* - {HH}: 两位小时
|
|
65
|
+
* - {mm}: 两位分钟
|
|
66
|
+
* - {ss}: 两位秒数
|
|
67
|
+
* - {timestamp}: 时间戳
|
|
68
|
+
* - {hash}: 随机哈希
|
|
69
|
+
* - {major}: 主版本号(需配合 semverBase)
|
|
70
|
+
* - {minor}: 次版本号(需配合 semverBase)
|
|
71
|
+
* - {patch}: 补丁版本号(需配合 semverBase)
|
|
72
|
+
*
|
|
73
|
+
* @example '{YYYY}.{MM}.{DD}-{hash}'
|
|
74
|
+
*/
|
|
75
|
+
customFormat?: string;
|
|
76
|
+
/**
|
|
77
|
+
* 语义化版本基础值,用于 semver 格式
|
|
78
|
+
*
|
|
79
|
+
* @default '1.0.0'
|
|
80
|
+
*/
|
|
81
|
+
semverBase?: string;
|
|
82
|
+
/**
|
|
83
|
+
* 输出类型
|
|
84
|
+
*
|
|
85
|
+
* @default 'file'
|
|
86
|
+
*/
|
|
87
|
+
outputType?: OutputType;
|
|
88
|
+
/**
|
|
89
|
+
* 输出文件路径(相对于构建输出目录)
|
|
90
|
+
*
|
|
91
|
+
* @default 'version.json'
|
|
92
|
+
*/
|
|
93
|
+
outputFile?: string;
|
|
94
|
+
/**
|
|
95
|
+
* 注入到代码中的全局变量名
|
|
96
|
+
*
|
|
97
|
+
* @default '__APP_VERSION__'
|
|
98
|
+
*/
|
|
99
|
+
defineName?: string;
|
|
100
|
+
/**
|
|
101
|
+
* 哈希长度
|
|
102
|
+
*
|
|
103
|
+
* @default 8
|
|
104
|
+
*/
|
|
105
|
+
hashLength?: number;
|
|
106
|
+
/**
|
|
107
|
+
* 版本号前缀
|
|
108
|
+
*
|
|
109
|
+
* @example 'v'
|
|
110
|
+
*/
|
|
111
|
+
prefix?: string;
|
|
112
|
+
/**
|
|
113
|
+
* 版本号后缀
|
|
114
|
+
*
|
|
115
|
+
* @example '-beta'
|
|
116
|
+
*/
|
|
117
|
+
suffix?: string;
|
|
118
|
+
/**
|
|
119
|
+
* 额外的版本信息,会包含在输出的 JSON 文件中
|
|
120
|
+
*/
|
|
121
|
+
extra?: Record<string, any>;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* 自动生成版本号插件
|
|
126
|
+
*
|
|
127
|
+
* @param {GenerateVersionOptions} options - 插件配置选项
|
|
128
|
+
* @returns {Plugin} 一个 Vite 插件实例
|
|
129
|
+
*
|
|
130
|
+
* @example
|
|
131
|
+
* ```typescript
|
|
132
|
+
* // 基本使用 - 时间戳格式
|
|
133
|
+
* generateVersion()
|
|
134
|
+
*
|
|
135
|
+
* // 日期格式
|
|
136
|
+
* generateVersion({
|
|
137
|
+
* format: 'date'
|
|
138
|
+
* })
|
|
139
|
+
*
|
|
140
|
+
* // 语义化版本格式
|
|
141
|
+
* generateVersion({
|
|
142
|
+
* format: 'semver',
|
|
143
|
+
* semverBase: '2.0.0',
|
|
144
|
+
* prefix: 'v'
|
|
145
|
+
* })
|
|
146
|
+
*
|
|
147
|
+
* // 自定义格式
|
|
148
|
+
* generateVersion({
|
|
149
|
+
* format: 'custom',
|
|
150
|
+
* customFormat: '{YYYY}.{MM}.{DD}-{hash}',
|
|
151
|
+
* hashLength: 6
|
|
152
|
+
* })
|
|
153
|
+
*
|
|
154
|
+
* // 注入到代码中
|
|
155
|
+
* generateVersion({
|
|
156
|
+
* outputType: 'define',
|
|
157
|
+
* defineName: '__VERSION__'
|
|
158
|
+
* })
|
|
159
|
+
*
|
|
160
|
+
* // 同时输出文件和注入代码
|
|
161
|
+
* generateVersion({
|
|
162
|
+
* outputType: 'both',
|
|
163
|
+
* outputFile: 'build-info.json',
|
|
164
|
+
* defineName: '__BUILD_VERSION__',
|
|
165
|
+
* extra: {
|
|
166
|
+
* environment: 'production',
|
|
167
|
+
* author: 'MengXi Studio'
|
|
168
|
+
* }
|
|
169
|
+
* })
|
|
170
|
+
* ```
|
|
171
|
+
*
|
|
172
|
+
* @remarks
|
|
173
|
+
* 该插件会在 Vite 构建过程中自动生成版本号,支持多种格式:
|
|
174
|
+
* - timestamp: 时间戳格式 (20260203153000)
|
|
175
|
+
* - date: 日期格式 (2026.02.03)
|
|
176
|
+
* - datetime: 日期时间格式 (2026.02.03.153000)
|
|
177
|
+
* - semver: 语义化版本格式 (1.0.0)
|
|
178
|
+
* - hash: 随机哈希格式 (a1b2c3d4)
|
|
179
|
+
* - custom: 自定义格式
|
|
180
|
+
*/
|
|
181
|
+
declare const generateVersion: PluginFactory<GenerateVersionOptions, GenerateVersionOptions>;
|
|
182
|
+
|
|
183
|
+
export { generateVersion };
|
|
184
|
+
export type { GenerateVersionOptions, OutputType, VersionFormat, VersionInfo };
|