@modern-js/plugin-garfish 1.4.4-beta.3 → 1.4.4-beta.6
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.
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import _merge from "lodash/merge";
|
|
2
1
|
const _excluded = ["manifest"];
|
|
3
2
|
|
|
4
3
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
@@ -35,7 +34,7 @@ async function initOptions(manifest = {}, options) {
|
|
|
35
34
|
|
|
36
35
|
|
|
37
36
|
if (manifest !== null && manifest !== void 0 && manifest.getAppList) {
|
|
38
|
-
const getAppList = await (manifest === null || manifest === void 0 ? void 0 : manifest.getAppList());
|
|
37
|
+
const getAppList = await (manifest === null || manifest === void 0 ? void 0 : manifest.getAppList(manifest));
|
|
39
38
|
|
|
40
39
|
if (getAppList.length > 0) {
|
|
41
40
|
apps = getAppList;
|
|
@@ -58,20 +57,17 @@ async function initOptions(manifest = {}, options) {
|
|
|
58
57
|
} // export default GarfishPlugin;
|
|
59
58
|
|
|
60
59
|
|
|
61
|
-
export default (
|
|
60
|
+
export default (config => ({
|
|
62
61
|
name: '@modern-js/garfish-plugin',
|
|
63
|
-
setup:
|
|
62
|
+
setup: () => {
|
|
64
63
|
setExternal();
|
|
65
64
|
|
|
66
|
-
const
|
|
67
|
-
{
|
|
65
|
+
const {
|
|
68
66
|
manifest
|
|
69
|
-
} =
|
|
70
|
-
options = _objectWithoutProperties(
|
|
67
|
+
} = config,
|
|
68
|
+
options = _objectWithoutProperties(config, _excluded);
|
|
71
69
|
|
|
72
|
-
logger('createPlugin',
|
|
73
|
-
config
|
|
74
|
-
});
|
|
70
|
+
logger('createPlugin', config);
|
|
75
71
|
const promise = initOptions(manifest, options);
|
|
76
72
|
return {
|
|
77
73
|
hoc({
|
|
@@ -5,8 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
|
|
8
|
-
var _merge3 = _interopRequireDefault(require("lodash/merge"));
|
|
9
|
-
|
|
10
8
|
var _react = _interopRequireDefault(require("react"));
|
|
11
9
|
|
|
12
10
|
var _hoistNonReactStatics = _interopRequireDefault(require("hoist-non-react-statics"));
|
|
@@ -52,7 +50,7 @@ async function initOptions(manifest = {}, options) {
|
|
|
52
50
|
|
|
53
51
|
|
|
54
52
|
if (manifest !== null && manifest !== void 0 && manifest.getAppList) {
|
|
55
|
-
const getAppList = await (manifest === null || manifest === void 0 ? void 0 : manifest.getAppList());
|
|
53
|
+
const getAppList = await (manifest === null || manifest === void 0 ? void 0 : manifest.getAppList(manifest));
|
|
56
54
|
|
|
57
55
|
if (getAppList.length > 0) {
|
|
58
56
|
apps = getAppList;
|
|
@@ -75,20 +73,17 @@ async function initOptions(manifest = {}, options) {
|
|
|
75
73
|
} // export default GarfishPlugin;
|
|
76
74
|
|
|
77
75
|
|
|
78
|
-
var _default =
|
|
76
|
+
var _default = config => ({
|
|
79
77
|
name: '@modern-js/garfish-plugin',
|
|
80
|
-
setup:
|
|
78
|
+
setup: () => {
|
|
81
79
|
(0, _setExternal.default)();
|
|
82
80
|
|
|
83
|
-
const
|
|
84
|
-
{
|
|
81
|
+
const {
|
|
85
82
|
manifest
|
|
86
|
-
} =
|
|
87
|
-
options = _objectWithoutProperties(
|
|
83
|
+
} = config,
|
|
84
|
+
options = _objectWithoutProperties(config, _excluded);
|
|
88
85
|
|
|
89
|
-
(0, _util.logger)('createPlugin',
|
|
90
|
-
config
|
|
91
|
-
});
|
|
86
|
+
(0, _util.logger)('createPlugin', config);
|
|
92
87
|
const promise = initOptions(manifest, options);
|
|
93
88
|
return {
|
|
94
89
|
hoc({
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
2
|
|
|
3
|
-
import _merge from "lodash/merge";
|
|
4
3
|
var _excluded = ["manifest"];
|
|
5
4
|
|
|
6
5
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
@@ -88,7 +87,7 @@ function _initOptions() {
|
|
|
88
87
|
}
|
|
89
88
|
|
|
90
89
|
_context2.next = 7;
|
|
91
|
-
return manifest === null || manifest === void 0 ? void 0 : manifest.getAppList();
|
|
90
|
+
return manifest === null || manifest === void 0 ? void 0 : manifest.getAppList(manifest);
|
|
92
91
|
|
|
93
92
|
case 7:
|
|
94
93
|
getAppList = _context2.sent;
|
|
@@ -120,19 +119,16 @@ function _initOptions() {
|
|
|
120
119
|
return _initOptions.apply(this, arguments);
|
|
121
120
|
}
|
|
122
121
|
|
|
123
|
-
export default (function (
|
|
122
|
+
export default (function (config) {
|
|
124
123
|
return {
|
|
125
124
|
name: '@modern-js/garfish-plugin',
|
|
126
|
-
setup: function setup(
|
|
125
|
+
setup: function setup() {
|
|
127
126
|
setExternal();
|
|
128
127
|
|
|
129
|
-
var
|
|
130
|
-
|
|
131
|
-
options = _objectWithoutProperties(_merge2, _excluded);
|
|
128
|
+
var manifest = config.manifest,
|
|
129
|
+
options = _objectWithoutProperties(config, _excluded);
|
|
132
130
|
|
|
133
|
-
logger('createPlugin',
|
|
134
|
-
config: config
|
|
135
|
-
});
|
|
131
|
+
logger('createPlugin', config);
|
|
136
132
|
var promise = initOptions(manifest, options);
|
|
137
133
|
return {
|
|
138
134
|
hoc: function hoc(_ref, next) {
|
|
@@ -9,7 +9,7 @@ export declare type ModulesInfo = Array<ModuleInfo>;
|
|
|
9
9
|
export declare type Manifest = {
|
|
10
10
|
modules?: ModulesInfo;
|
|
11
11
|
loadable?: LoadableConfig;
|
|
12
|
-
getAppList?: () => Promise<Array<GarfishInterfaces.AppInfo>>;
|
|
12
|
+
getAppList?: (info: any) => Promise<Array<GarfishInterfaces.AppInfo>>;
|
|
13
13
|
};
|
|
14
14
|
export declare type LoadingComponent = React.ComponentType<{
|
|
15
15
|
isLoading: boolean;
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"modern",
|
|
12
12
|
"modern.js"
|
|
13
13
|
],
|
|
14
|
-
"version": "1.4.4-beta.
|
|
14
|
+
"version": "1.4.4-beta.6",
|
|
15
15
|
"jsnext:source": "./src/index.ts",
|
|
16
16
|
"types": "./dist/types/runtime/index.d.ts",
|
|
17
17
|
"typesVersions": {
|
|
@@ -82,7 +82,9 @@
|
|
|
82
82
|
},
|
|
83
83
|
"peerDependencies": {
|
|
84
84
|
"@modern-js/plugin-router": "^1.2.5",
|
|
85
|
-
"@modern-js/runtime-core": "^1.2.4"
|
|
85
|
+
"@modern-js/runtime-core": "^1.2.4",
|
|
86
|
+
"@modern-js/core": "^1.5.0",
|
|
87
|
+
"react": "^17"
|
|
86
88
|
},
|
|
87
89
|
"sideEffects": false,
|
|
88
90
|
"modernConfig": {},
|