befly 3.8.13 → 3.8.15

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 (3) hide show
  1. package/check.ts +18 -11
  2. package/package.json +2 -2
  3. package/plugins/db.ts +1 -1
package/check.ts CHANGED
@@ -65,17 +65,19 @@ export const checkTable = async function (): Promise<boolean> {
65
65
  const allTableFiles: TableFileInfo[] = [];
66
66
  let hasError = false;
67
67
 
68
- // 收集项目表字段定义文件
69
- for await (const file of tablesGlob.scan({
70
- cwd: projectTableDir,
71
- absolute: true,
72
- onlyFiles: true
73
- })) {
74
- allTableFiles.push({
75
- file: file,
76
- typeCode: 'project',
77
- typeName: '项目'
78
- });
68
+ // 收集项目表字段定义文件(如果目录存在)
69
+ if (existsSync(projectTableDir)) {
70
+ for await (const file of tablesGlob.scan({
71
+ cwd: projectTableDir,
72
+ absolute: true,
73
+ onlyFiles: true
74
+ })) {
75
+ allTableFiles.push({
76
+ file: file,
77
+ typeCode: 'project',
78
+ typeName: '项目'
79
+ });
80
+ }
79
81
  }
80
82
 
81
83
  // 收集 addon 表字段定义文件
@@ -83,6 +85,11 @@ export const checkTable = async function (): Promise<boolean> {
83
85
  for (const addonName of addons) {
84
86
  const addonTablesDir = getAddonDir(addonName, 'tables');
85
87
 
88
+ // 检查 addon tables 目录是否存在
89
+ if (!existsSync(addonTablesDir)) {
90
+ continue;
91
+ }
92
+
86
93
  for await (const file of tablesGlob.scan({
87
94
  cwd: addonTablesDir,
88
95
  absolute: true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "befly",
3
- "version": "3.8.13",
3
+ "version": "3.8.15",
4
4
  "description": "Befly - 为 Bun 专属打造的 TypeScript API 接口框架核心引擎",
5
5
  "type": "module",
6
6
  "private": false,
@@ -65,5 +65,5 @@
65
65
  "es-toolkit": "^1.41.0",
66
66
  "pathe": "^2.0.3"
67
67
  },
68
- "gitHead": "afb329b2cce2ab5f5821d8515ae7dba4622a4f1f"
68
+ "gitHead": "4607bf1cc0f31705a9c25bc7abdc3cba383e567c"
69
69
  }
package/plugins/db.ts CHANGED
@@ -35,7 +35,7 @@ const dbPlugin: Plugin = {
35
35
 
36
36
  return dbManager;
37
37
  } else {
38
- Logger.warn('数据库未启用(DB_ENABLE≠1),跳过初始化');
38
+ Logger.warn('数据库未启用,跳过初始化');
39
39
  return {};
40
40
  }
41
41
  } catch (error: any) {