@lsby/net-core 0.0.5-beta.6 → 0.0.5

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.
Files changed (29) hide show
  1. package/dist/bin/gen-test/bin.cjs +3 -0
  2. package/dist/bin/gen-test/index.cjs +3 -0
  3. package/dist/bin/{get-type → gen-type}/bin.cjs +8 -5
  4. package/dist/{cjs/bin/get-type → bin/gen-type}/calc-code.cjs +1 -1
  5. package/dist/bin/{get-type → gen-type}/index.cjs +9 -6
  6. package/dist/cjs/bin/gen-test/bin.cjs +3 -0
  7. package/dist/cjs/bin/gen-test/index.cjs +3 -0
  8. package/dist/cjs/bin/{get-type → gen-type}/bin.cjs +8 -5
  9. package/dist/{bin/get-type → cjs/bin/gen-type}/calc-code.cjs +1 -1
  10. package/dist/cjs/bin/{get-type → gen-type}/index.cjs +9 -6
  11. package/dist/esm/bin/gen-test/bin.js +1 -1
  12. package/dist/esm/bin/gen-test/index.js +1 -1
  13. package/dist/esm/bin/{get-type → gen-type}/bin.js +3 -3
  14. package/dist/esm/bin/{get-type → gen-type}/calc-code.js +1 -1
  15. package/dist/esm/bin/{get-type → gen-type}/index.js +2 -2
  16. package/dist/esm/{chunk-DVQ4V2GS.js → chunk-23CY3P3G.js} +1 -1
  17. package/dist/esm/{chunk-553ZM42W.js → chunk-D2G3YVNR.js} +4 -1
  18. package/dist/esm/{chunk-EDGJJIIQ.js → chunk-DB7BWSXE.js} +6 -3
  19. package/dist/esm/index.js +3 -3
  20. package/package.json +2 -2
  21. /package/dist/bin/{get-type → gen-type}/bin.d.cts +0 -0
  22. /package/dist/bin/{get-type → gen-type}/calc-code.d.cts +0 -0
  23. /package/dist/bin/{get-type → gen-type}/index.d.cts +0 -0
  24. /package/dist/cjs/bin/{get-type → gen-type}/bin.d.cts +0 -0
  25. /package/dist/cjs/bin/{get-type → gen-type}/calc-code.d.cts +0 -0
  26. /package/dist/cjs/bin/{get-type → gen-type}/index.d.cts +0 -0
  27. /package/dist/esm/bin/{get-type → gen-type}/bin.d.ts +0 -0
  28. /package/dist/esm/bin/{get-type → gen-type}/calc-code.d.ts +0 -0
  29. /package/dist/esm/bin/{get-type → gen-type}/index.d.ts +0 -0
@@ -203077,6 +203077,9 @@ function main(tsconfigPath, interfaceFolderPath, outFilePath, filter) {
203077
203077
  "it('exit', async () => process.exit(0))",
203078
203078
  ""
203079
203079
  ].join("\n");
203080
+ if (!(0, import_node_fs.existsSync)(outFilePath)) {
203081
+ (0, import_node_fs.mkdirSync)(outFilePath, { recursive: true });
203082
+ }
203080
203083
  (0, import_node_fs.writeFileSync)(outFilePath, finalTestFile);
203081
203084
  }).run();
203082
203085
  }
@@ -203082,6 +203082,9 @@ function main(tsconfigPath, interfaceFolderPath, outFilePath, filter) {
203082
203082
  "it('exit', async () => process.exit(0))",
203083
203083
  ""
203084
203084
  ].join("\n");
203085
+ if (!(0, import_node_fs.existsSync)(outFilePath)) {
203086
+ (0, import_node_fs.mkdirSync)(outFilePath, { recursive: true });
203087
+ }
203085
203088
  (0, import_node_fs.writeFileSync)(outFilePath, finalTestFile);
203086
203089
  }).run();
203087
203090
  }
