@modern-js/plugin-koa 2.67.2 → 2.67.3
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/index.js +10 -5
- package/dist/esm/cli/index.js +11 -5
- package/dist/esm-node/cli/index.js +10 -5
- package/package.json +9 -9
package/dist/cjs/cli/index.js
CHANGED
|
@@ -40,14 +40,19 @@ const koaPlugin = () => ({
|
|
|
40
40
|
let bffExportsUtils;
|
|
41
41
|
const { useAppContext } = api;
|
|
42
42
|
const runtimeModulePath = path.resolve(__dirname, "../runtime");
|
|
43
|
+
const useConfig = api.useConfigContext();
|
|
44
|
+
const appContext = api.useAppContext();
|
|
45
|
+
api.setAppContext({
|
|
46
|
+
...appContext,
|
|
47
|
+
bffRuntimeFramework: "koa"
|
|
48
|
+
});
|
|
43
49
|
return {
|
|
44
50
|
config() {
|
|
45
|
-
var
|
|
46
|
-
const
|
|
47
|
-
bffExportsUtils = (0, import_utils.createRuntimeExportsUtils)(
|
|
48
|
-
const modernConfig = api.useResolvedConfigContext();
|
|
51
|
+
var _useConfig_bff;
|
|
52
|
+
const appContext2 = useAppContext();
|
|
53
|
+
bffExportsUtils = (0, import_utils.createRuntimeExportsUtils)(appContext2.internalDirectory, "server");
|
|
49
54
|
const runtimePath = "@modern-js/plugin-koa/runtime";
|
|
50
|
-
const alias = process.env.NODE_ENV === "production" || !!(
|
|
55
|
+
const alias = process.env.NODE_ENV === "production" || !!(useConfig === null || useConfig === void 0 ? void 0 : (_useConfig_bff = useConfig.bff) === null || _useConfig_bff === void 0 ? void 0 : _useConfig_bff.crossProject) ? runtimePath : require.resolve(runtimePath);
|
|
51
56
|
return {
|
|
52
57
|
output: {
|
|
53
58
|
externals: {
|
package/dist/esm/cli/index.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { _ as _object_spread } from "@swc/helpers/_/_object_spread";
|
|
2
|
+
import { _ as _object_spread_props } from "@swc/helpers/_/_object_spread_props";
|
|
1
3
|
import * as path from "path";
|
|
2
4
|
import { createRuntimeExportsUtils } from "@modern-js/utils";
|
|
3
5
|
var koaPlugin = function() {
|
|
@@ -7,14 +9,18 @@ var koaPlugin = function() {
|
|
|
7
9
|
var bffExportsUtils;
|
|
8
10
|
var useAppContext = api.useAppContext;
|
|
9
11
|
var runtimeModulePath = path.resolve(__dirname, "../runtime");
|
|
12
|
+
var useConfig = api.useConfigContext();
|
|
13
|
+
var appContext = api.useAppContext();
|
|
14
|
+
api.setAppContext(_object_spread_props(_object_spread({}, appContext), {
|
|
15
|
+
bffRuntimeFramework: "koa"
|
|
16
|
+
}));
|
|
10
17
|
return {
|
|
11
18
|
config: function config() {
|
|
12
|
-
var
|
|
13
|
-
var
|
|
14
|
-
bffExportsUtils = createRuntimeExportsUtils(
|
|
15
|
-
var modernConfig = api.useResolvedConfigContext();
|
|
19
|
+
var _useConfig_bff;
|
|
20
|
+
var appContext2 = useAppContext();
|
|
21
|
+
bffExportsUtils = createRuntimeExportsUtils(appContext2.internalDirectory, "server");
|
|
16
22
|
var runtimePath = "@modern-js/plugin-koa/runtime";
|
|
17
|
-
var alias = process.env.NODE_ENV === "production" || !!(
|
|
23
|
+
var alias = process.env.NODE_ENV === "production" || !!(useConfig === null || useConfig === void 0 ? void 0 : (_useConfig_bff = useConfig.bff) === null || _useConfig_bff === void 0 ? void 0 : _useConfig_bff.crossProject) ? runtimePath : require.resolve(runtimePath);
|
|
18
24
|
return {
|
|
19
25
|
output: {
|
|
20
26
|
externals: {
|
|
@@ -6,14 +6,19 @@ const koaPlugin = () => ({
|
|
|
6
6
|
let bffExportsUtils;
|
|
7
7
|
const { useAppContext } = api;
|
|
8
8
|
const runtimeModulePath = path.resolve(__dirname, "../runtime");
|
|
9
|
+
const useConfig = api.useConfigContext();
|
|
10
|
+
const appContext = api.useAppContext();
|
|
11
|
+
api.setAppContext({
|
|
12
|
+
...appContext,
|
|
13
|
+
bffRuntimeFramework: "koa"
|
|
14
|
+
});
|
|
9
15
|
return {
|
|
10
16
|
config() {
|
|
11
|
-
var
|
|
12
|
-
const
|
|
13
|
-
bffExportsUtils = createRuntimeExportsUtils(
|
|
14
|
-
const modernConfig = api.useResolvedConfigContext();
|
|
17
|
+
var _useConfig_bff;
|
|
18
|
+
const appContext2 = useAppContext();
|
|
19
|
+
bffExportsUtils = createRuntimeExportsUtils(appContext2.internalDirectory, "server");
|
|
15
20
|
const runtimePath = "@modern-js/plugin-koa/runtime";
|
|
16
|
-
const alias = process.env.NODE_ENV === "production" || !!(
|
|
21
|
+
const alias = process.env.NODE_ENV === "production" || !!(useConfig === null || useConfig === void 0 ? void 0 : (_useConfig_bff = useConfig.bff) === null || _useConfig_bff === void 0 ? void 0 : _useConfig_bff.crossProject) ? runtimePath : require.resolve(runtimePath);
|
|
17
22
|
return {
|
|
18
23
|
output: {
|
|
19
24
|
externals: {
|
package/package.json
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"modern",
|
|
16
16
|
"modern.js"
|
|
17
17
|
],
|
|
18
|
-
"version": "2.67.
|
|
18
|
+
"version": "2.67.3",
|
|
19
19
|
"jsnext:source": "./src/index.ts",
|
|
20
20
|
"types": "./dist/types/cli/index.d.ts",
|
|
21
21
|
"main": "./dist/cjs/cli/index.js",
|
|
@@ -68,11 +68,11 @@
|
|
|
68
68
|
"koa-body": "^4.2.0",
|
|
69
69
|
"koa-router": "^10.0.0",
|
|
70
70
|
"type-is": "^1.6.18",
|
|
71
|
-
"@modern-js/bff-core": "2.67.
|
|
72
|
-
"@modern-js/
|
|
73
|
-
"@modern-js/
|
|
74
|
-
"@modern-js/types": "2.67.
|
|
75
|
-
"@modern-js/utils": "2.67.
|
|
71
|
+
"@modern-js/bff-core": "2.67.3",
|
|
72
|
+
"@modern-js/server-core": "2.67.3",
|
|
73
|
+
"@modern-js/bff-runtime": "2.67.3",
|
|
74
|
+
"@modern-js/types": "2.67.3",
|
|
75
|
+
"@modern-js/utils": "2.67.3"
|
|
76
76
|
},
|
|
77
77
|
"devDependencies": {
|
|
78
78
|
"@types/jest": "^29",
|
|
@@ -86,9 +86,9 @@
|
|
|
86
86
|
"supertest": "^6.1.6",
|
|
87
87
|
"typescript": "^5",
|
|
88
88
|
"zod": "^3.22.3",
|
|
89
|
-
"@modern-js/plugin-v2": "2.67.
|
|
90
|
-
"@modern-js/app-tools": "2.67.
|
|
91
|
-
"@modern-js/core": "2.67.
|
|
89
|
+
"@modern-js/plugin-v2": "2.67.3",
|
|
90
|
+
"@modern-js/app-tools": "2.67.3",
|
|
91
|
+
"@modern-js/core": "2.67.3",
|
|
92
92
|
"@scripts/build": "2.66.0",
|
|
93
93
|
"@scripts/jest-config": "2.66.0"
|
|
94
94
|
},
|