@blocklet/pages-kit-block-studio 0.4.66 → 0.4.67
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/lib/cjs/middlewares/init-block-studio-router.js +8 -1
- package/lib/cjs/tsconfig.tsbuildinfo +1 -1
- package/lib/cjs/utils/ts-morph-utils.js +63 -0
- package/lib/cjs/utils/zod-utils.js +0 -111
- package/lib/esm/middlewares/init-block-studio-router.js +9 -2
- package/lib/esm/tsconfig.tsbuildinfo +1 -1
- package/lib/esm/utils/ts-morph-utils.js +59 -0
- package/lib/esm/utils/zod-utils.js +0 -73
- package/lib/types/tsconfig.tsbuildinfo +1 -1
- package/lib/types/utils/ts-morph-utils.d.ts +9 -0
- package/lib/types/utils/zod-utils.d.ts +0 -16
- package/package.json +4 -4
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Project } from 'ts-morph';
|
|
2
|
+
import { z } from 'zod';
|
|
2
3
|
/**
|
|
3
4
|
* 创建 ts-morph 项目
|
|
4
5
|
* @param tsConfigFilePath tsconfig.json 文件路径
|
|
@@ -22,3 +23,11 @@ export declare function extractTypeWithDependencies(sourceFilePath: string, type
|
|
|
22
23
|
* @param imports 导入语句集合
|
|
23
24
|
*/
|
|
24
25
|
export declare function combineTypeDefinitions(typeText: string, dependencies: Map<string, string>, imports?: string[]): string;
|
|
26
|
+
/**
|
|
27
|
+
* 从TypeScript文件中的类型声明生成Zod schema
|
|
28
|
+
* 支持处理外部引用类型
|
|
29
|
+
* @param sourceFilePath 源文件路径
|
|
30
|
+
* @param typeName 类型名称
|
|
31
|
+
* @param tsConfigFilePath tsconfig.json 路径,默认为项目根目录下的tsconfig.json
|
|
32
|
+
*/
|
|
33
|
+
export declare function tsFileToZodSchema(sourceFilePath: string, typeName: string): Promise<z.ZodTypeAny>;
|
|
@@ -48,20 +48,4 @@ export declare function zodSchemaToJsonSchema(schema: z.ZodTypeAny): import("zod
|
|
|
48
48
|
[key: string]: import("zod-to-json-schema").JsonSchema7Type;
|
|
49
49
|
} | undefined;
|
|
50
50
|
};
|
|
51
|
-
/**
|
|
52
|
-
* 从TypeScript文件中的类型声明生成Zod schema
|
|
53
|
-
* 支持处理外部引用类型
|
|
54
|
-
* @param sourceFilePath 源文件路径
|
|
55
|
-
* @param typeName 类型名称
|
|
56
|
-
* @param tsConfigFilePath tsconfig.json 路径,默认为项目根目录下的tsconfig.json
|
|
57
|
-
*/
|
|
58
|
-
export declare function tsFileToZodSchema(sourceFilePath: string, typeName: string): Promise<z.ZodTypeAny>;
|
|
59
|
-
/**
|
|
60
|
-
* 从TypeScript文件中的类型生成Properties对象
|
|
61
|
-
* 支持处理外部引用类型
|
|
62
|
-
* @param sourceFilePath 源文件路径
|
|
63
|
-
* @param typeName 类型名称
|
|
64
|
-
* @param existingProperties 已存在的properties对象
|
|
65
|
-
*/
|
|
66
|
-
export declare function tsFileInterfaceToProperties(sourceFilePath: string, typeName: string, existingProperties?: Record<string, any>): Promise<Record<string, any>>;
|
|
67
51
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blocklet/pages-kit-block-studio",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.67",
|
|
4
4
|
"description": "Pages Kit block studio for blocklet(s)",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -120,7 +120,7 @@
|
|
|
120
120
|
"react-dom": "^18.3.1",
|
|
121
121
|
"react-router-dom": "^6.26.1",
|
|
122
122
|
"rollup-plugin-external-globals": "^0.12.1",
|
|
123
|
-
"ts-morph": "^
|
|
123
|
+
"ts-morph": "^21.0.1",
|
|
124
124
|
"ts-to-zod": "^3.15.0",
|
|
125
125
|
"typescript": "^5.7.2",
|
|
126
126
|
"ufo": "^1.5.4",
|
|
@@ -132,7 +132,7 @@
|
|
|
132
132
|
"zod": "^3.24.2",
|
|
133
133
|
"zod-to-json-schema": "^3.24.4",
|
|
134
134
|
"zod-to-ts": "^1.2.0",
|
|
135
|
-
"@blocklet/pages-kit": "0.4.
|
|
135
|
+
"@blocklet/pages-kit": "0.4.67"
|
|
136
136
|
},
|
|
137
137
|
"devDependencies": {
|
|
138
138
|
"@rollup/plugin-typescript": "^11.1.6",
|
|
@@ -157,7 +157,7 @@
|
|
|
157
157
|
"zod": "^3.24.2",
|
|
158
158
|
"zod-to-json-schema": "^3.24.4",
|
|
159
159
|
"zod-to-ts": "^1.2.0",
|
|
160
|
-
"@blocklet/pages-kit": "0.4.
|
|
160
|
+
"@blocklet/pages-kit": "0.4.67"
|
|
161
161
|
},
|
|
162
162
|
"scripts": {
|
|
163
163
|
"lint": "eslint src --ext .mjs,.js,.jsx,.ts,.tsx",
|