@@ -202963,11 +202963,11 @@ ${e.message}`;
202963
202963
  }
202964
202964
  });
202965
202965
 
202966
- // src/bin/get-type/bin.ts
202966
+ // src/bin/gen-type/bin.ts
202967
202967
  var import_node_path2 = __toESM(require("path"), 1);
202968
202968
  var import_commander = require("commander");
202969
202969
 
202970
- // src/bin/get-type/index.ts
202970
+ // src/bin/gen-type/index.ts
202971
202971
  var import_node_crypto = require("crypto");
202972
202972
  var import_node_fs = __toESM(require("fs"), 1);
202973
202973
  var import_node_path = __toESM(require("path"), 1);
@@ -203009,7 +203009,7 @@ var Log = class _Log {
203009
203009
  }
203010
203010
  };
203011
203011
 
203012
- // src/bin/get-type/calc-code.ts
203012
+ // src/bin/gen-type/calc-code.ts
203013
203013
  var calcCode = `
203014
203014
  import type { \u63A5\u53E3\u7C7B\u578B, JSON\u89E3\u6790\u63D2\u4EF6 } from "@lsby/net-core"
203015
203015
  import type { z } from "zod"
@@ -203037,7 +203037,7 @@ type Api = (typeof exportedApiSchema) extends \u63A5\u53E3\u7C7B\u578B<infer Pat
203037
203037
  export default Api
203038
203038
  `;
203039
203039
 
203040
- // src/bin/get-type/index.ts
203040
+ // src/bin/gen-type/index.ts
203041
203041
  function main(tsconfigPath, apiFolderPath, outputPath) {
203042
203042
  return new import_ts_fp_data2.Task(async () => {
203043
203043
  var log = new Log("@lsby:net-core").extend("gen-type");
@@ -203109,12 +203109,15 @@ function main(tsconfigPath, apiFolderPath, outputPath) {
203109
203109
  }
203110
203110
  await log.debug("\u6210\u529F\u5904\u7406\u6240\u6709\u63A5\u53E3...").run();
203111
203111
  const outputPathAbs = import_node_path.default.resolve(outputPath);
203112
+ if (!(0, import_node_fs.existsSync)(outputPathAbs)) {
203113
+ (0, import_node_fs.mkdirSync)(outputPathAbs, { recursive: true });
203114
+ }
203112
203115
  import_node_fs.default.writeFileSync(outputPathAbs, `export type InterfaceType = [${result.join(",")}]`);
203113
203116
  await log.debug("\u751F\u6210\u6210\u529F\uFF1A%o", outputPathAbs).run();
203114
203117
  }).run();
203115
203118
  }
203116
203119
 
203117
- // src/bin/get-type/bin.ts
203120
+ // src/bin/gen-type/bin.ts
203118
203121
  var program = new import_commander.Command();
203119
203122
  program.name("\u751F\u6210\u7C7B\u578B\u6587\u4EF6").argument("<tsconfigPath>", "tsconfig\u6587\u4EF6\u8DEF\u5F84").argument("<interfaceFolderPath>", "\u63A5\u53E3\u6587\u4EF6\u5939\u8DEF\u5F84").argument("<outFilePath>", "\u8F93\u51FA\u6587\u4EF6\u8DEF\u5F84").action(async (tsconfigPath, interfaceFolderPath, outputPath) => {
203120
203123
  const absoluteTsconfigPath = import_node_path2.default.resolve(tsconfigPath);
@@ -17,7 +17,7 @@ var __copyProps = (to, from, except, desc) => {
17
17
  };
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
19
 
20
- // src/bin/get-type/calc-code.ts
20
+ // src/bin/gen-type/calc-code.ts
21
21
  var calc_code_exports = {};
22
22
  __export(calc_code_exports, {
23
23
  calcCode: () => calcCode
@@ -202967,12 +202967,12 @@ ${e.message}`;
202967
202967
  }
202968
202968
  });
202969
202969
 
