@modern-js/plugin-express 1.15.0 → 1.18.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 CHANGED
@@ -1,5 +1,61 @@
1
1
  # @modern-js/plugin-express
2
2
 
3
+ ## 1.18.0
4
+
5
+ ### Patch Changes
6
+
7
+ - 3d5e3a5: chore: get api mode from bff core
8
+ chore: 从 bff core 中获取 api mode
9
+ - 2b7406d: feat: use typescript instead of babel as typescript compiler in server
10
+ feat: 服务端,增加 typescript 作为 typescipt 编译器
11
+ - Updated dependencies [8280920]
12
+ - Updated dependencies [3d5e3a5]
13
+ - Updated dependencies [5227370]
14
+ - Updated dependencies [7928bae]
15
+ - @modern-js/utils@1.18.0
16
+ - @modern-js/bff-core@1.18.0
17
+ - @modern-js/bff-runtime@1.18.0
18
+ - @modern-js/types@1.18.0
19
+
20
+ ## 1.17.0
21
+
22
+ ### Patch Changes
23
+
24
+ - Updated dependencies [1b9176f]
25
+ - Updated dependencies [77d3a38]
26
+ - Updated dependencies [151329d]
27
+ - Updated dependencies [5af9472]
28
+ - Updated dependencies [6b6a534]
29
+ - Updated dependencies [6b43a2b]
30
+ - Updated dependencies [a7be124]
31
+ - Updated dependencies [31547b4]
32
+ - @modern-js/utils@1.17.0
33
+ - @modern-js/bff-core@1.17.0
34
+ - @modern-js/bff-runtime@1.17.0
35
+ - @modern-js/types@1.17.0
36
+
37
+ ## 1.16.0
38
+
39
+ ### Minor Changes
40
+
41
+ - 1100dd58c: chore: support react 18
42
+
43
+ chore: 支持 React 18
44
+
45
+ ### Patch Changes
46
+
47
+ - Updated dependencies [641592f52]
48
+ - Updated dependencies [3904b30a5]
49
+ - Updated dependencies [1100dd58c]
50
+ - Updated dependencies [e04e6e76a]
51
+ - Updated dependencies [81c66e4a4]
52
+ - Updated dependencies [2c305b6f5]
53
+ - Updated dependencies [020b9bd52]
54
+ - @modern-js/utils@1.16.0
55
+ - @modern-js/bff-runtime@1.16.0
56
+ - @modern-js/types@1.16.0
57
+ - @modern-js/bff-core@1.16.0
58
+
3
59
  ## 1.15.0
4
60
 
5
61
  ### Minor Changes
@@ -54,13 +54,13 @@ export default (() => ({
54
54
  setup: api => ({
55
55
  async prepareApiServer({
56
56
  pwd,
57
- mode,
58
57
  config
59
58
  }) {
60
59
  let app;
61
60
  const apiDir = path.join(pwd, './api');
62
61
  const appContext = api.useAppContext();
63
62
  const apiHandlerInfos = appContext.apiHandlerInfos;
63
+ const mode = appContext.apiMode;
64
64
 
65
65
  if (mode === 'framework') {
66
66
  const appModule = await findAppModule(apiDir);
@@ -83,12 +83,15 @@ export default (() => ({
83
83
 
84
84
  useRun(app);
85
85
  registerRoutes(app, apiHandlerInfos);
86
- const {
87
- afterLambdaRegisted
88
- } = hooks;
89
86
 
90
- if (afterLambdaRegisted) {
91
- afterLambdaRegisted(app);
87
+ if (hooks) {
88
+ const {
89
+ afterLambdaRegisted
90
+ } = hooks;
91
+
92
+ if (afterLambdaRegisted) {
93
+ afterLambdaRegisted(app);
94
+ }
92
95
  }
93
96
  } else if (mode === 'function') {
94
97
  app = express();
@@ -74,13 +74,13 @@ var _default = () => ({
74
74
  setup: api => ({
75
75
  async prepareApiServer({
76
76
  pwd,
77
- mode,
78
77
  config
79
78
  }) {
80
79
  let app;
81
80
  const apiDir = path.join(pwd, './api');
82
81
  const appContext = api.useAppContext();
83
82
  const apiHandlerInfos = appContext.apiHandlerInfos;
83
+ const mode = appContext.apiMode;
84
84
 
85
85
  if (mode === 'framework') {
86
86
  const appModule = await findAppModule(apiDir);
@@ -103,12 +103,15 @@ var _default = () => ({
103
103
 
104
104
  useRun(app);
105
105
  (0, _registerRoutes.default)(app, apiHandlerInfos);
106
- const {
107
- afterLambdaRegisted
108
- } = hooks;
109
106
 
110
- if (afterLambdaRegisted) {
111
- afterLambdaRegisted(app);
107
+ if (hooks) {
108
+ const {
109
+ afterLambdaRegisted
110
+ } = hooks;
111
+
112
+ if (afterLambdaRegisted) {
113
+ afterLambdaRegisted(app);
114
+ }
112
115
  }
113
116
  } else if (mode === 'function') {
114
117
  app = (0, _express.default)();
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "modern",
12
12
  "modern.js"
13
13
  ],
14
- "version": "1.15.0",
14
+ "version": "1.18.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,10 +34,10 @@
34
34
  },
35
35
  "dependencies": {
36
36
  "@babel/runtime": "^7.18.0",
37
- "@modern-js/bff-core": "1.15.0",
38
- "@modern-js/bff-runtime": "1.15.0",
39
- "@modern-js/types": "1.15.0",
40
- "@modern-js/utils": "1.15.0",
37
+ "@modern-js/bff-core": "1.18.0",
38
+ "@modern-js/bff-runtime": "1.18.0",
39
+ "@modern-js/types": "1.18.0",
40
+ "@modern-js/utils": "1.18.0",
41
41
  "cookie-parser": "^1.4.5",
42
42
  "finalhandler": "^1.1.2",
43
43
  "formidable": "^1.2.2",
@@ -45,10 +45,10 @@
45
45
  "type-is": "^1.6.18"
46
46
  },
47
47
  "devDependencies": {
48
- "@modern-js/core": "1.15.0",
49
- "@modern-js/server-core": "1.15.0",
50
- "@scripts/build": "1.15.0",
51
- "@scripts/jest-config": "1.15.0",
48
+ "@modern-js/core": "1.18.0",
49
+ "@modern-js/server-core": "1.18.0",
50
+ "@scripts/build": "1.18.0",
51
+ "@scripts/jest-config": "1.18.0",
52
52
  "@types/cookie-parser": "^1.4.2",
53
53
  "@types/express": "^4.17.13",
54
54
  "@types/finalhandler": "^1.1.1",