@modern-js/plugin-express 2.16.0 → 2.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 +11 -0
- package/dist/cjs/cli/index.js +8 -22
- package/dist/esm/cli/index.js +8 -22
- package/dist/esm-node/cli/index.js +8 -22
- package/dist/types/runtime/operators.d.ts +1 -1
- package/package.json +13 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# @modern-js/plugin-express
|
|
2
2
|
|
|
3
|
+
## 2.17.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 3810930: fix: optimize alias for plugin-express & export useBlocker
|
|
8
|
+
fix: 优化 plugin-express 的 alias 的实现 & 导出 useBlocker
|
|
9
|
+
- @modern-js/bff-core@2.17.0
|
|
10
|
+
- @modern-js/bff-runtime@2.17.0
|
|
11
|
+
- @modern-js/types@2.17.0
|
|
12
|
+
- @modern-js/utils@2.17.0
|
|
13
|
+
|
|
3
14
|
## 2.16.0
|
|
4
15
|
|
|
5
16
|
### Patch Changes
|
package/dist/cjs/cli/index.js
CHANGED
|
@@ -8,7 +8,6 @@ Object.defineProperty(exports, "default", {
|
|
|
8
8
|
});
|
|
9
9
|
const _path = /* @__PURE__ */ _interop_require_wildcard(require("path"));
|
|
10
10
|
const _utils = require("@modern-js/utils");
|
|
11
|
-
const _bffcore = require("@modern-js/bff-core");
|
|
12
11
|
function _getRequireWildcardCache(nodeInterop) {
|
|
13
12
|
if (typeof WeakMap !== "function")
|
|
14
13
|
return null;
|
|
@@ -58,29 +57,16 @@ const _default = () => ({
|
|
|
58
57
|
return {
|
|
59
58
|
config() {
|
|
60
59
|
const appContext = useAppContext();
|
|
61
|
-
const { appDirectory } = appContext;
|
|
62
60
|
bffExportsUtils = (0, _utils.createRuntimeExportsUtils)(appContext.internalDirectory, "server");
|
|
63
|
-
const
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
"@modern-js/runtime/server": relativeRuntimePath,
|
|
70
|
-
"@modern-js/runtime/express": relativeRuntimePath
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
};
|
|
74
|
-
} else {
|
|
75
|
-
return {
|
|
76
|
-
source: {
|
|
77
|
-
alias: {
|
|
78
|
-
"@modern-js/runtime/server": serverRuntimePath,
|
|
79
|
-
"@modern-js/runtime/express": serverRuntimePath
|
|
80
|
-
}
|
|
61
|
+
const runtimePath = process.env.NODE_ENV === "development" ? require.resolve("@modern-js/plugin-express/runtime") : "@modern-js/plugin-express/runtime";
|
|
62
|
+
return {
|
|
63
|
+
source: {
|
|
64
|
+
alias: {
|
|
65
|
+
"@modern-js/runtime/server": runtimePath,
|
|
66
|
+
"@modern-js/runtime/express": runtimePath
|
|
81
67
|
}
|
|
82
|
-
}
|
|
83
|
-
}
|
|
68
|
+
}
|
|
69
|
+
};
|
|
84
70
|
},
|
|
85
71
|
collectServerPlugins({ plugins }) {
|
|
86
72
|
plugins.push({
|
package/dist/esm/cli/index.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import * as path from "path";
|
|
2
2
|
import { createRuntimeExportsUtils } from "@modern-js/utils";
|
|
3
|
-
import { getRelativeRuntimePath } from "@modern-js/bff-core";
|
|
4
3
|
export default function() {
|
|
5
4
|
return {
|
|
6
5
|
name: "@modern-js/plugin-express",
|
|
@@ -11,29 +10,16 @@ export default function() {
|
|
|
11
10
|
return {
|
|
12
11
|
config: function config() {
|
|
13
12
|
var appContext = useAppContext();
|
|
14
|
-
var appDirectory = appContext.appDirectory;
|
|
15
13
|
bffExportsUtils = createRuntimeExportsUtils(appContext.internalDirectory, "server");
|
|
16
|
-
var
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
"@modern-js/runtime/server": relativeRuntimePath,
|
|
23
|
-
"@modern-js/runtime/express": relativeRuntimePath
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
|
-
} else {
|
|
28
|
-
return {
|
|
29
|
-
source: {
|
|
30
|
-
alias: {
|
|
31
|
-
"@modern-js/runtime/server": serverRuntimePath,
|
|
32
|
-
"@modern-js/runtime/express": serverRuntimePath
|
|
33
|
-
}
|
|
14
|
+
var runtimePath = process.env.NODE_ENV === "development" ? require.resolve("@modern-js/plugin-express/runtime") : "@modern-js/plugin-express/runtime";
|
|
15
|
+
return {
|
|
16
|
+
source: {
|
|
17
|
+
alias: {
|
|
18
|
+
"@modern-js/runtime/server": runtimePath,
|
|
19
|
+
"@modern-js/runtime/express": runtimePath
|
|
34
20
|
}
|
|
35
|
-
}
|
|
36
|
-
}
|
|
21
|
+
}
|
|
22
|
+
};
|
|
37
23
|
},
|
|
38
24
|
collectServerPlugins: function collectServerPlugins(param) {
|
|
39
25
|
var plugins = param.plugins;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import * as path from "path";
|
|
2
2
|
import { createRuntimeExportsUtils } from "@modern-js/utils";
|
|
3
|
-
import { getRelativeRuntimePath } from "@modern-js/bff-core";
|
|
4
3
|
export default () => ({
|
|
5
4
|
name: "@modern-js/plugin-express",
|
|
6
5
|
setup: (api) => {
|
|
@@ -10,29 +9,16 @@ export default () => ({
|
|
|
10
9
|
return {
|
|
11
10
|
config() {
|
|
12
11
|
const appContext = useAppContext();
|
|
13
|
-
const { appDirectory } = appContext;
|
|
14
12
|
bffExportsUtils = createRuntimeExportsUtils(appContext.internalDirectory, "server");
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
"@modern-js/runtime/server": relativeRuntimePath,
|
|
22
|
-
"@modern-js/runtime/express": relativeRuntimePath
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
} else {
|
|
27
|
-
return {
|
|
28
|
-
source: {
|
|
29
|
-
alias: {
|
|
30
|
-
"@modern-js/runtime/server": serverRuntimePath,
|
|
31
|
-
"@modern-js/runtime/express": serverRuntimePath
|
|
32
|
-
}
|
|
13
|
+
const runtimePath = process.env.NODE_ENV === "development" ? require.resolve("@modern-js/plugin-express/runtime") : "@modern-js/plugin-express/runtime";
|
|
14
|
+
return {
|
|
15
|
+
source: {
|
|
16
|
+
alias: {
|
|
17
|
+
"@modern-js/runtime/server": runtimePath,
|
|
18
|
+
"@modern-js/runtime/express": runtimePath
|
|
33
19
|
}
|
|
34
|
-
}
|
|
35
|
-
}
|
|
20
|
+
}
|
|
21
|
+
};
|
|
36
22
|
},
|
|
37
23
|
collectServerPlugins({ plugins }) {
|
|
38
24
|
plugins.push({
|
|
@@ -6,6 +6,6 @@ type MaybeAsync<T> = T | Promise<T>;
|
|
|
6
6
|
type PipeFunction<T> = (value: T, end: EndFunction) => MaybeAsync<void> | MaybeAsync<T>;
|
|
7
7
|
export declare const Pipe: <T>(func: PipeFunction<T>) => Operator;
|
|
8
8
|
export type Pipe = typeof Pipe;
|
|
9
|
-
export declare const Middleware: (middleware: (req: Request, res: Response, next: NextFunction) => void) => Operator
|
|
9
|
+
export declare const Middleware: (middleware: (req: Request, res: Response, next: NextFunction) => void) => Operator<void>;
|
|
10
10
|
export type Middleware = typeof Middleware;
|
|
11
11
|
export {};
|
package/package.json
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"modern",
|
|
16
16
|
"modern.js"
|
|
17
17
|
],
|
|
18
|
-
"version": "2.
|
|
18
|
+
"version": "2.17.0",
|
|
19
19
|
"jsnext:source": "./src/index.ts",
|
|
20
20
|
"types": "./dist/types/cli/index.d.ts",
|
|
21
21
|
"main": "./dist/cjs/cli/index.js",
|
|
@@ -37,6 +37,9 @@
|
|
|
37
37
|
"require": "./dist/cjs/index.js"
|
|
38
38
|
},
|
|
39
39
|
"default": "./dist/esm/index.js"
|
|
40
|
+
},
|
|
41
|
+
"./runtime": {
|
|
42
|
+
"default": "./dist/cjs/runtime/index.js"
|
|
40
43
|
}
|
|
41
44
|
},
|
|
42
45
|
"dependencies": {
|
|
@@ -46,10 +49,10 @@
|
|
|
46
49
|
"formidable": "^1.2.2",
|
|
47
50
|
"reflect-metadata": "^0.1.13",
|
|
48
51
|
"type-is": "^1.6.18",
|
|
49
|
-
"@modern-js/bff-core": "2.
|
|
50
|
-
"@modern-js/bff-runtime": "2.
|
|
51
|
-
"@modern-js/types": "2.
|
|
52
|
-
"@modern-js/utils": "2.
|
|
52
|
+
"@modern-js/bff-core": "2.17.0",
|
|
53
|
+
"@modern-js/bff-runtime": "2.17.0",
|
|
54
|
+
"@modern-js/types": "2.17.0",
|
|
55
|
+
"@modern-js/utils": "2.17.0"
|
|
53
56
|
},
|
|
54
57
|
"devDependencies": {
|
|
55
58
|
"@types/cookie-parser": "^1.4.2",
|
|
@@ -65,11 +68,11 @@
|
|
|
65
68
|
"supertest": "^6.1.6",
|
|
66
69
|
"typescript": "^4",
|
|
67
70
|
"zod": "^3.17.3",
|
|
68
|
-
"@modern-js/core": "2.
|
|
69
|
-
"@modern-js/app-tools": "2.
|
|
70
|
-
"@modern-js/server-core": "2.
|
|
71
|
-
"@scripts/build": "2.
|
|
72
|
-
"@scripts/jest-config": "2.
|
|
71
|
+
"@modern-js/core": "2.17.0",
|
|
72
|
+
"@modern-js/app-tools": "2.17.0",
|
|
73
|
+
"@modern-js/server-core": "2.17.0",
|
|
74
|
+
"@scripts/build": "2.17.0",
|
|
75
|
+
"@scripts/jest-config": "2.17.0"
|
|
73
76
|
},
|
|
74
77
|
"peerDependencies": {
|
|
75
78
|
"express": "^4.17.1"
|