202970
- // src/bin/get-type/index.ts
202971
- var get_type_exports = {};
202972
- __export(get_type_exports, {
202970
+ // src/bin/gen-type/index.ts
202971
+ var gen_type_exports = {};
202972
+ __export(gen_type_exports, {
202973
202973
  main: () => main
202974
202974
  });
202975
- module.exports = __toCommonJS(get_type_exports);
202975
+ module.exports = __toCommonJS(gen_type_exports);
202976
202976
  var import_node_crypto = require("crypto");
202977
202977
  var import_node_fs = __toESM(require("fs"), 1);
202978
202978
  var import_node_path = __toESM(require("path"), 1);
@@ -203014,7 +203014,7 @@ var Log = class _Log {
203014
203014
  }
203015
203015
  };
203016
203016
 
203017
- // src/bin/get-type/calc-code.ts
203017
+ // src/bin/gen-type/calc-code.ts
203018
203018
  var calcCode = `
203019
203019
  import type { \u63A5\u53E3\u7C7B\u578B, JSON\u89E3\u6790\u63D2\u4EF6 } from "@lsby/net-core"
203020
203020
  import type { z } from "zod"
@@ -203042,7 +203042,7 @@ type Api = (typeof exportedApiSchema) extends \u63A5\u53E3\u7C7B\u578B<infer Pat
203042
203042
  export default Api
203043
203043
  `;
203044
203044
 
203045
- // src/bin/get-type/index.ts
203045
+ // src/bin/gen-type/index.ts
203046
203046
  function main(tsconfigPath, apiFolderPath, outputPath) {
203047
203047
  return new import_ts_fp_data2.Task(async () => {
203048
203048
  var log = new Log("@lsby:net-core").extend("gen-type");
@@ -203114,6 +203114,9 @@ function main(tsconfigPath, apiFolderPath, outputPath) {
203114
203114
  }
203115
203115
  await log.debug("\u6210\u529F\u5904\u7406\u6240\u6709\u63A5\u53E3...").run();
203116
203116
  const outputPathAbs = import_node_path.default.resolve(outputPath);
203117
+ if (!(0, import_node_fs.existsSync)(outputPathAbs)) {
203118
+ (0, import_node_fs.mkdirSync)(outputPathAbs, { recursive: true });
203119
+ }
203117
203120
  import_node_fs.default.writeFileSync(outputPathAbs, `export type InterfaceType = [${result.join(",")}]`);
203118
203121
  await log.debug("\u751F\u6210\u6210\u529F\uFF1A%o", outputPathAbs).run();
203119
203122
  }).run();
@@ -203077,6 +203077,9 @@ function main(tsconfigPath, interfaceFolderPath, outFilePath, filter) {
203077
203077
  "it('exit', async () => process.exit(0))",
203078
203078
  ""
203079
203079
  ].join("\n");
203080
+ if (!(0, import_node_fs.existsSync)(outFilePath)) {
203081
+ (0, import_node_fs.mkdirSync)(outFilePath, { recursive: true });
203082
+ }
203080
203083
  (0, import_node_fs.writeFileSync)(outFilePath, finalTestFile);
203081
203084
  }).run();
203082
203085
  }
@@ -203082,6 +203082,9 @@ function main(tsconfigPath, interfaceFolderPath, outFilePath, filter) {
203082
203082
  "it('exit', async () => process.exit(0))",
203083
203083
  ""
203084
203084
  ].join("\n");
203085
+ if (!(0, import_node_fs.existsSync)(outFilePath)) {
203086
+ (0, import_node_fs.mkdirSync)(outFilePath, { recursive: true });
203087
+ }
203085
203088
  (0, import_node_fs.writeFileSync)(outFilePath, finalTestFile);
203086
203089
  }).run();
203087
203090
  }
@@ -202963,11 +202963,11 @@ ${e.message}`;
202963
202963
  }
202964
202964
  });
202965
202965
 
202966
- // src/bin/get-type/bin.ts
202966
+ // src/bin/gen-type/bin.ts
202967
202967
  var import_node_path2 = __toESM(require("path"), 1);
202968
202968
  var import_commander = require("commander");
202969
202969
 
202970
- // src/bin/get-type/index.ts
202970
+ // src/bin/gen-type/index.ts
202971
202971
  var import_node_crypto = require("crypto");
202972
202972
  var import_node_fs = __toESM(require("fs"), 1);
202973
202973
  var import_node_path = __toESM(require("path"), 1);
@@ -203009,7 +203009,7 @@ var Log = class _Log {
203009
203009
  }
203010
203010
  };
203011
203011
 
203012
- // src/bin/get-type/calc-code.ts
203012
+ // src/bin/gen-type/calc-code.ts
203013
203013
  var calcCode = `
