@modern-js/server-core 2.35.1 → 2.36.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/dist/cjs/index.js CHANGED
@@ -1,9 +1,28 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
15
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
16
+ var src_exports = {};
17
+ module.exports = __toCommonJS(src_exports);
18
+ __reExport(src_exports, require("./plugin"), module.exports);
19
+ __reExport(src_exports, require("@modern-js/plugin"), module.exports);
20
+ __reExport(src_exports, require("./loadPlugins"), module.exports);
21
+ __reExport(src_exports, require("./types/config"), module.exports);
22
+ // Annotate the CommonJS export names for ESM import in node:
23
+ 0 && (module.exports = {
24
+ ...require("./plugin"),
25
+ ...require("@modern-js/plugin"),
26
+ ...require("./loadPlugins"),
27
+ ...require("./types/config")
4
28
  });
5
- const _export_star = require("@swc/helpers/_/_export_star");
6
- _export_star._(require("./plugin"), exports);
7
- _export_star._(require("@modern-js/plugin"), exports);
8
- _export_star._(require("./loadPlugins"), exports);
9
- _export_star._(require("./types/config"), exports);
@@ -1,36 +1,53 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "loadPlugins", {
6
- enumerable: true,
7
- get: function() {
8
- return loadPlugins;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
9
15
  }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var loadPlugins_exports = {};
20
+ __export(loadPlugins_exports, {
21
+ loadPlugins: () => loadPlugins
10
22
  });
11
- const _utils = require("@modern-js/utils");
12
- const _plugin = require("./plugin");
23
+ module.exports = __toCommonJS(loadPlugins_exports);
24
+ var import_utils = require("@modern-js/utils");
25
+ var import_plugin = require("./plugin");
13
26
  const resolvePlugin = (p, appDirectory) => {
14
27
  const isPluginInstance = typeof p !== "string";
15
28
  if (isPluginInstance) {
16
29
  return {
17
- module: (0, _plugin.createPlugin)(p.setup, p)
30
+ module: (0, import_plugin.createPlugin)(p.setup, p)
18
31
  };
19
32
  }
20
- const pluginPath = (0, _utils.tryResolve)(p, appDirectory);
21
- const module = (0, _utils.compatRequire)(pluginPath);
22
- const pluginInstance = module();
33
+ const pluginPath = (0, import_utils.tryResolve)(p, appDirectory);
34
+ const module2 = (0, import_utils.compatRequire)(pluginPath);
35
+ const pluginInstance = module2();
23
36
  return {
24
- module: (0, _plugin.createPlugin)(pluginInstance.setup, pluginInstance)
37
+ module: (0, import_plugin.createPlugin)(pluginInstance.setup, pluginInstance)
25
38
  };
26
39
  };
27
40
  const loadPlugins = (appDirectory, configPlugins, options) => {
28
- const loadedPlugins = (0, _utils.getInternalPlugins)(appDirectory, options.internalPlugins);
41
+ const loadedPlugins = (0, import_utils.getInternalPlugins)(appDirectory, options.internalPlugins);
29
42
  return [
30
43
  ...loadedPlugins,
31
44
  ...configPlugins
32
45
  ].map((plugin) => {
33
- const { module } = resolvePlugin(plugin, appDirectory);
34
- return module;
46
+ const { module: module2 } = resolvePlugin(plugin, appDirectory);
47
+ return module2;
35
48
  });
36
49
  };
50
+ // Annotate the CommonJS export names for ESM import in node:
51
+ 0 && (module.exports = {
52
+ loadPlugins
53
+ });
@@ -1,76 +1,69 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- function _export(target, all) {
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
6
7
  for (var name in all)
7
- Object.defineProperty(target, name, {
8
- enumerable: true,
9
- get: all[name]
10
- });
11
- }
12
- _export(exports, {
13
- AppContext: function() {
14
- return AppContext;
15
- },
16
- setAppContext: function() {
17
- return setAppContext;
18
- },
19
- ConfigContext: function() {
20
- return ConfigContext;
21
- },
22
- useConfigContext: function() {
23
- return useConfigContext;
24
- },
25
- useAppContext: function() {
26
- return useAppContext;
27
- },
28
- createServerManager: function() {
29
- return createServerManager;
30
- },
31
- serverManager: function() {
32
- return serverManager;
33
- },
34
- createPlugin: function() {
35
- return createPlugin;
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
36
15
  }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var plugin_exports = {};
20
+ __export(plugin_exports, {
21
+ AppContext: () => AppContext,
22
+ ConfigContext: () => ConfigContext,
23
+ createPlugin: () => createPlugin,
24
+ createServerManager: () => createServerManager,
25
+ serverManager: () => serverManager,
26
+ setAppContext: () => setAppContext,
27
+ useAppContext: () => useAppContext,
28
+ useConfigContext: () => useConfigContext
37
29
  });
38
- const _plugin = require("@modern-js/plugin");
39
- const gather = (0, _plugin.createParallelWorkflow)();
40
- const config = (0, _plugin.createWaterfall)();
41
- const prepare = (0, _plugin.createWaterfall)();
42
- const prepareLoaderHandler = (0, _plugin.createAsyncPipeline)();
43
- const prepareWebServer = (0, _plugin.createAsyncPipeline)();
44
- const prepareApiServer = (0, _plugin.createAsyncPipeline)();
45
- const onApiChange = (0, _plugin.createWaterfall)();
46
- const repack = (0, _plugin.createWaterfall)();
47
- const beforeServerInit = (0, _plugin.createAsyncWaterfall)();
48
- const afterServerInit = (0, _plugin.createAsyncWaterfall)();
49
- const beforeDevServer = (0, _plugin.createParallelWorkflow)();
50
- const setupCompiler = (0, _plugin.createParallelWorkflow)();
51
- const afterDevServer = (0, _plugin.createParallelWorkflow)();
52
- const beforeRouteSet = (0, _plugin.createAsyncPipeline)();
53
- const afterRouteSet = (0, _plugin.createAsyncPipeline)();
54
- const beforeProdServer = (0, _plugin.createParallelWorkflow)();
55
- const afterProdServer = (0, _plugin.createParallelWorkflow)();
56
- const listen = (0, _plugin.createParallelWorkflow)();
57
- const beforeServerReset = (0, _plugin.createParallelWorkflow)();
58
- const afterServerReset = (0, _plugin.createParallelWorkflow)();
59
- const extendSSRContext = (0, _plugin.createAsyncWaterfall)();
60
- const extendContext = (0, _plugin.createAsyncPipeline)();
61
- const handleError = (0, _plugin.createParallelWorkflow)();
62
- const beforeMatch = (0, _plugin.createAsyncPipeline)();
63
- const afterMatch = (0, _plugin.createAsyncPipeline)();
64
- const prefetch = (0, _plugin.createParallelWorkflow)();
65
- const renderToString = (0, _plugin.createAsyncPipeline)();
66
- const beforeRender = (0, _plugin.createAsyncPipeline)();
67
- const afterRender = (0, _plugin.createAsyncPipeline)();
68
- const beforeSend = (0, _plugin.createAsyncPipeline)();
69
- const afterSend = (0, _plugin.createParallelWorkflow)();
70
- const reset = (0, _plugin.createParallelWorkflow)();
71
- const AppContext = (0, _plugin.createContext)({});
30
+ module.exports = __toCommonJS(plugin_exports);
31
+ var import_plugin = require("@modern-js/plugin");
32
+ const gather = (0, import_plugin.createParallelWorkflow)();
33
+ const config = (0, import_plugin.createWaterfall)();
34
+ const prepare = (0, import_plugin.createWaterfall)();
35
+ const prepareLoaderHandler = (0, import_plugin.createAsyncPipeline)();
36
+ const prepareWebServer = (0, import_plugin.createAsyncPipeline)();
37
+ const prepareApiServer = (0, import_plugin.createAsyncPipeline)();
38
+ const onApiChange = (0, import_plugin.createWaterfall)();
39
+ const repack = (0, import_plugin.createWaterfall)();
40
+ const beforeServerInit = (0, import_plugin.createAsyncWaterfall)();
41
+ const afterServerInit = (0, import_plugin.createAsyncWaterfall)();
42
+ const beforeDevServer = (0, import_plugin.createParallelWorkflow)();
43
+ const setupCompiler = (0, import_plugin.createParallelWorkflow)();
44
+ const afterDevServer = (0, import_plugin.createParallelWorkflow)();
45
+ const beforeRouteSet = (0, import_plugin.createAsyncPipeline)();
46
+ const afterRouteSet = (0, import_plugin.createAsyncPipeline)();
47
+ const beforeProdServer = (0, import_plugin.createParallelWorkflow)();
48
+ const afterProdServer = (0, import_plugin.createParallelWorkflow)();
49
+ const listen = (0, import_plugin.createParallelWorkflow)();
50
+ const beforeServerReset = (0, import_plugin.createParallelWorkflow)();
51
+ const afterServerReset = (0, import_plugin.createParallelWorkflow)();
52
+ const extendSSRContext = (0, import_plugin.createAsyncWaterfall)();
53
+ const extendContext = (0, import_plugin.createAsyncPipeline)();
54
+ const handleError = (0, import_plugin.createParallelWorkflow)();
55
+ const beforeMatch = (0, import_plugin.createAsyncPipeline)();
56
+ const afterMatch = (0, import_plugin.createAsyncPipeline)();
57
+ const prefetch = (0, import_plugin.createParallelWorkflow)();
58
+ const renderToString = (0, import_plugin.createAsyncPipeline)();
59
+ const beforeRender = (0, import_plugin.createAsyncPipeline)();
60
+ const afterRender = (0, import_plugin.createAsyncPipeline)();
61
+ const beforeSend = (0, import_plugin.createAsyncPipeline)();
62
+ const afterSend = (0, import_plugin.createParallelWorkflow)();
63
+ const reset = (0, import_plugin.createParallelWorkflow)();
64
+ const AppContext = (0, import_plugin.createContext)({});
72
65
  const setAppContext = (value) => AppContext.set(value);
73
- const ConfigContext = (0, _plugin.createContext)({});
66
+ const ConfigContext = (0, import_plugin.createContext)({});
74
67
  const useConfigContext = () => ConfigContext.use().value;
75
68
  const useAppContext = () => AppContext.use().value;
76
69
  const pluginAPI = {
@@ -114,6 +107,17 @@ const serverHooks = {
114
107
  afterSend,
115
108
  reset
116
109
  };
117
- const createServerManager = () => (0, _plugin.createAsyncManager)(serverHooks, pluginAPI);
110
+ const createServerManager = () => (0, import_plugin.createAsyncManager)(serverHooks, pluginAPI);
118
111
  const serverManager = createServerManager();
119
112
  const { createPlugin } = serverManager;
113
+ // Annotate the CommonJS export names for ESM import in node:
114
+ 0 && (module.exports = {
115
+ AppContext,
116
+ ConfigContext,
117
+ createPlugin,
118
+ createServerManager,
119
+ serverManager,
120
+ setAppContext,
121
+ useAppContext,
122
+ useConfigContext
123
+ });
@@ -1,4 +1,16 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
+ var bff_exports = {};
16
+ module.exports = __toCommonJS(bff_exports);
@@ -1,4 +1,16 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
+ var dev_exports = {};
16
+ module.exports = __toCommonJS(dev_exports);
@@ -1,4 +1,16 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
+ var html_exports = {};
16
+ module.exports = __toCommonJS(html_exports);
@@ -1,11 +1,32 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
15
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
16
+ var config_exports = {};
17
+ module.exports = __toCommonJS(config_exports);
18
+ __reExport(config_exports, require("./bff"), module.exports);
19
+ __reExport(config_exports, require("./html"), module.exports);
20
+ __reExport(config_exports, require("./output"), module.exports);
21
+ __reExport(config_exports, require("./server"), module.exports);
22
+ __reExport(config_exports, require("./source"), module.exports);
23
+ __reExport(config_exports, require("./tools"), module.exports);
24
+ // Annotate the CommonJS export names for ESM import in node:
25
+ 0 && (module.exports = {
26
+ ...require("./bff"),
27
+ ...require("./html"),
28
+ ...require("./output"),
29
+ ...require("./server"),
30
+ ...require("./source"),
31
+ ...require("./tools")
4
32
  });
5
- const _export_star = require("@swc/helpers/_/_export_star");
6
- _export_star._(require("./bff"), exports);
7
- _export_star._(require("./html"), exports);
8
- _export_star._(require("./output"), exports);
9
- _export_star._(require("./server"), exports);
10
- _export_star._(require("./source"), exports);
11
- _export_star._(require("./tools"), exports);
@@ -1,4 +1,16 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
+ var output_exports = {};
16
+ module.exports = __toCommonJS(output_exports);
@@ -1,4 +1,16 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
+ var security_exports = {};
16
+ module.exports = __toCommonJS(security_exports);
@@ -1,4 +1,16 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
+ var server_exports = {};
16
+ module.exports = __toCommonJS(server_exports);
@@ -1,4 +1,16 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
+ var share_exports = {};
16
+ module.exports = __toCommonJS(share_exports);
@@ -1,4 +1,16 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
+ var source_exports = {};
16
+ module.exports = __toCommonJS(source_exports);
@@ -1,4 +1,16 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
+ var tools_exports = {};
16
+ module.exports = __toCommonJS(tools_exports);
@@ -14,7 +14,7 @@ const resolvePlugin = (p, appDirectory) => {
14
14
  module: createPlugin(pluginInstance.setup, pluginInstance)
15
15
  };
16
16
  };
17
- export const loadPlugins = (appDirectory, configPlugins, options) => {
17
+ const loadPlugins = (appDirectory, configPlugins, options) => {
18
18
  const loadedPlugins = getInternalPlugins(appDirectory, options.internalPlugins);
19
19
  return [
20
20
  ...loadedPlugins,
@@ -24,3 +24,6 @@ export const loadPlugins = (appDirectory, configPlugins, options) => {
24
24
  return module;
25
25
  });
26
26
  };
27
+ export {
28
+ loadPlugins
29
+ };
@@ -31,11 +31,11 @@ const afterRender = createAsyncPipeline();
31
31
  const beforeSend = createAsyncPipeline();
32
32
  const afterSend = createParallelWorkflow();
33
33
  const reset = createParallelWorkflow();
34
- export const AppContext = createContext({});
35
- export const setAppContext = (value) => AppContext.set(value);
36
- export const ConfigContext = createContext({});
37
- export const useConfigContext = () => ConfigContext.use().value;
38
- export const useAppContext = () => AppContext.use().value;
34
+ const AppContext = createContext({});
35
+ const setAppContext = (value) => AppContext.set(value);
36
+ const ConfigContext = createContext({});
37
+ const useConfigContext = () => ConfigContext.use().value;
38
+ const useAppContext = () => AppContext.use().value;
39
39
  const pluginAPI = {
40
40
  useAppContext,
41
41
  useConfigContext,
@@ -77,6 +77,16 @@ const serverHooks = {
77
77
  afterSend,
78
78
  reset
79
79
  };
80
- export const createServerManager = () => createAsyncManager(serverHooks, pluginAPI);
81
- export const serverManager = createServerManager();
82
- export const { createPlugin } = serverManager;
80
+ const createServerManager = () => createAsyncManager(serverHooks, pluginAPI);
81
+ const serverManager = createServerManager();
82
+ const { createPlugin } = serverManager;
83
+ export {
84
+ AppContext,
85
+ ConfigContext,
86
+ createPlugin,
87
+ createServerManager,
88
+ serverManager,
89
+ setAppContext,
90
+ useAppContext,
91
+ useConfigContext
92
+ };
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
package/package.json CHANGED
@@ -15,7 +15,7 @@
15
15
  "modern",
16
16
  "modern.js"
17
17
  ],
18
- "version": "2.35.1",
18
+ "version": "2.36.0",
19
19
  "jsnext:source": "./src/index.ts",
20
20
  "types": "./dist/types/index.d.ts",
21
21
  "main": "./dist/cjs/index.js",
@@ -33,8 +33,8 @@
33
33
  },
34
34
  "dependencies": {
35
35
  "@swc/helpers": "0.5.1",
36
- "@modern-js/utils": "2.35.1",
37
- "@modern-js/plugin": "2.35.1"
36
+ "@modern-js/plugin": "2.36.0",
37
+ "@modern-js/utils": "2.36.0"
38
38
  },
39
39
  "devDependencies": {
40
40
  "@types/jest": "^29",
@@ -43,10 +43,10 @@
43
43
  "jest": "^29",
44
44
  "ts-jest": "^29.1.0",
45
45
  "typescript": "^5",
46
- "@modern-js/babel-preset-app": "2.35.1",
47
- "@modern-js/types": "2.35.1",
48
- "@scripts/build": "2.35.1",
49
- "@scripts/jest-config": "2.35.1"
46
+ "@modern-js/babel-preset-app": "2.36.0",
47
+ "@modern-js/types": "2.36.0",
48
+ "@scripts/build": "2.36.0",
49
+ "@scripts/jest-config": "2.36.0"
50
50
  },
51
51
  "sideEffects": false,
52
52
  "publishConfig": {