building out frontend and docker
This commit is contained in:
@@ -4,8 +4,14 @@ import { SqliteProjectRepository } from '#lib/server/adapters/sqlite/project-rep
|
||||
import { SqliteRunRepository } from '#lib/server/adapters/sqlite/run-repository.ts';
|
||||
import { SyncEngine } from '#lib/server/sync/core/engine.ts';
|
||||
import { PatternIgnorePolicy } from '#lib/server/sync/core/ignore.ts';
|
||||
import type { Logger } from '#lib/server/sync/core/ports.ts';
|
||||
import type {
|
||||
Logger,
|
||||
SourceRootResolver,
|
||||
TargetRootResolver
|
||||
} from '#lib/server/sync/core/ports.ts';
|
||||
import { Reconciler } from '#lib/server/sync/core/reconciler.ts';
|
||||
import { ProjectService } from '#lib/server/sync/project-service.ts';
|
||||
import { StatusService } from '#lib/server/status/status-service.ts';
|
||||
import { FakeAcc } from '#lib/server/adapters/simulated/fake-acc.ts';
|
||||
import { FakeDrive } from '#lib/server/adapters/simulated/fake-drive.ts';
|
||||
|
||||
@@ -53,6 +59,40 @@ export async function createHarness({ maxAttempts = 3 } = {}) {
|
||||
targetDisplayPath: 'Project X/Project Files'
|
||||
});
|
||||
|
||||
/** Stands in for the coordinator: tests add project IDs to mark them as running. */
|
||||
const running = new Set<string>();
|
||||
const activity = { isRunning: (id: string) => running.has(id) };
|
||||
|
||||
/** Resolves any input to a new folder of that name on each side. */
|
||||
const resolver: SourceRootResolver & TargetRootResolver = {
|
||||
resolveSourceRoot: async (input) => ({
|
||||
root: {
|
||||
siteId: 'site',
|
||||
driveId: 'drive',
|
||||
rootItemId: drive.addFolder(drive.driveRootId, input)
|
||||
},
|
||||
displayPath: `SharePoint/${input}`
|
||||
}),
|
||||
resolveTargetRoot: async (input) => ({
|
||||
root: {
|
||||
hubId: 'hub',
|
||||
projectId: 'acc-project',
|
||||
rootFolderId: acc.addFolderByHand(acc.rootFolderId, input)
|
||||
},
|
||||
displayPath: `ACC/${input}`
|
||||
})
|
||||
};
|
||||
|
||||
const projectService = new ProjectService({
|
||||
projects,
|
||||
items,
|
||||
sourceResolver: resolver,
|
||||
targetResolver: resolver,
|
||||
activity,
|
||||
maxAttempts
|
||||
});
|
||||
const status = new StatusService({ projects, items, runs, activity, clock, retentionDays: 7 });
|
||||
|
||||
return {
|
||||
db,
|
||||
drive,
|
||||
@@ -62,6 +102,9 @@ export async function createHarness({ maxAttempts = 3 } = {}) {
|
||||
items,
|
||||
runs,
|
||||
engine,
|
||||
projectService,
|
||||
status,
|
||||
running,
|
||||
project,
|
||||
sync: () => engine.runProject(project.id, 'schedule'),
|
||||
itemNamed: async (name: string) =>
|
||||
|
||||
Reference in New Issue
Block a user