@chuckcchen/vite-plugin 0.0.2 → 0.0.4

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/dist/utils.d.ts CHANGED
@@ -1,43 +1,43 @@
1
1
  /**
2
- * EdgeOne Vite Plugin Adapter - 工具函数模块
3
- *
4
- * 本模块提供了一系列通用的工具函数,包括:
5
- * - 日志记录
6
- * - 文件系统操作(读写、复制、删除等)
7
- * - 路径检测
8
- * - 文件大小格式化
9
- * - 条件等待等
2
+ * EdgeOne Vite Plugin Adapter - Utility Functions Module
3
+ *
4
+ * This module provides a set of general utility functions, including:
5
+ * - Logging
6
+ * - File system operations (read, write, copy, delete, etc.)
7
+ * - Path detection
8
+ * - File size formatting
9
+ * - Conditional waiting, etc.
10
10
  */
11
11
  import type { Logger } from "./types.js";
12
12
  /**
13
- * 创建日志记录器实例
13
+ * Create logger instance
14
14
  *
15
- * @param verbose - 是否启用详细日志模式,默认为 false
16
- * @returns 返回一个包含 logverbosewarnerror 方法的日志对象
15
+ * @param verbose - Enable verbose logging mode, default is false
16
+ * @returns Logger object with log, verbose, warn, error methods
17
17
  *
18
18
  * @example
19
19
  * const logger = createLogger(true);
20
- * logger.verbose("这条消息只在 verbose 模式下显示");
21
- * logger.warn("这是一条警告消息");
20
+ * logger.verbose("This message only shows in verbose mode");
21
+ * logger.warn("This is a warning message");
22
22
  */
23
23
  export declare function createLogger(verbose?: boolean): Logger;
24
24
  /**
25
- * 检查指定路径是否存在
25
+ * Check if specified path exists
26
26
  *
27
- * @param filePath - 要检查的文件或目录路径
28
- * @returns 如果路径存在返回 true,否则返回 false
27
+ * @param filePath - File or directory path to check
28
+ * @returns True if path exists, false otherwise
29
29
  *
30
30
  * @example
31
31
  * if (await pathExists('/path/to/file')) {
32
- * console.log('文件存在');
32
+ * console.log('File exists');
33
33
  * }
34
34
  */
35
35
  export declare function pathExists(filePath: string): Promise<boolean>;
36
36
  /**
37
- * 从候选路径列表中找到第一个存在的路径
37
+ * Find first existing path from candidate list
38
38
  *
39
- * @param candidates - 候选路径数组,按优先级排序
40
- * @returns 返回第一个存在的路径,如果都不存在则返回 null
39
+ * @param candidates - Candidate paths array, sorted by priority
40
+ * @returns First existing path, or null if none exist
41
41
  *
42
42
  * @example
43
43
  * const buildDir = await findExistingPath([
@@ -48,71 +48,71 @@ export declare function pathExists(filePath: string): Promise<boolean>;
48
48
  */
49
49
  export declare function findExistingPath(candidates: string[]): Promise<string | null>;
50
50
  /**
51
- * 递归复制目录
52
- * 将源目录的所有内容复制到目标目录
51
+ * Recursively copy directory
52
+ * Copy all contents from source directory to destination directory
53
53
  *
54
- * @param src - 源目录路径
55
- * @param dest - 目标目录路径
54
+ * @param src - Source directory path
55
+ * @param dest - Destination directory path
56
56
  *
57
57
  * @example
58
58
  * await copyDirectory('dist/client', '.edgeone/assets');
59
59
  */
60
60
  export declare function copyDirectory(src: string, dest: string): Promise<void>;
61
61
  /**
62
- * 清理目录(删除后重新创建)
63
- * 用于确保目录为空的干净状态
62
+ * Clean directory (delete and recreate)
63
+ * Used to ensure directory is in a clean empty state
64
64
  *
65
- * @param dir - 要清理的目录路径
65
+ * @param dir - Directory path to clean
66
66
  *
67
67
  * @example
68
68
  * await cleanDirectory('.edgeone');
69
69
  */
