@modern-js/plugin-bff 2.68.17 → 2.68.18
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/cli.js
CHANGED
|
@@ -39,7 +39,6 @@ var import_utils = require("@modern-js/utils");
|
|
|
39
39
|
var import_clientGenerator = __toESM(require("./utils/clientGenerator"));
|
|
40
40
|
var import_pluginGenerator = __toESM(require("./utils/pluginGenerator"));
|
|
41
41
|
var import_runtimeGenerator = __toESM(require("./utils/runtimeGenerator"));
|
|
42
|
-
const DEFAULT_API_PREFIX = "/api";
|
|
43
42
|
const TS_CONFIG_FILENAME = "tsconfig.json";
|
|
44
43
|
const RUNTIME_CREATE_REQUEST = "@modern-js/plugin-bff/runtime/create-request";
|
|
45
44
|
const RUNTIME_HONO = "@modern-js/plugin-bff/hono";
|
|
@@ -85,7 +84,7 @@ const bffPlugin = () => ({
|
|
|
85
84
|
const modernConfig = api.useResolvedConfigContext();
|
|
86
85
|
const relativeDistPath = (modernConfig === null || modernConfig === void 0 ? void 0 : (_modernConfig_output = modernConfig.output) === null || _modernConfig_output === void 0 ? void 0 : (_modernConfig_output_distPath = _modernConfig_output.distPath) === null || _modernConfig_output_distPath === void 0 ? void 0 : _modernConfig_output_distPath.root) || "dist";
|
|
87
86
|
const { bff } = modernConfig || {};
|
|
88
|
-
const prefix = (bff === null || bff === void 0 ? void 0 : bff.prefix) || DEFAULT_API_PREFIX;
|
|
87
|
+
const prefix = (bff === null || bff === void 0 ? void 0 : bff.prefix) || import_utils.DEFAULT_API_PREFIX;
|
|
89
88
|
const httpMethodDecider = bff === null || bff === void 0 ? void 0 : bff.httpMethodDecider;
|
|
90
89
|
const apiRouter = new import_bff_core.ApiRouter({
|
|
91
90
|
apiDir: apiDirectory,
|
|
@@ -145,7 +144,7 @@ const bffPlugin = () => ({
|
|
|
145
144
|
[RUNTIME_HONO]: RUNTIME_HONO
|
|
146
145
|
} : void 0;
|
|
147
146
|
const devServer = (_api_useConfigContext = api.useConfigContext()) === null || _api_useConfigContext === void 0 ? void 0 : (_api_useConfigContext_tools = _api_useConfigContext.tools) === null || _api_useConfigContext_tools === void 0 ? void 0 : _api_useConfigContext_tools.devServer;
|
|
148
|
-
const prefix = ((_api_useConfigContext1 = api.useConfigContext()) === null || _api_useConfigContext1 === void 0 ? void 0 : (_api_useConfigContext_bff = _api_useConfigContext1.bff) === null || _api_useConfigContext_bff === void 0 ? void 0 : _api_useConfigContext_bff.prefix) || DEFAULT_API_PREFIX;
|
|
147
|
+
const prefix = ((_api_useConfigContext1 = api.useConfigContext()) === null || _api_useConfigContext1 === void 0 ? void 0 : (_api_useConfigContext_bff = _api_useConfigContext1.bff) === null || _api_useConfigContext_bff === void 0 ? void 0 : _api_useConfigContext_bff.prefix) || import_utils.DEFAULT_API_PREFIX;
|
|
149
148
|
if (typeof devServer === "object" && devServer !== null && !Array.isArray(devServer)) {
|
|
150
149
|
const compress = devServer.compress;
|
|
151
150
|
if (typeof compress === "undefined" || compress === true) {
|
|
@@ -163,7 +162,7 @@ const bffPlugin = () => ({
|
|
|
163
162
|
const { port, appDirectory, apiDirectory, lambdaDirectory } = api.useAppContext();
|
|
164
163
|
const modernConfig = api.useResolvedConfigContext();
|
|
165
164
|
const { bff } = modernConfig || {};
|
|
166
|
-
const prefix2 = (bff === null || bff === void 0 ? void 0 : bff.prefix) || DEFAULT_API_PREFIX;
|
|
165
|
+
const prefix2 = (bff === null || bff === void 0 ? void 0 : bff.prefix) || import_utils.DEFAULT_API_PREFIX;
|
|
167
166
|
const httpMethodDecider = bff === null || bff === void 0 ? void 0 : bff.httpMethodDecider;
|
|
168
167
|
const apiRouter = new import_bff_core.ApiRouter({
|
|
169
168
|
apiDir: apiDirectory,
|
|
@@ -33,6 +33,7 @@ __export(createHonoRoutes_exports, {
|
|
|
33
33
|
});
|
|
34
34
|
module.exports = __toCommonJS(createHonoRoutes_exports);
|
|
35
35
|
var import_bff_core = require("@modern-js/bff-core");
|
|
36
|
+
var import_qs = require("@modern-js/create-request/qs");
|
|
36
37
|
var import_type_is = __toESM(require("type-is"));
|
|
37
38
|
const createHonoRoutes = (handlerInfos = []) => {
|
|
38
39
|
return handlerInfos.map(({ routePath, handler, httpMethod }) => {
|
|
@@ -120,7 +121,7 @@ const createHonoHandler = (handler) => {
|
|
|
120
121
|
const getHonoInput = async (c) => {
|
|
121
122
|
const draft = {
|
|
122
123
|
params: c.req.param(),
|
|
123
|
-
query: c.req.query(),
|
|
124
|
+
query: (0, import_qs.parse)(c.req.query()),
|
|
124
125
|
headers: c.req.header(),
|
|
125
126
|
cookies: c.req.header("cookie")
|
|
126
127
|
};
|
package/dist/esm/cli.js
CHANGED
|
@@ -8,11 +8,10 @@ import { _ as _ts_generator } from "@swc/helpers/_/_ts_generator";
|
|
|
8
8
|
import path from "path";
|
|
9
9
|
import { ApiRouter } from "@modern-js/bff-core";
|
|
10
10
|
import { compile } from "@modern-js/server-utils";
|
|
11
|
-
import { fs, API_DIR, SHARED_DIR, normalizeOutputPath } from "@modern-js/utils";
|
|
11
|
+
import { fs, API_DIR, DEFAULT_API_PREFIX, SHARED_DIR, normalizeOutputPath } from "@modern-js/utils";
|
|
12
12
|
import clientGenerator from "./utils/clientGenerator";
|
|
13
13
|
import pluginGenerator from "./utils/pluginGenerator";
|
|
14
14
|
import runtimeGenerator from "./utils/runtimeGenerator";
|
|
15
|
-
var DEFAULT_API_PREFIX = "/api";
|
|
16
15
|
var TS_CONFIG_FILENAME = "tsconfig.json";
|
|
17
16
|
var RUNTIME_CREATE_REQUEST = "@modern-js/plugin-bff/runtime/create-request";
|
|
18
17
|
var RUNTIME_HONO = "@modern-js/plugin-bff/hono";
|
|
@@ -5,6 +5,7 @@ import { _ as _to_consumable_array } from "@swc/helpers/_/_to_consumable_array";
|
|
|
5
5
|
import { _ as _type_of } from "@swc/helpers/_/_type_of";
|
|
6
6
|
import { _ as _ts_generator } from "@swc/helpers/_/_ts_generator";
|
|
7
7
|
import { HttpMetadata, ResponseMetaType, ValidationError, isWithMetaHandler } from "@modern-js/bff-core";
|
|
8
|
+
import { parse } from "@modern-js/create-request/qs";
|
|
8
9
|
import typeIs from "type-is";
|
|
9
10
|
var createHonoRoutes = function() {
|
|
10
11
|
var handlerInfos = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [];
|
|
@@ -213,7 +214,7 @@ var getHonoInput = function() {
|
|
|
213
214
|
case 0:
|
|
214
215
|
draft = {
|
|
215
216
|
params: c.req.param(),
|
|
216
|
-
query: c.req.query(),
|
|
217
|
+
query: parse(c.req.query()),
|
|
217
218
|
headers: c.req.header(),
|
|
218
219
|
cookies: c.req.header("cookie")
|
|
219
220
|
};
|
package/dist/esm-node/cli.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import path from "path";
|
|
2
2
|
import { ApiRouter } from "@modern-js/bff-core";
|
|
3
3
|
import { compile } from "@modern-js/server-utils";
|
|
4
|
-
import { fs, API_DIR, SHARED_DIR, normalizeOutputPath } from "@modern-js/utils";
|
|
4
|
+
import { fs, API_DIR, DEFAULT_API_PREFIX, SHARED_DIR, normalizeOutputPath } from "@modern-js/utils";
|
|
5
5
|
import clientGenerator from "./utils/clientGenerator";
|
|
6
6
|
import pluginGenerator from "./utils/pluginGenerator";
|
|
7
7
|
import runtimeGenerator from "./utils/runtimeGenerator";
|
|
8
|
-
const DEFAULT_API_PREFIX = "/api";
|
|
9
8
|
const TS_CONFIG_FILENAME = "tsconfig.json";
|
|
10
9
|
const RUNTIME_CREATE_REQUEST = "@modern-js/plugin-bff/runtime/create-request";
|
|
11
10
|
const RUNTIME_HONO = "@modern-js/plugin-bff/hono";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { HttpMetadata, ResponseMetaType, ValidationError, isWithMetaHandler } from "@modern-js/bff-core";
|
|
2
|
+
import { parse } from "@modern-js/create-request/qs";
|
|
2
3
|
import typeIs from "type-is";
|
|
3
4
|
const createHonoRoutes = (handlerInfos = []) => {
|
|
4
5
|
return handlerInfos.map(({ routePath, handler, httpMethod }) => {
|
|
@@ -86,7 +87,7 @@ const createHonoHandler = (handler) => {
|
|
|
86
87
|
const getHonoInput = async (c) => {
|
|
87
88
|
const draft = {
|
|
88
89
|
params: c.req.param(),
|
|
89
|
-
query: c.req.query(),
|
|
90
|
+
query: parse(c.req.query()),
|
|
90
91
|
headers: c.req.header(),
|
|
91
92
|
cookies: c.req.header("cookie")
|
|
92
93
|
};
|
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.18",
|
|
19
19
|
"jsnext:source": "./src/cli.ts",
|
|
20
20
|
"types": "./dist/types/cli.d.ts",
|
|
21
21
|
"main": "./dist/cjs/cli.js",
|
|
@@ -76,14 +76,14 @@
|
|
|
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.18",
|
|
80
|
+
"@modern-js/create-request": "2.68.18",
|
|
81
|
+
"@modern-js/server-core": "2.68.18",
|
|
82
|
+
"@modern-js/server-utils": "2.68.18",
|
|
83
|
+
"@modern-js/utils": "2.68.18"
|
|
84
84
|
},
|
|
85
85
|
"devDependencies": {
|
|
86
|
-
"@rsbuild/core": "1.5.
|
|
86
|
+
"@rsbuild/core": "1.5.17",
|
|
87
87
|
"@types/babel__core": "^7.20.5",
|
|
88
88
|
"@types/jest": "^29",
|
|
89
89
|
"@types/node": "^18",
|
|
@@ -94,12 +94,12 @@
|
|
|
94
94
|
"typescript": "^5",
|
|
95
95
|
"webpack": "^5.102.1",
|
|
96
96
|
"zod": "^3.22.3",
|
|
97
|
-
"@modern-js/app-tools": "2.68.
|
|
98
|
-
"@modern-js/
|
|
99
|
-
"@modern-js/
|
|
100
|
-
"@modern-js/plugin-v2": "2.68.
|
|
101
|
-
"@modern-js/runtime": "2.68.
|
|
102
|
-
"@modern-js/types": "2.68.
|
|
97
|
+
"@modern-js/app-tools": "2.68.18",
|
|
98
|
+
"@modern-js/core": "2.68.18",
|
|
99
|
+
"@modern-js/bff-runtime": "2.68.18",
|
|
100
|
+
"@modern-js/plugin-v2": "2.68.18",
|
|
101
|
+
"@modern-js/runtime": "2.68.18",
|
|
102
|
+
"@modern-js/types": "2.68.18",
|
|
103
103
|
"@scripts/build": "2.66.0",
|
|
104
104
|
"@scripts/jest-config": "2.66.0"
|
|
105
105
|
},
|