@modern-js/plugin-bff 2.68.0 → 2.68.2
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.
|
@@ -83,6 +83,9 @@ const createHonoHandler = (handler) => {
|
|
|
83
83
|
if (c.finalized)
|
|
84
84
|
return;
|
|
85
85
|
const result = await handler(input);
|
|
86
|
+
if (result instanceof Response) {
|
|
87
|
+
return result;
|
|
88
|
+
}
|
|
86
89
|
return result && typeof result === "object" ? c.json(result) : c.body(result);
|
|
87
90
|
} catch (error) {
|
|
88
91
|
if (error instanceof import_bff_core.ValidationError) {
|
|
@@ -108,6 +111,9 @@ const createHonoHandler = (handler) => {
|
|
|
108
111
|
return await Promise.resolve();
|
|
109
112
|
}
|
|
110
113
|
if (typeof body !== "undefined") {
|
|
114
|
+
if (body instanceof Response) {
|
|
115
|
+
return body;
|
|
116
|
+
}
|
|
111
117
|
return c.json(body);
|
|
112
118
|
}
|
|
113
119
|
} catch {
|
|
@@ -126,6 +126,12 @@ var createHonoHandler = function(handler) {
|
|
|
126
126
|
];
|
|
127
127
|
case 3:
|
|
128
128
|
result = _state.sent();
|
|
129
|
+
if (_instanceof(result, Response)) {
|
|
130
|
+
return [
|
|
131
|
+
2,
|
|
132
|
+
result
|
|
133
|
+
];
|
|
134
|
+
}
|
|
129
135
|
return [
|
|
130
136
|
2,
|
|
131
137
|
result && (typeof result === "undefined" ? "undefined" : _type_of(result)) === "object" ? c.json(result) : c.body(result)
|
|
@@ -189,6 +195,12 @@ var createHonoHandler = function(handler) {
|
|
|
189
195
|
];
|
|
190
196
|
case 10:
|
|
191
197
|
if (typeof body !== "undefined") {
|
|
198
|
+
if (_instanceof(body, Response)) {
|
|
199
|
+
return [
|
|
200
|
+
2,
|
|
201
|
+
body
|
|
202
|
+
];
|
|
203
|
+
}
|
|
192
204
|
return [
|
|
193
205
|
2,
|
|
194
206
|
c.json(body)
|
|
@@ -49,6 +49,9 @@ const createHonoHandler = (handler) => {
|
|
|
49
49
|
if (c.finalized)
|
|
50
50
|
return;
|
|
51
51
|
const result = await handler(input);
|
|
52
|
+
if (result instanceof Response) {
|
|
53
|
+
return result;
|
|
54
|
+
}
|
|
52
55
|
return result && typeof result === "object" ? c.json(result) : c.body(result);
|
|
53
56
|
} catch (error) {
|
|
54
57
|
if (error instanceof ValidationError) {
|
|
@@ -74,6 +77,9 @@ const createHonoHandler = (handler) => {
|
|
|
74
77
|
return await Promise.resolve();
|
|
75
78
|
}
|
|
76
79
|
if (typeof body !== "undefined") {
|
|
80
|
+
if (body instanceof Response) {
|
|
81
|
+
return body;
|
|
82
|
+
}
|
|
77
83
|
return c.json(body);
|
|
78
84
|
}
|
|
79
85
|
} catch {
|
package/package.json
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"modern",
|
|
16
16
|
"modern.js"
|
|
17
17
|
],
|
|
18
|
-
"version": "2.68.
|
|
18
|
+
"version": "2.68.2",
|
|
19
19
|
"jsnext:source": "./src/cli.ts",
|
|
20
20
|
"types": "./dist/types/cli.d.ts",
|
|
21
21
|
"main": "./dist/cjs/cli.js",
|
|
@@ -76,11 +76,11 @@
|
|
|
76
76
|
"@babel/core": "^7.26.0",
|
|
77
77
|
"@swc/helpers": "^0.5.17",
|
|
78
78
|
"type-is": "^1.6.18",
|
|
79
|
-
"@modern-js/bff-core": "2.68.
|
|
80
|
-
"@modern-js/create-request": "2.68.
|
|
81
|
-
"@modern-js/server-core": "2.68.
|
|
82
|
-
"@modern-js/server-utils": "2.68.
|
|
83
|
-
"@modern-js/utils": "2.68.
|
|
79
|
+
"@modern-js/bff-core": "2.68.2",
|
|
80
|
+
"@modern-js/create-request": "2.68.2",
|
|
81
|
+
"@modern-js/server-core": "2.68.2",
|
|
82
|
+
"@modern-js/server-utils": "2.68.2",
|
|
83
|
+
"@modern-js/utils": "2.68.2"
|
|
84
84
|
},
|
|
85
85
|
"devDependencies": {
|
|
86
86
|
"@types/babel__core": "^7.20.5",
|
|
@@ -93,12 +93,12 @@
|
|
|
93
93
|
"typescript": "^5",
|
|
94
94
|
"webpack": "^5.99.8",
|
|
95
95
|
"zod": "^3.22.3",
|
|
96
|
-
"@modern-js/app-tools": "2.68.
|
|
97
|
-
"@modern-js/bff-runtime": "2.68.
|
|
98
|
-
"@modern-js/core": "2.68.
|
|
99
|
-
"@modern-js/
|
|
100
|
-
"@modern-js/
|
|
101
|
-
"@modern-js/types": "2.68.
|
|
96
|
+
"@modern-js/app-tools": "2.68.2",
|
|
97
|
+
"@modern-js/bff-runtime": "2.68.2",
|
|
98
|
+
"@modern-js/core": "2.68.2",
|
|
99
|
+
"@modern-js/plugin-v2": "2.68.2",
|
|
100
|
+
"@modern-js/runtime": "2.68.2",
|
|
101
|
+
"@modern-js/types": "2.68.2",
|
|
102
102
|
"@scripts/build": "2.66.0",
|
|
103
103
|
"@scripts/jest-config": "2.66.0"
|
|
104
104
|
},
|