@lsby/net-core 0.3.3 → 0.3.4

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.
@@ -78,15 +78,6 @@ async function main(tsconfigPath, interfaceFolderPath, outFilePath, filter) {
78
78
  const outputFolderRelativeToProjectRoot = import_node_path.default.relative(import_node_path.default.dirname(outFilePath), projectRootPath).replaceAll("\\", "/");
79
79
  const importPath = import_node_path.default.join(outputFolderRelativeToProjectRoot, filenameRelativeToProjectRoot).replaceAll("\\", "/");
80
80
  await log.info(`\u5904\u7406\uFF08${index + 1} / ${testSourceFilesFilter.length}\uFF09\uFF1A${filenameRelativeToApiFolder}`);
81
- for (const node of testSourceFile.statements) {
82
- if (import_typescript.default.isExportAssignment(node) && node.isExportEquals === void 0) {
83
- const expression = node.expression;
84
- if (import_typescript.default.isNewExpression(expression) && expression.expression.getText() === "\u6D4B\u8BD5") {
85
- break;
86
- }
87
- throw new Error(`${testSourceFile.fileName}\uFF1A\u9ED8\u8BA4\u5BFC\u51FA\u4E0D\u662F \u6D4B\u8BD5`);
88
- }
89
- }
90
81
  importCode.push(`import ${importName} from '${importPath}'`);
91
82
  testCode.push(generateTestCode(importName, importName));
92
83
  }
@@ -83,15 +83,6 @@ async function main(tsconfigPath, interfaceFolderPath, outFilePath, filter) {
83
83
  const outputFolderRelativeToProjectRoot = import_node_path.default.relative(import_node_path.default.dirname(outFilePath), projectRootPath).replaceAll("\\", "/");
84
84
  const importPath = import_node_path.default.join(outputFolderRelativeToProjectRoot, filenameRelativeToProjectRoot).replaceAll("\\", "/");
85
85
  await log.info(`\u5904\u7406\uFF08${index + 1} / ${testSourceFilesFilter.length}\uFF09\uFF1A${filenameRelativeToApiFolder}`);
86
- for (const node of testSourceFile.statements) {
87
- if (import_typescript.default.isExportAssignment(node) && node.isExportEquals === void 0) {
88
- const expression = node.expression;
89
- if (import_typescript.default.isNewExpression(expression) && expression.expression.getText() === "\u6D4B\u8BD5") {
90
- break;
91
- }
92
- throw new Error(`${testSourceFile.fileName}\uFF1A\u9ED8\u8BA4\u5BFC\u51FA\u4E0D\u662F \u6D4B\u8BD5`);
93
- }
94
- }
95
86
  importCode.push(`import ${importName} from '${importPath}'`);
96
87
  testCode.push(generateTestCode(importName, importName));
97
88
  }
@@ -78,15 +78,6 @@ async function main(tsconfigPath, interfaceFolderPath, outFilePath, filter) {
78
78
  const outputFolderRelativeToProjectRoot = import_node_path.default.relative(import_node_path.default.dirname(outFilePath), projectRootPath).replaceAll("\\", "/");
79
79
  const importPath = import_node_path.default.join(outputFolderRelativeToProjectRoot, filenameRelativeToProjectRoot).replaceAll("\\", "/");
80
80
  await log.info(`\u5904\u7406\uFF08${index + 1} / ${testSourceFilesFilter.length}\uFF09\uFF1A${filenameRelativeToApiFolder}`);
81
- for (const node of testSourceFile.statements) {
82
- if (import_typescript.default.isExportAssignment(node) && node.isExportEquals === void 0) {
83
- const expression = node.expression;
84
- if (import_typescript.default.isNewExpression(expression) && expression.expression.getText() === "\u6D4B\u8BD5") {
85
- break;
86
- }
87
- throw new Error(`${testSourceFile.fileName}\uFF1A\u9ED8\u8BA4\u5BFC\u51FA\u4E0D\u662F \u6D4B\u8BD5`);
88
- }
89
- }
90
81
  importCode.push(`import ${importName} from '${importPath}'`);
91
82
  testCode.push(generateTestCode(importName, importName));
92
83
  }
