@lsby/net-core 0.0.24 → 0.0.25

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.
@@ -63,6 +63,7 @@ var Log = class _Log {
63
63
  // src/bin/gen-list/index.ts
64
64
  async function main(tsconfigPath, interfaceFolderPath, outFilePath) {
65
65
  var log = new Log("@lsby:net-core").extend("gen-list");
66
+ await log.debug("\u51C6\u5907\u751F\u6210\u63A5\u53E3\u5217\u8868...");
66
67
  const \u9879\u76EE\u6839\u8DEF\u5F84 = import_node_path.default.dirname(tsconfigPath);
67
68
  const tsconfigJson = import_typescript.default.parseConfigFileTextToJson(tsconfigPath, import_node_fs.default.readFileSync(tsconfigPath, "utf8"));
68
69
  if (tsconfigJson.error) {
@@ -68,6 +68,7 @@ var Log = class _Log {
68
68
  // src/bin/gen-list/index.ts
69
69
  async function main(tsconfigPath, interfaceFolderPath, outFilePath) {
70
70
  var log = new Log("@lsby:net-core").extend("gen-list");
71
+ await log.debug("\u51C6\u5907\u751F\u6210\u63A5\u53E3\u5217\u8868...");
71
72
  const \u9879\u76EE\u6839\u8DEF\u5F84 = import_node_path.default.dirname(tsconfigPath);
72
73
  const tsconfigJson = import_typescript.default.parseConfigFileTextToJson(tsconfigPath, import_node_fs.default.readFileSync(tsconfigPath, "utf8"));
73
74
  if (tsconfigJson.error) {
@@ -63,6 +63,7 @@ var Log = class _Log {
63
63
  // src/bin/gen-test/index.ts
64
64
  async function main(tsconfigPath, interfaceFolderPath, outFilePath, filter) {
65
65
  var log = new Log("@lsby:net-core").extend("gen-test");
66
+ await log.debug("\u51C6\u5907\u751F\u6210\u6D4B\u8BD5\u6587\u4EF6...");
66
67
  const projectRootPath = import_node_path.default.dirname(tsconfigPath);
67
68
  const tsconfigJson = import_typescript.default.parseConfigFileTextToJson(tsconfigPath, import_node_fs.default.readFileSync(tsconfigPath, "utf8"));
68
69
  if (tsconfigJson.error) {
@@ -68,6 +68,7 @@ var Log = class _Log {
68
68
  // src/bin/gen-test/index.ts
69
69
  async function main(tsconfigPath, interfaceFolderPath, outFilePath, filter) {
70
70
  var log = new Log("@lsby:net-core").extend("gen-test");
71
+ await log.debug("\u51C6\u5907\u751F\u6210\u6D4B\u8BD5\u6587\u4EF6...");
71
72
  const projectRootPath = import_node_path.default.dirname(tsconfigPath);
72
73
  const tsconfigJson = import_typescript.default.parseConfigFileTextToJson(tsconfigPath, import_node_fs.default.readFileSync(tsconfigPath, "utf8"));
73
74
  if (tsconfigJson.error) {
@@ -63,28 +63,26 @@ var Log = class _Log {
63
63
 
64
64
  // src/bin/gen-type/calc-code.ts
65
65
  var calcCode = `
66
- import type { \u63A5\u53E3\u7C7B\u578B, JSON\u89E3\u6790\u63D2\u4EF6 } from "@lsby/net-core"
67
- import type { z } from "zod"
66
+ import type { z } from 'zod'
67
+ import type { \u5408\u5E76JSON\u63D2\u4EF6\u7ED3\u679C, \u63A5\u53E3\u7C7B\u578B } from '@lsby/net-core'
68
+ import exportedApiSchema from './type'
68
69
 
69
- import exportedApiSchema from "./type"
70
-
71
- type GetApiInputFromPreApi<PreApis> = PreApis extends []
72
- ? {}
73
- : PreApis extends [infer x, ...infer xs]
74
- ? x extends JSON\u89E3\u6790\u63D2\u4EF6<infer input>
75
- ? z.infer<input>
76
- : GetApiInputFromPreApi<xs>
77
- : {}
78
-
79
- type Api = (typeof exportedApiSchema) extends \u63A5\u53E3\u7C7B\u578B<infer Path, infer Method, infer PreApis, infer SuccessSchema, infer ErrorSchema>
80
- ? {
81
- path: Path,
82
- method: Method,
83
- input: GetApiInputFromPreApi<PreApis>,
84
- successOutput: z.infer<SuccessSchema>,
85
- errorOutput: z.infer<ErrorSchema>,
86
- }
87
- : never
70
+ type Api =
71
+ typeof exportedApiSchema extends \u63A5\u53E3\u7C7B\u578B<
72
+ infer Path,
73
+ infer Method,
74
+ infer PreApis,
75
+ infer SuccessSchema,
76
+ infer ErrorSchema
77
+ >
78
+ ? {
79
+ path: Path
80
+ method: Method
81
+ input: \u5408\u5E76JSON\u63D2\u4EF6\u7ED3\u679C<PreApis>
82
+ successOutput: z.infer<SuccessSchema>
83
+ errorOutput: z.infer<ErrorSchema>
84
+ }
85
+ : never
88
86
 
89
87
  export default Api
90
88
  `;
@@ -92,6 +90,7 @@ export default Api
92
90
  // src/bin/gen-type/index.ts
93
91
  async function main(tsconfigPath, apiFolderPath, outputPath) {
94
92
  var log = new Log("@lsby:net-core").extend("gen-type");
93
+ await log.debug("\u51C6\u5907\u751F\u6210\u7C7B\u578B\u6587\u4EF6...");
95
94
  const tsconfigJson = import_typescript.default.parseConfigFileTextToJson(tsconfigPath, import_node_fs.default.readFileSync(tsconfigPath, "utf8"));
96
95
  if (tsconfigJson.error) {
97
96
  throw new Error("\u65E0\u6CD5\u89E3\u6790 tsconfig.json");
@@ -24,28 +24,26 @@ __export(calc_code_exports, {
24
24
  });
25
25
  module.exports = __toCommonJS(calc_code_exports);
26
26
  var calcCode = `
27
- import type { \u63A5\u53E3\u7C7B\u578B, JSON\u89E3\u6790\u63D2\u4EF6 } from "@lsby/net-core"
28
- import type { z } from "zod"
27
+ import type { z } from 'zod'
28
+ import type { \u5408\u5E76JSON\u63D2\u4EF6\u7ED3\u679C, \u63A5\u53E3\u7C7B\u578B } from '@lsby/net-core'
29
+ import exportedApiSchema from './type'
29
30
 
30
- import exportedApiSchema from "./type"
31
-
32
- type GetApiInputFromPreApi<PreApis> = PreApis extends []
33
- ? {}
34
- : PreApis extends [infer x, ...infer xs]
35
- ? x extends JSON\u89E3\u6790\u63D2\u4EF6<infer input>
36
- ? z.infer<input>
37
- : GetApiInputFromPreApi<xs>
38
- : {}
39
-
40
- type Api = (typeof exportedApiSchema) extends \u63A5\u53E3\u7C7B\u578B<infer Path, infer Method, infer PreApis, infer SuccessSchema, infer ErrorSchema>
41
- ? {
42
- path: Path,
43
- method: Method,
44
- input: GetApiInputFromPreApi<PreApis>,
45
- successOutput: z.infer<SuccessSchema>,
46
- errorOutput: z.infer<ErrorSchema>,
47
- }
48
- : never
31
+ type Api =
32
+ typeof exportedApiSchema extends \u63A5\u53E3\u7C7B\u578B<
33
+ infer Path,
34
+ infer Method,
35
+ infer PreApis,
36
+ infer SuccessSchema,
37
+ infer ErrorSchema
38
+ >
39
+ ? {
40
+ path: Path
41
+ method: Method
42
+ input: \u5408\u5E76JSON\u63D2\u4EF6\u7ED3\u679C<PreApis>
43
+ successOutput: z.infer<SuccessSchema>
44
+ errorOutput: z.infer<ErrorSchema>
45
+ }
46
+ : never
49
47
 
50
48
  export default Api
51
49
  `;
@@ -1,3 +1,3 @@
1
- declare const calcCode = "\nimport type { \u63A5\u53E3\u7C7B\u578B, JSON\u89E3\u6790\u63D2\u4EF6 } from \"@lsby/net-core\"\nimport type { z } from \"zod\"\n\nimport exportedApiSchema from \"./type\"\n\ntype GetApiInputFromPreApi<PreApis> = PreApis extends []\n ? {}\n : PreApis extends [infer x, ...infer xs]\n ? x extends JSON\u89E3\u6790\u63D2\u4EF6<infer input>\n ? z.infer<input>\n : GetApiInputFromPreApi<xs>\n : {}\n\ntype Api = (typeof exportedApiSchema) extends \u63A5\u53E3\u7C7B\u578B<infer Path, infer Method, infer PreApis, infer SuccessSchema, infer ErrorSchema>\n ? {\n path: Path,\n method: Method,\n input: GetApiInputFromPreApi<PreApis>,\n successOutput: z.infer<SuccessSchema>,\n errorOutput: z.infer<ErrorSchema>,\n }\n : never\n\nexport default Api\n";
1
+ declare const calcCode = "\nimport type { z } from 'zod'\nimport type { \u5408\u5E76JSON\u63D2\u4EF6\u7ED3\u679C, \u63A5\u53E3\u7C7B\u578B } from '@lsby/net-core'\nimport exportedApiSchema from './type'\n\ntype Api =\n typeof exportedApiSchema extends \u63A5\u53E3\u7C7B\u578B<\n infer Path,\n infer Method,\n infer PreApis,\n infer SuccessSchema,\n infer ErrorSchema\n >\n ? {\n path: Path\n method: Method\n input: \u5408\u5E76JSON\u63D2\u4EF6\u7ED3\u679C<PreApis>\n successOutput: z.infer<SuccessSchema>\n errorOutput: z.infer<ErrorSchema>\n }\n : never\n\nexport default Api\n";
2
2
 
3
3
  export { calcCode };
@@ -68,28 +68,26 @@ var Log = class _Log {
68
68
 
69
69
  // src/bin/gen-type/calc-code.ts
70
70
  var calcCode = `
71
- import type { \u63A5\u53E3\u7C7B\u578B, JSON\u89E3\u6790\u63D2\u4EF6 } from "@lsby/net-core"
72
- import type { z } from "zod"
71
+ import type { z } from 'zod'
72
+ import type { \u5408\u5E76JSON\u63D2\u4EF6\u7ED3\u679C, \u63A5\u53E3\u7C7B\u578B } from '@lsby/net-core'
73
+ import exportedApiSchema from './type'
73
74
 
74
- import exportedApiSchema from "./type"
75
-
76
- type GetApiInputFromPreApi<PreApis> = PreApis extends []
77
- ? {}
78
- : PreApis extends [infer x, ...infer xs]
79
- ? x extends JSON\u89E3\u6790\u63D2\u4EF6<infer input>
80
- ? z.infer<input>
81
- : GetApiInputFromPreApi<xs>
82
- : {}
83
-
84
- type Api = (typeof exportedApiSchema) extends \u63A5\u53E3\u7C7B\u578B<infer Path, infer Method, infer PreApis, infer SuccessSchema, infer ErrorSchema>
85
- ? {
86
- path: Path,
87
- method: Method,
88
- input: GetApiInputFromPreApi<PreApis>,
89
- successOutput: z.infer<SuccessSchema>,
90
- errorOutput: z.infer<ErrorSchema>,
91
- }
92
- : never
75
+ type Api =
76
+ typeof exportedApiSchema extends \u63A5\u53E3\u7C7B\u578B<
77
+ infer Path,
78
+ infer Method,
79
+ infer PreApis,
80
+ infer SuccessSchema,
81
+ infer ErrorSchema
82
+ >
83
+ ? {
84
+ path: Path
85
+ method: Method
86
+ input: \u5408\u5E76JSON\u63D2\u4EF6\u7ED3\u679C<PreApis>
87
+ successOutput: z.infer<SuccessSchema>
88
+ errorOutput: z.infer<ErrorSchema>
89
+ }
90
+ : never
93
91
 
94
92
  export default Api
95
93
  `;
@@ -97,6 +95,7 @@ export default Api
97
95
  // src/bin/gen-type/index.ts
98
96
  async function main(tsconfigPath, apiFolderPath, outputPath) {
99
97
  var log = new Log("@lsby:net-core").extend("gen-type");
98
+ await log.debug("\u51C6\u5907\u751F\u6210\u7C7B\u578B\u6587\u4EF6...");
100
99
  const tsconfigJson = import_typescript.default.parseConfigFileTextToJson(tsconfigPath, import_node_fs.default.readFileSync(tsconfigPath, "utf8"));
101
100
  if (tsconfigJson.error) {
102
101
  throw new Error("\u65E0\u6CD5\u89E3\u6790 tsconfig.json");
@@ -63,6 +63,7 @@ var Log = class _Log {
63
63
  // src/bin/gen-list/index.ts
64
64
  async function main(tsconfigPath, interfaceFolderPath, outFilePath) {
65
65
  var log = new Log("@lsby:net-core").extend("gen-list");
66
+ await log.debug("\u51C6\u5907\u751F\u6210\u63A5\u53E3\u5217\u8868...");
66
67
  const \u9879\u76EE\u6839\u8DEF\u5F84 = import_node_path.default.dirname(tsconfigPath);
67
68
  const tsconfigJson = import_typescript.default.parseConfigFileTextToJson(tsconfigPath, import_node_fs.default.readFileSync(tsconfigPath, "utf8"));
68
69
  if (tsconfigJson.error) {
@@ -68,6 +68,7 @@ var Log = class _Log {
68
68
  // src/bin/gen-list/index.ts
69
69
  async function main(tsconfigPath, interfaceFolderPath, outFilePath) {
70
70
  var log = new Log("@lsby:net-core").extend("gen-list");
71
+ await log.debug("\u51C6\u5907\u751F\u6210\u63A5\u53E3\u5217\u8868...");
71
72
  const \u9879\u76EE\u6839\u8DEF\u5F84 = import_node_path.default.dirname(tsconfigPath);
72
73
  const tsconfigJson = import_typescript.default.parseConfigFileTextToJson(tsconfigPath, import_node_fs.default.readFileSync(tsconfigPath, "utf8"));
73
74
  if (tsconfigJson.error) {
@@ -63,6 +63,7 @@ var Log = class _Log {
63
63
  // src/bin/gen-test/index.ts
64
64
  async function main(tsconfigPath, interfaceFolderPath, outFilePath, filter) {
65
65
  var log = new Log("@lsby:net-core").extend("gen-test");
66
+ await log.debug("\u51C6\u5907\u751F\u6210\u6D4B\u8BD5\u6587\u4EF6...");
66
67
  const projectRootPath = import_node_path.default.dirname(tsconfigPath);
67
68
  const tsconfigJson = import_typescript.default.parseConfigFileTextToJson(tsconfigPath, import_node_fs.default.readFileSync(tsconfigPath, "utf8"));
68
69
  if (tsconfigJson.error) {
@@ -68,6 +68,7 @@ var Log = class _Log {
68
68
  // src/bin/gen-test/index.ts
69
69
  async function main(tsconfigPath, interfaceFolderPath, outFilePath, filter) {
70
70
  var log = new Log("@lsby:net-core").extend("gen-test");
71
+ await log.debug("\u51C6\u5907\u751F\u6210\u6D4B\u8BD5\u6587\u4EF6...");
71
72
  const projectRootPath = import_node_path.default.dirname(tsconfigPath);
72
73
  const tsconfigJson = import_typescript.default.parseConfigFileTextToJson(tsconfigPath, import_node_fs.default.readFileSync(tsconfigPath, "utf8"));
73
74
  if (tsconfigJson.error) {
@@ -63,28 +63,26 @@ var Log = class _Log {
63
63
 
64
64
  // src/bin/gen-type/calc-code.ts
65
65
  var calcCode = `
66
- import type { \u63A5\u53E3\u7C7B\u578B, JSON\u89E3\u6790\u63D2\u4EF6 } from "@lsby/net-core"
67
- import type { z } from "zod"
66
+ import type { z } from 'zod'
67
+ import type { \u5408\u5E76JSON\u63D2\u4EF6\u7ED3\u679C, \u63A5\u53E3\u7C7B\u578B } from '@lsby/net-core'
68
+ import exportedApiSchema from './type'
68
69
 
69
- import exportedApiSchema from "./type"
70
-
71
- type GetApiInputFromPreApi<PreApis> = PreApis extends []
72
- ? {}
73
- : PreApis extends [infer x, ...infer xs]
74
- ? x extends JSON\u89E3\u6790\u63D2\u4EF6<infer input>
75
- ? z.infer<input>
76
- : GetApiInputFromPreApi<xs>
77
- : {}
78
-
79
- type Api = (typeof exportedApiSchema) extends \u63A5\u53E3\u7C7B\u578B<infer Path, infer Method, infer PreApis, infer SuccessSchema, infer ErrorSchema>
80
- ? {
81
- path: Path,
82
- method: Method,
83
- input: GetApiInputFromPreApi<PreApis>,
84
- successOutput: z.infer<SuccessSchema>,
85
- errorOutput: z.infer<ErrorSchema>,
86
- }
87
- : never
70
+ type Api =
71
+ typeof exportedApiSchema extends \u63A5\u53E3\u7C7B\u578B<
72
+ infer Path,
73
+ infer Method,
74
+ infer PreApis,
75
+ infer SuccessSchema,
76
+ infer ErrorSchema
77
+ >
78
+ ? {
79
+ path: Path
80
+ method: Method
81
+ input: \u5408\u5E76JSON\u63D2\u4EF6\u7ED3\u679C<PreApis>
82
+ successOutput: z.infer<SuccessSchema>
83
+ errorOutput: z.infer<ErrorSchema>
84
+ }
85
+ : never
88
86
 
89
87
  export default Api
90
88
  `;
@@ -92,6 +90,7 @@ export default Api
92
90
  // src/bin/gen-type/index.ts
93
91
  async function main(tsconfigPath, apiFolderPath, outputPath) {
94
92
  var log = new Log("@lsby:net-core").extend("gen-type");
93
+ await log.debug("\u51C6\u5907\u751F\u6210\u7C7B\u578B\u6587\u4EF6...");
95
94
  const tsconfigJson = import_typescript.default.parseConfigFileTextToJson(tsconfigPath, import_node_fs.default.readFileSync(tsconfigPath, "utf8"));
96
95
  if (tsconfigJson.error) {
97
96
  throw new Error("\u65E0\u6CD5\u89E3\u6790 tsconfig.json");
@@ -24,28 +24,26 @@ __export(calc_code_exports, {
24
24
  });
25
25
  module.exports = __toCommonJS(calc_code_exports);
26
26
  var calcCode = `
27
- import type { \u63A5\u53E3\u7C7B\u578B, JSON\u89E3\u6790\u63D2\u4EF6 } from "@lsby/net-core"
28
- import type { z } from "zod"
27
+ import type { z } from 'zod'
28
+ import type { \u5408\u5E76JSON\u63D2\u4EF6\u7ED3\u679C, \u63A5\u53E3\u7C7B\u578B } from '@lsby/net-core'
29
+ import exportedApiSchema from './type'
29
30
 
30
- import exportedApiSchema from "./type"
31
-
32
- type GetApiInputFromPreApi<PreApis> = PreApis extends []
33
- ? {}
34
- : PreApis extends [infer x, ...infer xs]
35
- ? x extends JSON\u89E3\u6790\u63D2\u4EF6<infer input>
36
- ? z.infer<input>
37
- : GetApiInputFromPreApi<xs>
38
- : {}
39
-
40
- type Api = (typeof exportedApiSchema) extends \u63A5\u53E3\u7C7B\u578B<infer Path, infer Method, infer PreApis, infer SuccessSchema, infer ErrorSchema>
41
- ? {
42
- path: Path,
43
- method: Method,
44
- input: GetApiInputFromPreApi<PreApis>,
45
- successOutput: z.infer<SuccessSchema>,
46
- errorOutput: z.infer<ErrorSchema>,
47
- }
48
- : never
31
+ type Api =
32
+ typeof exportedApiSchema extends \u63A5\u53E3\u7C7B\u578B<
33
+ infer Path,
34
+ infer Method,
35
+ infer PreApis,
36
+ infer SuccessSchema,
37
+ infer ErrorSchema
38
+ >
39
+ ? {
40
+ path: Path
41
+ method: Method
42
+ input: \u5408\u5E76JSON\u63D2\u4EF6\u7ED3\u679C<PreApis>
43
+ successOutput: z.infer<SuccessSchema>
44
+ errorOutput: z.infer<ErrorSchema>
45
+ }
46
+ : never
49
47
 
50
48
  export default Api
51
49
  `;
@@ -1,3 +1,3 @@
1
- declare const calcCode = "\nimport type { \u63A5\u53E3\u7C7B\u578B, JSON\u89E3\u6790\u63D2\u4EF6 } from \"@lsby/net-core\"\nimport type { z } from \"zod\"\n\nimport exportedApiSchema from \"./type\"\n\ntype GetApiInputFromPreApi<PreApis> = PreApis extends []\n ? {}\n : PreApis extends [infer x, ...infer xs]\n ? x extends JSON\u89E3\u6790\u63D2\u4EF6<infer input>\n ? z.infer<input>\n : GetApiInputFromPreApi<xs>\n : {}\n\ntype Api = (typeof exportedApiSchema) extends \u63A5\u53E3\u7C7B\u578B<infer Path, infer Method, infer PreApis, infer SuccessSchema, infer ErrorSchema>\n ? {\n path: Path,\n method: Method,\n input: GetApiInputFromPreApi<PreApis>,\n successOutput: z.infer<SuccessSchema>,\n errorOutput: z.infer<ErrorSchema>,\n }\n : never\n\nexport default Api\n";
1
+ declare const calcCode = "\nimport type { z } from 'zod'\nimport type { \u5408\u5E76JSON\u63D2\u4EF6\u7ED3\u679C, \u63A5\u53E3\u7C7B\u578B } from '@lsby/net-core'\nimport exportedApiSchema from './type'\n\ntype Api =\n typeof exportedApiSchema extends \u63A5\u53E3\u7C7B\u578B<\n infer Path,\n infer Method,\n infer PreApis,\n infer SuccessSchema,\n infer ErrorSchema\n >\n ? {\n path: Path\n method: Method\n input: \u5408\u5E76JSON\u63D2\u4EF6\u7ED3\u679C<PreApis>\n successOutput: z.infer<SuccessSchema>\n errorOutput: z.infer<ErrorSchema>\n }\n : never\n\nexport default Api\n";
2
2
 
3
3
  export { calcCode };
@@ -68,28 +68,26 @@ var Log = class _Log {
68
68
 
69
69
  // src/bin/gen-type/calc-code.ts
70
70
  var calcCode = `
71
- import type { \u63A5\u53E3\u7C7B\u578B, JSON\u89E3\u6790\u63D2\u4EF6 } from "@lsby/net-core"
72
- import type { z } from "zod"
71
+ import type { z } from 'zod'
72
+ import type { \u5408\u5E76JSON\u63D2\u4EF6\u7ED3\u679C, \u63A5\u53E3\u7C7B\u578B } from '@lsby/net-core'
73
+ import exportedApiSchema from './type'
73
74
 
74
- import exportedApiSchema from "./type"
75
-
76
- type GetApiInputFromPreApi<PreApis> = PreApis extends []
77
- ? {}
78
- : PreApis extends [infer x, ...infer xs]
79
- ? x extends JSON\u89E3\u6790\u63D2\u4EF6<infer input>
80
- ? z.infer<input>
81
- : GetApiInputFromPreApi<xs>
82
- : {}
83
-
84
- type Api = (typeof exportedApiSchema) extends \u63A5\u53E3\u7C7B\u578B<infer Path, infer Method, infer PreApis, infer SuccessSchema, infer ErrorSchema>
85
- ? {
86
- path: Path,
87
- method: Method,
88
- input: GetApiInputFromPreApi<PreApis>,
89
- successOutput: z.infer<SuccessSchema>,
90
- errorOutput: z.infer<ErrorSchema>,
91
- }
92
- : never
75
+ type Api =
76
+ typeof exportedApiSchema extends \u63A5\u53E3\u7C7B\u578B<
77
+ infer Path,
78
+ infer Method,
79
+ infer PreApis,
80
+ infer SuccessSchema,
81
+ infer ErrorSchema
82
+ >
83
+ ? {
84
+ path: Path
85
+ method: Method
86
+ input: \u5408\u5E76JSON\u63D2\u4EF6\u7ED3\u679C<PreApis>
87
+ successOutput: z.infer<SuccessSchema>
88
+ errorOutput: z.infer<ErrorSchema>
89
+ }
90
+ : never
93
91
 
94
92
  export default Api
95
93
  `;
@@ -97,6 +95,7 @@ export default Api
97
95
  // src/bin/gen-type/index.ts
98
96
  async function main(tsconfigPath, apiFolderPath, outputPath) {
99
97
  var log = new Log("@lsby:net-core").extend("gen-type");
98
+ await log.debug("\u51C6\u5907\u751F\u6210\u7C7B\u578B\u6587\u4EF6...");
100
99
  const tsconfigJson = import_typescript.default.parseConfigFileTextToJson(tsconfigPath, import_node_fs.default.readFileSync(tsconfigPath, "utf8"));
101
100
  if (tsconfigJson.error) {
102
101
  throw new Error("\u65E0\u6CD5\u89E3\u6790 tsconfig.json");
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  main
4
- } from "../../chunk-ALBZFUFF.js";
4
+ } from "../../chunk-WB2UYUI3.js";
5
5
  import "../../chunk-BZOQHDXK.js";
6
6
 
7
7
  // src/bin/gen-list/bin.ts
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  main
3
- } from "../../chunk-ALBZFUFF.js";
3
+ } from "../../chunk-WB2UYUI3.js";
4
4
  import "../../chunk-BZOQHDXK.js";
5
5
  export {
6
6
  main
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  main
4
- } from "../../chunk-VLNWJ4OM.js";
4
+ } from "../../chunk-HFRDMPQ4.js";
5
5
  import "../../chunk-BZOQHDXK.js";
6
6
 
7
7
  // src/bin/gen-test/bin.ts
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  main
3
- } from "../../chunk-VLNWJ4OM.js";
3
+ } from "../../chunk-HFRDMPQ4.js";
4
4
  import "../../chunk-BZOQHDXK.js";
5
5
  export {
6
6
  main
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  main
4
- } from "../../chunk-FXHL3NIN.js";
5
- import "../../chunk-23CY3P3G.js";
4
+ } from "../../chunk-KN7DZTQG.js";
5
+ import "../../chunk-IRKJYOPK.js";
6
6
  import "../../chunk-BZOQHDXK.js";
7
7
 
8
8
  // src/bin/gen-type/bin.ts
@@ -1,3 +1,3 @@
1
- declare const calcCode = "\nimport type { \u63A5\u53E3\u7C7B\u578B, JSON\u89E3\u6790\u63D2\u4EF6 } from \"@lsby/net-core\"\nimport type { z } from \"zod\"\n\nimport exportedApiSchema from \"./type\"\n\ntype GetApiInputFromPreApi<PreApis> = PreApis extends []\n ? {}\n : PreApis extends [infer x, ...infer xs]\n ? x extends JSON\u89E3\u6790\u63D2\u4EF6<infer input>\n ? z.infer<input>\n : GetApiInputFromPreApi<xs>\n : {}\n\ntype Api = (typeof exportedApiSchema) extends \u63A5\u53E3\u7C7B\u578B<infer Path, infer Method, infer PreApis, infer SuccessSchema, infer ErrorSchema>\n ? {\n path: Path,\n method: Method,\n input: GetApiInputFromPreApi<PreApis>,\n successOutput: z.infer<SuccessSchema>,\n errorOutput: z.infer<ErrorSchema>,\n }\n : never\n\nexport default Api\n";
1
+ declare const calcCode = "\nimport type { z } from 'zod'\nimport type { \u5408\u5E76JSON\u63D2\u4EF6\u7ED3\u679C, \u63A5\u53E3\u7C7B\u578B } from '@lsby/net-core'\nimport exportedApiSchema from './type'\n\ntype Api =\n typeof exportedApiSchema extends \u63A5\u53E3\u7C7B\u578B<\n infer Path,\n infer Method,\n infer PreApis,\n infer SuccessSchema,\n infer ErrorSchema\n >\n ? {\n path: Path\n method: Method\n input: \u5408\u5E76JSON\u63D2\u4EF6\u7ED3\u679C<PreApis>\n successOutput: z.infer<SuccessSchema>\n errorOutput: z.infer<ErrorSchema>\n }\n : never\n\nexport default Api\n";
2
2
 
3
3
  export { calcCode };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  calcCode
3
- } from "../../chunk-23CY3P3G.js";
3
+ } from "../../chunk-IRKJYOPK.js";
4
4
  export {
5
5
  calcCode
6
6
  };
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  main
3
- } from "../../chunk-FXHL3NIN.js";
4
- import "../../chunk-23CY3P3G.js";
3
+ } from "../../chunk-KN7DZTQG.js";
4
+ import "../../chunk-IRKJYOPK.js";
5
5
  import "../../chunk-BZOQHDXK.js";
6
6
  export {
7
7
  main
@@ -8,6 +8,7 @@ import path from "node:path";
8
8
  import ts from "typescript";
9
9
  async function main(tsconfigPath, interfaceFolderPath, outFilePath, filter) {
10
10
  var log = new Log("@lsby:net-core").extend("gen-test");
11
+ await log.debug("\u51C6\u5907\u751F\u6210\u6D4B\u8BD5\u6587\u4EF6...");
11
12
  const projectRootPath = path.dirname(tsconfigPath);
12
13
  const tsconfigJson = ts.parseConfigFileTextToJson(tsconfigPath, fs.readFileSync(tsconfigPath, "utf8"));
13
14
  if (tsconfigJson.error) {
@@ -0,0 +1,29 @@
1
+ // src/bin/gen-type/calc-code.ts
2
+ var calcCode = `
3
+ import type { z } from 'zod'
4
+ import type { \u5408\u5E76JSON\u63D2\u4EF6\u7ED3\u679C, \u63A5\u53E3\u7C7B\u578B } from '@lsby/net-core'
5
+ import exportedApiSchema from './type'
6
+
7
+ type Api =
8
+ typeof exportedApiSchema extends \u63A5\u53E3\u7C7B\u578B<
9
+ infer Path,
10
+ infer Method,
11
+ infer PreApis,
12
+ infer SuccessSchema,
13
+ infer ErrorSchema
14
+ >
15
+ ? {
16
+ path: Path
17
+ method: Method
18
+ input: \u5408\u5E76JSON\u63D2\u4EF6\u7ED3\u679C<PreApis>
19
+ successOutput: z.infer<SuccessSchema>
20
+ errorOutput: z.infer<ErrorSchema>
21
+ }
22
+ : never
23
+
24
+ export default Api
25
+ `;
26
+
27
+ export {
28
+ calcCode
29
+ };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  calcCode
3
- } from "./chunk-23CY3P3G.js";
3
+ } from "./chunk-IRKJYOPK.js";
4
4
  import {
5
5
  Log
6
6
  } from "./chunk-BZOQHDXK.js";
@@ -12,6 +12,7 @@ import path from "node:path";
12
12
  import ts from "typescript";
13
13
  async function main(tsconfigPath, apiFolderPath, outputPath) {
14
14
  var log = new Log("@lsby:net-core").extend("gen-type");
15
+ await log.debug("\u51C6\u5907\u751F\u6210\u7C7B\u578B\u6587\u4EF6...");
15
16
  const tsconfigJson = ts.parseConfigFileTextToJson(tsconfigPath, fs.readFileSync(tsconfigPath, "utf8"));
16
17
  if (tsconfigJson.error) {
17
18
  throw new Error("\u65E0\u6CD5\u89E3\u6790 tsconfig.json");
@@ -8,6 +8,7 @@ import path from "node:path";
8
8
  import ts from "typescript";
9
9
  async function main(tsconfigPath, interfaceFolderPath, outFilePath) {
10
10
  var log = new Log("@lsby:net-core").extend("gen-list");
11
+ await log.debug("\u51C6\u5907\u751F\u6210\u63A5\u53E3\u5217\u8868...");
11
12
  const \u9879\u76EE\u6839\u8DEF\u5F84 = path.dirname(tsconfigPath);
12
13
  const tsconfigJson = ts.parseConfigFileTextToJson(tsconfigPath, fs.readFileSync(tsconfigPath, "utf8"));
13
14
  if (tsconfigJson.error) {
package/dist/esm/index.js CHANGED
@@ -1,12 +1,21 @@
1
+ import {
2
+ JSON解析插件
3
+ } from "./chunk-B62YPABM.js";
1
4
  import {
2
5
  表单解析插件
3
6
  } from "./chunk-5UUMGDDD.js";
7
+ import {
8
+ 测试
9
+ } from "./chunk-I4WZG5LK.js";
4
10
  import {
5
11
  服务器
6
12
  } from "./chunk-VSYZY2NW.js";
7
13
  import {
8
- 测试
9
- } from "./chunk-I4WZG5LK.js";
14
+ 接口类型
15
+ } from "./chunk-SF5Z34AP.js";
16
+ import {
17
+ 接口
18
+ } from "./chunk-KRIDSMPV.js";
10
19
  import {
11
20
  正确JSON结果,
12
21
  正确结果,
@@ -15,24 +24,15 @@ import {
15
24
  错误JSON结果,
16
25
  错误结果
17
26
  } from "./chunk-HARBKRRI.js";
18
- import {
19
- 接口类型
20
- } from "./chunk-SF5Z34AP.js";
21
- import {
22
- 接口
23
- } from "./chunk-KRIDSMPV.js";
27
+ import "./chunk-ZSY7VBEW.js";
28
+ import "./chunk-LVYVPQ5V.js";
29
+ import "./chunk-BZOQHDXK.js";
24
30
  import {
25
31
  中文路径支持插件
26
32
  } from "./chunk-XG4VZZOX.js";
27
33
  import {
28
34
  自定义数据插件
29
35
  } from "./chunk-P6PGPAMW.js";
30
- import {
31
- JSON解析插件
32
- } from "./chunk-B62YPABM.js";
33
- import "./chunk-ZSY7VBEW.js";
34
- import "./chunk-LVYVPQ5V.js";
35
- import "./chunk-BZOQHDXK.js";
36
36
  import {
37
37
  插件
38
38
  } from "./chunk-KSZE2DTR.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lsby/net-core",
3
- "version": "0.0.24",
3
+ "version": "0.0.25",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  "require": "./dist/cjs/index.cjs",
@@ -45,7 +45,6 @@
45
45
  "prettier": "3.2.5",
46
46
  "prettier-plugin-packagejson": "^2.5.0",
47
47
  "tsup": "^8.0.2",
48
- "tsx": "^4.9.3",
49
48
  "typescript": "^5.4.5"
50
49
  },
51
50
  "peerDependencies": {
@@ -1,31 +0,0 @@
1
- // src/bin/gen-type/calc-code.ts
2
- var calcCode = `
3
- import type { \u63A5\u53E3\u7C7B\u578B, JSON\u89E3\u6790\u63D2\u4EF6 } from "@lsby/net-core"
4
- import type { z } from "zod"
5
-
6
- import exportedApiSchema from "./type"
7
-
8
- type GetApiInputFromPreApi<PreApis> = PreApis extends []
9
- ? {}
10
- : PreApis extends [infer x, ...infer xs]
11
- ? x extends JSON\u89E3\u6790\u63D2\u4EF6<infer input>
12
- ? z.infer<input>
13
- : GetApiInputFromPreApi<xs>
14
- : {}
15
-
16
- type Api = (typeof exportedApiSchema) extends \u63A5\u53E3\u7C7B\u578B<infer Path, infer Method, infer PreApis, infer SuccessSchema, infer ErrorSchema>
17
- ? {
18
- path: Path,
19
- method: Method,
20
- input: GetApiInputFromPreApi<PreApis>,
21
- successOutput: z.infer<SuccessSchema>,
22
- errorOutput: z.infer<ErrorSchema>,
23
- }
24
- : never
25
-
26
- export default Api
27
- `;
28
-
29
- export {
30
- calcCode
31
- };