203014
203014
  import type { \u63A5\u53E3\u7C7B\u578B, JSON\u89E3\u6790\u63D2\u4EF6 } from "@lsby/net-core"
203015
203015
  import type { z } from "zod"
@@ -203037,7 +203037,7 @@ type Api = (typeof exportedApiSchema) extends \u63A5\u53E3\u7C7B\u578B<infer Pat
203037
203037
  export default Api
203038
203038
  `;
203039
203039
 
203040
- // src/bin/get-type/index.ts
203040
+ // src/bin/gen-type/index.ts
203041
203041
  function main(tsconfigPath, apiFolderPath, outputPath) {
203042
203042
  return new import_ts_fp_data2.Task(async () => {
203043
203043
  var log = new Log("@lsby:net-core").extend("gen-type");
@@ -203109,12 +203109,15 @@ function main(tsconfigPath, apiFolderPath, outputPath) {
203109
203109
  }
203110
203110
  await log.debug("\u6210\u529F\u5904\u7406\u6240\u6709\u63A5\u53E3...").run();
203111
203111
  const outputPathAbs = import_node_path.default.resolve(outputPath);
203112
+ if (!(0, import_node_fs.existsSync)(outputPathAbs)) {
203113
+ (0, import_node_fs.mkdirSync)(outputPathAbs, { recursive: true });
203114
+ }
203112
203115
  import_node_fs.default.writeFileSync(outputPathAbs, `export type InterfaceType = [${result.join(",")}]`);
203113
203116
  await log.debug("\u751F\u6210\u6210\u529F\uFF1A%o", outputPathAbs).run();
203114
203117
  }).run();
203115
203118
  }
203116
203119
 
203117
- // src/bin/get-type/bin.ts
203120
+ // src/bin/gen-type/bin.ts
203118
203121
  var program = new import_commander.Command();
203119
203122
  program.name("\u751F\u6210\u7C7B\u578B\u6587\u4EF6").argument("<tsconfigPath>", "tsconfig\u6587\u4EF6\u8DEF\u5F84").argument("<interfaceFolderPath>", "\u63A5\u53E3\u6587\u4EF6\u5939\u8DEF\u5F84").argument("<outFilePath>", "\u8F93\u51FA\u6587\u4EF6\u8DEF\u5F84").action(async (tsconfigPath, interfaceFolderPath, outputPath) => {
203120
203123
  const absoluteTsconfigPath = import_node_path2.default.resolve(tsconfigPath);
@@ -17,7 +17,7 @@ var __copyProps = (to, from, except, desc) => {
17
17
  };
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
19
 
20
- // src/bin/get-type/calc-code.ts
20
+ // src/bin/gen-type/calc-code.ts
21
21
  var calc_code_exports = {};
22
22
  __export(calc_code_exports, {
23
23
  calcCode: () => calcCode
@@ -202967,12 +202967,12 @@ ${e.message}`;
202967
202967
  }
202968
202968
  });
202969
202969
 
