@modern-js/plugin-express 2.35.0 → 2.35.1
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/plugin.js +3 -4
- package/dist/cjs/utils.js +2 -2
- package/dist/esm/plugin.js +4 -4
- package/dist/esm/utils.js +2 -2
- package/dist/esm-node/plugin.js +3 -4
- package/dist/esm-node/utils.js +2 -2
- package/package.json +10 -10
package/dist/cjs/plugin.js
CHANGED
|
@@ -77,11 +77,10 @@ const _default = () => ({
|
|
|
77
77
|
const mode = appContext.apiMode;
|
|
78
78
|
const userConfig = api.useConfigContext();
|
|
79
79
|
if (mode === "framework") {
|
|
80
|
-
var _app;
|
|
81
80
|
const appModule = await findAppModule(apiDir);
|
|
82
81
|
app = appModule[0];
|
|
83
82
|
const hooks = appModule[1];
|
|
84
|
-
if (!(
|
|
83
|
+
if (!(app === null || app === void 0 ? void 0 : app.use)) {
|
|
85
84
|
app = (0, _express.default)();
|
|
86
85
|
}
|
|
87
86
|
initApp(app);
|
|
@@ -135,9 +134,9 @@ const _default = () => ({
|
|
|
135
134
|
});
|
|
136
135
|
},
|
|
137
136
|
prepareWebServer({ config }, next) {
|
|
138
|
-
var _userConfig_server
|
|
137
|
+
var _userConfig_server;
|
|
139
138
|
const userConfig = api.useConfigContext();
|
|
140
|
-
if (!(
|
|
139
|
+
if (!(userConfig === null || userConfig === void 0 ? void 0 : (_userConfig_server = userConfig.server) === null || _userConfig_server === void 0 ? void 0 : _userConfig_server.enableFrameworkExt)) {
|
|
141
140
|
return next();
|
|
142
141
|
}
|
|
143
142
|
const app = (0, _express.default)();
|
package/dist/cjs/utils.js
CHANGED
|
@@ -84,8 +84,8 @@ const createRouteHandler = (handler) => {
|
|
|
84
84
|
}
|
|
85
85
|
} else if ((0, _bffcore.isInputParamsDeciderHandler)(handler)) {
|
|
86
86
|
try {
|
|
87
|
-
var _input_data
|
|
88
|
-
const args = (
|
|
87
|
+
var _input_data;
|
|
88
|
+
const args = (input === null || input === void 0 ? void 0 : (_input_data = input.data) === null || _input_data === void 0 ? void 0 : _input_data.args) || [];
|
|
89
89
|
const body = await handler(...args);
|
|
90
90
|
if (typeof body !== "undefined") {
|
|
91
91
|
if (typeof body === "object") {
|
package/dist/esm/plugin.js
CHANGED
|
@@ -136,7 +136,7 @@ export default function() {
|
|
|
136
136
|
prepareApiServer: function prepareApiServer(param) {
|
|
137
137
|
var pwd = param.pwd, config = param.config, render = param.render;
|
|
138
138
|
return _async_to_generator(function() {
|
|
139
|
-
var _userConfig_bff, app, appContext, apiHandlerInfos, apiDirectory, apiDir, mode, userConfig,
|
|
139
|
+
var _userConfig_bff, app, appContext, apiHandlerInfos, apiDirectory, apiDir, mode, userConfig, appModule, hooks, middleware, afterLambdaRegisted, middleware1;
|
|
140
140
|
return _ts_generator(this, function(_state) {
|
|
141
141
|
switch (_state.label) {
|
|
142
142
|
case 0:
|
|
@@ -159,7 +159,7 @@ export default function() {
|
|
|
159
159
|
appModule = _state.sent();
|
|
160
160
|
app = appModule[0];
|
|
161
161
|
hooks = appModule[1];
|
|
162
|
-
if (!(
|
|
162
|
+
if (!(app === null || app === void 0 ? void 0 : app.use)) {
|
|
163
163
|
app = express();
|
|
164
164
|
}
|
|
165
165
|
initApp(app);
|
|
@@ -248,9 +248,9 @@ export default function() {
|
|
|
248
248
|
},
|
|
249
249
|
prepareWebServer: function prepareWebServer(param, next) {
|
|
250
250
|
var config = param.config;
|
|
251
|
-
var _userConfig_server
|
|
251
|
+
var _userConfig_server;
|
|
252
252
|
var userConfig = api.useConfigContext();
|
|
253
|
-
if (!(
|
|
253
|
+
if (!(userConfig === null || userConfig === void 0 ? void 0 : (_userConfig_server = userConfig.server) === null || _userConfig_server === void 0 ? void 0 : _userConfig_server.enableFrameworkExt)) {
|
|
254
254
|
return next();
|
|
255
255
|
}
|
|
256
256
|
var app = express();
|
package/dist/esm/utils.js
CHANGED
|
@@ -70,7 +70,7 @@ var handleResponseMeta = function(res, handler) {
|
|
|
70
70
|
export var createRouteHandler = function(handler) {
|
|
71
71
|
var apiHandler = function() {
|
|
72
72
|
var _ref = _async_to_generator(function(req, res, next) {
|
|
73
|
-
var input, result, error, result1, _input_data,
|
|
73
|
+
var input, result, error, result1, _input_data, args, body, e, args1, body1, e1;
|
|
74
74
|
return _ts_generator(this, function(_state) {
|
|
75
75
|
switch (_state.label) {
|
|
76
76
|
case 0:
|
|
@@ -179,7 +179,7 @@ export var createRouteHandler = function(handler) {
|
|
|
179
179
|
,
|
|
180
180
|
12
|
|
181
181
|
]);
|
|
182
|
-
args = (
|
|
182
|
+
args = (input === null || input === void 0 ? void 0 : (_input_data = input.data) === null || _input_data === void 0 ? void 0 : _input_data.args) || [];
|
|
183
183
|
return [
|
|
184
184
|
4,
|
|
185
185
|
handler.apply(void 0, _to_consumable_array(args))
|
package/dist/esm-node/plugin.js
CHANGED
|
@@ -65,11 +65,10 @@ export default () => ({
|
|
|
65
65
|
const mode = appContext.apiMode;
|
|
66
66
|
const userConfig = api.useConfigContext();
|
|
67
67
|
if (mode === "framework") {
|
|
68
|
-
var _app;
|
|
69
68
|
const appModule = await findAppModule(apiDir);
|
|
70
69
|
app = appModule[0];
|
|
71
70
|
const hooks = appModule[1];
|
|
72
|
-
if (!(
|
|
71
|
+
if (!(app === null || app === void 0 ? void 0 : app.use)) {
|
|
73
72
|
app = express();
|
|
74
73
|
}
|
|
75
74
|
initApp(app);
|
|
@@ -123,9 +122,9 @@ export default () => ({
|
|
|
123
122
|
});
|
|
124
123
|
},
|
|
125
124
|
prepareWebServer({ config }, next) {
|
|
126
|
-
var _userConfig_server
|
|
125
|
+
var _userConfig_server;
|
|
127
126
|
const userConfig = api.useConfigContext();
|
|
128
|
-
if (!(
|
|
127
|
+
if (!(userConfig === null || userConfig === void 0 ? void 0 : (_userConfig_server = userConfig.server) === null || _userConfig_server === void 0 ? void 0 : _userConfig_server.enableFrameworkExt)) {
|
|
129
128
|
return next();
|
|
130
129
|
}
|
|
131
130
|
const app = express();
|
package/dist/esm-node/utils.js
CHANGED
|
@@ -64,8 +64,8 @@ export const createRouteHandler = (handler) => {
|
|
|
64
64
|
}
|
|
65
65
|
} else if (isInputParamsDeciderHandler(handler)) {
|
|
66
66
|
try {
|
|
67
|
-
var _input_data
|
|
68
|
-
const args = (
|
|
67
|
+
var _input_data;
|
|
68
|
+
const args = (input === null || input === void 0 ? void 0 : (_input_data = input.data) === null || _input_data === void 0 ? void 0 : _input_data.args) || [];
|
|
69
69
|
const body = await handler(...args);
|
|
70
70
|
if (typeof body !== "undefined") {
|
|
71
71
|
if (typeof body === "object") {
|
package/package.json
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"modern",
|
|
16
16
|
"modern.js"
|
|
17
17
|
],
|
|
18
|
-
"version": "2.35.
|
|
18
|
+
"version": "2.35.1",
|
|
19
19
|
"jsnext:source": "./src/index.ts",
|
|
20
20
|
"types": "./dist/types/cli/index.d.ts",
|
|
21
21
|
"main": "./dist/cjs/cli/index.js",
|
|
@@ -49,10 +49,10 @@
|
|
|
49
49
|
"reflect-metadata": "^0.1.13",
|
|
50
50
|
"type-is": "^1.6.18",
|
|
51
51
|
"@swc/helpers": "0.5.1",
|
|
52
|
-
"@modern-js/bff-core": "2.35.
|
|
53
|
-
"@modern-js/
|
|
54
|
-
"@modern-js/
|
|
55
|
-
"@modern-js/
|
|
52
|
+
"@modern-js/bff-core": "2.35.1",
|
|
53
|
+
"@modern-js/bff-runtime": "2.35.1",
|
|
54
|
+
"@modern-js/utils": "2.35.1",
|
|
55
|
+
"@modern-js/types": "2.35.1"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
58
|
"@types/cookie-parser": "^1.4.2",
|
|
@@ -68,11 +68,11 @@
|
|
|
68
68
|
"supertest": "^6.1.6",
|
|
69
69
|
"typescript": "^5",
|
|
70
70
|
"zod": "^3.17.3",
|
|
71
|
-
"@modern-js/core": "2.35.
|
|
72
|
-
"@modern-js/
|
|
73
|
-
"@modern-js/
|
|
74
|
-
"@scripts/build": "2.35.
|
|
75
|
-
"@scripts/jest-config": "2.35.
|
|
71
|
+
"@modern-js/core": "2.35.1",
|
|
72
|
+
"@modern-js/server-core": "2.35.1",
|
|
73
|
+
"@modern-js/app-tools": "2.35.1",
|
|
74
|
+
"@scripts/build": "2.35.1",
|
|
75
|
+
"@scripts/jest-config": "2.35.1"
|
|
76
76
|
},
|
|
77
77
|
"peerDependencies": {
|
|
78
78
|
"express": "^4.17.1"
|