diff --git a/packages/common/infra/package.json b/packages/common/infra/package.json index 6fc688249..3f25db516 100644 --- a/packages/common/infra/package.json +++ b/packages/common/infra/package.json @@ -3,14 +3,6 @@ "type": "module", "private": true, "exports": { - "./blocksuite": "./src/blocksuite/index.ts", - "./command": "./src/command/index.ts", - "./atom": "./src/atom/index.ts", - "./app-config-storage": "./src/app-config-storage.ts", - "./di": "./src/di/index.ts", - "./livedata": "./src/livedata/index.ts", - "./storage": "./src/storage/index.ts", - "./lifecycle": "./src/lifecycle/index.ts", ".": "./src/index.ts" }, "dependencies": { diff --git a/packages/common/infra/src/page/page.ts b/packages/common/infra/src/page/page.ts index 49ce5fec1..bd28834a2 100644 --- a/packages/common/infra/src/page/page.ts +++ b/packages/common/infra/src/page/page.ts @@ -1,5 +1,5 @@ import type { Doc as BlockSuiteDoc } from '@blocksuite/store'; -import type { ServiceProvider } from '@toeverything/infra/di'; +import type { ServiceProvider } from '@toeverything/infra'; import type { PageMode, PageRecord } from './record'; diff --git a/packages/frontend/core/src/commands/affine-creation.tsx b/packages/frontend/core/src/commands/affine-creation.tsx index 47a19a7cd..3dd502e76 100644 --- a/packages/frontend/core/src/commands/affine-creation.tsx +++ b/packages/frontend/core/src/commands/affine-creation.tsx @@ -1,6 +1,6 @@ import type { useAFFiNEI18N } from '@affine/i18n/hooks'; import { ImportIcon, PlusIcon } from '@blocksuite/icons'; -import { registerAffineCommand } from '@toeverything/infra/command'; +import { registerAffineCommand } from '@toeverything/infra'; import type { createStore } from 'jotai'; import { openCreateWorkspaceModalAtom } from '../atoms'; diff --git a/packages/frontend/core/src/commands/affine-help.tsx b/packages/frontend/core/src/commands/affine-help.tsx index cf938cdd9..1d1d77ffe 100644 --- a/packages/frontend/core/src/commands/affine-help.tsx +++ b/packages/frontend/core/src/commands/affine-help.tsx @@ -1,6 +1,6 @@ import type { useAFFiNEI18N } from '@affine/i18n/hooks'; import { ContactWithUsIcon, NewIcon } from '@blocksuite/icons'; -import { registerAffineCommand } from '@toeverything/infra/command'; +import { registerAffineCommand } from '@toeverything/infra'; import type { createStore } from 'jotai'; import { openSettingModalAtom } from '../atoms'; diff --git a/packages/frontend/core/src/commands/affine-layout.tsx b/packages/frontend/core/src/commands/affine-layout.tsx index 5ecf74037..6906f5ea7 100644 --- a/packages/frontend/core/src/commands/affine-layout.tsx +++ b/packages/frontend/core/src/commands/affine-layout.tsx @@ -1,6 +1,6 @@ import type { useAFFiNEI18N } from '@affine/i18n/hooks'; import { SidebarIcon } from '@blocksuite/icons'; -import { registerAffineCommand } from '@toeverything/infra/command'; +import { registerAffineCommand } from '@toeverything/infra'; import type { createStore } from 'jotai'; import { appSidebarOpenAtom } from '../components/app-sidebar'; diff --git a/packages/frontend/core/src/commands/affine-navigation.tsx b/packages/frontend/core/src/commands/affine-navigation.tsx index 5b8d114c0..677697821 100644 --- a/packages/frontend/core/src/commands/affine-navigation.tsx +++ b/packages/frontend/core/src/commands/affine-navigation.tsx @@ -2,7 +2,7 @@ import { WorkspaceSubPath } from '@affine/core/shared'; import type { useAFFiNEI18N } from '@affine/i18n/hooks'; import { ArrowRightBigIcon } from '@blocksuite/icons'; import type { DocCollection } from '@blocksuite/store'; -import { registerAffineCommand } from '@toeverything/infra/command'; +import { registerAffineCommand } from '@toeverything/infra'; import type { createStore } from 'jotai'; import { openSettingModalAtom, openWorkspaceListModalAtom } from '../atoms'; diff --git a/packages/frontend/core/src/commands/affine-settings.tsx b/packages/frontend/core/src/commands/affine-settings.tsx index 17c827355..26f5d1797 100644 --- a/packages/frontend/core/src/commands/affine-settings.tsx +++ b/packages/frontend/core/src/commands/affine-settings.tsx @@ -1,11 +1,11 @@ import type { useAFFiNEI18N } from '@affine/i18n/hooks'; import { SettingsIcon } from '@blocksuite/icons'; import type { AffineEditorContainer } from '@blocksuite/presets'; -import { appSettingAtom } from '@toeverything/infra/atom'; +import { appSettingAtom } from '@toeverything/infra'; import { PreconditionStrategy, registerAffineCommand, -} from '@toeverything/infra/command'; +} from '@toeverything/infra'; import { type createStore } from 'jotai'; import type { useTheme } from 'next-themes'; diff --git a/packages/frontend/core/src/commands/affine-updates.tsx b/packages/frontend/core/src/commands/affine-updates.tsx index c93fbe82c..ba2274dee 100644 --- a/packages/frontend/core/src/commands/affine-updates.tsx +++ b/packages/frontend/core/src/commands/affine-updates.tsx @@ -2,7 +2,7 @@ import { updateReadyAtom } from '@affine/core/hooks/use-app-updater'; import { apis } from '@affine/electron-api'; import type { useAFFiNEI18N } from '@affine/i18n/hooks'; import { ResetIcon } from '@blocksuite/icons'; -import { registerAffineCommand } from '@toeverything/infra/command'; +import { registerAffineCommand } from '@toeverything/infra'; import type { createStore } from 'jotai'; export function registerAffineUpdatesCommands({ diff --git a/packages/frontend/core/src/components/affine/affine-error-boundary/affine-error-fallback.tsx b/packages/frontend/core/src/components/affine/affine-error-boundary/affine-error-fallback.tsx index 864d809db..f3844529f 100644 --- a/packages/frontend/core/src/components/affine/affine-error-boundary/affine-error-fallback.tsx +++ b/packages/frontend/core/src/components/affine/affine-error-boundary/affine-error-fallback.tsx @@ -1,4 +1,4 @@ -import { getCurrentStore } from '@toeverything/infra/atom'; +import { getCurrentStore } from '@toeverything/infra'; import { Provider } from 'jotai/react'; import type { FC } from 'react'; import { useMemo } from 'react'; diff --git a/packages/frontend/core/src/components/affine/affine-error-boundary/error-basic/info-logger.tsx b/packages/frontend/core/src/components/affine/affine-error-boundary/error-basic/info-logger.tsx index 4510fc824..a212fcab5 100644 --- a/packages/frontend/core/src/components/affine/affine-error-boundary/error-basic/info-logger.tsx +++ b/packages/frontend/core/src/components/affine/affine-error-boundary/error-basic/info-logger.tsx @@ -1,6 +1,6 @@ import { WorkspaceListService } from '@toeverything/infra'; -import { useService } from '@toeverything/infra/di'; -import { useLiveData } from '@toeverything/infra/livedata'; +import { useService } from '@toeverything/infra'; +import { useLiveData } from '@toeverything/infra'; import { useEffect } from 'react'; import { useLocation, useParams } from 'react-router-dom'; diff --git a/packages/frontend/core/src/components/affine/awareness/index.tsx b/packages/frontend/core/src/components/affine/awareness/index.tsx index 45d4d5980..f56d672fb 100644 --- a/packages/frontend/core/src/components/affine/awareness/index.tsx +++ b/packages/frontend/core/src/components/affine/awareness/index.tsx @@ -1,5 +1,5 @@ -import { useService } from '@toeverything/infra/di'; -import { useLiveData } from '@toeverything/infra/livedata'; +import { useService } from '@toeverything/infra'; +import { useLiveData } from '@toeverything/infra'; import { Suspense, useEffect } from 'react'; import { useCurrentLoginStatus } from '../../../hooks/affine/use-current-login-status'; diff --git a/packages/frontend/core/src/components/affine/create-workspace-modal/index.tsx b/packages/frontend/core/src/components/affine/create-workspace-modal/index.tsx index e71c82261..e2ea6af94 100644 --- a/packages/frontend/core/src/components/affine/create-workspace-modal/index.tsx +++ b/packages/frontend/core/src/components/affine/create-workspace-modal/index.tsx @@ -14,7 +14,7 @@ import { useAFFiNEI18N } from '@affine/i18n/hooks'; import { _addLocalWorkspace } from '@affine/workspace-impl'; import { WorkspaceManager } from '@toeverything/infra'; import { buildShowcaseWorkspace, initEmptyPage } from '@toeverything/infra'; -import { useService } from '@toeverything/infra/di'; +import { useService } from '@toeverything/infra'; import { useSetAtom } from 'jotai'; import type { KeyboardEvent } from 'react'; import { useLayoutEffect } from 'react'; diff --git a/packages/frontend/core/src/components/affine/page-history-modal/history-modal.tsx b/packages/frontend/core/src/components/affine/page-history-modal/history-modal.tsx index 3092de289..e6651179e 100644 --- a/packages/frontend/core/src/components/affine/page-history-modal/history-modal.tsx +++ b/packages/frontend/core/src/components/affine/page-history-modal/history-modal.tsx @@ -15,7 +15,7 @@ import { type DocCollection } from '@blocksuite/store'; import * as Collapsible from '@radix-ui/react-collapsible'; import type { DialogContentProps } from '@radix-ui/react-dialog'; import { Doc, type PageMode, Workspace } from '@toeverything/infra'; -import { useService } from '@toeverything/infra/di'; +import { useService } from '@toeverything/infra'; import { atom, useAtom, useSetAtom } from 'jotai'; import { Fragment, diff --git a/packages/frontend/core/src/components/affine/page-properties/confirm-delete-property-modal.tsx b/packages/frontend/core/src/components/affine/page-properties/confirm-delete-property-modal.tsx index adff7cf13..ad0db5a53 100644 --- a/packages/frontend/core/src/components/affine/page-properties/confirm-delete-property-modal.tsx +++ b/packages/frontend/core/src/components/affine/page-properties/confirm-delete-property-modal.tsx @@ -3,7 +3,7 @@ import { WorkspacePropertiesAdapter } from '@affine/core/modules/workspace'; import type { PageInfoCustomPropertyMeta } from '@affine/core/modules/workspace/properties/schema'; import { Trans } from '@affine/i18n'; import { useAFFiNEI18N } from '@affine/i18n/hooks'; -import { useService } from '@toeverything/infra/di'; +import { useService } from '@toeverything/infra'; import { useMemo } from 'react'; import { PagePropertiesMetaManager } from './page-properties-manager'; diff --git a/packages/frontend/core/src/components/affine/page-properties/tags-inline-editor.tsx b/packages/frontend/core/src/components/affine/page-properties/tags-inline-editor.tsx index e6b0e6e67..1d0b745a4 100644 --- a/packages/frontend/core/src/components/affine/page-properties/tags-inline-editor.tsx +++ b/packages/frontend/core/src/components/affine/page-properties/tags-inline-editor.tsx @@ -11,7 +11,7 @@ import { WorkspaceLegacyProperties } from '@affine/core/modules/workspace'; import { useAFFiNEI18N } from '@affine/i18n/hooks'; import { DeleteIcon, MoreHorizontalIcon, TagsIcon } from '@blocksuite/icons'; import { useLiveData } from '@toeverything/infra'; -import { useService } from '@toeverything/infra/di'; +import { useService } from '@toeverything/infra'; import clsx from 'clsx'; import { type HTMLAttributes, diff --git a/packages/frontend/core/src/components/affine/setting-modal/general-setting/appearance/date-format-setting.tsx b/packages/frontend/core/src/components/affine/setting-modal/general-setting/appearance/date-format-setting.tsx index 06ee1aa6d..ab0fa3e81 100644 --- a/packages/frontend/core/src/components/affine/setting-modal/general-setting/appearance/date-format-setting.tsx +++ b/packages/frontend/core/src/components/affine/setting-modal/general-setting/appearance/date-format-setting.tsx @@ -1,5 +1,5 @@ import { Menu, MenuItem, MenuTrigger } from '@affine/component/ui/menu'; -import { dateFormatOptions, type DateFormats } from '@toeverything/infra/atom'; +import { dateFormatOptions, type DateFormats } from '@toeverything/infra'; import dayjs from 'dayjs'; import { useCallback } from 'react'; diff --git a/packages/frontend/core/src/components/affine/setting-modal/general-setting/appearance/index.tsx b/packages/frontend/core/src/components/affine/setting-modal/general-setting/appearance/index.tsx index 5988c8e15..b47bef92e 100644 --- a/packages/frontend/core/src/components/affine/setting-modal/general-setting/appearance/index.tsx +++ b/packages/frontend/core/src/components/affine/setting-modal/general-setting/appearance/index.tsx @@ -7,7 +7,7 @@ import { type AppSetting, fontStyleOptions, windowFrameStyleOptions, -} from '@toeverything/infra/atom'; +} from '@toeverything/infra'; import { useTheme } from 'next-themes'; import { useCallback } from 'react'; diff --git a/packages/frontend/core/src/components/affine/setting-modal/setting-sidebar/index.tsx b/packages/frontend/core/src/components/affine/setting-modal/setting-sidebar/index.tsx index ebf7cebd9..b6832ad76 100644 --- a/packages/frontend/core/src/components/affine/setting-modal/setting-sidebar/index.tsx +++ b/packages/frontend/core/src/components/affine/setting-modal/setting-sidebar/index.tsx @@ -16,8 +16,8 @@ import { WorkspaceManager, type WorkspaceMetadata, } from '@toeverything/infra'; -import { useService } from '@toeverything/infra/di'; -import { useLiveData } from '@toeverything/infra/livedata'; +import { useService } from '@toeverything/infra'; +import { useLiveData } from '@toeverything/infra'; import clsx from 'clsx'; import { useAtom } from 'jotai/react'; import { type ReactElement, Suspense, useCallback, useMemo } from 'react'; diff --git a/packages/frontend/core/src/components/affine/setting-modal/workspace-setting/new-workspace-setting-detail/delete-leave-workspace/index.tsx b/packages/frontend/core/src/components/affine/setting-modal/workspace-setting/new-workspace-setting-detail/delete-leave-workspace/index.tsx index 70d95982b..6998106f3 100644 --- a/packages/frontend/core/src/components/affine/setting-modal/workspace-setting/new-workspace-setting-detail/delete-leave-workspace/index.tsx +++ b/packages/frontend/core/src/components/affine/setting-modal/workspace-setting/new-workspace-setting-detail/delete-leave-workspace/index.tsx @@ -5,8 +5,8 @@ import { useAsyncCallback } from '@affine/core/hooks/affine-async-hooks'; import { useAFFiNEI18N } from '@affine/i18n/hooks'; import { ArrowRightSmallIcon } from '@blocksuite/icons'; import { Workspace, WorkspaceManager } from '@toeverything/infra'; -import { useService } from '@toeverything/infra/di'; -import { useLiveData } from '@toeverything/infra/livedata'; +import { useService } from '@toeverything/infra'; +import { useLiveData } from '@toeverything/infra'; import { useSetAtom } from 'jotai'; import { useCallback, useState } from 'react'; diff --git a/packages/frontend/core/src/components/affine/setting-modal/workspace-setting/new-workspace-setting-detail/enable-cloud.tsx b/packages/frontend/core/src/components/affine/setting-modal/workspace-setting/new-workspace-setting-detail/enable-cloud.tsx index 419acdcdc..75ddd771f 100644 --- a/packages/frontend/core/src/components/affine/setting-modal/workspace-setting/new-workspace-setting-detail/enable-cloud.tsx +++ b/packages/frontend/core/src/components/affine/setting-modal/workspace-setting/new-workspace-setting-detail/enable-cloud.tsx @@ -6,7 +6,7 @@ import { UNTITLED_WORKSPACE_NAME } from '@affine/env/constant'; import { WorkspaceFlavour } from '@affine/env/workspace'; import { useAFFiNEI18N } from '@affine/i18n/hooks'; import { type Workspace, WorkspaceManager } from '@toeverything/infra'; -import { useService } from '@toeverything/infra/di'; +import { useService } from '@toeverything/infra'; import { useSetAtom } from 'jotai'; import { useState } from 'react'; diff --git a/packages/frontend/core/src/components/affine/setting-modal/workspace-setting/properties/index.tsx b/packages/frontend/core/src/components/affine/setting-modal/workspace-setting/properties/index.tsx index bd7a4be0f..bc32f468c 100644 --- a/packages/frontend/core/src/components/affine/setting-modal/workspace-setting/properties/index.tsx +++ b/packages/frontend/core/src/components/affine/setting-modal/workspace-setting/properties/index.tsx @@ -7,10 +7,7 @@ import type { PageInfoCustomPropertyMeta } from '@affine/core/modules/workspace/ import { Trans } from '@affine/i18n'; import { useAFFiNEI18N } from '@affine/i18n/hooks'; import { DeleteIcon, FilterIcon, MoreHorizontalIcon } from '@blocksuite/icons'; -import type { - Workspace, - WorkspaceMetadata, -} from '@toeverything/infra/workspace'; +import type { Workspace, WorkspaceMetadata } from '@toeverything/infra'; import { createContext, Fragment, diff --git a/packages/frontend/core/src/components/affine/share-page-modal/share-menu/share-export.tsx b/packages/frontend/core/src/components/affine/share-page-modal/share-menu/share-export.tsx index d52f7e504..a0b3da4e7 100644 --- a/packages/frontend/core/src/components/affine/share-page-modal/share-menu/share-export.tsx +++ b/packages/frontend/core/src/components/affine/share-page-modal/share-menu/share-export.tsx @@ -5,7 +5,7 @@ import { WorkspaceFlavour } from '@affine/env/workspace'; import { useAFFiNEI18N } from '@affine/i18n/hooks'; import { LinkIcon } from '@blocksuite/icons'; import { Doc, useLiveData } from '@toeverything/infra'; -import { useService } from '@toeverything/infra/di'; +import { useService } from '@toeverything/infra'; import { useExportPage } from '../../../../hooks/affine/use-export-page'; import * as styles from './index.css'; diff --git a/packages/frontend/core/src/components/app-sidebar/index.tsx b/packages/frontend/core/src/components/app-sidebar/index.tsx index cc5061b18..d0a3bc442 100644 --- a/packages/frontend/core/src/components/app-sidebar/index.tsx +++ b/packages/frontend/core/src/components/app-sidebar/index.tsx @@ -1,7 +1,7 @@ import { Skeleton } from '@affine/component'; import { ResizePanel } from '@affine/component/resize-panel'; import { Workspace } from '@toeverything/infra'; -import { useServiceOptional } from '@toeverything/infra/di'; +import { useServiceOptional } from '@toeverything/infra'; import { useAtom, useAtomValue } from 'jotai'; import { debounce } from 'lodash-es'; import type { PropsWithChildren, ReactElement } from 'react'; diff --git a/packages/frontend/core/src/components/blocksuite/block-suite-header/favorite/index.tsx b/packages/frontend/core/src/components/blocksuite/block-suite-header/favorite/index.tsx index 60b08fe1c..1c3e51125 100644 --- a/packages/frontend/core/src/components/blocksuite/block-suite-header/favorite/index.tsx +++ b/packages/frontend/core/src/components/blocksuite/block-suite-header/favorite/index.tsx @@ -5,7 +5,7 @@ import { toast } from '@affine/core/utils'; import { useAFFiNEI18N } from '@affine/i18n/hooks'; import { assertExists } from '@blocksuite/global/utils'; import { Workspace } from '@toeverything/infra'; -import { useService } from '@toeverything/infra/di'; +import { useService } from '@toeverything/infra'; import { useCallback } from 'react'; export interface FavoriteButtonProps { diff --git a/packages/frontend/core/src/components/page-detail-editor.tsx b/packages/frontend/core/src/components/page-detail-editor.tsx index 625a3c783..329f1df11 100644 --- a/packages/frontend/core/src/components/page-detail-editor.tsx +++ b/packages/frontend/core/src/components/page-detail-editor.tsx @@ -11,7 +11,7 @@ import { useLiveData, useService, } from '@toeverything/infra'; -import { fontStyleOptions } from '@toeverything/infra/atom'; +import { fontStyleOptions } from '@toeverything/infra'; import clsx from 'clsx'; import type { CSSProperties } from 'react'; import { memo, Suspense, useCallback, useMemo } from 'react'; diff --git a/packages/frontend/core/src/components/page-list/docs/page-list-new-page-button.tsx b/packages/frontend/core/src/components/page-list/docs/page-list-new-page-button.tsx index 1466a2f0b..18df01133 100644 --- a/packages/frontend/core/src/components/page-list/docs/page-list-new-page-button.tsx +++ b/packages/frontend/core/src/components/page-list/docs/page-list-new-page-button.tsx @@ -1,5 +1,5 @@ import { Workspace } from '@toeverything/infra'; -import { useService } from '@toeverything/infra/di'; +import { useService } from '@toeverything/infra'; import type { PropsWithChildren } from 'react'; import { usePageHelper } from '../../blocksuite/block-suite-page-list/utils'; diff --git a/packages/frontend/core/src/components/page-list/view/collection-operations.tsx b/packages/frontend/core/src/components/page-list/view/collection-operations.tsx index 464a1f609..6a0054ed7 100644 --- a/packages/frontend/core/src/components/page-list/view/collection-operations.tsx +++ b/packages/frontend/core/src/components/page-list/view/collection-operations.tsx @@ -14,7 +14,7 @@ import { FilterIcon, SplitViewIcon, } from '@blocksuite/icons'; -import { useService } from '@toeverything/infra/di'; +import { useService } from '@toeverything/infra'; import { type PropsWithChildren, type ReactElement, diff --git a/packages/frontend/core/src/components/pure/cmdk/data-hooks.tsx b/packages/frontend/core/src/components/pure/cmdk/data-hooks.tsx index 67d55f6db..c2922ed65 100644 --- a/packages/frontend/core/src/components/pure/cmdk/data-hooks.tsx +++ b/packages/frontend/core/src/components/pure/cmdk/data-hooks.tsx @@ -26,8 +26,8 @@ import { AffineCommandRegistry, type CommandCategory, PreconditionStrategy, -} from '@toeverything/infra/command'; -import { useService, useServiceOptional } from '@toeverything/infra/di'; +} from '@toeverything/infra'; +import { useService, useServiceOptional } from '@toeverything/infra'; import { atom, useAtomValue } from 'jotai'; import { useCallback, useEffect, useMemo, useState } from 'react'; diff --git a/packages/frontend/core/src/components/pure/cmdk/filter-commands.ts b/packages/frontend/core/src/components/pure/cmdk/filter-commands.ts index 6a7eb5064..152675186 100644 --- a/packages/frontend/core/src/components/pure/cmdk/filter-commands.ts +++ b/packages/frontend/core/src/components/pure/cmdk/filter-commands.ts @@ -1,4 +1,4 @@ -import type { CommandCategory } from '@toeverything/infra/command'; +import type { CommandCategory } from '@toeverything/infra'; import { commandScore } from 'cmdk'; import { groupBy } from 'lodash-es'; diff --git a/packages/frontend/core/src/components/pure/cmdk/main.tsx b/packages/frontend/core/src/components/pure/cmdk/main.tsx index 4780dd39c..e3d295bc2 100644 --- a/packages/frontend/core/src/components/pure/cmdk/main.tsx +++ b/packages/frontend/core/src/components/pure/cmdk/main.tsx @@ -4,7 +4,7 @@ import { useDocEngineStatus } from '@affine/core/hooks/affine/use-doc-engine-sta import { useAsyncCallback } from '@affine/core/hooks/affine-async-hooks'; import { useAFFiNEI18N } from '@affine/i18n/hooks'; import type { DocMeta } from '@blocksuite/store'; -import type { CommandCategory } from '@toeverything/infra/command'; +import type { CommandCategory } from '@toeverything/infra'; import clsx from 'clsx'; import { Command } from 'cmdk'; import { useAtom } from 'jotai'; diff --git a/packages/frontend/core/src/components/pure/cmdk/types.ts b/packages/frontend/core/src/components/pure/cmdk/types.ts index 548873258..cf255b0d8 100644 --- a/packages/frontend/core/src/components/pure/cmdk/types.ts +++ b/packages/frontend/core/src/components/pure/cmdk/types.ts @@ -1,4 +1,4 @@ -import type { CommandCategory } from '@toeverything/infra/command'; +import type { CommandCategory } from '@toeverything/infra'; export interface CommandContext { pageMode: 'page' | 'edgeless' | undefined; diff --git a/packages/frontend/core/src/components/pure/trash-page-footer/index.tsx b/packages/frontend/core/src/components/pure/trash-page-footer/index.tsx index bb399aa12..6f8c85266 100644 --- a/packages/frontend/core/src/components/pure/trash-page-footer/index.tsx +++ b/packages/frontend/core/src/components/pure/trash-page-footer/index.tsx @@ -5,8 +5,8 @@ import { useBlockSuiteDocMeta } from '@affine/core/hooks/use-block-suite-page-me import { useAFFiNEI18N } from '@affine/i18n/hooks'; import { assertExists } from '@blocksuite/global/utils'; import { DeleteIcon, ResetIcon } from '@blocksuite/icons'; -import { useService } from '@toeverything/infra/di'; -import { useLiveData } from '@toeverything/infra/livedata'; +import { useService } from '@toeverything/infra'; +import { useLiveData } from '@toeverything/infra'; import { useCallback, useState } from 'react'; import { useAppSettingHelper } from '../../../hooks/affine/use-app-setting-helper'; diff --git a/packages/frontend/core/src/components/pure/workspace-slider-bar/collections/collections-list.tsx b/packages/frontend/core/src/components/pure/workspace-slider-bar/collections/collections-list.tsx index 98db52157..535ebadc0 100644 --- a/packages/frontend/core/src/components/pure/workspace-slider-bar/collections/collections-list.tsx +++ b/packages/frontend/core/src/components/pure/workspace-slider-bar/collections/collections-list.tsx @@ -14,7 +14,7 @@ import type { DocCollection, DocMeta } from '@blocksuite/store'; import { useDroppable } from '@dnd-kit/core'; import * as Collapsible from '@radix-ui/react-collapsible'; import { useService } from '@toeverything/infra'; -import { useLiveData } from '@toeverything/infra/livedata'; +import { useLiveData } from '@toeverything/infra'; import { useCallback, useMemo, useState } from 'react'; import { useAllPageListConfig } from '../../../../hooks/affine/use-all-page-list-config'; diff --git a/packages/frontend/core/src/components/pure/workspace-slider-bar/components/operation-menu-button.tsx b/packages/frontend/core/src/components/pure/workspace-slider-bar/components/operation-menu-button.tsx index fc81fb798..8bc31429f 100644 --- a/packages/frontend/core/src/components/pure/workspace-slider-bar/components/operation-menu-button.tsx +++ b/packages/frontend/core/src/components/pure/workspace-slider-bar/components/operation-menu-button.tsx @@ -5,7 +5,7 @@ import { Workbench } from '@affine/core/modules/workbench'; import { useAFFiNEI18N } from '@affine/i18n/hooks'; import { MoreHorizontalIcon } from '@blocksuite/icons'; import type { DocCollection } from '@blocksuite/store'; -import { useService } from '@toeverything/infra/di'; +import { useService } from '@toeverything/infra'; import { useCallback } from 'react'; import { useBlockSuiteMetaHelper } from '../../../../hooks/affine/use-block-suite-meta-helper'; diff --git a/packages/frontend/core/src/components/pure/workspace-slider-bar/user-with-workspace-list/index.tsx b/packages/frontend/core/src/components/pure/workspace-slider-bar/user-with-workspace-list/index.tsx index 95d2fae48..a83aa5d86 100644 --- a/packages/frontend/core/src/components/pure/workspace-slider-bar/user-with-workspace-list/index.tsx +++ b/packages/frontend/core/src/components/pure/workspace-slider-bar/user-with-workspace-list/index.tsx @@ -6,8 +6,8 @@ import { Unreachable } from '@affine/env/constant'; import { useAFFiNEI18N } from '@affine/i18n/hooks'; import { Logo1Icon } from '@blocksuite/icons'; import { WorkspaceManager } from '@toeverything/infra'; -import { useService } from '@toeverything/infra/di'; -import { useLiveData } from '@toeverything/infra/livedata'; +import { useService } from '@toeverything/infra'; +import { useLiveData } from '@toeverything/infra'; import { useSetAtom } from 'jotai'; import { Suspense, useCallback, useEffect } from 'react'; diff --git a/packages/frontend/core/src/components/pure/workspace-slider-bar/user-with-workspace-list/workspace-list/index.tsx b/packages/frontend/core/src/components/pure/workspace-slider-bar/user-with-workspace-list/workspace-list/index.tsx index 51db03050..616fdd146 100644 --- a/packages/frontend/core/src/components/pure/workspace-slider-bar/user-with-workspace-list/workspace-list/index.tsx +++ b/packages/frontend/core/src/components/pure/workspace-slider-bar/user-with-workspace-list/workspace-list/index.tsx @@ -10,8 +10,8 @@ import { WorkspaceFlavour } from '@affine/env/workspace'; import { useAFFiNEI18N } from '@affine/i18n/hooks'; import type { DragEndEvent } from '@dnd-kit/core'; import { WorkspaceManager, type WorkspaceMetadata } from '@toeverything/infra'; -import { useService } from '@toeverything/infra/di'; -import { useLiveData } from '@toeverything/infra/livedata'; +import { useService } from '@toeverything/infra'; +import { useLiveData } from '@toeverything/infra'; import { useSetAtom } from 'jotai'; import { useCallback, useMemo } from 'react'; diff --git a/packages/frontend/core/src/components/pure/workspace-slider-bar/workspace-card/index.tsx b/packages/frontend/core/src/components/pure/workspace-slider-bar/workspace-card/index.tsx index 2a5beaa50..5fbb11ebe 100644 --- a/packages/frontend/core/src/components/pure/workspace-slider-bar/workspace-card/index.tsx +++ b/packages/frontend/core/src/components/pure/workspace-slider-bar/workspace-card/index.tsx @@ -18,7 +18,7 @@ import { UnsyncIcon, } from '@blocksuite/icons'; import { Workspace } from '@toeverything/infra'; -import { useService } from '@toeverything/infra/di'; +import { useService } from '@toeverything/infra'; import { useSetAtom } from 'jotai'; import { debounce } from 'lodash-es'; import { diff --git a/packages/frontend/core/src/components/workspace-upgrade/upgrade.tsx b/packages/frontend/core/src/components/workspace-upgrade/upgrade.tsx index 6a02be89d..c5fc25b24 100644 --- a/packages/frontend/core/src/components/workspace-upgrade/upgrade.tsx +++ b/packages/frontend/core/src/components/workspace-upgrade/upgrade.tsx @@ -5,7 +5,7 @@ import { useNavigateHelper } from '@affine/core/hooks/use-navigate-helper'; import { useWorkspaceStatus } from '@affine/core/hooks/use-workspace-status'; import { useAFFiNEI18N } from '@affine/i18n/hooks'; import { Workspace, WorkspaceManager } from '@toeverything/infra'; -import { useService } from '@toeverything/infra/di'; +import { useService } from '@toeverything/infra'; import { useState } from 'react'; import { WorkspaceSubPath } from '../../shared'; diff --git a/packages/frontend/core/src/hooks/__tests__/use-block-suite-workspace-page-title.spec.tsx b/packages/frontend/core/src/hooks/__tests__/use-block-suite-workspace-page-title.spec.tsx index 60546c1fe..5c0ae3635 100644 --- a/packages/frontend/core/src/hooks/__tests__/use-block-suite-workspace-page-title.spec.tsx +++ b/packages/frontend/core/src/hooks/__tests__/use-block-suite-workspace-page-title.spec.tsx @@ -6,7 +6,7 @@ import 'fake-indexeddb/auto'; import { WorkspacePropertiesAdapter } from '@affine/core/modules/workspace'; import { render } from '@testing-library/react'; import { Workspace } from '@toeverything/infra'; -import { ServiceProviderContext, useService } from '@toeverything/infra/di'; +import { ServiceProviderContext, useService } from '@toeverything/infra'; import { createStore, Provider } from 'jotai'; import { Suspense } from 'react'; import { describe, expect, test, vi } from 'vitest'; diff --git a/packages/frontend/core/src/hooks/affine/use-all-page-list-config.tsx b/packages/frontend/core/src/hooks/affine/use-all-page-list-config.tsx index 6178a6c23..71f534663 100644 --- a/packages/frontend/core/src/hooks/affine/use-all-page-list-config.tsx +++ b/packages/frontend/core/src/hooks/affine/use-all-page-list-config.tsx @@ -7,7 +7,7 @@ import { useBlockSuiteDocMeta } from '@affine/core/hooks/use-block-suite-page-me import { useAFFiNEI18N } from '@affine/i18n/hooks'; import type { DocMeta } from '@blocksuite/store'; import { Workspace } from '@toeverything/infra'; -import { useService } from '@toeverything/infra/di'; +import { useService } from '@toeverything/infra'; import { useCallback, useMemo } from 'react'; import { usePageHelper } from '../../components/blocksuite/block-suite-page-list/utils'; diff --git a/packages/frontend/core/src/hooks/affine/use-app-setting-helper.ts b/packages/frontend/core/src/hooks/affine/use-app-setting-helper.ts index 1be32c0b8..eb22b1996 100644 --- a/packages/frontend/core/src/hooks/affine/use-app-setting-helper.ts +++ b/packages/frontend/core/src/hooks/affine/use-app-setting-helper.ts @@ -1,4 +1,4 @@ -import { type AppSetting, appSettingAtom } from '@toeverything/infra/atom'; +import { type AppSetting, appSettingAtom } from '@toeverything/infra'; import { useAtom } from 'jotai'; import { useCallback, useMemo } from 'react'; diff --git a/packages/frontend/core/src/hooks/affine/use-register-blocksuite-editor-commands.tsx b/packages/frontend/core/src/hooks/affine/use-register-blocksuite-editor-commands.tsx index 5c7ef9005..e319422d2 100644 --- a/packages/frontend/core/src/hooks/affine/use-register-blocksuite-editor-commands.tsx +++ b/packages/frontend/core/src/hooks/affine/use-register-blocksuite-editor-commands.tsx @@ -8,8 +8,8 @@ import { Doc, useLiveData, Workspace } from '@toeverything/infra'; import { PreconditionStrategy, registerAffineCommand, -} from '@toeverything/infra/command'; -import { useService } from '@toeverything/infra/di'; +} from '@toeverything/infra'; +import { useService } from '@toeverything/infra'; import { useSetAtom } from 'jotai'; import { useCallback, useEffect } from 'react'; diff --git a/packages/frontend/core/src/hooks/affine/use-sidebar-drag.ts b/packages/frontend/core/src/hooks/affine/use-sidebar-drag.ts index a31f24259..e13de311b 100644 --- a/packages/frontend/core/src/hooks/affine/use-sidebar-drag.ts +++ b/packages/frontend/core/src/hooks/affine/use-sidebar-drag.ts @@ -4,7 +4,7 @@ import { useDocMetaHelper } from '@affine/core/hooks/use-block-suite-page-meta'; import { useAFFiNEI18N } from '@affine/i18n/hooks'; import type { DragEndEvent, UniqueIdentifier } from '@dnd-kit/core'; import { Workspace } from '@toeverything/infra'; -import { useService } from '@toeverything/infra/di'; +import { useService } from '@toeverything/infra'; import { useCallback } from 'react'; import { useBlockSuiteMetaHelper } from './use-block-suite-meta-helper'; diff --git a/packages/frontend/core/src/hooks/use-affine-adapter.ts b/packages/frontend/core/src/hooks/use-affine-adapter.ts index deec59baf..2dd09ca47 100644 --- a/packages/frontend/core/src/hooks/use-affine-adapter.ts +++ b/packages/frontend/core/src/hooks/use-affine-adapter.ts @@ -1,5 +1,5 @@ import type { Workspace } from '@toeverything/infra'; -import { useService } from '@toeverything/infra/di'; +import { useService } from '@toeverything/infra'; import { useDebouncedState } from 'foxact/use-debounced-state'; import { useEffect, useMemo } from 'react'; diff --git a/packages/frontend/core/src/hooks/use-app-config-storage.ts b/packages/frontend/core/src/hooks/use-app-config-storage.ts index 0d7f3b5a8..29b9859c4 100644 --- a/packages/frontend/core/src/hooks/use-app-config-storage.ts +++ b/packages/frontend/core/src/hooks/use-app-config-storage.ts @@ -5,7 +5,7 @@ import { type AppConfigSchema, AppConfigStorage, defaultAppConfig, -} from '@toeverything/infra/app-config-storage'; +} from '@toeverything/infra'; import { type Dispatch, useEffect, useState } from 'react'; import { useMemo } from 'react'; diff --git a/packages/frontend/core/src/hooks/use-app-updater.ts b/packages/frontend/core/src/hooks/use-app-updater.ts index 81604e640..4ccea64b4 100644 --- a/packages/frontend/core/src/hooks/use-app-updater.ts +++ b/packages/frontend/core/src/hooks/use-app-updater.ts @@ -1,6 +1,6 @@ import { apis, events, type UpdateMeta } from '@affine/electron-api'; import { isBrowser } from '@affine/env/constant'; -import { appSettingAtom } from '@toeverything/infra/atom'; +import { appSettingAtom } from '@toeverything/infra'; import { atom, useAtom, useAtomValue } from 'jotai'; import { atomWithObservable, atomWithStorage } from 'jotai/utils'; import { useCallback, useState } from 'react'; diff --git a/packages/frontend/core/src/hooks/use-register-workspace-commands.ts b/packages/frontend/core/src/hooks/use-register-workspace-commands.ts index 03022575d..2d38da47e 100644 --- a/packages/frontend/core/src/hooks/use-register-workspace-commands.ts +++ b/packages/frontend/core/src/hooks/use-register-workspace-commands.ts @@ -1,6 +1,6 @@ import { useAFFiNEI18N } from '@affine/i18n/hooks'; import { Workspace } from '@toeverything/infra'; -import { useService } from '@toeverything/infra/di'; +import { useService } from '@toeverything/infra'; import { useStore } from 'jotai'; import { useTheme } from 'next-themes'; import { useEffect } from 'react'; diff --git a/packages/frontend/core/src/hooks/use-workspace-info.ts b/packages/frontend/core/src/hooks/use-workspace-info.ts index e991c097b..af07d6b91 100644 --- a/packages/frontend/core/src/hooks/use-workspace-info.ts +++ b/packages/frontend/core/src/hooks/use-workspace-info.ts @@ -1,5 +1,5 @@ import { WorkspaceManager, type WorkspaceMetadata } from '@toeverything/infra'; -import { useService } from '@toeverything/infra/di'; +import { useService } from '@toeverything/infra'; import { useEffect, useState } from 'react'; import { useWorkspaceBlobObjectUrl } from './use-workspace-blob'; diff --git a/packages/frontend/core/src/hooks/use-workspace.ts b/packages/frontend/core/src/hooks/use-workspace.ts index ce793200c..932365498 100644 --- a/packages/frontend/core/src/hooks/use-workspace.ts +++ b/packages/frontend/core/src/hooks/use-workspace.ts @@ -1,6 +1,6 @@ import type { WorkspaceMetadata } from '@toeverything/infra'; import { type Workspace, WorkspaceManager } from '@toeverything/infra'; -import { useService } from '@toeverything/infra/di'; +import { useService } from '@toeverything/infra'; import { useEffect, useState } from 'react'; /** diff --git a/packages/frontend/core/src/layouts/workspace-layout.tsx b/packages/frontend/core/src/layouts/workspace-layout.tsx index c362a457f..4d52e07da 100644 --- a/packages/frontend/core/src/layouts/workspace-layout.tsx +++ b/packages/frontend/core/src/layouts/workspace-layout.tsx @@ -10,7 +10,7 @@ import { useSensors, } from '@dnd-kit/core'; import { PageRecordList, useLiveData, Workspace } from '@toeverything/infra'; -import { useService } from '@toeverything/infra/di'; +import { useService } from '@toeverything/infra'; import { useAtom, useAtomValue, useSetAtom } from 'jotai'; import type { PropsWithChildren, ReactNode } from 'react'; import { lazy, Suspense, useCallback, useEffect, useState } from 'react'; diff --git a/packages/frontend/core/src/modules/collection/service.ts b/packages/frontend/core/src/modules/collection/service.ts index 41dcf0e44..ec25e2eac 100644 --- a/packages/frontend/core/src/modules/collection/service.ts +++ b/packages/frontend/core/src/modules/collection/service.ts @@ -4,7 +4,7 @@ import type { DeletedCollection, } from '@affine/env/filter'; import type { Workspace } from '@toeverything/infra'; -import { LiveData } from '@toeverything/infra/livedata'; +import { LiveData } from '@toeverything/infra'; import { Observable } from 'rxjs'; import { Array as YArray } from 'yjs'; diff --git a/packages/frontend/core/src/modules/multi-tab-sidebar/entities/tabs/journal.tsx b/packages/frontend/core/src/modules/multi-tab-sidebar/entities/tabs/journal.tsx index 2ccf41c48..732cb7120 100644 --- a/packages/frontend/core/src/modules/multi-tab-sidebar/entities/tabs/journal.tsx +++ b/packages/frontend/core/src/modules/multi-tab-sidebar/entities/tabs/journal.tsx @@ -27,7 +27,7 @@ import { useLiveData, Workspace, } from '@toeverything/infra'; -import { useService } from '@toeverything/infra/di'; +import { useService } from '@toeverything/infra'; import { assignInlineVars } from '@vanilla-extract/dynamic'; import clsx from 'clsx'; import dayjs from 'dayjs'; diff --git a/packages/frontend/core/src/modules/navigation/view/navigation-buttons.tsx b/packages/frontend/core/src/modules/navigation/view/navigation-buttons.tsx index f74b8693a..8dbedeae6 100644 --- a/packages/frontend/core/src/modules/navigation/view/navigation-buttons.tsx +++ b/packages/frontend/core/src/modules/navigation/view/navigation-buttons.tsx @@ -1,8 +1,8 @@ import { IconButton, Tooltip } from '@affine/component'; import { useAFFiNEI18N } from '@affine/i18n/hooks'; import { ArrowLeftSmallIcon, ArrowRightSmallIcon } from '@blocksuite/icons'; -import { useService } from '@toeverything/infra/di'; -import { useLiveData } from '@toeverything/infra/livedata'; +import { useService } from '@toeverything/infra'; +import { useLiveData } from '@toeverything/infra'; import { useCallback, useEffect, useMemo } from 'react'; import { useGeneralShortcuts } from '../../../hooks/affine/use-shortcuts'; diff --git a/packages/frontend/core/src/modules/navigation/view/use-register-navigation-commands.ts b/packages/frontend/core/src/modules/navigation/view/use-register-navigation-commands.ts index 6945d3097..4b815555a 100644 --- a/packages/frontend/core/src/modules/navigation/view/use-register-navigation-commands.ts +++ b/packages/frontend/core/src/modules/navigation/view/use-register-navigation-commands.ts @@ -1,8 +1,8 @@ import { PreconditionStrategy, registerAffineCommand, -} from '@toeverything/infra/command'; -import { useService } from '@toeverything/infra/di'; +} from '@toeverything/infra'; +import { useService } from '@toeverything/infra'; import { useEffect } from 'react'; import { Navigator } from '../entities/navigator'; diff --git a/packages/frontend/core/src/modules/right-sidebar/entities/right-sidebar.ts b/packages/frontend/core/src/modules/right-sidebar/entities/right-sidebar.ts index 7aa11aa85..f236de0c6 100644 --- a/packages/frontend/core/src/modules/right-sidebar/entities/right-sidebar.ts +++ b/packages/frontend/core/src/modules/right-sidebar/entities/right-sidebar.ts @@ -1,5 +1,5 @@ -import { LiveData } from '@toeverything/infra/livedata'; -import type { GlobalState } from '@toeverything/infra/storage'; +import type { GlobalState } from '@toeverything/infra'; +import { LiveData } from '@toeverything/infra'; import type { RightSidebarView } from './right-sidebar-view'; diff --git a/packages/frontend/core/src/modules/right-sidebar/view/container.tsx b/packages/frontend/core/src/modules/right-sidebar/view/container.tsx index fc9094919..a20c4a05d 100644 --- a/packages/frontend/core/src/modules/right-sidebar/view/container.tsx +++ b/packages/frontend/core/src/modules/right-sidebar/view/container.tsx @@ -1,8 +1,8 @@ import { ResizePanel } from '@affine/component/resize-panel'; import { appSidebarOpenAtom } from '@affine/core/components/app-sidebar'; -import { appSettingAtom } from '@toeverything/infra/atom'; -import { useService } from '@toeverything/infra/di'; -import { useLiveData } from '@toeverything/infra/livedata'; +import { appSettingAtom } from '@toeverything/infra'; +import { useService } from '@toeverything/infra'; +import { useLiveData } from '@toeverything/infra'; import { useAtomValue } from 'jotai'; import { useCallback, useEffect, useState } from 'react'; diff --git a/packages/frontend/core/src/modules/workbench/view/browser-adapter.ts b/packages/frontend/core/src/modules/workbench/view/browser-adapter.ts index d1991f3b1..36b215f5a 100644 --- a/packages/frontend/core/src/modules/workbench/view/browser-adapter.ts +++ b/packages/frontend/core/src/modules/workbench/view/browser-adapter.ts @@ -1,4 +1,4 @@ -import { useLiveData } from '@toeverything/infra/livedata'; +import { useLiveData } from '@toeverything/infra'; import { type Location } from 'history'; import { useEffect } from 'react'; // eslint-disable-next-line @typescript-eslint/no-restricted-imports diff --git a/packages/frontend/core/src/modules/workbench/view/route-container.tsx b/packages/frontend/core/src/modules/workbench/view/route-container.tsx index 4fcf1f2e5..0c62de148 100644 --- a/packages/frontend/core/src/modules/workbench/view/route-container.tsx +++ b/packages/frontend/core/src/modules/workbench/view/route-container.tsx @@ -2,7 +2,7 @@ import { IconButton } from '@affine/component'; import { WindowsAppControls } from '@affine/core/components/pure/header/windows-app-controls'; import { RightSidebarIcon } from '@blocksuite/icons'; import { useLiveData } from '@toeverything/infra'; -import { useService } from '@toeverything/infra/di'; +import { useService } from '@toeverything/infra'; import { useAtomValue } from 'jotai'; import { Suspense, useCallback } from 'react'; diff --git a/packages/frontend/core/src/modules/workbench/view/split-view/panel.tsx b/packages/frontend/core/src/modules/workbench/view/split-view/panel.tsx index 38fdc1b4e..a300725fa 100644 --- a/packages/frontend/core/src/modules/workbench/view/split-view/panel.tsx +++ b/packages/frontend/core/src/modules/workbench/view/split-view/panel.tsx @@ -7,8 +7,8 @@ import { SoloViewIcon, } from '@blocksuite/icons'; import { useSortable } from '@dnd-kit/sortable'; -import { useService } from '@toeverything/infra/di'; -import { useLiveData } from '@toeverything/infra/livedata'; +import { useService } from '@toeverything/infra'; +import { useLiveData } from '@toeverything/infra'; import { assignInlineVars } from '@vanilla-extract/dynamic'; import type { SetStateAction } from 'jotai'; import { diff --git a/packages/frontend/core/src/modules/workbench/view/split-view/split-view.tsx b/packages/frontend/core/src/modules/workbench/view/split-view/split-view.tsx index 3638026da..84684af6c 100644 --- a/packages/frontend/core/src/modules/workbench/view/split-view/split-view.tsx +++ b/packages/frontend/core/src/modules/workbench/view/split-view/split-view.tsx @@ -11,7 +11,7 @@ import { horizontalListSortingStrategy, SortableContext, } from '@dnd-kit/sortable'; -import { useService } from '@toeverything/infra/di'; +import { useService } from '@toeverything/infra'; import clsx from 'clsx'; import { type HTMLAttributes, diff --git a/packages/frontend/core/src/modules/workbench/view/use-view-position.tsx b/packages/frontend/core/src/modules/workbench/view/use-view-position.tsx index 06c6f6f47..d728e963c 100644 --- a/packages/frontend/core/src/modules/workbench/view/use-view-position.tsx +++ b/packages/frontend/core/src/modules/workbench/view/use-view-position.tsx @@ -1,4 +1,4 @@ -import { useService } from '@toeverything/infra/di'; +import { useService } from '@toeverything/infra'; import { useEffect, useState } from 'react'; import type { View } from '../entities/view'; diff --git a/packages/frontend/core/src/modules/workbench/view/view-root.tsx b/packages/frontend/core/src/modules/workbench/view/view-root.tsx index c885bf541..37c61c8b7 100644 --- a/packages/frontend/core/src/modules/workbench/view/view-root.tsx +++ b/packages/frontend/core/src/modules/workbench/view/view-root.tsx @@ -1,4 +1,4 @@ -import { useLiveData } from '@toeverything/infra/livedata'; +import { useLiveData } from '@toeverything/infra'; import { lazy as reactLazy, useEffect, useMemo } from 'react'; import { createMemoryRouter, diff --git a/packages/frontend/core/src/modules/workbench/view/workbench-link.tsx b/packages/frontend/core/src/modules/workbench/view/workbench-link.tsx index d40a7937d..33a605fb5 100644 --- a/packages/frontend/core/src/modules/workbench/view/workbench-link.tsx +++ b/packages/frontend/core/src/modules/workbench/view/workbench-link.tsx @@ -1,6 +1,6 @@ import { useAppSettingHelper } from '@affine/core/hooks/affine/use-app-setting-helper'; -import { useService } from '@toeverything/infra/di'; -import { useLiveData } from '@toeverything/infra/livedata'; +import { useService } from '@toeverything/infra'; +import { useLiveData } from '@toeverything/infra'; import type { To } from 'history'; import { useCallback } from 'react'; diff --git a/packages/frontend/core/src/modules/workbench/view/workbench-root.tsx b/packages/frontend/core/src/modules/workbench/view/workbench-root.tsx index 9d71a6ab7..64a119952 100644 --- a/packages/frontend/core/src/modules/workbench/view/workbench-root.tsx +++ b/packages/frontend/core/src/modules/workbench/view/workbench-root.tsx @@ -1,5 +1,5 @@ -import { useService } from '@toeverything/infra/di'; -import { useLiveData } from '@toeverything/infra/livedata'; +import { useService } from '@toeverything/infra'; +import { useLiveData } from '@toeverything/infra'; import { useCallback, useEffect, useRef } from 'react'; import { useLocation } from 'react-router-dom'; diff --git a/packages/frontend/core/src/modules/workspace/current-workspace.ts b/packages/frontend/core/src/modules/workspace/current-workspace.ts index 9391aae10..9c5b40a2d 100644 --- a/packages/frontend/core/src/modules/workspace/current-workspace.ts +++ b/packages/frontend/core/src/modules/workspace/current-workspace.ts @@ -1,5 +1,5 @@ import type { Workspace } from '@toeverything/infra'; -import { LiveData } from '@toeverything/infra/livedata'; +import { LiveData } from '@toeverything/infra'; /** * service to manage current workspace diff --git a/packages/frontend/core/src/modules/workspace/properties/legacy-properties.ts b/packages/frontend/core/src/modules/workspace/properties/legacy-properties.ts index c27417275..e2b66cd48 100644 --- a/packages/frontend/core/src/modules/workspace/properties/legacy-properties.ts +++ b/packages/frontend/core/src/modules/workspace/properties/legacy-properties.ts @@ -1,7 +1,7 @@ import type { Tag } from '@affine/env/filter'; import type { DocsPropertiesMeta } from '@blocksuite/store'; -import { LiveData } from '@toeverything/infra/livedata'; -import type { Workspace } from '@toeverything/infra/workspace'; +import type { Workspace } from '@toeverything/infra'; +import { LiveData } from '@toeverything/infra'; import { Observable } from 'rxjs'; /** diff --git a/packages/frontend/core/src/pages/workspace/collection/index.tsx b/packages/frontend/core/src/pages/workspace/collection/index.tsx index 438063056..16b3715b1 100644 --- a/packages/frontend/core/src/pages/workspace/collection/index.tsx +++ b/packages/frontend/core/src/pages/workspace/collection/index.tsx @@ -17,8 +17,8 @@ import { ViewLayersIcon, } from '@blocksuite/icons'; import { Workspace } from '@toeverything/infra'; -import { useService } from '@toeverything/infra/di'; -import { useLiveData } from '@toeverything/infra/livedata'; +import { useService } from '@toeverything/infra'; +import { useLiveData } from '@toeverything/infra'; import { useSetAtom } from 'jotai'; import { useCallback, useEffect, useState } from 'react'; import { useParams } from 'react-router-dom'; diff --git a/packages/frontend/core/src/pages/workspace/index.tsx b/packages/frontend/core/src/pages/workspace/index.tsx index 939ca91ea..ac791757b 100644 --- a/packages/frontend/core/src/pages/workspace/index.tsx +++ b/packages/frontend/core/src/pages/workspace/index.tsx @@ -1,8 +1,8 @@ import { useWorkspace } from '@affine/core/hooks/use-workspace'; import type { Workspace } from '@toeverything/infra'; import { WorkspaceListService, WorkspaceManager } from '@toeverything/infra'; -import { ServiceProviderContext, useService } from '@toeverything/infra/di'; -import { useLiveData } from '@toeverything/infra/livedata'; +import { ServiceProviderContext, useService } from '@toeverything/infra'; +import { useLiveData } from '@toeverything/infra'; import { type ReactElement, Suspense, useEffect, useMemo } from 'react'; import { useParams } from 'react-router-dom'; diff --git a/packages/frontend/core/src/pages/workspace/trash-page.tsx b/packages/frontend/core/src/pages/workspace/trash-page.tsx index 651ad24d7..d469969d9 100644 --- a/packages/frontend/core/src/pages/workspace/trash-page.tsx +++ b/packages/frontend/core/src/pages/workspace/trash-page.tsx @@ -18,7 +18,7 @@ import { assertExists } from '@blocksuite/global/utils'; import { DeleteIcon } from '@blocksuite/icons'; import type { DocMeta } from '@blocksuite/store'; import { Workspace } from '@toeverything/infra'; -import { useService } from '@toeverything/infra/di'; +import { useService } from '@toeverything/infra'; import { useCallback } from 'react'; import { ViewBodyIsland, ViewHeaderIsland } from '../../modules/workbench'; diff --git a/packages/frontend/core/src/providers/modal-provider.tsx b/packages/frontend/core/src/providers/modal-provider.tsx index f3e064fa6..a92a84447 100644 --- a/packages/frontend/core/src/providers/modal-provider.tsx +++ b/packages/frontend/core/src/providers/modal-provider.tsx @@ -1,8 +1,8 @@ import { events } from '@affine/electron-api'; import { WorkspaceFlavour } from '@affine/env/workspace'; import { WorkspaceManager } from '@toeverything/infra'; -import { useService } from '@toeverything/infra/di'; -import { useLiveData } from '@toeverything/infra/livedata'; +import { useService } from '@toeverything/infra'; +import { useLiveData } from '@toeverything/infra'; import { useAtom } from 'jotai'; import { lazy, diff --git a/packages/frontend/core/src/utils/island.tsx b/packages/frontend/core/src/utils/island.tsx index 8596881e9..9ba0b7020 100644 --- a/packages/frontend/core/src/utils/island.tsx +++ b/packages/frontend/core/src/utils/island.tsx @@ -1,4 +1,4 @@ -import { LiveData, useLiveData } from '@toeverything/infra/livedata'; +import { LiveData, useLiveData } from '@toeverything/infra'; import { useEffect, useRef } from 'react'; import { createPortal } from 'react-dom'; diff --git a/packages/frontend/electron/renderer/app.tsx b/packages/frontend/electron/renderer/app.tsx index d6f250c3d..8567e8339 100644 --- a/packages/frontend/electron/renderer/app.tsx +++ b/packages/frontend/electron/renderer/app.tsx @@ -16,8 +16,8 @@ import createEmotionCache from '@affine/core/utils/create-emotion-cache'; import { configureWebServices } from '@affine/core/web'; import { createI18n, setUpLanguage } from '@affine/i18n'; import { CacheProvider } from '@emotion/react'; -import { getCurrentStore } from '@toeverything/infra/atom'; -import { ServiceCollection } from '@toeverything/infra/di'; +import { getCurrentStore } from '@toeverything/infra'; +import { ServiceCollection } from '@toeverything/infra'; import mixpanel from 'mixpanel-browser'; import type { PropsWithChildren, ReactElement } from 'react'; import { lazy, Suspense } from 'react'; diff --git a/packages/frontend/electron/src/helper/db/base-db-adapter.ts b/packages/frontend/electron/src/helper/db/base-db-adapter.ts index 30d3fe473..cc17c857c 100644 --- a/packages/frontend/electron/src/helper/db/base-db-adapter.ts +++ b/packages/frontend/electron/src/helper/db/base-db-adapter.ts @@ -3,7 +3,7 @@ import { SqliteConnection, ValidationResult, } from '@affine/native'; -import { WorkspaceVersion } from '@toeverything/infra/blocksuite'; +import { WorkspaceVersion } from '@toeverything/infra'; import { applyGuidCompatibilityFix, migrateToLatest } from '../db/migration'; import { logger } from '../logger'; diff --git a/packages/frontend/electron/src/helper/db/migration.ts b/packages/frontend/electron/src/helper/db/migration.ts index dc1da3519..110502611 100644 --- a/packages/frontend/electron/src/helper/db/migration.ts +++ b/packages/frontend/electron/src/helper/db/migration.ts @@ -8,7 +8,7 @@ import { migrateGuidCompatibility, migrateToSubdoc, WorkspaceVersion, -} from '@toeverything/infra/blocksuite'; +} from '@toeverything/infra'; import fs from 'fs-extra'; import { nanoid } from 'nanoid'; import { applyUpdate, Doc as YDoc, encodeStateAsUpdate } from 'yjs'; diff --git a/packages/frontend/electron/src/helper/dialog/dialog.ts b/packages/frontend/electron/src/helper/dialog/dialog.ts index c532556d7..3ea7be118 100644 --- a/packages/frontend/electron/src/helper/dialog/dialog.ts +++ b/packages/frontend/electron/src/helper/dialog/dialog.ts @@ -1,7 +1,7 @@ import path from 'node:path'; import { ValidationResult } from '@affine/native'; -import { WorkspaceVersion } from '@toeverything/infra/blocksuite'; +import { WorkspaceVersion } from '@toeverything/infra'; import fs from 'fs-extra'; import { nanoid } from 'nanoid'; diff --git a/packages/frontend/electron/src/main/config-storage/persist.ts b/packages/frontend/electron/src/main/config-storage/persist.ts index 78fe9bfb5..e1c1ab7a5 100644 --- a/packages/frontend/electron/src/main/config-storage/persist.ts +++ b/packages/frontend/electron/src/main/config-storage/persist.ts @@ -1,10 +1,7 @@ import fs from 'node:fs'; import path from 'node:path'; -import { - AppConfigStorage, - defaultAppConfig, -} from '@toeverything/infra/app-config-storage'; +import { AppConfigStorage, defaultAppConfig } from '@toeverything/infra'; import { app } from 'electron'; const FILENAME = 'config.json'; diff --git a/packages/frontend/web/src/app.tsx b/packages/frontend/web/src/app.tsx index d6f250c3d..8567e8339 100644 --- a/packages/frontend/web/src/app.tsx +++ b/packages/frontend/web/src/app.tsx @@ -16,8 +16,8 @@ import createEmotionCache from '@affine/core/utils/create-emotion-cache'; import { configureWebServices } from '@affine/core/web'; import { createI18n, setUpLanguage } from '@affine/i18n'; import { CacheProvider } from '@emotion/react'; -import { getCurrentStore } from '@toeverything/infra/atom'; -import { ServiceCollection } from '@toeverything/infra/di'; +import { getCurrentStore } from '@toeverything/infra'; +import { ServiceCollection } from '@toeverything/infra'; import mixpanel from 'mixpanel-browser'; import type { PropsWithChildren, ReactElement } from 'react'; import { lazy, Suspense } from 'react'; diff --git a/packages/frontend/workspace-impl/src/cloud/workspace-factory.ts b/packages/frontend/workspace-impl/src/cloud/workspace-factory.ts index 60da81874..ec3579d6e 100644 --- a/packages/frontend/workspace-impl/src/cloud/workspace-factory.ts +++ b/packages/frontend/workspace-impl/src/cloud/workspace-factory.ts @@ -1,5 +1,6 @@ import { WorkspaceFlavour } from '@affine/env/workspace'; import type { WorkspaceFactory } from '@toeverything/infra'; +import type { ServiceCollection } from '@toeverything/infra'; import { AwarenessContext, AwarenessProvider, @@ -8,7 +9,6 @@ import { WorkspaceIdContext, WorkspaceScope, } from '@toeverything/infra'; -import type { ServiceCollection } from '@toeverything/infra/di'; import { LocalWorkspaceFactory } from '../local'; import { IndexedDBBlobStorage } from '../local/blob-indexeddb'; diff --git a/tests/storybook/.storybook/preview.tsx b/tests/storybook/.storybook/preview.tsx index b24433e6f..ce0e84c37 100644 --- a/tests/storybook/.storybook/preview.tsx +++ b/tests/storybook/.storybook/preview.tsx @@ -7,14 +7,14 @@ import { useDarkMode } from 'storybook-dark-mode'; import { AffineContext } from '@affine/component/context'; import useSWR from 'swr'; import type { Decorator } from '@storybook/react'; -import { _setCurrentStore } from '@toeverything/infra/atom'; +import { _setCurrentStore } from '@toeverything/infra'; import { setupGlobal, type Environment } from '@affine/env/global'; import type { Preview } from '@storybook/react'; import { useLayoutEffect, useRef } from 'react'; import { setup } from '@affine/core/bootstrap/setup'; import { WorkspaceFlavour } from '@affine/env/workspace'; -import { ServiceCollection } from '@toeverything/infra/di'; +import { ServiceCollection } from '@toeverything/infra'; import { WorkspaceManager, configureInfraServices, diff --git a/tests/storybook/src/stories/share-menu.stories.tsx b/tests/storybook/src/stories/share-menu.stories.tsx index 73ebdfe72..fbd88ac9c 100644 --- a/tests/storybook/src/stories/share-menu.stories.tsx +++ b/tests/storybook/src/stories/share-menu.stories.tsx @@ -7,7 +7,7 @@ import { expect } from '@storybook/jest'; import type { Meta, StoryFn } from '@storybook/react'; import { Workspace } from '@toeverything/infra'; import { initEmptyPage } from '@toeverything/infra'; -import { useService } from '@toeverything/infra/di'; +import { useService } from '@toeverything/infra'; import { nanoid } from 'nanoid'; import { useEffect, useState } from 'react'; diff --git a/tsconfig.json b/tsconfig.json index 99656f5fc..1431be78a 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -67,7 +67,7 @@ "@affine-test/kit/*": ["./tests/kit/*"], "@affine-test/fixtures/*": ["./tests/fixtures/*"], "@toeverything/y-indexeddb": ["./packages/common/y-indexeddb/src"], - "@toeverything/infra/*": ["./packages/common/infra/src/*"], + "@toeverything/infra": ["./packages/common/infra/src"], "@affine/native": ["./packages/frontend/native/index.d.ts"], "@affine/native/*": ["./packages/frontend/native/*"], "@affine/storage": ["./packages/backend/storage/index.d.ts"], @@ -119,9 +119,6 @@ { "path": "./packages/common/infra" }, - { - "path": "./packages/common/infra" - }, { "path": "./packages/common/y-indexeddb" },