@modern-js/plugin-express 1.2.1-rc.0 → 1.2.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/CHANGELOG.md CHANGED
@@ -1,17 +1,10 @@
1
1
  # @modern-js/plugin-express
2
2
 
3
- ## 1.2.1-rc.0
3
+ ## 1.2.1
4
4
 
5
5
  ### Patch Changes
6
6
 
7
- - Updated dependencies [e51b1db3]
8
- - Updated dependencies [b7fb82ec]
9
- - @modern-js/server-plugin@1.1.4-rc.0
10
- - @modern-js/utils@1.1.6-rc.0
11
- - @modern-js/core@1.2.1-rc.0
12
- - @modern-js/adapter-helpers@1.1.1
13
- - @modern-js/bff-runtime@1.1.2-rc.0
14
- - @modern-js/bff-utils@1.1.2-rc.0
7
+ - ad107726: feat: new action support apppend type define
15
8
 
16
9
  ## 1.2.0
17
10
 
@@ -62,7 +62,7 @@ export default createPlugin(() => ({
62
62
  app = await findAppModule(apiDir);
63
63
 
64
64
  if (!app || !app.use) {
65
- console.warn('There is not api/app.ts.');
65
+ // console.warn('There is not api/app.ts.');
66
66
  app = express();
67
67
  }
68
68
 
@@ -84,7 +84,7 @@ var _default = (0, _serverPlugin.createPlugin)(() => ({
84
84
  app = await findAppModule(apiDir);
85
85
 
86
86
  if (!app || !app.use) {
87
- console.warn('There is not api/app.ts.');
87
+ // console.warn('There is not api/app.ts.');
88
88
  app = (0, _express.default)();
89
89
  }
90
90
 
package/package.json CHANGED
@@ -11,26 +11,31 @@
11
11
  "modern",
12
12
  "modern.js"
13
13
  ],
14
- "version": "1.2.1-rc.0",
14
+ "version": "1.2.1",
15
15
  "jsnext:source": "./src/index.ts",
16
16
  "types": "./dist/types/index.d.ts",
17
17
  "main": "./dist/js/node/index.js",
18
18
  "module": "./dist/js/treeshaking/index.js",
19
19
  "jsnext:modern": "./dist/js/modern/index.js",
20
20
  "exports": {
21
+ "./types": "./types.d.ts",
21
22
  ".": {
22
23
  "node": {
24
+ "jsnext:source": "./src/index.ts",
23
25
  "import": "./dist/js/modern/index.js",
24
26
  "require": "./dist/js/node/index.js"
25
27
  },
26
28
  "default": "./dist/js/treeshaking/index.js"
27
29
  },
28
- "./cli": "./dist/js/node/cli/index.js"
30
+ "./cli": {
31
+ "jsnext:source": "./src/cli/index.ts",
32
+ "default": "./dist/js/node/cli/index.js"
33
+ }
29
34
  },
30
35
  "dependencies": {
31
36
  "@babel/runtime": "^7.15.3",
32
37
  "@modern-js/adapter-helpers": "^1.1.1",
33
- "@modern-js/utils": "^1.1.6-rc.0",
38
+ "@modern-js/utils": "^1.1.5",
34
39
  "cookie-parser": "^1.4.5",
35
40
  "finalhandler": "^1.1.2",
36
41
  "formidable": "^1.2.2",
@@ -38,8 +43,8 @@
38
43
  },
39
44
  "devDependencies": {
40
45
  "express": "^4.17.1",
41
- "@modern-js/server-utils": "^1.1.3-rc.0",
42
- "@modern-js/bff-runtime": "^1.1.2-rc.0",
46
+ "@modern-js/server-utils": "^1.1.2",
47
+ "@modern-js/bff-runtime": "^1.1.1",
43
48
  "@types/cookie-parser": "^1.4.2",
44
49
  "@types/express": "^4.17.13",
45
50
  "@types/finalhandler": "^1.1.1",
@@ -50,11 +55,11 @@
50
55
  "@types/type-is": "^1.6.3",
51
56
  "supertest": "^6.1.6",
52
57
  "typescript": "^4",
53
- "@modern-js/bff-utils": "^1.1.2-rc.0",
54
- "@modern-js/core": "^1.2.1-rc.0",
55
- "@modern-js/server-plugin": "^1.1.4-rc.0",
58
+ "@modern-js/bff-utils": "^1.1.1",
59
+ "@modern-js/core": "^1.2.0",
60
+ "@modern-js/server-plugin": "^1.1.3",
56
61
  "@modern-js/plugin-testing": "^1.2.2",
57
- "@modern-js/module-tools": "^1.1.4"
62
+ "@modern-js/module-tools": "^1.1.5"
58
63
  },
59
64
  "modernConfig": {
60
65
  "output": {
@@ -62,10 +67,10 @@
62
67
  }
63
68
  },
64
69
  "peerDependencies": {
65
- "@modern-js/bff-utils": "^1.1.2-rc.0",
66
- "@modern-js/core": "^1.2.1-rc.0",
67
- "@modern-js/server-plugin": "^1.1.4-rc.0",
68
- "@modern-js/bff-runtime": "^1.1.2-rc.0",
70
+ "@modern-js/bff-utils": "^1.1.1",
71
+ "@modern-js/core": "^1.2.0",
72
+ "@modern-js/server-plugin": "^1.1.3",
73
+ "@modern-js/bff-runtime": "^1.1.1",
69
74
  "express": "^4.17.1"
70
75
  },
71
76
  "publishConfig": {
package/src/plugin.ts CHANGED
@@ -67,7 +67,7 @@ export default createPlugin(
67
67
  app = await findAppModule(apiDir);
68
68
 
69
69
  if (!app || !app.use) {
70
- console.warn('There is not api/app.ts.');
70
+ // console.warn('There is not api/app.ts.');
71
71
  app = express();
72
72
  }
73
73
  initApp(app);
@@ -1,7 +1,7 @@
1
1
  // eslint-disable-next-line eslint-comments/disable-enable-pair
2
2
  /* eslint-disable react-hooks/rules-of-hooks */
3
3
  import { match } from '@modern-js/bff-runtime';
4
- import { useContext } from '@/context';
4
+ import { useContext } from '../../../../../src/context';
5
5
 
6
6
  // eslint-disable-next-line arrow-body-style
7
7
  export const get = ({ query }: { query: Record<string, unknown> }) => {
@@ -1,7 +1,7 @@
1
1
  // eslint-disable-next-line eslint-comments/disable-enable-pair
2
2
  /* eslint-disable react-hooks/rules-of-hooks */
3
3
  import { match } from '@modern-js/bff-runtime';
4
- import { useContext } from '@/context';
4
+ import { useContext } from '../../../../../../src/context';
5
5
 
6
6
  export const get = ({ query }: { query: Record<string, unknown> }) => ({
7
7
  query,
@@ -1,5 +1,5 @@
1
1
  import path from 'path';
2
- import express, { Request, Response } from 'express';
2
+ import express from 'express';
3
3
  import request from 'supertest';
4
4
  import { serverManager } from '@modern-js/server-plugin';
5
5
  import { INTROSPECTION_ROUTE_PATH } from '@modern-js/bff-utils';
@@ -333,7 +333,7 @@ describe('support as async handler', () => {
333
333
  config: { middleware: [wrapMiddleware] },
334
334
  });
335
335
 
336
- const asyncHandler = async (req: Request, res: Response) => {
336
+ const asyncHandler = async (req: any, res: any) => {
337
337
  await apiHandler(req, res);
338
338
  order.push(3);
339
339
  };
@@ -7,8 +7,6 @@
7
7
  "isolatedModules": true,
8
8
  "sourceMap": true
9
9
  },
10
- "paths": {
11
- "@/*": ["../src/*"]
12
- },
10
+ "paths": {},
13
11
  "exclude": ["src/__test__/fixtures/**"]
14
12
  }
@@ -3,7 +3,7 @@ import { Buffer } from 'buffer';
3
3
  import { Request, Response } from 'express';
4
4
  import request from 'supertest';
5
5
  import { serverManager } from '@modern-js/server-plugin';
6
- import plugin from '@/plugin';
6
+ import plugin from '../src/plugin';
7
7
  import './common';
8
8
 
9
9
  const pwd = path.join(__dirname, './fixtures/function-mode');