mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-09-07 09:21:24 +08:00
feat(infra): new workspace infra (#5617)
This PR copying @affine/workspace into common/infra, and adding definitions for services and unit tests.
This commit is contained in:
@@ -5,17 +5,24 @@ export * from './command';
|
||||
export * from './di';
|
||||
export * from './livedata';
|
||||
export * from './storage';
|
||||
export * from './utils';
|
||||
export * from './workspace';
|
||||
|
||||
import type { ServiceCollection } from './di';
|
||||
import { CleanupService } from './lifecycle';
|
||||
import { GlobalCache, GlobalState, MemoryMemento } from './storage';
|
||||
import {
|
||||
configureTestingWorkspaceServices,
|
||||
configureWorkspaceServices,
|
||||
} from './workspace';
|
||||
|
||||
export function configureInfraServices(services: ServiceCollection) {
|
||||
services.add(CleanupService);
|
||||
configureWorkspaceServices(services);
|
||||
}
|
||||
|
||||
export function configureTestingInfraServices(services: ServiceCollection) {
|
||||
configureInfraServices(services);
|
||||
configureTestingWorkspaceServices(services);
|
||||
services.addImpl(GlobalCache, MemoryMemento);
|
||||
services.addImpl(GlobalState, MemoryMemento);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user