MCPcopy Create free account
hub / github.com/alibaba/lowcode-graph / init

Function init

packages/plugin-core/src/index.ts:7–21  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

5const PluginCore = (ctx: IPublicModelPluginContext, options: any) => {
6 return {
7 async init() {
8 const { material, project, plugins } = ctx;
9 const { assets, schema } = options;
10 await plugins.register(Inject);
11 // 注册 components,加载所有的 meta js
12 await material.setAssets(await injectAssets(assets));
13
14 // 加载 schema
15 project.openDocument(schema);
16
17 // 简单处理 init 时候直接 load 所有组件 view
18 const loader = new AssetLoader();
19 const componentsAssets = assets.packages.map((asset: any) => asset.urls).flat();
20 await loader.load(componentsAssets);
21 },
22 }
23}
24

Callers

nothing calls this directly

Calls 1

registerMethod · 0.80

Tested by

no test coverage detected