70
70
  export declare function cleanDirectory(dir: string): Promise<void>;
71
71
  /**
72
- * 确保目录存在
73
- * 如果目录不存在则递归创建
72
+ * Ensure directory exists
73
+ * Recursively create if directory doesn't exist
74
74
  *
75
- * @param dir - 目录路径
75
+ * @param dir - Directory path
76
76
  *
77
77
  * @example
78
78
  * await ensureDirectory('.edgeone/server-handler');
79
79
  */
80
80
  export declare function ensureDirectory(dir: string): Promise<void>;
81
81
  /**
82
- * 读取文件内容为字符串
82
+ * Read file content as string
83
83
  *
84
- * @param filePath - 文件路径
85
- * @returns 文件内容字符串(UTF-8 编码)
84
+ * @param filePath - File path
85
+ * @returns File content string (UTF-8 encoded)
86
86
  *
87
87
  * @example
88
88
  * const content = await readFile('dist/server/index.js');
89
89
  */
90
90
  export declare function readFile(filePath: string): Promise<string>;
91
91
  /**
92
- * 将内容写入文件
93
- * 如果父目录不存在会自动创建
92
+ * Write content to file
93
+ * Automatically creates parent directory if it doesn't exist
94
94
  *
95
- * @param filePath - 文件路径
96
- * @param content - 要写入的内容
95
+ * @param filePath - File path
96
+ * @param content - Content to write
97
97
  *
98
98
  * @example
99
99
  * await writeFile('.edgeone/meta.json', JSON.stringify(config));
100
100
  */
101
101
  export declare function writeFile(filePath: string, content: string): Promise<void>;
102
102
  /**
103
- * 删除文件
103
+ * Delete file
104
104
  *
105
- * @param filePath - 要删除的文件路径
105
+ * @param filePath - File path to delete
106
106
  *
107
107
  * @example
108
108
  * await deleteFile('server-wrapper.temp.js');
109
109
  */
110
110
  export declare function deleteFile(filePath: string): Promise<void>;
111
111
  /**
112
- * 格式化文件大小为人类可读的字符串
112
+ * Format file size to human-readable string
113
113
  *
114
- * @param bytes - 字节数
115
- * @returns 格式化后的字符串,如 "1.5 KB""2.3 MB"
114
+ * @param bytes - Number of bytes
115
+ * @returns Formatted string, e.g. "1.5 KB", "2.3 MB"
116
116
  *
117
117
  * @example
118
118
  * formatSize(1536); // "1.5 KB"
@@ -120,14 +120,14 @@ export declare function deleteFile(filePath: string): Promise<void>;
120
120
  */
121
121
  export declare function formatSize(bytes: number): string;
122
122
  /**
123
- * 等待条件满足(带重试机制)
124
- * 用于等待异步操作完成,如文件写入完成
123
+ * Wait for condition to be met (with retry mechanism)
124
+ * Used to wait for async operations to complete, like file writes
125
125
  *
126
- * @param condition - 返回布尔值的异步条件函数
127
- * @param options - 配置选项
128
- * @param options.maxRetries - 最大重试次数,默认 15
129
- * @param options.delay - 每次重试的间隔时间(毫秒),默认 300ms
130
- * @returns 条件满足返回 true,超时返回 false
126
+ * @param condition - Async condition function returning boolean
127
+ * @param options - Configuration options
128
+ * @param options.maxRetries - Maximum retry count, default 15
129
+ * @param options.delay - Delay between retries in milliseconds, default 300ms
130
+ * @returns True if condition met, false if timeout
131
131
  *
132
132
  * @example
133
133
  * const ready = await waitFor(
@@ -140,10 +140,10 @@ export declare function waitFor(condition: () => Promise<boolean>, options?: {
140
140
  delay?: number;
141
141
  }): Promise<boolean>;
142
142
  /**
143
- * 列出目录中的文件和子目录名称
143
+ * List files and subdirectory names in directory
144
144
  *
145
- * @param dir - 目录路径
146
- * @returns 文件和目录名称数组,如果目录不存在则返回空数组
145
+ * @param dir - Directory path
146
+ * @returns Array of file and directory names, empty array if directory doesn't exist
147
147
  *
148
148
  * @example
149
149
  * const files = await listFiles('dist/client');
@@ -151,14 +151,14 @@ export declare function waitFor(condition: () => Promise<boolean>, options?: {
151
151
  */
