@meng-xi/vite-plugin 0.0.5 → 0.0.7
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 +404 -182
- package/README.md +403 -182
- package/dist/common/index.cjs +1 -1
- package/dist/common/index.d.cts +9 -1
- package/dist/common/index.d.mts +9 -1
- package/dist/common/index.d.ts +9 -1
- package/dist/common/index.mjs +1 -1
- package/dist/factory/index.cjs +1 -1
- package/dist/factory/index.d.cts +71 -6
- package/dist/factory/index.d.mts +71 -6
- package/dist/factory/index.d.ts +71 -6
- package/dist/factory/index.mjs +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +4 -5
- package/dist/index.d.mts +4 -5
- package/dist/index.d.ts +4 -5
- package/dist/index.mjs +1 -1
- package/dist/logger/index.cjs +1 -1
- package/dist/logger/index.d.cts +1 -1
- package/dist/logger/index.d.mts +1 -1
- package/dist/logger/index.d.ts +1 -1
- package/dist/logger/index.mjs +1 -1
- package/dist/plugins/index.cjs +1 -1
- package/dist/plugins/index.d.cts +263 -8
- package/dist/plugins/index.d.mts +263 -8
- package/dist/plugins/index.d.ts +263 -8
- package/dist/plugins/index.mjs +1 -1
- package/dist/shared/vite-plugin.Ba9646wL.cjs +1 -0
- package/dist/shared/vite-plugin.C3ejdBNf.mjs +1 -0
- package/dist/shared/vite-plugin.CIahO6bu.mjs +37 -0
- package/dist/shared/{vite-plugin.B3PARlU9.d.cts → vite-plugin.CLr0ttuO.d.cts} +16 -0
- package/dist/shared/{vite-plugin.B3PARlU9.d.mts → vite-plugin.CLr0ttuO.d.mts} +16 -0
- package/dist/shared/{vite-plugin.B3PARlU9.d.ts → vite-plugin.CLr0ttuO.d.ts} +16 -0
- package/dist/shared/vite-plugin.CawoITTT.cjs +1 -0
- package/dist/shared/vite-plugin.DSb6XzBn.mjs +1 -0
- package/dist/shared/vite-plugin.DqgHJjxa.cjs +37 -0
- package/package.json +72 -72
- package/dist/shared/vite-plugin.BZsetDCm.cjs +0 -1
- package/dist/shared/vite-plugin.C7isVPKg.mjs +0 -1
- package/dist/shared/vite-plugin.CS9a5kjK.mjs +0 -36
- package/dist/shared/vite-plugin.CgnG5_UX.cjs +0 -36
- package/dist/shared/vite-plugin.DqWt65U-.cjs +0 -1
- package/dist/shared/vite-plugin.UkE7CdSe.d.cts +0 -43
- package/dist/shared/vite-plugin.UkE7CdSe.d.mts +0 -43
- package/dist/shared/vite-plugin.UkE7CdSe.d.ts +0 -43
- package/dist/shared/vite-plugin.YvjM8LxW.mjs +0 -1
package/dist/common/index.d.ts
CHANGED
|
@@ -132,11 +132,19 @@ declare function copySourceToTarget(sourcePath: string, targetPath: string, opti
|
|
|
132
132
|
* @throws 当写入过程中出现错误时抛出异常
|
|
133
133
|
*/
|
|
134
134
|
declare function writeFileContent(filePath: string, content: string): Promise<void>;
|
|
135
|
+
/**
|
|
136
|
+
* 读取文件内容
|
|
137
|
+
* @param filePath 文件路径
|
|
138
|
+
* @returns 文件内容字符串
|
|
139
|
+
* @throws 当读取过程中出现错误时抛出异常
|
|
140
|
+
*/
|
|
141
|
+
declare function readFileContent(filePath: string): Promise<string>;
|
|
135
142
|
/**
|
|
136
143
|
* 同步读取文件内容
|
|
137
144
|
* @param filePath 文件路径
|
|
138
145
|
* @returns 文件内容字符串
|
|
139
146
|
* @throws 当读取过程中出现错误时抛出异常
|
|
147
|
+
* @deprecated 请使用异步版本 readFileContent
|
|
140
148
|
*/
|
|
141
149
|
declare function readFileSync(filePath: string): string;
|
|
142
150
|
|
|
@@ -306,5 +314,5 @@ declare function stripJsonComments(jsonString: string): string;
|
|
|
306
314
|
*/
|
|
307
315
|
declare function deepMerge<T extends Record<string, any>>(...sources: Partial<T>[]): T;
|
|
308
316
|
|
|
309
|
-
export { checkSourceExists, copySourceToTarget, deepMerge, ensureTargetDir, fileExists, formatDate, generateRandomHash, getDateFormatParams, padNumber, parseTemplate, readDirRecursive, readFileSync, runWithConcurrency, shouldUpdateFile, stripJsonComments, toCamelCase, toPascalCase, writeFileContent };
|
|
317
|
+
export { checkSourceExists, copySourceToTarget, deepMerge, ensureTargetDir, fileExists, formatDate, generateRandomHash, getDateFormatParams, padNumber, parseTemplate, readDirRecursive, readFileContent, readFileSync, runWithConcurrency, shouldUpdateFile, stripJsonComments, toCamelCase, toPascalCase, writeFileContent };
|
|
310
318
|
export type { DateFormatOptions };
|
package/dist/common/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{c as checkSourceExists,a as copySourceToTarget,e as ensureTargetDir,f as fileExists,b as formatDate,g as generateRandomHash,d as getDateFormatParams,p as padNumber,h as parseTemplate,r as readDirRecursive,i as
|
|
1
|
+
export{c as checkSourceExists,a as copySourceToTarget,e as ensureTargetDir,f as fileExists,b as formatDate,g as generateRandomHash,d as getDateFormatParams,p as padNumber,h as parseTemplate,r as readDirRecursive,i as readFileContent,j as readFileSync,k as runWithConcurrency,s as shouldUpdateFile,l as stripJsonComments,t as toCamelCase,m as toPascalCase,w as writeFileContent}from"../shared/vite-plugin.C3ejdBNf.mjs";export{V as Validator,d as deepMerge}from"../shared/vite-plugin.B88RyRN8.mjs";import"fs";import"path";import"crypto";
|
package/dist/factory/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const index=require("../shared/vite-plugin.
|
|
1
|
+
"use strict";const index=require("../shared/vite-plugin.CawoITTT.cjs");require("../logger/index.cjs"),require("fs"),require("path"),require("crypto"),require("../shared/vite-plugin.IGZeStMa.cjs"),exports.BasePlugin=index.BasePlugin,exports.createPluginFactory=index.createPluginFactory;
|
package/dist/factory/index.d.cts
CHANGED
|
@@ -1,8 +1,58 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { P as PluginLogger, a as LoggerOptions } from '../shared/vite-plugin.B3PARlU9.cjs';
|
|
1
|
+
import { Plugin, ResolvedConfig } from 'vite';
|
|
2
|
+
import { P as PluginLogger, a as LoggerOptions } from '../shared/vite-plugin.CLr0ttuO.cjs';
|
|
4
3
|
import { V as Validator } from '../shared/vite-plugin.CiHfwMiN.cjs';
|
|
5
4
|
|
|
5
|
+
/**
|
|
6
|
+
* 带插件实例引用的 Vite 插件类型
|
|
7
|
+
*
|
|
8
|
+
* @template T 插件配置类型
|
|
9
|
+
*/
|
|
10
|
+
interface PluginWithInstance<T extends BasePluginOptions = BasePluginOptions> extends Plugin {
|
|
11
|
+
/**
|
|
12
|
+
* 原始插件实例的引用,方便外部访问插件内部状态
|
|
13
|
+
*/
|
|
14
|
+
pluginInstance?: BasePlugin<T>;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* 基础插件配置
|
|
18
|
+
*
|
|
19
|
+
* @interface BasePluginOptions
|
|
20
|
+
*/
|
|
21
|
+
interface BasePluginOptions {
|
|
22
|
+
/**
|
|
23
|
+
* 是否启用插件
|
|
24
|
+
*
|
|
25
|
+
* @default true
|
|
26
|
+
*/
|
|
27
|
+
enabled?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* 是否启用日志
|
|
30
|
+
*
|
|
31
|
+
* @default true
|
|
32
|
+
*/
|
|
33
|
+
verbose?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* 错误处理策略
|
|
36
|
+
*
|
|
37
|
+
* @default 'throw'
|
|
38
|
+
*/
|
|
39
|
+
errorStrategy?: 'throw' | 'log' | 'ignore';
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* 插件选项标准化器类型
|
|
43
|
+
*
|
|
44
|
+
* @template T 目标选项类型
|
|
45
|
+
* @template R 原始选项类型
|
|
46
|
+
*/
|
|
47
|
+
type OptionsNormalizer<T, R = any> = (raw?: R) => T;
|
|
48
|
+
/**
|
|
49
|
+
* 插件工厂函数类型
|
|
50
|
+
*
|
|
51
|
+
* @template T 插件配置类型,默认继承自 BasePluginOptions
|
|
52
|
+
* @template R 原始配置类型,默认与 T 相同
|
|
53
|
+
*/
|
|
54
|
+
type PluginFactory<T extends BasePluginOptions = BasePluginOptions, R = T> = (options?: R) => PluginWithInstance<T>;
|
|
55
|
+
|
|
6
56
|
/**
|
|
7
57
|
* 基础插件抽象类,提供插件开发的核心功能和生命周期管理
|
|
8
58
|
*
|
|
@@ -66,11 +116,10 @@ declare abstract class BasePlugin<T extends BasePluginOptions = BasePluginOption
|
|
|
66
116
|
* 获取插件的默认配置选项
|
|
67
117
|
*
|
|
68
118
|
* @protected
|
|
69
|
-
* @abstract
|
|
70
119
|
* @returns {Partial<T>} 插件特定的默认配置
|
|
71
|
-
* @description
|
|
120
|
+
* @description 子类可以重写此方法,以提供插件特定的默认配置值。默认返回空对象
|
|
72
121
|
*/
|
|
73
|
-
protected
|
|
122
|
+
protected getDefaultOptions(): Partial<T>;
|
|
74
123
|
/**
|
|
75
124
|
* 合并插件配置,将用户提供的配置与默认配置合并
|
|
76
125
|
*
|
|
@@ -142,6 +191,21 @@ declare abstract class BasePlugin<T extends BasePluginOptions = BasePluginOption
|
|
|
142
191
|
* @description 处理 Vite 配置解析完成事件,将解析后的配置存储到插件实例中
|
|
143
192
|
*/
|
|
144
193
|
protected onConfigResolved(config: ResolvedConfig): void;
|
|
194
|
+
/**
|
|
195
|
+
* 插件销毁生命周期
|
|
196
|
+
*
|
|
197
|
+
* @protected
|
|
198
|
+
* @virtual
|
|
199
|
+
* @description 插件销毁时调用的清理方法。基类会注销日志配置,子类可重写此方法添加自定义清理逻辑
|
|
200
|
+
* @example
|
|
201
|
+
* ```typescript
|
|
202
|
+
* protected destroy(): void {
|
|
203
|
+
* super.destroy()
|
|
204
|
+
* this.stopWatching()
|
|
205
|
+
* }
|
|
206
|
+
* ```
|
|
207
|
+
*/
|
|
208
|
+
protected destroy(): void;
|
|
145
209
|
/**
|
|
146
210
|
* 添加插件钩子到 Vite 插件对象
|
|
147
211
|
*
|
|
@@ -258,3 +322,4 @@ declare abstract class BasePlugin<T extends BasePluginOptions = BasePluginOption
|
|
|
258
322
|
declare function createPluginFactory<T extends BasePluginOptions, P extends BasePlugin<T>, R = T>(PluginClass: new (options: T, loggerConfig?: LoggerOptions) => P, normalizer?: OptionsNormalizer<T, R>): PluginFactory<T, R>;
|
|
259
323
|
|
|
260
324
|
export { BasePlugin, createPluginFactory };
|
|
325
|
+
export type { BasePluginOptions, OptionsNormalizer, PluginFactory, PluginWithInstance };
|
package/dist/factory/index.d.mts
CHANGED
|
@@ -1,8 +1,58 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { P as PluginLogger, a as LoggerOptions } from '../shared/vite-plugin.B3PARlU9.mjs';
|
|
1
|
+
import { Plugin, ResolvedConfig } from 'vite';
|
|
2
|
+
import { P as PluginLogger, a as LoggerOptions } from '../shared/vite-plugin.CLr0ttuO.mjs';
|
|
4
3
|
import { V as Validator } from '../shared/vite-plugin.CiHfwMiN.mjs';
|
|
5
4
|
|
|
5
|
+
/**
|
|
6
|
+
* 带插件实例引用的 Vite 插件类型
|
|
7
|
+
*
|
|
8
|
+
* @template T 插件配置类型
|
|
9
|
+
*/
|
|
10
|
+
interface PluginWithInstance<T extends BasePluginOptions = BasePluginOptions> extends Plugin {
|
|
11
|
+
/**
|
|
12
|
+
* 原始插件实例的引用,方便外部访问插件内部状态
|
|
13
|
+
*/
|
|
14
|
+
pluginInstance?: BasePlugin<T>;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* 基础插件配置
|
|
18
|
+
*
|
|
19
|
+
* @interface BasePluginOptions
|
|
20
|
+
*/
|
|
21
|
+
interface BasePluginOptions {
|
|
22
|
+
/**
|
|
23
|
+
* 是否启用插件
|
|
24
|
+
*
|
|
25
|
+
* @default true
|
|
26
|
+
*/
|
|
27
|
+
enabled?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* 是否启用日志
|
|
30
|
+
*
|
|
31
|
+
* @default true
|
|
32
|
+
*/
|
|
33
|
+
verbose?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* 错误处理策略
|
|
36
|
+
*
|
|
37
|
+
* @default 'throw'
|
|
38
|
+
*/
|
|
39
|
+
errorStrategy?: 'throw' | 'log' | 'ignore';
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* 插件选项标准化器类型
|
|
43
|
+
*
|
|
44
|
+
* @template T 目标选项类型
|
|
45
|
+
* @template R 原始选项类型
|
|
46
|
+
*/
|
|
47
|
+
type OptionsNormalizer<T, R = any> = (raw?: R) => T;
|
|
48
|
+
/**
|
|
49
|
+
* 插件工厂函数类型
|
|
50
|
+
*
|
|
51
|
+
* @template T 插件配置类型,默认继承自 BasePluginOptions
|
|
52
|
+
* @template R 原始配置类型,默认与 T 相同
|
|
53
|
+
*/
|
|
54
|
+
type PluginFactory<T extends BasePluginOptions = BasePluginOptions, R = T> = (options?: R) => PluginWithInstance<T>;
|
|
55
|
+
|
|
6
56
|
/**
|
|
7
57
|
* 基础插件抽象类,提供插件开发的核心功能和生命周期管理
|
|
8
58
|
*
|
|
@@ -66,11 +116,10 @@ declare abstract class BasePlugin<T extends BasePluginOptions = BasePluginOption
|
|
|
66
116
|
* 获取插件的默认配置选项
|
|
67
117
|
*
|
|
68
118
|
* @protected
|
|
69
|
-
* @abstract
|
|
70
119
|
* @returns {Partial<T>} 插件特定的默认配置
|
|
71
|
-
* @description
|
|
120
|
+
* @description 子类可以重写此方法,以提供插件特定的默认配置值。默认返回空对象
|
|
72
121
|
*/
|
|
73
|
-
protected
|
|
122
|
+
protected getDefaultOptions(): Partial<T>;
|
|
74
123
|
/**
|
|
75
124
|
* 合并插件配置,将用户提供的配置与默认配置合并
|
|
76
125
|
*
|
|
@@ -142,6 +191,21 @@ declare abstract class BasePlugin<T extends BasePluginOptions = BasePluginOption
|
|
|
142
191
|
* @description 处理 Vite 配置解析完成事件,将解析后的配置存储到插件实例中
|
|
143
192
|
*/
|
|
144
193
|
protected onConfigResolved(config: ResolvedConfig): void;
|
|
194
|
+
/**
|
|
195
|
+
* 插件销毁生命周期
|
|
196
|
+
*
|
|
197
|
+
* @protected
|
|
198
|
+
* @virtual
|
|
199
|
+
* @description 插件销毁时调用的清理方法。基类会注销日志配置,子类可重写此方法添加自定义清理逻辑
|
|
200
|
+
* @example
|
|
201
|
+
* ```typescript
|
|
202
|
+
* protected destroy(): void {
|
|
203
|
+
* super.destroy()
|
|
204
|
+
* this.stopWatching()
|
|
205
|
+
* }
|
|
206
|
+
* ```
|
|
207
|
+
*/
|
|
208
|
+
protected destroy(): void;
|
|
145
209
|
/**
|
|
146
210
|
* 添加插件钩子到 Vite 插件对象
|
|
147
211
|
*
|
|
@@ -258,3 +322,4 @@ declare abstract class BasePlugin<T extends BasePluginOptions = BasePluginOption
|
|
|
258
322
|
declare function createPluginFactory<T extends BasePluginOptions, P extends BasePlugin<T>, R = T>(PluginClass: new (options: T, loggerConfig?: LoggerOptions) => P, normalizer?: OptionsNormalizer<T, R>): PluginFactory<T, R>;
|
|
259
323
|
|
|
260
324
|
export { BasePlugin, createPluginFactory };
|
|
325
|
+
export type { BasePluginOptions, OptionsNormalizer, PluginFactory, PluginWithInstance };
|
package/dist/factory/index.d.ts
CHANGED
|
@@ -1,8 +1,58 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { P as PluginLogger, a as LoggerOptions } from '../shared/vite-plugin.B3PARlU9.js';
|
|
1
|
+
import { Plugin, ResolvedConfig } from 'vite';
|
|
2
|
+
import { P as PluginLogger, a as LoggerOptions } from '../shared/vite-plugin.CLr0ttuO.js';
|
|
4
3
|
import { V as Validator } from '../shared/vite-plugin.CiHfwMiN.js';
|
|
5
4
|
|
|
5
|
+
/**
|
|
6
|
+
* 带插件实例引用的 Vite 插件类型
|
|
7
|
+
*
|
|
8
|
+
* @template T 插件配置类型
|
|
9
|
+
*/
|
|
10
|
+
interface PluginWithInstance<T extends BasePluginOptions = BasePluginOptions> extends Plugin {
|
|
11
|
+
/**
|
|
12
|
+
* 原始插件实例的引用,方便外部访问插件内部状态
|
|
13
|
+
*/
|
|
14
|
+
pluginInstance?: BasePlugin<T>;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* 基础插件配置
|
|
18
|
+
*
|
|
19
|
+
* @interface BasePluginOptions
|
|
20
|
+
*/
|
|
21
|
+
interface BasePluginOptions {
|
|
22
|
+
/**
|
|
23
|
+
* 是否启用插件
|
|
24
|
+
*
|
|
25
|
+
* @default true
|
|
26
|
+
*/
|
|
27
|
+
enabled?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* 是否启用日志
|
|
30
|
+
*
|
|
31
|
+
* @default true
|
|
32
|
+
*/
|
|
33
|
+
verbose?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* 错误处理策略
|
|
36
|
+
*
|
|
37
|
+
* @default 'throw'
|
|
38
|
+
*/
|
|
39
|
+
errorStrategy?: 'throw' | 'log' | 'ignore';
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* 插件选项标准化器类型
|
|
43
|
+
*
|
|
44
|
+
* @template T 目标选项类型
|
|
45
|
+
* @template R 原始选项类型
|
|
46
|
+
*/
|
|
47
|
+
type OptionsNormalizer<T, R = any> = (raw?: R) => T;
|
|
48
|
+
/**
|
|
49
|
+
* 插件工厂函数类型
|
|
50
|
+
*
|
|
51
|
+
* @template T 插件配置类型,默认继承自 BasePluginOptions
|
|
52
|
+
* @template R 原始配置类型,默认与 T 相同
|
|
53
|
+
*/
|
|
54
|
+
type PluginFactory<T extends BasePluginOptions = BasePluginOptions, R = T> = (options?: R) => PluginWithInstance<T>;
|
|
55
|
+
|
|
6
56
|
/**
|
|
7
57
|
* 基础插件抽象类,提供插件开发的核心功能和生命周期管理
|
|
8
58
|
*
|
|
@@ -66,11 +116,10 @@ declare abstract class BasePlugin<T extends BasePluginOptions = BasePluginOption
|
|
|
66
116
|
* 获取插件的默认配置选项
|
|
67
117
|
*
|
|
68
118
|
* @protected
|
|
69
|
-
* @abstract
|
|
70
119
|
* @returns {Partial<T>} 插件特定的默认配置
|
|
71
|
-
* @description
|
|
120
|
+
* @description 子类可以重写此方法,以提供插件特定的默认配置值。默认返回空对象
|
|
72
121
|
*/
|
|
73
|
-
protected
|
|
122
|
+
protected getDefaultOptions(): Partial<T>;
|
|
74
123
|
/**
|
|
75
124
|
* 合并插件配置,将用户提供的配置与默认配置合并
|
|
76
125
|
*
|
|
@@ -142,6 +191,21 @@ declare abstract class BasePlugin<T extends BasePluginOptions = BasePluginOption
|
|
|
142
191
|
* @description 处理 Vite 配置解析完成事件,将解析后的配置存储到插件实例中
|
|
143
192
|
*/
|
|
144
193
|
protected onConfigResolved(config: ResolvedConfig): void;
|
|
194
|
+
/**
|
|
195
|
+
* 插件销毁生命周期
|
|
196
|
+
*
|
|
197
|
+
* @protected
|
|
198
|
+
* @virtual
|
|
199
|
+
* @description 插件销毁时调用的清理方法。基类会注销日志配置,子类可重写此方法添加自定义清理逻辑
|
|
200
|
+
* @example
|
|
201
|
+
* ```typescript
|
|
202
|
+
* protected destroy(): void {
|
|
203
|
+
* super.destroy()
|
|
204
|
+
* this.stopWatching()
|
|
205
|
+
* }
|
|
206
|
+
* ```
|
|
207
|
+
*/
|
|
208
|
+
protected destroy(): void;
|
|
145
209
|
/**
|
|
146
210
|
* 添加插件钩子到 Vite 插件对象
|
|
147
211
|
*
|
|
@@ -258,3 +322,4 @@ declare abstract class BasePlugin<T extends BasePluginOptions = BasePluginOption
|
|
|
258
322
|
declare function createPluginFactory<T extends BasePluginOptions, P extends BasePlugin<T>, R = T>(PluginClass: new (options: T, loggerConfig?: LoggerOptions) => P, normalizer?: OptionsNormalizer<T, R>): PluginFactory<T, R>;
|
|
259
323
|
|
|
260
324
|
export { BasePlugin, createPluginFactory };
|
|
325
|
+
export type { BasePluginOptions, OptionsNormalizer, PluginFactory, PluginWithInstance };
|
package/dist/factory/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{B as BasePlugin,c as createPluginFactory}from"../shared/vite-plugin.
|
|
1
|
+
export{B as BasePlugin,c as createPluginFactory}from"../shared/vite-plugin.DSb6XzBn.mjs";import"../logger/index.mjs";import"fs";import"path";import"crypto";import"../shared/vite-plugin.B88RyRN8.mjs";
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const format=require("./shared/vite-plugin.
|
|
1
|
+
"use strict";const format=require("./shared/vite-plugin.Ba9646wL.cjs"),validation=require("./shared/vite-plugin.IGZeStMa.cjs"),index=require("./shared/vite-plugin.CawoITTT.cjs"),logger_index=require("./logger/index.cjs"),index$1=require("./shared/vite-plugin.DqgHJjxa.cjs");require("fs"),require("path"),require("crypto"),exports.checkSourceExists=format.checkSourceExists,exports.copySourceToTarget=format.copySourceToTarget,exports.ensureTargetDir=format.ensureTargetDir,exports.fileExists=format.fileExists,exports.formatDate=format.formatDate,exports.generateRandomHash=format.generateRandomHash,exports.getDateFormatParams=format.getDateFormatParams,exports.padNumber=format.padNumber,exports.parseTemplate=format.parseTemplate,exports.readDirRecursive=format.readDirRecursive,exports.readFileContent=format.readFileContent,exports.readFileSync=format.readFileSync,exports.runWithConcurrency=format.runWithConcurrency,exports.shouldUpdateFile=format.shouldUpdateFile,exports.stripJsonComments=format.stripJsonComments,exports.toCamelCase=format.toCamelCase,exports.toPascalCase=format.toPascalCase,exports.writeFileContent=format.writeFileContent,exports.Validator=validation.Validator,exports.deepMerge=validation.deepMerge,exports.BasePlugin=index.BasePlugin,exports.createPluginFactory=index.createPluginFactory,exports.Logger=logger_index.Logger,exports.buildProgress=index$1.buildProgress,exports.copyFile=index$1.copyFile,exports.generateRouter=index$1.generateRouter,exports.generateVersion=index$1.generateVersion,exports.injectIco=index$1.injectIco;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
export { DateFormatOptions, checkSourceExists, copySourceToTarget, deepMerge, ensureTargetDir, fileExists, formatDate, generateRandomHash, getDateFormatParams, padNumber, parseTemplate, readDirRecursive, readFileSync, runWithConcurrency, shouldUpdateFile, stripJsonComments, toCamelCase, toPascalCase, writeFileContent } from './common/index.cjs';
|
|
1
|
+
export { DateFormatOptions, checkSourceExists, copySourceToTarget, deepMerge, ensureTargetDir, fileExists, formatDate, generateRandomHash, getDateFormatParams, padNumber, parseTemplate, readDirRecursive, readFileContent, readFileSync, runWithConcurrency, shouldUpdateFile, stripJsonComments, toCamelCase, toPascalCase, writeFileContent } from './common/index.cjs';
|
|
2
2
|
export { V as Validator } from './shared/vite-plugin.CiHfwMiN.cjs';
|
|
3
|
-
export { BasePlugin, createPluginFactory } from './factory/index.cjs';
|
|
4
|
-
export { L as Logger, P as PluginLogger } from './shared/vite-plugin.
|
|
5
|
-
export { copyFile, generateRouter, generateVersion, injectIco } from './plugins/index.cjs';
|
|
3
|
+
export { BasePlugin, BasePluginOptions, OptionsNormalizer, PluginFactory, PluginWithInstance, createPluginFactory } from './factory/index.cjs';
|
|
4
|
+
export { L as Logger, P as PluginLogger } from './shared/vite-plugin.CLr0ttuO.cjs';
|
|
5
|
+
export { BuildPhase, BuildProgressOptions, CopyFileOptions, GenerateRouterOptions, GenerateVersionOptions, Icon, InjectIcoOptions, NameStrategy, OutputFormat, OutputType, ProgressFormat, ProgressTheme, RouteConfig, RouteMeta, UniAppPageConfig, UniAppPagesJson, UniAppTabBarConfig, VersionFormat, buildProgress, copyFile, generateRouter, generateVersion, injectIco } from './plugins/index.cjs';
|
|
6
6
|
import 'vite';
|
|
7
|
-
import './shared/vite-plugin.UkE7CdSe.cjs';
|
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
export { DateFormatOptions, checkSourceExists, copySourceToTarget, deepMerge, ensureTargetDir, fileExists, formatDate, generateRandomHash, getDateFormatParams, padNumber, parseTemplate, readDirRecursive, readFileSync, runWithConcurrency, shouldUpdateFile, stripJsonComments, toCamelCase, toPascalCase, writeFileContent } from './common/index.mjs';
|
|
1
|
+
export { DateFormatOptions, checkSourceExists, copySourceToTarget, deepMerge, ensureTargetDir, fileExists, formatDate, generateRandomHash, getDateFormatParams, padNumber, parseTemplate, readDirRecursive, readFileContent, readFileSync, runWithConcurrency, shouldUpdateFile, stripJsonComments, toCamelCase, toPascalCase, writeFileContent } from './common/index.mjs';
|
|
2
2
|
export { V as Validator } from './shared/vite-plugin.CiHfwMiN.mjs';
|
|
3
|
-
export { BasePlugin, createPluginFactory } from './factory/index.mjs';
|
|
4
|
-
export { L as Logger, P as PluginLogger } from './shared/vite-plugin.
|
|
5
|
-
export { copyFile, generateRouter, generateVersion, injectIco } from './plugins/index.mjs';
|
|
3
|
+
export { BasePlugin, BasePluginOptions, OptionsNormalizer, PluginFactory, PluginWithInstance, createPluginFactory } from './factory/index.mjs';
|
|
4
|
+
export { L as Logger, P as PluginLogger } from './shared/vite-plugin.CLr0ttuO.mjs';
|
|
5
|
+
export { BuildPhase, BuildProgressOptions, CopyFileOptions, GenerateRouterOptions, GenerateVersionOptions, Icon, InjectIcoOptions, NameStrategy, OutputFormat, OutputType, ProgressFormat, ProgressTheme, RouteConfig, RouteMeta, UniAppPageConfig, UniAppPagesJson, UniAppTabBarConfig, VersionFormat, buildProgress, copyFile, generateRouter, generateVersion, injectIco } from './plugins/index.mjs';
|
|
6
6
|
import 'vite';
|
|
7
|
-
import './shared/vite-plugin.UkE7CdSe.mjs';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
export { DateFormatOptions, checkSourceExists, copySourceToTarget, deepMerge, ensureTargetDir, fileExists, formatDate, generateRandomHash, getDateFormatParams, padNumber, parseTemplate, readDirRecursive, readFileSync, runWithConcurrency, shouldUpdateFile, stripJsonComments, toCamelCase, toPascalCase, writeFileContent } from './common/index.js';
|
|
1
|
+
export { DateFormatOptions, checkSourceExists, copySourceToTarget, deepMerge, ensureTargetDir, fileExists, formatDate, generateRandomHash, getDateFormatParams, padNumber, parseTemplate, readDirRecursive, readFileContent, readFileSync, runWithConcurrency, shouldUpdateFile, stripJsonComments, toCamelCase, toPascalCase, writeFileContent } from './common/index.js';
|
|
2
2
|
export { V as Validator } from './shared/vite-plugin.CiHfwMiN.js';
|
|
3
|
-
export { BasePlugin, createPluginFactory } from './factory/index.js';
|
|
4
|
-
export { L as Logger, P as PluginLogger } from './shared/vite-plugin.
|
|
5
|
-
export { copyFile, generateRouter, generateVersion, injectIco } from './plugins/index.js';
|
|
3
|
+
export { BasePlugin, BasePluginOptions, OptionsNormalizer, PluginFactory, PluginWithInstance, createPluginFactory } from './factory/index.js';
|
|
4
|
+
export { L as Logger, P as PluginLogger } from './shared/vite-plugin.CLr0ttuO.js';
|
|
5
|
+
export { BuildPhase, BuildProgressOptions, CopyFileOptions, GenerateRouterOptions, GenerateVersionOptions, Icon, InjectIcoOptions, NameStrategy, OutputFormat, OutputType, ProgressFormat, ProgressTheme, RouteConfig, RouteMeta, UniAppPageConfig, UniAppPagesJson, UniAppTabBarConfig, VersionFormat, buildProgress, copyFile, generateRouter, generateVersion, injectIco } from './plugins/index.js';
|
|
6
6
|
import 'vite';
|
|
7
|
-
import './shared/vite-plugin.UkE7CdSe.js';
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{c as checkSourceExists,a as copySourceToTarget,e as ensureTargetDir,f as fileExists,b as formatDate,g as generateRandomHash,d as getDateFormatParams,p as padNumber,h as parseTemplate,r as readDirRecursive,i as
|
|
1
|
+
export{c as checkSourceExists,a as copySourceToTarget,e as ensureTargetDir,f as fileExists,b as formatDate,g as generateRandomHash,d as getDateFormatParams,p as padNumber,h as parseTemplate,r as readDirRecursive,i as readFileContent,j as readFileSync,k as runWithConcurrency,s as shouldUpdateFile,l as stripJsonComments,t as toCamelCase,m as toPascalCase,w as writeFileContent}from"./shared/vite-plugin.C3ejdBNf.mjs";export{V as Validator,d as deepMerge}from"./shared/vite-plugin.B88RyRN8.mjs";export{B as BasePlugin,c as createPluginFactory}from"./shared/vite-plugin.DSb6XzBn.mjs";export{Logger}from"./logger/index.mjs";export{b as buildProgress,c as copyFile,g as generateRouter,a as generateVersion,i as injectIco}from"./shared/vite-plugin.CIahO6bu.mjs";import"fs";import"path";import"crypto";
|
package/dist/logger/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";class Logger{static instance=null;libName="@meng-xi/vite-plugin";pluginConfigs=new Map;logTypes={info:{method:console.log,icon:"\u2139\uFE0F",color:"\x1B[36m",reset:"\x1B[0m"},success:{method:console.log,icon:"\u2705",color:"\x1B[32m",reset:"\x1B[0m"},warn:{method:console.warn,icon:"\u26A0\uFE0F",color:"\x1B[33m",reset:"\x1B[0m"},error:{method:console.error,icon:"\u274C",color:"\x1B[31m",reset:"\x1B[0m"}};constructor(){}static getInstance(){return Logger.instance||(Logger.instance=new Logger),Logger.instance}static create(e){const
|
|
1
|
+
"use strict";class Logger{static instance=null;libName="@meng-xi/vite-plugin";pluginConfigs=new Map;logTypes={info:{method:console.log,icon:"\u2139\uFE0F",color:"\x1B[36m",reset:"\x1B[0m"},success:{method:console.log,icon:"\u2705",color:"\x1B[32m",reset:"\x1B[0m"},warn:{method:console.warn,icon:"\u26A0\uFE0F",color:"\x1B[33m",reset:"\x1B[0m"},error:{method:console.error,icon:"\u274C",color:"\x1B[31m",reset:"\x1B[0m"}};constructor(){}static getInstance(){return Logger.instance||(Logger.instance=new Logger),Logger.instance}static create(e){const t=Logger.getInstance();return t.registerPlugin(e.name,e.enabled??!0),t}registerPlugin(e,t){this.pluginConfigs.set(e,t)}unregisterPlugin(e){this.pluginConfigs.delete(e)}static unregister(e){Logger.instance&&Logger.instance.unregisterPlugin(e)}static destroy(){Logger.instance&&(Logger.instance.pluginConfigs.clear(),Logger.instance=null)}formatPrefix(e){return`[${this.libName}:${e}]`}isPluginEnabled(e){return this.pluginConfigs.get(e)??!0}log(e,t,n,r){if(!this.isPluginEnabled(e))return;const l=this.formatPrefix(e),u=this.logTypes[t],{method:o,icon:a,color:s,reset:i}=u,c=`${a} ${l}`;r!=null?o(s+c+i,s+n+i,r):o(s+c+i,s+n+i)}createPluginLogger(e){return{success:(t,n)=>this.log(e,"success",t,n),info:(t,n)=>this.log(e,"info",t,n),warn:(t,n)=>this.log(e,"warn",t,n),error:(t,n)=>this.log(e,"error",t,n)}}}exports.Logger=Logger;
|
package/dist/logger/index.d.cts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { L as Logger, P as PluginLogger } from '../shared/vite-plugin.
|
|
1
|
+
export { L as Logger, P as PluginLogger } from '../shared/vite-plugin.CLr0ttuO.cjs';
|
package/dist/logger/index.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { L as Logger, P as PluginLogger } from '../shared/vite-plugin.
|
|
1
|
+
export { L as Logger, P as PluginLogger } from '../shared/vite-plugin.CLr0ttuO.mjs';
|
package/dist/logger/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { L as Logger, P as PluginLogger } from '../shared/vite-plugin.
|
|
1
|
+
export { L as Logger, P as PluginLogger } from '../shared/vite-plugin.CLr0ttuO.js';
|
package/dist/logger/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
class
|
|
1
|
+
class t{static instance=null;libName="@meng-xi/vite-plugin";pluginConfigs=new Map;logTypes={info:{method:console.log,icon:"\u2139\uFE0F",color:"\x1B[36m",reset:"\x1B[0m"},success:{method:console.log,icon:"\u2705",color:"\x1B[32m",reset:"\x1B[0m"},warn:{method:console.warn,icon:"\u26A0\uFE0F",color:"\x1B[33m",reset:"\x1B[0m"},error:{method:console.error,icon:"\u274C",color:"\x1B[31m",reset:"\x1B[0m"}};constructor(){}static getInstance(){return t.instance||(t.instance=new t),t.instance}static create(e){const n=t.getInstance();return n.registerPlugin(e.name,e.enabled??!0),n}registerPlugin(e,n){this.pluginConfigs.set(e,n)}unregisterPlugin(e){this.pluginConfigs.delete(e)}static unregister(e){t.instance&&t.instance.unregisterPlugin(e)}static destroy(){t.instance&&(t.instance.pluginConfigs.clear(),t.instance=null)}formatPrefix(e){return`[${this.libName}:${e}]`}isPluginEnabled(e){return this.pluginConfigs.get(e)??!0}log(e,n,s,o){if(!this.isPluginEnabled(e))return;const u=this.formatPrefix(e),a=this.logTypes[n],{method:l,icon:g,color:i,reset:r}=a,c=`${g} ${u}`;o!=null?l(i+c+r,i+s+r,o):l(i+c+r,i+s+r)}createPluginLogger(e){return{success:(n,s)=>this.log(e,"success",n,s),info:(n,s)=>this.log(e,"info",n,s),warn:(n,s)=>this.log(e,"warn",n,s),error:(n,s)=>this.log(e,"error",n,s)}}}export{t as Logger};
|
package/dist/plugins/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const index=require("../shared/vite-plugin.
|
|
1
|
+
"use strict";const index=require("../shared/vite-plugin.DqgHJjxa.cjs");require("../shared/vite-plugin.CawoITTT.cjs"),require("../logger/index.cjs"),require("fs"),require("path"),require("crypto"),require("../shared/vite-plugin.IGZeStMa.cjs"),require("../shared/vite-plugin.Ba9646wL.cjs"),exports.buildProgress=index.buildProgress,exports.copyFile=index.copyFile,exports.generateRouter=index.generateRouter,exports.generateVersion=index.generateVersion,exports.injectIco=index.injectIco;
|