@modern-js/plugin-testing 2.58.1 → 2.58.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (38) hide show
  1. package/dist/cjs/base/config/patches/index.js +1 -1
  2. package/dist/cjs/base/config/transformer/babelTransformer.js +1 -1
  3. package/dist/cjs/base/runJest.js +2 -2
  4. package/dist/cjs/cli/bff/app.js +2 -2
  5. package/dist/cjs/cli/bff/setup.js +2 -2
  6. package/dist/cjs/runtime-testing/customRender.js +4 -4
  7. package/dist/cjs/runtime-testing/reduck.js +2 -2
  8. package/dist/esm/base/config/patches/index.js +1 -1
  9. package/dist/esm/base/config/transformer/babelTransformer.js +1 -1
  10. package/dist/esm/base/runJest.js +3 -3
  11. package/dist/esm/cli/bff/app.js +11 -6
  12. package/dist/esm/cli/bff/index.js +1 -1
  13. package/dist/esm/cli/bff/setup.js +11 -6
  14. package/dist/esm/cli/index.js +2 -2
  15. package/dist/esm/runtime-testing/customRender.js +1 -1
  16. package/dist/esm/runtime-testing/reduck.js +2 -2
  17. package/dist/esm-node/base/config/patches/index.js +1 -1
  18. package/dist/esm-node/base/config/transformer/babelTransformer.js +1 -1
  19. package/dist/esm-node/base/runJest.js +2 -2
  20. package/dist/esm-node/cli/bff/app.js +2 -2
  21. package/dist/esm-node/cli/bff/index.js +1 -1
  22. package/dist/esm-node/cli/bff/setup.js +2 -2
  23. package/dist/esm-node/cli/index.js +2 -2
  24. package/dist/esm-node/runtime-testing/customRender.js +1 -1
  25. package/dist/esm-node/runtime-testing/reduck.js +2 -2
  26. package/dist/types/base/config/index.d.ts +3 -3
  27. package/dist/types/base/config/patches/assetsModule.d.ts +1 -1
  28. package/dist/types/base/config/patches/index.d.ts +1 -1
  29. package/dist/types/base/config/patches/transformer.d.ts +1 -1
  30. package/dist/types/base/hook.d.ts +1 -1
  31. package/dist/types/base/runJest.d.ts +3 -3
  32. package/dist/types/cli/bff/app.d.ts +1 -1
  33. package/dist/types/cli/bff/index.d.ts +2 -2
  34. package/dist/types/cli/index.d.ts +2 -2
  35. package/dist/types/cli/test.d.ts +2 -2
  36. package/dist/types/runtime-testing/app.d.ts +1 -1
  37. package/package.json +14 -14
  38. package/types/index.d.ts +4 -4
@@ -21,8 +21,8 @@ __export(patches_exports, {
21
21
  applyPatches: () => applyPatches
22
22
  });
23
23
  module.exports = __toCommonJS(patches_exports);
24
- var import_transformer = require("./transformer");
25
24
  var import_assetsModule = require("./assetsModule");
