mirror of
https://github.com/smartxworks/sunmao-ui.git
synced 2025-04-12 21:50:23 +08:00
support cross package import @mata-io/runtime
This commit is contained in:
parent
0546d60a2f
commit
92a11a1458
@ -6,7 +6,7 @@
|
||||
"homepage": "https://github.com/webzard-io/meta-ui#readme",
|
||||
"license": "MIT",
|
||||
"module": "lib/index.js",
|
||||
"typings": "typings/index.d.ts",
|
||||
"types": "lib/index.d.ts",
|
||||
"directories": {
|
||||
"lib": "lib",
|
||||
"test": "__tests__"
|
||||
@ -20,7 +20,7 @@
|
||||
},
|
||||
"scripts": {
|
||||
"build": "tsc -b .",
|
||||
"typings": "tsc -d --emitDeclarationOnly --declarationDir typings",
|
||||
"typings": "tsc -d",
|
||||
"test": "jest",
|
||||
"lint": "eslint src --ext .ts",
|
||||
"prepublish": "npm run build && npm run typings"
|
||||
|
@ -1,6 +1,6 @@
|
||||
import React from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
import { App } from '@meta-ui/runtime';
|
||||
import { App } from './metaUI';
|
||||
import { DialogFormSchema } from './constants';
|
||||
|
||||
export default function renderApp() {
|
||||
|
7
packages/editor/src/metaUI.ts
Normal file
7
packages/editor/src/metaUI.ts
Normal file
@ -0,0 +1,7 @@
|
||||
import { InitMetaUI } from '@meta-ui/runtime';
|
||||
|
||||
const metaUI = InitMetaUI();
|
||||
|
||||
export const App = metaUI.App;
|
||||
export const registry = metaUI.registry;
|
||||
export const stateStore = metaUI.stateStore;
|
@ -5,7 +5,7 @@
|
||||
"dev": "vite",
|
||||
"test": "jest",
|
||||
"build": "tsc -b .",
|
||||
"typings": "tsc -d --emitDeclarationOnly --declarationDir typings",
|
||||
"typings": "tsc -d",
|
||||
"lint": "eslint src --ext .ts",
|
||||
"prepublish": "npm run build && npm run typings"
|
||||
},
|
||||
@ -13,7 +13,7 @@
|
||||
"lib"
|
||||
],
|
||||
"module": "lib/index.js",
|
||||
"typings": "typings/index.d.ts",
|
||||
"types": "lib/index.d.ts",
|
||||
"dependencies": {
|
||||
"@chakra-ui/react": "^1.6.5",
|
||||
"@emotion/react": "^11",
|
||||
|
@ -1,3 +1,11 @@
|
||||
export * from './App';
|
||||
export * from './api-service';
|
||||
export * from './store';
|
||||
import { stateStore } from './store';
|
||||
import { App } from './App';
|
||||
import { registry } from './registry';
|
||||
|
||||
export function InitMetaUI() {
|
||||
return {
|
||||
App,
|
||||
stateStore,
|
||||
registry,
|
||||
};
|
||||
}
|
||||
|
@ -97,7 +97,7 @@ export type TraitImplementation<T = any> = (
|
||||
}
|
||||
) => TraitResult;
|
||||
|
||||
class Registry {
|
||||
export class Registry {
|
||||
components: Map<string, Map<string, ImplementedRuntimeComponent>> = new Map();
|
||||
traits: Map<string, Map<string, ImplementedRuntimeTrait>> = new Map();
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { RuntimeApplication } from '@meta-ui/core';
|
||||
import { TSchema } from '@sinclair/typebox';
|
||||
import { RuntimeApplication } from '../../../core/typings';
|
||||
import { registry } from '../registry';
|
||||
import { stateStore } from '../store';
|
||||
import { parseTypeBox } from './parseTypeBox';
|
||||
|
Loading…
x
Reference in New Issue
Block a user