@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.
- package/commands/prepare.ts +1 -1
- package/core/app.ts +3 -4
- package/core/module/FindPackageRoot.ts +1 -1
- package/package.json +1 -1
- package/utils/Dayjs.ts +16 -16
package/commands/prepare.ts
CHANGED
|
@@ -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
|
|
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
|
-
|
|
86
|
-
|
|
83
|
+
if (isPrepareMode) {
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
87
86
|
|
|
88
87
|
// 5. 注册组件
|
|
89
88
|
|
package/package.json
CHANGED
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 };
|