202970
- // src/bin/get-type/index.ts
202971
- var get_type_exports = {};
202972
- __export(get_type_exports, {
202970
+ // src/bin/gen-type/index.ts
202971
+ var gen_type_exports = {};
202972
+ __export(gen_type_exports, {
202973
202973
  main: () => main
202974
202974
  });
202975
- module.exports = __toCommonJS(get_type_exports);
202975
+ module.exports = __toCommonJS(gen_type_exports);
202976
202976
  var import_node_crypto = require("crypto");
202977
202977
  var import_node_fs = __toESM(require("fs"), 1);
202978
202978
  var import_node_path = __toESM(require("path"), 1);
@@ -203014,7 +203014,7 @@ var Log = class _Log {
203014
203014
  }
203015
203015
  };
203016
203016
 
203017
- // src/bin/get-type/calc-code.ts
203017
+ // src/bin/gen-type/calc-code.ts
203018
203018
  var calcCode = `
203019
203019
  import type { \u63A5\u53E3\u7C7B\u578B, JSON\u89E3\u6790\u63D2\u4EF6 } from "@lsby/net-core"
203020
203020
  import type { z } from "zod"
@@ -203042,7 +203042,7 @@ type Api = (typeof exportedApiSchema) extends \u63A5\u53E3\u7C7B\u578B<infer Pat
203042
203042
  export default Api
203043
203043
  `;
203044
203044
 
203045
- // src/bin/get-type/index.ts
203045
+ // src/bin/gen-type/index.ts
203046
203046
  function main(tsconfigPath, apiFolderPath, outputPath) {
203047
203047
  return new import_ts_fp_data2.Task(async () => {
203048
203048
  var log = new Log("@lsby:net-core").extend("gen-type");
@@ -203114,6 +203114,9 @@ function main(tsconfigPath, apiFolderPath, outputPath) {
203114
203114
  }
203115
203115
  await log.debug("\u6210\u529F\u5904\u7406\u6240\u6709\u63A5\u53E3...").run();
203116
203116
  const outputPathAbs = import_node_path.default.resolve(outputPath);
203117
+ if (!(0, import_node_fs.existsSync)(outputPathAbs)) {
203118
+ (0, import_node_fs.mkdirSync)(outputPathAbs, { recursive: true });
203119
+ }
203117
203120
  import_node_fs.default.writeFileSync(outputPathAbs, `export type InterfaceType = [${result.join(",")}]`);
203118
203121
  await log.debug("\u751F\u6210\u6210\u529F\uFF1A%o", outputPathAbs).run();
203119
203122
  }).run();
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  main
4
- } from "../../chunk-553ZM42W.js";
4
+ } from "../../chunk-D2G3YVNR.js";
5
5
  import "../../chunk-PLIWJ5OD.js";
6
6
  import "../../chunk-PLYBVQKK.js";
7
7
  import "../../chunk-VBXJIVYU.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  main
3
- } from "../../chunk-553ZM42W.js";
3
+ } from "../../chunk-D2G3YVNR.js";
4
4
  import "../../chunk-PLIWJ5OD.js";
5
5
  import "../../chunk-PLYBVQKK.js";
6
6
  import "../../chunk-VBXJIVYU.js";
@@ -1,13 +1,13 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  main
4
- } from "../../chunk-EDGJJIIQ.js";
5
- import "../../chunk-DVQ4V2GS.js";
4
+ } from "../../chunk-DB7BWSXE.js";
5
+ import "../../chunk-23CY3P3G.js";
6
6
  import "../../chunk-PLIWJ5OD.js";
7
7
  import "../../chunk-PLYBVQKK.js";
8
8
  import "../../chunk-VBXJIVYU.js";
9
9
 
10
- // src/bin/get-type/bin.ts
10
+ // src/bin/gen-type/bin.ts
11
11
  import path from "node:path";
12
12
  import { Command } from "commander";
13
13
  var program = new Command();
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  calcCode
3
- } from "../../chunk-DVQ4V2GS.js";
3
+ } from "../../chunk-23CY3P3G.js";
4
4
  import "../../chunk-VBXJIVYU.js";
5
5
  export {
6
6
  calcCode
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  main
3
- } from "../../chunk-EDGJJIIQ.js";
4
- import "../../chunk-DVQ4V2GS.js";
3
+ } from "../../chunk-DB7BWSXE.js";
4
+ import "../../chunk-23CY3P3G.js";
5
5
  import "../../chunk-PLIWJ5OD.js";
6
6
  import "../../chunk-PLYBVQKK.js";
7
7
  import "../../chunk-VBXJIVYU.js";
