feat(editor): replace spec provider with extension manager (#11861)

Closes: BS-3273
This commit is contained in:
Saul-Mirone
2025-04-22 07:40:41 +00:00
parent 8fdb00e0ab
commit 6d6504e2af
51 changed files with 623 additions and 177 deletions
@@ -1,5 +1,5 @@
import type { StoreExtensionManager } from '@blocksuite/affine/ext-loader';
import { AffineSchemas } from '@blocksuite/affine/schemas';
import { SpecProvider } from '@blocksuite/affine/shared/utils';
import { nanoid, Schema, Transformer } from '@blocksuite/affine/store';
import {
createAutoIncrementIdGenerator,
@@ -23,7 +23,9 @@ const room = params.get('room');
const isE2E = room?.startsWith('playwright');
const blobSourceArgs = (params.get('blobSource') ?? '').split(',');
export function createStarterDocCollection() {
export function createStarterDocCollection(
storeExtensionManager: StoreExtensionManager
) {
const collectionId = room ?? 'starter';
const schema = new Schema();
schema.register(AffineSchemas);
@@ -56,7 +58,7 @@ export function createStarterDocCollection() {
blobSources,
};
const collection = new TestWorkspace(options);
collection.storeExtensions = SpecProvider._.getSpec('store').value;
collection.storeExtensions = storeExtensionManager.get('store');
collection.start();
// debug info