1
0
mirror of synced 2026-03-25 04:28:34 +08:00

refactor: 将data-source,dep,schema,utils收敛到core,将form,table,stage,design,util收敛到editor

This commit is contained in:
roymondchen
2024-09-04 17:25:33 +08:00
committed by roymondchen
parent c3bc1035ad
commit 34fc0a15b9
212 changed files with 634 additions and 778 deletions

View File

@@ -1,17 +1,9 @@
import { describe, expect, test } from 'vitest';
import { MApp, NodeType } from '@tmagic/schema';
import TMagicApp, { type MApp, NodeType } from '@tmagic/core';
import { createDataSourceManager, DataSourceManager } from '@data-source/index';
class Core {
public dsl?: MApp;
constructor(options: any) {
this.dsl = options.config;
}
}
const dsl: MApp = {
type: NodeType.ROOT,
id: 'app_1',
@@ -46,13 +38,14 @@ const dsl: MApp = {
},
],
methods: [],
events: [],
},
],
};
describe('createDataSourceManager', () => {
test('instance', () => {
const manager = createDataSourceManager(new Core({ config: dsl }));
const manager = createDataSourceManager(new TMagicApp({ config: dsl }));
expect(manager).toBeInstanceOf(DataSourceManager);
});
});