@modern-js/plugin-testing 0.0.0-next-20221021092811 → 0.0.0-next-20221027082629

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,25 +1,49 @@
1
1
  # @modern-js/plugin-testing
2
2
 
3
- ## 0.0.0-next-20221021092811
4
-
5
- ### Patch Changes
6
-
7
- - Updated dependencies [c9e800d3]
8
- - Updated dependencies [dcf343c1]
9
- - Updated dependencies [dcf343c1]
10
- - Updated dependencies [9650b93b]
11
- - Updated dependencies [7d85fcd1]
12
- - Updated dependencies [b8bbe036]
13
- - Updated dependencies [3bbea92b]
14
- - Updated dependencies [ec58878b]
15
- - Updated dependencies [fcace5b5]
16
- - @modern-js/runtime@0.0.0-next-20221021092811
17
- - @modern-js/prod-server@0.0.0-next-20221021092811
18
- - @modern-js/plugin@0.0.0-next-20221021092811
19
- - @modern-js/utils@0.0.0-next-20221021092811
20
- - @modern-js/webpack@0.0.0-next-20221021092811
21
- - @modern-js/babel-preset-app@0.0.0-next-20221021092811
22
- - @modern-js/babel-compiler@0.0.0-next-20221021092811
3
+ ## 0.0.0-next-20221027082629
4
+
5
+ ### Patch Changes
6
+
7
+ - cc971eabf: refactor: move server plugin load logic in `@modern-js/core`
8
+ refactor:移除在 `@modern-js/core` 中的 server 插件加载逻辑
9
+ - Updated dependencies [c9e800d39]
10
+ - Updated dependencies [decfcd989]
11
+ - Updated dependencies [4369648ae]
12
+ - Updated dependencies [cc971eabf]
13
+ - Updated dependencies [b8bbe036c]
14
+ - Updated dependencies [d5a31df78]
15
+ - Updated dependencies [8b8e1bb57]
16
+ - Updated dependencies [3bbea92b2]
17
+ - Updated dependencies [fcace5b5b]
18
+ - @modern-js/runtime@0.0.0-next-20221027082629
19
+ - @modern-js/prod-server@0.0.0-next-20221027082629
20
+ - @modern-js/babel-preset-app@0.0.0-next-20221027082629
21
+ - @modern-js/utils@0.0.0-next-20221027082629
22
+ - @modern-js/plugin@0.0.0-next-20221027082629
23
+ - @modern-js/webpack@0.0.0-next-20221027082629
24
+ - @modern-js/babel-compiler@0.0.0-next-20221027082629
25
+
26
+ ## 1.21.0
27
+
28
+ ### Patch Changes
29
+
30
+ - Updated dependencies [f51c59a]
31
+ - Updated dependencies [4c1f3a4]
32
+ - Updated dependencies [17d1672]
33
+ - Updated dependencies [4c1f3a4]
34
+ - Updated dependencies [8f3674a]
35
+ - Updated dependencies [c40fc4b]
36
+ - Updated dependencies [28f0a4f]
37
+ - Updated dependencies [b0597e3]
38
+ - Updated dependencies [519965e]
39
+ - Updated dependencies [67d80b7]
40
+ - @modern-js/runtime@1.21.0
41
+ - @modern-js/prod-server@1.21.0
42
+ - @modern-js/webpack@1.21.0
43
+ - @modern-js/plugin@1.21.0
44
+ - @modern-js/utils@1.21.0
45
+ - @modern-js/babel-preset-app@1.21.0
46
+ - @modern-js/babel-compiler@1.21.0
23
47
 
24
48
  ## 1.20.1
25
49
 
@@ -11,7 +11,7 @@ const createApp = async (pwd, config, plugins, routes) => {
11
11
  apiOnly: true,
12
12
  pwd,
13
13
  config,
14
- plugins,
14
+ internalPlugins: plugins,
15
15
  routes
16
16
  });
17
17
  await server.init();
