@umijs/zod2ts 4.0.0-canary.20230314.1

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2017-present ChenCheng (sorrycc@gmail.com)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,3 @@
1
+ # @umijs/zod2ts
2
+
3
+ See our website [umijs](https://umijs.org) for more information.
@@ -0,0 +1,8 @@
1
+ import type { ZodTypeAny } from '@umijs/utils/compiled/zod';
2
+ import { GetType, RequiredZodToTsOptions, ZodToTsOptions, ZodToTsReturn } from './types';
3
+ import { createTypeAlias, printNode } from './utils';
4
+ export declare const resolveOptions: (raw?: ZodToTsOptions) => RequiredZodToTsOptions;
5
+ export declare const zodToTs: (zod: ZodTypeAny, identifier?: string, options?: ZodToTsOptions) => ZodToTsReturn;
6
+ export { withGetType } from './utils';
7
+ export { createTypeAlias, printNode };
8
+ export type { GetType, ZodToTsOptions };
package/dist/index.js ADDED
@@ -0,0 +1,312 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+
29
+ // src/index.ts
30
+ var src_exports = {};
31
+ __export(src_exports, {
32
+ createTypeAlias: () => import_utils.createTypeAlias,
33
+ printNode: () => import_utils.printNode,
34
+ resolveOptions: () => resolveOptions,
35
+ withGetType: () => import_utils2.withGetType,
36
+ zodToTs: () => zodToTs
37
+ });
38
+ module.exports = __toCommonJS(src_exports);
39
+ var import_typescript = __toESM(require("typescript"));
40
+ var import_utils = require("./utils");
41
+ var import_utils2 = require("./utils");
42
+ var { factory: f } = import_typescript.default;
43
+ var callGetType = (zod, identifier, options) => {
44
+ let type = null;
45
+ if (zod.getType)
46
+ type = zod.getType(import_typescript.default, identifier, options);
47
+ return type;
48
+ };
49
+ var resolveOptions = (raw) => {
50
+ const resolved = { resolveNativeEnums: true };
51
+ return { ...resolved, ...raw };
52
+ };
53
+ var zodToTs = (zod, identifier, options) => {
54
+ const resolvedIdentifier = identifier ?? "Identifier";
55
+ const resolvedOptions = resolveOptions(options);
56
+ const store = { nativeEnums: [] };
57
+ const node = zodToTsNode(zod, resolvedIdentifier, store, resolvedOptions);
58
+ return { node, store };
59
+ };
60
+ var zodToTsNode = (zod, identifier, store, options) => {
61
+ const { typeName } = zod._def;
62
+ const getTypeType = callGetType(zod, identifier, options);
63
+ if (getTypeType && typeName !== "ZodNativeEnum") {
64
+ return (0, import_utils.maybeIdentifierToTypeReference)(getTypeType);
65
+ }
66
+ const otherArgs = [identifier, store, options];
67
+ switch (typeName) {
68
+ case "ZodString":
69
+ return f.createKeywordTypeNode(import_typescript.default.SyntaxKind.StringKeyword);
70
+ case "ZodNumber":
71
+ return f.createKeywordTypeNode(import_typescript.default.SyntaxKind.NumberKeyword);
72
+ case "ZodBigInt":
73
+ return f.createKeywordTypeNode(import_typescript.default.SyntaxKind.BigIntKeyword);
74
+ case "ZodBoolean":
75
+ return f.createKeywordTypeNode(import_typescript.default.SyntaxKind.BooleanKeyword);
76
+ case "ZodDate":
77
+ return f.createTypeReferenceNode(f.createIdentifier("Date"));
78
+ case "ZodUndefined":
79
+ return f.createKeywordTypeNode(import_typescript.default.SyntaxKind.UndefinedKeyword);
80
+ case "ZodNull":
81
+ return f.createLiteralTypeNode(f.createNull());
82
+ case "ZodVoid":
83
+ return f.createUnionTypeNode([
84
+ f.createKeywordTypeNode(import_typescript.default.SyntaxKind.VoidKeyword),
85
+ f.createKeywordTypeNode(import_typescript.default.SyntaxKind.UndefinedKeyword)
86
+ ]);
87
+ case "ZodAny":
88
+ return f.createKeywordTypeNode(import_typescript.default.SyntaxKind.AnyKeyword);
89
+ case "ZodUnknown":
90
+ return (0, import_utils.createUnknownKeywordNode)();
91
+ case "ZodNever":
92
+ return f.createKeywordTypeNode(import_typescript.default.SyntaxKind.NeverKeyword);
93
+ case "ZodLazy": {
94
+ if (!getTypeType)
95
+ return (0, import_utils.createTypeReferenceFromString)(identifier);
96
+ break;
97
+ }
98
+ case "ZodLiteral": {
99
+ let literal;
100
+ const literalValue = zod._def.value;
101
+ switch (typeof literalValue) {
102
+ case "number":
103
+ literal = f.createNumericLiteral(literalValue);
104
+ break;
105
+ case "boolean":
106
+ if (literalValue === true)
107
+ literal = f.createTrue();
108
+ else
109
+ literal = f.createFalse();
110
+ break;
111
+ default:
112
+ literal = f.createStringLiteral(literalValue);
113
+ break;
114
+ }
115
+ return f.createLiteralTypeNode(literal);
116
+ }
117
+ case "ZodObject": {
118
+ const properties = Object.entries(zod._def.shape());
119
+ const members = properties.map(([key, value]) => {
120
+ const nextZodNode = value;
121
+ const type = zodToTsNode(nextZodNode, ...otherArgs);
122
+ const { typeName: nextZodNodeTypeName } = nextZodNode._def;
123
+ const isOptional = nextZodNodeTypeName === "ZodOptional" || nextZodNode.isOptional();
124
+ const propertySignature = f.createPropertySignature(
125
+ void 0,
126
+ (0, import_utils.getIdentifierOrStringLiteral)(key),
127
+ isOptional ? f.createToken(import_typescript.default.SyntaxKind.QuestionToken) : void 0,
128
+ type
129
+ );
130
+ if (nextZodNode.description) {
131
+ (0, import_utils.addJsDocComment)(propertySignature, nextZodNode.description);
132
+ }
133
+ return propertySignature;
134
+ });
135
+ return f.createTypeLiteralNode(members);
136
+ }
137
+ case "ZodArray": {
138
+ const type = zodToTsNode(zod._def.type, ...otherArgs);
139
+ const node = f.createArrayTypeNode(type);
140
+ return node;
141
+ }
142
+ case "ZodEnum": {
143
+ const types = zod._def.values.map(
144
+ (value) => f.createStringLiteral(value)
145
+ );
146
+ return f.createUnionTypeNode(types);
147
+ }
148
+ case "ZodUnion": {
149
+ const options2 = zod._def.options;
150
+ const types = options2.map(
151
+ (option) => zodToTsNode(option, ...otherArgs)
152
+ );
153
+ return f.createUnionTypeNode(types);
154
+ }
155
+ case "ZodDiscriminatedUnion": {
156
+ const options2 = [...zod._def.options.values()];
157
+ const types = options2.map(
158
+ (option) => zodToTsNode(option, ...otherArgs)
159
+ );
160
+ return f.createUnionTypeNode(types);
161
+ }
162
+ case "ZodEffects": {
163
+ const node = zodToTsNode(zod._def.schema, ...otherArgs);
164
+ return node;
165
+ }
166
+ case "ZodNativeEnum": {
167
+ let type = getTypeType;
168
+ if (!type)
169
+ return (0, import_utils.createUnknownKeywordNode)();
170
+ if (options.resolveNativeEnums) {
171
+ const enumMembers = Object.entries(
172
+ zod._def.values
173
+ ).map(([key, value]) => {
174
+ const literal = typeof value === "number" ? f.createNumericLiteral(value) : f.createStringLiteral(value);
175
+ return f.createEnumMember((0, import_utils.getIdentifierOrStringLiteral)(key), literal);
176
+ });
177
+ if (import_typescript.default.isIdentifier(type)) {
178
+ store.nativeEnums.push(
179
+ f.createEnumDeclaration(void 0, type, enumMembers)
180
+ );
181
+ } else {
182
+ throw new Error(
183
+ "getType on nativeEnum must return an identifier when resolveNativeEnums is set"
184
+ );
185
+ }
186
+ }
187
+ type = (0, import_utils.maybeIdentifierToTypeReference)(type);
188
+ return type;
189
+ }
190
+ case "ZodOptional": {
191
+ const innerType = zodToTsNode(
192
+ zod._def.innerType,
193
+ ...otherArgs
194
+ );
195
+ return f.createUnionTypeNode([
196
+ innerType,
197
+ f.createKeywordTypeNode(import_typescript.default.SyntaxKind.UndefinedKeyword)
198
+ ]);
199
+ }
200
+ case "ZodNullable": {
201
+ const innerType = zodToTsNode(
202
+ zod._def.innerType,
203
+ ...otherArgs
204
+ );
205
+ return f.createUnionTypeNode([
206
+ innerType,
207
+ f.createLiteralTypeNode(f.createNull())
208
+ ]);
209
+ }
210
+ case "ZodTuple": {
211
+ const types = zod._def.items.map(
212
+ (option) => zodToTsNode(option, ...otherArgs)
213
+ );
214
+ return f.createTupleTypeNode(types);
215
+ }
216
+ case "ZodRecord": {
217
+ const valueType = zodToTsNode(zod._def.valueType, ...otherArgs);
218
+ const node = f.createTypeLiteralNode([
219
+ f.createIndexSignature(
220
+ void 0,
221
+ [
222
+ f.createParameterDeclaration(
223
+ void 0,
224
+ void 0,
225
+ f.createIdentifier("x"),
226
+ void 0,
227
+ f.createKeywordTypeNode(import_typescript.default.SyntaxKind.StringKeyword),
228
+ void 0
229
+ )
230
+ ],
231
+ valueType
232
+ )
233
+ ]);
234
+ return node;
235
+ }
236
+ case "ZodMap": {
237
+ const valueType = zodToTsNode(zod._def.valueType, ...otherArgs);
238
+ const keyType = zodToTsNode(zod._def.keyType, ...otherArgs);
239
+ const node = f.createTypeReferenceNode(f.createIdentifier("Map"), [
240
+ keyType,
241
+ valueType
242
+ ]);
243
+ return node;
244
+ }
245
+ case "ZodSet": {
246
+ const type = zodToTsNode(zod._def.valueType, ...otherArgs);
247
+ const node = f.createTypeReferenceNode(f.createIdentifier("Set"), [type]);
248
+ return node;
249
+ }
250
+ case "ZodIntersection": {
251
+ const left = zodToTsNode(zod._def.left, ...otherArgs);
252
+ const right = zodToTsNode(zod._def.right, ...otherArgs);
253
+ const node = f.createIntersectionTypeNode([left, right]);
254
+ return node;
255
+ }
256
+ case "ZodPromise": {
257
+ const type = zodToTsNode(zod._def.type, ...otherArgs);
258
+ const node = f.createTypeReferenceNode(f.createIdentifier("Promise"), [
259
+ type
260
+ ]);
261
+ return node;
262
+ }
263
+ case "ZodFunction": {
264
+ const argTypes = zod._def.args._def.items.map(
265
+ (arg, index) => {
266
+ const argType = zodToTsNode(arg, ...otherArgs);
267
+ return f.createParameterDeclaration(
268
+ void 0,
269
+ void 0,
270
+ f.createIdentifier(`args_${index}`),
271
+ void 0,
272
+ argType,
273
+ void 0
274
+ );
275
+ }
276
+ );
277
+ argTypes.push(
278
+ f.createParameterDeclaration(
279
+ void 0,
280
+ f.createToken(import_typescript.default.SyntaxKind.DotDotDotToken),
281
+ f.createIdentifier(`args_${argTypes.length}`),
282
+ void 0,
283
+ f.createArrayTypeNode((0, import_utils.createUnknownKeywordNode)()),
284
+ void 0
285
+ )
286
+ );
287
+ const returnType = zodToTsNode(zod._def.returns, ...otherArgs);
288
+ const node = f.createFunctionTypeNode(void 0, argTypes, returnType);
289
+ return node;
290
+ }
291
+ case "ZodDefault": {
292
+ const type = zodToTsNode(zod._def.innerType, ...otherArgs);
293
+ const filteredNodes = [];
294
+ type.forEachChild((node) => {
295
+ if (![import_typescript.default.SyntaxKind.UndefinedKeyword].includes(node.kind)) {
296
+ filteredNodes.push(node);
297
+ }
298
+ });
299
+ type.types = filteredNodes;
300
+ return type;
301
+ }
302
+ }
303
+ return f.createKeywordTypeNode(import_typescript.default.SyntaxKind.AnyKeyword);
304
+ };
305
+ // Annotate the CommonJS export names for ESM import in node:
306
+ 0 && (module.exports = {
307
+ createTypeAlias,
308
+ printNode,
309
+ resolveOptions,
310
+ withGetType,
311
+ zodToTs
312
+ });
@@ -0,0 +1,17 @@
1
+ import ts from 'typescript';
2
+ export declare type LiteralType = string | number | boolean;
3
+ export declare type ZodToTsOptions = {
4
+ resolveNativeEnums?: boolean;
5
+ };
6
+ export declare type RequiredZodToTsOptions = Required<ZodToTsOptions>;
7
+ export declare type ZodToTsStore = {
8
+ nativeEnums: ts.EnumDeclaration[];
9
+ };
10
+ export declare type ZodToTsReturn = {
11
+ node: ts.TypeNode;
12
+ store: ZodToTsStore;
13
+ };
14
+ export declare type GetTypeFunction = (typescript: typeof ts, identifier: string, options: RequiredZodToTsOptions) => ts.Identifier | ts.TypeNode;
15
+ export declare type GetType = {
16
+ getType?: GetTypeFunction;
17
+ };
package/dist/types.js ADDED
@@ -0,0 +1,17 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __copyProps = (to, from, except, desc) => {
6
+ if (from && typeof from === "object" || typeof from === "function") {
7
+ for (let key of __getOwnPropNames(from))
8
+ if (!__hasOwnProp.call(to, key) && key !== except)
9
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
10
+ }
11
+ return to;
12
+ };
13
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
14
+
15
+ // src/types.ts
16
+ var types_exports = {};
17
+ module.exports = __toCommonJS(types_exports);
@@ -0,0 +1,11 @@
1
+ import type { ZodTypeAny } from '@umijs/utils/compiled/zod';
2
+ import ts from 'typescript';
3
+ import type { GetType, GetTypeFunction } from './types';
4
+ export declare const maybeIdentifierToTypeReference: (identifier: ts.Identifier | ts.TypeNode) => ts.TypeNode;
5
+ export declare const createTypeReferenceFromString: (identifier: string) => ts.TypeReferenceNode;
6
+ export declare const createUnknownKeywordNode: () => ts.KeywordTypeNode<ts.SyntaxKind.UnknownKeyword>;
7
+ export declare const createTypeAlias: (node: ts.TypeNode, identifier: string, comment?: string) => ts.TypeAliasDeclaration;
8
+ export declare const printNode: (node: ts.Node, printerOptions?: ts.PrinterOptions) => string;
9
+ export declare const withGetType: <T extends ZodTypeAny & GetType>(schema: T, getType: GetTypeFunction) => T;
10
+ export declare const getIdentifierOrStringLiteral: (str: string) => ts.Identifier | ts.StringLiteral;
11
+ export declare const addJsDocComment: (node: ts.Node, text: string) => void;
package/dist/utils.js ADDED
@@ -0,0 +1,104 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+
29
+ // src/utils.ts
30
+ var utils_exports = {};
31
+ __export(utils_exports, {
32
+ addJsDocComment: () => addJsDocComment,
33
+ createTypeAlias: () => createTypeAlias,
34
+ createTypeReferenceFromString: () => createTypeReferenceFromString,
35
+ createUnknownKeywordNode: () => createUnknownKeywordNode,
36
+ getIdentifierOrStringLiteral: () => getIdentifierOrStringLiteral,
37
+ maybeIdentifierToTypeReference: () => maybeIdentifierToTypeReference,
38
+ printNode: () => printNode,
39
+ withGetType: () => withGetType
40
+ });
41
+ module.exports = __toCommonJS(utils_exports);
42
+ var import_typescript = __toESM(require("typescript"));
43
+ var { factory: f } = import_typescript.default;
44
+ var maybeIdentifierToTypeReference = (identifier) => {
45
+ if (import_typescript.default.isIdentifier(identifier)) {
46
+ return f.createTypeReferenceNode(identifier);
47
+ }
48
+ return identifier;
49
+ };
50
+ var createTypeReferenceFromString = (identifier) => f.createTypeReferenceNode(f.createIdentifier(identifier));
51
+ var createUnknownKeywordNode = () => f.createKeywordTypeNode(import_typescript.default.SyntaxKind.UnknownKeyword);
52
+ var createTypeAlias = (node, identifier, comment) => {
53
+ const typeAlias = f.createTypeAliasDeclaration(
54
+ void 0,
55
+ f.createIdentifier(identifier),
56
+ void 0,
57
+ node
58
+ );
59
+ if (comment) {
60
+ addJsDocComment(typeAlias, comment);
61
+ }
62
+ return typeAlias;
63
+ };
64
+ var printNode = (node, printerOptions) => {
65
+ const sourceFile = import_typescript.default.createSourceFile(
66
+ "print.ts",
67
+ "",
68
+ import_typescript.default.ScriptTarget.Latest,
69
+ false,
70
+ import_typescript.default.ScriptKind.TS
71
+ );
72
+ const printer = import_typescript.default.createPrinter(printerOptions);
73
+ return printer.printNode(import_typescript.default.EmitHint.Unspecified, node, sourceFile);
74
+ };
75
+ var withGetType = (schema, getType) => {
76
+ schema.getType = getType;
77
+ return schema;
78
+ };
79
+ var identifierRE = /^[A-Za-z_$][A-Za-z0-9_$]*$/;
80
+ var getIdentifierOrStringLiteral = (str) => {
81
+ if (identifierRE.test(str)) {
82
+ return f.createIdentifier(str);
83
+ }
84
+ return f.createStringLiteral(str);
85
+ };
86
+ var addJsDocComment = (node, text) => {
87
+ import_typescript.default.addSyntheticLeadingComment(
88
+ node,
89
+ import_typescript.default.SyntaxKind.MultiLineCommentTrivia,
90
+ `* ${text} `,
91
+ true
92
+ );
93
+ };
94
+ // Annotate the CommonJS export names for ESM import in node:
95
+ 0 && (module.exports = {
96
+ addJsDocComment,
97
+ createTypeAlias,
98
+ createTypeReferenceFromString,
99
+ createUnknownKeywordNode,
100
+ getIdentifierOrStringLiteral,
101
+ maybeIdentifierToTypeReference,
102
+ printNode,
103
+ withGetType
104
+ });
package/package.json ADDED
@@ -0,0 +1,35 @@
1
+ {
2
+ "name": "@umijs/zod2ts",
3
+ "version": "4.0.0-canary.20230314.1",
4
+ "description": "@umijs/zod2ts",
5
+ "homepage": "https://github.com/umijs/umi/tree/master/packages/zod2ts#readme",
6
+ "bugs": "https://github.com/umijs/umi/issues",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "https://github.com/umijs/umi"
10
+ },
11
+ "license": "MIT",
12
+ "main": "dist/index.js",
13
+ "types": "dist/index.d.ts",
14
+ "files": [
15
+ "dist"
16
+ ],
17
+ "dependencies": {
18
+ "@umijs/utils": "4.0.0-canary.20230314.1"
19
+ },
20
+ "peerDependencies": {
21
+ "typescript": "^4"
22
+ },
23
+ "publishConfig": {
24
+ "access": "public"
25
+ },
26
+ "authors": [
27
+ "chencheng <sorrycc@gmail.com> (https://github.com/sorrycc)"
28
+ ],
29
+ "scripts": {
30
+ "build": "umi-scripts father build",
31
+ "build:deps": "umi-scripts bundleDeps",
32
+ "dev": "umi-scripts father dev",
33
+ "test": "umi-scripts jest-turbo"
34
+ }
35
+ }