GeezerVison is showing github.com — chore: fix package/workspace build error · hengleeme/lowcode-engine@1342481
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: lerna.json +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 1 | 1 | { | 2 | 2 | "lerna": "4.0.0", | 3 | | - "version": "1.0.18", | | 3 | + "version": "1.1.0", | 4 | 4 | "npmClient": "yarn", | 5 | 5 | "useWorkspaces": true, | 6 | 6 | "packages": [ | |
Collapse file Copy file name to clipboardExpand all lines: packages/engine/build.plugin.js -1Lines changed: 0 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -34,7 +34,6 @@ module.exports = ({ context, onGetWebpackConfig }) => { | 34 | 34 | .use('babel-loader') | 35 | 35 | .tap((options) => { | 36 | 36 | const { plugins = [] } = options; | 37 | | - console.log('plugins', plugins); | 38 | 37 | return { | 39 | 38 | ...options, | 40 | 39 | plugins: [ | |
Collapse file Copy file name to clipboardExpand all lines: packages/engine/package.json +1Lines changed: 1 addition & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 27 | 27 | "@alilc/lowcode-plugin-outline-pane": "1.0.18", | 28 | 28 | "@alilc/lowcode-shell": "1.0.18", | 29 | 29 | "@alilc/lowcode-utils": "1.0.18", | | 30 | + "@alilc/lowcode-workspace": "1.0.18", | 30 | 31 | "react": "^16.8.1", | 31 | 32 | "react-dom": "^16.8.1" | 32 | 33 | }, | |
Collapse file Copy file name to clipboardExpand all lines: packages/engine/src/engine-core.ts +11-7Lines changed: 11 additions & 7 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -61,7 +61,16 @@ export * from './modules/lowcode-types'; | 61 | 61 |
| 62 | 62 | registerDefaults(); | 63 | 63 |
| 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); | 65 | 74 | const workspace = new Workspace(innerWorkspace); | 66 | 75 | const editor = new Editor(); | 67 | 76 | globalContext.register(editor, Editor); | @@ -170,12 +179,7 @@ export async function init( | 170 | 179 | } | 171 | 180 | engineConfig.setEngineOptions(engineOptions as any); | 172 | 181 |
| 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); | 179 | 183 |
| 180 | 184 | await plugins.init(pluginPreference as any); | 181 | 185 |
| |
Collapse file Copy file name to clipboardExpand all lines: packages/renderer-core/tests/setup.ts -13Lines changed: 0 additions & 13 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 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 | | - | 14 | 1 | jest.mock('lodash', () => { | 15 | 2 | const original = jest.requireActual('lodash'); | 16 | 3 |
| |
Collapse file Copy file name to clipboardExpand all lines: packages/shell/package.json +1Lines changed: 1 addition & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 20 | 20 | "@alilc/lowcode-editor-skeleton": "1.0.18", | 21 | 21 | "@alilc/lowcode-types": "1.0.18", | 22 | 22 | "@alilc/lowcode-utils": "1.0.18", | | 23 | + "@alilc/lowcode-workspace": "1.0.18", | 23 | 24 | "classnames": "^2.2.6", | 24 | 25 | "enzyme": "^3.11.0", | 25 | 26 | "enzyme-adapter-react-16": "^1.15.5", | |
Collapse file Copy file name to clipboardExpand all lines: packages/workspace/package.json -1Lines changed: 0 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 3 | 3 | "version": "1.0.18", | 4 | 4 | "description": "Shell Layer for AliLowCodeEngine", | 5 | 5 | "main": "lib/index.js", | 6 | | - "private": true, | 7 | 6 | "module": "es/index.js", | 8 | 7 | "files": [ | 9 | 8 | "lib", | |
Collapse file Copy file name to clipboardExpand all lines: packages/workspace/src/base-context.ts +4-15Lines changed: 4 additions & 15 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -16,7 +16,6 @@ import { | 16 | 16 | import { | 17 | 17 | Skeleton as InnerSkeleton, | 18 | 18 | } from '@alilc/lowcode-editor-skeleton'; | 19 | | - | 20 | 19 | import { | 21 | 20 | Hotkey, | 22 | 21 | Plugins, | @@ -34,14 +33,8 @@ import { | 34 | 33 | IPublicTypePluginMeta, | 35 | 34 | } from '@alilc/lowcode-types'; | 36 | 35 | 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'; | 42 | 37 | import { EditorWindow } from './editor-window/context'; | 43 | | -import { shellModelFactory } from './shell-model-factory'; | 44 | | - | 45 | 38 | export class BasicContext { | 46 | 39 | skeleton: Skeleton; | 47 | 40 | plugins: Plugins; | @@ -62,7 +55,7 @@ export class BasicContext { | 62 | 55 | innerPlugins: LowCodePluginManager; | 63 | 56 | canvas: Canvas; | 64 | 57 |
| 65 | | - constructor(innerWorkspace: any, viewName: string, public editorWindow?: EditorWindow) { | | 58 | + constructor(innerWorkspace: InnerWorkspace, viewName: string, public editorWindow?: EditorWindow) { | 66 | 59 | const editor = new Editor(viewName, true); | 67 | 60 |
| 68 | 61 | const innerSkeleton = new InnerSkeleton(editor, viewName); | @@ -71,7 +64,7 @@ export class BasicContext { | 71 | 64 | const designer: Designer = new Designer({ | 72 | 65 | editor, | 73 | 66 | viewName, | 74 | | - shellModelFactory, | | 67 | + shellModelFactory: innerWorkspace.shellModelFactory, | 75 | 68 | }); | 76 | 69 | editor.set('designer' as any, designer); | 77 | 70 |
| @@ -138,11 +131,7 @@ export class BasicContext { | 138 | 131 |
| 139 | 132 | // 注册一批内置插件 | 140 | 133 | 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); | 146 | 135 | }; | 147 | 136 | } | 148 | 137 | } |
Collapse file Copy file name to clipboardExpand all lines: packages/workspace/src/index.ts +6-1Lines changed: 6 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| | 1 | +import { Designer } from '@alilc/lowcode-designer'; | 1 | 2 | import { Editor } from '@alilc/lowcode-editor-core'; | 2 | 3 | import { | 3 | 4 | Skeleton as InnerSkeleton, | 4 | 5 | } from '@alilc/lowcode-editor-skeleton'; | | 6 | +import { Plugins } from '@alilc/lowcode-shell'; | 5 | 7 | import { IPublicResourceOptions } from '@alilc/lowcode-types'; | 6 | 8 | import { EditorWindow } from './editor-window/context'; | 7 | 9 | import { Resource } from './resource'; | @@ -14,7 +16,10 @@ export class Workspace { | 14 | 16 | readonly editor = new Editor(); | 15 | 17 | readonly skeleton = new InnerSkeleton(this.editor); | 16 | 18 |
| 17 | | - constructor() { | | 19 | + constructor( | | 20 | + readonly registryInnerPlugin: (designer: Designer, editor: Editor, plugins: Plugins) => Promise<void>, | | 21 | + readonly shellModelFactory: any, | | 22 | + ) { | 18 | 23 | if (this.defaultResource) { | 19 | 24 | this.window = new EditorWindow(this.defaultResource, this); | 20 | 25 | } | |
Collapse file Copy file name to clipboardExpand all lines: packages/workspace/src/shell-model-factory.ts -18Lines changed: 0 additions & 18 deletions
|