Skip to content

Commit

Permalink
chore: fix package/workspace build error
Browse files Browse the repository at this point in the history
  • Loading branch information
liujuping committed Dec 27, 2022
1 parent 37dffae commit b65bdc3
Show file tree
Hide file tree
Showing 11 changed files with 27 additions and 45 deletions.
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"lerna": "4.0.0",
"version": "1.0.18",
"version": "1.1.0",
"npmClient": "yarn",
"useWorkspaces": true,
"packages": [
Expand Down
1 change: 0 additions & 1 deletion packages/engine/build.plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ module.exports = ({ context, onGetWebpackConfig }) => {
.use('babel-loader')
.tap((options) => {
const { plugins = [] } = options;
console.log('plugins', plugins);
return {
...options,
plugins: [
Expand Down
1 change: 1 addition & 0 deletions packages/engine/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"@alilc/lowcode-plugin-outline-pane": "1.0.18",
"@alilc/lowcode-shell": "1.0.18",
"@alilc/lowcode-utils": "1.0.18",
"@alilc/lowcode-workspace": "1.0.18",
"react": "^16.8.1",
"react-dom": "^16.8.1"
},
Expand Down
18 changes: 11 additions & 7 deletions packages/engine/src/engine-core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,16 @@ export * from './modules/lowcode-types';

registerDefaults();

const innerWorkspace = new InnerWorkspace();
async function registryInnerPlugin(designer: Designer, editor: Editor, plugins: Plugins) {
// 注册一批内置插件
await plugins.register(OutlinePlugin, {}, { autoInit: true });
await plugins.register(componentMetaParser(designer));
await plugins.register(setterRegistry, {}, { autoInit: true });
await plugins.register(defaultPanelRegistry(editor, designer));
await plugins.register(builtinHotkey);
}

const innerWorkspace = new InnerWorkspace(registryInnerPlugin, shellModelFactory);
const workspace = new Workspace(innerWorkspace);
const editor = new Editor();
globalContext.register(editor, Editor);
Expand Down Expand Up @@ -170,12 +179,7 @@ export async function init(
}
engineConfig.setEngineOptions(engineOptions as any);

// 注册一批内置插件
await plugins.register(OutlinePlugin, {}, { autoInit: true });
await plugins.register(componentMetaParser(designer));
await plugins.register(setterRegistry, {}, { autoInit: true });
await plugins.register(defaultPanelRegistry(editor, designer));
await plugins.register(builtinHotkey);
await registryInnerPlugin(designer, editor, plugins);

await plugins.init(pluginPreference as any);

Expand Down
1 change: 1 addition & 0 deletions packages/shell/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"@alilc/lowcode-editor-skeleton": "1.0.18",
"@alilc/lowcode-types": "1.0.18",
"@alilc/lowcode-utils": "1.0.18",
"@alilc/lowcode-workspace": "1.0.18",
"classnames": "^2.2.6",
"enzyme": "^3.11.0",
"enzyme-adapter-react-16": "^1.15.5",
Expand Down
1 change: 0 additions & 1 deletion packages/workspace/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"version": "1.0.15",
"description": "Shell Layer for AliLowCodeEngine",
"main": "lib/index.js",
"private": true,
"module": "es/index.js",
"files": [
"lib",
Expand Down
19 changes: 4 additions & 15 deletions packages/workspace/src/base-context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import {
import {
Skeleton as InnerSkeleton,
} from '@alilc/lowcode-editor-skeleton';

import {
Hotkey,
Plugins,
Expand All @@ -34,14 +33,8 @@ import {
IPublicTypePluginMeta,
} from '@alilc/lowcode-types';
import { getLogger } from '@alilc/lowcode-utils';
import { OutlinePlugin } from '@alilc/lowcode-plugin-outline-pane';
import { setterRegistry } from '../../engine/src/inner-plugins/setter-registry';
import { componentMetaParser } from '../../engine/src/inner-plugins/component-meta-parser';
import defaultPanelRegistry from '../../engine/src/inner-plugins/default-panel-registry';
import { builtinHotkey } from '../../engine/src/inner-plugins/builtin-hotkey';
import { Workspace as InnerWorkspace } from './index';
import { EditorWindow } from './editor-window/context';
import { shellModelFactory } from './shell-model-factory';

export class BasicContext {
skeleton: Skeleton;
plugins: Plugins;
Expand All @@ -62,7 +55,7 @@ export class BasicContext {
innerPlugins: LowCodePluginManager;
canvas: Canvas;

constructor(innerWorkspace: any, viewName: string, public editorWindow?: EditorWindow) {
constructor(innerWorkspace: InnerWorkspace, viewName: string, public editorWindow?: EditorWindow) {
const editor = new Editor(viewName, true);

const innerSkeleton = new InnerSkeleton(editor, viewName);
Expand All @@ -71,7 +64,7 @@ export class BasicContext {
const designer: Designer = new Designer({
editor,
viewName,
shellModelFactory,
shellModelFactory: innerWorkspace.shellModelFactory,
});
editor.set('designer' as any, designer);

Expand Down Expand Up @@ -138,11 +131,7 @@ export class BasicContext {

// 注册一批内置插件
this.registerInnerPlugins = async function registerPlugins() {
await plugins.register(OutlinePlugin, {}, { autoInit: true });
await plugins.register(componentMetaParser(designer));
await plugins.register(setterRegistry, {}, { autoInit: true });
await plugins.register(defaultPanelRegistry(editor, designer));
await plugins.register(builtinHotkey);
await innerWorkspace.registryInnerPlugin(designer, editor, plugins);
};
}
}
7 changes: 6 additions & 1 deletion packages/workspace/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { Designer } from '@alilc/lowcode-designer';
import { Editor } from '@alilc/lowcode-editor-core';
import {
Skeleton as InnerSkeleton,
} from '@alilc/lowcode-editor-skeleton';
import { Plugins } from '@alilc/lowcode-shell';
import { IPublicResourceOptions } from '@alilc/lowcode-types';
import { EditorWindow } from './editor-window/context';
import { Resource } from './resource';
Expand All @@ -14,7 +16,10 @@ export class Workspace {
readonly editor = new Editor();
readonly skeleton = new InnerSkeleton(this.editor);

constructor() {
constructor(
readonly registryInnerPlugin: (designer: Designer, editor: Editor, plugins: Plugins) => Promise<void>,
readonly shellModelFactory: any,
) {
if (this.defaultResource) {
this.window = new EditorWindow(this.defaultResource, this);
}
Expand Down
18 changes: 0 additions & 18 deletions packages/workspace/src/shell-model-factory.ts

This file was deleted.

1 change: 1 addition & 0 deletions scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ lerna run build \
--scope @alilc/lowcode-react-renderer \
--scope @alilc/lowcode-react-simulator-renderer \
--scope @alilc/lowcode-renderer-core \
--scope @alilc/lowcode-workspace \
--scope @alilc/lowcode-engine \
--stream

Expand Down
3 changes: 2 additions & 1 deletion scripts/sync.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ tnpm sync @alilc/lowcode-rax-renderer
tnpm sync @alilc/lowcode-rax-simulator-renderer
tnpm sync @alilc/lowcode-react-renderer
tnpm sync @alilc/lowcode-react-simulator-renderer
tnpm sync @alilc/lowcode-engine
tnpm sync @alilc/lowcode-engine
tnpm sync @alilc/lowcode-workspace

0 comments on commit b65bdc3

Please sign in to comment.