Skip to content

Commit 1342481

Browse files
liujupingJackLian
authored andcommitted
chore: fix package/workspace build error
1 parent a1828b1 commit 1342481

File tree

12 files changed

+27
-58
lines changed

12 files changed

+27
-58
lines changed

lerna.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"lerna": "4.0.0",
3-
"version": "1.0.18",
3+
"version": "1.1.0",
44
"npmClient": "yarn",
55
"useWorkspaces": true,
66
"packages": [

packages/engine/build.plugin.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ module.exports = ({ context, onGetWebpackConfig }) => {
3434
.use('babel-loader')
3535
.tap((options) => {
3636
const { plugins = [] } = options;
37-
console.log('plugins', plugins);
3837
return {
3938
...options,
4039
plugins: [

packages/engine/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
"@alilc/lowcode-plugin-outline-pane": "1.0.18",
2828
"@alilc/lowcode-shell": "1.0.18",
2929
"@alilc/lowcode-utils": "1.0.18",
30+
"@alilc/lowcode-workspace": "1.0.18",
3031
"react": "^16.8.1",
3132
"react-dom": "^16.8.1"
3233
},

packages/engine/src/engine-core.ts

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,16 @@ export * from './modules/lowcode-types';
6161

6262
registerDefaults();
6363

64-
const innerWorkspace = new InnerWorkspace();
64+
async function registryInnerPlugin(designer: Designer, editor: Editor, plugins: Plugins) {
65+
// 注册一批内置插件
66+
await plugins.register(OutlinePlugin, {}, { autoInit: true });
67+
await plugins.register(componentMetaParser(designer));
68+
await plugins.register(setterRegistry, {}, { autoInit: true });
69+
await plugins.register(defaultPanelRegistry(editor, designer));
70+
await plugins.register(builtinHotkey);
71+
}
72+
73+
const innerWorkspace = new InnerWorkspace(registryInnerPlugin, shellModelFactory);
6574
const workspace = new Workspace(innerWorkspace);
6675
const editor = new Editor();
6776
globalContext.register(editor, Editor);
@@ -170,12 +179,7 @@ export async function init(
170179
}
171180
engineConfig.setEngineOptions(engineOptions as any);
172181

173-
// 注册一批内置插件
174-
await plugins.register(OutlinePlugin, {}, { autoInit: true });
175-
await plugins.register(componentMetaParser(designer));
176-
await plugins.register(setterRegistry, {}, { autoInit: true });
177-
await plugins.register(defaultPanelRegistry(editor, designer));
178-
await plugins.register(builtinHotkey);
182+
await registryInnerPlugin(designer, editor, plugins);
179183

180184
await plugins.init(pluginPreference as any);
181185

packages/renderer-core/tests/setup.ts

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,3 @@
1-
jest.mock('zen-logger', () => {
2-
class Logger {
3-
log() {}
4-
error() {}
5-
warn() {}
6-
debug() {}
7-
}
8-
return {
9-
__esModule: true,
10-
default: Logger,
11-
};
12-
});
13-
141
jest.mock('lodash', () => {
152
const original = jest.requireActual('lodash');
163

packages/shell/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
"@alilc/lowcode-editor-skeleton": "1.0.18",
2121
"@alilc/lowcode-types": "1.0.18",
2222
"@alilc/lowcode-utils": "1.0.18",
23+
"@alilc/lowcode-workspace": "1.0.18",
2324
"classnames": "^2.2.6",
2425
"enzyme": "^3.11.0",
2526
"enzyme-adapter-react-16": "^1.15.5",

packages/workspace/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
"version": "1.0.18",
44
"description": "Shell Layer for AliLowCodeEngine",
55
"main": "lib/index.js",
6-
"private": true,
76
"module": "es/index.js",
87
"files": [
98
"lib",

packages/workspace/src/base-context.ts

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import {
1616
import {
1717
Skeleton as InnerSkeleton,
1818
} from '@alilc/lowcode-editor-skeleton';
19-
2019
import {
2120
Hotkey,
2221
Plugins,
@@ -34,14 +33,8 @@ import {
3433
IPublicTypePluginMeta,
3534
} from '@alilc/lowcode-types';
3635
import { getLogger } from '@alilc/lowcode-utils';
37-
import { OutlinePlugin } from '@alilc/lowcode-plugin-outline-pane';
38-
import { setterRegistry } from '../../engine/src/inner-plugins/setter-registry';
39-
import { componentMetaParser } from '../../engine/src/inner-plugins/component-meta-parser';
40-
import defaultPanelRegistry from '../../engine/src/inner-plugins/default-panel-registry';
41-
import { builtinHotkey } from '../../engine/src/inner-plugins/builtin-hotkey';
36+
import { Workspace as InnerWorkspace } from './index';
4237
import { EditorWindow } from './editor-window/context';
43-
import { shellModelFactory } from './shell-model-factory';
44-
4538
export class BasicContext {
4639
skeleton: Skeleton;
4740
plugins: Plugins;
@@ -62,7 +55,7 @@ export class BasicContext {
6255
innerPlugins: LowCodePluginManager;
6356
canvas: Canvas;
6457

65-
constructor(innerWorkspace: any, viewName: string, public editorWindow?: EditorWindow) {
58+
constructor(innerWorkspace: InnerWorkspace, viewName: string, public editorWindow?: EditorWindow) {
6659
const editor = new Editor(viewName, true);
6760

6861
const innerSkeleton = new InnerSkeleton(editor, viewName);
@@ -71,7 +64,7 @@ export class BasicContext {
7164
const designer: Designer = new Designer({
7265
editor,
7366
viewName,
74-
shellModelFactory,
67+
shellModelFactory: innerWorkspace.shellModelFactory,
7568
});
7669
editor.set('designer' as any, designer);
7770

@@ -138,11 +131,7 @@ export class BasicContext {
138131

139132
// 注册一批内置插件
140133
this.registerInnerPlugins = async function registerPlugins() {
141-
await plugins.register(OutlinePlugin, {}, { autoInit: true });
142-
await plugins.register(componentMetaParser(designer));
143-
await plugins.register(setterRegistry, {}, { autoInit: true });
144-
await plugins.register(defaultPanelRegistry(editor, designer));
145-
await plugins.register(builtinHotkey);
134+
await innerWorkspace.registryInnerPlugin(designer, editor, plugins);
146135
};
147136
}
148137
}

packages/workspace/src/index.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1+
import { Designer } from '@alilc/lowcode-designer';
12
import { Editor } from '@alilc/lowcode-editor-core';
23
import {
34
Skeleton as InnerSkeleton,
45
} from '@alilc/lowcode-editor-skeleton';
6+
import { Plugins } from '@alilc/lowcode-shell';
57
import { IPublicResourceOptions } from '@alilc/lowcode-types';
68
import { EditorWindow } from './editor-window/context';
79
import { Resource } from './resource';
@@ -14,7 +16,10 @@ export class Workspace {
1416
readonly editor = new Editor();
1517
readonly skeleton = new InnerSkeleton(this.editor);
1618

17-
constructor() {
19+
constructor(
20+
readonly registryInnerPlugin: (designer: Designer, editor: Editor, plugins: Plugins) => Promise<void>,
21+
readonly shellModelFactory: any,
22+
) {
1823
if (this.defaultResource) {
1924
this.window = new EditorWindow(this.defaultResource, this);
2025
}

packages/workspace/src/shell-model-factory.ts

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)