mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-01-12 08:58:15 +00:00
refactor: 优化 engine 内部结构
fix: 修复 deploy.sh 中包名使用错误
This commit is contained in:
parent
f8615bc63d
commit
89cf37505e
@ -14,7 +14,6 @@
|
||||
"clean": "rm -rf ./packages/*/lib ./packages/*/es ./packages/*/dist ./packages/*/build",
|
||||
"lint": "eslint --ext .ts,.tsx,.js,.jsx ./ --quiet",
|
||||
"lint:fix": "eslint --ext .ts,.tsx,.js,.jsx ./ --quiet --fix",
|
||||
"watchdog:build": "node ./scripts/watchdog.js",
|
||||
"pub": "tnpm run watchdog:build && lerna publish --force-publish --cd-version patch",
|
||||
"pub:prepatch": "tnpm run watchdog:build && lerna publish --force-publish --cd-version prepatch --npm-tag beta --preid beta",
|
||||
"pub:prerelease": "tnpm run watchdog:build && lerna publish --force-publish --cd-version prerelease --npm-tag beta --preid beta",
|
||||
@ -24,6 +23,7 @@
|
||||
"start:server": "./scripts/start-server.sh",
|
||||
"test": "lerna run test --stream",
|
||||
"test:snapshot": "lerna run test:snapshot",
|
||||
"watchdog:build": "node ./scripts/watchdog.js",
|
||||
"xima:fix": "xima fix",
|
||||
"xima:scan": "xima scan"
|
||||
},
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
"version": "1.0.30-beta.8",
|
||||
"description": "Universal API for AliLowCode engine",
|
||||
"main": "lib/index.js",
|
||||
"module": "es/index.js",
|
||||
"private": true,
|
||||
"files": [
|
||||
"dist",
|
||||
|
||||
@ -1,60 +0,0 @@
|
||||
import { isJSBlock, isJSExpression, isJSSlot } from '@ali/lowcode-types';
|
||||
import { isPlainObject, hasOwnProperty, cloneDeep, isI18NObject, isUseI18NSetter, convertToI18NObject, isString } from '@ali/lowcode-utils';
|
||||
import { globalContext, Editor } from '@ali/lowcode-editor-core';
|
||||
import { Designer, LiveEditing, TransformStage, Node, getConvertedExtraKey, LowCodePluginManager } from '@ali/lowcode-designer';
|
||||
import Outline, { OutlineBackupPane, getTreeMaster } from '@ali/lowcode-plugin-outline-pane';
|
||||
|
||||
import DesignerPlugin from '@ali/lowcode-plugin-designer';
|
||||
import { Skeleton, SettingsPrimaryPane, registerDefaults } from '@ali/lowcode-editor-skeleton';
|
||||
|
||||
export const editor = new Editor();
|
||||
globalContext.register(editor, Editor);
|
||||
|
||||
export const skeleton = new Skeleton(editor);
|
||||
editor.set(Skeleton, skeleton);
|
||||
editor.set('skeleton', skeleton);
|
||||
registerDefaults();
|
||||
|
||||
export const designer = new Designer({ editor });
|
||||
editor.set(Designer, designer);
|
||||
editor.set('designer', designer);
|
||||
|
||||
export const plugins = (new LowCodePluginManager(editor)).toProxy();
|
||||
editor.set('plugins', plugins);
|
||||
|
||||
|
||||
skeleton.add({
|
||||
area: 'mainArea',
|
||||
name: 'designer',
|
||||
type: 'Widget',
|
||||
content: DesignerPlugin,
|
||||
});
|
||||
skeleton.add({
|
||||
area: 'rightArea',
|
||||
name: 'settingsPane',
|
||||
type: 'Panel',
|
||||
content: SettingsPrimaryPane,
|
||||
props: {
|
||||
ignoreRoot: true,
|
||||
},
|
||||
});
|
||||
skeleton.add({
|
||||
area: 'leftArea',
|
||||
name: 'outlinePane',
|
||||
type: 'PanelDock',
|
||||
content: Outline,
|
||||
panelProps: {
|
||||
area: 'leftFixedArea',
|
||||
},
|
||||
});
|
||||
skeleton.add({
|
||||
area: 'rightArea',
|
||||
name: 'backupOutline',
|
||||
type: 'Panel',
|
||||
props: {
|
||||
condition: () => {
|
||||
return designer.dragon.dragging && !getTreeMaster(designer).hasVisibleTreeBoard();
|
||||
},
|
||||
},
|
||||
content: OutlineBackupPane,
|
||||
});
|
||||
@ -1,10 +1,64 @@
|
||||
import { createElement } from 'react';
|
||||
import { render } from 'react-dom';
|
||||
import { globalContext, Editor } from '@ali/lowcode-editor-core';
|
||||
import { Designer, LiveEditing, TransformStage, Node, getConvertedExtraKey, LowCodePluginManager } from '@ali/lowcode-designer';
|
||||
import Outline, { OutlineBackupPane, getTreeMaster } from '@ali/lowcode-plugin-outline-pane';
|
||||
import * as editorHelper from '@ali/lowcode-editor-core';
|
||||
import * as designerHelper from '@ali/lowcode-designer';
|
||||
// import { Node } from '@ali/lowcode-designer';
|
||||
import { skeleton, designer, editor, plugins } from './editor';
|
||||
import * as skeletonHelper from '@ali/lowcode-editor-skeleton';
|
||||
import DesignerPlugin from '@ali/lowcode-plugin-designer';
|
||||
import { Skeleton, SettingsPrimaryPane, registerDefaults } from '@ali/lowcode-editor-skeleton';
|
||||
|
||||
const editor = new Editor();
|
||||
globalContext.register(editor, Editor);
|
||||
|
||||
const skeleton = new Skeleton(editor);
|
||||
editor.set(Skeleton, skeleton);
|
||||
editor.set('skeleton', skeleton);
|
||||
registerDefaults();
|
||||
|
||||
const designer = new Designer({ editor });
|
||||
editor.set(Designer, designer);
|
||||
editor.set('designer', designer);
|
||||
|
||||
const plugins = (new LowCodePluginManager(editor)).toProxy();
|
||||
editor.set('plugins', plugins);
|
||||
|
||||
skeleton.add({
|
||||
area: 'mainArea',
|
||||
name: 'designer',
|
||||
type: 'Widget',
|
||||
content: DesignerPlugin,
|
||||
});
|
||||
skeleton.add({
|
||||
area: 'rightArea',
|
||||
name: 'settingsPane',
|
||||
type: 'Panel',
|
||||
content: SettingsPrimaryPane,
|
||||
props: {
|
||||
ignoreRoot: true,
|
||||
},
|
||||
});
|
||||
skeleton.add({
|
||||
area: 'leftArea',
|
||||
name: 'outlinePane',
|
||||
type: 'PanelDock',
|
||||
content: Outline,
|
||||
panelProps: {
|
||||
area: 'leftFixedArea',
|
||||
},
|
||||
});
|
||||
skeleton.add({
|
||||
area: 'rightArea',
|
||||
name: 'backupOutline',
|
||||
type: 'Panel',
|
||||
props: {
|
||||
condition: () => {
|
||||
return designer.dragon.dragging && !getTreeMaster(designer).hasVisibleTreeBoard();
|
||||
},
|
||||
},
|
||||
content: OutlineBackupPane,
|
||||
});
|
||||
|
||||
const { project, currentSelection: selection } = designer;
|
||||
const { hotkey, monitor, getSetter, registerSetter } = editorHelper;
|
||||
@ -59,7 +113,7 @@ export {
|
||||
// store,
|
||||
hotkey,
|
||||
monitor,
|
||||
}
|
||||
};
|
||||
|
||||
export async function init(container?: Element) {
|
||||
let engineContainer = container;
|
||||
@ -79,12 +133,3 @@ export async function init(container?: Element) {
|
||||
engineContainer,
|
||||
);
|
||||
}
|
||||
|
||||
const version = '{{VERSION_PLACEHOLDER}}';
|
||||
|
||||
console.log(
|
||||
`%c AliLowCodeEngine %c v${version} `,
|
||||
'padding: 2px 1px; border-radius: 3px 0 0 3px; color: #fff; background: #606060; font-weight: bold;',
|
||||
'padding: 2px 1px; border-radius: 0 3px 3px 0; color: #fff; background: #42c02e; font-weight: bold;',
|
||||
);
|
||||
|
||||
|
||||
10
packages/engine/src/port.ts
Normal file
10
packages/engine/src/port.ts
Normal file
@ -0,0 +1,10 @@
|
||||
import './index';
|
||||
|
||||
const version = '{{VERSION_PLACEHOLDER}}';
|
||||
|
||||
console.log(
|
||||
`%c AliLowCodeEngine %c v${version} `,
|
||||
'padding: 2px 1px; border-radius: 3px 0 0 3px; color: #fff; background: #606060; font-weight: bold;',
|
||||
'padding: 2px 1px; border-radius: 0 3px 3px 0; color: #fff; background: #42c02e; font-weight: bold;',
|
||||
);
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
{
|
||||
"entry": {
|
||||
"editor-preset-vision": "../editor-preset-vision/src/index.ts",
|
||||
"engine": "../engine/src/index.ts",
|
||||
"engine": "../engine/src/port.ts",
|
||||
"vision-polyfill": "../vision-polyfill/src/index.ts",
|
||||
"react-simulator-renderer": "../react-simulator-renderer/src/index.ts",
|
||||
"rax-simulator-renderer": "../rax-simulator-renderer/src/index.ts"
|
||||
|
||||
@ -36,8 +36,8 @@ cd $WORK_DIR
|
||||
mv deploy-space/packages/react-simulator-renderer/dist $BUILD_DEST
|
||||
mv deploy-space/packages/rax-simulator-renderer/dist/* $BUILD_DEST
|
||||
mv deploy-space/packages/editor-preset-vision/dist/* $BUILD_DEST
|
||||
mv deploy-space/packages/editor-engine/dist/* $BUILD_DEST
|
||||
mv deploy-space/packages/editor-vision-polyfill/dist/* $BUILD_DEST
|
||||
mv deploy-space/packages/engine/dist/* $BUILD_DEST
|
||||
mv deploy-space/packages/vision-polyfill/dist/* $BUILD_DEST
|
||||
# mv deploy-space/packages/editor-preset-general/dist/* $BUILD_DEST
|
||||
# cp deploy-space/static/* $BUILD_DEST
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user