@meng-xi/vite-plugin 0.0.1 → 0.0.3

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.
Files changed (53) hide show
  1. package/README-en.md +150 -0
  2. package/README.md +84 -138
  3. package/dist/common/index.cjs +1 -0
  4. package/dist/common/index.d.cts +109 -0
  5. package/dist/common/index.d.mts +109 -0
  6. package/dist/common/index.d.ts +109 -0
  7. package/dist/common/index.mjs +1 -0
  8. package/dist/factory/index.cjs +1 -0
  9. package/dist/factory/index.d.cts +260 -0
  10. package/dist/factory/index.d.mts +260 -0
  11. package/dist/factory/index.d.ts +260 -0
  12. package/dist/factory/index.mjs +1 -0
  13. package/dist/index.cjs +1 -3
  14. package/dist/index.d.cts +7 -282
  15. package/dist/index.d.mts +7 -282
  16. package/dist/index.d.ts +7 -282
  17. package/dist/index.mjs +1 -3
  18. package/dist/logger/index.cjs +1 -0
  19. package/dist/logger/index.d.cts +1 -0
  20. package/dist/logger/index.d.mts +1 -0
  21. package/dist/logger/index.d.ts +1 -0
  22. package/dist/logger/index.mjs +1 -0
  23. package/dist/plugins/index.cjs +1 -0
  24. package/dist/plugins/index.d.cts +210 -0
  25. package/dist/plugins/index.d.mts +210 -0
  26. package/dist/plugins/index.d.ts +210 -0
  27. package/dist/plugins/index.mjs +1 -0
  28. package/dist/shared/vite-plugin.B3PARlU9.d.cts +119 -0
  29. package/dist/shared/vite-plugin.B3PARlU9.d.mts +119 -0
  30. package/dist/shared/vite-plugin.B3PARlU9.d.ts +119 -0
  31. package/dist/shared/vite-plugin.BT1oHRKK.cjs +1 -0
  32. package/dist/shared/vite-plugin.BTKhc7n7.cjs +3 -0
  33. package/dist/shared/vite-plugin.BZqhBDYR.mjs +1 -0
  34. package/dist/shared/vite-plugin.Bn8mcCzy.cjs +3 -0
  35. package/dist/shared/vite-plugin.CY2ydccp.mjs +3 -0
  36. package/dist/shared/vite-plugin.CiHfwMiN.d.cts +91 -0
  37. package/dist/shared/vite-plugin.CiHfwMiN.d.mts +91 -0
  38. package/dist/shared/vite-plugin.CiHfwMiN.d.ts +91 -0
  39. package/dist/shared/vite-plugin.ClHiVXD6.mjs +1 -0
  40. package/dist/shared/vite-plugin.DSRKYuae.mjs +3 -0
  41. package/dist/shared/vite-plugin.DrSzERYS.cjs +1 -0
  42. package/dist/shared/vite-plugin.UkE7CdSe.d.cts +43 -0
  43. package/dist/shared/vite-plugin.UkE7CdSe.d.mts +43 -0
  44. package/dist/shared/vite-plugin.UkE7CdSe.d.ts +43 -0
  45. package/package.json +72 -57
  46. package/dist/plugins/copyFile/index.d.ts +0 -44
  47. package/dist/plugins/copyFile/index.mjs +0 -43
  48. package/dist/plugins/copyFile/type.d.ts +0 -47
  49. package/dist/plugins/copyFile/type.mjs +0 -0
  50. package/dist/plugins/injectIco/index.d.ts +0 -74
  51. package/dist/plugins/injectIco/index.mjs +0 -82
  52. package/dist/plugins/injectIco/type.d.ts +0 -115
  53. package/dist/plugins/injectIco/type.mjs +0 -0
