@modern-js/plugin-state 1.2.1 → 1.2.4
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/.eslintrc.js +8 -0
- package/CHANGELOG.md +24 -0
- package/dist/js/modern/cli/index.js +84 -88
- package/dist/js/modern/runtime/plugin.js +47 -45
- package/dist/js/node/cli/index.js +91 -94
- package/dist/js/node/runtime/plugin.js +51 -48
- package/dist/js/treeshaking/cli/index.js +83 -84
- package/dist/js/treeshaking/runtime/plugin.js +44 -44
- package/dist/types/cli/index.d.ts +5 -17
- package/dist/types/runtime/plugin.d.ts +2 -27
- package/jest.config.js +0 -1
- package/package.json +12 -9
- package/tests/index.test.ts +0 -9
package/.eslintrc.js
ADDED
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# @modern-js/plugin-state
|
|
2
2
|
|
|
3
|
+
## 1.2.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 6cffe99d: chore:
|
|
8
|
+
remove react eslint rules for `modern-js` rule set.
|
|
9
|
+
add .eslintrc for each package to speed up linting
|
|
10
|
+
- 04ae5262: chore: bump @modern-js/utils to v1.4.1 in dependencies
|
|
11
|
+
- 60f7d8bf: feat: add tests dir to npmignore
|
|
12
|
+
|
|
13
|
+
## 1.2.3
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- bebb39b6: chore: improve devDependencies and peerDependencies
|
|
18
|
+
|
|
19
|
+
## 1.2.2
|
|
20
|
+
|
|
21
|
+
### Patch Changes
|
|
22
|
+
|
|
23
|
+
- 94d02b35: feat(plugin-runtime): convert to new plugin
|
|
24
|
+
- 681a1ff9: feat: remove unnecessary peerDependencies
|
|
25
|
+
- e8bbc315: feat(plugin-state): convert to new plugin
|
|
26
|
+
|
|
3
27
|
## 1.2.1
|
|
4
28
|
|
|
5
29
|
### 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
|
+
}));
|
|
@@ -4,64 +4,66 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
4
4
|
|
|
5
5
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
6
|
|
|
7
|
-
// eslint-disable-next-line filenames/match-exported
|
|
8
7
|
import { useContext } from 'react';
|
|
9
|
-
import {
|
|
8
|
+
import { RuntimeReactContext } from '@modern-js/runtime-core';
|
|
10
9
|
import { createStore } from '@modern-js-reduck/store';
|
|
11
10
|
import { Provider } from '@modern-js-reduck/react';
|
|
12
11
|
import hoistNonReactStatics from 'hoist-non-react-statics';
|
|
13
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
13
|
|
|
15
|
-
const state = config =>
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
14
|
+
const state = config => ({
|
|
15
|
+
name: '@modern-js/plugin-state',
|
|
16
|
+
setup: () => {
|
|
17
|
+
return {
|
|
18
|
+
hoc({
|
|
19
|
+
App
|
|
20
|
+
}, next) {
|
|
21
|
+
const getStateApp = props => {
|
|
22
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
23
|
+
const context = useContext(RuntimeReactContext);
|
|
24
|
+
return /*#__PURE__*/_jsx(Provider, {
|
|
25
|
+
store: context.store,
|
|
26
|
+
config: config,
|
|
27
|
+
children: /*#__PURE__*/_jsx(App, _objectSpread({}, props))
|
|
28
|
+
});
|
|
29
|
+
};
|
|
28
30
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
return next({
|
|
32
|
+
App: hoistNonReactStatics(getStateApp, App)
|
|
33
|
+
});
|
|
34
|
+
},
|
|
33
35
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
init({
|
|
37
|
+
context
|
|
38
|
+
}, next) {
|
|
39
|
+
const storeConfig = config || {};
|
|
38
40
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
+
if (typeof window !== 'undefined') {
|
|
42
|
+
var _window, _window$_SSR_DATA, _window$_SSR_DATA$dat;
|
|
41
43
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
+
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) || {};
|
|
45
|
+
}
|
|
44
46
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
47
|
+
context.store = createStore(storeConfig);
|
|
48
|
+
next({
|
|
49
|
+
context
|
|
50
|
+
});
|
|
51
|
+
},
|
|
50
52
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
53
|
+
pickContext({
|
|
54
|
+
context,
|
|
55
|
+
pickedContext
|
|
56
|
+
}, next) {
|
|
57
|
+
return next({
|
|
58
|
+
context,
|
|
59
|
+
pickedContext: _objectSpread(_objectSpread({}, pickedContext), {}, {
|
|
60
|
+
store: context.store
|
|
61
|
+
})
|
|
62
|
+
});
|
|
63
|
+
}
|
|
62
64
|
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
+
};
|
|
66
|
+
}
|
|
65
67
|
});
|
|
66
68
|
|
|
67
69
|
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;
|
|
@@ -40,56 +40,59 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
40
40
|
|
|
41
41
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
42
42
|
|
|
43
|
-
const state = config => (
|
|
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
|
-
|
|
43
|
+
const state = config => ({
|
|
44
|
+
name: '@modern-js/plugin-state',
|
|
45
|
+
setup: () => {
|
|
46
|
+
return {
|
|
47
|
+
hoc({
|
|
48
|
+
App
|
|
49
|
+
}, next) {
|
|
50
|
+
const getStateApp = props => {
|
|
51
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
52
|
+
const context = (0, _react.useContext)(_runtimeCore.RuntimeReactContext);
|
|
53
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_react2.Provider, {
|
|
54
|
+
store: context.store,
|
|
55
|
+
config: config,
|
|
56
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(App, _objectSpread({}, props))
|
|
57
|
+
});
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
return next({
|
|
61
|
+
App: (0, _hoistNonReactStatics.default)(getStateApp, App)
|
|
62
|
+
});
|
|
63
|
+
},
|
|
64
|
+
|
|
65
|
+
init({
|
|
66
|
+
context
|
|
67
|
+
}, next) {
|
|
68
|
+
const storeConfig = config || {};
|
|
69
|
+
|
|
70
|
+
if (typeof window !== 'undefined') {
|
|
71
|
+
var _window, _window$_SSR_DATA, _window$_SSR_DATA$dat;
|
|
72
|
+
|
|
73
|
+
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) || {};
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
context.store = (0, _store.createStore)(storeConfig);
|
|
77
|
+
next({
|
|
78
|
+
context
|
|
79
|
+
});
|
|
80
|
+
},
|
|
81
|
+
|
|
82
|
+
pickContext({
|
|
83
|
+
context,
|
|
84
|
+
pickedContext
|
|
85
|
+
}, next) {
|
|
86
|
+
return next({
|
|
87
|
+
context,
|
|
88
|
+
pickedContext: _objectSpread(_objectSpread({}, pickedContext), {}, {
|
|
89
|
+
store: context.store
|
|
90
|
+
})
|
|
91
|
+
});
|
|
92
|
+
}
|
|
69
93
|
|
|
70
|
-
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
context.store = (0, _store.createStore)(storeConfig);
|
|
74
|
-
next({
|
|
75
|
-
context
|
|
76
|
-
});
|
|
77
|
-
},
|
|
78
|
-
|
|
79
|
-
pickContext({
|
|
80
|
-
context,
|
|
81
|
-
pickedContext
|
|
82
|
-
}, next) {
|
|
83
|
-
return next({
|
|
84
|
-
context,
|
|
85
|
-
pickedContext: _objectSpread(_objectSpread({}, pickedContext), {}, {
|
|
86
|
-
store: context.store
|
|
87
|
-
})
|
|
88
|
-
});
|
|
94
|
+
};
|
|
89
95
|
}
|
|
90
|
-
|
|
91
|
-
}), {
|
|
92
|
-
name: '@modern-js/plugin-state'
|
|
93
96
|
});
|
|
94
97
|
|
|
95
98
|
var _default = state;
|
|
@@ -1,101 +1,100 @@
|
|
|
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
|
var PLUGIN_IDENTIFIER = 'state';
|
|
6
|
-
|
|
7
|
-
var stateConfigMap = new Map();
|
|
8
|
-
var pluginsExportsUtils;
|
|
9
|
-
var stateModulePath = path.resolve(__dirname, '../../../../');
|
|
5
|
+
export default (function () {
|
|
10
6
|
return {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
7
|
+
name: '@modern-js/plugin-state',
|
|
8
|
+
required: ['@modern-js/runtime'],
|
|
9
|
+
setup: function setup(api) {
|
|
10
|
+
var stateConfigMap = new Map();
|
|
11
|
+
var pluginsExportsUtils;
|
|
12
|
+
var stateModulePath = path.resolve(__dirname, '../../../../');
|
|
15
13
|
return {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
14
|
+
config: function config() {
|
|
15
|
+
var appContext = api.useAppContext();
|
|
16
|
+
pluginsExportsUtils = createRuntimeExportsUtils(appContext.internalDirectory, 'plugins');
|
|
17
|
+
return {
|
|
18
|
+
source: {
|
|
19
|
+
alias: {
|
|
20
|
+
'@modern-js/runtime/plugins': pluginsExportsUtils.getPath()
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
},
|
|
25
|
+
modifyEntryImports: function modifyEntryImports(_ref) {
|
|
26
|
+
var _getEntryOptions;
|
|
25
27
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
28
|
+
var entrypoint = _ref.entrypoint,
|
|
29
|
+
imports = _ref.imports;
|
|
30
|
+
var entryName = entrypoint.entryName;
|
|
31
|
+
var userConfig = api.useResolvedConfigContext();
|
|
29
32
|
|
|
30
|
-
|
|
33
|
+
var _api$useAppContext = api.useAppContext(),
|
|
34
|
+
packageName = _api$useAppContext.packageName;
|
|
31
35
|
|
|
32
|
-
|
|
33
|
-
|
|
36
|
+
var stateConfig = (_getEntryOptions = getEntryOptions(entryName, userConfig.runtime, userConfig.runtimeByEntries, packageName)) === null || _getEntryOptions === void 0 ? void 0 : _getEntryOptions.state;
|
|
37
|
+
stateConfigMap.set(entryName, stateConfig);
|
|
34
38
|
|
|
35
|
-
|
|
36
|
-
|
|
39
|
+
var getEnabledPlugins = function getEnabledPlugins() {
|
|
40
|
+
var internalPlugins = ['immer', 'effects', 'autoActions', 'devtools'];
|
|
41
|
+
return internalPlugins.filter(function (name) {
|
|
42
|
+
return stateConfig[name] !== false;
|
|
43
|
+
});
|
|
44
|
+
};
|
|
37
45
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
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(function (imported) {
|
|
56
|
+
return {
|
|
57
|
+
imported: imported
|
|
58
|
+
};
|
|
59
|
+
}),
|
|
60
|
+
initialize: "\n const createStatePlugins = (config) => {\n const plugins = [];\n\n ".concat(getEnabledPlugins().map(function (name) {
|
|
61
|
+
return "\n plugins.push(".concat(name, "(config['").concat(name, "']));\n ");
|
|
62
|
+
}).join('\n'), "\n\n return plugins;\n }\n ")
|
|
63
|
+
});
|
|
64
|
+
}
|
|
44
65
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
specifiers: getEnabledPlugins().map(function (imported) {
|
|
55
|
-
return {
|
|
56
|
-
imported: imported
|
|
57
|
-
};
|
|
58
|
-
}),
|
|
59
|
-
initialize: "\n const createStatePlugins = (config) => {\n const plugins = [];\n\n ".concat(getEnabledPlugins().map(function (name) {
|
|
60
|
-
return "\n plugins.push(".concat(name, "(config['").concat(name, "']));\n ");
|
|
61
|
-
}).join('\n'), "\n\n return plugins;\n }\n ")
|
|
62
|
-
});
|
|
63
|
-
}
|
|
66
|
+
return {
|
|
67
|
+
entrypoint: entrypoint,
|
|
68
|
+
imports: imports
|
|
69
|
+
};
|
|
70
|
+
},
|
|
71
|
+
modifyEntryRuntimePlugins: function modifyEntryRuntimePlugins(_ref2) {
|
|
72
|
+
var entrypoint = _ref2.entrypoint,
|
|
73
|
+
plugins = _ref2.plugins;
|
|
74
|
+
var stateOptions = stateConfigMap.get(entrypoint.entryName);
|
|
64
75
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
if (stateOptions) {
|
|
76
|
-
var isBoolean = typeof stateOptions === 'boolean';
|
|
77
|
-
var options = isBoolean ? '{}' : JSON.stringify(stateOptions);
|
|
78
|
-
options = "".concat(options.substr(0, options.length - 1)).concat(isBoolean ? '' : ',', "plugins: createStatePlugins(").concat(JSON.stringify(stateConfigMap.get(entrypoint.entryName)), ")}");
|
|
79
|
-
plugins.push({
|
|
80
|
-
name: PLUGIN_IDENTIFIER,
|
|
81
|
-
options: options
|
|
82
|
-
});
|
|
83
|
-
}
|
|
76
|
+
if (stateOptions) {
|
|
77
|
+
var isBoolean = typeof stateOptions === 'boolean';
|
|
78
|
+
var options = isBoolean ? '{}' : JSON.stringify(stateOptions);
|
|
79
|
+
options = "".concat(options.substr(0, options.length - 1)).concat(isBoolean ? '' : ',', "plugins: createStatePlugins(").concat(JSON.stringify(stateConfigMap.get(entrypoint.entryName)), ")}");
|
|
80
|
+
plugins.push({
|
|
81
|
+
name: PLUGIN_IDENTIFIER,
|
|
82
|
+
options: options
|
|
83
|
+
});
|
|
84
|
+
}
|
|
84
85
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
86
|
+
return {
|
|
87
|
+
entrypoint: entrypoint,
|
|
88
|
+
plugins: plugins
|
|
89
|
+
};
|
|
90
|
+
},
|
|
91
|
+
validateSchema: function validateSchema() {
|
|
92
|
+
return PLUGIN_SCHEMAS['@modern-js/plugin-state'];
|
|
93
|
+
},
|
|
94
|
+
addRuntimeExports: function addRuntimeExports() {
|
|
95
|
+
pluginsExportsUtils.addExport("export { default as state } from '".concat(stateModulePath, "'"));
|
|
96
|
+
}
|
|
88
97
|
};
|
|
89
|
-
},
|
|
90
|
-
validateSchema: function validateSchema() {
|
|
91
|
-
return PLUGIN_SCHEMAS['@modern-js/plugin-state'];
|
|
92
|
-
},
|
|
93
|
-
addRuntimeExports: function addRuntimeExports() {
|
|
94
|
-
pluginsExportsUtils.addExport("export { default as state } from '".concat(stateModulePath, "'"));
|
|
95
98
|
}
|
|
96
99
|
};
|
|
97
|
-
}
|
|
98
|
-
name: '@modern-js/plugin-state',
|
|
99
|
-
required: ['@modern-js/runtime']
|
|
100
|
-
});
|
|
101
|
-
export default index;
|
|
100
|
+
});
|
|
@@ -4,63 +4,63 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
4
4
|
|
|
5
5
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
6
|
|
|
7
|
-
// eslint-disable-next-line filenames/match-exported
|
|
8
7
|
import { useContext } from 'react';
|
|
9
|
-
import {
|
|
8
|
+
import { RuntimeReactContext } from '@modern-js/runtime-core';
|
|
10
9
|
import { createStore } from '@modern-js-reduck/store';
|
|
11
10
|
import { Provider } from '@modern-js-reduck/react';
|
|
12
11
|
import hoistNonReactStatics from 'hoist-non-react-statics';
|
|
13
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
13
|
|
|
15
14
|
var state = function state(config) {
|
|
16
|
-
return
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
return {
|
|
16
|
+
name: '@modern-js/plugin-state',
|
|
17
|
+
setup: function setup() {
|
|
18
|
+
return {
|
|
19
|
+
hoc: function hoc(_ref, next) {
|
|
20
|
+
var App = _ref.App;
|
|
20
21
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
22
|
+
var getStateApp = function getStateApp(props) {
|
|
23
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
24
|
+
var context = useContext(RuntimeReactContext);
|
|
25
|
+
return /*#__PURE__*/_jsx(Provider, {
|
|
26
|
+
store: context.store,
|
|
27
|
+
config: config,
|
|
28
|
+
children: /*#__PURE__*/_jsx(App, _objectSpread({}, props))
|
|
29
|
+
});
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
return next({
|
|
33
|
+
App: hoistNonReactStatics(getStateApp, App)
|
|
28
34
|
});
|
|
29
|
-
}
|
|
35
|
+
},
|
|
36
|
+
init: function init(_ref2, next) {
|
|
37
|
+
var context = _ref2.context;
|
|
38
|
+
var storeConfig = config || {};
|
|
30
39
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
});
|
|
34
|
-
},
|
|
35
|
-
init: function init(_ref2, next) {
|
|
36
|
-
var context = _ref2.context;
|
|
37
|
-
var storeConfig = config || {};
|
|
40
|
+
if (typeof window !== 'undefined') {
|
|
41
|
+
var _window, _window$_SSR_DATA, _window$_SSR_DATA$dat;
|
|
38
42
|
|
|
39
|
-
|
|
40
|
-
|
|
43
|
+
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) || {};
|
|
44
|
+
}
|
|
41
45
|
|
|
42
|
-
|
|
46
|
+
context.store = createStore(storeConfig);
|
|
47
|
+
next({
|
|
48
|
+
context: context
|
|
49
|
+
});
|
|
50
|
+
},
|
|
51
|
+
pickContext: function pickContext(_ref3, next) {
|
|
52
|
+
var context = _ref3.context,
|
|
53
|
+
pickedContext = _ref3.pickedContext;
|
|
54
|
+
return next({
|
|
55
|
+
context: context,
|
|
56
|
+
pickedContext: _objectSpread(_objectSpread({}, pickedContext), {}, {
|
|
57
|
+
store: context.store
|
|
58
|
+
})
|
|
59
|
+
});
|
|
43
60
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
context: context
|
|
48
|
-
});
|
|
49
|
-
},
|
|
50
|
-
pickContext: function pickContext(_ref3, next) {
|
|
51
|
-
var context = _ref3.context,
|
|
52
|
-
pickedContext = _ref3.pickedContext;
|
|
53
|
-
return next({
|
|
54
|
-
context: context,
|
|
55
|
-
pickedContext: _objectSpread(_objectSpread({}, pickedContext), {}, {
|
|
56
|
-
store: context.store
|
|
57
|
-
})
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
};
|
|
61
|
-
}, {
|
|
62
|
-
name: '@modern-js/plugin-state'
|
|
63
|
-
});
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
64
|
};
|
|
65
65
|
|
|
66
66
|
export default state;
|
|
@@ -1,17 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
validateSchema: import("@modern-js/core").ParallelWorkflow<void, unknown>;
|
|
7
|
-
prepare: import("@modern-js/core").AsyncWorkflow<void, void>;
|
|
8
|
-
commands: import("@modern-js/core").AsyncWorkflow<{
|
|
9
|
-
program: import("commander").Command;
|
|
10
|
-
}, void>;
|
|
11
|
-
watchFiles: import("@modern-js/core").ParallelWorkflow<void, unknown>;
|
|
12
|
-
fileChange: import("@modern-js/core").AsyncWorkflow<{
|
|
13
|
-
filename: string;
|
|
14
|
-
}, void>;
|
|
15
|
-
beforeExit: import("@modern-js/core").AsyncWorkflow<void, void>;
|
|
16
|
-
} & import("@modern-js/core").ClearDraftProgress<import("@modern-js/core").Hooks>>>>;
|
|
17
|
-
export default index;
|
|
1
|
+
import type { CliPlugin } from '@modern-js/core';
|
|
2
|
+
|
|
3
|
+
declare const _default: () => CliPlugin;
|
|
4
|
+
|
|
5
|
+
export default _default;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { createStore, Store } from '@modern-js-reduck/store';
|
|
2
|
+
import type { Plugin } from '@modern-js/runtime-core';
|
|
3
3
|
declare module '@modern-js/runtime-core' {
|
|
4
4
|
interface RuntimeContext {
|
|
5
5
|
store: Store;
|
|
@@ -12,31 +12,6 @@ declare module '@modern-js/runtime-core' {
|
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
14
|
declare type PluginProps = Parameters<typeof createStore>[0];
|
|
15
|
-
declare const state: (config: PluginProps) =>
|
|
16
|
-
hoc: import("@modern-js/runtime-core").Pipeline<{
|
|
17
|
-
App: import("react").ComponentType<any>;
|
|
18
|
-
}, import("react").ComponentType<any>>;
|
|
19
|
-
provide: import("@modern-js/runtime-core").Pipeline<{
|
|
20
|
-
element: JSX.Element;
|
|
21
|
-
readonly props: import("@modern-js/runtime-core/src/plugin").AppProps;
|
|
22
|
-
readonly context: import("@modern-js/runtime-core").RuntimeContext;
|
|
23
|
-
}, JSX.Element>;
|
|
24
|
-
client: import("@modern-js/runtime-core").AsyncPipeline<{
|
|
25
|
-
App: import("react").ComponentType<any>;
|
|
26
|
-
readonly context?: import("@modern-js/runtime-core").RuntimeContext | undefined;
|
|
27
|
-
rootElement: HTMLElement;
|
|
28
|
-
}, void>;
|
|
29
|
-
server: import("@modern-js/runtime-core").AsyncPipeline<{
|
|
30
|
-
App: import("react").ComponentType<any>;
|
|
31
|
-
readonly context?: import("@modern-js/runtime-core").RuntimeContext | undefined;
|
|
32
|
-
}, string>;
|
|
33
|
-
init: import("@modern-js/runtime-core").AsyncPipeline<{
|
|
34
|
-
context: import("@modern-js/runtime-core").RuntimeContext;
|
|
35
|
-
}, unknown>;
|
|
36
|
-
pickContext: import("@modern-js/runtime-core").Pipeline<{
|
|
37
|
-
context: import("@modern-js/runtime-core").RuntimeContext;
|
|
38
|
-
pickedContext: import("@modern-js/runtime-core").TRuntimeContext;
|
|
39
|
-
}, import("@modern-js/runtime-core").TRuntimeContext>;
|
|
40
|
-
} & import("@modern-js/runtime-core").ClearDraftProgress<{}>>>>;
|
|
15
|
+
declare const state: (config: PluginProps) => Plugin;
|
|
41
16
|
export default state;
|
|
42
17
|
export * from '../plugins';
|
package/jest.config.js
CHANGED
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"modern",
|
|
12
12
|
"modern.js"
|
|
13
13
|
],
|
|
14
|
-
"version": "1.2.
|
|
14
|
+
"version": "1.2.4",
|
|
15
15
|
"jsnext:source": "./src/runtime/index.tsx",
|
|
16
16
|
"types": "./dist/types/runtime/index.d.ts",
|
|
17
17
|
"main": "./dist/js/node/runtime/index.js",
|
|
@@ -46,6 +46,12 @@
|
|
|
46
46
|
],
|
|
47
47
|
"plugins": [
|
|
48
48
|
"./dist/types/plugins.d.ts"
|
|
49
|
+
],
|
|
50
|
+
"cli": [
|
|
51
|
+
"./dist/types/cli/index.d.ts"
|
|
52
|
+
],
|
|
53
|
+
"runtime": [
|
|
54
|
+
"./dist/types/runtime/index.d.ts"
|
|
49
55
|
]
|
|
50
56
|
}
|
|
51
57
|
},
|
|
@@ -62,10 +68,10 @@
|
|
|
62
68
|
"hoist-non-react-statics": "^3.3.2"
|
|
63
69
|
},
|
|
64
70
|
"devDependencies": {
|
|
65
|
-
"@modern-js/core": "
|
|
66
|
-
"@modern-js/plugin": "^1.
|
|
67
|
-
"@modern-js/runtime-core": "
|
|
68
|
-
"@modern-js/utils": "^1.
|
|
71
|
+
"@modern-js/core": "1.8.0",
|
|
72
|
+
"@modern-js/plugin": "^1.3.3",
|
|
73
|
+
"@modern-js/runtime-core": "1.4.2",
|
|
74
|
+
"@modern-js/utils": "^1.5.0",
|
|
69
75
|
"@types/hoist-non-react-statics": "^3.3.1",
|
|
70
76
|
"@types/jest": "^26",
|
|
71
77
|
"@types/node": "^14",
|
|
@@ -79,15 +85,12 @@
|
|
|
79
85
|
},
|
|
80
86
|
"sideEffects": false,
|
|
81
87
|
"peerDependencies": {
|
|
82
|
-
"@modern-js/core": "^1.3.2",
|
|
83
|
-
"@modern-js/runtime-core": "^1.2.1",
|
|
84
88
|
"react": "^17.0.2"
|
|
85
89
|
},
|
|
86
90
|
"modernConfig": {},
|
|
87
91
|
"publishConfig": {
|
|
88
92
|
"registry": "https://registry.npmjs.org/",
|
|
89
|
-
"access": "public"
|
|
90
|
-
"types": "./dist/types/runtime/index.d.ts"
|
|
93
|
+
"access": "public"
|
|
91
94
|
},
|
|
92
95
|
"scripts": {
|
|
93
96
|
"new": "modern new",
|