152
152
  export declare function listFiles(dir: string): Promise<string[]>;
153
153
  /**
154
- * 递归统计目录中的文件数量
154
+ * Recursively count files in directory
155
155
  *
156
- * @param dir - 目录路径
157
- * @returns 文件总数(不包括目录)
156
+ * @param dir - Directory path
157
+ * @returns Total file count (excluding directories)
158
158
  *
159
159
  * @example
160
160
  * const count = await countFiles('dist');
161
- * console.log(`构建产物包含 ${count} 个文件`);
161
+ * console.log(`Build artifacts contain ${count} files`);
162
162
  */
163
163
  export declare function countFiles(dir: string): Promise<number>;
164
164
  //# sourceMappingURL=utils.d.ts.map
package/dist/utils.js CHANGED
@@ -1,57 +1,57 @@
1
1
  /**
2
- * EdgeOne Vite Plugin Adapter - 工具函数模块
2
+ * EdgeOne Vite Plugin Adapter - Utility Functions Module
3
3
  *
4
- * 本模块提供了一系列通用的工具函数,包括:
5
- * - 日志记录
6
- * - 文件系统操作(读写、复制、删除等)
7
- * - 路径检测
8
- * - 文件大小格式化
9
- * - 条件等待等
4
+ * This module provides a set of general utility functions, including:
5
+ * - Logging
6
+ * - File system operations (read, write, copy, delete, etc.)
7
+ * - Path detection
8
+ * - File size formatting
9
+ * - Conditional waiting, etc.
10
10
  */
11
11
  import fs from "fs/promises";
12
12
  import path from "path";
13
13
  /**
14
- * 创建日志记录器实例
14
+ * Create logger instance
15
15
  *
16
- * @param verbose - 是否启用详细日志模式,默认为 false
17
- * @returns 返回一个包含 logverbosewarnerror 方法的日志对象
16
+ * @param verbose - Enable verbose logging mode, default is false
17
+ * @returns Logger object with log, verbose, warn, error methods
18
18
  *
19
19
  * @example
20
20
  * const logger = createLogger(true);
21
- * logger.verbose("这条消息只在 verbose 模式下显示");
22
- * logger.warn("这是一条警告消息");
21
+ * logger.verbose("This message only shows in verbose mode");
22
+ * logger.warn("This is a warning message");
23
23
  */
24
24
  export function createLogger(verbose = false) {
25
25
  return {
26
- // 普通日志,始终输出
26
+ // Normal log, always outputs
27
27
  log: (message, ...args) => {
28
28
  console.log(`[EdgeOne Adapter] ${message}`, ...args);
29
29
  },
30
- // 详细日志,仅在 verbose 模式下输出
30
+ // Verbose log, only outputs in verbose mode
31
31
  verbose: (message, ...args) => {
32
32
  if (verbose) {
33
33
  console.log(`[EdgeOne Adapter] ${message}`, ...args);
34
34
  }
35
35
  },
36
- // 警告日志,带有警告图标
36
+ // Warning log with warning icon
37
37
  warn: (message, ...args) => {
38
38
  console.warn(`[EdgeOne Adapter] ⚠️ ${message}`, ...args);
39
39
  },
40
- // 错误日志,带有错误图标
40
+ // Error log with error icon
41
41
  error: (message, ...args) => {
42
42
  console.error(`[EdgeOne Adapter] ❌ ${message}`, ...args);
43
43
  },
44
44
  };
45
45
  }
