@modern-js/plugin-testing 0.0.0-next-20240731045432 → 0.0.0-next-20240731143838

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.
@@ -43,7 +43,7 @@ let server;
43
43
  const createApp = async (pwd, config, plugins, routes) => {
44
44
  if (!server) {
45
45
  config.output.path = "./";
46
- const pluginInstances = (0, import_prod_server.loadServerPlugins)(plugins, pwd);
46
+ const pluginInstances = await (0, import_prod_server.loadServerPlugins)(plugins, pwd);
47
47
  server = await (0, import_prod_server.createProdServer)({
48
48
  pwd,
49
49
  config,
@@ -44,7 +44,7 @@ const setup = () => {
44
44
  prefix,
45
45
  httpMethodDecider
46
46
  });
47
- const apiInfos = apiRouter.getApiHandlers();
47
+ const apiInfos = await apiRouter.getApiHandlers();
48
48
  const apiInfosByFile = apiInfos.reduce((res, apiInfo) => {
49
49
  if (!res[apiInfo.filename]) {
50
50
  res[apiInfo.filename] = [];
@@ -17,10 +17,15 @@ var createApp = function() {
17
17
  if (!!server)
18
18
  return [
19
19
  3,
20
- 2
20
+ 3
21
21
  ];
22
22
  config.output.path = "./";
23
- pluginInstances = loadServerPlugins(plugins, pwd);
23
+ return [
24
+ 4,
25
+ loadServerPlugins(plugins, pwd)
26
+ ];
27
+ case 1:
28
+ pluginInstances = _state.sent();
24
29
  return [
25
30
  4,
26
31
  createProdServer({
@@ -34,10 +39,10 @@ var createApp = function() {
34
39
  }
35
40
  })
36
41
  ];
37
- case 1:
38
- server = _state.sent();
39
- _state.label = 2;
40
42
  case 2:
43
+ server = _state.sent();
44
+ _state.label = 3;
45
+ case 3:
41
46
  app = server.getRequestListener();
42
47
  return [
43
48
  2,
@@ -27,7 +27,12 @@ var setup = function() {
27
27
  prefix,
28
28
  httpMethodDecider
29
29
  });
30
- apiInfos = apiRouter.getApiHandlers();
30
+ return [
31
+ 4,
32
+ apiRouter.getApiHandlers()
33
+ ];
34
+ case 1:
35
+ apiInfos = _state.sent();
31
36
  apiInfosByFile = apiInfos.reduce(function(res, apiInfo) {
32
37
  if (!res[apiInfo.filename]) {
33
38
  res[apiInfo.filename] = [];
@@ -39,16 +44,16 @@ var setup = function() {
39
44
  if (!!app)
40
45
  return [
41
46
  3,
42
- 2
47
+ 3
43
48
  ];
44
49
  return [
45
50
  4,
46
51
  createApp(bff_info.appDir, bff_info.modernUserConfig, bff_info.plugins, bff_info.routes)
47
52
  ];
48
- case 1:
49
- app = _state.sent();
50
- _state.label = 2;
51
53
  case 2:
54
+ app = _state.sent();
55
+ _state.label = 3;
56
+ case 3:
52
57
  return [
53
58
  2
54
59
  ];
@@ -7,7 +7,7 @@ let server;
7
7
  const createApp = async (pwd, config, plugins, routes) => {
8
8
  if (!server) {
9
9
  config.output.path = "./";
10
- const pluginInstances = loadServerPlugins(plugins, pwd);
10
+ const pluginInstances = await loadServerPlugins(plugins, pwd);
11
11
  server = await createProdServer({
12
12
  pwd,
13
13
  config,
@@ -21,7 +21,7 @@ const setup = () => {
21
21
  prefix,
22
22
  httpMethodDecider
23
23
  });
24
- const apiInfos = apiRouter.getApiHandlers();
24
+ const apiInfos = await apiRouter.getApiHandlers();
25
25
  const apiInfosByFile = apiInfos.reduce((res, apiInfo) => {
26
26
  if (!res[apiInfo.filename]) {
27
27
  res[apiInfo.filename] = [];
@@ -1,5 +1,5 @@
1
1
  import type { CliPlugin, IAppContext } from '@modern-js/core';
2
- import type { ServerPlugin } from '@modern-js/server-core';
2
+ import { ServerPlugin } from '@modern-js/prod-server';
3
3
  import { UserConfig } from '../../base/config';
4
4
  import { TestConfigOperator } from '../../base';
5
5
  import type { Hooks } from '../../base/hook';
@@ -18,7 +18,7 @@ declare class ModernRuntime {
18
18
  runtimeByEntries?: any;
19
19
  };
20
20
  }>): void;
21
- createApp(props?: CreateAppProps): ({ _internal_context, ...props }: any) => JSX.Element;
21
+ createApp(props?: CreateAppProps): React.ComponentType<any>;
22
22
  }
23
23
  declare const _default: ModernRuntime;
24
24
  export default _default;
package/package.json CHANGED
@@ -15,7 +15,7 @@
15
15
  "modern",
16
16
  "modern.js"
17
17
  ],
18
- "version": "0.0.0-next-20240731045432",
18
+ "version": "0.0.0-next-20240731143838",
19
19
  "jsnext:source": "./src/cli/index.ts",
20
20
  "types": "./dist/types/cli/index.d.ts",
21
21
  "main": "./dist/cjs/cli/index.js",
@@ -130,19 +130,18 @@
130
130
  "ts-jest": "^29.1.0",
131
131
  "yargs": "^17.0.1",
132
132
  "@swc/helpers": "0.5.3",
133
- "@modern-js/babel-compiler": "0.0.0-next-20240731045432",
134
- "@modern-js/plugin": "0.0.0-next-20240731045432",
135
- "@modern-js/utils": "0.0.0-next-20240731045432",
136
- "@modern-js/prod-server": "0.0.0-next-20240731045432",
137
- "@modern-js/server-core": "0.0.0-next-20240731045432",
138
- "@modern-js/babel-preset": "0.0.0-next-20240731045432",
139
- "@modern-js/types": "0.0.0-next-20240731045432",
140
- "@modern-js/bff-core": "0.0.0-next-20240731045432"
133
+ "@modern-js/babel-compiler": "0.0.0-next-20240731143838",
134
+ "@modern-js/utils": "0.0.0-next-20240731143838",
135
+ "@modern-js/plugin": "0.0.0-next-20240731143838",
136
+ "@modern-js/types": "0.0.0-next-20240731143838",
137
+ "@modern-js/bff-core": "0.0.0-next-20240731143838",
138
+ "@modern-js/prod-server": "0.0.0-next-20240731143838",
139
+ "@modern-js/babel-preset": "0.0.0-next-20240731143838"
141
140
  },
142
141
  "peerDependencies": {
143
142
  "react": ">=17",
144
143
  "react-dom": ">=17",
145
- "@modern-js/runtime": "0.0.0-next-20240731045432"
144
+ "@modern-js/runtime": "0.0.0-next-20240731143838"
146
145
  },
147
146
  "peerDependenciesMeta": {
148
147
  "@modern-js/runtime": {
@@ -157,10 +156,10 @@
157
156
  "@types/node": "^14",
158
157
  "@types/yargs": "^17.0.2",
159
158
  "typescript": "^5",
160
- "@modern-js/core": "0.0.0-next-20240731045432",
161
- "@modern-js/runtime": "0.0.0-next-20240731045432",
162
- "@scripts/build": "0.0.0-next-20240731045432",
163
- "@scripts/jest-config": "0.0.0-next-20240731045432"
159
+ "@modern-js/core": "0.0.0-next-20240731143838",
160
+ "@scripts/build": "0.0.0-next-20240731143838",
161
+ "@modern-js/runtime": "0.0.0-next-20240731143838",
162
+ "@scripts/jest-config": "0.0.0-next-20240731143838"
164
163
  },
165
164
  "sideEffects": false,
166
165
  "publishConfig": {