@modern-js/plugin-garfish 2.35.1 → 2.37.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.
Files changed (40) hide show
  1. package/dist/cjs/cli/index.js +62 -63
  2. package/dist/cjs/cli/utils.js +31 -24
  3. package/dist/cjs/deps/index.js +35 -9
  4. package/dist/cjs/index.js +37 -10
  5. package/dist/cjs/runtime/index.js +43 -28
  6. package/dist/cjs/runtime/loadable.js +35 -18
  7. package/dist/cjs/runtime/plugin.js +62 -45
  8. package/dist/cjs/runtime/useModuleApps.js +43 -24
  9. package/dist/cjs/runtime/utils/Context.js +37 -18
  10. package/dist/cjs/runtime/utils/MApp.js +61 -35
  11. package/dist/cjs/runtime/utils/apps.js +61 -43
  12. package/dist/cjs/runtime/utils/setExternal.js +40 -18
  13. package/dist/cjs/util.js +39 -21
  14. package/dist/esm/cli/index.js +37 -40
  15. package/dist/esm/cli/utils.js +12 -5
  16. package/dist/esm/deps/index.js +4 -1
  17. package/dist/esm/index.js +4 -1
  18. package/dist/esm/runtime/index.js +10 -3
  19. package/dist/esm/runtime/loadable.js +8 -5
  20. package/dist/esm/runtime/plugin.js +13 -10
  21. package/dist/esm/runtime/useModuleApps.js +8 -4
  22. package/dist/esm/runtime/utils/Context.js +4 -1
  23. package/dist/esm/runtime/utils/MApp.js +8 -5
  24. package/dist/esm/runtime/utils/apps.js +12 -8
  25. package/dist/esm/runtime/utils/setExternal.js +4 -1
  26. package/dist/esm/util.js +8 -3
  27. package/dist/esm-node/cli/index.js +23 -25
  28. package/dist/esm-node/cli/utils.js +12 -5
  29. package/dist/esm-node/deps/index.js +4 -1
  30. package/dist/esm-node/index.js +4 -1
  31. package/dist/esm-node/runtime/index.js +10 -3
  32. package/dist/esm-node/runtime/loadable.js +4 -1
  33. package/dist/esm-node/runtime/plugin.js +4 -1
  34. package/dist/esm-node/runtime/useModuleApps.js +6 -2
  35. package/dist/esm-node/runtime/utils/Context.js +4 -1
  36. package/dist/esm-node/runtime/utils/MApp.js +4 -1
  37. package/dist/esm-node/runtime/utils/apps.js +6 -2
  38. package/dist/esm-node/runtime/utils/setExternal.js +4 -1
  39. package/dist/esm-node/util.js +8 -3
  40. package/package.json +10 -10
@@ -62,7 +62,7 @@ function _initOptions() {
62
62
  return [
63
63
  2,
64
64
  _object_spread_props(_object_spread({}, options), {
65
- apps: apps
65
+ apps
66
66
  })
67
67
  ];
68
68
  }
@@ -70,7 +70,7 @@ function _initOptions() {
70
70
  });
71
71
  return _initOptions.apply(this, arguments);
72
72
  }
