feat(web): add workspace-aware session flow

This commit is contained in:
imccyu
2026-07-25 16:04:48 +08:00
parent 755e2a8c51
commit 9eb9c70a8a
170 changed files with 7573 additions and 3006 deletions

View File

@@ -1,6 +1,6 @@
import { describe, expect, it } from 'vitest'
import { Context } from 'cordis'
import Storage, { BackendRegistry } from '../src/index.ts'
import Storage, { BackendRegistry, storageBackendServiceKey } from '../src/index.ts'
import type { StorageBackend } from '../src/index.ts'
const fakeBackend = (): StorageBackend => ({ close: async () => {} })
@@ -25,6 +25,11 @@ describe('BackendRegistry', () => {
})
describe('Storage service', () => {
it('derives stable lifecycle service keys for named backends', () => {
expect(storageBackendServiceKey('json')).toBe('storage.backend.json')
expect(storageBackendServiceKey('tenant-a')).toBe('storage.backend.tenant-a')
})
it('mounts on the context and exposes registry plus form mounting', async () => {
const ctx = new Context()
await ctx.plugin(Storage)