@modern-js/bff-core 2.48.6 → 2.49.0

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.
@@ -42,35 +42,6 @@ var import_utils3 = require("./utils");
42
42
  __reExport(router_exports, require("./types"), module.exports);
43
43
  __reExport(router_exports, require("./constants"), module.exports);
44
44
  class ApiRouter {
45
- enableRegister() {
46
- const existTsLoader = Boolean(require.extensions[".ts"]);
47
- if (!existTsLoader) {
48
- try {
49
- const projectSearchDir = this.appDir || this.apiDir;
50
- const tsNode = require("ts-node");
51
- tsNode.register({
52
- projectSearchDir,
53
- compilerOptions: {
54
- allowJs: false
55
- },
56
- scope: true,
57
- transpileOnly: true,
58
- ignore: [
59
- "(?:^|/)node_modules/"
60
- ]
61
- });
62
- const tsConfigPaths = require("tsconfig-paths");
63
- const loaderRes = tsConfigPaths.loadConfig(projectSearchDir);
64
- if (loaderRes.resultType === "success") {
65
- tsConfigPaths.register({
66
- baseUrl: loaderRes.absoluteBaseUrl,
67
- paths: loaderRes.paths
68
- });
69
- }
70
- } catch (error) {
71
- }
72
- }
73
- }
74
45
  isExistLambda() {
75
46
  return this.existLambdaDir;
76
47
  }
@@ -222,7 +193,6 @@ class ApiRouter {
222
193
  return filenames.map((filename) => this.getModuleInfo(filename)).filter((moduleInfo) => Boolean(moduleInfo));
223
194
  }
224
195
  getModuleInfo(filename) {
225
- this.enableRegister();
226
196
  try {
227
197
  const module2 = (0, import_utils3.requireHandlerModule)(filename);
228
198
  return {
@@ -8,35 +8,6 @@ import { getFiles, getPathFromFilename, requireHandlerModule, sortRoutes } from
8
8
  export * from "./types";
9
9
  export * from "./constants";
10
10
  class ApiRouter {
11
- enableRegister() {
12
- const existTsLoader = Boolean(require.extensions[".ts"]);
13
- if (!existTsLoader) {
14
- try {
15
- const projectSearchDir = this.appDir || this.apiDir;
16
- const tsNode = require("ts-node");
17
- tsNode.register({
18
- projectSearchDir,
19
- compilerOptions: {
20
- allowJs: false
21
- },
22
- scope: true,
23
- transpileOnly: true,
24
- ignore: [
25
- "(?:^|/)node_modules/"
26
- ]
27
- });
28
- const tsConfigPaths = require("tsconfig-paths");
29
- const loaderRes = tsConfigPaths.loadConfig(projectSearchDir);
30
- if (loaderRes.resultType === "success") {
31
- tsConfigPaths.register({
32
- baseUrl: loaderRes.absoluteBaseUrl,
33
- paths: loaderRes.paths
34
- });
35
- }
36
- } catch (error) {
37
- }
38
- }
39
- }
40
11
  isExistLambda() {
41
12
  return this.existLambdaDir;
42
13
  }
@@ -188,7 +159,6 @@ class ApiRouter {
188
159
  return filenames.map((filename) => this.getModuleInfo(filename)).filter((moduleInfo) => Boolean(moduleInfo));
189
160
  }
190
161
  getModuleInfo(filename) {
191
- this.enableRegister();
192
162
  try {
193
163
  const module = requireHandlerModule(filename);
194
164
  return {
@@ -23,7 +23,6 @@ export declare class ApiRouter {
23
23
  isBuild?: boolean;
24
24
  httpMethodDecider?: HttpMethodDecider;
25
25
  });
26
- private enableRegister;
27
26
  isExistLambda(): boolean;
28
27
  getApiMode(): APIMode;
29
28
  getLambdaDir(): string;
package/package.json CHANGED
@@ -15,7 +15,7 @@
15
15
  "modern",
16
16
  "modern.js"
17
17
  ],
18
- "version": "2.48.6",
18
+ "version": "2.49.0",
19
19
  "jsnext:source": "./src/index.ts",
20
20
  "types": "./dist/types/index.d.ts",
21
21
  "main": "./dist/cjs/index.js",
@@ -32,7 +32,7 @@
32
32
  "reflect-metadata": "^0.1.13",
33
33
  "type-fest": "2.15.0",
34
34
  "@swc/helpers": "0.5.3",
35
- "@modern-js/utils": "2.48.6"
35
+ "@modern-js/utils": "2.49.0"
36
36
  },
37
37
  "devDependencies": {
38
38
  "@types/jest": "^29",
@@ -43,9 +43,9 @@
43
43
  "tsconfig-paths": "^4.1.2",
44
44
  "typescript": "^5",
45
45
  "zod": "^3.22.3",
46
- "@modern-js/types": "2.48.6",
47
- "@scripts/build": "2.48.6",
48
- "@scripts/jest-config": "2.48.6"
46
+ "@scripts/build": "2.49.0",
47
+ "@modern-js/types": "2.49.0",
48
+ "@scripts/jest-config": "2.49.0"
49
49
  },
50
50
  "peerDependencies": {
51
51
  "zod": "^3.22.3",