@modern-js/plugin-express 1.5.4 → 1.5.5
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
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @modern-js/plugin-express
|
|
2
2
|
|
|
3
|
+
## 1.5.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- bfccb4c8: fix: bff runtime path not found in development
|
|
8
|
+
- Updated dependencies [d57e7622]
|
|
9
|
+
- Updated dependencies [6451a098]
|
|
10
|
+
- Updated dependencies [192dbc78]
|
|
11
|
+
- Updated dependencies [d5a2cfd8]
|
|
12
|
+
- Updated dependencies [437367c6]
|
|
13
|
+
- @modern-js/bff-utils@1.2.8
|
|
14
|
+
- @modern-js/utils@1.7.6
|
|
15
|
+
- @modern-js/types@1.5.4
|
|
16
|
+
|
|
3
17
|
## 1.5.4
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
|
@@ -11,7 +11,6 @@ export default (() => ({
|
|
|
11
11
|
const runtimeModulePath = path.resolve(__dirname, '../runtime');
|
|
12
12
|
return {
|
|
13
13
|
config() {
|
|
14
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
15
14
|
const appContext = useAppContext();
|
|
16
15
|
const {
|
|
17
16
|
appDirectory
|
|
@@ -19,17 +18,27 @@ export default (() => ({
|
|
|
19
18
|
bffExportsUtils = createRuntimeExportsUtils(appContext.internalDirectory, 'server');
|
|
20
19
|
const serverRuntimePath = bffExportsUtils.getPath();
|
|
21
20
|
const relativeRuntimePath = getRelativeRuntimePath(appDirectory, serverRuntimePath);
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
21
|
+
|
|
22
|
+
if (process.env.NODE_ENV === 'production') {
|
|
23
|
+
return {
|
|
24
|
+
source: {
|
|
25
|
+
alias: {
|
|
26
|
+
'@modern-js/runtime/server': relativeRuntimePath
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
} else {
|
|
31
|
+
return {
|
|
32
|
+
source: {
|
|
33
|
+
alias: {
|
|
34
|
+
'@modern-js/runtime/server': serverRuntimePath
|
|
35
|
+
}
|
|
26
36
|
}
|
|
27
|
-
}
|
|
28
|
-
}
|
|
37
|
+
};
|
|
38
|
+
}
|
|
29
39
|
},
|
|
30
40
|
|
|
31
41
|
addRuntimeExports(input) {
|
|
32
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
33
42
|
const {
|
|
34
43
|
appDirectory
|
|
35
44
|
} = useAppContext();
|
|
@@ -13,7 +13,6 @@ import { createDebugger } from '@modern-js/utils';
|
|
|
13
13
|
const debug = createDebugger('express');
|
|
14
14
|
|
|
15
15
|
const registerRoutes = app => {
|
|
16
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
17
16
|
const handlerInfos = useAPIHandlerInfos();
|
|
18
17
|
sortDynamicRoutes(handlerInfos);
|
|
19
18
|
debug('handlerInfos', handlerInfos);
|
|
@@ -53,7 +52,6 @@ const registerRoutes = app => {
|
|
|
53
52
|
return await Promise.resolve();
|
|
54
53
|
}
|
|
55
54
|
|
|
56
|
-
res.status(200);
|
|
57
55
|
return res.json(body);
|
|
58
56
|
} catch (e) {
|
|
59
57
|
return next(e);
|
|
@@ -25,7 +25,6 @@ var _default = () => ({
|
|
|
25
25
|
const runtimeModulePath = path.resolve(__dirname, '../runtime');
|
|
26
26
|
return {
|
|
27
27
|
config() {
|
|
28
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
29
28
|
const appContext = useAppContext();
|
|
30
29
|
const {
|
|
31
30
|
appDirectory
|
|
@@ -33,17 +32,27 @@ var _default = () => ({
|
|
|
33
32
|
bffExportsUtils = (0, _utils.createRuntimeExportsUtils)(appContext.internalDirectory, 'server');
|
|
34
33
|
const serverRuntimePath = bffExportsUtils.getPath();
|
|
35
34
|
const relativeRuntimePath = (0, _adapterHelpers.getRelativeRuntimePath)(appDirectory, serverRuntimePath);
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
35
|
+
|
|
36
|
+
if (process.env.NODE_ENV === 'production') {
|
|
37
|
+
return {
|
|
38
|
+
source: {
|
|
39
|
+
alias: {
|
|
40
|
+
'@modern-js/runtime/server': relativeRuntimePath
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
} else {
|
|
45
|
+
return {
|
|
46
|
+
source: {
|
|
47
|
+
alias: {
|
|
48
|
+
'@modern-js/runtime/server': serverRuntimePath
|
|
49
|
+
}
|
|
40
50
|
}
|
|
41
|
-
}
|
|
42
|
-
}
|
|
51
|
+
};
|
|
52
|
+
}
|
|
43
53
|
},
|
|
44
54
|
|
|
45
55
|
addRuntimeExports(input) {
|
|
46
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
47
56
|
const {
|
|
48
57
|
appDirectory
|
|
49
58
|
} = useAppContext();
|
|
@@ -28,7 +28,6 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
|
28
28
|
const debug = (0, _utils.createDebugger)('express');
|
|
29
29
|
|
|
30
30
|
const registerRoutes = app => {
|
|
31
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
32
31
|
const handlerInfos = (0, _bffUtils.useAPIHandlerInfos)();
|
|
33
32
|
(0, _adapterHelpers.sortDynamicRoutes)(handlerInfos);
|
|
34
33
|
debug('handlerInfos', handlerInfos);
|
|
@@ -68,7 +67,6 @@ const registerRoutes = app => {
|
|
|
68
67
|
return await Promise.resolve();
|
|
69
68
|
}
|
|
70
69
|
|
|
71
|
-
res.status(200);
|
|
72
70
|
return res.json(body);
|
|
73
71
|
} catch (e) {
|
|
74
72
|
return next(e);
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"modern",
|
|
12
12
|
"modern.js"
|
|
13
13
|
],
|
|
14
|
-
"version": "1.5.
|
|
14
|
+
"version": "1.5.5",
|
|
15
15
|
"jsnext:source": "./src/index.ts",
|
|
16
16
|
"types": "./dist/types/index.d.ts",
|
|
17
17
|
"main": "./dist/js/node/index.js",
|
|
@@ -36,18 +36,18 @@
|
|
|
36
36
|
"@babel/runtime": "^7.15.3",
|
|
37
37
|
"@modern-js/adapter-helpers": "^1.2.4",
|
|
38
38
|
"@modern-js/bff-runtime": "^1.2.3",
|
|
39
|
-
"@modern-js/bff-utils": "^1.2.
|
|
40
|
-
"@modern-js/types": "^1.5.
|
|
41
|
-
"@modern-js/utils": "^1.7.
|
|
39
|
+
"@modern-js/bff-utils": "^1.2.8",
|
|
40
|
+
"@modern-js/types": "^1.5.4",
|
|
41
|
+
"@modern-js/utils": "^1.7.6",
|
|
42
42
|
"cookie-parser": "^1.4.5",
|
|
43
43
|
"finalhandler": "^1.1.2",
|
|
44
44
|
"formidable": "^1.2.2",
|
|
45
45
|
"type-is": "^1.6.18"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
|
-
"@modern-js/core": "1.
|
|
48
|
+
"@modern-js/core": "1.11.1",
|
|
49
49
|
"@modern-js/server-core": "1.3.5",
|
|
50
|
-
"@modern-js/server-utils": "1.2.
|
|
50
|
+
"@modern-js/server-utils": "1.2.9",
|
|
51
51
|
"@scripts/build": "0.0.0",
|
|
52
52
|
"@scripts/jest-config": "0.0.0",
|
|
53
53
|
"@types/cookie-parser": "^1.4.2",
|
|
@@ -92,7 +92,8 @@
|
|
|
92
92
|
"files": [
|
|
93
93
|
"src/**/*",
|
|
94
94
|
"tsconfig.json",
|
|
95
|
-
"package.json"
|
|
95
|
+
"package.json",
|
|
96
|
+
"tests/**/*"
|
|
96
97
|
],
|
|
97
98
|
"output": []
|
|
98
99
|
}
|