46
46
  /**
47
- * 检查指定路径是否存在
47
+ * Check if specified path exists
48
48
  *
49
- * @param filePath - 要检查的文件或目录路径
50
- * @returns 如果路径存在返回 true,否则返回 false
49
+ * @param filePath - File or directory path to check
50
+ * @returns True if path exists, false otherwise
51
51
  *
52
52
  * @example
53
53
  * if (await pathExists('/path/to/file')) {
54
- * console.log('文件存在');
54
+ * console.log('File exists');
55
55
  * }
56
56
  */
57
57
  export async function pathExists(filePath) {
@@ -64,10 +64,10 @@ export async function pathExists(filePath) {
64
64
  }
65
65
  }
66
66
  /**
67
- * 从候选路径列表中找到第一个存在的路径
67
+ * Find first existing path from candidate list
68
68
  *
69
- * @param candidates - 候选路径数组,按优先级排序
70
- * @returns 返回第一个存在的路径,如果都不存在则返回 null
69
+ * @param candidates - Candidate paths array, sorted by priority
70
+ * @returns First existing path, or null if none exist
71
71
  *
72
72
  * @example
73
73
  * const buildDir = await findExistingPath([
@@ -85,11 +85,11 @@ export async function findExistingPath(candidates) {
85
85
  return null;
86
86
  }
87
87
  /**
88
- * 递归复制目录
89
- * 将源目录的所有内容复制到目标目录
88
+ * Recursively copy directory
89
+ * Copy all contents from source directory to destination directory
90
90
  *
91
- * @param src - 源目录路径
92
- * @param dest - 目标目录路径
91
+ * @param src - Source directory path
92
+ * @param dest - Destination directory path
93
93
  *
94
94
  * @example
95
95
  * await copyDirectory('dist/client', '.edgeone/assets');
@@ -98,10 +98,10 @@ export async function copyDirectory(src, dest) {
98
98
  await fs.cp(src, dest, { recursive: true });
99
99
  }
100
100
  /**
101
- * 清理目录(删除后重新创建)
102
- * 用于确保目录为空的干净状态
101
+ * Clean directory (delete and recreate)
102
+ * Used to ensure directory is in a clean empty state
103
103
  *
104
- * @param dir - 要清理的目录路径
104
+ * @param dir - Directory path to clean
105
105
  *
106
106
  * @example
107
107
  * await cleanDirectory('.edgeone');
@@ -111,10 +111,10 @@ export async function cleanDirectory(dir) {
111
111
  await fs.mkdir(dir, { recursive: true });
112
112
  }
113
113
  /**
114
- * 确保目录存在
115
- * 如果目录不存在则递归创建
114
+ * Ensure directory exists
115
+ * Recursively create if directory doesn't exist
116
116
  *
117
- * @param dir - 目录路径
117
+ * @param dir - Directory path
118
118
  *
119
119
  * @example
120
120
  * await ensureDirectory('.edgeone/server-handler');
@@ -123,10 +123,10 @@ export async function ensureDirectory(dir) {
123
123
  await fs.mkdir(dir, { recursive: true });
124
124
  }
125
125
  /**
126
- * 读取文件内容为字符串
126
+ * Read file content as string
127
127
  *
128
- * @param filePath - 文件路径
129
- * @returns 文件内容字符串(UTF-8 编码)
128
+ * @param filePath - File path
129
+ * @returns File content string (UTF-8 encoded)
130
130
  *
131
131
  * @example
132
132
  * const content = await readFile('dist/server/index.js');
@@ -135,24 +135,24 @@ export async function readFile(filePath) {
135
135
  return fs.readFile(filePath, "utf-8");
136
136
  }
137
137
  /**
138
- * 将内容写入文件
139
- * 如果父目录不存在会自动创建
138
+ * Write content to file
139
+ * Automatically creates parent directory if it doesn't exist
140
140
  *
141
- * @param filePath - 文件路径
142
- * @param content - 要写入的内容
141
+ * @param filePath - File path
142
+ * @param content - Content to write
143
143
  *
144
144
  * @example
145
145
  * await writeFile('.edgeone/meta.json', JSON.stringify(config));
146
146
  */
