@modern-js/plugin-state 1.1.1 → 1.1.2

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 CHANGED
@@ -1,5 +1,16 @@
1
1
  # @modern-js/plugin-state
2
2
 
3
+ ## 1.1.2
4
+
5
+ ### Patch Changes
6
+
7
+ - 0fa83663: support more .env files
8
+ - f594fbc8: fix apple icon and favicon support
9
+ - Updated dependencies [6f7fe574]
10
+ - Updated dependencies [0fa83663]
11
+ - @modern-js/core@1.1.2
12
+ - @modern-js/runtime-core@1.1.1
13
+
3
14
  ## 1.1.1
4
15
 
5
16
  ### Patch Changes
@@ -31,8 +31,12 @@ const index = createPlugin(() => {
31
31
  entryName
32
32
  } = entrypoint; // eslint-disable-next-line react-hooks/rules-of-hooks
33
33
 
34
- const userConfig = useResolvedConfigContext();
35
- const stateConfig = (_getEntryOptions = getEntryOptions(entryName, userConfig.runtime, userConfig.runtimeByEntries)) === null || _getEntryOptions === void 0 ? void 0 : _getEntryOptions.state;
34
+ const userConfig = useResolvedConfigContext(); // eslint-disable-next-line react-hooks/rules-of-hooks
35
+
36
+ const {
37
+ packageName
38
+ } = useAppContext();
39
+ const stateConfig = (_getEntryOptions = getEntryOptions(entryName, userConfig.runtime, userConfig.runtimeByEntries, packageName)) === null || _getEntryOptions === void 0 ? void 0 : _getEntryOptions.state;
36
40
  stateConfigMap.set(entryName, stateConfig);
37
41
 
38
42
  const getEnabledPlugins = () => {
@@ -46,8 +46,12 @@ const index = (0, _core.createPlugin)(() => {
46
46
  entryName
47
47
  } = entrypoint; // eslint-disable-next-line react-hooks/rules-of-hooks
48
48
 
49
- const userConfig = (0, _core.useResolvedConfigContext)();
50
- const stateConfig = (_getEntryOptions = (0, _utils.getEntryOptions)(entryName, userConfig.runtime, userConfig.runtimeByEntries)) === null || _getEntryOptions === void 0 ? void 0 : _getEntryOptions.state;
49
+ const userConfig = (0, _core.useResolvedConfigContext)(); // eslint-disable-next-line react-hooks/rules-of-hooks
50
+
51
+ const {
52
+ packageName
53
+ } = (0, _core.useAppContext)();
54
+ const stateConfig = (_getEntryOptions = (0, _utils.getEntryOptions)(entryName, userConfig.runtime, userConfig.runtimeByEntries, packageName)) === null || _getEntryOptions === void 0 ? void 0 : _getEntryOptions.state;
51
55
  stateConfigMap.set(entryName, stateConfig);
52
56
 
53
57
  const getEnabledPlugins = () => {
@@ -27,8 +27,12 @@ var index = createPlugin(function () {
27
27
  imports = _ref.imports;
28
28
  var entryName = entrypoint.entryName; // eslint-disable-next-line react-hooks/rules-of-hooks
29
29
 
30
- var userConfig = useResolvedConfigContext();
31
- var stateConfig = (_getEntryOptions = getEntryOptions(entryName, userConfig.runtime, userConfig.runtimeByEntries)) === null || _getEntryOptions === void 0 ? void 0 : _getEntryOptions.state;
30
+ var userConfig = useResolvedConfigContext(); // eslint-disable-next-line react-hooks/rules-of-hooks
31
+
32
+ var _useAppContext = useAppContext(),
33
+ packageName = _useAppContext.packageName;
34
+
35
+ var stateConfig = (_getEntryOptions = getEntryOptions(entryName, userConfig.runtime, userConfig.runtimeByEntries, packageName)) === null || _getEntryOptions === void 0 ? void 0 : _getEntryOptions.state;
32
36
  stateConfigMap.set(entryName, stateConfig);
33
37
 
34
38
  var getEnabledPlugins = function getEnabledPlugins() {
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "modern",
12
12
  "modern.js"
13
13
  ],
14
- "version": "1.1.1",
14
+ "version": "1.1.2",
15
15
  "jsnext:source": "./src/index.ts",
16
16
  "types": "./dist/types/runtime/index.d.ts",
17
17
  "main": "./dist/js/node/runtime/index.js",
@@ -56,10 +56,10 @@
56
56
  "redux-logger": "^3.0.6"
57
57
  },
58
58
  "devDependencies": {
59
- "@modern-js/core": "^1.1.1",
60
- "@modern-js/plugin": "^1.1.1",
61
- "@modern-js/runtime-core": "^1.1.0",
62
- "@modern-js/utils": "^1.1.1",
59
+ "@modern-js/core": "^1.1.2",
60
+ "@modern-js/plugin": "^1.1.2",
61
+ "@modern-js/runtime-core": "^1.1.1",
62
+ "@modern-js/utils": "^1.1.2",
63
63
  "@types/jest": "^26",
64
64
  "@types/node": "^14",
65
65
  "@types/react": "^17",
@@ -71,8 +71,8 @@
71
71
  },
72
72
  "sideEffects": false,
73
73
  "peerDependencies": {
74
- "@modern-js/core": "^1.1.1",
75
- "@modern-js/runtime-core": "^1.1.0",
74
+ "@modern-js/core": "^1.1.2",
75
+ "@modern-js/runtime-core": "^1.1.1",
76
76
  "react": "^17.0.2"
77
77
  },
78
78
  "modernConfig": {},
package/src/cli/index.ts CHANGED
@@ -42,11 +42,14 @@ const index = createPlugin(
42
42
  const { entryName } = entrypoint;
43
43
  // eslint-disable-next-line react-hooks/rules-of-hooks
44
44
  const userConfig = useResolvedConfigContext();
45
+ // eslint-disable-next-line react-hooks/rules-of-hooks
46
+ const { packageName } = useAppContext();
45
47
 
46
48
  const stateConfig = getEntryOptions(
47
49
  entryName,
48
50
  userConfig.runtime,
49
51
  userConfig.runtimeByEntries,
52
+ packageName,
50
53
  )?.state;
51
54
 
52
55
  stateConfigMap.set(entryName, stateConfig);