@modern-js/plugin-express 1.17.0 → 1.18.1-alpha.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,33 @@
1
1
  # @modern-js/plugin-express
2
2
 
3
+ ## 1.18.1-alpha.0
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [9fcfbd4]
8
+ - Updated dependencies [6c2c745]
9
+ - @modern-js/utils@1.18.1-alpha.0
10
+ - @modern-js/bff-core@1.18.1-alpha.0
11
+ - @modern-js/bff-runtime@1.18.1-alpha.0
12
+ - @modern-js/types@1.18.1-alpha.0
13
+
14
+ ## 1.18.0
15
+
16
+ ### Patch Changes
17
+
18
+ - 3d5e3a5: chore: get api mode from bff core
19
+ chore: 从 bff core 中获取 api mode
20
+ - 2b7406d: feat: use typescript instead of babel as typescript compiler in server
21
+ feat: 服务端,增加 typescript 作为 typescipt 编译器
22
+ - Updated dependencies [8280920]
23
+ - Updated dependencies [3d5e3a5]
24
+ - Updated dependencies [5227370]
25
+ - Updated dependencies [7928bae]
26
+ - @modern-js/utils@1.18.0
27
+ - @modern-js/bff-core@1.18.0
28
+ - @modern-js/bff-runtime@1.18.0
29
+ - @modern-js/types@1.18.0
30
+
3
31
  ## 1.17.0
4
32
 
5
33
  ### Patch 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.17.0",
14
+ "version": "1.18.1-alpha.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.17.0",
38
- "@modern-js/bff-runtime": "1.17.0",
39
- "@modern-js/types": "1.17.0",
40
- "@modern-js/utils": "1.17.0",
37
+ "@modern-js/bff-core": "1.18.1-alpha.0",
38
+ "@modern-js/bff-runtime": "1.18.1-alpha.0",
39
+ "@modern-js/types": "1.18.1-alpha.0",
40
+ "@modern-js/utils": "1.18.1-alpha.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.17.0",
49
- "@modern-js/server-core": "1.17.0",
50
- "@scripts/build": "1.17.0",
51
- "@scripts/jest-config": "1.17.0",
48
+ "@modern-js/core": "1.18.1-alpha.0",
49
+ "@modern-js/server-core": "1.18.1-alpha.0",
50
+ "@scripts/build": "1.18.1-alpha.0",
51
+ "@scripts/jest-config": "1.18.1-alpha.0",
52
52
  "@types/cookie-parser": "^1.4.2",
53
53
  "@types/express": "^4.17.13",
54
54
  "@types/finalhandler": "^1.1.1",