@modern-js/plugin-bff 2.40.1-alpha.0 → 2.42.0
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 +1 -8
- package/dist/esm/cli.js +6 -18
- package/dist/esm-node/cli.js +1 -8
- package/dist/types/cli.d.ts +1 -1
- package/dist/types/constants.d.ts +1 -1
- package/dist/types/helper.d.ts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/loader.d.ts +11 -11
- package/dist/types/server.d.ts +1 -1
- package/package.json +16 -16
package/dist/cjs/cli.js
CHANGED
|
@@ -39,7 +39,6 @@ var import_bff_core = require("@modern-js/bff-core");
|
|
|
39
39
|
var import_helper = require("./helper");
|
|
40
40
|
const DEFAULT_API_PREFIX = "/api";
|
|
41
41
|
const TS_CONFIG_FILENAME = "tsconfig.json";
|
|
42
|
-
const SERVER_TS_CONFIG = "tsconfig.server.json";
|
|
43
42
|
const bffPlugin = () => ({
|
|
44
43
|
name: "@modern-js/plugin-bff",
|
|
45
44
|
setup: (api) => {
|
|
@@ -145,13 +144,7 @@ const bffPlugin = () => ({
|
|
|
145
144
|
const distDir = import_path.default.resolve(distDirectory);
|
|
146
145
|
const apiDir = apiDirectory || import_path.default.resolve(appDirectory, import_utils.API_DIR);
|
|
147
146
|
const sharedDir = sharedDirectory || import_path.default.resolve(appDirectory, import_utils.SHARED_DIR);
|
|
148
|
-
|
|
149
|
-
const serverTsconfigPath = import_path.default.resolve(appDirectory, SERVER_TS_CONFIG);
|
|
150
|
-
if (await import_utils.fs.pathExists(serverTsconfigPath)) {
|
|
151
|
-
tsconfigPath = serverTsconfigPath;
|
|
152
|
-
} else {
|
|
153
|
-
tsconfigPath = import_path.default.resolve(appDirectory, TS_CONFIG_FILENAME);
|
|
154
|
-
}
|
|
147
|
+
const tsconfigPath = import_path.default.resolve(appDirectory, TS_CONFIG_FILENAME);
|
|
155
148
|
const sourceDirs = [];
|
|
156
149
|
if (import_utils.fs.existsSync(apiDir)) {
|
|
157
150
|
sourceDirs.push(apiDir);
|
package/dist/esm/cli.js
CHANGED
|
@@ -10,7 +10,6 @@ import { ApiRouter } from "@modern-js/bff-core";
|
|
|
10
10
|
import { registerModernRuntimePath } from "./helper";
|
|
11
11
|
var DEFAULT_API_PREFIX = "/api";
|
|
12
12
|
var TS_CONFIG_FILENAME = "tsconfig.json";
|
|
13
|
-
var SERVER_TS_CONFIG = "tsconfig.server.json";
|
|
14
13
|
var bffPlugin = function() {
|
|
15
14
|
return {
|
|
16
15
|
name: "@modern-js/plugin-bff",
|
|
@@ -123,7 +122,7 @@ var bffPlugin = function() {
|
|
|
123
122
|
},
|
|
124
123
|
afterBuild: function afterBuild() {
|
|
125
124
|
return _async_to_generator(function() {
|
|
126
|
-
var _api_useAppContext, appDirectory, distDirectory, apiDirectory, sharedDirectory, modernConfig, distDir, apiDir, sharedDir, tsconfigPath,
|
|
125
|
+
var _api_useAppContext, appDirectory, distDirectory, apiDirectory, sharedDirectory, modernConfig, distDir, apiDir, sharedDir, tsconfigPath, sourceDirs, server, alias, babel;
|
|
127
126
|
return _ts_generator(this, function(_state) {
|
|
128
127
|
switch (_state.label) {
|
|
129
128
|
case 0:
|
|
@@ -135,18 +134,7 @@ var bffPlugin = function() {
|
|
|
135
134
|
distDir = path.resolve(distDirectory);
|
|
136
135
|
apiDir = apiDirectory || path.resolve(appDirectory, API_DIR);
|
|
137
136
|
sharedDir = sharedDirectory || path.resolve(appDirectory, SHARED_DIR);
|
|
138
|
-
tsconfigPath =
|
|
139
|
-
serverTsconfigPath = path.resolve(appDirectory, SERVER_TS_CONFIG);
|
|
140
|
-
return [
|
|
141
|
-
4,
|
|
142
|
-
fs.pathExists(serverTsconfigPath)
|
|
143
|
-
];
|
|
144
|
-
case 1:
|
|
145
|
-
if (_state.sent()) {
|
|
146
|
-
tsconfigPath = serverTsconfigPath;
|
|
147
|
-
} else {
|
|
148
|
-
tsconfigPath = path.resolve(appDirectory, TS_CONFIG_FILENAME);
|
|
149
|
-
}
|
|
137
|
+
tsconfigPath = path.resolve(appDirectory, TS_CONFIG_FILENAME);
|
|
150
138
|
sourceDirs = [];
|
|
151
139
|
if (fs.existsSync(apiDir)) {
|
|
152
140
|
sourceDirs.push(apiDir);
|
|
@@ -160,7 +148,7 @@ var bffPlugin = function() {
|
|
|
160
148
|
if (!(sourceDirs.length > 0))
|
|
161
149
|
return [
|
|
162
150
|
3,
|
|
163
|
-
|
|
151
|
+
2
|
|
164
152
|
];
|
|
165
153
|
return [
|
|
166
154
|
4,
|
|
@@ -174,10 +162,10 @@ var bffPlugin = function() {
|
|
|
174
162
|
tsconfigPath
|
|
175
163
|
})
|
|
176
164
|
];
|
|
177
|
-
case
|
|
165
|
+
case 1:
|
|
178
166
|
_state.sent();
|
|
179
|
-
_state.label =
|
|
180
|
-
case
|
|
167
|
+
_state.label = 2;
|
|
168
|
+
case 2:
|
|
181
169
|
return [
|
|
182
170
|
2
|
|
183
171
|
];
|
package/dist/esm-node/cli.js
CHANGED
|
@@ -5,7 +5,6 @@ import { ApiRouter } from "@modern-js/bff-core";
|
|
|
5
5
|
import { registerModernRuntimePath } from "./helper";
|
|
6
6
|
const DEFAULT_API_PREFIX = "/api";
|
|
7
7
|
const TS_CONFIG_FILENAME = "tsconfig.json";
|
|
8
|
-
const SERVER_TS_CONFIG = "tsconfig.server.json";
|
|
9
8
|
const bffPlugin = () => ({
|
|
10
9
|
name: "@modern-js/plugin-bff",
|
|
11
10
|
setup: (api) => {
|
|
@@ -111,13 +110,7 @@ const bffPlugin = () => ({
|
|
|
111
110
|
const distDir = path.resolve(distDirectory);
|
|
112
111
|
const apiDir = apiDirectory || path.resolve(appDirectory, API_DIR);
|
|
113
112
|
const sharedDir = sharedDirectory || path.resolve(appDirectory, SHARED_DIR);
|
|
114
|
-
|
|
115
|
-
const serverTsconfigPath = path.resolve(appDirectory, SERVER_TS_CONFIG);
|
|
116
|
-
if (await fs.pathExists(serverTsconfigPath)) {
|
|
117
|
-
tsconfigPath = serverTsconfigPath;
|
|
118
|
-
} else {
|
|
119
|
-
tsconfigPath = path.resolve(appDirectory, TS_CONFIG_FILENAME);
|
|
120
|
-
}
|
|
113
|
+
const tsconfigPath = path.resolve(appDirectory, TS_CONFIG_FILENAME);
|
|
121
114
|
const sourceDirs = [];
|
|
122
115
|
if (fs.existsSync(apiDir)) {
|
|
123
116
|
sourceDirs.push(apiDir);
|
package/dist/types/cli.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const API_APP_NAME = "_app";
|
|
2
|
-
export declare const BUILD_FILES: string[];
|
|
2
|
+
export declare const BUILD_FILES: string[];
|
package/dist/types/helper.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
declare const registerModernRuntimePath: (internalDirectory: string) => () => void;
|
|
2
|
-
export { registerModernRuntimePath };
|
|
2
|
+
export { registerModernRuntimePath };
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './constants';
|
|
1
|
+
export * from './constants';
|
package/dist/types/loader.d.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import type { HttpMethodDecider } from '@modern-js/types';
|
|
2
2
|
import type { LoaderContext } from 'webpack';
|
|
3
3
|
export type APILoaderOptions = {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
4
|
+
prefix: string;
|
|
5
|
+
appDir: string;
|
|
6
|
+
apiDir: string;
|
|
7
|
+
lambdaDir: string;
|
|
8
|
+
existLambda: boolean;
|
|
9
|
+
port: number;
|
|
10
|
+
fetcher?: string;
|
|
11
|
+
requestCreator?: string;
|
|
12
|
+
target: string;
|
|
13
|
+
httpMethodDecider?: HttpMethodDecider;
|
|
14
14
|
};
|
|
15
15
|
declare function loader(this: LoaderContext<APILoaderOptions>, source: string): Promise<void>;
|
|
16
|
-
export default loader;
|
|
16
|
+
export default loader;
|
package/dist/types/server.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"modern",
|
|
16
16
|
"modern.js"
|
|
17
17
|
],
|
|
18
|
-
"version": "2.
|
|
18
|
+
"version": "2.42.0",
|
|
19
19
|
"jsnext:source": "./src/cli.ts",
|
|
20
20
|
"types": "./dist/types/cli.d.ts",
|
|
21
21
|
"main": "./dist/cjs/cli.js",
|
|
@@ -56,29 +56,29 @@
|
|
|
56
56
|
},
|
|
57
57
|
"dependencies": {
|
|
58
58
|
"@babel/core": "^7.23.2",
|
|
59
|
-
"@swc/helpers": "0.5.
|
|
60
|
-
"@modern-js/bff-core": "2.
|
|
61
|
-
"@modern-js/
|
|
62
|
-
"@modern-js/
|
|
63
|
-
"@modern-js/
|
|
59
|
+
"@swc/helpers": "0.5.3",
|
|
60
|
+
"@modern-js/bff-core": "2.42.0",
|
|
61
|
+
"@modern-js/create-request": "2.42.0",
|
|
62
|
+
"@modern-js/utils": "2.42.0",
|
|
63
|
+
"@modern-js/server-utils": "2.42.0"
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
66
|
-
"@types/babel__core": "^7.20.
|
|
66
|
+
"@types/babel__core": "^7.20.1",
|
|
67
67
|
"@types/jest": "^29",
|
|
68
68
|
"@types/node": "^14",
|
|
69
69
|
"jest": "^29",
|
|
70
|
-
"memfs": "^3.
|
|
70
|
+
"memfs": "^3.5.1",
|
|
71
71
|
"ts-jest": "^29.1.0",
|
|
72
72
|
"typescript": "^5",
|
|
73
73
|
"webpack": "^5.88.1",
|
|
74
|
-
"@modern-js/
|
|
75
|
-
"@modern-js/
|
|
76
|
-
"@modern-js/runtime": "2.
|
|
77
|
-
"@modern-js/
|
|
78
|
-
"@modern-js/
|
|
79
|
-
"@
|
|
80
|
-
"@scripts/
|
|
81
|
-
"@
|
|
74
|
+
"@modern-js/runtime": "2.42.0",
|
|
75
|
+
"@modern-js/core": "2.42.0",
|
|
76
|
+
"@modern-js/bff-runtime": "2.42.0",
|
|
77
|
+
"@modern-js/server-core": "2.42.0",
|
|
78
|
+
"@modern-js/types": "2.42.0",
|
|
79
|
+
"@modern-js/app-tools": "2.42.0",
|
|
80
|
+
"@scripts/jest-config": "2.42.0",
|
|
81
|
+
"@scripts/build": "2.42.0"
|
|
82
82
|
},
|
|
83
83
|
"sideEffects": false,
|
|
84
84
|
"publishConfig": {
|