25
+ var import_transformer = require("./transformer");
26
26
  const _applyPatches = async (patches2, testOperator) => {
27
27
  for (const patch of patches2) {
28
28
  await patch(testOperator);
@@ -31,8 +31,8 @@ __export(babelTransformer_exports, {
31
31
  default: () => babelTransformer_default
32
32
  });
33
33
  module.exports = __toCommonJS(babelTransformer_exports);
34
- var import_babel_jest = __toESM(require("babel-jest"));
35
34
  var import_utils = require("@modern-js/utils");
35
+ var import_babel_jest = __toESM(require("babel-jest"));
36
36
  var _babelJest_createTransformer;
37
37
  const isNewJsx = (0, import_utils.isBeyondReact17)(process.cwd());
38
38
  const babelTransformer = (_babelJest_createTransformer = import_babel_jest.default.createTransformer) === null || _babelJest_createTransformer === void 0 ? void 0 : _babelJest_createTransformer.call(import_babel_jest.default, {
@@ -32,9 +32,9 @@ __export(runJest_exports, {
32
32
  runTest: () => runTest
33
33
  });
34
34
  module.exports = __toCommonJS(runJest_exports);
35
- var import_yargs = __toESM(require("yargs/yargs"));
36
- var import_jest = require("jest");
37
35
  var import_utils = require("@modern-js/utils");
36
+ var import_jest = require("jest");
37
+ var import_yargs = __toESM(require("yargs/yargs"));
38
38
  var import_config = require("./config");
39
39
  var import_utils2 = require("./utils");
40
40
  const buildArgv = async (rawArgv, config) => {
@@ -34,16 +34,16 @@ __export(app_exports, {
34
34
  isInHandler: () => isInHandler
35
35
  });
36
36
  module.exports = __toCommonJS(app_exports);
37
- var import_async_hooks = require("async_hooks");
38
37
  var import_node_path = __toESM(require("node:path"));
39
38
  var import_prod_server = require("@modern-js/prod-server");
39
+ var import_async_hooks = require("async_hooks");
40
40
  const store = new import_async_hooks.AsyncLocalStorage();
41
41
  const isInHandler = () => Boolean(store.getStore());
42
42
  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,
@@ -23,9 +23,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
23
23
  ));
24
24
  var import_path = __toESM(require("path"));
25
25
  var import_bff_core = require("@modern-js/bff-core");
26
+ var import_app = require("./app");
26
27
  var import_constant = require("./constant");
27
28
  var import_mockAPI = __toESM(require("./mockAPI"));
28
- var import_app = require("./app");
29
29
  let uped = false;
30
30
  const setup = () => {
31
31
  var _bff_info_modernUserConfig_bff, _bff_info_modernUserConfig, _bff_info_modernUserConfig_bff1, _bff_info_modernUserConfig1;
@@ -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] = [];
@@ -31,11 +31,11 @@ __export(customRender_exports, {
31
31
  default: () => customRender_default
32
32
  });
33
33
  module.exports = __toCommonJS(customRender_exports);
34
- var import_react = __toESM(require("react"));
35
- var import_react2 = require("@testing-library/react");
34
+ var import_react = require("@testing-library/react");
35
+ var import_react2 = __toESM(require("react"));
36
36
  var import_app = __toESM(require("./app"));
37
- const WrapModernProviders = (props) => import_react.default.createElement(import_app.default.createApp(props));
38
- const customRender = (ui, options) => (0, import_react2.render)(ui, {
37
+ const WrapModernProviders = (props) => import_react2.default.createElement(import_app.default.createApp(props));
38
+ const customRender = (ui, options) => (0, import_react.render)(ui, {
39
39
  wrapper: WrapModernProviders,
40
40
  ...options
41
41
  });
@@ -34,10 +34,10 @@ __export(reduck_exports, {
34
34
  immer: () => immer
35
35
  });
36
36
  module.exports = __toCommonJS(reduck_exports);
37
- var import_store = require("@modern-js-reduck/store");
38
- var import_plugin_effects = __toESM(require("@modern-js-reduck/plugin-effects"));
39
37
  var import_plugin_auto_actions = __toESM(require("@modern-js-reduck/plugin-auto-actions"));
38
+ var import_plugin_effects = __toESM(require("@modern-js-reduck/plugin-effects"));
40
39
  var import_plugin_immutable = __toESM(require("@modern-js-reduck/plugin-immutable"));
40
+ var import_store = require("@modern-js-reduck/store");
41
41
  var import_constant = require("../constant");
42
42
  const effects = () => import_plugin_effects.default;
43
43
  const immer = () => import_plugin_immutable.default;
@@ -1,7 +1,7 @@
1
1
  import { _ as _async_to_generator } from "@swc/helpers/_/_async_to_generator";
2
2
  import { _ as _ts_generator } from "@swc/helpers/_/_ts_generator";
3
- import { patchTransformer } from "./transformer";
4
3
  import { patchAssetsModule } from "./assetsModule";
4
+ import { patchTransformer } from "./transformer";
5
5
  var _applyPatches = function() {
6
6
  var _ref = _async_to_generator(function(patches2, testOperator) {
7
7
  var _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, patch, err;
@@ -1,6 +1,6 @@
1
1
  var _babelJest_createTransformer;
2
- import babelJest from "babel-jest";
3
2
  import { isBeyondReact17 } from "@modern-js/utils";
3
+ import babelJest from "babel-jest";
4
4
  var isNewJsx = isBeyondReact17(process.cwd());
5
5
  var babelTransformer = (_babelJest_createTransformer = babelJest.createTransformer) === null || _babelJest_createTransformer === void 0 ? void 0 : _babelJest_createTransformer.call(babelJest, {
6
6
  presets: [
@@ -1,8 +1,8 @@
1
1
  import { _ as _async_to_generator } from "@swc/helpers/_/_async_to_generator";
2
2
  import { _ as _ts_generator } from "@swc/helpers/_/_ts_generator";
3
- import yargs from "yargs/yargs";
4
- import { runCLI } from "jest";
5
3
  import { chalk } from "@modern-js/utils";
4
+ import { runCLI } from "jest";
5
+ import yargs from "yargs/yargs";
6
6
  import { getJestUtils, patchConfig } from "./config";
7
7
  import { debug } from "./utils";
8
8
  var buildArgv = function() {
@@ -54,7 +54,7 @@ var readResultsAndExit = function(result, globalConfig) {
54
54
  });
55
55
  if (globalConfig.forceExit) {
56
56
  if (!globalConfig.detectOpenHandles) {
57
- console.warn("".concat(chalk.bold("Force exiting Jest: "), "Have you considered using `--detectOpenHandles` to detect ") + "async operations that kept running after all tests finished?");
57
+ console.warn("".concat(chalk.bold("Force exiting Jest: "), "Have you considered using `--detectOpenHandles` to detect async operations that kept running after all tests finished?"));
58
58
  }
59
59
  process.exit(code);
60
60
  } else if (!globalConfig.detectOpenHandles) {
@@ -1,8 +1,8 @@
1
1
  import { _ as _async_to_generator } from "@swc/helpers/_/_async_to_generator";
2
2
  import { _ as _ts_generator } from "@swc/helpers/_/_ts_generator";
3
- import { AsyncLocalStorage } from "async_hooks";
4
3
  import path from "node:path";
5
4
  import { createProdServer, loadServerPlugins } from "@modern-js/prod-server";
5
+ import { AsyncLocalStorage } from "async_hooks";
6
6
  var store = new AsyncLocalStorage();
7
7
  var isInHandler = function() {
8
8
  return Boolean(store.getStore());
@@ -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,
@@ -3,7 +3,7 @@ import { _ as _define_property } from "@swc/helpers/_/_define_property";
3
3
  import { _ as _object_spread } from "@swc/helpers/_/_object_spread";
4
4
  import { _ as _ts_generator } from "@swc/helpers/_/_ts_generator";
5
5
  import { isApiOnly } from "@modern-js/utils";
6
- import { getModuleNameMapper, DEFAULT_RESOLVER_PATH } from "../../base";
6
+ import { DEFAULT_RESOLVER_PATH, getModuleNameMapper } from "../../base";
7
7
  import { bff_info_key } from "./constant";
8
8
  import { isBFFProject } from "./utils";
9
9
  var setJestConfigForBFF = function() {
@@ -2,9 +2,9 @@ import { _ as _async_to_generator } from "@swc/helpers/_/_async_to_generator";
2
2
  import { _ as _ts_generator } from "@swc/helpers/_/_ts_generator";
3
3
  import path from "path";
4
4
  import { ApiRouter } from "@modern-js/bff-core";
5
+ import { closeServer, createApp } from "./app";
5
6
  import { bff_info_key } from "./constant";
6
7
  import mockAPI from "./mockAPI";
7
- import { createApp, closeServer } from "./app";
8
8
  var uped = false;
9
9
  var setup = function() {
10
10
  var _bff_info_modernUserConfig_bff, _bff_info_modernUserConfig, _bff_info_modernUserConfig_bff1, _bff_info_modernUserConfig1;
@@ -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
  ];
@@ -2,8 +2,8 @@ import { _ as _async_to_generator } from "@swc/helpers/_/_async_to_generator";
2
2
  import { _ as _define_property } from "@swc/helpers/_/_define_property";
3
3
  import { _ as _ts_generator } from "@swc/helpers/_/_ts_generator";
4
4
  import path from "path";
5
- import { isApiOnly, mergeAlias, createRuntimeExportsUtils } from "@modern-js/utils";
6
- import { testingHooks, getModuleNameMapper, DEFAULT_RESOLVER_PATH } from "../base";
5
+ import { createRuntimeExportsUtils, isApiOnly, mergeAlias } from "@modern-js/utils";
6
+ import { DEFAULT_RESOLVER_PATH, getModuleNameMapper, testingHooks } from "../base";
7
7
  import { MODERNJS_CONFIG_KEY } from "../constant";
8
8
  import { testingBffPlugin } from "./bff";
9
9
  import test from "./test";
@@ -1,6 +1,6 @@
1
1
  import { _ as _object_spread } from "@swc/helpers/_/_object_spread";
2
- import React from "react";
3
2
  import { render } from "@testing-library/react";
3
+ import React from "react";
4
4
  import app from "./app";
5
5
  var WrapModernProviders = function(props) {
6
6
  return React.createElement(app.createApp(props));
@@ -1,9 +1,9 @@
1
1
  import { _ as _object_spread } from "@swc/helpers/_/_object_spread";
2
2
  import { _ as _object_spread_props } from "@swc/helpers/_/_object_spread_props";
3
- import { createStore as originCreateStore } from "@modern-js-reduck/store";
4
- import effectsPlugin from "@modern-js-reduck/plugin-effects";
5
3
  import autoActionsPlugin from "@modern-js-reduck/plugin-auto-actions";
4
+ import effectsPlugin from "@modern-js-reduck/plugin-effects";
6
5
  import immerPlugin from "@modern-js-reduck/plugin-immutable";
6
+ import { createStore as originCreateStore } from "@modern-js-reduck/store";
7
7
  import { MODERNJS_CONFIG_KEY } from "../constant";
8
8
  var effects = function() {
9
9
  return effectsPlugin;
@@ -1,5 +1,5 @@
1
- import { patchTransformer } from "./transformer";
2
1
  import { patchAssetsModule } from "./assetsModule";
2
+ import { patchTransformer } from "./transformer";
3
3
  const _applyPatches = async (patches2, testOperator) => {
4
4
  for (const patch of patches2) {
5
5
  await patch(testOperator);
@@ -1,6 +1,6 @@
1
1
  var _babelJest_createTransformer;
2
- import babelJest from "babel-jest";
3
2
  import { isBeyondReact17 } from "@modern-js/utils";
3
+ import babelJest from "babel-jest";
4
4
  const isNewJsx = isBeyondReact17(process.cwd());
5
5
  const babelTransformer = (_babelJest_createTransformer = babelJest.createTransformer) === null || _babelJest_createTransformer === void 0 ? void 0 : _babelJest_createTransformer.call(babelJest, {
6
6
  presets: [
@@ -1,6 +1,6 @@
1
- import yargs from "yargs/yargs";
2
- import { runCLI } from "jest";
3
1
  import { chalk } from "@modern-js/utils";
2
+ import { runCLI } from "jest";
3
+ import yargs from "yargs/yargs";
4
4
  import { getJestUtils, patchConfig } from "./config";
5
5
  import { debug } from "./utils";
6
6
  const buildArgv = async (rawArgv, config) => {
@@ -1,13 +1,13 @@
1
- import { AsyncLocalStorage } from "async_hooks";
2
1
  import path from "node:path";
3
2
  import { createProdServer, loadServerPlugins } from "@modern-js/prod-server";
3
+ import { AsyncLocalStorage } from "async_hooks";
4
4
  const store = new AsyncLocalStorage();
5
5
  const isInHandler = () => Boolean(store.getStore());
6
6
  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,
@@ -1,5 +1,5 @@
1
1
  import { isApiOnly } from "@modern-js/utils";
2
- import { getModuleNameMapper, DEFAULT_RESOLVER_PATH } from "../../base";
2
+ import { DEFAULT_RESOLVER_PATH, getModuleNameMapper } from "../../base";
3
3
  import { bff_info_key } from "./constant";
4
4
  import { isBFFProject } from "./utils";
5
5
  const setJestConfigForBFF = async ({ pwd, userConfig, plugins, routes, utils, appContext }) => {
@@ -1,8 +1,8 @@
1
1
  import path from "path";
2
2
  import { ApiRouter } from "@modern-js/bff-core";
3
+ import { closeServer, createApp } from "./app";
3
4
  import { bff_info_key } from "./constant";
4
5
  import mockAPI from "./mockAPI";
5
- import { createApp, closeServer } from "./app";
6
6
  let uped = false;
7
7
  const setup = () => {
8
8
  var _bff_info_modernUserConfig_bff, _bff_info_modernUserConfig, _bff_info_modernUserConfig_bff1, _bff_info_modernUserConfig1;
@@ -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,6 +1,6 @@
1
1
  import path from "path";
2
- import { isApiOnly, mergeAlias, createRuntimeExportsUtils } from "@modern-js/utils";
3
- import { testingHooks, getModuleNameMapper, DEFAULT_RESOLVER_PATH } from "../base";
2
+ import { createRuntimeExportsUtils, isApiOnly, mergeAlias } from "@modern-js/utils";
3
+ import { DEFAULT_RESOLVER_PATH, getModuleNameMapper, testingHooks } from "../base";
4
4
  import { MODERNJS_CONFIG_KEY } from "../constant";
5
5
  import { testingBffPlugin } from "./bff";
6
6
  import test from "./test";
@@ -1,5 +1,5 @@
1
- import React from "react";
2
1
  import { render } from "@testing-library/react";
2
+ import React from "react";
3
3
  import app from "./app";
4
4
  const WrapModernProviders = (props) => React.createElement(app.createApp(props));
5
5
  const customRender = (ui, options) => render(ui, {
@@ -1,7 +1,7 @@
1
- import { createStore as originCreateStore } from "@modern-js-reduck/store";
2
- import effectsPlugin from "@modern-js-reduck/plugin-effects";
3
1
  import autoActionsPlugin from "@modern-js-reduck/plugin-auto-actions";
2
+ import effectsPlugin from "@modern-js-reduck/plugin-effects";
4
3
  import immerPlugin from "@modern-js-reduck/plugin-immutable";
4
+ import { createStore as originCreateStore } from "@modern-js-reduck/store";
5
5
  import { MODERNJS_CONFIG_KEY } from "../constant";
6
6
  const effects = () => effectsPlugin;
7
7
  const immer = () => immerPlugin;
@@ -1,6 +1,6 @@
1
- import { AliasOption } from '@modern-js/utils';
2
- import { JestConfig } from '@modern-js/types';
3
- import { TestConfig } from '../types';
1
+ import type { JestConfig } from '@modern-js/types';
2
+ import type { AliasOption } from '@modern-js/utils';
3
+ import type { TestConfig } from '../types';
4
4
  import { TestConfigOperator } from './testConfigOperator';
5
5
  /**
6
6
  * Parse jest config
@@ -1,4 +1,4 @@
1
- import { TestConfigOperator } from '../testConfigOperator';
1
+ import type { TestConfigOperator } from '../testConfigOperator';
2
2
  /**
3
3
  * Merge config from testConfig.jest
4
4
  */
@@ -1,2 +1,2 @@
1
- import { TestConfigOperator } from '../testConfigOperator';
1
+ import type { TestConfigOperator } from '../testConfigOperator';
2
2
  export declare const applyPatches: (testConfig: TestConfigOperator) => Promise<void>;
@@ -1,4 +1,4 @@
1
- import { TestConfigOperator } from '../testConfigOperator';
1
+ import type { TestConfigOperator } from '../testConfigOperator';
2
2
  /**
3
3
  * Map `TestConfig.transformer` to jest config
4
4
  */
@@ -1,4 +1,4 @@
1
- import { TestConfigOperator } from './config/testConfigOperator';
1
+ import type { TestConfigOperator } from './config/testConfigOperator';
2
2
  export declare const jestConfigHook: import("@modern-js/plugin").AsyncPipeline<TestConfigOperator, TestConfigOperator>;
3
3
  export declare const afterTestHook: import("@modern-js/plugin").ParallelWorkflow<void, unknown>;
4
4
  export declare const testingHooks: {
@@ -5,11 +5,11 @@
5
5
  * The followed code is inspired by
6
6
  * https://github.com/facebook/jest/blob/fdc74af37235354e077edeeee8aa2d1a4a863032/packages/jest-cli/src/cli/index.ts#L21
7
7
  */
8
- import { Config } from '@jest/types';
8
+ import type { Config } from '@jest/types';
9
9
  import type { PluginAPI } from '@modern-js/core';
10
- import { UserConfig } from './config';
11
- import { TestConfig } from './types';
10
+ import { type UserConfig } from './config';
12
11
  import type { Hooks } from './hook';
12
+ import type { TestConfig } from './types';
13
13
  type Argv = Omit<Config.Argv, '_' | '$0'>;
14
14
  /**
15
15
  * Node API: execute jest
@@ -1,5 +1,5 @@
1
1
  /// <reference types="node" />
2
- import { ServerPlugin } from '@modern-js/types';
2
+ import type { ServerPlugin } from '@modern-js/types';
3
3
  export declare const isInHandler: () => boolean;
4
4
  declare const createApp: (pwd: string, config: any, plugins: ServerPlugin[], routes: any[]) => Promise<(req: import("http").IncomingMessage, res: import("http").ServerResponse) => Promise<void>>;
5
5
  declare const getApp: () => (req: import("http").IncomingMessage, res: import("http").ServerResponse) => Promise<void>;
@@ -1,7 +1,7 @@
1
1
  import type { CliPlugin, IAppContext } from '@modern-js/core';
2
2
  import type { ServerPlugin } from '@modern-js/server-core';
3
- import { UserConfig } from '../../base/config';
4
- import { TestConfigOperator } from '../../base';
3
+ import { type TestConfigOperator } from '../../base';
4
+ import type { UserConfig } from '../../base/config';
5
5
  import type { Hooks } from '../../base/hook';
6
6
  export declare const setJestConfigForBFF: ({ pwd, userConfig, plugins, routes, utils, appContext, }: {
7
7
  pwd: string;
@@ -1,7 +1,7 @@
1
1
  import type { CliPlugin } from '@modern-js/core';
2
- import { TestConfigOperator } from '../base';
3
- import type { Hooks } from '../base/hook';
2
+ import { type TestConfigOperator } from '../base';
4
3
  import type { UserConfig } from '../base/config';
4
+ import type { Hooks } from '../base/hook';
5
5
  export declare const mergeUserJestConfig: (testUtils: TestConfigOperator) => void;
6
6
  export declare const getJestTransformEsModulesRegStr: () => string;
7
7
  export declare const testingPlugin: () => CliPlugin<{
@@ -1,6 +1,6 @@
1
1
  import type { PluginAPI } from '@modern-js/core';
2
- import { Hooks } from '../base/hook';
3
- import { UserConfig } from '../base/config';
2
+ import type { UserConfig } from '../base/config';
3
+ import type { Hooks } from '../base/hook';
4
4
  declare const test: (api: PluginAPI<{
5
5
  hooks: Hooks;
6
6
  userConfig: UserConfig;
@@ -1,5 +1,5 @@
1
- import React from 'react';
2
1
  import type { UserConfig } from '@modern-js/core';
2
+ import type React from 'react';
3
3
  interface CreateAppProps {
4
4
  entry?: string;
5
5
  children?: React.ReactElement;
package/package.json CHANGED
@@ -15,7 +15,7 @@
15
15
  "modern",
16
16
  "modern.js"
17
17
  ],
18
- "version": "2.58.1",
18
+ "version": "2.58.3",
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,19 @@
130
130
  "supertest": "^6.1.6",
131
131
  "ts-jest": "^29.1.0",
132
132
  "yargs": "^17.0.1",
133
- "@modern-js/babel-compiler": "2.58.1",
134
- "@modern-js/babel-preset": "2.58.1",
135
- "@modern-js/bff-core": "2.58.1",
136
- "@modern-js/plugin": "2.58.1",
137
- "@modern-js/prod-server": "2.58.1",
138
- "@modern-js/server-core": "2.58.1",
139
- "@modern-js/types": "2.58.1",
140
- "@modern-js/utils": "2.58.1"
133
+ "@modern-js/babel-compiler": "2.58.3",
134
+ "@modern-js/babel-preset": "2.58.3",
135
+ "@modern-js/bff-core": "2.58.3",
136
+ "@modern-js/plugin": "2.58.3",
137
+ "@modern-js/prod-server": "2.58.3",
138
+ "@modern-js/server-core": "2.58.3",
139
+ "@modern-js/types": "2.58.3",
140
+ "@modern-js/utils": "2.58.3"
141
141
  },
142
142
  "peerDependencies": {
143
143
  "react": ">=17",
144
144
  "react-dom": ">=17",
145
- "@modern-js/runtime": "^2.58.1"
145
+ "@modern-js/runtime": "^2.58.3"
146
146
  },
147
147
  "peerDependenciesMeta": {
148
148
  "@modern-js/runtime": {
@@ -157,10 +157,10 @@
157
157
  "react": "^18",
158
158
  "react-dom": "^18",
159
159
  "typescript": "^5",
160
- "@modern-js/core": "2.58.1",
161
- "@modern-js/runtime": "2.58.1",
162
- "@scripts/build": "2.58.1",
163
- "@scripts/jest-config": "2.58.1"
160
+ "@modern-js/core": "2.58.3",
161
+ "@modern-js/runtime": "2.58.3",
162
+ "@scripts/jest-config": "2.58.3",
163
+ "@scripts/build": "2.58.3"
164
164
  },
165
165
  "sideEffects": false,
166
166
  "publishConfig": {
package/types/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import "@testing-library/react"
2
- import "@testing-library/jest-dom"
3
- import "../dist/types/runtime-testing"
4
- import "../dist/types/runtime-testing/bff"
1
+ import '@testing-library/react';
2
+ import '@testing-library/jest-dom';
3
+ import '../dist/types/runtime-testing';
4
+ import '../dist/types/runtime-testing/bff';
5
5
 
6
6
  declare module '@modern-js/runtime/testing' {
7
7
  export * from '@testing-library/react';