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:
EYHN
2024-01-30 06:31:23 +00:00
parent 4f7e0d012d
commit 2e71c980cf
37 changed files with 3082 additions and 4 deletions
+8 -1
View File
@@ -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);
}