package/README-en.md ADDED
@@ -0,0 +1,150 @@
1
+ **English** | [中文](./README.md)
2
+
3
+ <div align="center">
4
+ <a href="https://github.com/MengXi-Studio/vite-plugin">
5
+ <img alt="梦曦工作室 Logo" width="215" src="https://github.com/MengXi-Studio/vite-plugin/blob/master/packages/docs/src/public/logo.svg">
6
+ </a>
7
+ <br>
8
+ <h1>@meng-xi/vite-plugin</h1>
9
+
10
+ [![license](https://img.shields.io/github/license/MengXi-Studio/vite-plugin.svg)](LICENSE) [![npm](https://img.shields.io/npm/v/@meng-xi/vite-plugin?color=blue)](https://www.npmjs.com/package/@meng-xi/vite-plugin)
11
+ ![npm](https://img.shields.io/npm/dt/@meng-xi/vite-plugin?color=green)
12
+
13
+ </div>
14
+
15
+ > - This is a toolkit that provides practical plugins for Vite, helping developers simplify the build process and improve development efficiency.
16
+ > - Extends Vite build process functionality, providing automated processing solutions for common build tasks.
17
+ > - All plugins support detailed configuration options, allowing customization based on project needs to meet different usage scenarios.
18
+ > - Plugins provide error handling mechanisms to ensure build processes can catch errors, improving build reliability.
19
+ > - Adopts modular design, plugins can be used individually or in combination, flexibly responding to different project needs.
20
+
21
+ ---
22
+
23
+ Start reading the [documentation](https://mengxi-studio.github.io/vite-plugin/).
24
+
25
+ ## Quick Start
26
+
27
+ ### Installation
28
+
29
+ Install `@meng-xi/vite-plugin` using a package manager:
30
+
31
+ ```bash
32
+ # Using npm
33
+ npm install @meng-xi/vite-plugin --save-dev
34
+
35
+ # Using yarn
36
+ yarn add @meng-xi/vite-plugin --save-dev
37
+
38
+ # Using pnpm
39
+ pnpm add @meng-xi/vite-plugin --save-dev
40
+ ```
41
+
42
+ ### Basic Usage
43
+
44
+ Import and use the plugins in your Vite configuration file:
45
+
46
+ ```typescript
47
+ import { defineConfig } from 'vite'
48
+ import { copyFile, injectIco } from '@meng-xi/vite-plugin'
49
+
50
+ export default defineConfig({
51
+ plugins: [
52
+ // Copy file plugin
53
+ copyFile({
54
+ sourceDir: 'src/assets',
55
+ targetDir: 'dist/assets'
56
+ }),
57
+
58
+ // Inject icon plugin
59
+ injectIco({
60
+ base: '/assets'
61
+ })
62
+ ]
63
+ })
64
+ ```
65
+
66
+ ### Import All
67
+
68
+ You can also use default import to import all plugins:
69
+
70
+ ```typescript
71
+ import { defineConfig } from 'vite'
72
+ import vitePlugin from '@meng-xi/vite-plugin'
73
+
74
+ export default defineConfig({
75
+ plugins: [
76
+ // Copy file plugin
77
+ vitePlugin.copyFile({
78
+ sourceDir: 'src/assets',
79
+ targetDir: 'dist/assets'
80
+ }),
81
+
82
+ // Inject icon plugin
83
+ vitePlugin.injectIco({
84
+ base: '/assets'
85
+ })
86
+ ]
87
+ })
88
+ ```
89
+
90
+ ## Plugin Details
91
+
92
+ ### copyFile Plugin
93
+
94
+ Used to copy files or directories to specified locations after Vite build is completed.
95
+
96
+ **Configuration Options**:
97
+
98
+ - `sourceDir`: Source directory path (required)
99
+ - `targetDir`: Target directory path (required)
100
+ - `overwrite`: Whether to overwrite existing files, default is `true`
101
+ - `recursive`: Whether to recursively copy subdirectories, default is `true`
102
+ - `verbose`: Whether to output detailed logs, default is `true`
103
+ - `enabled`: Whether to enable the plugin, default is `true`
104
+
105
+ ### injectIco Plugin
106
+
107
+ Used to inject website icon links into the head of HTML files during the Vite build process.
108
+
109
+ **Configuration Options**:
110
+
111
+ - `base`: Base path for icon files
112
+ - `url`: Complete URL for the icon
113
+ - `link`: Custom complete link tag HTML
114
+ - `icons`: Custom icon array
115
+ - `verbose`: Whether to output detailed logs, default is `true`
116
+ - `enabled`: Whether to enable the plugin, default is `true`
117
+ - `copyOptions`: Icon file copying configuration
118
+
119
+ ## Contribution
120
+
121
+ Welcome to contribute to `@meng-xi/vite-plugin`. Here are the steps to contribute code:
122
+
123
+ 1. Fork the project: Fork this project on GitHub.
124
+ 2. Clone the code: Clone the forked project to your local machine.
125
+
126
+ ```bash
127
+ git clone https://github.com/your-username/vite-plugin.git
128
+ cd vite-plugin
129
+ ```
130
+
131
+ 3. Create a new branch: Create a new feature branch based on the `master` branch.
132
+
133
+ ```bash
134
+ git checkout -b feature/your-feature
135
+ ```
136
+
137
+ 4. Commit changes: Ensure your code passes tests and commit your changes with clear commit messages.
138
+
139
+ ```bash
140
+ git add .
141
+ git commit -m "feat: add your feature description"
142
+ ```
143
+
144
+ 5. Push changes: Push your local branch to GitHub.
145
+
146
+ ```bash
147
+ git push origin feature/your-feature
148
+ ```
149
+
150
+ 6. Create a PR: Create a Pull Request on GitHub and wait for review.
package/README.md CHANGED
@@ -1,138 +1,84 @@
1
- # @meng-xi/vite-plugin [![npm](https://img.shields.io/npm/v/@meng-xi/vite-plugin?color=blue)](https://www.npmjs.com/package/@meng-xi/vite-plugin) ![GitHub](https://img.shields.io/github/license/MengXi-Studio/vite-plugin?color=orange)
2
-
3
- > - 这是一个为 Vite 提供实用插件的工具包,帮助开发者简化构建流程,提高开发效率。
4
- > - 扩展 Vite 构建流程的功能,提供常见构建任务的自动化处理方案。
5
- > - 所有插件都支持详细的配置选项,可根据项目需求自定义行为,满足不同场景的使用需求。
6
- > - 插件提供错误处理机制,确保构建流程能捕获到错误,提高构建的可靠性。
7
- > - 采用模块化设计,插件可以单独使用,也可以组合使用,灵活应对不同项目的需求。
8
-
9
- ---
10
-
11
- 开始阅读[文档](https://mengxi-studio.github.io/vite-plugin/)
12
-
13
- ## 快速入门
14
-
15
- ### 安装
16
-
17
- 使用包管理器安装 `@meng-xi/vite-plugin`:
18
-
19
- ```bash
20
- # 使用 npm
21
- npm install @meng-xi/vite-plugin --save-dev
22
-
23
- # 使用 yarn
24
- yarn add @meng-xi/vite-plugin --save-dev
25
-
26
- # 使用 pnpm
27
- pnpm add @meng-xi/vite-plugin --save-dev
28
- ```
29
-
30
- ### 基本使用
31
-
32
- 在 Vite 配置文件中引入并使用插件:
33
-
34
- ```typescript
35
- import { defineConfig } from 'vite'
36
- import { copyFile, injectIco } from '@meng-xi/vite-plugin'
37
-
38
- export default defineConfig({
39
- plugins: [
40
- // 复制文件插件
41
- copyFile({
42
- sourceDir: 'src/assets',
43
- targetDir: 'dist/assets'
44
- }),
45
-
46
- // 注入图标插件
47
- injectIco({
48
- base: '/assets'
49
- })
50
- ]
51
- })
52
- ```
53
-
54
- ### 全部引入
55
-
56
- 也可以使用默认导入的方式全部引入:
57
-
58
- ```typescript
59
- import { defineConfig } from 'vite'
60
- import vitePlugin from '@meng-xi/vite-plugin'
61
-
62
- export default defineConfig({
63
- plugins: [
64
- // 复制文件插件
65
- vitePlugin.copyFile({
66
- sourceDir: 'src/assets',
67
- targetDir: 'dist/assets'
68
- }),
69
-
70
- // 注入图标插件
71
- vitePlugin.injectIco({
72
- base: '/assets'
73
- })
74
- ]
75
- })
76
- ```
77
-
78
- ## 插件详情
79
-
80
- ### copyFile 插件
81
-
82
- 用于在 Vite 构建完成后复制文件或目录到指定位置。
83
-
84
- **配置选项**:
85
-
86
- - `sourceDir`:源目录路径(必填)
87
- - `targetDir`:目标目录路径(必填)
88
- - `overwrite`:是否覆盖已存在的文件,默认为 `true`
89
- - `recursive`:是否递归复制子目录,默认为 `true`
90
- - `verbose`:是否输出详细日志,默认为 `true`
91
- - `enabled`:是否启用插件,默认为 `true`
92
-
93
- ### injectIco 插件
94
-
95
- 用于在 Vite 构建过程中注入网站图标链接到 HTML 文件的头部。
96
-
97
- **配置选项**:
98
-
99
- - `base`:图标文件的基础路径
100
- - `url`:图标的完整 URL
101
- - `link`:自定义的完整 link 标签 HTML
102
- - `icons`:自定义图标数组
103
- - `verbose`:是否输出详细日志,默认为 `true`
104
- - `enabled`:是否启用插件,默认为 `true`
105
- - `copyOptions`:图标文件复制配置
106
-
107
- ## 贡献
108
-
109
- 欢迎为 `@meng-xi/vite-plugin` 贡献代码。以下是贡献代码的步骤:
110
-
111
- 1. Fork 项目:在 GitHub 上 Fork 此项目。
112
- 2. 克隆代码:将 Fork 后的项目克隆到您的本地机器。
113
-
114
- ```bash
115
- git clone https://github.com/your-username/vite-plugin.git
116
- cd vite-plugin
117
- ```
118
-
119
- 3. 创建新分支:基于 `master` 分支创建一个新的功能分支。
120
-
121
- ```bash
122
- git checkout -b feature/your-feature
123
- ```
124
-
125
- 4. 提交变更:确保您的代码通过了测试,并使用清晰的提交消息提交您的变更。
126
-
127
- ```bash
128
- git add .
129
- git commit -m "feat: add your feature description"
130
- ```
131
-
132
- 5. Push 变更:将您的本地分支推送到 GitHub。
133
-
134
- ```bash
135
- git push origin feature/your-feature
136
- ```
137
-
138
- 6. 创建 PR:在 GitHub 上创建一个 Pull Request,并等待审核。
1
+ **中文** | [English](./README-en.md)
2
+
3
+ <div align="center">
4
+ <a href="https://github.com/MengXi-Studio/vite-plugin">
5
+ <img alt="梦曦工作室 Logo" width="215" src="https://github.com/MengXi-Studio/vite-plugin/blob/master/packages/docs/src/public/logo.svg">
6
+ </a>
7
+ <br>
8
+ <h1>@meng-xi/vite-plugin</h1>
9
+
10
+ [![license](https://img.shields.io/github/license/MengXi-Studio/vite-plugin.svg)](LICENSE) [![npm](https://img.shields.io/npm/v/@meng-xi/vite-plugin?color=blue)](https://www.npmjs.com/package/@meng-xi/vite-plugin)
11
+ ![npm](https://img.shields.io/npm/dt/@meng-xi/vite-plugin?color=green)
12
+
13
+ </div>
14
+
15
+ ## 简介
16
+
17
+ `@meng-xi/vite-plugin` 是一个为 Vite 提供实用插件的工具包,帮助开发者简化构建流程,提高开发效率。
18
+
19
+ ## 特性
20
+
21
+ - **增强 Vite 构建流程**:提供实用插件集合,扩展 Vite 功能,简化构建过程中的常见任务,提高开发效率
22
+ - **模块化插件架构**:采用模块化设计,插件可单独使用或组合使用,灵活应对不同项目需求
23
+ - **高度可配置**:所有功能支持详细配置选项,可根据项目需求自定义行为,满足多样化场景
24
+ - **环境感知能力**:支持根据构建环境条件执行插件功能,智能控制不同环境下的行为
25
+ - **详细日志输出**:提供可选的详细日志,帮助开发者了解执行过程,便于调试和问题排查
26
+ - **类型安全**:完全使用 TypeScript 开发,提供完整类型定义,确保使用过程中的类型安全
27
+ - **无缝集成**:与 Vite 构建流程无缝集成,无需复杂配置即可快速启用
28
+ - **优化开发体验**:简化常见构建任务,减少手动操作,让开发者专注于核心业务逻辑
29
+
30
+ ## 文档
31
+
32
+ 开始阅读[文档地址](https://mengxi-studio.github.io/vite-plugin/)。
33
+
34
+ ## 安装
35
+
36
+ 使用包管理器安装 `@meng-xi/vite-plugin`:
37
+
38
+ ```bash
39
+ # 使用 npm
40
+ npm install @meng-xi/vite-plugin --save-dev
41
+
42
+ # 使用 yarn
43
+ yarn add @meng-xi/vite-plugin --save-dev
44
+
45
+ # 使用 pnpm
46
+ pnpm add @meng-xi/vite-plugin --save-dev
47
+ ```
48
+
49
+ ## 更新日志
50
+
51
+ [CHANGELOG](https://github.com/MengXi-Studio/vite-plugin/releases)
52
+
53
+ ## 如何贡献
54
+
55
+ 欢迎为 `@meng-xi/vite-plugin` 贡献代码。以下是贡献代码的步骤:
56
+
57
+ 1. Fork 项目:在 GitHub 上 Fork 此项目。
58
+ 2. 克隆代码:将 Fork 后的项目克隆到您的本地机器。
59
+
60
+ ```bash
61
+ git clone https://github.com/your-username/vite-plugin.git
62
+ cd vite-plugin
63
+ ```
64
+
65
+ 3. 创建新分支:基于 `master` 分支创建一个新的功能分支。
66
+
67
+ ```bash
68
+ git checkout -b feature/your-feature
69
+ ```
70
+
71
+ 4. 提交变更:确保您的代码通过了测试,并使用清晰的提交消息提交您的变更。
72
+
73
+ ```bash
74
+ git add .
75
+ git commit -m "feat: add your feature description"
76
+ ```
77
+
78
+ 5. Push 变更:将您的本地分支推送到 GitHub。
79
+
80
+ ```bash
81
+ git push origin feature/your-feature
82
+ ```
83
+
84
+ 6. 创建 PR:在 GitHub 上创建一个 Pull Request,并等待审核。
@@ -0,0 +1 @@
1
+ "use strict";const index=require("../shared/vite-plugin.DrSzERYS.cjs"),validation=require("../shared/vite-plugin.BTKhc7n7.cjs");require("fs"),require("path"),exports.checkSourceExists=index.checkSourceExists,exports.copySourceToTarget=index.copySourceToTarget,exports.ensureTargetDir=index.ensureTargetDir,exports.readDirRecursive=index.readDirRecursive,exports.readFileSync=index.readFileSync,exports.shouldUpdateFile=index.shouldUpdateFile,exports.writeFileContent=index.writeFileContent,exports.Validator=validation.Validator,exports.deepMerge=validation.deepMerge;
@@ -0,0 +1,109 @@
1
+ export { V as Validator } from '../shared/vite-plugin.CiHfwMiN.cjs';
2
+
3
+ /**
4
+ * 复制操作的选项接口
5
+ */
6
+ interface CopyOptions {
7
+ /**
8
+ * 是否支持递归复制
9
+ */
10
+ recursive: boolean;
11
+ /**
12
+ * 是否覆盖同名文件
13
+ */
14
+ overwrite: boolean;
15
+ /**
16
+ * 是否启用增量复制
17
+ */
18
+ incremental?: boolean;
19
+ /**
20
+ * 并行处理的最大文件数
21
+ */
22
+ parallelLimit?: number;
23
+ /**
24
+ * 是否跳过空目录
25
+ */
26
+ skipEmptyDirs?: boolean;
27
+ }
28
+ /**
29
+ * 复制结果接口
30
+ */
31
+ interface CopyResult {
32
+ /**
33
+ * 复制的文件数量
34
+ */
35
+ copiedFiles: number;
36
+ /**
37
+ * 跳过的文件数量
38
+ */
39
+ skippedFiles: number;
40
+ /**
41
+ * 复制的目录数量
42
+ */
43
+ copiedDirs: number;
44
+ /**
45
+ * 总执行时间(毫秒)
46
+ */
47
+ executionTime: number;
48
+ }
49
+
50
+ /**
51
+ * 检查源文件是否存在
52
+ * @param sourcePath 源文件路径
53
+ * @throws 当源文件不存在或无法访问时抛出异常
54
+ */
55
+ declare function checkSourceExists(sourcePath: string): Promise<void>;
56
+ /**
57
+ * 创建目标目录
58
+ * @param targetPath 目标目录路径
59
+ * @throws 当无法创建目标目录时抛出异常
60
+ */
61
+ declare function ensureTargetDir(targetPath: string): Promise<void>;
62
+ /**
63
+ * 读取目录内容
64
+ * @param dirPath 目录路径
65
+ * @param recursive 是否递归读取
66
+ * @returns 文件和目录列表
67
+ */
68
+ declare function readDirRecursive(dirPath: string, recursive: boolean): Promise<string[]>;
69
+ /**
70
+ * 检查文件是否需要更新
71
+ * @param sourceFile 源文件路径
72
+ * @param targetFile 目标文件路径
73
+ * @returns 是否需要更新
74
+ */
75
+ declare function shouldUpdateFile(sourceFile: string, targetFile: string): Promise<boolean>;
76
+ /**
77
+ * 执行文件复制操作
78
+ * @param sourcePath 源文件或目录路径
79
+ * @param targetPath 目标文件或目录路径
80
+ * @param options 复制选项
81
+ * @returns 复制结果
82
+ * @throws 当复制过程中出现错误时抛出异常
83
+ */
84
+ declare function copySourceToTarget(sourcePath: string, targetPath: string, options: CopyOptions): Promise<CopyResult>;
85
+ /**
86
+ * 写入文件内容
87
+ * @param filePath 文件路径
88
+ * @param content 文件内容
89
+ * @throws 当写入过程中出现错误时抛出异常
90
+ */
91
+ declare function writeFileContent(filePath: string, content: string): Promise<void>;
92
+ /**
93
+ * 同步读取文件内容
94
+ * @param filePath 文件路径
95
+ * @returns 文件内容字符串
96
+ * @throws 当读取过程中出现错误时抛出异常
97
+ */
98
+ declare function readFileSync(filePath: string): string;
99
+
100
+ /**
101
+ * 深度合并对象
102
+ *
103
+ * @param target 目标对象
104
+ * @param sources 源对象列表
105
+ * @returns 合并后的对象
106
+ */
107
+ declare function deepMerge<T extends Record<string, any>>(...sources: Partial<T>[]): T;
108
+
109
+ export { checkSourceExists, copySourceToTarget, deepMerge, ensureTargetDir, readDirRecursive, readFileSync, shouldUpdateFile, writeFileContent };
@@ -0,0 +1,109 @@
1
+ export { V as Validator } from '../shared/vite-plugin.CiHfwMiN.mjs';
2
+
3
+ /**
4
+ * 复制操作的选项接口
5
+ */
6
+ interface CopyOptions {
7
+ /**
8
+ * 是否支持递归复制
9
+ */
10
+ recursive: boolean;
11
+ /**
12
+ * 是否覆盖同名文件
13
+ */
14
+ overwrite: boolean;
15
+ /**
16
+ * 是否启用增量复制
17
+ */
18
+ incremental?: boolean;
19
+ /**
20
+ * 并行处理的最大文件数
21
+ */
22
+ parallelLimit?: number;
23
+ /**
24
+ * 是否跳过空目录
25
+ */
26
+ skipEmptyDirs?: boolean;
27
+ }
28
+ /**
29
+ * 复制结果接口
30
+ */
31
+ interface CopyResult {
32
+ /**
33
+ * 复制的文件数量
34
+ */
35
+ copiedFiles: number;
36
+ /**
37
+ * 跳过的文件数量
38
+ */
39
+ skippedFiles: number;
40
+ /**
41
+ * 复制的目录数量
42
+ */
43
+ copiedDirs: number;
44
+ /**
45
+ * 总执行时间(毫秒)
46
+ */
47
+ executionTime: number;
48
+ }
49
+
50
+ /**
51
+ * 检查源文件是否存在
52
+ * @param sourcePath 源文件路径
53
+ * @throws 当源文件不存在或无法访问时抛出异常
54
+ */
55
+ declare function checkSourceExists(sourcePath: string): Promise<void>;
56
+ /**
57
+ * 创建目标目录
58
+ * @param targetPath 目标目录路径
59
+ * @throws 当无法创建目标目录时抛出异常
60
+ */
61
+ declare function ensureTargetDir(targetPath: string): Promise<void>;
62
+ /**
63
+ * 读取目录内容
64
+ * @param dirPath 目录路径
65
+ * @param recursive 是否递归读取
66
+ * @returns 文件和目录列表
67
+ */
68
+ declare function readDirRecursive(dirPath: string, recursive: boolean): Promise<string[]>;
69
+ /**
70
+ * 检查文件是否需要更新
71
+ * @param sourceFile 源文件路径
72
+ * @param targetFile 目标文件路径
73
+ * @returns 是否需要更新
74
+ */
75
+ declare function shouldUpdateFile(sourceFile: string, targetFile: string): Promise<boolean>;
76
+ /**
77
+ * 执行文件复制操作
78
+ * @param sourcePath 源文件或目录路径
79
+ * @param targetPath 目标文件或目录路径
80
+ * @param options 复制选项
81
+ * @returns 复制结果
82
+ * @throws 当复制过程中出现错误时抛出异常
83
+ */
84
+ declare function copySourceToTarget(sourcePath: string, targetPath: string, options: CopyOptions): Promise<CopyResult>;
85
+ /**
86
+ * 写入文件内容
87
+ * @param filePath 文件路径
88
+ * @param content 文件内容
89
+ * @throws 当写入过程中出现错误时抛出异常
90
+ */
91
+ declare function writeFileContent(filePath: string, content: string): Promise<void>;
92
+ /**
93
+ * 同步读取文件内容
94
+ * @param filePath 文件路径
95
+ * @returns 文件内容字符串
96
+ * @throws 当读取过程中出现错误时抛出异常
97
+ */
98
+ declare function readFileSync(filePath: string): string;
99
+
100
+ /**
101
+ * 深度合并对象
102
+ *
103
+ * @param target 目标对象
104
+ * @param sources 源对象列表
105
+ * @returns 合并后的对象
106
+ */
107
+ declare function deepMerge<T extends Record<string, any>>(...sources: Partial<T>[]): T;
108
+
109
+ export { checkSourceExists, copySourceToTarget, deepMerge, ensureTargetDir, readDirRecursive, readFileSync, shouldUpdateFile, writeFileContent };