refactor: 只保留 Web,移除 Capacitor 原生壳
删除 android/、ios/ 两个 Capacitor 原生工程与 capacitor.config.ts、 ionic.config.json,以及 scripts/android、scripts/ios.sh 构建脚本; 根与 apps/web 的 @capacitor/* 依赖和相关 npm scripts 一并移除。 Web 侧去掉原生分支:登录只走云乐坊容器授权面板或顶层重定向, 暗色模式不再改原生状态栏,移除 Android 物理返回键处理。 保留 @nuxtjs/ionic(Web UI 框架)、云乐坊 window.ylf 桥接与 PWA。 决策记录见 docs/decisions/0004-web-only.md。
This commit is contained in:
@@ -31,8 +31,6 @@ describe('yunlefun auth controller', () => {
|
||||
const identity = fakeIdentityAdapter()
|
||||
const controller = createYunlefunAuthController({
|
||||
identity,
|
||||
native: fakeAuthorizationAdapter(),
|
||||
platform: 'web',
|
||||
web,
|
||||
})
|
||||
|
||||
@@ -46,29 +44,17 @@ describe('yunlefun auth controller', () => {
|
||||
expect(identity.adopted).toEqual([authorization])
|
||||
})
|
||||
|
||||
it('opens the platform-appropriate authorization surface', async () => {
|
||||
it('opens the web authorization surface', async () => {
|
||||
const web = fakeAuthorizationAdapter()
|
||||
const native = fakeAuthorizationAdapter()
|
||||
const webController = createYunlefunAuthController({
|
||||
const controller = createYunlefunAuthController({
|
||||
identity: fakeIdentityAdapter(),
|
||||
native,
|
||||
platform: 'web',
|
||||
web,
|
||||
})
|
||||
const nativeController = createYunlefunAuthController({
|
||||
identity: fakeIdentityAdapter(),
|
||||
native,
|
||||
platform: 'native',
|
||||
web,
|
||||
})
|
||||
|
||||
await webController.signIn()
|
||||
await nativeController.signIn()
|
||||
await controller.signIn()
|
||||
|
||||
expect(web.started).toBe(1)
|
||||
expect(native.started).toBe(1)
|
||||
expect(webController.snapshot().status).toBe('signing-in')
|
||||
expect(nativeController.snapshot().status).toBe('signing-in')
|
||||
expect(controller.snapshot().status).toBe('signing-in')
|
||||
})
|
||||
|
||||
it('adopts a host authorization without leaving the current page', async () => {
|
||||
@@ -76,8 +62,6 @@ describe('yunlefun auth controller', () => {
|
||||
const identity = fakeIdentityAdapter()
|
||||
const controller = createYunlefunAuthController({
|
||||
identity,
|
||||
native: fakeAuthorizationAdapter(),
|
||||
platform: 'web',
|
||||
web,
|
||||
})
|
||||
|
||||
@@ -95,8 +79,6 @@ describe('yunlefun auth controller', () => {
|
||||
const identity = fakeIdentityAdapter(account)
|
||||
const controller = createYunlefunAuthController({
|
||||
identity,
|
||||
native: fakeAuthorizationAdapter(),
|
||||
platform: 'web',
|
||||
web: fakeAuthorizationAdapter(),
|
||||
})
|
||||
await controller.initialize()
|
||||
@@ -119,8 +101,6 @@ describe('yunlefun auth controller', () => {
|
||||
}
|
||||
const controller = createYunlefunAuthController({
|
||||
identity,
|
||||
native: fakeAuthorizationAdapter(),
|
||||
platform: 'web',
|
||||
web: fakeAuthorizationAdapter(),
|
||||
})
|
||||
await controller.initialize()
|
||||
@@ -133,22 +113,6 @@ describe('yunlefun auth controller', () => {
|
||||
status: 'error',
|
||||
})
|
||||
})
|
||||
|
||||
it('adopts an authorization delivered after the native app resumes', async () => {
|
||||
const identity = fakeIdentityAdapter()
|
||||
const controller = createYunlefunAuthController({
|
||||
identity,
|
||||
native: fakeAuthorizationAdapter(),
|
||||
platform: 'native',
|
||||
web: fakeAuthorizationAdapter(),
|
||||
})
|
||||
await controller.initialize()
|
||||
|
||||
await controller.handleAuthorization(authorization)
|
||||
|
||||
expect(identity.adopted).toEqual([authorization])
|
||||
expect(controller.snapshot().status).toBe('signed-in')
|
||||
})
|
||||
})
|
||||
|
||||
function fakeAuthorizationAdapter(
|
||||
|
||||
Reference in New Issue
Block a user