@@ -83,15 +83,6 @@ async function main(tsconfigPath, interfaceFolderPath, outFilePath, filter) {
83
83
  const outputFolderRelativeToProjectRoot = import_node_path.default.relative(import_node_path.default.dirname(outFilePath), projectRootPath).replaceAll("\\", "/");
84
84
  const importPath = import_node_path.default.join(outputFolderRelativeToProjectRoot, filenameRelativeToProjectRoot).replaceAll("\\", "/");
85
85
  await log.info(`\u5904\u7406\uFF08${index + 1} / ${testSourceFilesFilter.length}\uFF09\uFF1A${filenameRelativeToApiFolder}`);
86
- for (const node of testSourceFile.statements) {
87
- if (import_typescript.default.isExportAssignment(node) && node.isExportEquals === void 0) {
88
- const expression = node.expression;
89
- if (import_typescript.default.isNewExpression(expression) && expression.expression.getText() === "\u6D4B\u8BD5") {
90
- break;
91
- }
92
- throw new Error(`${testSourceFile.fileName}\uFF1A\u9ED8\u8BA4\u5BFC\u51FA\u4E0D\u662F \u6D4B\u8BD5`);
93
- }
94
- }
95
86
  importCode.push(`import ${importName} from '${importPath}'`);
96
87
  testCode.push(generateTestCode(importName, importName));
97
88
  }
