@modern-js/plugin-garfish 2.59.0 → 2.60.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/cli/template.js +2 -2
- package/dist/cjs/runtime/plugin.js +1 -2
- package/dist/cjs/runtime/utils/MApp.js +1 -2
- package/dist/esm/cli/index.js +2 -1
- package/dist/esm/cli/template.js +1 -1
- package/dist/esm/runtime/plugin.js +5 -6
- package/dist/esm/runtime/utils/MApp.js +2 -4
- package/dist/esm-node/cli/template.js +2 -2
- package/dist/esm-node/runtime/plugin.js +1 -2
- package/dist/esm-node/runtime/utils/MApp.js +1 -2
- package/package.json +13 -13
package/dist/cjs/cli/template.js
CHANGED
|
@@ -22,8 +22,8 @@ __export(template_exports, {
|
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(template_exports);
|
|
24
24
|
var import_utils = require("@modern-js/utils");
|
|
25
|
-
const genRenderCode = ({ srcDirectory, internalSrcAlias, metaName, entry, customEntry, customBootstrap, mountId }) => customEntry ? `import '${entry.replace(srcDirectory, internalSrcAlias)}'
|
|
26
|
-
export * from '${entry.replace(srcDirectory, internalSrcAlias)}'` : `import { createRoot } from '@${metaName}/runtime/react';
|
|
25
|
+
const genRenderCode = ({ srcDirectory, internalSrcAlias, metaName, entry, customEntry, customBootstrap, mountId }) => customEntry ? `import '${(0, import_utils.formatImportPath)(entry.replace(srcDirectory, internalSrcAlias))}'
|
|
26
|
+
export * from '${(0, import_utils.formatImportPath)(entry.replace(srcDirectory, internalSrcAlias))}'` : `import { createRoot } from '@${metaName}/runtime/react';
|
|
27
27
|
import { render } from '@${metaName}/runtime/browser';
|
|
28
28
|
import { isRenderGarfish, createProvider } from '@${metaName}/plugin-garfish/tools';
|
|
29
29
|
${customBootstrap ? `import customBootstrap from '${(0, import_utils.formatImportPath)(customBootstrap.replace(srcDirectory, internalSrcAlias))}';` : "let customBootstrap;"}
|
|
@@ -89,8 +89,7 @@ const garfishPlugin = (userConfig = {}) => ({
|
|
|
89
89
|
});
|
|
90
90
|
}
|
|
91
91
|
constructor(props) {
|
|
92
|
-
super(props)
|
|
93
|
-
this.state = {
|
|
92
|
+
super(props), this.state = {
|
|
94
93
|
MApp: () => {
|
|
95
94
|
(0, import_util.logger)("MApp init Component Render");
|
|
96
95
|
return /* @__PURE__ */ import_react.default.createElement("div");
|
package/dist/esm/cli/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
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 _object_spread } from "@swc/helpers/_/_object_spread";
|
|
4
|
+
import { _ as _type_of } from "@swc/helpers/_/_type_of";
|
|
4
5
|
import { _ as _ts_generator } from "@swc/helpers/_/_ts_generator";
|
|
5
6
|
import { createAsyncWorkflow } from "@modern-js/plugin";
|
|
6
7
|
import { createRuntimeExportsUtils, getEntryOptions } from "@modern-js/utils";
|
|
@@ -69,7 +70,7 @@ var garfishPlugin = function() {
|
|
|
69
70
|
if (Array.isArray(baseUrl)) {
|
|
70
71
|
throw new Error("Now Micro-Front-End mode dose not support multiple baseUrl, you can set it as a string");
|
|
71
72
|
}
|
|
72
|
-
setRuntimeConfig(nConfig.resolved, "masterApp", Object.assign(typeof masterApp === "object" ? _object_spread({}, masterApp) : {}, {
|
|
73
|
+
setRuntimeConfig(nConfig.resolved, "masterApp", Object.assign((typeof masterApp === "undefined" ? "undefined" : _type_of(masterApp)) === "object" ? _object_spread({}, masterApp) : {}, {
|
|
73
74
|
basename: baseUrl || (router === null || router === void 0 ? void 0 : (_router_historyOptions = router.historyOptions) === null || _router_historyOptions === void 0 ? void 0 : _router_historyOptions.basename) || (router === null || router === void 0 ? void 0 : router.basename) || "/"
|
|
74
75
|
}));
|
|
75
76
|
}
|
package/dist/esm/cli/template.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { formatImportPath } from "@modern-js/utils";
|
|
2
2
|
var genRenderCode = function(param) {
|
|
3
3
|
var srcDirectory = param.srcDirectory, internalSrcAlias = param.internalSrcAlias, metaName = param.metaName, entry = param.entry, customEntry = param.customEntry, customBootstrap = param.customBootstrap, mountId = param.mountId;
|
|
4
|
-
return customEntry ? "import '".concat(entry.replace(srcDirectory, internalSrcAlias), "'\nexport * from '").concat(entry.replace(srcDirectory, internalSrcAlias), "'") : "import { createRoot } from '@".concat(metaName, "/runtime/react';\nimport { render } from '@").concat(metaName, "/runtime/browser';\nimport { isRenderGarfish, createProvider } from '@").concat(metaName, "/plugin-garfish/tools';\n").concat(customBootstrap ? "import customBootstrap from '".concat(formatImportPath(customBootstrap.replace(srcDirectory, internalSrcAlias)), "';") : "let customBootstrap;", "\nif (!isRenderGarfish()) {\n const ModernRoot = createRoot();\n ").concat(customBootstrap ? "customBootstrap(ModernRoot, () => render(<ModernRoot />, '".concat(mountId || "root", "'));") : "render(<ModernRoot />, '".concat(mountId || "root", "');"), ";\n}\n\nexport const provider = createProvider('").concat(mountId || "root", "', { customBootstrap });\n");
|
|
4
|
+
return customEntry ? "import '".concat(formatImportPath(entry.replace(srcDirectory, internalSrcAlias)), "'\nexport * from '").concat(formatImportPath(entry.replace(srcDirectory, internalSrcAlias)), "'") : "import { createRoot } from '@".concat(metaName, "/runtime/react';\nimport { render } from '@").concat(metaName, "/runtime/browser';\nimport { isRenderGarfish, createProvider } from '@").concat(metaName, "/plugin-garfish/tools';\n").concat(customBootstrap ? "import customBootstrap from '".concat(formatImportPath(customBootstrap.replace(srcDirectory, internalSrcAlias)), "';") : "let customBootstrap;", "\nif (!isRenderGarfish()) {\n const ModernRoot = createRoot();\n ").concat(customBootstrap ? "customBootstrap(ModernRoot, () => render(<ModernRoot />, '".concat(mountId || "root", "'));") : "render(<ModernRoot />, '".concat(mountId || "root", "');"), ";\n}\n\nexport const provider = createProvider('").concat(mountId || "root", "', { customBootstrap });\n");
|
|
5
5
|
};
|
|
6
6
|
var index = function(param) {
|
|
7
7
|
var srcDirectory = param.srcDirectory, internalSrcAlias = param.internalSrcAlias, metaName = param.metaName, entry = param.entry, entryName = param.entryName, customEntry = param.customEntry, customBootstrap = param.customBootstrap, mountId = param.mountId, _param_appendCode = param.appendCode, appendCode = _param_appendCode === void 0 ? [] : _param_appendCode;
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import { _ as _assert_this_initialized } from "@swc/helpers/_/_assert_this_initialized";
|
|
2
1
|
import { _ as _async_to_generator } from "@swc/helpers/_/_async_to_generator";
|
|
2
|
+
import { _ as _call_super } from "@swc/helpers/_/_call_super";
|
|
3
3
|
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
|
|
4
4
|
import { _ as _inherits } from "@swc/helpers/_/_inherits";
|
|
5
5
|
import { _ as _object_spread } from "@swc/helpers/_/_object_spread";
|
|
6
6
|
import { _ as _object_spread_props } from "@swc/helpers/_/_object_spread_props";
|
|
7
7
|
import { _ as _object_without_properties } from "@swc/helpers/_/_object_without_properties";
|
|
8
8
|
import { _ as _to_consumable_array } from "@swc/helpers/_/_to_consumable_array";
|
|
9
|
-
import { _ as _create_super } from "@swc/helpers/_/_create_super";
|
|
10
9
|
import { _ as _ts_generator } from "@swc/helpers/_/_ts_generator";
|
|
11
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
11
|
import { merge } from "@modern-js/runtime-utils/merge";
|
|
@@ -86,12 +85,13 @@ var garfishPlugin = function() {
|
|
|
86
85
|
var GetMicroFrontendApp = /* @__PURE__ */ function(_React_Component) {
|
|
87
86
|
"use strict";
|
|
88
87
|
_inherits(GetMicroFrontendApp2, _React_Component);
|
|
89
|
-
var _super = _create_super(GetMicroFrontendApp2);
|
|
90
88
|
function GetMicroFrontendApp2(props) {
|
|
91
89
|
_class_call_check(this, GetMicroFrontendApp2);
|
|
92
90
|
var _this;
|
|
93
|
-
|
|
94
|
-
_this
|
|
91
|
+
var _this1;
|
|
92
|
+
_this = _call_super(this, GetMicroFrontendApp2, [
|
|
93
|
+
props
|
|
94
|
+
]), _this1 = _this, _this.state = {
|
|
95
95
|
MApp: function() {
|
|
96
96
|
logger("MApp init Component Render");
|
|
97
97
|
return /* @__PURE__ */ React.createElement("div");
|
|
@@ -105,7 +105,6 @@ var garfishPlugin = function() {
|
|
|
105
105
|
}),
|
|
106
106
|
appInfoList: []
|
|
107
107
|
};
|
|
108
|
-
var _this1 = _assert_this_initialized(_this);
|
|
109
108
|
var load = function() {
|
|
110
109
|
var _ref = _async_to_generator(function() {
|
|
111
110
|
var GarfishConfig, _generateApps, appInfoList, apps, MApp;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import { _ as _call_super } from "@swc/helpers/_/_call_super";
|
|
1
2
|
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
|
|
2
3
|
import { _ as _inherits } from "@swc/helpers/_/_inherits";
|
|
3
4
|
import { _ as _object_spread } from "@swc/helpers/_/_object_spread";
|
|
4
5
|
import { _ as _object_without_properties } from "@swc/helpers/_/_object_without_properties";
|
|
5
6
|
import { _ as _to_consumable_array } from "@swc/helpers/_/_to_consumable_array";
|
|
6
|
-
import { _ as _create_super } from "@swc/helpers/_/_create_super";
|
|
7
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
8
|
import Garfish from "garfish";
|
|
9
9
|
import React from "react";
|
|
@@ -13,12 +13,10 @@ function generateMApp(options, manifest) {
|
|
|
13
13
|
var MApp = /* @__PURE__ */ function(_React_Component) {
|
|
14
14
|
"use strict";
|
|
15
15
|
_inherits(MApp2, _React_Component);
|
|
16
|
-
var _super = _create_super(MApp2);
|
|
17
16
|
function MApp2() {
|
|
18
17
|
_class_call_check(this, MApp2);
|
|
19
18
|
var _this;
|
|
20
|
-
_this =
|
|
21
|
-
_this.state = {
|
|
19
|
+
_this = _call_super(this, MApp2, arguments), _this.state = {
|
|
22
20
|
domId: generateSubAppContainerKey()
|
|
23
21
|
};
|
|
24
22
|
return _this;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { formatImportPath } from "@modern-js/utils";
|
|
2
|
-
const genRenderCode = ({ srcDirectory, internalSrcAlias, metaName, entry, customEntry, customBootstrap, mountId }) => customEntry ? `import '${entry.replace(srcDirectory, internalSrcAlias)}'
|
|
3
|
-
export * from '${entry.replace(srcDirectory, internalSrcAlias)}'` : `import { createRoot } from '@${metaName}/runtime/react';
|
|
2
|
+
const genRenderCode = ({ srcDirectory, internalSrcAlias, metaName, entry, customEntry, customBootstrap, mountId }) => customEntry ? `import '${formatImportPath(entry.replace(srcDirectory, internalSrcAlias))}'
|
|
3
|
+
export * from '${formatImportPath(entry.replace(srcDirectory, internalSrcAlias))}'` : `import { createRoot } from '@${metaName}/runtime/react';
|
|
4
4
|
import { render } from '@${metaName}/runtime/browser';
|
|
5
5
|
import { isRenderGarfish, createProvider } from '@${metaName}/plugin-garfish/tools';
|
|
6
6
|
${customBootstrap ? `import customBootstrap from '${formatImportPath(customBootstrap.replace(srcDirectory, internalSrcAlias))}';` : "let customBootstrap;"}
|
|
@@ -55,8 +55,7 @@ const garfishPlugin = (userConfig = {}) => ({
|
|
|
55
55
|
});
|
|
56
56
|
}
|
|
57
57
|
constructor(props) {
|
|
58
|
-
super(props)
|
|
59
|
-
this.state = {
|
|
58
|
+
super(props), this.state = {
|
|
60
59
|
MApp: () => {
|
|
61
60
|
logger("MApp init Component Render");
|
|
62
61
|
return /* @__PURE__ */ React.createElement("div");
|
package/package.json
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"modern",
|
|
16
16
|
"modern.js"
|
|
17
17
|
],
|
|
18
|
-
"version": "2.
|
|
18
|
+
"version": "2.60.0",
|
|
19
19
|
"jsnext:source": "./src/cli/index.ts",
|
|
20
20
|
"types": "./dist/types/cli/index.d.ts",
|
|
21
21
|
"typesVersions": {
|
|
@@ -63,18 +63,18 @@
|
|
|
63
63
|
}
|
|
64
64
|
},
|
|
65
65
|
"dependencies": {
|
|
66
|
-
"@swc/helpers": "0.5.
|
|
66
|
+
"@swc/helpers": "0.5.13",
|
|
67
67
|
"@types/debug": "4.1.7",
|
|
68
68
|
"@types/react-loadable": "^5.5.6",
|
|
69
69
|
"debug": "4.3.4",
|
|
70
70
|
"garfish": "^1.8.1",
|
|
71
71
|
"react-loadable": "^5.5.0",
|
|
72
|
-
"@modern-js/plugin": "2.
|
|
73
|
-
"@modern-js/runtime-utils": "2.
|
|
74
|
-
"@modern-js/utils": "2.
|
|
72
|
+
"@modern-js/plugin": "2.60.0",
|
|
73
|
+
"@modern-js/runtime-utils": "2.60.0",
|
|
74
|
+
"@modern-js/utils": "2.60.0"
|
|
75
75
|
},
|
|
76
76
|
"peerDependencies": {
|
|
77
|
-
"@modern-js/runtime": "^2.
|
|
77
|
+
"@modern-js/runtime": "^2.60.0",
|
|
78
78
|
"react": ">=17",
|
|
79
79
|
"react-dom": ">=17"
|
|
80
80
|
},
|
|
@@ -93,13 +93,13 @@
|
|
|
93
93
|
"react-dom": "^18",
|
|
94
94
|
"react-router-dom": "6.22.0",
|
|
95
95
|
"typescript": "^5",
|
|
96
|
-
"@modern-js/app-tools": "2.
|
|
97
|
-
"@modern-js/
|
|
98
|
-
"@modern-js/
|
|
99
|
-
"@modern-js/
|
|
100
|
-
"@modern-js/
|
|
101
|
-
"@scripts/build": "2.
|
|
102
|
-
"@scripts/jest-config": "2.
|
|
96
|
+
"@modern-js/app-tools": "2.60.0",
|
|
97
|
+
"@modern-js/runtime": "2.60.0",
|
|
98
|
+
"@modern-js/core": "2.60.0",
|
|
99
|
+
"@modern-js/plugin-router-v5": "2.60.0",
|
|
100
|
+
"@modern-js/types": "2.60.0",
|
|
101
|
+
"@scripts/build": "2.60.0",
|
|
102
|
+
"@scripts/jest-config": "2.60.0"
|
|
103
103
|
},
|
|
104
104
|
"sideEffects": false,
|
|
105
105
|
"publishConfig": {
|