147
147
  export async function writeFile(filePath, content) {
148
- // 确保父目录存在
148
+ // Ensure parent directory exists
149
149
  await ensureDirectory(path.dirname(filePath));
150
150
  await fs.writeFile(filePath, content);
151
151
  }
152
152
  /**
153
- * 删除文件
153
+ * Delete file
154
154
  *
155
- * @param filePath - 要删除的文件路径
155
+ * @param filePath - File path to delete
156
156
  *
157
157
  * @example
158
158
  * await deleteFile('server-wrapper.temp.js');
@@ -161,10 +161,10 @@ export async function deleteFile(filePath) {
161
161
  await fs.unlink(filePath);
162
162
  }
163
163
  /**
164
- * 格式化文件大小为人类可读的字符串
164
+ * Format file size to human-readable string
165
165
  *
166
- * @param bytes - 字节数
167
- * @returns 格式化后的字符串,如 "1.5 KB""2.3 MB"
166
+ * @param bytes - Number of bytes
167
+ * @returns Formatted string, e.g. "1.5 KB", "2.3 MB"
168
168
  *
169
169
  * @example
170
170
  * formatSize(1536); // "1.5 KB"
@@ -175,20 +175,20 @@ export function formatSize(bytes) {
175
175
  return "0 B";
176
176
  const k = 1024;
177
177
  const sizes = ["B", "KB", "MB", "GB"];
178
- // 计算适合的单位级别
178
+ // Calculate appropriate unit level
179
179
  const i = Math.floor(Math.log(bytes) / Math.log(k));
180
- // 转换并保留两位小数
180
+ // Convert and keep two decimal places
181
181
  return parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + " " + sizes[i];
182
182
  }
183
183
  /**
184
- * 等待条件满足(带重试机制)
185
- * 用于等待异步操作完成,如文件写入完成
184
+ * Wait for condition to be met (with retry mechanism)
185
+ * Used to wait for async operations to complete, like file writes
186
186
  *
187
- * @param condition - 返回布尔值的异步条件函数
188
- * @param options - 配置选项
189
- * @param options.maxRetries - 最大重试次数,默认 15
190
- * @param options.delay - 每次重试的间隔时间(毫秒),默认 300ms
191
- * @returns 条件满足返回 true,超时返回 false
187
+ * @param condition - Async condition function returning boolean
188
+ * @param options - Configuration options
189
+ * @param options.maxRetries - Maximum retry count, default 15
190
+ * @param options.delay - Delay between retries in milliseconds, default 300ms
191
+ * @returns True if condition met, false if timeout
192
192
  *
193
193
  * @example
194
194
  * const ready = await waitFor(
@@ -199,11 +199,11 @@ export function formatSize(bytes) {
199
199
  export async function waitFor(condition, options = {}) {
200
200
  const { maxRetries = 15, delay = 300 } = options;
201
201
  for (let i = 0; i < maxRetries; i++) {
202
- // 检查条件是否满足
202
+ // Check if condition is met
203
203
  if (await condition()) {
204
204
  return true;
205
205
  }
206
- // 如果不是最后一次尝试,则等待后重试
206
+ // If not last attempt, wait then retry
207
207
  if (i < maxRetries - 1) {
208
208
  await new Promise((resolve) => setTimeout(resolve, delay));
209
209
  }
@@ -211,10 +211,10 @@ export async function waitFor(condition, options = {}) {
211
211
  return false;
212
212
  }
213
213
  /**
214
- * 列出目录中的文件和子目录名称
214
+ * List files and subdirectory names in directory
215
215
  *
216
- * @param dir - 目录路径
217
- * @returns 文件和目录名称数组,如果目录不存在则返回空数组
216
+ * @param dir - Directory path
217
+ * @returns Array of file and directory names, empty array if directory doesn't exist
218
218
  *
219
219
  * @example
220
220
  * const files = await listFiles('dist/client');
@@ -229,33 +229,33 @@ export async function listFiles(dir) {
229
229
  }
230
230
  }
231
231
  /**
232
- * 递归统计目录中的文件数量
232
+ * Recursively count files in directory
233
233
  *
234
- * @param dir - 目录路径
235
- * @returns 文件总数(不包括目录)
234
+ * @param dir - Directory path
235
+ * @returns Total file count (excluding directories)
236
236
  *
237
237
  * @example
238
238
  * const count = await countFiles('dist');
239
- * console.log(`构建产物包含 ${count} 个文件`);
239
+ * console.log(`Build artifacts contain ${count} files`);
240
240
  */
