mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 04:48:53 +00:00
refactor: using unified nanoid (#4519)
This commit is contained in:
@@ -60,7 +60,7 @@ describe('crud', () => {
|
||||
expect(localWorkspace.blockSuiteWorkspace.doc.toJSON()).toEqual({
|
||||
meta: expect.anything(),
|
||||
spaces: expect.objectContaining({
|
||||
'space:page0': expect.anything(),
|
||||
page0: expect.anything(),
|
||||
}),
|
||||
});
|
||||
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
import { DebugLogger } from '@affine/debug';
|
||||
import type { LocalWorkspace, WorkspaceCRUD } from '@affine/env/workspace';
|
||||
import { WorkspaceFlavour } from '@affine/env/workspace';
|
||||
import { nanoid, Workspace as BlockSuiteWorkspace } from '@blocksuite/store';
|
||||
import { Workspace as BlockSuiteWorkspace } from '@blocksuite/store';
|
||||
import { createJSONStorage } from 'jotai/utils';
|
||||
import { nanoid } from 'nanoid';
|
||||
import { z } from 'zod';
|
||||
|
||||
import { getOrCreateWorkspace } from '../manager';
|
||||
|
||||
@@ -76,7 +76,7 @@ describe('download provider', () => {
|
||||
...prev,
|
||||
// download provider only download the root doc
|
||||
spaces: {
|
||||
'space:page0': {
|
||||
page0: {
|
||||
blocks: {},
|
||||
},
|
||||
},
|
||||
|
||||
@@ -5,12 +5,13 @@ import type {
|
||||
import { getDoc } from '@affine/y-provider';
|
||||
import { __unstableSchemas, AffineSchemas } from '@blocksuite/blocks/models';
|
||||
import type { Y as YType } from '@blocksuite/store';
|
||||
import { Schema, uuidv4, Workspace } from '@blocksuite/store';
|
||||
import { Schema, Workspace } from '@blocksuite/store';
|
||||
import type { DBHandlerManager } from '@toeverything/infra/handler';
|
||||
import type {
|
||||
EventMap,
|
||||
UnwrapManagerHandlerToClientSide,
|
||||
} from '@toeverything/infra/type';
|
||||
import { nanoid } from 'nanoid';
|
||||
import { setTimeout } from 'timers/promises';
|
||||
import { beforeEach, describe, expect, test, vi } from 'vitest';
|
||||
|
||||
@@ -79,7 +80,7 @@ const schema = new Schema();
|
||||
schema.register(AffineSchemas).register(__unstableSchemas);
|
||||
|
||||
beforeEach(() => {
|
||||
id = uuidv4();
|
||||
id = nanoid();
|
||||
workspace = new Workspace({
|
||||
id,
|
||||
isSSR: true,
|
||||
|
||||
Reference in New Issue
Block a user