@modern-js/plugin-bff 2.25.1 → 2.25.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/CHANGELOG.md +19 -0
- package/dist/cjs/cli.js +5 -2
- package/dist/cjs/loader.js +1 -0
- package/dist/cjs/server.js +1 -0
- package/dist/esm/cli.js +5 -2
- package/dist/esm/loader.js +1 -0
- package/dist/esm/server.js +1 -0
- package/dist/esm-node/cli.js +5 -2
- package/dist/esm-node/loader.js +1 -0
- package/dist/esm-node/server.js +1 -0
- package/dist/types/loader.d.ts +1 -0
- package/package.json +14 -14
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# @modern-js/plugin-bff
|
|
2
2
|
|
|
3
|
+
## 2.25.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 272646c: feat(builder): bump webpack v5.88, support top level await
|
|
8
|
+
|
|
9
|
+
feat(builder): 升级 webpack v5.88, 支持 top level await
|
|
10
|
+
|
|
11
|
+
- 358ed24: fix: support configuration ts-node and avoid to register ts-node unnecessarily
|
|
12
|
+
fix: 支持配置 ts-node,避免对 ts-node 不必要的注册
|
|
13
|
+
- Updated dependencies [63d8247]
|
|
14
|
+
- Updated dependencies [6651684]
|
|
15
|
+
- Updated dependencies [272646c]
|
|
16
|
+
- Updated dependencies [358ed24]
|
|
17
|
+
- @modern-js/utils@2.25.2
|
|
18
|
+
- @modern-js/create-request@2.25.2
|
|
19
|
+
- @modern-js/bff-core@2.25.2
|
|
20
|
+
- @modern-js/server-utils@2.25.2
|
|
21
|
+
|
|
3
22
|
## 2.25.1
|
|
4
23
|
|
|
5
24
|
### Patch Changes
|
package/dist/cjs/cli.js
CHANGED
|
@@ -65,7 +65,7 @@ const bffPlugin = () => {
|
|
|
65
65
|
return {
|
|
66
66
|
tools: {
|
|
67
67
|
bundlerChain: (chain, { CHAIN_ID, isServer }) => {
|
|
68
|
-
const { port, apiDirectory, lambdaDirectory } = api.useAppContext();
|
|
68
|
+
const { port, appDirectory, apiDirectory, lambdaDirectory } = api.useAppContext();
|
|
69
69
|
const modernConfig = api.useResolvedConfigContext();
|
|
70
70
|
const { bff } = modernConfig || {};
|
|
71
71
|
const prefix = (bff === null || bff === void 0 ? void 0 : bff.prefix) || DEFAULT_API_PREFIX;
|
|
@@ -73,9 +73,11 @@ const bffPlugin = () => {
|
|
|
73
73
|
chain.resolve.alias.set("@api", apiDirectory);
|
|
74
74
|
const apiRouter = new _bffcore.ApiRouter({
|
|
75
75
|
apiDir: apiDirectory,
|
|
76
|
+
appDir: appDirectory,
|
|
76
77
|
lambdaDir: lambdaDirectory,
|
|
77
78
|
prefix,
|
|
78
|
-
httpMethodDecider
|
|
79
|
+
httpMethodDecider,
|
|
80
|
+
isBuild: true
|
|
79
81
|
});
|
|
80
82
|
const lambdaDir = apiRouter.getLambdaDir();
|
|
81
83
|
const existLambda = apiRouter.isExistLambda();
|
|
@@ -84,6 +86,7 @@ const bffPlugin = () => {
|
|
|
84
86
|
chain.module.rule(CHAIN_ID.RULE.JS).exclude.add(apiRegexp);
|
|
85
87
|
chain.module.rule(CHAIN_ID.RULE.JS_BFF_API).test(apiRegexp).use("custom-loader").loader(require.resolve("./loader").replace(/\\/g, "/")).options({
|
|
86
88
|
prefix,
|
|
89
|
+
appDir: appDirectory,
|
|
87
90
|
apiDir: apiDirectory,
|
|
88
91
|
lambdaDir,
|
|
89
92
|
existLambda,
|
package/dist/cjs/loader.js
CHANGED
|
@@ -24,6 +24,7 @@ async function loader(source) {
|
|
|
24
24
|
}
|
|
25
25
|
const options = {
|
|
26
26
|
prefix: Array.isArray(draftOptions.prefix) ? draftOptions.prefix[0] : draftOptions.prefix,
|
|
27
|
+
appDir: draftOptions.appDir,
|
|
27
28
|
apiDir: draftOptions.apiDir,
|
|
28
29
|
lambdaDir: draftOptions.lambdaDir,
|
|
29
30
|
target: draftOptions.target,
|
package/dist/cjs/server.js
CHANGED
|
@@ -62,6 +62,7 @@ const _default = () => ({
|
|
|
62
62
|
const appContext = api.useAppContext();
|
|
63
63
|
const { apiDirectory, lambdaDirectory } = appContext;
|
|
64
64
|
const apiRouter = new _bffcore.ApiRouter({
|
|
65
|
+
appDir: pwd,
|
|
65
66
|
apiDir: apiDirectory || apiDir,
|
|
66
67
|
lambdaDir: lambdaDirectory,
|
|
67
68
|
prefix,
|
package/dist/esm/cli.js
CHANGED
|
@@ -51,7 +51,7 @@ export var bffPlugin = function() {
|
|
|
51
51
|
tools: {
|
|
52
52
|
bundlerChain: function(chain, param) {
|
|
53
53
|
var CHAIN_ID = param.CHAIN_ID, isServer = param.isServer;
|
|
54
|
-
var _api_useAppContext = api.useAppContext(), port = _api_useAppContext.port, apiDirectory = _api_useAppContext.apiDirectory, lambdaDirectory = _api_useAppContext.lambdaDirectory;
|
|
54
|
+
var _api_useAppContext = api.useAppContext(), port = _api_useAppContext.port, appDirectory = _api_useAppContext.appDirectory, apiDirectory = _api_useAppContext.apiDirectory, lambdaDirectory = _api_useAppContext.lambdaDirectory;
|
|
55
55
|
var modernConfig = api.useResolvedConfigContext();
|
|
56
56
|
var bff = (modernConfig || {}).bff;
|
|
57
57
|
var prefix = (bff === null || bff === void 0 ? void 0 : bff.prefix) || DEFAULT_API_PREFIX;
|
|
@@ -59,9 +59,11 @@ export var bffPlugin = function() {
|
|
|
59
59
|
chain.resolve.alias.set("@api", apiDirectory);
|
|
60
60
|
var apiRouter = new ApiRouter({
|
|
61
61
|
apiDir: apiDirectory,
|
|
62
|
+
appDir: appDirectory,
|
|
62
63
|
lambdaDir: lambdaDirectory,
|
|
63
64
|
prefix: prefix,
|
|
64
|
-
httpMethodDecider: httpMethodDecider
|
|
65
|
+
httpMethodDecider: httpMethodDecider,
|
|
66
|
+
isBuild: true
|
|
65
67
|
});
|
|
66
68
|
var lambdaDir = apiRouter.getLambdaDir();
|
|
67
69
|
var existLambda = apiRouter.isExistLambda();
|
|
@@ -70,6 +72,7 @@ export var bffPlugin = function() {
|
|
|
70
72
|
chain.module.rule(CHAIN_ID.RULE.JS).exclude.add(apiRegexp);
|
|
71
73
|
chain.module.rule(CHAIN_ID.RULE.JS_BFF_API).test(apiRegexp).use("custom-loader").loader(require.resolve("./loader").replace(/\\/g, "/")).options({
|
|
72
74
|
prefix: prefix,
|
|
75
|
+
appDir: appDirectory,
|
|
73
76
|
apiDir: apiDirectory,
|
|
74
77
|
lambdaDir: lambdaDir,
|
|
75
78
|
existLambda: existLambda,
|
package/dist/esm/loader.js
CHANGED
|
@@ -26,6 +26,7 @@ function _loader() {
|
|
|
26
26
|
}
|
|
27
27
|
options = {
|
|
28
28
|
prefix: Array.isArray(draftOptions.prefix) ? draftOptions.prefix[0] : draftOptions.prefix,
|
|
29
|
+
appDir: draftOptions.appDir,
|
|
29
30
|
apiDir: draftOptions.apiDir,
|
|
30
31
|
lambdaDir: draftOptions.lambdaDir,
|
|
31
32
|
target: draftOptions.target,
|
package/dist/esm/server.js
CHANGED
|
@@ -67,6 +67,7 @@ export default function() {
|
|
|
67
67
|
var appContext = api.useAppContext();
|
|
68
68
|
var apiDirectory = appContext.apiDirectory, lambdaDirectory = appContext.lambdaDirectory;
|
|
69
69
|
var apiRouter = new ApiRouter({
|
|
70
|
+
appDir: pwd,
|
|
70
71
|
apiDir: apiDirectory || apiDir,
|
|
71
72
|
lambdaDir: lambdaDirectory,
|
|
72
73
|
prefix: prefix,
|
package/dist/esm-node/cli.js
CHANGED
|
@@ -45,7 +45,7 @@ export const bffPlugin = () => {
|
|
|
45
45
|
return {
|
|
46
46
|
tools: {
|
|
47
47
|
bundlerChain: (chain, { CHAIN_ID, isServer }) => {
|
|
48
|
-
const { port, apiDirectory, lambdaDirectory } = api.useAppContext();
|
|
48
|
+
const { port, appDirectory, apiDirectory, lambdaDirectory } = api.useAppContext();
|
|
49
49
|
const modernConfig = api.useResolvedConfigContext();
|
|
50
50
|
const { bff } = modernConfig || {};
|
|
51
51
|
const prefix = (bff === null || bff === void 0 ? void 0 : bff.prefix) || DEFAULT_API_PREFIX;
|
|
@@ -53,9 +53,11 @@ export const bffPlugin = () => {
|
|
|
53
53
|
chain.resolve.alias.set("@api", apiDirectory);
|
|
54
54
|
const apiRouter = new ApiRouter({
|
|
55
55
|
apiDir: apiDirectory,
|
|
56
|
+
appDir: appDirectory,
|
|
56
57
|
lambdaDir: lambdaDirectory,
|
|
57
58
|
prefix,
|
|
58
|
-
httpMethodDecider
|
|
59
|
+
httpMethodDecider,
|
|
60
|
+
isBuild: true
|
|
59
61
|
});
|
|
60
62
|
const lambdaDir = apiRouter.getLambdaDir();
|
|
61
63
|
const existLambda = apiRouter.isExistLambda();
|
|
@@ -64,6 +66,7 @@ export const bffPlugin = () => {
|
|
|
64
66
|
chain.module.rule(CHAIN_ID.RULE.JS).exclude.add(apiRegexp);
|
|
65
67
|
chain.module.rule(CHAIN_ID.RULE.JS_BFF_API).test(apiRegexp).use("custom-loader").loader(require.resolve("./loader").replace(/\\/g, "/")).options({
|
|
66
68
|
prefix,
|
|
69
|
+
appDir: appDirectory,
|
|
67
70
|
apiDir: apiDirectory,
|
|
68
71
|
lambdaDir,
|
|
69
72
|
existLambda,
|
package/dist/esm-node/loader.js
CHANGED
|
@@ -14,6 +14,7 @@ async function loader(source) {
|
|
|
14
14
|
}
|
|
15
15
|
const options = {
|
|
16
16
|
prefix: Array.isArray(draftOptions.prefix) ? draftOptions.prefix[0] : draftOptions.prefix,
|
|
17
|
+
appDir: draftOptions.appDir,
|
|
17
18
|
apiDir: draftOptions.apiDir,
|
|
18
19
|
lambdaDir: draftOptions.lambdaDir,
|
|
19
20
|
target: draftOptions.target,
|
package/dist/esm-node/server.js
CHANGED
package/dist/types/loader.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"modern",
|
|
16
16
|
"modern.js"
|
|
17
17
|
],
|
|
18
|
-
"version": "2.25.
|
|
18
|
+
"version": "2.25.2",
|
|
19
19
|
"jsnext:source": "./src/cli.ts",
|
|
20
20
|
"types": "./dist/types/cli.d.ts",
|
|
21
21
|
"main": "./dist/cjs/cli.js",
|
|
@@ -57,10 +57,10 @@
|
|
|
57
57
|
"dependencies": {
|
|
58
58
|
"@babel/core": "^7.21.8",
|
|
59
59
|
"@swc/helpers": "0.5.1",
|
|
60
|
-
"@modern-js/
|
|
61
|
-
"@modern-js/
|
|
62
|
-
"@modern-js/
|
|
63
|
-
"@modern-js/
|
|
60
|
+
"@modern-js/create-request": "2.25.2",
|
|
61
|
+
"@modern-js/server-utils": "2.25.2",
|
|
62
|
+
"@modern-js/utils": "2.25.2",
|
|
63
|
+
"@modern-js/bff-core": "2.25.2"
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
66
66
|
"@types/babel__core": "^7.20.0",
|
|
@@ -70,16 +70,16 @@
|
|
|
70
70
|
"memfs": "^3.3.0",
|
|
71
71
|
"ts-jest": "^29.1.0",
|
|
72
72
|
"typescript": "^5",
|
|
73
|
-
"webpack": "^5.
|
|
73
|
+
"webpack": "^5.88.1",
|
|
74
74
|
"webpack-chain": "^6.5.1",
|
|
75
|
-
"@modern-js/runtime": "2.25.
|
|
76
|
-
"@modern-js/core": "2.25.
|
|
77
|
-
"@modern-js/bff-runtime": "2.25.
|
|
78
|
-
"@modern-js/server-core": "2.25.
|
|
79
|
-
"@modern-js/types": "2.25.
|
|
80
|
-
"@modern-js/app-tools": "2.25.
|
|
81
|
-
"@scripts/
|
|
82
|
-
"@scripts/
|
|
75
|
+
"@modern-js/runtime": "2.25.2",
|
|
76
|
+
"@modern-js/core": "2.25.2",
|
|
77
|
+
"@modern-js/bff-runtime": "2.25.2",
|
|
78
|
+
"@modern-js/server-core": "2.25.2",
|
|
79
|
+
"@modern-js/types": "2.25.2",
|
|
80
|
+
"@modern-js/app-tools": "2.25.2",
|
|
81
|
+
"@scripts/jest-config": "2.25.2",
|
|
82
|
+
"@scripts/build": "2.25.2"
|
|
83
83
|
},
|
|
84
84
|
"sideEffects": false,
|
|
85
85
|
"publishConfig": {
|