@modern-js/plugin-garfish 2.15.0 → 2.17.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/CHANGELOG.md +23 -0
- package/dist/cjs/cli/index.js +224 -236
- package/dist/cjs/cli/utils.js +24 -48
- package/dist/cjs/deps/index.js +12 -35
- package/dist/cjs/index.js +26 -36
- package/dist/cjs/runtime/index.js +24 -44
- package/dist/cjs/runtime/loadable.js +46 -58
- package/dist/cjs/runtime/plugin.js +86 -82
- package/dist/cjs/runtime/useModuleApps.js +70 -56
- package/dist/cjs/runtime/utils/Context.js +18 -36
- package/dist/cjs/runtime/utils/MApp.js +88 -87
- package/dist/cjs/runtime/utils/apps.js +114 -94
- package/dist/cjs/runtime/utils/setExternal.js +23 -41
- package/dist/cjs/util.js +21 -40
- package/dist/esm/cli/index.js +409 -402
- package/dist/esm/cli/utils.js +25 -26
- package/dist/esm/deps/index.js +1 -2
- package/dist/esm/index.js +1 -2
- package/dist/esm/runtime/index.js +3 -4
- package/dist/esm/runtime/loadable.js +226 -210
- package/dist/esm/runtime/plugin.js +456 -426
- package/dist/esm/runtime/useModuleApps.js +49 -50
- package/dist/esm/runtime/utils/Context.js +1 -1
- package/dist/esm/runtime/utils/MApp.js +337 -316
- package/dist/esm/runtime/utils/apps.js +468 -442
- package/dist/esm/runtime/utils/setExternal.js +9 -9
- package/dist/esm/util.js +4 -5
- package/dist/esm-node/cli/index.js +209 -219
- package/dist/esm-node/cli/utils.js +15 -30
- package/dist/esm-node/deps/index.js +1 -4
- package/dist/esm-node/index.js +1 -4
- package/dist/esm-node/runtime/index.js +3 -10
- package/dist/esm-node/runtime/loadable.js +34 -31
- package/dist/esm-node/runtime/plugin.js +50 -33
- package/dist/esm-node/runtime/useModuleApps.js +12 -19
- package/dist/esm-node/runtime/utils/Context.js +2 -5
- package/dist/esm-node/runtime/utils/MApp.js +61 -40
- package/dist/esm-node/runtime/utils/apps.js +38 -44
- package/dist/esm-node/runtime/utils/setExternal.js +5 -5
- package/dist/esm-node/util.js +4 -9
- package/package.json +15 -11
|
@@ -1,42 +1,69 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __export = (target, all) => {
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
8
6
|
for (var name in all)
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
-
mod
|
|
26
|
-
));
|
|
27
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
-
var apps_exports = {};
|
|
29
|
-
__export(apps_exports, {
|
|
30
|
-
generateApps: () => generateApps,
|
|
31
|
-
pathJoin: () => pathJoin
|
|
7
|
+
Object.defineProperty(target, name, {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: all[name]
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
_export(exports, {
|
|
13
|
+
pathJoin: () => pathJoin,
|
|
14
|
+
generateApps: () => generateApps
|
|
32
15
|
});
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
16
|
+
const _jsxruntime = require("react/jsx-runtime");
|
|
17
|
+
const _react = /* @__PURE__ */ _interop_require_wildcard(require("react"));
|
|
18
|
+
const _runtime = require("@modern-js/runtime");
|
|
19
|
+
const _garfish = /* @__PURE__ */ _interop_require_default(require("garfish"));
|
|
20
|
+
const _util = require("../../util");
|
|
21
|
+
const _loadable = require("../loadable");
|
|
22
|
+
function _interop_require_default(obj) {
|
|
23
|
+
return obj && obj.__esModule ? obj : {
|
|
24
|
+
default: obj
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
function _getRequireWildcardCache(nodeInterop) {
|
|
28
|
+
if (typeof WeakMap !== "function")
|
|
29
|
+
return null;
|
|
30
|
+
var cacheBabelInterop = /* @__PURE__ */ new WeakMap();
|
|
31
|
+
var cacheNodeInterop = /* @__PURE__ */ new WeakMap();
|
|
32
|
+
return (_getRequireWildcardCache = function(nodeInterop2) {
|
|
33
|
+
return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
|
|
34
|
+
})(nodeInterop);
|
|
35
|
+
}
|
|
36
|
+
function _interop_require_wildcard(obj, nodeInterop) {
|
|
37
|
+
if (!nodeInterop && obj && obj.__esModule) {
|
|
38
|
+
return obj;
|
|
39
|
+
}
|
|
40
|
+
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
41
|
+
return {
|
|
42
|
+
default: obj
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
var cache = _getRequireWildcardCache(nodeInterop);
|
|
46
|
+
if (cache && cache.has(obj)) {
|
|
47
|
+
return cache.get(obj);
|
|
48
|
+
}
|
|
49
|
+
var newObj = {};
|
|
50
|
+
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
51
|
+
for (var key in obj) {
|
|
52
|
+
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
53
|
+
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
54
|
+
if (desc && (desc.get || desc.set)) {
|
|
55
|
+
Object.defineProperty(newObj, key, desc);
|
|
56
|
+
} else {
|
|
57
|
+
newObj[key] = obj[key];
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
newObj.default = obj;
|
|
62
|
+
if (cache) {
|
|
63
|
+
cache.set(obj, newObj);
|
|
64
|
+
}
|
|
65
|
+
return newObj;
|
|
66
|
+
}
|
|
40
67
|
function pathJoin(...args) {
|
|
41
68
|
const res = args.reduce((res2, path) => {
|
|
42
69
|
let nPath = path;
|
|
@@ -57,39 +84,38 @@ function pathJoin(...args) {
|
|
|
57
84
|
function getAppInstance(options, appInfo, manifest) {
|
|
58
85
|
let locationHref = "";
|
|
59
86
|
function MicroApp(props) {
|
|
60
|
-
var
|
|
61
|
-
const appRef = (0,
|
|
62
|
-
const domId = (0,
|
|
63
|
-
const [SubModuleComponent, setSubModuleComponent] = (0,
|
|
64
|
-
const context = (0,
|
|
65
|
-
const match =
|
|
66
|
-
const matchs =
|
|
67
|
-
const location =
|
|
68
|
-
let basename = (options
|
|
87
|
+
var _context_router, _context_router_useRouteMatch, _context_router1, _context_router_useMatches, _context_router2, _context_router_useLocation;
|
|
88
|
+
const appRef = (0, _react.useRef)(null);
|
|
89
|
+
const domId = (0, _util.generateSubAppContainerKey)(appInfo);
|
|
90
|
+
const [SubModuleComponent, setSubModuleComponent] = (0, _react.useState)();
|
|
91
|
+
const context = (0, _react.useContext)(_runtime.RuntimeReactContext);
|
|
92
|
+
const match = context === null || context === void 0 ? void 0 : (_context_router = context.router) === null || _context_router === void 0 ? void 0 : (_context_router_useRouteMatch = _context_router.useRouteMatch) === null || _context_router_useRouteMatch === void 0 ? void 0 : _context_router_useRouteMatch.call(_context_router);
|
|
93
|
+
const matchs = context === null || context === void 0 ? void 0 : (_context_router1 = context.router) === null || _context_router1 === void 0 ? void 0 : (_context_router_useMatches = _context_router1.useMatches) === null || _context_router_useMatches === void 0 ? void 0 : _context_router_useMatches.call(_context_router1);
|
|
94
|
+
const location = context === null || context === void 0 ? void 0 : (_context_router2 = context.router) === null || _context_router2 === void 0 ? void 0 : (_context_router_useLocation = _context_router2.useLocation) === null || _context_router_useLocation === void 0 ? void 0 : _context_router_useLocation.call(_context_router2);
|
|
95
|
+
let basename = (options === null || options === void 0 ? void 0 : options.basename) || "/";
|
|
69
96
|
if (matchs && matchs.length > 0) {
|
|
70
97
|
const matchItem = {
|
|
71
98
|
...matchs[matchs.length - 1]
|
|
72
99
|
};
|
|
73
100
|
for (const key in matchItem.params) {
|
|
74
|
-
matchItem.pathname = matchItem.pathname.replace(
|
|
75
|
-
new RegExp(`/${matchItem.params[key]}$`),
|
|
76
|
-
""
|
|
77
|
-
);
|
|
101
|
+
matchItem.pathname = matchItem.pathname.replace(new RegExp(`/${matchItem.params[key]}$`), "");
|
|
78
102
|
}
|
|
79
103
|
basename = pathJoin(basename, matchItem.pathname || "/");
|
|
80
104
|
} else if (match) {
|
|
81
|
-
basename = pathJoin(basename, (match
|
|
105
|
+
basename = pathJoin(basename, (match === null || match === void 0 ? void 0 : match.path) || "/");
|
|
82
106
|
}
|
|
83
|
-
(0,
|
|
84
|
-
if (location && locationHref !== location.pathname && !
|
|
107
|
+
(0, _react.useEffect)(() => {
|
|
108
|
+
if (location && locationHref !== location.pathname && !_garfish.default.running) {
|
|
85
109
|
locationHref = location.pathname;
|
|
86
110
|
const popStateEvent = new PopStateEvent("popstate");
|
|
87
111
|
popStateEvent.garfish = true;
|
|
88
112
|
dispatchEvent(popStateEvent);
|
|
89
|
-
(0,
|
|
113
|
+
(0, _util.logger)(`MicroApp Garfish.loadApp popstate`);
|
|
90
114
|
}
|
|
91
|
-
}, [
|
|
92
|
-
|
|
115
|
+
}, [
|
|
116
|
+
location
|
|
117
|
+
]);
|
|
118
|
+
(0, _react.useEffect)(() => {
|
|
93
119
|
const { setLoadingState, ...userProps } = props;
|
|
94
120
|
const loadAppOptions = {
|
|
95
121
|
...appInfo,
|
|
@@ -105,29 +131,24 @@ function getAppInstance(options, appInfo, manifest) {
|
|
|
105
131
|
...userProps
|
|
106
132
|
},
|
|
107
133
|
customLoader: (provider) => {
|
|
108
|
-
const {
|
|
109
|
-
|
|
110
|
-
destroy,
|
|
111
|
-
SubModuleComponent: SubModuleComponent2,
|
|
112
|
-
jupiter_submodule_app_key
|
|
113
|
-
} = provider;
|
|
114
|
-
const componetRenderMode = (manifest == null ? void 0 : manifest.componentRender) && (SubModuleComponent2 || jupiter_submodule_app_key);
|
|
134
|
+
const { render, destroy, SubModuleComponent: SubModuleComponent2, jupiter_submodule_app_key } = provider;
|
|
135
|
+
const componetRenderMode = (manifest === null || manifest === void 0 ? void 0 : manifest.componentRender) && (SubModuleComponent2 || jupiter_submodule_app_key);
|
|
115
136
|
return {
|
|
116
137
|
mount: (...props2) => {
|
|
117
138
|
if (componetRenderMode) {
|
|
118
139
|
setSubModuleComponent(SubModuleComponent2);
|
|
119
140
|
return void 0;
|
|
120
141
|
} else {
|
|
121
|
-
(0,
|
|
122
|
-
return render
|
|
142
|
+
(0, _util.logger)("MicroApp customer render", props2);
|
|
143
|
+
return render === null || render === void 0 ? void 0 : render.apply(provider, props2);
|
|
123
144
|
}
|
|
124
145
|
},
|
|
125
146
|
unmount(...props2) {
|
|
126
147
|
if (componetRenderMode) {
|
|
127
148
|
return void 0;
|
|
128
149
|
}
|
|
129
|
-
(0,
|
|
130
|
-
return destroy
|
|
150
|
+
(0, _util.logger)("MicroApp customer destroy", props2);
|
|
151
|
+
return destroy === null || destroy === void 0 ? void 0 : destroy.apply(provider, props2);
|
|
131
152
|
}
|
|
132
153
|
};
|
|
133
154
|
}
|
|
@@ -136,36 +157,31 @@ function getAppInstance(options, appInfo, manifest) {
|
|
|
136
157
|
isLoading: true,
|
|
137
158
|
error: null
|
|
138
159
|
});
|
|
139
|
-
(0,
|
|
160
|
+
(0, _util.logger)(`MicroApp Garfish.loadApp "${appInfo.name}"`, {
|
|
140
161
|
loadAppOptions
|
|
141
162
|
});
|
|
142
163
|
async function renderApp() {
|
|
143
164
|
try {
|
|
144
|
-
const appInstance = await
|
|
145
|
-
appInfo.name,
|
|
146
|
-
loadAppOptions
|
|
147
|
-
);
|
|
165
|
+
const appInstance = await _garfish.default.loadApp(appInfo.name, loadAppOptions);
|
|
148
166
|
if (!appInstance) {
|
|
149
|
-
throw new Error(
|
|
150
|
-
`MicroApp Garfish.loadApp "${appInfo.name}" result is null`
|
|
151
|
-
);
|
|
167
|
+
throw new Error(`MicroApp Garfish.loadApp "${appInfo.name}" result is null`);
|
|
152
168
|
}
|
|
153
169
|
appRef.current = appInstance;
|
|
154
170
|
setLoadingState({
|
|
155
171
|
isLoading: false
|
|
156
172
|
});
|
|
157
173
|
if (appInstance.mounted && appInstance.appInfo.cache) {
|
|
158
|
-
(0,
|
|
174
|
+
(0, _util.logger)(`MicroApp Garfish.loadApp "${appInfo.name}" show`, {
|
|
159
175
|
appInfo: appInstance.appInfo,
|
|
160
176
|
appInstance
|
|
161
177
|
});
|
|
162
|
-
await (appInstance
|
|
178
|
+
await (appInstance === null || appInstance === void 0 ? void 0 : appInstance.show());
|
|
163
179
|
} else {
|
|
164
|
-
(0,
|
|
180
|
+
(0, _util.logger)(`MicroApp Garfish.loadApp "${appInfo.name}" mount`, {
|
|
165
181
|
appInfo: appInstance.appInfo,
|
|
166
182
|
appInstance
|
|
167
183
|
});
|
|
168
|
-
await (appInstance
|
|
184
|
+
await (appInstance === null || appInstance === void 0 ? void 0 : appInstance.mount());
|
|
169
185
|
}
|
|
170
186
|
} catch (error) {
|
|
171
187
|
setLoadingState({
|
|
@@ -176,35 +192,39 @@ function getAppInstance(options, appInfo, manifest) {
|
|
|
176
192
|
}
|
|
177
193
|
renderApp();
|
|
178
194
|
return () => {
|
|
179
|
-
var _a2, _b2;
|
|
180
195
|
if (appRef.current) {
|
|
181
196
|
const { appInfo: appInfo2 } = appRef.current;
|
|
182
197
|
if (appInfo2.cache) {
|
|
183
|
-
|
|
184
|
-
(
|
|
198
|
+
var _appRef_current;
|
|
199
|
+
(0, _util.logger)(`MicroApp Garfish.loadApp "${appInfo2.name}" hide`);
|
|
200
|
+
(_appRef_current = appRef.current) === null || _appRef_current === void 0 ? void 0 : _appRef_current.hide();
|
|
185
201
|
} else {
|
|
186
|
-
|
|
187
|
-
(
|
|
202
|
+
var _appRef_current1;
|
|
203
|
+
(0, _util.logger)(`MicroApp Garfish.loadApp "${appInfo2.name}" unmount`);
|
|
204
|
+
(_appRef_current1 = appRef.current) === null || _appRef_current1 === void 0 ? void 0 : _appRef_current1.unmount();
|
|
188
205
|
}
|
|
189
206
|
}
|
|
190
207
|
};
|
|
191
208
|
}, []);
|
|
192
|
-
return /* @__PURE__ */ (0,
|
|
209
|
+
return /* @__PURE__ */ (0, _jsxruntime.jsx)(_jsxruntime.Fragment, {
|
|
210
|
+
children: /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
|
|
211
|
+
id: domId,
|
|
212
|
+
children: SubModuleComponent && /* @__PURE__ */ (0, _jsxruntime.jsx)(SubModuleComponent, {})
|
|
213
|
+
})
|
|
214
|
+
});
|
|
193
215
|
}
|
|
194
|
-
return (0,
|
|
216
|
+
return (0, _loadable.Loadable)(MicroApp)(manifest === null || manifest === void 0 ? void 0 : manifest.loadable);
|
|
195
217
|
}
|
|
196
218
|
function generateApps(options, manifest) {
|
|
197
|
-
var
|
|
219
|
+
var _options_apps;
|
|
198
220
|
const apps = {};
|
|
199
|
-
(
|
|
221
|
+
(_options_apps = options.apps) === null || _options_apps === void 0 ? void 0 : _options_apps.forEach((appInfo) => {
|
|
200
222
|
const Component = getAppInstance(options, appInfo, manifest);
|
|
201
223
|
appInfo.Component = Component;
|
|
202
224
|
apps[appInfo.name] = Component;
|
|
203
225
|
});
|
|
204
|
-
return {
|
|
226
|
+
return {
|
|
227
|
+
apps,
|
|
228
|
+
appInfoList: options.apps || []
|
|
229
|
+
};
|
|
205
230
|
}
|
|
206
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
207
|
-
0 && (module.exports = {
|
|
208
|
-
generateApps,
|
|
209
|
-
pathJoin
|
|
210
|
-
});
|
|
@@ -1,43 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
for (var name in all)
|
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
-
};
|
|
11
|
-
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
-
for (let key of __getOwnPropNames(from))
|
|
14
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
-
}
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
-
mod
|
|
26
|
-
));
|
|
27
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
-
var setExternal_exports = {};
|
|
29
|
-
__export(setExternal_exports, {
|
|
30
|
-
default: () => setExternal_default
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "default", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: () => _default
|
|
31
8
|
});
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
9
|
+
const _react = /* @__PURE__ */ _interop_require_default(require("react"));
|
|
10
|
+
const _reactdom = /* @__PURE__ */ _interop_require_default(require("react-dom"));
|
|
11
|
+
const _garfish = /* @__PURE__ */ _interop_require_default(require("garfish"));
|
|
12
|
+
const _util = require("../../util");
|
|
13
|
+
function _interop_require_default(obj) {
|
|
14
|
+
return obj && obj.__esModule ? obj : {
|
|
15
|
+
default: obj
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
const _default = () => {
|
|
19
|
+
(0, _util.logger)("setExternal ", {
|
|
20
|
+
react: _react.default,
|
|
21
|
+
"react-dom": _reactdom.default
|
|
22
|
+
});
|
|
23
|
+
_garfish.default.setExternal("react", _react.default);
|
|
24
|
+
_garfish.default.setExternal("react-dom", _reactdom.default);
|
|
41
25
|
};
|
|
42
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
43
|
-
0 && (module.exports = {});
|
package/dist/cjs/util.js
CHANGED
|
@@ -1,46 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __export = (target, all) => {
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
8
6
|
for (var name in all)
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
-
mod
|
|
26
|
-
));
|
|
27
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
-
var util_exports = {};
|
|
29
|
-
__export(util_exports, {
|
|
7
|
+
Object.defineProperty(target, name, {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: all[name]
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
_export(exports, {
|
|
13
|
+
logger: () => logger,
|
|
30
14
|
SUBMODULE_APP_COMPONENT_KEY: () => SUBMODULE_APP_COMPONENT_KEY,
|
|
31
|
-
generateSubAppContainerKey: () => generateSubAppContainerKey
|
|
32
|
-
logger: () => logger
|
|
15
|
+
generateSubAppContainerKey: () => generateSubAppContainerKey
|
|
33
16
|
});
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
17
|
+
const _debug = /* @__PURE__ */ _interop_require_default(require("debug"));
|
|
18
|
+
function _interop_require_default(obj) {
|
|
19
|
+
return obj && obj.__esModule ? obj : {
|
|
20
|
+
default: obj
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
const logger = (0, _debug.default)("modern-js:plugin-garfish");
|
|
37
24
|
const SUBMODULE_APP_COMPONENT_KEY = "SubModuleComponent";
|
|
38
25
|
function generateSubAppContainerKey(moduleInfo) {
|
|
39
|
-
return moduleInfo ? `modern_sub_app_container_${decodeURIComponent(moduleInfo
|
|
26
|
+
return moduleInfo ? `modern_sub_app_container_${decodeURIComponent(moduleInfo === null || moduleInfo === void 0 ? void 0 : moduleInfo.name)}` : "modern_sub_app_container";
|
|
40
27
|
}
|
|
41
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
42
|
-
0 && (module.exports = {
|
|
43
|
-
SUBMODULE_APP_COMPONENT_KEY,
|
|
44
|
-
generateSubAppContainerKey,
|
|
45
|
-
logger
|
|
46
|
-
});
|