@modern-js/plugin-server 0.0.0-next-20221017080123 → 0.0.0-next-20221020075751

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,16 +1,20 @@
1
1
  # @modern-js/plugin-server
2
2
 
3
- ## 0.0.0-next-20221017080123
3
+ ## 0.0.0-next-20221020075751
4
4
 
5
5
  ### Patch Changes
6
6
 
7
- - 3bbea92b: feat: support Hook、Middleware new API
7
+ - 3bbea92b2: feat: support Hook、Middleware new API
8
8
  feat: 支持 Hook、Middleware 的新 API
9
- - Updated dependencies [b8bbe036]
10
- - Updated dependencies [3bbea92b]
11
- - @modern-js/utils@0.0.0-next-20221017080123
12
- - @modern-js/server-utils@0.0.0-next-20221017080123
13
- - @modern-js/babel-compiler@0.0.0-next-20221017080123
9
+ - e84c4e4d5: fix: modify the parameters passed to the compile function of server-utils
10
+ fix: 修改传入 server-utils 的 compile 函数的参数
11
+ - Updated dependencies [9b915e0c1]
12
+ - Updated dependencies [9650b93b2]
13
+ - Updated dependencies [b8bbe036c]
14
+ - Updated dependencies [3bbea92b2]
15
+ - @modern-js/server-utils@0.0.0-next-20221020075751
16
+ - @modern-js/utils@0.0.0-next-20221020075751
17
+ - @modern-js/babel-compiler@0.0.0-next-20221020075751
14
18
 
15
19
  ## 1.20.1
16
20
 
@@ -30,8 +30,26 @@ export default (() => ({
30
30
  sourceDirs.push(sharedDir);
31
31
  }
32
32
 
33
+ const {
34
+ server
35
+ } = modernConfig;
36
+ const {
37
+ alias,
38
+ envVars,
39
+ globalVars
40
+ } = modernConfig.source;
41
+ const {
42
+ babel
43
+ } = modernConfig.tools;
44
+
33
45
  if (sourceDirs.length > 0) {
34
- await compile(appDirectory, modernConfig, {
46
+ await compile(appDirectory, {
47
+ server,
48
+ alias,
49
+ envVars,
50
+ globalVars,
51
+ babelConfig: babel
52
+ }, {
35
53
  sourceDirs,
36
54
  distDir,
37
55
  tsconfigPath
@@ -49,8 +49,26 @@ var _default = () => ({
49
49
  sourceDirs.push(sharedDir);
50
50
  }
51
51
 
52
+ const {
53
+ server
54
+ } = modernConfig;
55
+ const {
56
+ alias,
57
+ envVars,
58
+ globalVars
59
+ } = modernConfig.source;
60
+ const {
61
+ babel
62
+ } = modernConfig.tools;
63
+
52
64
  if (sourceDirs.length > 0) {
53
- await (0, _serverUtils.compile)(appDirectory, modernConfig, {
65
+ await (0, _serverUtils.compile)(appDirectory, {
66
+ server,
67
+ alias,
68
+ envVars,
69
+ globalVars,
70
+ babelConfig: babel
71
+ }, {
54
72
  sourceDirs,
55
73
  distDir,
56
74
  tsconfigPath
@@ -15,7 +15,7 @@ export default (function () {
15
15
  },
16
16
  afterBuild: function afterBuild() {
17
17
  return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
18
- var _api$useAppContext, appDirectory, distDirectory, modernConfig, distDir, serverDir, sharedDir, tsconfigPath, sourceDirs;
18
+ var _api$useAppContext, appDirectory, distDirectory, modernConfig, distDir, serverDir, sharedDir, tsconfigPath, sourceDirs, server, _modernConfig$source, alias, envVars, globalVars, babel;
19
19
 
20
20
  return _regeneratorRuntime().wrap(function _callee$(_context) {
21
21
  while (1) {
@@ -37,19 +37,29 @@ export default (function () {
37
37
  sourceDirs.push(sharedDir);
38
38
  }
39
39
 
40
+ server = modernConfig.server;
41
+ _modernConfig$source = modernConfig.source, alias = _modernConfig$source.alias, envVars = _modernConfig$source.envVars, globalVars = _modernConfig$source.globalVars;
42
+ babel = modernConfig.tools.babel;
43
+
40
44
  if (!(sourceDirs.length > 0)) {
41
- _context.next = 12;
45
+ _context.next = 15;
42
46
  break;
43
47
  }
44
48
 
45
- _context.next = 12;
46
- return compile(appDirectory, modernConfig, {
49
+ _context.next = 15;
50
+ return compile(appDirectory, {
51
+ server: server,
52
+ alias: alias,
53
+ envVars: envVars,
54
+ globalVars: globalVars,
55
+ babelConfig: babel
56
+ }, {
47
57
  sourceDirs: sourceDirs,
48
58
  distDir: distDir,
49
59
  tsconfigPath: tsconfigPath
50
60
  });
51
61
 
52
- case 12:
62
+ case 15:
53
63
  case "end":
54
64
  return _context.stop();
55
65
  }
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "modern",
12
12
  "modern.js"
13
13
  ],
14
- "version": "0.0.0-next-20221017080123",
14
+ "version": "0.0.0-next-20221020075751",
15
15
  "types": "./dist/types/server.d.ts",
16
16
  "jsnext:source": "./src/server.ts",
17
17
  "main": "./dist/js/node/server.js",
@@ -48,20 +48,20 @@
48
48
  },
49
49
  "dependencies": {
50
50
  "@babel/runtime": "^7.18.0",
51
- "@modern-js/babel-compiler": "0.0.0-next-20221017080123",
52
- "@modern-js/server-utils": "0.0.0-next-20221017080123",
53
- "@modern-js/utils": "0.0.0-next-20221017080123"
51
+ "@modern-js/babel-compiler": "0.0.0-next-20221020075751",
52
+ "@modern-js/server-utils": "0.0.0-next-20221020075751",
53
+ "@modern-js/utils": "0.0.0-next-20221020075751"
54
54
  },
55
55
  "devDependencies": {
56
- "@modern-js/server-core": "0.0.0-next-20221017080123",
57
- "@modern-js/core": "0.0.0-next-20221017080123",
58
- "@scripts/build": "0.0.0-next-20221017080123",
59
- "@modern-js/types": "0.0.0-next-20221017080123",
56
+ "@modern-js/server-core": "0.0.0-next-20221020075751",
57
+ "@modern-js/core": "0.0.0-next-20221020075751",
58
+ "@scripts/build": "0.0.0-next-20221020075751",
59
+ "@modern-js/types": "0.0.0-next-20221020075751",
60
60
  "typescript": "^4",
61
61
  "@types/jest": "^27",
62
62
  "@types/node": "^14",
63
63
  "jest": "^27",
64
- "@scripts/jest-config": "0.0.0-next-20221017080123"
64
+ "@scripts/jest-config": "0.0.0-next-20221020075751"
65
65
  },
66
66
  "sideEffects": [
67
67
  "*.css",