@@ -44,6 +44,7 @@ __export(src_exports, {
44
44
  \u6B63\u786E\u7ED3\u679C: () => \u6B63\u786E\u7ED3\u679C,
45
45
  \u6B63\u786E\u81EA\u5B9A\u4E49\u7ED3\u679C: () => \u6B63\u786E\u81EA\u5B9A\u4E49\u7ED3\u679C,
46
46
  \u6D4B\u8BD5: () => \u6D4B\u8BD5,
47
+ \u6D4B\u8BD5\u62BD\u8C61\u7C7B: () => \u6D4B\u8BD5\u62BD\u8C61\u7C7B,
47
48
  \u7ED3\u679C: () => \u7ED3\u679C,
48
49
  \u81EA\u5B9A\u4E49\u6570\u636E\u63D2\u4EF6: () => \u81EA\u5B9A\u4E49\u6570\u636E\u63D2\u4EF6,
49
50
  \u8868\u5355\u89E3\u6790\u63D2\u4EF6: () => \u8868\u5355\u89E3\u6790\u63D2\u4EF6,
@@ -353,6 +354,13 @@ var \u6D4B\u8BD5 = class {
353
354
  await this.\u540E\u7F6E(\u4E2D\u7F6E\u7ED3\u679C);
354
355
  }
355
356
  };
357
+
358
+ // src/test/test-abstract.ts
359
+ var \u6D4B\u8BD5\u62BD\u8C61\u7C7B = class extends \u6D4B\u8BD5 {
360
+ constructor() {
361
+ super(null, null, null, null);
362
+ }
363
+ };
356
364
  // Annotate the CommonJS export names for ESM import in node:
357
365
  0 && (module.exports = {
358
366
  JSON\u89E3\u6790\u63D2\u4EF6,
@@ -369,6 +377,7 @@ var \u6D4B\u8BD5 = class {
369
377
  \u6B63\u786E\u7ED3\u679C,
370
378
  \u6B63\u786E\u81EA\u5B9A\u4E49\u7ED3\u679C,
371
379
  \u6D4B\u8BD5,
380
+ \u6D4B\u8BD5\u62BD\u8C61\u7C7B,
372
381
  \u7ED3\u679C,
373
382
  \u81EA\u5B9A\u4E49\u6570\u636E\u63D2\u4EF6,
374
383
  \u8868\u5355\u89E3\u6790\u63D2\u4EF6,
@@ -10,6 +10,7 @@ export { 表单解析插件 } from './plugin/urlencoded.cjs';
10
10
  export { 正确JSON结果, 正确结果, 正确自定义结果, 结果, 错误JSON结果, 错误结果 } from './result/result.cjs';
11
11
  export { 服务器 } from './server/server.cjs';
12
12
  export { 测试 } from './test/test.cjs';
13
+ export { 测试抽象类 } from './test/test-abstract.cjs';
13
14
  import 'zod';
14
15
  import 'express';
15
16
  import '@lsby/ts-fp-data';
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/test/test-abstract.ts
21
+ var test_abstract_exports = {};
22
+ __export(test_abstract_exports, {
23
+ \u6D4B\u8BD5\u62BD\u8C61\u7C7B: () => \u6D4B\u8BD5\u62BD\u8C61\u7C7B
24
+ });
25
+ module.exports = __toCommonJS(test_abstract_exports);
26
+
27
+ // src/test/test.ts
28
+ var \u6D4B\u8BD5 = class {
29
+ constructor(\u63A5\u53E3\u7C7B\u578B, \u524D\u7F6E, \u4E2D\u7F6E, \u540E\u7F6E) {
30
+ this.\u63A5\u53E3\u7C7B\u578B = \u63A5\u53E3\u7C7B\u578B;
31
+ this.\u524D\u7F6E = \u524D\u7F6E;
32
+ this.\u4E2D\u7F6E = \u4E2D\u7F6E;
33
+ this.\u540E\u7F6E = \u540E\u7F6E;
34
+ }
35
+ async \u8FD0\u884C() {
36
+ await this.\u524D\u7F6E();
37
+ var \u4E2D\u7F6E\u7ED3\u679C = await this.\u4E2D\u7F6E();
38
+ await this.\u540E\u7F6E(\u4E2D\u7F6E\u7ED3\u679C);
39
+ }
40
+ };
41
+
42
+ // src/test/test-abstract.ts
43
+ var \u6D4B\u8BD5\u62BD\u8C61\u7C7B = class extends \u6D4B\u8BD5 {
44
+ constructor() {
45
+ super(null, null, null, null);
46
+ }
47
+ };
48
+ // Annotate the CommonJS export names for ESM import in node:
49
+ 0 && (module.exports = {
50
+ \u6D4B\u8BD5\u62BD\u8C61\u7C7B
51
+ });
@@ -0,0 +1,15 @@
1
+ import { 测试 as __ } from './test.cjs';
2
+ import '../interface/interface-type.cjs';
3
+ import 'zod';
4
+ import '../interface/plug.cjs';
5
+ import 'express';
6
+ import '@lsby/ts-fp-data';
7
+
8
+ declare abstract class 测试抽象类 extends __ {
9
+ abstract 前置: () => Promise<void>;
10
+ abstract 中置: () => Promise<object>;
11
+ abstract 后置: (中置结果: object) => Promise<void>;
12
+ constructor();
13
+ }
14
+
15
+ export { 测试抽象类 };
@@ -6,9 +6,9 @@ import '@lsby/ts-fp-data';
6
6
 
7
7
  declare class 测试 {
8
8
  private 接口类型;
9
- private 前置;
10
- private 中置;
11
- private 后置;
9
+ protected 前置: () => Promise<void>;
10
+ protected 中置: () => Promise<object>;
11
+ protected 后置: (中置结果: object) => Promise<void>;
12
12
  constructor(接口类型: ______, 前置: () => Promise<void>, 中置: () => Promise<object>, 后置: (中置结果: object) => Promise<void>);
13
13
  运行(): Promise<void>;
14
14
  }
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  main
4
- } from "../../chunk-B5T7IMMQ.js";
4
+ } from "../../chunk-CSZNLNB5.js";
5
5
 
6
6
  // src/bin/gen-test/bin.ts
7
7
  import path from "node:path";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  main
3
- } from "../../chunk-B5T7IMMQ.js";
3
+ } from "../../chunk-CSZNLNB5.js";
4
4
  export {
5
5
  main
6
6
  };
@@ -49,15 +49,6 @@ async function main(tsconfigPath, interfaceFolderPath, outFilePath, filter) {
49
49
  const outputFolderRelativeToProjectRoot = path.relative(path.dirname(outFilePath), projectRootPath).replaceAll("\\", "/");
50
50
  const importPath = path.join(outputFolderRelativeToProjectRoot, filenameRelativeToProjectRoot).replaceAll("\\", "/");
51
51
  await log.info(`\u5904\u7406\uFF08${index + 1} / ${testSourceFilesFilter.length}\uFF09\uFF1A${filenameRelativeToApiFolder}`);
52
- for (const node of testSourceFile.statements) {
53
- if (ts.isExportAssignment(node) && node.isExportEquals === void 0) {
54
- const expression = node.expression;
55
- if (ts.isNewExpression(expression) && expression.expression.getText() === "\u6D4B\u8BD5") {
56
- break;
57
- }
58
- throw new Error(`${testSourceFile.fileName}\uFF1A\u9ED8\u8BA4\u5BFC\u51FA\u4E0D\u662F \u6D4B\u8BD5`);
59
- }
60
- }
61
52
  importCode.push(`import ${importName} from '${importPath}'`);
62
53
  testCode.push(generateTestCode(importName, importName));
63
54
  }
