mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 04:18:54 +00:00
style: enable import-x/no-duplicates (#6279)
This commit is contained in:
@@ -1,6 +1,11 @@
|
||||
import { nanoid } from 'nanoid';
|
||||
import { Array as YArray, Doc as YDoc, Map as YMap } from 'yjs';
|
||||
import { applyUpdate, encodeStateAsUpdate } from 'yjs';
|
||||
import {
|
||||
applyUpdate,
|
||||
Array as YArray,
|
||||
Doc as YDoc,
|
||||
encodeStateAsUpdate,
|
||||
Map as YMap,
|
||||
} from 'yjs';
|
||||
|
||||
const migrationOrigin = 'affine-migration';
|
||||
|
||||
|
||||
@@ -2,11 +2,8 @@ import { DebugLogger } from '@affine/debug';
|
||||
// @ts-expect-error upstream type is wrong
|
||||
import { tinykeys } from 'tinykeys';
|
||||
|
||||
import {
|
||||
type AffineCommand,
|
||||
type AffineCommandOptions,
|
||||
createAffineCommand,
|
||||
} from './command';
|
||||
import type { AffineCommand, AffineCommandOptions } from './command';
|
||||
import { createAffineCommand } from './command';
|
||||
|
||||
const commandLogger = new DebugLogger('command:registry');
|
||||
|
||||
|
||||
@@ -6,10 +6,10 @@ import {
|
||||
ServiceNotFoundError,
|
||||
} from './error';
|
||||
import { parseIdentifier } from './identifier';
|
||||
import {
|
||||
type GeneralServiceIdentifier,
|
||||
type ServiceIdentifierValue,
|
||||
type ServiceVariant,
|
||||
import type {
|
||||
GeneralServiceIdentifier,
|
||||
ServiceIdentifierValue,
|
||||
ServiceVariant,
|
||||
} from './types';
|
||||
|
||||
export interface ResolveOptions {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import React, { useContext } from 'react';
|
||||
|
||||
import type { ServiceProvider } from '../core';
|
||||
import { type GeneralServiceIdentifier, ServiceCollection } from '../core';
|
||||
import type { GeneralServiceIdentifier, ServiceProvider } from '../core';
|
||||
import { ServiceCollection } from '../core';
|
||||
|
||||
export const ServiceProviderContext = React.createContext(
|
||||
ServiceCollection.EMPTY.provider()
|
||||
|
||||
@@ -1,22 +1,25 @@
|
||||
import { DebugLogger } from '@affine/debug';
|
||||
import type {
|
||||
InteropObservable,
|
||||
Observer,
|
||||
OperatorFunction,
|
||||
Subscription,
|
||||
TeardownLogic,
|
||||
} from 'rxjs';
|
||||
import {
|
||||
BehaviorSubject,
|
||||
combineLatest,
|
||||
distinctUntilChanged,
|
||||
EMPTY,
|
||||
filter,
|
||||
type InteropObservable,
|
||||
map,
|
||||
Observable,
|
||||
type Observer,
|
||||
of,
|
||||
type OperatorFunction,
|
||||
scan,
|
||||
skip,
|
||||
type Subscription,
|
||||
Subject,
|
||||
switchMap,
|
||||
type TeardownLogic,
|
||||
} from 'rxjs';
|
||||
import { BehaviorSubject, Subject } from 'rxjs';
|
||||
|
||||
export * from './react';
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import type { Doc as BlockSuiteDoc } from '@blocksuite/store';
|
||||
|
||||
import { createIdentifier, type ServiceCollection } from '../di';
|
||||
import type { ServiceCollection } from '../di';
|
||||
import { createIdentifier } from '../di';
|
||||
import type { PageRecord } from './record';
|
||||
import { PageScope } from './service-scope';
|
||||
|
||||
|
||||
@@ -4,7 +4,8 @@ export * from './record';
|
||||
export * from './record-list';
|
||||
export * from './service-scope';
|
||||
|
||||
import { type ServiceCollection, ServiceProvider } from '../di';
|
||||
import type { ServiceCollection } from '../di';
|
||||
import { ServiceProvider } from '../di';
|
||||
import { CleanupService } from '../lifecycle';
|
||||
import { Workspace, WorkspaceLocalState, WorkspaceScope } from '../workspace';
|
||||
import { BlockSuitePageContext, PageRecordContext } from './context';
|
||||
|
||||
@@ -2,7 +2,7 @@ import { isEqual } from 'lodash-es';
|
||||
import { distinctUntilChanged, map, Observable } from 'rxjs';
|
||||
|
||||
import { LiveData } from '../livedata';
|
||||
import { type Workspace, type WorkspaceLocalState } from '../workspace';
|
||||
import type { Workspace, WorkspaceLocalState } from '../workspace';
|
||||
import { PageRecord } from './record';
|
||||
|
||||
export class PageRecordList {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { createScope, type ServiceScope } from '../di';
|
||||
import type { ServiceScope } from '../di';
|
||||
import { createScope } from '../di';
|
||||
import { WorkspaceScope } from '../workspace';
|
||||
|
||||
export const PageScope: ServiceScope = createScope('page', WorkspaceScope);
|
||||
|
||||
@@ -23,7 +23,8 @@ import { nanoid } from 'nanoid';
|
||||
import type { Awareness } from 'y-protocols/awareness.js';
|
||||
import type { Doc as YDoc } from 'yjs';
|
||||
|
||||
import { createIdentifier, type ServiceCollection } from '../di';
|
||||
import type { ServiceCollection } from '../di';
|
||||
import { createIdentifier } from '../di';
|
||||
import { BlobEngine } from './engine/blob';
|
||||
import { globalBlockSuiteSchema } from './global-schema';
|
||||
import type { WorkspaceMetadata } from './metadata';
|
||||
|
||||
@@ -1,7 +1,12 @@
|
||||
import { nanoid } from 'nanoid';
|
||||
import { describe, expect, test, vitest } from 'vitest';
|
||||
import { Doc as YDoc, encodeStateAsUpdate } from 'yjs';
|
||||
import { diffUpdate, encodeStateVectorFromUpdate, mergeUpdates } from 'yjs';
|
||||
import {
|
||||
diffUpdate,
|
||||
Doc as YDoc,
|
||||
encodeStateAsUpdate,
|
||||
encodeStateVectorFromUpdate,
|
||||
mergeUpdates,
|
||||
} from 'yjs';
|
||||
|
||||
import { AsyncLock } from '../../../../utils';
|
||||
import { DocEngine } from '..';
|
||||
|
||||
@@ -9,7 +9,8 @@ import { MANUALLY_STOP } from '../../../utils';
|
||||
import { DocEngineLocalPart } from './local';
|
||||
import { DocEngineRemotePart } from './remote';
|
||||
import type { DocServer } from './server';
|
||||
import { type DocStorage, DocStorageInner } from './storage';
|
||||
import type { DocStorage } from './storage';
|
||||
import { DocStorageInner } from './storage';
|
||||
|
||||
const logger = new DebugLogger('doc-engine');
|
||||
|
||||
|
||||
@@ -1,10 +1,5 @@
|
||||
import {
|
||||
type ByteKV,
|
||||
type Memento,
|
||||
MemoryMemento,
|
||||
ReadonlyByteKV,
|
||||
wrapMemento,
|
||||
} from '../../../storage';
|
||||
import type { ByteKV, Memento } from '../../../storage';
|
||||
import { MemoryMemento, ReadonlyByteKV, wrapMemento } from '../../../storage';
|
||||
import { AsyncLock, mergeUpdates, throwIfAborted } from '../../../utils';
|
||||
import type { DocEventBus } from '.';
|
||||
import { DocEventBusInner, MemoryDocEventBus } from './event';
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { createIdentifier, type ServiceCollection } from '../di';
|
||||
import type { ServiceCollection } from '../di';
|
||||
import { createIdentifier } from '../di';
|
||||
|
||||
export interface WorkspaceFactory {
|
||||
name: string;
|
||||
|
||||
@@ -11,7 +11,8 @@ export * from './testing';
|
||||
export * from './upgrade';
|
||||
export * from './workspace';
|
||||
|
||||
import { type ServiceCollection, ServiceProvider } from '../di';
|
||||
import type { ServiceCollection } from '../di';
|
||||
import { ServiceProvider } from '../di';
|
||||
import { CleanupService } from '../lifecycle';
|
||||
import { GlobalCache, GlobalState, MemoryMemento } from '../storage';
|
||||
import {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { GlobalCache } from '../../storage';
|
||||
import { type WorkspaceMetadata } from '../metadata';
|
||||
import type { WorkspaceMetadata } from '../metadata';
|
||||
|
||||
const CACHE_STORAGE_KEY = 'jotai-workspaces';
|
||||
|
||||
|
||||
@@ -9,7 +9,8 @@ import type { GlobalCache } from '../../storage';
|
||||
import type { BlobStorage } from '../engine';
|
||||
import type { WorkspaceMetadata } from '../metadata';
|
||||
import { readWorkspaceListCache, writeWorkspaceListCache } from './cache';
|
||||
import { type WorkspaceInfo, WorkspaceInformation } from './information';
|
||||
import type { WorkspaceInfo } from './information';
|
||||
import { WorkspaceInformation } from './information';
|
||||
|
||||
export * from './information';
|
||||
|
||||
|
||||
@@ -4,12 +4,13 @@ import { differenceBy } from 'lodash-es';
|
||||
import { nanoid } from 'nanoid';
|
||||
import { applyUpdate, encodeStateAsUpdate } from 'yjs';
|
||||
|
||||
import { type ServiceCollection } from '../di';
|
||||
import { GlobalState, type Memento } from '../storage';
|
||||
import type { ServiceCollection } from '../di';
|
||||
import type { Memento } from '../storage';
|
||||
import { GlobalState } from '../storage';
|
||||
import { WorkspaceMetadataContext } from './context';
|
||||
import type { BlobStorage } from './engine';
|
||||
import {
|
||||
AwarenessProvider,
|
||||
type BlobStorage,
|
||||
DocStorageImpl,
|
||||
LocalBlobStorage,
|
||||
MemoryDocStorage,
|
||||
@@ -17,9 +18,8 @@ import {
|
||||
import { MemoryStorage } from './engine/doc/storage';
|
||||
import type { WorkspaceFactory } from './factory';
|
||||
import { globalBlockSuiteSchema } from './global-schema';
|
||||
import type { WorkspaceListProvider } from './list';
|
||||
import { type WorkspaceInfo } from './list';
|
||||
import { type WorkspaceMetadata } from './metadata';
|
||||
import type { WorkspaceInfo, WorkspaceListProvider } from './list';
|
||||
import type { WorkspaceMetadata } from './metadata';
|
||||
import { WorkspaceScope } from './service-scope';
|
||||
|
||||
const LIST_STORE_KEY = 'testing-workspace-list';
|
||||
|
||||
@@ -4,12 +4,16 @@ import { Slot } from '@blocksuite/global/utils';
|
||||
import type { DocCollection } from '@blocksuite/store';
|
||||
import { applyUpdate, Doc as YDoc, encodeStateAsUpdate } from 'yjs';
|
||||
|
||||
import { checkWorkspaceCompatibility, MigrationPoint } from '../blocksuite';
|
||||
import { forceUpgradePages, upgradeV1ToV2 } from '../blocksuite';
|
||||
import { migrateGuidCompatibility } from '../blocksuite';
|
||||
import {
|
||||
checkWorkspaceCompatibility,
|
||||
forceUpgradePages,
|
||||
migrateGuidCompatibility,
|
||||
MigrationPoint,
|
||||
upgradeV1ToV2,
|
||||
} from '../blocksuite';
|
||||
import type { DocEngine } from './engine';
|
||||
import type { WorkspaceManager } from './manager';
|
||||
import { type WorkspaceMetadata } from './metadata';
|
||||
import type { WorkspaceMetadata } from './metadata';
|
||||
|
||||
export interface WorkspaceUpgradeStatus {
|
||||
needUpgrade: boolean;
|
||||
|
||||
@@ -4,11 +4,12 @@ import type { DocCollection } from '@blocksuite/store';
|
||||
|
||||
import type { ServiceProvider } from '../di';
|
||||
import { CleanupService } from '../lifecycle';
|
||||
import type { WorkspaceEngine } from './engine';
|
||||
import { type WorkspaceEngineStatus } from './engine';
|
||||
import { type WorkspaceMetadata } from './metadata';
|
||||
import type { WorkspaceUpgradeController } from './upgrade';
|
||||
import { type WorkspaceUpgradeStatus } from './upgrade';
|
||||
import type { WorkspaceEngine, WorkspaceEngineStatus } from './engine';
|
||||
import type { WorkspaceMetadata } from './metadata';
|
||||
import type {
|
||||
WorkspaceUpgradeController,
|
||||
WorkspaceUpgradeStatus,
|
||||
} from './upgrade';
|
||||
|
||||
export type { DocCollection } from '@blocksuite/store';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user