241
241
  export async function countFiles(dir) {
242
242
  let count = 0;
243
243
  try {
244
- // 获取目录内容,包含类型信息
244
+ // Get directory contents with type info
245
245
  const entries = await fs.readdir(dir, { withFileTypes: true });
246
246
  for (const entry of entries) {
247
247
  if (entry.isDirectory()) {
248
- // 递归统计子目录
248
+ // Recursively count subdirectory
249
249
  count += await countFiles(path.join(dir, entry.name));
250
250
  }
251
251
  else {
252
- // 文件计数加一
252
+ // Increment file count
253
253
  count++;
254
254
  }
255
255
  }
256
256
  }
257
257
  catch {
258
- // 忽略错误(如目录不存在)
258
+ // Ignore errors (e.g. directory doesn't exist)
259
259
  }
260
260
  return count;
261
261
  }
package/dist/utils.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,MAAM,aAAa,CAAC;AAC7B,OAAO,IAAI,MAAM,MAAM,CAAC;AAGxB;;;;;;;;;;GAUG;AACH,MAAM,UAAU,YAAY,CAAC,UAAmB,KAAK;IACnD,OAAO;QACL,YAAY;QACZ,GAAG,EAAE,CAAC,OAAe,EAAE,GAAG,IAAe,EAAE,EAAE;YAC3C,OAAO,CAAC,GAAG,CAAC,qBAAqB,OAAO,EAAE,EAAE,GAAG,IAAI,CAAC,CAAC;QACvD,CAAC;QACD,wBAAwB;QACxB,OAAO,EAAE,CAAC,OAAe,EAAE,GAAG,IAAe,EAAE,EAAE;YAC/C,IAAI,OAAO,EAAE,CAAC;gBACZ,OAAO,CAAC,GAAG,CAAC,qBAAqB,OAAO,EAAE,EAAE,GAAG,IAAI,CAAC,CAAC;YACvD,CAAC;QACH,CAAC;QACD,cAAc;QACd,IAAI,EAAE,CAAC,OAAe,EAAE,GAAG,IAAe,EAAE,EAAE;YAC5C,OAAO,CA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M,CAAC;QACP,+CAA+C;IACjD,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chuckcchen/vite-plugin",
3
- "version": "0.0.2",
3
+ "version": "0.0.4",
4
4
  "description": "Core adapter plugin for EdgeOne platform - handles build artifacts, bundling, and deployment configuration",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -8,6 +8,7 @@
8
8
  "exports": {
9
9
  ".": {
10
10
  "types": "./dist/index.d.ts",
11
+ "development": "./src/index.ts",
11
12
  "import": "./dist/index.js"
12
13
  }
13
14
  },