@@ -102,12 +102,11 @@ export default (() => ({
102
102
  }
103
103
 
104
104
  const userConfig = api.useResolvedConfigContext();
105
- const plugins = appContext.plugins.map(p => p.server).filter(Boolean);
106
105
  await setJestConfigForBFF({
107
106
  pwd,
108
107
  userConfig,
109
- plugins,
110
108
  routes: appContext.serverRoutes,
109
+ plugins: appContext.serverInternalPlugins,
111
110
  utils
112
111
  });
113
112
  return next(utils);
@@ -23,7 +23,7 @@ const createApp = async (pwd, config, plugins, routes) => {
23
23
  apiOnly: true,
24
24
  pwd,
25
25
  config,
26
- plugins,
26
+ internalPlugins: plugins,
27
27
  routes
28
28
  });
29
29
  await server.init();
@@ -119,12 +119,11 @@ var _default = () => ({
119
119
  }
120
120
 
121
121
  const userConfig = api.useResolvedConfigContext();
122
- const plugins = appContext.plugins.map(p => p.server).filter(Boolean);
123
122
  await setJestConfigForBFF({
124
123
  pwd,
125
124
  userConfig,
126
- plugins,
127
125
  routes: appContext.serverRoutes,
126
+ plugins: appContext.serverInternalPlugins,
128
127
  utils
129
128
  });
130
129
  return next(utils);
@@ -25,7 +25,7 @@ var createApp = /*#__PURE__*/function () {
25
25
  apiOnly: true,
26
26
  pwd: pwd,
27
27
  config: config,
28
- plugins: plugins,
28
+ internalPlugins: plugins,
29
29
  routes: routes
30
30
  });
31
31
  _context.next = 5;
@@ -103,7 +103,7 @@ export default (function () {
103
103
  return {
104
104
  jestConfig: function () {
105
105
  var _jestConfig = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(utils, next) {
106
- var appContext, pwd, userConfig, plugins;
106
+ var appContext, pwd, userConfig;
107
107
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
108
108
  while (1) {
109
109
  switch (_context2.prev = _context2.next) {
@@ -120,22 +120,19 @@ export default (function () {
120
120
 
121
121
  case 4:
122
122
  userConfig = api.useResolvedConfigContext();
123
- plugins = appContext.plugins.map(function (p) {
124
- return p.server;
125
- }).filter(Boolean);
126
- _context2.next = 8;
123
+ _context2.next = 7;
127
124
  return setJestConfigForBFF({
128
125
  pwd: pwd,
129
126
  userConfig: userConfig,
130
- plugins: plugins,
131
127
  routes: appContext.serverRoutes,
128
+ plugins: appContext.serverInternalPlugins,
132
129
  utils: utils
133
130
  });
134
131
 
135
- case 8:
132
+ case 7:
136
133
  return _context2.abrupt("return", next(utils));
137
134
 
138
- case 9:
135
+ case 8:
139
136
  case "end":
140
137
  return _context2.stop();
141
138
  }
@@ -1,8 +1,9 @@
1
1
  /// <reference types="node" />
2
2
  /// <reference types="node/http" />
3
3
  /// <reference types="@modern-js/prod-server/src/type" />
4
+ import { InternalPlugins } from '@modern-js/types';
4
5
  export declare const isInHandler: () => boolean;
5
- declare const createApp: (pwd: string, config: any, plugins: any[], routes: any[]) => Promise<(req: import("http").IncomingMessage, res: import("http").ServerResponse, next?: (() => void) | undefined) => void>;
6
+ declare const createApp: (pwd: string, config: any, plugins: InternalPlugins, routes: any[]) => Promise<(req: import("http").IncomingMessage, res: import("http").ServerResponse, next?: (() => void) | undefined) => void>;
6
7
  declare const getApp: () => (req: import("http").IncomingMessage, res: import("http").ServerResponse, next?: (() => void) | undefined) => void;
7
8
  declare const closeServer: () => Promise<void>;
8
9
  export { createApp, getApp, closeServer };
@@ -1,4 +1,5 @@
1
1
  import type { CliPlugin } from '@modern-js/core';
2
+ import { InternalPlugins } from '@modern-js/types';
2
3
  import { TestConfigOperator } from '../../base';
3
4
  export declare const setJestConfigForBFF: ({
4
5
  pwd,
@@ -9,7 +10,7 @@ export declare const setJestConfigForBFF: ({
9
10
  }: {
10
11
  pwd: string;
11
12
  userConfig: any;
12
- plugins: any[];
13
+ plugins: InternalPlugins;
13
14
  routes: any[];
14
15
  utils: TestConfigOperator;
15
16
  }) => Promise<void>;
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "modern",
12
12
  "modern.js"
13
13
  ],
14
- "version": "0.0.0-next-20221021092811",
14
+ "version": "0.0.0-next-20221027082629",
15
15
  "jsnext:source": "./src/index.ts",
16
16
  "types": "./dist/types/index.d.ts",
17
17
  "main": "./dist/js/node/index.js",
@@ -99,12 +99,12 @@
99
99
  "@modern-js-reduck/plugin-effects": "^1.0.2",
100
100
  "@modern-js-reduck/plugin-immutable": "^1.0.1",
101
101
  "@modern-js-reduck/store": "^1.0.3",
102
- "@modern-js/babel-compiler": "0.0.0-next-20221021092811",
103
- "@modern-js/utils": "0.0.0-next-20221021092811",
104
- "@modern-js/webpack": "0.0.0-next-20221021092811",
105
- "@modern-js/babel-preset-app": "0.0.0-next-20221021092811",
106
- "@modern-js/plugin": "0.0.0-next-20221021092811",
107
- "@modern-js/prod-server": "0.0.0-next-20221021092811",
102
+ "@modern-js/babel-compiler": "0.0.0-next-20221027082629",
103
+ "@modern-js/utils": "0.0.0-next-20221027082629",
104
+ "@modern-js/webpack": "0.0.0-next-20221027082629",
105
+ "@modern-js/babel-preset-app": "0.0.0-next-20221027082629",
106
+ "@modern-js/plugin": "0.0.0-next-20221027082629",
107
+ "@modern-js/prod-server": "0.0.0-next-20221027082629",
108
108
  "@testing-library/jest-dom": "^5.14.1",
109
109
  "@testing-library/react": "^13.4.0",
110
110
  "@types/testing-library__jest-dom": "^5.14.3",
@@ -121,7 +121,7 @@
121
121
  "peerDependencies": {
122
122
  "react": ">=18",
123
123
  "react-dom": ">=17",
124
- "@modern-js/runtime": "^0.0.0-next-20221021092811"
124
+ "@modern-js/runtime": "^0.0.0-next-20221027082629"
125
125
  },
126
126
  "peerDependenciesMeta": {
127
127
  "@modern-js/runtime": {
@@ -131,12 +131,12 @@
131
131
  "devDependencies": {
132
132
  "react": "^18",
133
133
  "react-dom": "^18",
134
- "@modern-js/core": "0.0.0-next-20221021092811",
135
- "@modern-js/types": "0.0.0-next-20221021092811",
136
- "@modern-js/runtime": "0.0.0-next-20221021092811",
137
- "@modern-js/bff-core": "0.0.0-next-20221021092811",
138
- "@scripts/build": "0.0.0-next-20221021092811",
139
- "@scripts/jest-config": "0.0.0-next-20221021092811",
134
+ "@modern-js/core": "0.0.0-next-20221027082629",
135
+ "@modern-js/types": "0.0.0-next-20221027082629",
136
+ "@modern-js/runtime": "0.0.0-next-20221027082629",
137
+ "@modern-js/bff-core": "0.0.0-next-20221027082629",
138
+ "@scripts/build": "0.0.0-next-20221027082629",
139
+ "@scripts/jest-config": "0.0.0-next-20221027082629",
140
140
  "@types/jest": "^27",
141
141
  "@types/supertest": "^2.0.11",
142
142
  "@types/node": "^14",