@@ -0,0 +1,14 @@
1
+ import {
2
+ 测试
3
+ } from "./chunk-I4WZG5LK.js";
4
+
5
+ // src/test/test-abstract.ts
6
+ var \u6D4B\u8BD5\u62BD\u8C61\u7C7B = class extends \u6D4B\u8BD5 {
7
+ constructor() {
8
+ super(null, null, null, null);
9
+ }
10
+ };
11
+
12
+ export {
13
+ 测试抽象类
14
+ };
@@ -10,6 +10,7 @@ export { 表单解析插件 } from './plugin/urlencoded.js';
10
10
  export { 正确JSON结果, 正确结果, 正确自定义结果, 结果, 错误JSON结果, 错误结果 } from './result/result.js';
11
11
  export { 服务器 } from './server/server.js';
12
12
  export { 测试 } from './test/test.js';
13
+ export { 测试抽象类 } from './test/test-abstract.js';
13
14
  import 'zod';
14
15
  import 'express';
15
16
  import '@lsby/ts-fp-data';
package/dist/esm/index.js CHANGED
@@ -10,6 +10,9 @@ import {
10
10
  import {
11
11
  服务器
12
12
  } from "./chunk-7W4HTEQ6.js";
13
+ import {
14
+ 测试抽象类
15
+ } from "./chunk-QRSNQEUN.js";
13
16
  import {
14
17
  测试
15
18
  } from "./chunk-I4WZG5LK.js";
@@ -57,6 +60,7 @@ export {
57
60
  \u6B63\u786E\u7ED3\u679C,
58
61
  \u6B63\u786E\u81EA\u5B9A\u4E49\u7ED3\u679C,
59
62
  \u6D4B\u8BD5,
63
+ \u6D4B\u8BD5\u62BD\u8C61\u7C7B,
60
64
  \u7ED3\u679C,
61
65
  \u81EA\u5B9A\u4E49\u6570\u636E\u63D2\u4EF6,
62
66
  \u8868\u5355\u89E3\u6790\u63D2\u4EF6,
@@ -0,0 +1,15 @@
1
+ import { 测试 as __ } from './test.js';
2
+ import '../interface/interface-type.js';
3
+ import 'zod';
4
+ import '../interface/plug.js';
5
+ import 'express';
6
+ import '@lsby/ts-fp-data';
7
+
8
+ declare abstract class 测试抽象类 extends __ {
9
+ abstract 前置: () => Promise<void>;
10
+ abstract 中置: () => Promise<object>;
11
+ abstract 后置: (中置结果: object) => Promise<void>;
12
+ constructor();
13
+ }
14
+
15
+ export { 测试抽象类 };
@@ -0,0 +1,7 @@
1
+ import {
2
+ 测试抽象类
3
+ } from "../chunk-QRSNQEUN.js";
4
+ import "../chunk-I4WZG5LK.js";
5
+ export {
6
+ \u6D4B\u8BD5\u62BD\u8C61\u7C7B
7
+ };
@@ -6,9 +6,9 @@ import '@lsby/ts-fp-data';
6
6
 
7
7
  declare class 测试 {
8
8
  private 接口类型;
9
- private 前置;
10
- private 中置;
11
- private 后置;
9
+ protected 前置: () => Promise<void>;
10
+ protected 中置: () => Promise<object>;
11
+ protected 后置: (中置结果: object) => Promise<void>;
12
12
  constructor(接口类型: ______, 前置: () => Promise<void>, 中置: () => Promise<object>, 后置: (中置结果: object) => Promise<void>);
13
13
  运行(): Promise<void>;
14
14
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lsby/net-core",
3
- "version": "0.3.3",
3
+ "version": "0.3.4",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  "require": "./dist/cjs/index.cjs",