@modern-js/plugin-bff 1.1.2-beta.0 → 1.1.3-beta.1
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/.runtime-exports/index.d.ts +0 -0
- package/.runtime-exports/index.js +1 -0
- package/CHANGELOG.md +24 -0
- package/dist/js/modern/server.js +2 -1
- package/dist/js/node/server.js +2 -1
- package/package.json +23 -25
- package/src/server.ts +11 -1
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '/Users/bytedance/Desktop/workspaces/modern.js/packages/cli/plugin-runtime'
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# @modern-js/plugin-bff
|
|
2
2
|
|
|
3
|
+
## 1.1.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 085a6a58: refactor server plugin
|
|
8
|
+
- 39e8137d: fix: support prefix array & webpack loader should read requestCreator & adjust runtime path to relative
|
|
9
|
+
- 085a6a58: refactor server plugin
|
|
10
|
+
- 085a6a58: refactor server conifg
|
|
11
|
+
- 085a6a58: support server runtime
|
|
12
|
+
- 085a6a58: feat: refactor server plugin
|
|
13
|
+
- Updated dependencies [085a6a58]
|
|
14
|
+
- Updated dependencies [085a6a58]
|
|
15
|
+
- Updated dependencies [085a6a58]
|
|
16
|
+
- Updated dependencies [d280ea33]
|
|
17
|
+
- Updated dependencies [d4fcc73a]
|
|
18
|
+
- Updated dependencies [085a6a58]
|
|
19
|
+
- Updated dependencies [ed1f6b12]
|
|
20
|
+
- Updated dependencies [a5ebbb00]
|
|
21
|
+
- Updated dependencies [085a6a58]
|
|
22
|
+
- @modern-js/core@1.1.3
|
|
23
|
+
- @modern-js/server-plugin@1.1.2
|
|
24
|
+
- @modern-js/server-utils@1.1.2
|
|
25
|
+
- @modern-js/utils@1.1.3
|
|
26
|
+
|
|
3
27
|
## 1.1.1
|
|
4
28
|
|
|
5
29
|
### Patch Changes
|
package/dist/js/modern/server.js
CHANGED
|
@@ -31,11 +31,12 @@ export default createPlugin(() => {
|
|
|
31
31
|
const root = isProd() ? distDirectory : appDirectory;
|
|
32
32
|
const apiPath = path.resolve(root || process.cwd(), API_DIR);
|
|
33
33
|
const apiAppPath = path.resolve(apiPath, API_APP_NAME);
|
|
34
|
+
console.log('111111111111111', process.env.NODE_ENV, isProd(), appDirectory, distDirectory, apiPath, apiAppPath);
|
|
34
35
|
const storage = new Storage();
|
|
35
36
|
const transformAPI = createTransformAPI(storage);
|
|
36
37
|
const apiMod = requireExistModule(apiAppPath);
|
|
37
38
|
|
|
38
|
-
if (apiMod) {
|
|
39
|
+
if (apiMod && typeof apiMod === 'function') {
|
|
39
40
|
apiMod(transformAPI);
|
|
40
41
|
}
|
|
41
42
|
|
package/dist/js/node/server.js
CHANGED
|
@@ -48,11 +48,12 @@ var _default = (0, _serverPlugin.createPlugin)(() => {
|
|
|
48
48
|
|
|
49
49
|
const apiAppPath = _path.default.resolve(apiPath, _constants.API_APP_NAME);
|
|
50
50
|
|
|
51
|
+
console.log('111111111111111', process.env.NODE_ENV, (0, _utils.isProd)(), appDirectory, distDirectory, apiPath, apiAppPath);
|
|
51
52
|
const storage = new Storage();
|
|
52
53
|
const transformAPI = createTransformAPI(storage);
|
|
53
54
|
const apiMod = (0, _utils.requireExistModule)(apiAppPath);
|
|
54
55
|
|
|
55
|
-
if (apiMod) {
|
|
56
|
+
if (apiMod && typeof apiMod === 'function') {
|
|
56
57
|
apiMod(transformAPI);
|
|
57
58
|
}
|
|
58
59
|
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"modern",
|
|
12
12
|
"modern.js"
|
|
13
13
|
],
|
|
14
|
-
"version": "1.1.
|
|
14
|
+
"version": "1.1.3-beta.1",
|
|
15
15
|
"jsnext:source": "./src/index.ts",
|
|
16
16
|
"types": "./dist/types/index.d.ts",
|
|
17
17
|
"main": "./dist/js/node/index.js",
|
|
@@ -41,35 +41,27 @@
|
|
|
41
41
|
]
|
|
42
42
|
}
|
|
43
43
|
},
|
|
44
|
-
"scripts": {
|
|
45
|
-
"prepare": "pnpm build",
|
|
46
|
-
"prepublishOnly": "pnpm build -- --platform",
|
|
47
|
-
"new": "modern new",
|
|
48
|
-
"build": "modern build",
|
|
49
|
-
"dev": "modern build --watch",
|
|
50
|
-
"test": "modern test"
|
|
51
|
-
},
|
|
52
44
|
"dependencies": {
|
|
53
45
|
"@babel/core": "^7.15.5",
|
|
54
46
|
"@babel/runtime": "^7",
|
|
55
|
-
"@modern-js/babel-chain": "
|
|
56
|
-
"@modern-js/babel-compiler": "
|
|
57
|
-
"@modern-js/babel-preset-lib": "
|
|
58
|
-
"@modern-js/create-request": "
|
|
59
|
-
"@modern-js/server-utils": "
|
|
60
|
-
"@modern-js/utils": "
|
|
47
|
+
"@modern-js/babel-chain": "^1.1.1",
|
|
48
|
+
"@modern-js/babel-compiler": "^1.1.2",
|
|
49
|
+
"@modern-js/babel-preset-lib": "^1.1.1",
|
|
50
|
+
"@modern-js/create-request": "^1.1.1",
|
|
51
|
+
"@modern-js/server-utils": "^1.1.2",
|
|
52
|
+
"@modern-js/utils": "^1.1.3",
|
|
61
53
|
"fs-extra": "^10.0.0",
|
|
62
54
|
"loader-utils": "^2.0.0"
|
|
63
55
|
},
|
|
64
56
|
"devDependencies": {
|
|
65
|
-
"@modern-js/bff-utils": "
|
|
66
|
-
"@modern-js/core": "
|
|
57
|
+
"@modern-js/bff-utils": "^1.1.1",
|
|
58
|
+
"@modern-js/core": "^1.1.3",
|
|
67
59
|
"@modern-js/module-tools": "^1.1.1",
|
|
68
|
-
"@modern-js/plugin-analyze": "
|
|
60
|
+
"@modern-js/plugin-analyze": "^1.1.1",
|
|
69
61
|
"@modern-js/plugin-testing": "^1.1.1",
|
|
70
|
-
"@modern-js/runtime": "
|
|
71
|
-
"@modern-js/server-plugin": "
|
|
72
|
-
"@modern-js/types": "
|
|
62
|
+
"@modern-js/runtime": "^1.1.1",
|
|
63
|
+
"@modern-js/server-plugin": "^1.1.2",
|
|
64
|
+
"@modern-js/types": "^1.1.2",
|
|
73
65
|
"@types/babel__core": "^7.1.15",
|
|
74
66
|
"@types/fs-extra": "^9.0.13",
|
|
75
67
|
"@types/jest": "^26",
|
|
@@ -82,9 +74,9 @@
|
|
|
82
74
|
"webpack-chain": "^6.5.1"
|
|
83
75
|
},
|
|
84
76
|
"peerDependencies": {
|
|
85
|
-
"@modern-js/bff-utils": "
|
|
86
|
-
"@modern-js/core": "
|
|
87
|
-
"@modern-js/server-plugin": "
|
|
77
|
+
"@modern-js/bff-utils": "^1.1.1",
|
|
78
|
+
"@modern-js/core": "^1.1.3",
|
|
79
|
+
"@modern-js/server-plugin": "^1.1.2"
|
|
88
80
|
},
|
|
89
81
|
"modernConfig": {
|
|
90
82
|
"output": {
|
|
@@ -95,5 +87,11 @@
|
|
|
95
87
|
"publishConfig": {
|
|
96
88
|
"registry": "https://registry.npmjs.org/",
|
|
97
89
|
"access": "public"
|
|
90
|
+
},
|
|
91
|
+
"scripts": {
|
|
92
|
+
"new": "modern new",
|
|
93
|
+
"build": "modern build",
|
|
94
|
+
"dev": "modern build --watch",
|
|
95
|
+
"test": "modern test"
|
|
98
96
|
}
|
|
99
|
-
}
|
|
97
|
+
}
|
package/src/server.ts
CHANGED
|
@@ -29,11 +29,21 @@ export default createPlugin(
|
|
|
29
29
|
const apiPath = path.resolve(root || process.cwd(), API_DIR);
|
|
30
30
|
const apiAppPath = path.resolve(apiPath, API_APP_NAME);
|
|
31
31
|
|
|
32
|
+
console.log(
|
|
33
|
+
'111111111111111',
|
|
34
|
+
process.env.NODE_ENV,
|
|
35
|
+
isProd(),
|
|
36
|
+
appDirectory,
|
|
37
|
+
distDirectory,
|
|
38
|
+
apiPath,
|
|
39
|
+
apiAppPath,
|
|
40
|
+
);
|
|
41
|
+
|
|
32
42
|
const storage = new Storage();
|
|
33
43
|
const transformAPI = createTransformAPI(storage);
|
|
34
44
|
|
|
35
45
|
const apiMod = requireExistModule(apiAppPath);
|
|
36
|
-
if (apiMod) {
|
|
46
|
+
if (apiMod && typeof apiMod === 'function') {
|
|
37
47
|
apiMod(transformAPI);
|
|
38
48
|
}
|
|
39
49
|
|