@modern-js/plugin-bff 3.1.0 → 3.1.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.
- package/dist/esm/cli.mjs +2 -1
- package/dist/esm/loader.mjs +1 -1
- package/dist/esm/runtime/create-request/index.mjs +1 -2
- package/dist/esm/runtime/hono/adapter.mjs +2 -2
- package/dist/esm/server.mjs +1 -1
- package/dist/esm/utils/clientGenerator.mjs +2 -1
- package/dist/esm/utils/createHonoRoutes.mjs +2 -1
- package/dist/esm/utils/crossProjectApiPlugin.mjs +2 -1
- package/dist/esm/utils/pluginGenerator.mjs +1 -1
- package/dist/esm/utils/runtimeGenerator.mjs +1 -1
- package/dist/esm-node/cli.mjs +4 -3
- package/dist/esm-node/loader.mjs +1 -1
- package/dist/esm-node/runtime/create-request/index.mjs +1 -2
- package/dist/esm-node/runtime/hono/adapter.mjs +2 -2
- package/dist/esm-node/server.mjs +1 -1
- package/dist/esm-node/utils/clientGenerator.mjs +2 -1
- package/dist/esm-node/utils/createHonoRoutes.mjs +2 -1
- package/dist/esm-node/utils/crossProjectApiPlugin.mjs +2 -1
- package/dist/esm-node/utils/pluginGenerator.mjs +3 -3
- package/dist/esm-node/utils/runtimeGenerator.mjs +1 -1
- package/package.json +14 -14
- /package/{rstest.config.ts → rstest.config.mts} +0 -0
package/dist/esm/cli.mjs
CHANGED
package/dist/esm/loader.mjs
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { configure, createRequest, createUploader };
|
|
1
|
+
export { configure, createRequest, createUploader } from "@modern-js/create-request";
|
|
@@ -28,7 +28,7 @@ class HonoAdapter {
|
|
|
28
28
|
method,
|
|
29
29
|
handler,
|
|
30
30
|
order: 'post',
|
|
31
|
-
before
|
|
31
|
+
before: before
|
|
32
32
|
}));
|
|
33
33
|
};
|
|
34
34
|
this.registerApiRoutes = async ()=>{
|
|
@@ -88,7 +88,7 @@ class HonoAdapter {
|
|
|
88
88
|
path: `${prefix}/*`,
|
|
89
89
|
method: 'all',
|
|
90
90
|
order: 'post',
|
|
91
|
-
before,
|
|
91
|
+
before: before,
|
|
92
92
|
handler: async (c, next)=>{
|
|
93
93
|
if (this.apiServer) {
|
|
94
94
|
const nodeReq = c.env?.node?.req;
|
package/dist/esm/server.mjs
CHANGED
|
@@ -172,4 +172,5 @@ async function clientGenerator(draftOptions) {
|
|
|
172
172
|
setPackage(sourceList, draftOptions.appDir, draftOptions.relativeDistPath);
|
|
173
173
|
}
|
|
174
174
|
const utils_clientGenerator = clientGenerator;
|
|
175
|
-
export
|
|
175
|
+
export default utils_clientGenerator;
|
|
176
|
+
export { copyFiles, readDirectoryFiles };
|
|
@@ -31,4 +31,5 @@ When using cross-project BFF, you should not configure bff.prefix as it may caus
|
|
|
31
31
|
}
|
|
32
32
|
});
|
|
33
33
|
const utils_crossProjectApiPlugin = crossProjectApiPlugin;
|
|
34
|
-
export
|
|
34
|
+
export default utils_crossProjectApiPlugin;
|
|
35
|
+
export { API_DIR, DIST_DIR, LAMBDA_DIR, PACKAGE_NAME, PREFIX, crossProjectApiPlugin };
|
|
@@ -40,4 +40,4 @@ async function runtimeGenerator({ runtime, appDirectory, relativeDistPath, packa
|
|
|
40
40
|
await fs.writeFile(pluginTypePath, tsSource);
|
|
41
41
|
}
|
|
42
42
|
const utils_runtimeGenerator = runtimeGenerator;
|
|
43
|
-
export
|
|
43
|
+
export default utils_runtimeGenerator;
|
package/dist/esm-node/cli.mjs
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import "node:module";
|
|
2
|
-
import { fileURLToPath as __rspack_fileURLToPath } from "node:url";
|
|
3
|
-
import { dirname as __rspack_dirname } from "node:path";
|
|
4
2
|
import path from "path";
|
|
5
3
|
import { ApiRouter } from "@modern-js/bff-core";
|
|
6
4
|
import { compile } from "@modern-js/server-utils";
|
|
@@ -8,6 +6,8 @@ import { API_DIR, DEFAULT_API_PREFIX, SHARED_DIR, fs, normalizeOutputPath } from
|
|
|
8
6
|
import clientGenerator from "./utils/clientGenerator.mjs";
|
|
9
7
|
import pluginGenerator from "./utils/pluginGenerator.mjs";
|
|
10
8
|
import runtimeGenerator from "./utils/runtimeGenerator.mjs";
|
|
9
|
+
import { fileURLToPath as __rspack_fileURLToPath } from "node:url";
|
|
10
|
+
import { dirname as __rspack_dirname } from "node:path";
|
|
11
11
|
var cli_dirname = __rspack_dirname(__rspack_fileURLToPath(import.meta.url));
|
|
12
12
|
const TS_CONFIG_FILENAME = 'tsconfig.json';
|
|
13
13
|
const RUNTIME_CREATE_REQUEST = '@modern-js/plugin-bff/client';
|
|
@@ -207,4 +207,5 @@ const bffPlugin = ()=>({
|
|
|
207
207
|
}
|
|
208
208
|
});
|
|
209
209
|
const cli = bffPlugin;
|
|
210
|
-
export
|
|
210
|
+
export default cli;
|
|
211
|
+
export { bffPlugin };
|
package/dist/esm-node/loader.mjs
CHANGED
|
@@ -29,7 +29,7 @@ class HonoAdapter {
|
|
|
29
29
|
method,
|
|
30
30
|
handler,
|
|
31
31
|
order: 'post',
|
|
32
|
-
before
|
|
32
|
+
before: before
|
|
33
33
|
}));
|
|
34
34
|
};
|
|
35
35
|
this.registerApiRoutes = async ()=>{
|
|
@@ -89,7 +89,7 @@ class HonoAdapter {
|
|
|
89
89
|
path: `${prefix}/*`,
|
|
90
90
|
method: 'all',
|
|
91
91
|
order: 'post',
|
|
92
|
-
before,
|
|
92
|
+
before: before,
|
|
93
93
|
handler: async (c, next)=>{
|
|
94
94
|
if (this.apiServer) {
|
|
95
95
|
const nodeReq = c.env?.node?.req;
|
package/dist/esm-node/server.mjs
CHANGED
|
@@ -173,4 +173,5 @@ async function clientGenerator(draftOptions) {
|
|
|
173
173
|
setPackage(sourceList, draftOptions.appDir, draftOptions.relativeDistPath);
|
|
174
174
|
}
|
|
175
175
|
const utils_clientGenerator = clientGenerator;
|
|
176
|
-
export
|
|
176
|
+
export default utils_clientGenerator;
|
|
177
|
+
export { copyFiles, readDirectoryFiles };
|
|
@@ -32,4 +32,5 @@ When using cross-project BFF, you should not configure bff.prefix as it may caus
|
|
|
32
32
|
}
|
|
33
33
|
});
|
|
34
34
|
const utils_crossProjectApiPlugin = crossProjectApiPlugin;
|
|
35
|
-
export
|
|
35
|
+
export default utils_crossProjectApiPlugin;
|
|
36
|
+
export { API_DIR, DIST_DIR, LAMBDA_DIR, PACKAGE_NAME, PREFIX, crossProjectApiPlugin };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import "node:module";
|
|
2
|
-
import { fileURLToPath as __rspack_fileURLToPath } from "node:url";
|
|
3
|
-
import { dirname as __rspack_dirname } from "node:path";
|
|
4
2
|
import path from "path";
|
|
5
3
|
import { fs, logger, normalizeToPosixPath } from "@modern-js/utils";
|
|
6
4
|
import { API_DIR, DIST_DIR, LAMBDA_DIR, PACKAGE_NAME, PREFIX } from "./crossProjectApiPlugin.mjs";
|
|
5
|
+
import { fileURLToPath as __rspack_fileURLToPath } from "node:url";
|
|
6
|
+
import { dirname as __rspack_dirname } from "node:path";
|
|
7
7
|
var pluginGenerator_dirname = __rspack_dirname(__rspack_fileURLToPath(import.meta.url));
|
|
8
8
|
function replaceContent(source, packageName, prefix, relativeDistPath, relativeApiPath, relativeLambdaPath) {
|
|
9
9
|
const updatedSource = source.replace(new RegExp(PACKAGE_NAME, 'g'), packageName).replace(new RegExp(PREFIX, 'g'), prefix).replace(new RegExp(DIST_DIR, 'g'), normalizeToPosixPath(relativeDistPath)).replace(new RegExp(API_DIR, 'g'), normalizeToPosixPath(relativeApiPath)).replace(new RegExp(LAMBDA_DIR, 'g'), normalizeToPosixPath(relativeLambdaPath));
|
|
@@ -30,4 +30,4 @@ async function pluginGenerator({ prefix, appDirectory, relativeDistPath, relativ
|
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
const utils_pluginGenerator = pluginGenerator;
|
|
33
|
-
export
|
|
33
|
+
export default utils_pluginGenerator;
|
|
@@ -42,4 +42,4 @@ async function runtimeGenerator({ runtime, appDirectory, relativeDistPath, packa
|
|
|
42
42
|
await fs.writeFile(pluginTypePath, tsSource);
|
|
43
43
|
}
|
|
44
44
|
const utils_runtimeGenerator = runtimeGenerator;
|
|
45
|
-
export
|
|
45
|
+
export default utils_runtimeGenerator;
|
package/package.json
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"modern",
|
|
16
16
|
"modern.js"
|
|
17
17
|
],
|
|
18
|
-
"version": "3.1.
|
|
18
|
+
"version": "3.1.2",
|
|
19
19
|
"types": "./dist/types/cli.d.ts",
|
|
20
20
|
"main": "./dist/cjs/cli.js",
|
|
21
21
|
"exports": {
|
|
@@ -79,28 +79,28 @@
|
|
|
79
79
|
"@swc/helpers": "^0.5.17",
|
|
80
80
|
"qs": "^6.15.0",
|
|
81
81
|
"type-is": "^1.6.18",
|
|
82
|
-
"@modern-js/bff-core": "3.1.
|
|
83
|
-
"@modern-js/
|
|
84
|
-
"@modern-js/
|
|
85
|
-
"@modern-js/server-core": "3.1.
|
|
86
|
-
"@modern-js/
|
|
87
|
-
"@modern-js/utils": "3.1.
|
|
82
|
+
"@modern-js/bff-core": "3.1.2",
|
|
83
|
+
"@modern-js/create-request": "3.1.2",
|
|
84
|
+
"@modern-js/builder": "3.1.2",
|
|
85
|
+
"@modern-js/server-core": "3.1.2",
|
|
86
|
+
"@modern-js/utils": "3.1.2",
|
|
87
|
+
"@modern-js/server-utils": "3.1.2"
|
|
88
88
|
},
|
|
89
89
|
"devDependencies": {
|
|
90
|
-
"@rsbuild/core": "2.0.0-
|
|
91
|
-
"@rslib/core": "0.
|
|
90
|
+
"@rsbuild/core": "2.0.0-rc.0",
|
|
91
|
+
"@rslib/core": "0.20.3",
|
|
92
92
|
"@types/node": "^20",
|
|
93
93
|
"@types/qs": "^6.15.0",
|
|
94
94
|
"@types/type-is": "^1.6.7",
|
|
95
95
|
"memfs": "^3.5.3",
|
|
96
96
|
"typescript": "^5",
|
|
97
97
|
"zod": "^3.25.76",
|
|
98
|
-
"@modern-js/
|
|
99
|
-
"@modern-js/
|
|
100
|
-
"@modern-js/plugin": "3.1.0",
|
|
98
|
+
"@modern-js/bff-runtime": "3.1.2",
|
|
99
|
+
"@modern-js/plugin": "3.1.2",
|
|
101
100
|
"@modern-js/rslib": "2.68.10",
|
|
102
|
-
"@modern-js/runtime": "3.1.
|
|
103
|
-
"@modern-js/types": "3.1.
|
|
101
|
+
"@modern-js/runtime": "3.1.2",
|
|
102
|
+
"@modern-js/types": "3.1.2",
|
|
103
|
+
"@modern-js/app-tools": "3.1.2",
|
|
104
104
|
"@scripts/rstest-config": "2.66.0"
|
|
105
105
|
},
|
|
106
106
|
"sideEffects": false,
|
|
File without changes
|