@modern-js/bff-core 3.9.1 → 3.9.3
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/cjs/router/index.js
CHANGED
|
@@ -174,10 +174,11 @@ var __webpack_exports__ = {};
|
|
|
174
174
|
if ('test' !== process.env.NODE_ENV) _modern_js_utils__rspack_import_1.logger.warn(`Only api handlers are allowd to be exported, please remove the function ${originHandlerName} from exports`);
|
|
175
175
|
return null;
|
|
176
176
|
}
|
|
177
|
+
} else {
|
|
178
|
+
if (!handler) return null;
|
|
179
|
+
if ('function' == typeof handler && handler.length > 0) return _types__rspack_import_3.HttpMethod.Post;
|
|
180
|
+
return _types__rspack_import_3.HttpMethod.Get;
|
|
177
181
|
}
|
|
178
|
-
if (!handler) return null;
|
|
179
|
-
if ('function' == typeof handler && handler.length > 0) return _types__rspack_import_3.HttpMethod.Post;
|
|
180
|
-
return _types__rspack_import_3.HttpMethod.Get;
|
|
181
182
|
}
|
|
182
183
|
getAction(handler) {
|
|
183
184
|
if (handler) {
|
|
@@ -226,9 +227,10 @@ var __webpack_exports__ = {};
|
|
|
226
227
|
cause: err
|
|
227
228
|
});
|
|
228
229
|
throw error;
|
|
230
|
+
} else {
|
|
231
|
+
console.error(`Failed to load BFF module '${filename}':`, err);
|
|
232
|
+
return null;
|
|
229
233
|
}
|
|
230
|
-
console.error(`Failed to load BFF module '${filename}':`, err);
|
|
231
|
-
return null;
|
|
232
234
|
}
|
|
233
235
|
}
|
|
234
236
|
getHandlerInfos(moduleInfos) {
|
|
@@ -88,10 +88,11 @@ class ApiRouter {
|
|
|
88
88
|
if ('test' !== process.env.NODE_ENV) logger.warn(`Only api handlers are allowd to be exported, please remove the function ${originHandlerName} from exports`);
|
|
89
89
|
return null;
|
|
90
90
|
}
|
|
91
|
+
} else {
|
|
92
|
+
if (!handler) return null;
|
|
93
|
+
if ('function' == typeof handler && handler.length > 0) return HttpMethod.Post;
|
|
94
|
+
return HttpMethod.Get;
|
|
91
95
|
}
|
|
92
|
-
if (!handler) return null;
|
|
93
|
-
if ('function' == typeof handler && handler.length > 0) return HttpMethod.Post;
|
|
94
|
-
return HttpMethod.Get;
|
|
95
96
|
}
|
|
96
97
|
getAction(handler) {
|
|
97
98
|
if (handler) {
|
|
@@ -140,9 +141,10 @@ class ApiRouter {
|
|
|
140
141
|
cause: err
|
|
141
142
|
});
|
|
142
143
|
throw error;
|
|
144
|
+
} else {
|
|
145
|
+
console.error(`Failed to load BFF module '${filename}':`, err);
|
|
146
|
+
return null;
|
|
143
147
|
}
|
|
144
|
-
console.error(`Failed to load BFF module '${filename}':`, err);
|
|
145
|
-
return null;
|
|
146
148
|
}
|
|
147
149
|
}
|
|
148
150
|
getHandlerInfos(moduleInfos) {
|
|
@@ -89,10 +89,11 @@ class ApiRouter {
|
|
|
89
89
|
if ('test' !== process.env.NODE_ENV) logger.warn(`Only api handlers are allowd to be exported, please remove the function ${originHandlerName} from exports`);
|
|
90
90
|
return null;
|
|
91
91
|
}
|
|
92
|
+
} else {
|
|
93
|
+
if (!handler) return null;
|
|
94
|
+
if ('function' == typeof handler && handler.length > 0) return HttpMethod.Post;
|
|
95
|
+
return HttpMethod.Get;
|
|
92
96
|
}
|
|
93
|
-
if (!handler) return null;
|
|
94
|
-
if ('function' == typeof handler && handler.length > 0) return HttpMethod.Post;
|
|
95
|
-
return HttpMethod.Get;
|
|
96
97
|
}
|
|
97
98
|
getAction(handler) {
|
|
98
99
|
if (handler) {
|
|
@@ -141,9 +142,10 @@ class ApiRouter {
|
|
|
141
142
|
cause: err
|
|
142
143
|
});
|
|
143
144
|
throw error;
|
|
145
|
+
} else {
|
|
146
|
+
console.error(`Failed to load BFF module '${filename}':`, err);
|
|
147
|
+
return null;
|
|
144
148
|
}
|
|
145
|
-
console.error(`Failed to load BFF module '${filename}':`, err);
|
|
146
|
-
return null;
|
|
147
149
|
}
|
|
148
150
|
}
|
|
149
151
|
getHandlerInfos(moduleInfos) {
|
package/package.json
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"modern",
|
|
16
16
|
"modern.js"
|
|
17
17
|
],
|
|
18
|
-
"version": "3.9.
|
|
18
|
+
"version": "3.9.3",
|
|
19
19
|
"types": "./dist/types/index.d.ts",
|
|
20
20
|
"main": "./dist/cjs/index.js",
|
|
21
21
|
"exports": {
|
|
@@ -33,18 +33,18 @@
|
|
|
33
33
|
"koa-compose": "^4.1.0",
|
|
34
34
|
"reflect-metadata": "^0.2.2",
|
|
35
35
|
"type-fest": "2.19.0",
|
|
36
|
-
"@modern-js/utils": "3.9.
|
|
36
|
+
"@modern-js/utils": "3.9.3"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@rslib/core": "1.0.
|
|
39
|
+
"@rslib/core": "1.0.1",
|
|
40
40
|
"@types/koa-compose": "^3.2.9",
|
|
41
41
|
"@types/node": "^20",
|
|
42
42
|
"ts-node": "^10.9.2",
|
|
43
43
|
"tsconfig-paths": "^4.2.0",
|
|
44
44
|
"typescript": "^5",
|
|
45
45
|
"zod": "^3.25.76",
|
|
46
|
+
"@modern-js/types": "3.9.3",
|
|
46
47
|
"@modern-js/rslib": "2.68.10",
|
|
47
|
-
"@modern-js/types": "3.9.1",
|
|
48
48
|
"@scripts/rstest-config": "2.66.0"
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|