@hz-9/a5-core 0.2.0-alpha.13 → 0.2.0-alpha.15

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/dist/all.d.ts CHANGED
@@ -547,13 +547,13 @@ export declare class LoadPackageUtil {
547
547
  * @returns 加载的包模块
548
548
  * @throws 当包加载失败时抛出错误
549
549
  */
550
- static loadPackage<T = unknown>(packageName: string): Promise<T>;
550
+ static loadPackage<T = unknown>(packageName: string): T;
551
551
  /**
552
552
  * 安全地动态加载包
553
553
  * @param packageName - 包名
554
554
  * @returns 加载的包模块,如果失败则返回 null
555
555
  */
556
- static loadPackageSafe<T = unknown>(packageName: string): Promise<T | null>;
556
+ static loadPackageSafe<T = unknown>(packageName: string): T | null;
557
557
  /**
558
558
  * 带重试的动态加载包
559
559
  * @param packageName - 包名
@@ -10,13 +10,13 @@ export declare class LoadPackageUtil {
10
10
  * @returns 加载的包模块
11
11
  * @throws 当包加载失败时抛出错误
12
12
  */
13
- static loadPackage<T = unknown>(packageName: string): Promise<T>;
13
+ static loadPackage<T = unknown>(packageName: string): T;
14
14
  /**
15
15
  * 安全地动态加载包
16
16
  * @param packageName - 包名
17
17
  * @returns 加载的包模块,如果失败则返回 null
18
18
  */
19
- static loadPackageSafe<T = unknown>(packageName: string): Promise<T | null>;
19
+ static loadPackageSafe<T = unknown>(packageName: string): T | null;
20
20
  /**
21
21
  * 带重试的动态加载包
22
22
  * @param packageName - 包名
@@ -15,7 +15,7 @@ class LoadPackageUtil {
15
15
  * @returns 加载的包模块
16
16
  * @throws 当包加载失败时抛出错误
17
17
  */
18
- static async loadPackage(packageName) {
18
+ static loadPackage(packageName) {
19
19
  try {
20
20
  // 使用 Dynimic_import 引入模块,仍会显示 ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING_FLAG 报错,
21
21
  // 使用 require 进行动态引入;
@@ -34,9 +34,9 @@ class LoadPackageUtil {
34
34
  * @param packageName - 包名
35
35
  * @returns 加载的包模块,如果失败则返回 null
36
36
  */
37
- static async loadPackageSafe(packageName) {
37
+ static loadPackageSafe(packageName) {
38
38
  try {
39
- return await LoadPackageUtil.loadPackage(packageName);
39
+ return LoadPackageUtil.loadPackage(packageName);
40
40
  }
41
41
  catch {
42
42
  return null;
@@ -54,7 +54,7 @@ class LoadPackageUtil {
54
54
  let lastError = null;
55
55
  for (let i = 0; i <= retries; i += 1) {
56
56
  try {
57
- return await LoadPackageUtil.loadPackage(packageName);
57
+ return LoadPackageUtil.loadPackage(packageName);
58
58
  }
59
59
  catch (error) {
60
60
  lastError = error instanceof Error ? error : new Error(String(error));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hz-9/a5-core",
3
- "version": "0.2.0-alpha.13",
3
+ "version": "0.2.0-alpha.15",
4
4
  "description": "The core library for the `@hz-9/a5-*` series of repositories.",
5
5
  "keywords": [
6
6
  "nest",
@@ -62,7 +62,6 @@
62
62
  "@nestjs/cli": "^10.0.0",
63
63
  "@nestjs/common": "^10.0.0",
64
64
  "@nestjs/core": "^10.0.0",
65
- "@nestjs/swagger": "~7.1.14",
66
65
  "@nestjs/testing": "^10.0.0",
67
66
  "@rushstack/heft": "0.66.1",
68
67
  "@types/body-parser": "~1.19.5",