@blocklet/pages-kit-block-studio 0.6.17 → 0.6.19
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/plugins/vite-plugin-block-studio.js +1 -0
- package/lib/cjs/tsconfig.tsbuildinfo +1 -1
- package/lib/cjs/utils/zod-utils.js +7 -0
- package/lib/esm/plugins/vite-plugin-block-studio.js +1 -0
- package/lib/esm/tsconfig.tsbuildinfo +1 -1
- package/lib/esm/utils/zod-utils.js +7 -0
- package/lib/types/tsconfig.tsbuildinfo +1 -1
- package/lib/types/utils/zod-utils.d.ts +1 -6
- package/package.json +6 -6
|
@@ -237,5 +237,12 @@ function zodSchemaToTypeString(schema, typeName, removeUndefined = true) {
|
|
|
237
237
|
* 从Zod schema生成JSON Schema
|
|
238
238
|
*/
|
|
239
239
|
function zodSchemaToJsonSchema(schema) {
|
|
240
|
+
// @ts-ignore zod 4.x support toJSONSchema
|
|
241
|
+
if (typeof zod_1.z?.toJSONSchema === 'function') {
|
|
242
|
+
// @ts-ignore
|
|
243
|
+
return zod_1.z.toJSONSchema(schema, {
|
|
244
|
+
target: 'draft-7',
|
|
245
|
+
});
|
|
246
|
+
}
|
|
240
247
|
return (0, zod_to_json_schema_1.zodToJsonSchema)(schema, { $refStrategy: 'none' });
|
|
241
248
|
}
|
|
@@ -57,6 +57,7 @@ const defaultBlockExternals = {
|
|
|
57
57
|
immer: '@blocklet/pages-kit/builtin/immer',
|
|
58
58
|
stream: '@blocklet/pages-kit/builtin/stream',
|
|
59
59
|
'@iconify/react': '@blocklet/pages-kit/builtin/iconify/react',
|
|
60
|
+
zod: '@blocklet/pages-kit/builtin/zod',
|
|
60
61
|
// 页面相关组件
|
|
61
62
|
'@blocklet/pages-kit/builtin/components': '@blocklet/pages-kit/builtin/components',
|
|
62
63
|
'@blocklet/pages-kit/builtin/page/header': '@blocklet/pages-kit/builtin/page/header',
|