@modern-js/plugin-garfish 2.14.0 → 2.16.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 (41) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/dist/cjs/cli/index.js +224 -236
  3. package/dist/cjs/cli/utils.js +24 -48
  4. package/dist/cjs/deps/index.js +12 -35
  5. package/dist/cjs/index.js +26 -36
  6. package/dist/cjs/runtime/index.js +24 -44
  7. package/dist/cjs/runtime/loadable.js +46 -58
  8. package/dist/cjs/runtime/plugin.js +86 -82
  9. package/dist/cjs/runtime/useModuleApps.js +70 -56
  10. package/dist/cjs/runtime/utils/Context.js +18 -36
  11. package/dist/cjs/runtime/utils/MApp.js +88 -87
  12. package/dist/cjs/runtime/utils/apps.js +114 -94
  13. package/dist/cjs/runtime/utils/setExternal.js +23 -41
  14. package/dist/cjs/util.js +21 -40
  15. package/dist/esm/cli/index.js +409 -402
  16. package/dist/esm/cli/utils.js +25 -26
  17. package/dist/esm/deps/index.js +1 -2
  18. package/dist/esm/index.js +1 -2
  19. package/dist/esm/runtime/index.js +3 -4
  20. package/dist/esm/runtime/loadable.js +226 -210
  21. package/dist/esm/runtime/plugin.js +456 -426
  22. package/dist/esm/runtime/useModuleApps.js +49 -50
  23. package/dist/esm/runtime/utils/Context.js +1 -1
  24. package/dist/esm/runtime/utils/MApp.js +337 -316
  25. package/dist/esm/runtime/utils/apps.js +468 -442
  26. package/dist/esm/runtime/utils/setExternal.js +9 -9
  27. package/dist/esm/util.js +4 -5
  28. package/dist/esm-node/cli/index.js +209 -219
  29. package/dist/esm-node/cli/utils.js +15 -30
  30. package/dist/esm-node/deps/index.js +1 -4
  31. package/dist/esm-node/index.js +1 -4
  32. package/dist/esm-node/runtime/index.js +3 -10
  33. package/dist/esm-node/runtime/loadable.js +34 -31
  34. package/dist/esm-node/runtime/plugin.js +50 -33
  35. package/dist/esm-node/runtime/useModuleApps.js +12 -19
  36. package/dist/esm-node/runtime/utils/Context.js +2 -5
  37. package/dist/esm-node/runtime/utils/MApp.js +61 -40
  38. package/dist/esm-node/runtime/utils/apps.js +38 -44
  39. package/dist/esm-node/runtime/utils/setExternal.js +5 -5
  40. package/dist/esm-node/util.js +4 -9
  41. package/package.json +15 -12
@@ -1,58 +1,57 @@
1
- function _defineProperty(obj, key, value) {
2
- if (key in obj) {
3
- Object.defineProperty(obj, key, {
4
- value: value,
5
- enumerable: true,
6
- configurable: true,
7
- writable: true
8
- });
9
- } else {
10
- obj[key] = value;
11
- }
12
- return obj;
1
+ function _define_property(obj, key, value) {
2
+ if (key in obj) {
3
+ Object.defineProperty(obj, key, {
4
+ value,
5
+ enumerable: true,
6
+ configurable: true,
7
+ writable: true
8
+ });
9
+ } else {
10
+ obj[key] = value;
11
+ }
12
+ return obj;
13
13
  }
14
- function _objectSpread(target) {
15
- for(var i = 1; i < arguments.length; i++){
16
- var source = arguments[i] != null ? arguments[i] : {};
17
- var ownKeys = Object.keys(source);
18
- if (typeof Object.getOwnPropertySymbols === "function") {
19
- ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
20
- return Object.getOwnPropertyDescriptor(source, sym).enumerable;
21
- }));
22
- }
23
- ownKeys.forEach(function(key) {
24
- _defineProperty(target, key, source[key]);
25
- });
14
+ function _object_spread(target) {
15
+ for (var i = 1; i < arguments.length; i++) {
16
+ var source = arguments[i] != null ? arguments[i] : {};
17
+ var ownKeys = Object.keys(source);
18
+ if (typeof Object.getOwnPropertySymbols === "function") {
19
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
20
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
21
+ }));
26
22
  }
27
- return target;
23
+ ownKeys.forEach(function(key) {
24
+ _define_property(target, key, source[key]);
25
+ });
26
+ }
27
+ return target;
28
28
  }
29
29
  import React, { useContext } from "react";
30
30
  import { logger } from "../util";
31
31
  import { GarfishContext } from "./utils/Context";
32
- function useModuleApps() {
33
- var _useContext = useContext(GarfishContext), apps = _useContext.apps, MApp = _useContext.MApp, appInfoList = _useContext.appInfoList;
34
- logger("call useModuleApps", _objectSpread({
35
- MApp: MApp,
36
- apps: appInfoList
37
- }, apps));
38
- var Info = new Proxy(_objectSpread({
39
- MApp: MApp,
40
- apps: appInfoList
41
- }, apps), {
42
- get: function get(target, p, receiver) {
43
- if (typeof p === "string" && p in target) {
44
- return Reflect.get(target, p, receiver);
45
- }
46
- return function() {
47
- return React.createElement("div");
48
- };
49
- }
50
- });
51
- return Info;
32
+ export function useModuleApps() {
33
+ var _useContext = useContext(GarfishContext), apps = _useContext.apps, MApp = _useContext.MApp, appInfoList = _useContext.appInfoList;
34
+ logger("call useModuleApps", _object_spread({
35
+ MApp,
36
+ apps: appInfoList
37
+ }, apps));
38
+ var Info = new Proxy(_object_spread({
39
+ MApp,
40
+ apps: appInfoList
41
+ }, apps), {
42
+ get: function get(target, p, receiver) {
43
+ if (typeof p === "string" && p in target) {
44
+ return Reflect.get(target, p, receiver);
45
+ }
46
+ return function() {
47
+ return React.createElement("div");
48
+ };
49
+ }
50
+ });
51
+ return Info;
52
52
  }
53
- function useModuleApp() {
54
- var MApp = useContext(GarfishContext).MApp;
55
- logger("call useModuleApps", MApp);
56
- return MApp;
53
+ export function useModuleApp() {
54
+ var MApp = useContext(GarfishContext).MApp;
55
+ logger("call useModuleApps", MApp);
56
+ return MApp;
57
57
  }
58
- export { useModuleApp, useModuleApps };
@@ -1,4 +1,4 @@
1
1
  import React from "react";
2
- var GarfishContext = React.createContext(null);
2
+ var GarfishContext = /* @__PURE__ */ React.createContext(null);
3
3
  var GarfishProvider = GarfishContext.Provider;
4
4
  export { GarfishContext, GarfishProvider };