Skip to content

Commit

Permalink
refactor(core): move infra modules to core (#9207)
Browse files Browse the repository at this point in the history
  • Loading branch information
EYHN committed Dec 23, 2024
1 parent 2ea79d2 commit 129f94e
Show file tree
Hide file tree
Showing 337 changed files with 908 additions and 1,367 deletions.
37 changes: 0 additions & 37 deletions packages/common/infra/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,44 +4,7 @@ export * from './blocksuite';
export * from './framework';
export * from './initialization';
export * from './livedata';
export * from './modules/db';
export * from './modules/doc';
export * from './modules/feature-flag';
export * from './modules/global-context';
export * from './modules/lifecycle';
export * from './modules/storage';
export * from './modules/workspace';
export * from './orm';
export * from './storage';
export * from './sync';
export * from './utils';

import type { Framework } from './framework';
import { configureWorkspaceDBModule } from './modules/db';
import { configureDocModule } from './modules/doc';
import { configureFeatureFlagModule } from './modules/feature-flag';
import { configureGlobalContextModule } from './modules/global-context';
import { configureLifecycleModule } from './modules/lifecycle';
import {
configureGlobalStorageModule,
configureTestingGlobalStorage,
} from './modules/storage';
import {
configureTestingWorkspaceProvider,
configureWorkspaceModule,
} from './modules/workspace';

export function configureInfraModules(framework: Framework) {
configureWorkspaceModule(framework);
configureDocModule(framework);
configureWorkspaceDBModule(framework);
configureGlobalStorageModule(framework);
configureGlobalContextModule(framework);
configureLifecycleModule(framework);
configureFeatureFlagModule(framework);
}

export function configureTestingInfraModules(framework: Framework) {
configureTestingGlobalStorage(framework);
configureTestingWorkspaceProvider(framework);
}
35 changes: 0 additions & 35 deletions packages/common/infra/src/modules/db/entities/table.ts

This file was deleted.

35 changes: 0 additions & 35 deletions packages/common/infra/src/modules/storage/index.ts

This file was deleted.

This file was deleted.

This file was deleted.

8 changes: 2 additions & 6 deletions packages/frontend/apps/android/src/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,15 @@ import { configureMobileModules } from '@affine/core/mobile/modules';
import { router } from '@affine/core/mobile/router';
import { configureCommonModules } from '@affine/core/modules';
import { I18nProvider } from '@affine/core/modules/i18n';
import { LifecycleService } from '@affine/core/modules/lifecycle';
import { configureLocalStorageStateStorageImpls } from '@affine/core/modules/storage';
import { configureIndexedDBUserspaceStorageProvider } from '@affine/core/modules/userspace';
import { configureBrowserWorkbenchModule } from '@affine/core/modules/workbench';
import {
configureBrowserWorkspaceFlavours,
configureIndexedDBWorkspaceEngineStorageProvider,
} from '@affine/core/modules/workspace-engine';
import {
Framework,
FrameworkRoot,
getCurrentStore,
LifecycleService,
} from '@toeverything/infra';
import { Framework, FrameworkRoot, getCurrentStore } from '@toeverything/infra';
import { Suspense } from 'react';
import { RouterProvider } from 'react-router-dom';

Expand Down
14 changes: 5 additions & 9 deletions packages/frontend/apps/electron/renderer/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,15 @@ import {
DesktopApiService,
} from '@affine/core/modules/desktop-api';
import { GlobalDialogService } from '@affine/core/modules/dialogs';
import { DocsService } from '@affine/core/modules/doc';
import {
configureSpellCheckSettingModule,
EditorSettingService,
} from '@affine/core/modules/editor-setting';
import { configureFindInPageModule } from '@affine/core/modules/find-in-page';
import { GlobalContextService } from '@affine/core/modules/global-context';
import { I18nProvider } from '@affine/core/modules/i18n';
import { LifecycleService } from '@affine/core/modules/lifecycle';
import { configureElectronStateStorageImpls } from '@affine/core/modules/storage';
import {
ClientSchemeProvider,
Expand All @@ -26,22 +29,15 @@ import {
configureDesktopWorkbenchModule,
WorkbenchService,
} from '@affine/core/modules/workbench';
import { WorkspacesService } from '@affine/core/modules/workspace';
import {
configureBrowserWorkspaceFlavours,
configureSqliteWorkspaceEngineStorageProvider,
} from '@affine/core/modules/workspace-engine';
import createEmotionCache from '@affine/core/utils/create-emotion-cache';
import { apis, events } from '@affine/electron-api';
import { CacheProvider } from '@emotion/react';
import {
DocsService,
Framework,
FrameworkRoot,
getCurrentStore,
GlobalContextService,
LifecycleService,
WorkspacesService,
} from '@toeverything/infra';
import { Framework, FrameworkRoot, getCurrentStore } from '@toeverything/infra';
import { Suspense } from 'react';
import { RouterProvider } from 'react-router-dom';

Expand Down
9 changes: 4 additions & 5 deletions packages/frontend/apps/electron/renderer/shell/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,12 @@ import {
} from '@affine/core/modules/app-tabs-header';
import { configureDesktopApiModule } from '@affine/core/modules/desktop-api';
import { configureI18nModule, I18nProvider } from '@affine/core/modules/i18n';
import { configureElectronStateStorageImpls } from '@affine/core/modules/storage';
import { configureAppThemeModule } from '@affine/core/modules/theme';
import {
configureElectronStateStorageImpls,
configureGlobalStorageModule,
Framework,
FrameworkRoot,
} from '@toeverything/infra';
} from '@affine/core/modules/storage';
import { configureAppThemeModule } from '@affine/core/modules/theme';
import { Framework, FrameworkRoot } from '@toeverything/infra';

import * as styles from './app.css';

Expand Down
Loading

0 comments on commit 129f94e

Please sign in to comment.