@@ -1,4 +1,4 @@
1
- // src/bin/get-type/calc-code.ts
1
+ // src/bin/gen-type/calc-code.ts
2
2
  var calcCode = `
3
3
  import type { \u63A5\u53E3\u7C7B\u578B, JSON\u89E3\u6790\u63D2\u4EF6 } from "@lsby/net-core"
4
4
  import type { z } from "zod"
@@ -10,7 +10,7 @@ import {
10
10
 
11
11
  // src/bin/gen-test/index.ts
12
12
  var import_typescript = __toESM(require_typescript(), 1);
13
- import fs, { writeFileSync } from "node:fs";
13
+ import fs, { existsSync, mkdirSync, writeFileSync } from "node:fs";
14
14
  import path from "node:path";
15
15
  import { Task } from "@lsby/ts-fp-data";
16
16
  function main(tsconfigPath, interfaceFolderPath, outFilePath, filter) {
@@ -81,6 +81,9 @@ function main(tsconfigPath, interfaceFolderPath, outFilePath, filter) {
81
81
  "it('exit', async () => process.exit(0))",
82
82
  ""
83
83
  ].join("\n");
84
+ if (!existsSync(outFilePath)) {
85
+ mkdirSync(outFilePath, { recursive: true });
86
+ }
84
87
  writeFileSync(outFilePath, finalTestFile);
85
88
  }).run();
86
89
  }
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  calcCode
3
- } from "./chunk-DVQ4V2GS.js";
3
+ } from "./chunk-23CY3P3G.js";
4
4
  import {
5
5
  require_typescript
6
6
  } from "./chunk-PLIWJ5OD.js";
@@ -11,10 +11,10 @@ import {
11
11
  __toESM
12
12
  } from "./chunk-VBXJIVYU.js";
13
13
 
14
- // src/bin/get-type/index.ts
14
+ // src/bin/gen-type/index.ts
15
15
  var import_typescript = __toESM(require_typescript(), 1);
16
16
  import { randomUUID } from "node:crypto";
17
- import fs from "node:fs";
17
+ import fs, { existsSync, mkdirSync } from "node:fs";
18
18
  import path from "node:path";
19
19
  import { Task } from "@lsby/ts-fp-data";
20
20
  function main(tsconfigPath, apiFolderPath, outputPath) {
@@ -88,6 +88,9 @@ function main(tsconfigPath, apiFolderPath, outputPath) {
88
88
  }
89
89
  await log.debug("\u6210\u529F\u5904\u7406\u6240\u6709\u63A5\u53E3...").run();
90
90
  const outputPathAbs = path.resolve(outputPath);
91
+ if (!existsSync(outputPathAbs)) {
92
+ mkdirSync(outputPathAbs, { recursive: true });
93
+ }
91
94
  fs.writeFileSync(outputPathAbs, `export type InterfaceType = [${result.join(",")}]`);
92
95
  await log.debug("\u751F\u6210\u6210\u529F\uFF1A%o", outputPathAbs).run();
93
96
  }).run();
package/dist/esm/index.js CHANGED
@@ -1,9 +1,6 @@
1
1
  import {
2
2
  表单解析插件
3
3
  } from "./chunk-FBQ7H3IE.js";
4
- import {
5
- 服务器
6
- } from "./chunk-R4LHKMZP.js";
7
4
  import {
8
5
  正确JSON结果,
9
6
  正确结果,
@@ -12,6 +9,9 @@ import {
12
9
  错误JSON结果,
13
10
  错误结果
14
11
  } from "./chunk-6MRTDFSR.js";
12
+ import {
13
+ 服务器
14
+ } from "./chunk-R4LHKMZP.js";
15
15
  import {
16
16
  测试
17
17
  } from "./chunk-ET2XZBZD.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lsby/net-core",
3
- "version": "0.0.5-beta.6",
3
+ "version": "0.0.5",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  "require": "./dist/cjs/index.cjs",
@@ -8,7 +8,7 @@
8
8
  },
9
9
  "bin": {
10
10
  "lsby-net-core-gen-test": "./dist/bin/gen-test/bin.cjs",
11
- "lsby-net-core-get-type": "./dist/bin/get-type/bin.cjs"
11
+ "lsby-net-core-gen-type": "./dist/bin/gen-type/bin.cjs"
12
12
  },
13
13
  "files": [
14
14
  "dist"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes