@modern-js/plugin-express 1.7.3-beta.0 → 1.17.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/CHANGELOG.md +63 -0
- package/dist/js/modern/cli/index.js +2 -14
- package/dist/js/modern/context.js +1 -1
- package/dist/js/modern/runtime/hook.js +1 -0
- package/dist/js/modern/runtime/index.js +1 -0
- package/dist/js/node/cli/index.js +3 -15
- package/dist/js/node/context.js +2 -2
- package/dist/js/node/runtime/hook.js +10 -0
- package/dist/js/node/runtime/index.js +10 -1
- package/dist/types/runtime/hook.d.ts +2 -0
- package/dist/types/runtime/index.d.ts +1 -0
- package/package.json +10 -12
- package/types.d.ts +0 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,68 @@
|
|
|
1
1
|
# @modern-js/plugin-express
|
|
2
2
|
|
|
3
|
+
## 1.17.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [1b9176f]
|
|
8
|
+
- Updated dependencies [77d3a38]
|
|
9
|
+
- Updated dependencies [151329d]
|
|
10
|
+
- Updated dependencies [5af9472]
|
|
11
|
+
- Updated dependencies [6b6a534]
|
|
12
|
+
- Updated dependencies [6b43a2b]
|
|
13
|
+
- Updated dependencies [a7be124]
|
|
14
|
+
- Updated dependencies [31547b4]
|
|
15
|
+
- @modern-js/utils@1.17.0
|
|
16
|
+
- @modern-js/bff-core@1.17.0
|
|
17
|
+
- @modern-js/bff-runtime@1.17.0
|
|
18
|
+
- @modern-js/types@1.17.0
|
|
19
|
+
|
|
20
|
+
## 1.16.0
|
|
21
|
+
|
|
22
|
+
### Minor Changes
|
|
23
|
+
|
|
24
|
+
- 1100dd58c: chore: support react 18
|
|
25
|
+
|
|
26
|
+
chore: 支持 React 18
|
|
27
|
+
|
|
28
|
+
### Patch Changes
|
|
29
|
+
|
|
30
|
+
- Updated dependencies [641592f52]
|
|
31
|
+
- Updated dependencies [3904b30a5]
|
|
32
|
+
- Updated dependencies [1100dd58c]
|
|
33
|
+
- Updated dependencies [e04e6e76a]
|
|
34
|
+
- Updated dependencies [81c66e4a4]
|
|
35
|
+
- Updated dependencies [2c305b6f5]
|
|
36
|
+
- Updated dependencies [020b9bd52]
|
|
37
|
+
- @modern-js/utils@1.16.0
|
|
38
|
+
- @modern-js/bff-runtime@1.16.0
|
|
39
|
+
- @modern-js/types@1.16.0
|
|
40
|
+
- @modern-js/bff-core@1.16.0
|
|
41
|
+
|
|
42
|
+
## 1.15.0
|
|
43
|
+
|
|
44
|
+
### Minor Changes
|
|
45
|
+
|
|
46
|
+
- 1f8b492: feat: support afterLambdaRegisted hook
|
|
47
|
+
|
|
48
|
+
### Patch Changes
|
|
49
|
+
|
|
50
|
+
- c0d8dac: fix: remove package adapter-helpers and bff runtime export
|
|
51
|
+
- 4524de6: fix: add server hook and types
|
|
52
|
+
fix: 增加 server hook API
|
|
53
|
+
- Updated dependencies [c0d8dac]
|
|
54
|
+
- Updated dependencies [8658a78]
|
|
55
|
+
- Updated dependencies [05d4a4f]
|
|
56
|
+
- Updated dependencies [7bfaaf9]
|
|
57
|
+
- Updated dependencies [b1f7000]
|
|
58
|
+
- Updated dependencies [ad05af9]
|
|
59
|
+
- Updated dependencies [5d53d1c]
|
|
60
|
+
- Updated dependencies [37cd159]
|
|
61
|
+
- @modern-js/bff-core@1.15.0
|
|
62
|
+
- @modern-js/utils@1.15.0
|
|
63
|
+
- @modern-js/types@1.15.0
|
|
64
|
+
- @modern-js/bff-runtime@1.15.0
|
|
65
|
+
|
|
3
66
|
## 1.7.2
|
|
4
67
|
|
|
5
68
|
### Patch Changes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as path from 'path';
|
|
2
2
|
import { createRuntimeExportsUtils } from '@modern-js/utils';
|
|
3
|
-
import { getRelativeRuntimePath } from '@modern-js/
|
|
3
|
+
import { getRelativeRuntimePath } from '@modern-js/bff-core';
|
|
4
4
|
export default (() => ({
|
|
5
5
|
name: '@modern-js/plugin-express',
|
|
6
6
|
setup: api => {
|
|
@@ -39,25 +39,13 @@ export default (() => ({
|
|
|
39
39
|
},
|
|
40
40
|
|
|
41
41
|
addRuntimeExports(input) {
|
|
42
|
-
const {
|
|
43
|
-
appDirectory
|
|
44
|
-
} = useAppContext();
|
|
45
|
-
|
|
46
|
-
const runtimePath = require.resolve(`@modern-js/runtime`, {
|
|
47
|
-
paths: [appDirectory]
|
|
48
|
-
});
|
|
49
|
-
|
|
50
42
|
const currentFile = bffExportsUtils.getPath();
|
|
51
|
-
const runtimeDir = path.dirname(runtimePath);
|
|
52
|
-
const relativeBffPath = path.relative(path.dirname(currentFile), path.join(runtimeDir, './exports/server'));
|
|
53
43
|
const relativeRuntimeModulePath = path.relative(path.dirname(currentFile), runtimeModulePath);
|
|
54
44
|
const relativeFramePath = path.relative(path.dirname(currentFile), require.resolve('express'));
|
|
55
|
-
bffExportsUtils.addExport(`const
|
|
56
|
-
const pluginRuntime = require('${relativeRuntimeModulePath}');
|
|
45
|
+
bffExportsUtils.addExport(`const pluginRuntime = require('${relativeRuntimeModulePath}');
|
|
57
46
|
const express = require('${relativeFramePath}')
|
|
58
47
|
module.exports = {
|
|
59
48
|
express: express,
|
|
60
|
-
...bffRuntime,
|
|
61
49
|
...pluginRuntime
|
|
62
50
|
}
|
|
63
51
|
`);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const hook = attacher => attacher;
|
|
@@ -9,7 +9,7 @@ var path = _interopRequireWildcard(require("path"));
|
|
|
9
9
|
|
|
10
10
|
var _utils = require("@modern-js/utils");
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _bffCore = require("@modern-js/bff-core");
|
|
13
13
|
|
|
14
14
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
15
15
|
|
|
@@ -31,7 +31,7 @@ var _default = () => ({
|
|
|
31
31
|
} = appContext;
|
|
32
32
|
bffExportsUtils = (0, _utils.createRuntimeExportsUtils)(appContext.internalDirectory, 'server');
|
|
33
33
|
const serverRuntimePath = bffExportsUtils.getPath();
|
|
34
|
-
const relativeRuntimePath = (0,
|
|
34
|
+
const relativeRuntimePath = (0, _bffCore.getRelativeRuntimePath)(appDirectory, serverRuntimePath);
|
|
35
35
|
|
|
36
36
|
if (process.env.NODE_ENV === 'production') {
|
|
37
37
|
return {
|
|
@@ -53,25 +53,13 @@ var _default = () => ({
|
|
|
53
53
|
},
|
|
54
54
|
|
|
55
55
|
addRuntimeExports(input) {
|
|
56
|
-
const {
|
|
57
|
-
appDirectory
|
|
58
|
-
} = useAppContext();
|
|
59
|
-
|
|
60
|
-
const runtimePath = require.resolve(`@modern-js/runtime`, {
|
|
61
|
-
paths: [appDirectory]
|
|
62
|
-
});
|
|
63
|
-
|
|
64
56
|
const currentFile = bffExportsUtils.getPath();
|
|
65
|
-
const runtimeDir = path.dirname(runtimePath);
|
|
66
|
-
const relativeBffPath = path.relative(path.dirname(currentFile), path.join(runtimeDir, './exports/server'));
|
|
67
57
|
const relativeRuntimeModulePath = path.relative(path.dirname(currentFile), runtimeModulePath);
|
|
68
58
|
const relativeFramePath = path.relative(path.dirname(currentFile), require.resolve('express'));
|
|
69
|
-
bffExportsUtils.addExport(`const
|
|
70
|
-
const pluginRuntime = require('${relativeRuntimeModulePath}');
|
|
59
|
+
bffExportsUtils.addExport(`const pluginRuntime = require('${relativeRuntimeModulePath}');
|
|
71
60
|
const express = require('${relativeFramePath}')
|
|
72
61
|
module.exports = {
|
|
73
62
|
express: express,
|
|
74
|
-
...bffRuntime,
|
|
75
63
|
...pluginRuntime
|
|
76
64
|
}
|
|
77
65
|
`);
|
package/dist/js/node/context.js
CHANGED
|
@@ -5,11 +5,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.useContext = exports.run = void 0;
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _bffCore = require("@modern-js/bff-core");
|
|
9
9
|
|
|
10
10
|
const {
|
|
11
11
|
run,
|
|
12
12
|
useContext
|
|
13
|
-
} = (0,
|
|
13
|
+
} = (0, _bffCore.createStorage)();
|
|
14
14
|
exports.useContext = useContext;
|
|
15
15
|
exports.run = run;
|
|
@@ -4,8 +4,15 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
var _exportNames = {
|
|
7
|
-
useContext: true
|
|
7
|
+
useContext: true,
|
|
8
|
+
hook: true
|
|
8
9
|
};
|
|
10
|
+
Object.defineProperty(exports, "hook", {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () {
|
|
13
|
+
return _hook.hook;
|
|
14
|
+
}
|
|
15
|
+
});
|
|
9
16
|
Object.defineProperty(exports, "useContext", {
|
|
10
17
|
enumerable: true,
|
|
11
18
|
get: function () {
|
|
@@ -29,6 +36,8 @@ Object.keys(_bffCore).forEach(function (key) {
|
|
|
29
36
|
|
|
30
37
|
var _context = require("../context");
|
|
31
38
|
|
|
39
|
+
var _hook = require("./hook");
|
|
40
|
+
|
|
32
41
|
var _operators = require("./operators");
|
|
33
42
|
|
|
34
43
|
Object.keys(_operators).forEach(function (key) {
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"modern",
|
|
12
12
|
"modern.js"
|
|
13
13
|
],
|
|
14
|
-
"version": "1.
|
|
14
|
+
"version": "1.17.0",
|
|
15
15
|
"jsnext:source": "./src/index.ts",
|
|
16
16
|
"types": "./dist/types/index.d.ts",
|
|
17
17
|
"main": "./dist/js/node/index.js",
|
|
@@ -34,11 +34,10 @@
|
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@babel/runtime": "^7.18.0",
|
|
37
|
-
"@modern-js/
|
|
38
|
-
"@modern-js/bff-
|
|
39
|
-
"@modern-js/
|
|
40
|
-
"@modern-js/
|
|
41
|
-
"@modern-js/utils": "^1.9.0",
|
|
37
|
+
"@modern-js/bff-core": "1.17.0",
|
|
38
|
+
"@modern-js/bff-runtime": "1.17.0",
|
|
39
|
+
"@modern-js/types": "1.17.0",
|
|
40
|
+
"@modern-js/utils": "1.17.0",
|
|
42
41
|
"cookie-parser": "^1.4.5",
|
|
43
42
|
"finalhandler": "^1.1.2",
|
|
44
43
|
"formidable": "^1.2.2",
|
|
@@ -46,10 +45,10 @@
|
|
|
46
45
|
"type-is": "^1.6.18"
|
|
47
46
|
},
|
|
48
47
|
"devDependencies": {
|
|
49
|
-
"@modern-js/core": "1.
|
|
50
|
-
"@modern-js/server-core": "1.
|
|
51
|
-
"@scripts/build": "
|
|
52
|
-
"@scripts/jest-config": "
|
|
48
|
+
"@modern-js/core": "1.17.0",
|
|
49
|
+
"@modern-js/server-core": "1.17.0",
|
|
50
|
+
"@scripts/build": "1.17.0",
|
|
51
|
+
"@scripts/jest-config": "1.17.0",
|
|
53
52
|
"@types/cookie-parser": "^1.4.2",
|
|
54
53
|
"@types/express": "^4.17.13",
|
|
55
54
|
"@types/finalhandler": "^1.1.1",
|
|
@@ -74,8 +73,7 @@
|
|
|
74
73
|
},
|
|
75
74
|
"publishConfig": {
|
|
76
75
|
"registry": "https://registry.npmjs.org/",
|
|
77
|
-
"access": "public"
|
|
78
|
-
"types": "./dist/types/index.d.ts"
|
|
76
|
+
"access": "public"
|
|
79
77
|
},
|
|
80
78
|
"wireit": {
|
|
81
79
|
"build": {
|