@ice/mf-runtime 1.0.2-beta.1 → 1.0.2-beta.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/README.md CHANGED
@@ -1,18 +1,12 @@
1
1
  # @ice/mf-runtime
2
2
 
3
- 基于 Module Federation 的运行时工具,用于在 ice.js 应用中加载和管理远程模块。支持跨版本 React 组件加载,并提供增强的插件机制。
3
+ 基于 Module Federation 的运行时工具,用于在 ice.js 应用中加载和管理远程模块。支持跨版本 React 组件加载
4
4
 
5
5
  ## 特性
6
6
 
7
7
  - 基于 [Module Federation 2.0](https://module-federation.io/index.html)
8
8
  - 支持跨版本 React 组件加载
9
9
  - 内置冲突检测和降级渲染
10
- - 🔌 **增强插件机制**: 完全兼容标准 MF 运行时插件
11
- - 🎯 **组件增强**: 支持 HOC、Props 注入等组件扩展机制
12
- - 🛡️ **错误边界**: 内置错误处理和恢复机制
13
- - 📊 **性能监控**: 支持组件加载和渲染性能追踪
14
- - 🔄 **热插拔**: 运行时动态注册和移除插件
15
- - 📝 **TypeScript**: 完整的类型定义支持
16
10
 
17
11
  ## 安装
18
12
 
@@ -20,220 +14,6 @@
20
14
  $ npm i @ice/mf-runtime --save
21
15
  ```
22
16
 
23
- ## 插件机制
24
-
25
- 从 v1.0.1 开始,`@ice/mf-runtime` 支持强大的插件机制,允许在运行时动态扩展微前端功能。
26
-
27
- ### 插件类型
28
-
29
- #### 1. 标准 MF 插件 (FederationRuntimePlugin)
30
- 标准 MF 插件使用原生的 `@module-federation/runtime` API 进行管理:
31
-
32
- ```typescript
33
- import { registerPlugins } from '@module-federation/runtime';
34
- import type { FederationRuntimePlugin } from '@ice/mf-runtime';
35
-
36
- const mfPlugin: FederationRuntimePlugin = {
37
- name: 'my-mf-plugin',
38
- beforeRequest: (args) => {
39
- console.log('模块请求前:', args);
40
- return args;
41
- },
42
- onLoad: (args) => {
43
- console.log('模块加载后:', args);
44
- return args;
45
- },
46
- afterResolve: (args) => {
47
- console.log('模块解析后:', args);
48
- return args;
49
- }
50
- };
51
-
52
- // 使用原生 API 注册标准 MF 插件
53
- registerPlugins([mfPlugin]);
54
- ```
55
-
56
- #### 2. 增强插件 (EnhancedRuntimePlugin)
57
- 增强插件使用新的 API 进行管理,提供组件级别的扩展能力:
58
-
59
- ```typescript
60
- import { registerEnhancedPlugins } from '@ice/mf-runtime';
61
- import type { EnhancedRuntimePlugin } from '@ice/mf-runtime';
62
-
63
- const enhancedPlugin: EnhancedRuntimePlugin = {
64
- name: 'my-enhanced-plugin',
65
-
66
- // 组件包装器 - 支持 HOC 模式
67
- wrapComponent: (WrappedComponent, context) => {
68
- return function Enhanced(props) {
69
- console.log(`渲染组件: ${context.remoteName}/${context.moduleName}`);
70
- return <WrappedComponent {...props} />;
71
- };
72
- },
73
-
74
- // 属性注入器
75
- injectProps: (props, context) => {
76
- return {
77
- ...props,
78
- injectedProp: `来自 ${context.remoteName} 的数据`
79
- };
80
- }
81
- };
82
-
83
- // 使用新的 API 注册增强插件
84
- registerEnhancedPlugins([enhancedPlugin]);
85
- ```
86
-
87
- ### 注册和使用插件
88
-
89
- #### 基本用法
90
-
91
- ```typescript
92
- import { init, registerEnhancedPlugins, RemoteModule } from '@ice/mf-runtime';
93
- import { registerPlugins } from '@module-federation/runtime';
94
-
95
- // 注册标准 MF 插件
96
- registerPlugins([mfPlugin]);
97
-
98
- // 注册增强插件
99
- registerEnhancedPlugins([enhancedPlugin]);
100
-
101
- // 初始化运行时
102
- init({
103
- remotes: [
104
- {
105
- name: 'remote-app',
106
- entry: 'http://localhost:3001/remoteEntry.js'
107
- }
108
- ]
109
- });
110
-
111
- // 使用远程模块(插件会自动应用)
112
- function App() {
113
- return (
114
- <RemoteModule
115
- scope="remote-app"
116
- module="Button"
117
- componentProps={{ text: '点击我' }}
118
- />
119
- );
120
- }
121
- ```
122
-
123
- #### 使用示例插件包
124
-
125
- 我们提供了一个示例插件包 `@ice/mf-plugin-example`,包含常用的插件:
126
-
127
- ```bash
128
- npm install @ice/mf-plugin-example
129
- ```
130
-
131
- ```typescript
132
- import { registerPlugins } from '@module-federation/runtime';
133
- import { registerEnhancedPlugins } from '@ice/mf-runtime';
134
- import {
135
- errorBoundaryPlugin,
136
- commonPropsPlugin,
137
- developmentMFLoggingPlugin,
138
- developmentEnhancedLoggingPlugin
139
- } from '@ice/mf-plugin-example';
140
-
141
- // 注册标准 MF 插件
142
- registerPlugins([
143
- developmentMFLoggingPlugin // MF 日志插件
144
- ]);
145
-
146
- // 注册增强插件
147
- registerEnhancedPlugins([
148
- developmentEnhancedLoggingPlugin, // 增强日志插件
149
- errorBoundaryPlugin, // 错误边界插件
150
- commonPropsPlugin // 通用属性注入插件
151
- ]);
152
- ```
153
-
154
- ### 插件开发指南
155
-
156
- #### 错误边界插件示例
157
-
158
- ```typescript
159
- import { ErrorBoundary } from 'react-error-boundary';
160
-
161
- const errorBoundaryPlugin: EnhancedRuntimePlugin = {
162
- name: 'error-boundary',
163
- wrapComponent: (WrappedComponent, context) => {
164
- return function ErrorBoundaryWrapper(props) {
165
- return (
166
- <ErrorBoundary
167
- fallback={<div>组件 {context.remoteName} 加载失败</div>}
168
- onError={(error) => {
169
- console.error(`组件错误:`, error);
170
- }}
171
- >
172
- <WrappedComponent {...props} />
173
- </ErrorBoundary>
174
- );
175
- };
176
- }
177
- };
178
- ```
179
-
180
- #### 属性注入插件示例
181
-
182
- ```typescript
183
- const themePlugin: EnhancedRuntimePlugin = {
184
- name: 'theme-injector',
185
- injectProps: (props, context) => {
186
- return {
187
- ...props,
188
- theme: {
189
- mode: 'light',
190
- primaryColor: '#1890ff'
191
- }
192
- };
193
- }
194
- };
195
- ```
196
-
197
- ### 插件 API
198
-
199
- #### EnhancedPluginManager
200
-
201
- ```typescript
202
- import { getEnhancedPluginManager } from '@ice/mf-runtime';
203
-
204
- const manager = getEnhancedPluginManager();
205
-
206
- // 注册增强插件
207
- manager.register(enhancedPlugin);
208
-
209
- // 获取插件信息
210
- const info = manager.getPluginInfo();
211
- // 返回: [{ name: 'plugin-name', hasWrapper: true, hasInjector: false }]
212
-
213
- // 移除插件
214
- manager.removePlugin('plugin-name');
215
-
216
- // 清空所有插件
217
- manager.clear();
218
- ```
219
-
220
- #### React Hook
221
-
222
- ```typescript
223
- import { useEnhancedPluginManager } from '@ice/mf-runtime';
224
-
225
- function MyComponent() {
226
- const enhancedPluginManager = useEnhancedPluginManager();
227
-
228
- // 动态操作插件
229
- const handleAddPlugin = () => {
230
- enhancedPluginManager.register(newEnhancedPlugin);
231
- };
232
-
233
- return <div>...</div>;
234
- }
235
- ```
236
-
237
17
  ## 使用
238
18
 
239
19
  ### 1. 初始化配置
@@ -6,7 +6,6 @@ import { ErrorBoundary } from 'react-error-boundary';
6
6
  import { FallBack } from './FallBack';
7
7
  import { setFederatedModulePublicPath } from './set-public-path';
8
8
  import { getMicroMod } from './mf-global-store';
9
- import { useEnhancedPluginManager } from './plugin-manager';
10
9
  const useMountNode = (mountNodeConfig)=>{
11
10
  const [resolvedNode, setResolvedNode] = useState(undefined);
12
11
  // 解析各种类型的 mountNode
@@ -36,7 +35,6 @@ const RemoteModuleInner = ({ module, scope, runtime, publicPath, LoadingComponen
36
35
  var _microMod, _runtime, _runtime1;
37
36
  const microMod = getMicroMod(scope);
38
37
  const resolvedMountNode = useMountNode(mountNode);
39
- const enhancedPluginManager = useEnhancedPluginManager();
40
38
  if ((_microMod = microMod) === null || _microMod === void 0 ? void 0 : _microMod.publicPath) {
41
39
  setFederatedModulePublicPath(microMod.moduleFederatedName, microMod.publicPath);
42
40
  }
@@ -47,7 +45,6 @@ const RemoteModuleInner = ({ module, scope, runtime, publicPath, LoadingComponen
47
45
  if (!module || !scope) return null;
48
46
  return /*#__PURE__*/ React.lazy(async ()=>{
49
47
  var _typedRemoteModule;
50
- // 使用标准 MF 加载逻辑,MF 插件自动执行
51
48
  const remoteModule = await loadRemote(`${scope}/${module}`);
52
49
  // 检查是否是来自 runtime plugin 的包装函数(通过标记识别)
53
50
  if (typeof remoteModule === 'function' && remoteModule.__ICE_MF_RUNTIME_WRAPPER__) {
@@ -58,34 +55,25 @@ const RemoteModuleInner = ({ module, scope, runtime, publicPath, LoadingComponen
58
55
  };
59
56
  }
60
57
  const typedRemoteModule = remoteModule;
61
- let BaseComponent;
62
58
  if (!((_typedRemoteModule = typedRemoteModule) === null || _typedRemoteModule === void 0 ? void 0 : _typedRemoteModule.default)) {
63
- BaseComponent = remoteModule;
64
- } else {
65
- BaseComponent = typedRemoteModule.default;
59
+ return {
60
+ default: remoteModule
61
+ };
66
62
  }
67
- // 先应用增强插件的组件包装器
68
- const WrappedComponent = enhancedPluginManager.wrapComponent(BaseComponent, {
69
- remoteName: scope,
70
- moduleName: module,
71
- props: componentProps || {}
72
- });
73
- // 然后处理 runtime 和 mountNode(如果需要)
74
- let FinalComponent;
75
63
  if (runtime) {
76
64
  const { react, reactDOM } = runtime;
77
- FinalComponent = FallBack({
78
- Original: WrappedComponent,
79
- remoteReact: ()=>react,
80
- remoteReactDOM: ()=>reactDOM,
81
- mountNode: resolvedMountNode,
82
- containerClassName: fallbackContainerClassName
83
- });
84
- } else {
85
- FinalComponent = WrappedComponent;
65
+ return {
66
+ default: FallBack({
67
+ Original: typedRemoteModule.default,
68
+ remoteReact: ()=>react,
69
+ remoteReactDOM: ()=>reactDOM,
70
+ mountNode: resolvedMountNode,
71
+ containerClassName: fallbackContainerClassName
72
+ })
73
+ };
86
74
  }
87
75
  return {
88
- default: FinalComponent
76
+ default: typedRemoteModule.default
89
77
  };
90
78
  });
91
79
  }, [
@@ -94,18 +82,11 @@ const RemoteModuleInner = ({ module, scope, runtime, publicPath, LoadingComponen
94
82
  (_runtime = runtime) === null || _runtime === void 0 ? void 0 : _runtime.react,
95
83
  (_runtime1 = runtime) === null || _runtime1 === void 0 ? void 0 : _runtime1.reactDOM,
96
84
  resolvedMountNode,
97
- fallbackContainerClassName,
98
- enhancedPluginManager,
99
- componentProps
85
+ fallbackContainerClassName
100
86
  ]);
101
87
  const Loading = LoadingComponent || /*#__PURE__*/ React.createElement("div", null, "Loading...");
102
88
  const ErrorFallback = ({ error })=>ErrorComponent || /*#__PURE__*/ React.createElement("div", null, "远程模块加载失败: ", error.message);
103
89
  if (!Component) return Loading;
104
- // 应用增强插件的属性注入
105
- const injectedProps = enhancedPluginManager.injectProps(componentProps || {}, {
106
- remoteName: scope,
107
- moduleName: module
108
- });
109
90
  return /*#__PURE__*/ React.createElement(ErrorBoundary, {
110
91
  resetKeys: [
111
92
  module,
@@ -117,8 +98,8 @@ const RemoteModuleInner = ({ module, scope, runtime, publicPath, LoadingComponen
117
98
  }, /*#__PURE__*/ React.createElement(React.Suspense, {
118
99
  fallback: Loading
119
100
  }, /*#__PURE__*/ React.createElement(Component, _object_spread({
120
- ref
121
- }, injectedProps), children)));
101
+ ref: ref
102
+ }, componentProps), children)));
122
103
  };
123
104
  // 使用 forwardRef 包装组件以支持 ref
124
105
  export const RemoteModule = /*#__PURE__*/ forwardRef(RemoteModuleInner);
package/es2017/index.d.ts CHANGED
@@ -2,7 +2,5 @@ import type { ExtendedUserOptions, MicroMod } from './types';
2
2
  export { loadRemote, registerPlugins } from '@module-federation/runtime';
3
3
  export * from './FallBack';
4
4
  export * from './RemoteModule';
5
- export * from './types';
6
- export * from './plugin-manager';
7
5
  export declare function init(options: ExtendedUserOptions, microMods?: MicroMod[]): void;
8
6
  export declare function initByMicroMods(microMods: MicroMod[], hostName?: string): void;
package/es2017/index.js CHANGED
@@ -1,16 +1,14 @@
1
1
  import { getBasename } from '@ice/stark-app';
2
- import { registerPlugins as mfRegisterPlugins, init as mfInit } from '@module-federation/runtime';
2
+ import { registerPlugins, init as mfInit } from '@module-federation/runtime';
3
3
  import { runtimePlugin } from './runtime-plugin';
4
4
  import { initGlobalStore } from './mf-global-store';
5
5
  export { loadRemote, registerPlugins } from '@module-federation/runtime';
6
6
  export * from './FallBack';
7
7
  export * from './RemoteModule';
8
- export * from './types';
9
- export * from './plugin-manager';
10
8
  export function init(options, microMods) {
11
9
  initGlobalStore(options, microMods);
12
10
  mfInit(options);
13
- mfRegisterPlugins([
11
+ registerPlugins([
14
12
  runtimePlugin()
15
13
  ]);
16
14
  }
package/es2017/types.d.ts CHANGED
@@ -1,6 +1,5 @@
1
1
  import type { UserOptions } from '@module-federation/runtime-core';
2
2
  import type { Remote } from '@module-federation/runtime-core/dist/src/types';
3
- import * as React from 'react';
4
3
  export interface ExtraInfo {
5
4
  external?: Record<string, string>;
6
5
  legacy?: boolean;
@@ -19,29 +18,3 @@ export interface MicroMod {
19
18
  moduleFederatedName: string;
20
19
  extraInfo?: ExtraInfo;
21
20
  }
22
- export interface FederationRuntimePlugin {
23
- name: string;
24
- afterResolve?: (args: any) => any;
25
- onLoad?: (args: any) => any;
26
- beforeRequest?: (args: any) => any;
27
- }
28
- export interface WrapperContext {
29
- remoteName: string;
30
- moduleName: string;
31
- props: Record<string, any>;
32
- }
33
- export interface InjectionContext {
34
- remoteName: string;
35
- moduleName: string;
36
- }
37
- export interface ComponentWrapper {
38
- (WrappedComponent: React.ComponentType<any>, context: WrapperContext): React.ComponentType<any>;
39
- }
40
- export interface PropInjector {
41
- (props: Record<string, any>, context: InjectionContext): Record<string, any>;
42
- }
43
- export interface EnhancedRuntimePlugin {
44
- name: string;
45
- wrapComponent?: ComponentWrapper;
46
- injectProps?: PropInjector;
47
- }
package/es2017/types.js CHANGED
@@ -1,2 +1 @@
1
- import * as React from 'react';
2
- // 不再需要联合类型,两种插件分开管理
1
+ export { };
@@ -10,7 +10,6 @@ import { ErrorBoundary } from "react-error-boundary";
10
10
  import { FallBack } from "./FallBack";
11
11
  import { setFederatedModulePublicPath } from "./set-public-path";
12
12
  import { getMicroMod } from "./mf-global-store";
13
- import { useEnhancedPluginManager } from "./plugin-manager";
14
13
  var useMountNode = function(mountNodeConfig) {
15
14
  var _useState = _sliced_to_array(useState(undefined), 2), resolvedNode = _useState[0], setResolvedNode = _useState[1];
16
15
  // 解析各种类型的 mountNode
@@ -41,7 +40,6 @@ var RemoteModuleInner = function(param, ref) {
41
40
  var _microMod, _runtime, _runtime1;
42
41
  var microMod = getMicroMod(scope);
43
42
  var resolvedMountNode = useMountNode(mountNode);
44
- var enhancedPluginManager = useEnhancedPluginManager();
45
43
  if ((_microMod = microMod) === null || _microMod === void 0 ? void 0 : _microMod.publicPath) {
46
44
  setFederatedModulePublicPath(microMod.moduleFederatedName, microMod.publicPath);
47
45
  }
@@ -51,7 +49,7 @@ var RemoteModuleInner = function(param, ref) {
51
49
  var Component = useMemo(function() {
52
50
  if (!module || !scope) return null;
53
51
  return /*#__PURE__*/ React.lazy(/*#__PURE__*/ _async_to_generator(function() {
54
- var _typedRemoteModule, remoteModule, ComponentFromPlugin, typedRemoteModule, BaseComponent, WrappedComponent, FinalComponent, react, reactDOM;
52
+ var _typedRemoteModule, remoteModule, ComponentFromPlugin, typedRemoteModule, react, reactDOM;
55
53
  return _ts_generator(this, function(_state) {
56
54
  switch(_state.label){
57
55
  case 0:
@@ -73,35 +71,36 @@ var RemoteModuleInner = function(param, ref) {
73
71
  }
74
72
  typedRemoteModule = remoteModule;
75
73
  if (!((_typedRemoteModule = typedRemoteModule) === null || _typedRemoteModule === void 0 ? void 0 : _typedRemoteModule.default)) {
76
- BaseComponent = remoteModule;
77
- } else {
78
- BaseComponent = typedRemoteModule.default;
74
+ return [
75
+ 2,
76
+ {
77
+ default: remoteModule
78
+ }
79
+ ];
79
80
  }
80
- WrappedComponent = enhancedPluginManager.wrapComponent(BaseComponent, {
81
- remoteName: scope,
82
- moduleName: module,
83
- props: componentProps || {}
84
- });
85
81
  if (runtime) {
86
82
  react = runtime.react, reactDOM = runtime.reactDOM;
87
- FinalComponent = FallBack({
88
- Original: WrappedComponent,
89
- remoteReact: function() {
90
- return react;
91
- },
92
- remoteReactDOM: function() {
93
- return reactDOM;
94
- },
95
- mountNode: resolvedMountNode,
96
- containerClassName: fallbackContainerClassName
97
- });
98
- } else {
99
- FinalComponent = WrappedComponent;
83
+ return [
84
+ 2,
85
+ {
86
+ default: FallBack({
87
+ Original: typedRemoteModule.default,
88
+ remoteReact: function() {
89
+ return react;
90
+ },
91
+ remoteReactDOM: function() {
92
+ return reactDOM;
93
+ },
94
+ mountNode: resolvedMountNode,
95
+ containerClassName: fallbackContainerClassName
96
+ })
97
+ }
98
+ ];
100
99
  }
101
100
  return [
102
101
  2,
103
102
  {
104
- default: FinalComponent
103
+ default: typedRemoteModule.default
105
104
  }
106
105
  ];
107
106
  }
@@ -113,9 +112,7 @@ var RemoteModuleInner = function(param, ref) {
113
112
  (_runtime = runtime) === null || _runtime === void 0 ? void 0 : _runtime.react,
114
113
  (_runtime1 = runtime) === null || _runtime1 === void 0 ? void 0 : _runtime1.reactDOM,
115
114
  resolvedMountNode,
116
- fallbackContainerClassName,
117
- enhancedPluginManager,
118
- componentProps
115
+ fallbackContainerClassName
119
116
  ]);
120
117
  var Loading = LoadingComponent || /*#__PURE__*/ React.createElement("div", null, "Loading...");
121
118
  var ErrorFallback = function(param) {
@@ -123,11 +120,6 @@ var RemoteModuleInner = function(param, ref) {
123
120
  return ErrorComponent || /*#__PURE__*/ React.createElement("div", null, "远程模块加载失败: ", error.message);
124
121
  };
125
122
  if (!Component) return Loading;
126
- // 应用增强插件的属性注入
127
- var injectedProps = enhancedPluginManager.injectProps(componentProps || {}, {
128
- remoteName: scope,
129
- moduleName: module
130
- });
131
123
  return /*#__PURE__*/ React.createElement(ErrorBoundary, {
132
124
  resetKeys: [
133
125
  module,
@@ -140,7 +132,7 @@ var RemoteModuleInner = function(param, ref) {
140
132
  fallback: Loading
141
133
  }, /*#__PURE__*/ React.createElement(Component, _object_spread({
142
134
  ref: ref
143
- }, injectedProps), children)));
135
+ }, componentProps), children)));
144
136
  };
145
137
  // 使用 forwardRef 包装组件以支持 ref
146
138
  export var RemoteModule = /*#__PURE__*/ forwardRef(RemoteModuleInner);
package/esm/index.d.ts CHANGED
@@ -2,7 +2,5 @@ import type { ExtendedUserOptions, MicroMod } from './types';
2
2
  export { loadRemote, registerPlugins } from '@module-federation/runtime';
3
3
  export * from './FallBack';
4
4
  export * from './RemoteModule';
5
- export * from './types';
6
- export * from './plugin-manager';
7
5
  export declare function init(options: ExtendedUserOptions, microMods?: MicroMod[]): void;
8
6
  export declare function initByMicroMods(microMods: MicroMod[], hostName?: string): void;
package/esm/index.js CHANGED
@@ -1,16 +1,14 @@
1
1
  import { getBasename } from "@ice/stark-app";
2
- import { registerPlugins as mfRegisterPlugins, init as mfInit } from "@module-federation/runtime";
2
+ import { registerPlugins, init as mfInit } from "@module-federation/runtime";
3
3
  import { runtimePlugin } from "./runtime-plugin";
4
4
  import { initGlobalStore } from "./mf-global-store";
5
5
  export { loadRemote, registerPlugins } from "@module-federation/runtime";
6
6
  export * from "./FallBack";
7
7
  export * from "./RemoteModule";
8
- export * from "./types";
9
- export * from "./plugin-manager";
10
8
  export function init(options, microMods) {
11
9
  initGlobalStore(options, microMods);
12
10
  mfInit(options);
13
- mfRegisterPlugins([
11
+ registerPlugins([
14
12
  runtimePlugin()
15
13
  ]);
16
14
  }
package/esm/types.d.ts CHANGED
@@ -1,6 +1,5 @@
1
1
  import type { UserOptions } from '@module-federation/runtime-core';
2
2
  import type { Remote } from '@module-federation/runtime-core/dist/src/types';
3
- import * as React from 'react';
4
3
  export interface ExtraInfo {
5
4
  external?: Record<string, string>;
6
5
  legacy?: boolean;
@@ -19,29 +18,3 @@ export interface MicroMod {
19
18
  moduleFederatedName: string;
20
19
  extraInfo?: ExtraInfo;
21
20
  }
22
- export interface FederationRuntimePlugin {
23
- name: string;
24
- afterResolve?: (args: any) => any;
25
- onLoad?: (args: any) => any;
26
- beforeRequest?: (args: any) => any;
27
- }
28
- export interface WrapperContext {
29
- remoteName: string;
30
- moduleName: string;
31
- props: Record<string, any>;
32
- }
33
- export interface InjectionContext {
34
- remoteName: string;
35
- moduleName: string;
36
- }
37
- export interface ComponentWrapper {
38
- (WrappedComponent: React.ComponentType<any>, context: WrapperContext): React.ComponentType<any>;
39
- }
40
- export interface PropInjector {
41
- (props: Record<string, any>, context: InjectionContext): Record<string, any>;
42
- }
43
- export interface EnhancedRuntimePlugin {
44
- name: string;
45
- wrapComponent?: ComponentWrapper;
46
- injectProps?: PropInjector;
47
- }
package/esm/types.js CHANGED
@@ -1,2 +1 @@
1
- import * as React from "react";
2
- // 不再需要联合类型,两种插件分开管理
1
+ export { };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ice/mf-runtime",
3
- "version": "1.0.2-beta.1",
3
+ "version": "1.0.2-beta.2",
4
4
  "description": "ice mf runtime",
5
5
  "files": [
6
6
  "esm",
@@ -34,9 +34,6 @@
34
34
  "start": "ice-pkg start",
35
35
  "build": "ice-pkg build",
36
36
  "prepublishOnly": "npm run build",
37
- "test": "vitest",
38
- "test:run": "vitest run",
39
- "test:coverage": "vitest run --coverage",
40
37
  "eslint": "eslint --cache --ext .js,.jsx,.ts,.tsx ./",
41
38
  "eslint:fix": "npm run eslint -- --fix",
42
39
  "stylelint": "stylelint \"**/*.{css,scss,less}\"",
@@ -60,19 +57,12 @@
60
57
  "@applint/spec": "^1.2.3",
61
58
  "@ice/pkg": "^1.0.0",
62
59
  "@ice/runtime": "^1.0.0",
63
- "@ice/stark-app": "^1.5.0",
64
- "@testing-library/jest-dom": "^6.0.0",
65
- "@testing-library/react": "^14.0.0",
66
60
  "@types/react": "^18.0.0",
67
61
  "@types/react-dom": "^18.0.0",
68
- "@vitest/coverage-v8": "^1.0.0",
69
62
  "eslint": "^8.0.0",
70
- "jsdom": "^23.0.0",
71
63
  "react": "^18.0.0",
72
64
  "react-dom": "^18.0.0",
73
- "stylelint": "^15.0.0",
74
- "typescript": "^5.0.0",
75
- "vitest": "^1.0.0"
65
+ "stylelint": "^15.0.0"
76
66
  },
77
67
  "publishConfig": {
78
68
  "access": "public",
@@ -1 +0,0 @@
1
- export {};