@modern-js/plugin-state 1.1.4 → 1.2.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 +34 -0
- package/dist/js/modern/cli/index.js +84 -88
- package/dist/js/modern/runtime/index.js +2 -4
- package/dist/js/modern/runtime/plugin.js +47 -44
- package/dist/js/node/cli/index.js +91 -94
- package/dist/js/node/runtime/index.js +17 -16
- package/dist/js/node/runtime/plugin.js +51 -48
- package/dist/js/treeshaking/cli/index.js +83 -84
- package/dist/js/treeshaking/runtime/index.js +2 -4
- package/dist/js/treeshaking/runtime/plugin.js +44 -43
- package/dist/types/cli/index.d.ts +5 -17
- package/dist/types/runtime/index.d.ts +2 -3
- package/dist/types/runtime/plugin.d.ts +2 -27
- package/jest.config.js +8 -0
- package/package.json +22 -12
- package/tests/index.test.ts +9 -0
- package/tests/tsconfig.json +13 -0
- package/tsconfig.json +1 -4
- package/src/.eslintrc.json +0 -3
- package/src/cli/index.ts +0 -144
- package/src/plugins.ts +0 -9
- package/src/runtime/index.tsx +0 -9
- package/src/runtime/plugin.tsx +0 -73
- package/src/types.ts +0 -19
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,39 @@
|
|
|
1
1
|
# @modern-js/plugin-state
|
|
2
2
|
|
|
3
|
+
## 1.2.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 94d02b35: feat(plugin-runtime): convert to new plugin
|
|
8
|
+
- 681a1ff9: feat: remove unnecessary peerDependencies
|
|
9
|
+
- e8bbc315: feat(plugin-state): convert to new plugin
|
|
10
|
+
|
|
11
|
+
## 1.2.1
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- 83166714: change .npmignore
|
|
16
|
+
- Updated dependencies [83166714]
|
|
17
|
+
- Updated dependencies [c3de9882]
|
|
18
|
+
- Updated dependencies [33ff48af]
|
|
19
|
+
- Updated dependencies [c74597bd]
|
|
20
|
+
- @modern-js/core@1.3.2
|
|
21
|
+
- @modern-js/runtime-core@1.2.1
|
|
22
|
+
|
|
23
|
+
## 1.2.0
|
|
24
|
+
|
|
25
|
+
### Minor Changes
|
|
26
|
+
|
|
27
|
+
- cfe11628: Make Modern.js self bootstraping
|
|
28
|
+
|
|
29
|
+
### Patch Changes
|
|
30
|
+
|
|
31
|
+
- Updated dependencies [fc71e36f]
|
|
32
|
+
- Updated dependencies [a2cb9abc]
|
|
33
|
+
- Updated dependencies [cfe11628]
|
|
34
|
+
- @modern-js/core@1.3.0
|
|
35
|
+
- @modern-js/runtime-core@1.2.0
|
|
36
|
+
|
|
3
37
|
## 1.1.4
|
|
4
38
|
|
|
5
39
|
### Patch Changes
|
|
@@ -1,62 +1,61 @@
|
|
|
1
1
|
import path from 'path';
|
|
2
2
|
import { getEntryOptions, createRuntimeExportsUtils, PLUGIN_SCHEMAS } from '@modern-js/utils';
|
|
3
|
-
import { createPlugin, useAppContext, useResolvedConfigContext } from '@modern-js/core';
|
|
4
3
|
import "../types";
|
|
5
4
|
const PLUGIN_IDENTIFIER = 'state';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
5
|
+
export default (() => ({
|
|
6
|
+
name: '@modern-js/plugin-state',
|
|
7
|
+
required: ['@modern-js/runtime'],
|
|
8
|
+
setup: api => {
|
|
9
|
+
const stateConfigMap = new Map();
|
|
10
|
+
let pluginsExportsUtils;
|
|
11
|
+
const stateModulePath = path.resolve(__dirname, '../../../../');
|
|
12
|
+
return {
|
|
13
|
+
config() {
|
|
14
|
+
const appContext = api.useAppContext();
|
|
15
|
+
pluginsExportsUtils = createRuntimeExportsUtils(appContext.internalDirectory, 'plugins');
|
|
16
|
+
return {
|
|
17
|
+
source: {
|
|
18
|
+
alias: {
|
|
19
|
+
'@modern-js/runtime/plugins': pluginsExportsUtils.getPath()
|
|
20
|
+
}
|
|
19
21
|
}
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
},
|
|
23
|
-
|
|
24
|
-
modifyEntryImports({
|
|
25
|
-
entrypoint,
|
|
26
|
-
imports
|
|
27
|
-
}) {
|
|
28
|
-
var _getEntryOptions;
|
|
22
|
+
};
|
|
23
|
+
},
|
|
29
24
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
25
|
+
modifyEntryImports({
|
|
26
|
+
entrypoint,
|
|
27
|
+
imports
|
|
28
|
+
}) {
|
|
29
|
+
var _getEntryOptions;
|
|
35
30
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
31
|
+
const {
|
|
32
|
+
entryName
|
|
33
|
+
} = entrypoint;
|
|
34
|
+
const userConfig = api.useResolvedConfigContext();
|
|
35
|
+
const {
|
|
36
|
+
packageName
|
|
37
|
+
} = api.useAppContext();
|
|
38
|
+
const stateConfig = (_getEntryOptions = getEntryOptions(entryName, userConfig.runtime, userConfig.runtimeByEntries, packageName)) === null || _getEntryOptions === void 0 ? void 0 : _getEntryOptions.state;
|
|
39
|
+
stateConfigMap.set(entryName, stateConfig);
|
|
41
40
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
41
|
+
const getEnabledPlugins = () => {
|
|
42
|
+
const internalPlugins = ['immer', 'effects', 'autoActions', 'devtools'];
|
|
43
|
+
return internalPlugins.filter(name => stateConfig[name] !== false);
|
|
44
|
+
};
|
|
46
45
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
46
|
+
if (stateConfig) {
|
|
47
|
+
imports.push({
|
|
48
|
+
value: '@modern-js/runtime/plugins',
|
|
49
|
+
specifiers: [{
|
|
50
|
+
imported: PLUGIN_IDENTIFIER
|
|
51
|
+
}]
|
|
52
|
+
});
|
|
53
|
+
imports.push({
|
|
54
|
+
value: '@modern-js/runtime/model',
|
|
55
|
+
specifiers: getEnabledPlugins().map(imported => ({
|
|
56
|
+
imported
|
|
57
|
+
})),
|
|
58
|
+
initialize: `
|
|
60
59
|
const createStatePlugins = (config) => {
|
|
61
60
|
const plugins = [];
|
|
62
61
|
|
|
@@ -67,48 +66,45 @@ const index = createPlugin(() => {
|
|
|
67
66
|
return plugins;
|
|
68
67
|
}
|
|
69
68
|
`
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
return {
|
|
74
|
-
entrypoint,
|
|
75
|
-
imports
|
|
76
|
-
};
|
|
77
|
-
},
|
|
69
|
+
});
|
|
70
|
+
}
|
|
78
71
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
72
|
+
return {
|
|
73
|
+
entrypoint,
|
|
74
|
+
imports
|
|
75
|
+
};
|
|
76
|
+
},
|
|
84
77
|
|
|
85
|
-
|
|
86
|
-
const isBoolean = typeof stateOptions === 'boolean';
|
|
87
|
-
let options = isBoolean ? '{}' : JSON.stringify(stateOptions);
|
|
88
|
-
options = `${options.substr(0, options.length - 1)}${isBoolean ? '' : ','}plugins: createStatePlugins(${JSON.stringify(stateConfigMap.get(entrypoint.entryName))})}`;
|
|
89
|
-
plugins.push({
|
|
90
|
-
name: PLUGIN_IDENTIFIER,
|
|
91
|
-
options
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
return {
|
|
78
|
+
modifyEntryRuntimePlugins({
|
|
96
79
|
entrypoint,
|
|
97
80
|
plugins
|
|
98
|
-
}
|
|
99
|
-
|
|
81
|
+
}) {
|
|
82
|
+
const stateOptions = stateConfigMap.get(entrypoint.entryName);
|
|
100
83
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
84
|
+
if (stateOptions) {
|
|
85
|
+
const isBoolean = typeof stateOptions === 'boolean';
|
|
86
|
+
let options = isBoolean ? '{}' : JSON.stringify(stateOptions);
|
|
87
|
+
options = `${options.substr(0, options.length - 1)}${isBoolean ? '' : ','}plugins: createStatePlugins(${JSON.stringify(stateConfigMap.get(entrypoint.entryName))})}`;
|
|
88
|
+
plugins.push({
|
|
89
|
+
name: PLUGIN_IDENTIFIER,
|
|
90
|
+
options
|
|
91
|
+
});
|
|
92
|
+
}
|
|
104
93
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
94
|
+
return {
|
|
95
|
+
entrypoint,
|
|
96
|
+
plugins
|
|
97
|
+
};
|
|
98
|
+
},
|
|
108
99
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
export default
|
|
100
|
+
validateSchema() {
|
|
101
|
+
return PLUGIN_SCHEMAS['@modern-js/plugin-state'];
|
|
102
|
+
},
|
|
103
|
+
|
|
104
|
+
addRuntimeExports() {
|
|
105
|
+
pluginsExportsUtils.addExport(`export { default as state } from '${stateModulePath}'`);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
}));
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
// eslint-disable-next-line filenames/match-exported
|
|
2
|
-
import statePlugin from "./plugin";
|
|
3
1
|
export * from '@modern-js-reduck/react';
|
|
4
2
|
export { model, createStore } from '@modern-js-reduck/store';
|
|
5
|
-
export
|
|
6
|
-
export
|
|
3
|
+
export { default } from "./plugin";
|
|
4
|
+
export * from "./plugin";
|
|
@@ -6,62 +6,65 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
|
6
6
|
|
|
7
7
|
// eslint-disable-next-line filenames/match-exported
|
|
8
8
|
import { useContext } from 'react';
|
|
9
|
-
import {
|
|
9
|
+
import { RuntimeReactContext } from '@modern-js/runtime-core';
|
|
10
10
|
import { createStore } from '@modern-js-reduck/store';
|
|
11
11
|
import { Provider } from '@modern-js-reduck/react';
|
|
12
12
|
import hoistNonReactStatics from 'hoist-non-react-statics';
|
|
13
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
14
|
|
|
15
|
-
const state = config =>
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
15
|
+
const state = config => ({
|
|
16
|
+
name: '@modern-js/plugin-state',
|
|
17
|
+
setup: () => {
|
|
18
|
+
return {
|
|
19
|
+
hoc({
|
|
20
|
+
App
|
|
21
|
+
}, next) {
|
|
22
|
+
const getStateApp = props => {
|
|
23
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
24
|
+
const context = useContext(RuntimeReactContext);
|
|
25
|
+
return /*#__PURE__*/_jsx(Provider, {
|
|
26
|
+
store: context.store,
|
|
27
|
+
config: config,
|
|
28
|
+
children: /*#__PURE__*/_jsx(App, _objectSpread({}, props))
|
|
29
|
+
});
|
|
30
|
+
};
|
|
28
31
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
32
|
+
return next({
|
|
33
|
+
App: hoistNonReactStatics(getStateApp, App)
|
|
34
|
+
});
|
|
35
|
+
},
|
|
33
36
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
37
|
+
init({
|
|
38
|
+
context
|
|
39
|
+
}, next) {
|
|
40
|
+
const storeConfig = config || {};
|
|
38
41
|
|
|
39
|
-
|
|
40
|
-
|
|
42
|
+
if (typeof window !== 'undefined') {
|
|
43
|
+
var _window, _window$_SSR_DATA, _window$_SSR_DATA$dat;
|
|
41
44
|
|
|
42
|
-
|
|
43
|
-
|
|
45
|
+
storeConfig.initialState = storeConfig.initialState || ((_window = window) === null || _window === void 0 ? void 0 : (_window$_SSR_DATA = _window._SSR_DATA) === null || _window$_SSR_DATA === void 0 ? void 0 : (_window$_SSR_DATA$dat = _window$_SSR_DATA.data) === null || _window$_SSR_DATA$dat === void 0 ? void 0 : _window$_SSR_DATA$dat.storeState) || {};
|
|
46
|
+
}
|
|
44
47
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
context.store = createStore(storeConfig);
|
|
49
|
+
next({
|
|
50
|
+
context
|
|
51
|
+
});
|
|
52
|
+
},
|
|
50
53
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
54
|
+
pickContext({
|
|
55
|
+
context,
|
|
56
|
+
pickedContext
|
|
57
|
+
}, next) {
|
|
58
|
+
return next({
|
|
59
|
+
context,
|
|
60
|
+
pickedContext: _objectSpread(_objectSpread({}, pickedContext), {}, {
|
|
61
|
+
store: context.store
|
|
62
|
+
})
|
|
63
|
+
});
|
|
64
|
+
}
|
|
62
65
|
|
|
63
|
-
}
|
|
64
|
-
|
|
66
|
+
};
|
|
67
|
+
}
|
|
65
68
|
});
|
|
66
69
|
|
|
67
70
|
export default state;
|
|
@@ -9,69 +9,68 @@ var _path = _interopRequireDefault(require("path"));
|
|
|
9
9
|
|
|
10
10
|
var _utils = require("@modern-js/utils");
|
|
11
11
|
|
|
12
|
-
var _core = require("@modern-js/core");
|
|
13
|
-
|
|
14
12
|
require("../types");
|
|
15
13
|
|
|
16
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
15
|
|
|
18
16
|
const PLUGIN_IDENTIFIER = 'state';
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
17
|
+
|
|
18
|
+
var _default = () => ({
|
|
19
|
+
name: '@modern-js/plugin-state',
|
|
20
|
+
required: ['@modern-js/runtime'],
|
|
21
|
+
setup: api => {
|
|
22
|
+
const stateConfigMap = new Map();
|
|
23
|
+
let pluginsExportsUtils;
|
|
24
|
+
|
|
25
|
+
const stateModulePath = _path.default.resolve(__dirname, '../../../../');
|
|
26
|
+
|
|
27
|
+
return {
|
|
28
|
+
config() {
|
|
29
|
+
const appContext = api.useAppContext();
|
|
30
|
+
pluginsExportsUtils = (0, _utils.createRuntimeExportsUtils)(appContext.internalDirectory, 'plugins');
|
|
31
|
+
return {
|
|
32
|
+
source: {
|
|
33
|
+
alias: {
|
|
34
|
+
'@modern-js/runtime/plugins': pluginsExportsUtils.getPath()
|
|
35
|
+
}
|
|
34
36
|
}
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
imported
|
|
73
|
-
})),
|
|
74
|
-
initialize: `
|
|
37
|
+
};
|
|
38
|
+
},
|
|
39
|
+
|
|
40
|
+
modifyEntryImports({
|
|
41
|
+
entrypoint,
|
|
42
|
+
imports
|
|
43
|
+
}) {
|
|
44
|
+
var _getEntryOptions;
|
|
45
|
+
|
|
46
|
+
const {
|
|
47
|
+
entryName
|
|
48
|
+
} = entrypoint;
|
|
49
|
+
const userConfig = api.useResolvedConfigContext();
|
|
50
|
+
const {
|
|
51
|
+
packageName
|
|
52
|
+
} = api.useAppContext();
|
|
53
|
+
const stateConfig = (_getEntryOptions = (0, _utils.getEntryOptions)(entryName, userConfig.runtime, userConfig.runtimeByEntries, packageName)) === null || _getEntryOptions === void 0 ? void 0 : _getEntryOptions.state;
|
|
54
|
+
stateConfigMap.set(entryName, stateConfig);
|
|
55
|
+
|
|
56
|
+
const getEnabledPlugins = () => {
|
|
57
|
+
const internalPlugins = ['immer', 'effects', 'autoActions', 'devtools'];
|
|
58
|
+
return internalPlugins.filter(name => stateConfig[name] !== false);
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
if (stateConfig) {
|
|
62
|
+
imports.push({
|
|
63
|
+
value: '@modern-js/runtime/plugins',
|
|
64
|
+
specifiers: [{
|
|
65
|
+
imported: PLUGIN_IDENTIFIER
|
|
66
|
+
}]
|
|
67
|
+
});
|
|
68
|
+
imports.push({
|
|
69
|
+
value: '@modern-js/runtime/model',
|
|
70
|
+
specifiers: getEnabledPlugins().map(imported => ({
|
|
71
|
+
imported
|
|
72
|
+
})),
|
|
73
|
+
initialize: `
|
|
75
74
|
const createStatePlugins = (config) => {
|
|
76
75
|
const plugins = [];
|
|
77
76
|
|
|
@@ -82,49 +81,47 @@ const index = (0, _core.createPlugin)(() => {
|
|
|
82
81
|
return plugins;
|
|
83
82
|
}
|
|
84
83
|
`
|
|
85
|
-
|
|
86
|
-
|
|
84
|
+
});
|
|
85
|
+
}
|
|
87
86
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
modifyEntryRuntimePlugins({
|
|
95
|
-
entrypoint,
|
|
96
|
-
plugins
|
|
97
|
-
}) {
|
|
98
|
-
const stateOptions = stateConfigMap.get(entrypoint.entryName);
|
|
99
|
-
|
|
100
|
-
if (stateOptions) {
|
|
101
|
-
const isBoolean = typeof stateOptions === 'boolean';
|
|
102
|
-
let options = isBoolean ? '{}' : JSON.stringify(stateOptions);
|
|
103
|
-
options = `${options.substr(0, options.length - 1)}${isBoolean ? '' : ','}plugins: createStatePlugins(${JSON.stringify(stateConfigMap.get(entrypoint.entryName))})}`;
|
|
104
|
-
plugins.push({
|
|
105
|
-
name: PLUGIN_IDENTIFIER,
|
|
106
|
-
options
|
|
107
|
-
});
|
|
108
|
-
}
|
|
87
|
+
return {
|
|
88
|
+
entrypoint,
|
|
89
|
+
imports
|
|
90
|
+
};
|
|
91
|
+
},
|
|
109
92
|
|
|
110
|
-
|
|
93
|
+
modifyEntryRuntimePlugins({
|
|
111
94
|
entrypoint,
|
|
112
95
|
plugins
|
|
113
|
-
}
|
|
114
|
-
|
|
96
|
+
}) {
|
|
97
|
+
const stateOptions = stateConfigMap.get(entrypoint.entryName);
|
|
98
|
+
|
|
99
|
+
if (stateOptions) {
|
|
100
|
+
const isBoolean = typeof stateOptions === 'boolean';
|
|
101
|
+
let options = isBoolean ? '{}' : JSON.stringify(stateOptions);
|
|
102
|
+
options = `${options.substr(0, options.length - 1)}${isBoolean ? '' : ','}plugins: createStatePlugins(${JSON.stringify(stateConfigMap.get(entrypoint.entryName))})}`;
|
|
103
|
+
plugins.push({
|
|
104
|
+
name: PLUGIN_IDENTIFIER,
|
|
105
|
+
options
|
|
106
|
+
});
|
|
107
|
+
}
|
|
115
108
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
109
|
+
return {
|
|
110
|
+
entrypoint,
|
|
111
|
+
plugins
|
|
112
|
+
};
|
|
113
|
+
},
|
|
119
114
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
115
|
+
validateSchema() {
|
|
116
|
+
return _utils.PLUGIN_SCHEMAS['@modern-js/plugin-state'];
|
|
117
|
+
},
|
|
123
118
|
|
|
124
|
-
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
|
|
119
|
+
addRuntimeExports() {
|
|
120
|
+
pluginsExportsUtils.addExport(`export { default as state } from '${stateModulePath}'`);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
};
|
|
124
|
+
}
|
|
128
125
|
});
|
|
129
|
-
|
|
126
|
+
|
|
130
127
|
exports.default = _default;
|
|
@@ -13,7 +13,12 @@ Object.defineProperty(exports, "createStore", {
|
|
|
13
13
|
return _store.createStore;
|
|
14
14
|
}
|
|
15
15
|
});
|
|
16
|
-
exports
|
|
16
|
+
Object.defineProperty(exports, "default", {
|
|
17
|
+
enumerable: true,
|
|
18
|
+
get: function () {
|
|
19
|
+
return _plugin.default;
|
|
20
|
+
}
|
|
21
|
+
});
|
|
17
22
|
Object.defineProperty(exports, "model", {
|
|
18
23
|
enumerable: true,
|
|
19
24
|
get: function () {
|
|
@@ -21,40 +26,36 @@ Object.defineProperty(exports, "model", {
|
|
|
21
26
|
}
|
|
22
27
|
});
|
|
23
28
|
|
|
24
|
-
var
|
|
29
|
+
var _react = require("@modern-js-reduck/react");
|
|
25
30
|
|
|
26
|
-
Object.keys(
|
|
31
|
+
Object.keys(_react).forEach(function (key) {
|
|
27
32
|
if (key === "default" || key === "__esModule") return;
|
|
28
33
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
29
|
-
if (key in exports && exports[key] ===
|
|
34
|
+
if (key in exports && exports[key] === _react[key]) return;
|
|
30
35
|
Object.defineProperty(exports, key, {
|
|
31
36
|
enumerable: true,
|
|
32
37
|
get: function () {
|
|
33
|
-
return
|
|
38
|
+
return _react[key];
|
|
34
39
|
}
|
|
35
40
|
});
|
|
36
41
|
});
|
|
37
42
|
|
|
38
|
-
var
|
|
43
|
+
var _store = require("@modern-js-reduck/store");
|
|
39
44
|
|
|
40
|
-
|
|
45
|
+
var _plugin = _interopRequireWildcard(require("./plugin"));
|
|
46
|
+
|
|
47
|
+
Object.keys(_plugin).forEach(function (key) {
|
|
41
48
|
if (key === "default" || key === "__esModule") return;
|
|
42
49
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
43
|
-
if (key in exports && exports[key] ===
|
|
50
|
+
if (key in exports && exports[key] === _plugin[key]) return;
|
|
44
51
|
Object.defineProperty(exports, key, {
|
|
45
52
|
enumerable: true,
|
|
46
53
|
get: function () {
|
|
47
|
-
return
|
|
54
|
+
return _plugin[key];
|
|
48
55
|
}
|
|
49
56
|
});
|
|
50
57
|
});
|
|
51
58
|
|
|
52
|
-
var _store = require("@modern-js-reduck/store");
|
|
53
|
-
|
|
54
59
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
55
60
|
|
|
56
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
57
|
-
|
|
58
|
-
// eslint-disable-next-line filenames/match-exported
|
|
59
|
-
var _default = _plugin.default;
|
|
60
|
-
exports.default = _default;
|
|
61
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|