refactor(core): move infra modules to core (#9207)

This commit is contained in:
EYHN
2024-12-23 04:53:59 +00:00
parent 2ea79d25ad
commit 129f94ee78
337 changed files with 908 additions and 1367 deletions

View File

@@ -1,20 +1,16 @@
import { DebugLogger } from '@affine/debug';
import type {
Job,
JobQueue,
WorkspaceLocalState,
WorkspaceService,
} from '@toeverything/infra';
import type { Job, JobQueue } from '@toeverything/infra';
import {
Entity,
IndexedDBIndexStorage,
IndexedDBJobQueue,
JobRunner,
LiveData,
WorkspaceDBService,
} from '@toeverything/infra';
import { map } from 'rxjs';
import { WorkspaceDBService } from '../../db';
import type { WorkspaceLocalState, WorkspaceService } from '../../workspace';
import { blockIndexSchema, docIndexSchema } from '../schema';
import { createWorker, type IndexerWorker } from '../worker/out-worker';

View File

@@ -1,12 +1,12 @@
export { DocsSearchService } from './services/docs-search';
import { type Framework } from '@toeverything/infra';
import {
type Framework,
WorkspaceLocalState,
WorkspaceScope,
WorkspaceService,
} from '@toeverything/infra';
} from '../workspace';
import { DocsIndexer } from './entities/docs-indexer';
import { DocsSearchService } from './services/docs-search';

View File

@@ -1,16 +1,12 @@
import { toURLSearchParams } from '@affine/core/modules/navigation';
import type { ReferenceParams } from '@blocksuite/blocks';
import type { WorkspaceService } from '@toeverything/infra';
import {
fromPromise,
OnEvent,
Service,
WorkspaceEngineBeforeStart,
} from '@toeverything/infra';
import { fromPromise, OnEvent, Service } from '@toeverything/infra';
import { isEmpty, omit } from 'lodash-es';
import { map, type Observable, switchMap } from 'rxjs';
import { z } from 'zod';
import type { WorkspaceService } from '../../workspace';
import { WorkspaceEngineBeforeStart } from '../../workspace';
import { DocsIndexer } from '../entities/docs-indexer';
@OnEvent(WorkspaceEngineBeforeStart, s => s.handleWorkspaceEngineBeforeStart)

View File

@@ -15,7 +15,7 @@ import {
} from '@blocksuite/affine/store';
import type { AffineTextAttributes } from '@blocksuite/affine-shared/types';
import type { DeltaInsert } from '@blocksuite/inline';
import { Document, getAFFiNEWorkspaceSchema } from '@toeverything/infra';
import { Document } from '@toeverything/infra';
import { toHexString } from 'lib0/buffer.js';
import { digest as lib0Digest } from 'lib0/hash/sha256';
import { difference, uniq } from 'lodash-es';
@@ -27,6 +27,7 @@ import {
Text as YText,
} from 'yjs';
import { getAFFiNEWorkspaceSchema } from '../../workspace/global-schema';
import type { BlockIndexSchema, DocIndexSchema } from '../schema';
import type {
WorkerIngoingMessage,