73
- export default function(config) {
73
+ function plugin_default(config) {
74
74
  return {
75
75
  name: "@modern-js/garfish-plugin",
76
76
  setup: function() {
@@ -128,18 +128,18 @@ export default function(config) {
128
128
  GarfishInstance.registerApp(appInfoList);
129
129
  MApp = generateMApp(GarfishConfig, manifest);
130
130
  logger("initOptions result", {
131
- manifest: manifest,
132
- GarfishConfig: GarfishConfig
131
+ manifest,
132
+ GarfishConfig
133
133
  });
134
134
  logger("generateApps", {
135
- MApp: MApp,
136
- apps: apps,
137
- appInfoList: appInfoList
135
+ MApp,
136
+ apps,
137
+ appInfoList
138
138
  });
139
139
  _this1.setState({
140
- MApp: MApp,
141
- apps: apps,
142
- appInfoList: appInfoList
140
+ MApp,
141
+ apps,
142
+ appInfoList
143
143
  });
144
144
  return [
145
145
  2
@@ -177,3 +177,6 @@ export default function(config) {
177
177
  };
178
178
  }
179
179
  ;
180
+ export {
181
+ plugin_default as default
182
+ };
@@ -2,14 +2,14 @@ import { _ as _object_spread } from "@swc/helpers/_/_object_spread";
2
2
  import React, { useContext } from "react";
3
3
  import { logger } from "../util";
4
4
  import { GarfishContext } from "./utils/Context";
5
- export function useModuleApps() {
5
+ function useModuleApps() {
6
6
  var _useContext = useContext(GarfishContext), apps = _useContext.apps, MApp = _useContext.MApp, appInfoList = _useContext.appInfoList;
7
7
  logger("call useModuleApps", _object_spread({
8
- MApp: MApp,
8
+ MApp,
9
9
  apps: appInfoList
10
10
  }, apps));
11
11
  var Info = new Proxy(_object_spread({
12
- MApp: MApp,
12
+ MApp,
13
13
  apps: appInfoList
14
14
  }, apps), {
15
15
  get: function get(target, p, receiver) {
@@ -23,8 +23,12 @@ export function useModuleApps() {
23
23
  });
24
24
  return Info;
25
25
  }
26
- export function useModuleApp() {
26
+ function useModuleApp() {
27
27
  var MApp = useContext(GarfishContext).MApp;
28
28
  logger("call useModuleApps", MApp);
29
29
  return MApp;
30
30
  }
31
+ export {
32
+ useModuleApp,
33
+ useModuleApps
34
+ };
@@ -1,4 +1,7 @@
1
1
  import React from "react";
2
2
  var GarfishContext = /* @__PURE__ */ React.createContext(null);
3
3
  var GarfishProvider = GarfishContext.Provider;
4
- export { GarfishContext, GarfishProvider };
4
+ export {
5
+ GarfishContext,
6
+ GarfishProvider
7
+ };
@@ -12,7 +12,7 @@ import React from "react";
12
12
  import Garfish from "garfish";
13
13
  import { logger, generateSubAppContainerKey } from "../../util";
14
14
  import { Loadable } from "../loadable";
15
- export function generateMApp(options, manifest) {
15
+ function generateMApp(options, manifest) {
16
16
  var MApp = /* @__PURE__ */ function(_React_Component) {
17
17
  "use strict";
18
18
  _inherits(MApp2, _React_Component);
@@ -77,7 +77,7 @@ export function generateMApp(options, manifest) {
77
77
  logger("MApp errorLoadApp", error, args);
78
78
  if (appInfo.activeWhen) {
79
79
  setLoadingState({
80
- error: error
80
+ error
81
81
  });
82
82
  }
83
83
  return errorLoadApp === null || errorLoadApp === void 0 ? void 0 : errorLoadApp.apply(void 0, [
@@ -92,7 +92,7 @@ export function generateMApp(options, manifest) {
92
92
  logger("MApp errorMountApp", error, args);
93
93
  if (appInfo.activeWhen) {
94
94
  setLoadingState({
95
- error: error
95
+ error
96
96
  });
97
97
  }
98
98
  return errorMountApp === null || errorMountApp === void 0 ? void 0 : errorMountApp.apply(void 0, [
@@ -107,7 +107,7 @@ export function generateMApp(options, manifest) {
107
107
  logger("MApp errorUnmountApp", error, args);
108
108
  if (appInfo.activeWhen) {
109
109
  setLoadingState({
110
- error: error
110
+ error
111
111
  });
112
112
  }
113
113
  return errorUnmountApp === null || errorUnmountApp === void 0 ? void 0 : errorUnmountApp.apply(void 0, [
@@ -150,7 +150,7 @@ export function generateMApp(options, manifest) {
150
150
  };
151
151
  logger("MApp componentDidMount", {
152
152
  garfishRunning: Garfish.running,
153
- garfishOptions: garfishOptions
153
+ garfishOptions
154
154
  });
155
155
  if (!Garfish.running) {
156
156
  Garfish.run(garfishOptions);
@@ -193,3 +193,6 @@ export function generateMApp(options, manifest) {
193
193
  }(React.Component);
194
194
  return Loadable(MApp)(manifest === null || manifest === void 0 ? void 0 : manifest.loadable);
195
195
  }
196
+ export {
197
+ generateMApp
198
+ };
@@ -11,7 +11,7 @@ import { RuntimeReactContext } from "@modern-js/runtime";
11
11
  import Garfish from "garfish";
12
12
  import { logger, generateSubAppContainerKey } from "../../util";
13
13
  import { Loadable } from "../loadable";
14
- export function pathJoin() {
14
+ function pathJoin() {
15
15
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
16
16
  args[_key] = arguments[_key];
17
17
  }
@@ -71,7 +71,7 @@ function getAppInstance(options, appInfo, manifest) {
71
71
  "_SERVER_DATA"
72
72
  ]),
73
73
  domGetter: "#".concat(domId),
74
- basename: basename,
74
+ basename,
75
75
  cache: true,
76
76
  props: _object_spread({}, appInfo.props, userProps),
77
77
  customLoader: function(provider) {
@@ -108,7 +108,7 @@ function getAppInstance(options, appInfo, manifest) {
108
108
  error: null
109
109
  });
110
110
  logger('MicroApp Garfish.loadApp "'.concat(appInfo.name, '"'), {
111
- loadAppOptions: loadAppOptions
111
+ loadAppOptions
112
112
  });
113
113
  function renderApp() {
114
114
  return _renderApp.apply(this, arguments);
@@ -145,7 +145,7 @@ function getAppInstance(options, appInfo, manifest) {
145
145
  ];
146
146
  logger('MicroApp Garfish.loadApp "'.concat(appInfo.name, '" show'), {
147
147
  appInfo: appInstance.appInfo,
148
- appInstance: appInstance
148
+ appInstance
149
149
  });
150
150
  return [
151
151
  4,
@@ -160,7 +160,7 @@ function getAppInstance(options, appInfo, manifest) {
160
160
  case 3:
161
161
  logger('MicroApp Garfish.loadApp "'.concat(appInfo.name, '" mount'), {
162
162
  appInfo: appInstance.appInfo,
163
- appInstance: appInstance
163
+ appInstance
164
164
  });
165
165
  return [
166
166
  4,
@@ -178,7 +178,7 @@ function getAppInstance(options, appInfo, manifest) {
178
178
  error = _state.sent();
179
179
  setLoadingState({
180
180
  isLoading: true,
181
- error: error
181
+ error
182
182
  });
183
183
  return [
184
184
  3,
@@ -219,7 +219,7 @@ function getAppInstance(options, appInfo, manifest) {
219
219
  var locationHref = "";
220
220
  return Loadable(MicroApp)(manifest === null || manifest === void 0 ? void 0 : manifest.loadable);
221
221
  }
222
- export function generateApps(options, manifest) {
222
+ function generateApps(options, manifest) {
223
223
  var _options_apps;
224
224
  var apps = {};
225
225
  (_options_apps = options.apps) === null || _options_apps === void 0 ? void 0 : _options_apps.forEach(function(appInfo) {
@@ -228,7 +228,11 @@ export function generateApps(options, manifest) {
228
228
  apps[appInfo.name] = Component;
229
229
  });
230
230
  return {
231
- apps: apps,
231
+ apps,
232
232
  appInfoList: options.apps || []
233
233
  };
234
234
  }
235
+ export {
236
+ generateApps,
237
+ pathJoin
238
+ };
@@ -2,7 +2,7 @@ import React from "react";
2
2
  import ReactDOM from "react-dom";
3
3
  import garfish from "garfish";
4
4
  import { logger } from "../../util";
5
- export default function() {
5
+ function setExternal_default() {
6
6
  logger("setExternal ", {
7
7
  react: React,
8
8
  "react-dom": ReactDOM
@@ -11,3 +11,6 @@ export default function() {
11
11
  garfish.setExternal("react-dom", ReactDOM);
12
12
  }
13
13
  ;
14
+ export {
15
+ setExternal_default as default
16
+ };
package/dist/esm/util.js CHANGED
@@ -1,6 +1,11 @@
1
1
  import createDebug from "debug";
2
- export var logger = createDebug("modern-js:plugin-garfish");
3
- export var SUBMODULE_APP_COMPONENT_KEY = "SubModuleComponent";
4
- export function generateSubAppContainerKey(moduleInfo) {
2
+ var logger = createDebug("modern-js:plugin-garfish");
3
+ var SUBMODULE_APP_COMPONENT_KEY = "SubModuleComponent";
4
+ function generateSubAppContainerKey(moduleInfo) {
5
5
  return moduleInfo ? "modern_sub_app_container_".concat(decodeURIComponent(moduleInfo === null || moduleInfo === void 0 ? void 0 : moduleInfo.name)) : "modern_sub_app_container";
6
6
  }
7
+ export {
8
+ SUBMODULE_APP_COMPONENT_KEY,
9
+ generateSubAppContainerKey,
10
+ logger
11
+ };
@@ -1,11 +1,11 @@
1
1
  import { createRuntimeExportsUtils } from "@modern-js/utils";
2
2
  import { logger } from "../util";
3
3
  import { getRuntimeConfig, makeProvider, makeRenderFunction, setRuntimeConfig, generateAsyncEntry } from "./utils";
4
- export const externals = {
4
+ const externals = {
5
5
  "react-dom": "react-dom",
6
6
  react: "react"
7
7
  };
8
- export function getDefaultMicroFrontedConfig(microFrontend) {
8
+ function getDefaultMicroFrontedConfig(microFrontend) {
9
9
  if (microFrontend === true) {
10
10
  return {
11
11
  enableHtmlEntry: true,
@@ -19,7 +19,7 @@ export function getDefaultMicroFrontedConfig(microFrontend) {
19
19
  ...microFrontend
20
20
  };
21
21
  }
22
- export const garfishPlugin = ({ pluginName = "@modern-js/plugin-garfish", runtimePluginName = "@modern-js/runtime/plugins" } = {}) => ({
22
+ const garfishPlugin = ({ pluginName = "@modern-js/plugin-garfish", runtimePluginName = "@modern-js/runtime/plugins" } = {}) => ({
23
23
  name: "@modern-js/plugin-garfish",
24
24
  setup: ({ useAppContext, useResolvedConfigContext, useConfigContext }) => {
25
25
  let pluginsExportsUtils;
@@ -113,15 +113,6 @@ export const garfishPlugin = ({ pluginName = "@modern-js/plugin-garfish", runtim
113
113
  "Access-Control-Allow-Origin": "*"
114
114
  }
115
115
  },
116
- webpackChain: (chain, { webpack, CHAIN_ID }) => {
117
- if (webpack.BannerPlugin) {
118
- chain.plugin(CHAIN_ID.PLUGIN.BANNER).use(webpack.BannerPlugin, [
119
- {
120
- banner: "Micro front-end"
121
- }
122
- ]);
123
- }
124
- },
125
116
  rspack: (config2) => {
126
117
  var _resolveOptions_deploy;
127
118
  var _config;
@@ -131,23 +122,24 @@ export const garfishPlugin = ({ pluginName = "@modern-js/plugin-garfish", runtim
131
122
  if ((resolveOptions === null || resolveOptions === void 0 ? void 0 : (_resolveOptions_deploy = resolveOptions.deploy) === null || _resolveOptions_deploy === void 0 ? void 0 : _resolveOptions_deploy.microFrontend) && !config2.externalsType) {
132
123
  config2.externalsType = "commonjs";
133
124
  }
134
- const banner = config2.builtins.banner || [];
135
- config2.builtins.banner = [
136
- ...Array.isArray(banner) ? banner : [
137
- banner
138
- ],
139
- {
140
- banner: "Micro front-end"
141
- }
142
- ];
143
125
  },
144
- bundlerChain: (chain, { env, CHAIN_ID }) => {
126
+ bundlerChain: (chain, { env, CHAIN_ID, bundler }) => {
145
127
  var _resolveOptions_deploy, _resolveConfig_resolve;
128
+ if (bundler.BannerPlugin) {
129
+ chain.plugin(CHAIN_ID.PLUGIN.BANNER).use(bundler.BannerPlugin, [
130
+ {
131
+ banner: "Micro front-end"
132
+ }
133
+ ]);
134
+ }
146
135
  const resolveOptions = useResolvedConfigContext();
147
136
  if (resolveOptions === null || resolveOptions === void 0 ? void 0 : (_resolveOptions_deploy = resolveOptions.deploy) === null || _resolveOptions_deploy === void 0 ? void 0 : _resolveOptions_deploy.microFrontend) {
148
- var _useConfig_dev, _resolveOptions_server, _resolveOptions_deploy1;
137
+ var _resolveOptions_dev, _useConfig_dev, _resolveOptions_server, _resolveOptions_deploy1;
149
138
  chain.output.libraryTarget("umd");
150
- if (!((_useConfig_dev = useConfig.dev) === null || _useConfig_dev === void 0 ? void 0 : _useConfig_dev.assetPrefix) && (resolveOptions === null || resolveOptions === void 0 ? void 0 : (_resolveOptions_server = resolveOptions.server) === null || _resolveOptions_server === void 0 ? void 0 : _resolveOptions_server.port) && env === "development") {
139
+ const DEFAULT_ASSET_PREFIX = "/";
140
+ const resolvedAssetPrefix = (_resolveOptions_dev = resolveOptions.dev) === null || _resolveOptions_dev === void 0 ? void 0 : _resolveOptions_dev.assetPrefix;
141
+ const isUsingDefaultAssetPrefix = !((_useConfig_dev = useConfig.dev) === null || _useConfig_dev === void 0 ? void 0 : _useConfig_dev.assetPrefix) && (!resolvedAssetPrefix || resolvedAssetPrefix === DEFAULT_ASSET_PREFIX);
142
+ if (isUsingDefaultAssetPrefix && (resolveOptions === null || resolveOptions === void 0 ? void 0 : (_resolveOptions_server = resolveOptions.server) === null || _resolveOptions_server === void 0 ? void 0 : _resolveOptions_server.port) && env === "development") {
151
143
  chain.output.publicPath(`//localhost:${resolveOptions.server.port}/`);
152
144
  }
153
145
  const { enableHtmlEntry, externalBasicLibrary } = getDefaultMicroFrontedConfig((_resolveOptions_deploy1 = resolveOptions.deploy) === null || _resolveOptions_deploy1 === void 0 ? void 0 : _resolveOptions_deploy1.microFrontend);
@@ -303,4 +295,10 @@ export const garfishPlugin = ({ pluginName = "@modern-js/plugin-garfish", runtim
303
295
  };
304
296
  }
305
297
  });
306
- export default garfishPlugin;
298
+ var cli_default = garfishPlugin;
299
+ export {
300
+ cli_default as default,
301
+ externals,
302
+ garfishPlugin,
303
+ getDefaultMicroFrontedConfig
304
+ };
@@ -1,4 +1,4 @@
1
- export const makeProvider = () => `
1
+ const makeProvider = () => `
2
2
  export const provider = function ({basename, dom}) {
3
3
  return {
4
4
  render({basename, dom, props, appName}) {
@@ -76,7 +76,7 @@ function generateRootDom ({ dom, props, basename }) {
76
76
  return { mountNode, props: mergedProps }
77
77
  }
78
78
  `;
79
- export const makeRenderFunction = (code) => {
79
+ const makeRenderFunction = (code) => {
80
80
  const inGarfishToRender = `
81
81
  let { basename, props, dom, appName } = typeof arguments[0] === 'object' && arguments[0] || {};
82
82
  if (!canContinueRender({ dom, appName })) return null;
@@ -86,7 +86,7 @@ export const makeRenderFunction = (code) => {
86
86
  `;
87
87
  return inGarfishToRender + code.replace(`router(`, `generateRouterPlugin(basename,`).replace(/MOUNT_ID/g, "mountNode").replace(`createApp({`, "createApp({ props,").replace(`bootstrap(AppWrapper, mountNode, root`, "bootstrap(AppWrapper, mountNode, root = IS_REACT18 ? ReactDOM.createRoot(mountNode) : null").replace(`customBootstrap(AppWrapper`, "customBootstrap(AppWrapper, mountNode");
88
88
  };
89
- export function getRuntimeConfig(config) {
89
+ function getRuntimeConfig(config) {
90
90
  var _config_runtime;
91
91
  if (config === null || config === void 0 ? void 0 : (_config_runtime = config.runtime) === null || _config_runtime === void 0 ? void 0 : _config_runtime.features) {
92
92
  var _config_runtime1;
@@ -94,7 +94,7 @@ export function getRuntimeConfig(config) {
94
94
  }
95
95
  return (config === null || config === void 0 ? void 0 : config.runtime) || {};
96
96
  }
97
- export function setRuntimeConfig(config, key, value) {
97
+ function setRuntimeConfig(config, key, value) {
98
98
  var _config_runtime, _config_runtime1;
99
99
  if ((config === null || config === void 0 ? void 0 : (_config_runtime = config.runtime) === null || _config_runtime === void 0 ? void 0 : _config_runtime.features) && (config === null || config === void 0 ? void 0 : (_config_runtime1 = config.runtime) === null || _config_runtime1 === void 0 ? void 0 : _config_runtime1.features[key])) {
100
100
  config.runtime.features[key] = value;
@@ -106,7 +106,7 @@ export function setRuntimeConfig(config, key, value) {
106
106
  }
107
107
  return void 0;
108
108
  }
109
- export const generateAsyncEntry = (code) => {
109
+ const generateAsyncEntry = (code) => {
110
110
  const transformCode = code.replace(`import('./bootstrap.jsx');`, `if (!window.__GARFISH__) { import('./bootstrap.jsx'); }`);
111
111
  return `
112
112
  export const provider = async (...args) => {
@@ -119,3 +119,10 @@ export const generateAsyncEntry = (code) => {
119
119
  }
120
120
  `;
121
121
  };
122
+ export {
123
+ generateAsyncEntry,
124
+ getRuntimeConfig,
125
+ makeProvider,
126
+ makeRenderFunction,
127
+ setRuntimeConfig
128
+ };
@@ -1 +1,4 @@
1
- export { default as hoistNonReactStatics } from "hoist-non-react-statics";
1
+ import { default as default2 } from "hoist-non-react-statics";
2
+ export {
3
+ default2 as hoistNonReactStatics
4
+ };
@@ -1,2 +1,5 @@
1
- export { default } from "./runtime";
1
+ import { default as default2 } from "./runtime";
2
2
  export * from "./runtime";
3
+ export {
4
+ default2 as default
5
+ };
@@ -1,3 +1,10 @@
1
- export { default } from "./plugin";
2
- export { useModuleApps, useModuleApp } from "./useModuleApps";
3
- export { default as Garfish, default as garfish } from "garfish";
1
+ import { default as default2 } from "./plugin";
2
+ import { useModuleApps, useModuleApp } from "./useModuleApps";
3
+ import { default as default3, default as default4 } from "garfish";
4
+ export {
5
+ default3 as Garfish,
6
+ default2 as default,
7
+ default4 as garfish,
8
+ useModuleApp,
9
+ useModuleApps
10
+ };
@@ -6,7 +6,7 @@ const DEFAULT_LOADABLE = {
6
6
  timeout: 1e4,
7
7
  loading: null
8
8
  };
9
- export function Loadable(WrapComponent) {
9
+ function Loadable(WrapComponent) {
10
10
  return function(defaultLoadable) {
11
11
  return function Lodable(props) {
12
12
  var _props_loadable;
@@ -109,3 +109,6 @@ export function Loadable(WrapComponent) {
109
109
  };
110
110
  };
111
111
  }
112
+ export {
113
+ Loadable
114
+ };
@@ -34,7 +34,7 @@ async function initOptions(manifest = {}, options) {
34
34
  apps
35
35
  };
36
36
  }
37
- export default (config) => ({
37
+ var plugin_default = (config) => ({
38
38
  name: "@modern-js/garfish-plugin",
39
39
  setup: () => {
40
40
  setExternal();
@@ -105,3 +105,6 @@ export default (config) => ({
105
105
  };
106
106
  }
107
107
  });
108
+ export {
109
+ plugin_default as default
110
+ };
@@ -1,7 +1,7 @@
1
1
  import React, { useContext } from "react";
2
2
  import { logger } from "../util";
3
3
  import { GarfishContext } from "./utils/Context";
4
- export function useModuleApps() {
4
+ function useModuleApps() {
5
5
  const { apps, MApp, appInfoList } = useContext(GarfishContext);
6
6
  logger("call useModuleApps", {
7
7
  MApp,
@@ -22,8 +22,12 @@ export function useModuleApps() {
22
22
  });
23
23
  return Info;
24
24
  }
25
- export function useModuleApp() {
25
+ function useModuleApp() {
26
26
  const { MApp } = useContext(GarfishContext);
27
27
  logger("call useModuleApps", MApp);
28
28
  return MApp;
29
29
  }
30
+ export {
31
+ useModuleApp,
32
+ useModuleApps
33
+ };
@@ -1,4 +1,7 @@
1
1
  import React from "react";
2
2
  const GarfishContext = /* @__PURE__ */ React.createContext(null);
3
3
  const GarfishProvider = GarfishContext.Provider;
4
- export { GarfishContext, GarfishProvider };
4
+ export {
5
+ GarfishContext,
6
+ GarfishProvider
7
+ };
@@ -4,7 +4,7 @@ import React from "react";
4
4
  import Garfish from "garfish";
5
5
  import { logger, generateSubAppContainerKey } from "../../util";
6
6
  import { Loadable } from "../loadable";
7
- export function generateMApp(options, manifest) {
7
+ function generateMApp(options, manifest) {
8
8
  class MApp extends React.Component {
9
9
  componentDidMount() {
10
10
  const { domId } = this.state;
@@ -140,3 +140,6 @@ export function generateMApp(options, manifest) {
140
140
  }
141
141
  return Loadable(MApp)(manifest === null || manifest === void 0 ? void 0 : manifest.loadable);
142
142
  }
143
+ export {
144
+ generateMApp
145
+ };
@@ -4,7 +4,7 @@ import { RuntimeReactContext } from "@modern-js/runtime";
4
4
  import Garfish from "garfish";
5
5
  import { logger, generateSubAppContainerKey } from "../../util";
6
6
  import { Loadable } from "../loadable";
7
- export function pathJoin(...args) {
7
+ function pathJoin(...args) {
8
8
  const res = args.reduce((res2, path) => {
9
9
  let nPath = path;
10
10
  if (!nPath || typeof nPath !== "string") {
@@ -155,7 +155,7 @@ function getAppInstance(options, appInfo, manifest) {
155
155
  }
156
156
  return Loadable(MicroApp)(manifest === null || manifest === void 0 ? void 0 : manifest.loadable);
157
157
  }
158
- export function generateApps(options, manifest) {
158
+ function generateApps(options, manifest) {
159
159
  var _options_apps;
160
160
  const apps = {};
161
161
  (_options_apps = options.apps) === null || _options_apps === void 0 ? void 0 : _options_apps.forEach((appInfo) => {
@@ -168,3 +168,7 @@ export function generateApps(options, manifest) {
168
168
  appInfoList: options.apps || []
169
169
  };
170
170
  }
171
+ export {
172
+ generateApps,
173
+ pathJoin
174
+ };
@@ -2,7 +2,7 @@ import React from "react";
2
2
  import ReactDOM from "react-dom";
3
3
  import garfish from "garfish";
4
4
  import { logger } from "../../util";
5
- export default () => {
5
+ var setExternal_default = () => {
6
6
  logger("setExternal ", {
7
7
  react: React,
8
8
  "react-dom": ReactDOM
@@ -10,3 +10,6 @@ export default () => {
10
10
  garfish.setExternal("react", React);
11
11
  garfish.setExternal("react-dom", ReactDOM);
12
12
  };
13
+ export {
14
+ setExternal_default as default
15
+ };
@@ -1,6 +1,11 @@
1
1
  import createDebug from "debug";
2
- export const logger = createDebug("modern-js:plugin-garfish");
3
- export const SUBMODULE_APP_COMPONENT_KEY = "SubModuleComponent";
4
- export function generateSubAppContainerKey(moduleInfo) {
2
+ const logger = createDebug("modern-js:plugin-garfish");
3
+ const SUBMODULE_APP_COMPONENT_KEY = "SubModuleComponent";
4
+ function generateSubAppContainerKey(moduleInfo) {
5
5
  return moduleInfo ? `modern_sub_app_container_${decodeURIComponent(moduleInfo === null || moduleInfo === void 0 ? void 0 : moduleInfo.name)}` : "modern_sub_app_container";
6
6
  }
7
+ export {
8
+ SUBMODULE_APP_COMPONENT_KEY,
9
+ generateSubAppContainerKey,
10
+ logger
11
+ };
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.37.0",
19
19
  "jsnext:source": "./src/cli/index.ts",
20
20
  "types": "./dist/types/cli/index.d.ts",
21
21
  "typesVersions": {
@@ -70,10 +70,10 @@
70
70
  "hoist-non-react-statics": "^3.3.2",
71
71
  "react-loadable": "^5.5.0",
72
72
  "@swc/helpers": "0.5.1",
73
- "@modern-js/utils": "2.35.1"
73
+ "@modern-js/utils": "2.37.0"
74
74
  },
75
75
  "peerDependencies": {
76
- "@modern-js/runtime": "^2.35.1",
76
+ "@modern-js/runtime": "^2.37.0",
77
77
  "react": ">=17",
78
78
  "react-dom": ">=17"
79
79
  },
@@ -91,13 +91,13 @@
91
91
  "react-dom": "^18",
92
92
  "react-router-dom": "^6.8.1",
93
93
  "typescript": "^5",
94
- "@modern-js/app-tools": "2.35.1",
95
- "@modern-js/core": "2.35.1",
96
- "@modern-js/plugin-router-v5": "2.35.1",
97
- "@modern-js/runtime": "2.35.1",
98
- "@modern-js/types": "2.35.1",
99
- "@scripts/build": "2.35.1",
100
- "@scripts/jest-config": "2.35.1"
94
+ "@modern-js/app-tools": "2.37.0",
95
+ "@modern-js/plugin-router-v5": "2.37.0",
96
+ "@modern-js/core": "2.37.0",
97
+ "@modern-js/runtime": "2.37.0",
98
+ "@modern-js/types": "2.37.0",
99
+ "@scripts/build": "2.37.0",
100
+ "@scripts/jest-config": "2.37.0"
101
101
  },
102
102
  "sideEffects": false,
103
103
  "publishConfig": {