@mindbase/express-common 1.0.9 → 1.0.11

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.
@@ -14,7 +14,7 @@ export function generateDrizzleSchemasJson(
14
14
  ): void {
15
15
  // 过滤 ORM schema(路径包含 /orm/)
16
16
  const ormSchemaFiles = scannedResults
17
- .filter((r) => r.type === "schema" && r.filePath.includes("/orm/"))
17
+ .filter((r) => r.type === "schema" && /[/\\]orm[/\\]/.test(r.filePath))
18
18
  .map((f) => path.relative(cwd, f.filePath).replace(/\\/g, "/"));
19
19
 
20
20
  // 生成到当前工作目录(宿主项目根目录)
package/core/app.ts CHANGED
@@ -76,14 +76,13 @@ export function createApp(options: MindBaseAppOptions = {}): MindBaseApp {
76
76
  // 准备模式:生成 schema 清单后返回,不启动服务
77
77
  if (isPrepareMode) {
78
78
  generateDrizzleSchemasJson(scannedResults, process.cwd());
79
- return;
80
79
  }
81
80
 
82
81
  // 3. 初始化数据库
83
82
  await initializeDataStorage(scannedResults);
84
-
85
- // 4. 初始化模块
86
- await installPlugins();
83
+ if (isPrepareMode) {
84
+ return;
85
+ }
87
86
 
88
87
  // 5. 注册组件
89
88
 
@@ -55,4 +55,4 @@ export function findPackageRoot(startPath: string): string {
55
55
 
56
56
  // 如果没有找到 package.json,返回起始路径的父目录
57
57
  return path.dirname(startPath);
58
- }
58
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mindbase/express-common",
3
- "version": "1.0.9",
3
+ "version": "1.0.11",
4
4
  "exports": {
5
5
  ".": "./index.ts"
6
6
  },
package/utils/Dayjs.ts CHANGED
@@ -1,16 +1,16 @@
1
- import dayjs from "dayjs";
2
- import "dayjs/locale/zh-cn";
3
- import duration from "dayjs/plugin/duration";
4
- import relativeTime from "dayjs/plugin/relativeTime";
5
- import utc from "dayjs/plugin/utc";
6
-
7
- // 设置中文语言包
8
- dayjs.locale("zh-cn");
9
-
10
- // 注册常用插件
11
- dayjs.extend(utc);
12
- dayjs.extend(duration);
13
- dayjs.extend(relativeTime);
14
-
15
- export default dayjs;
16
- export { dayjs };
1
+ import dayjs from "dayjs";
2
+ import "dayjs/locale/zh-cn";
3
+ import duration from "dayjs/plugin/duration";
4
+ import relativeTime from "dayjs/plugin/relativeTime";
5
+ import utc from "dayjs/plugin/utc";
6
+
7
+ // 设置中文语言包
8
+ dayjs.locale("zh-cn");
9
+
10
+ // 注册常用插件
11
+ dayjs.extend(utc);
12
+ dayjs.extend(duration);
13
+ dayjs.extend(relativeTime);
14
+
15
+ export default dayjs;
16
+ export { dayjs };