feat(release): prepare 1.1.0 candidate
This commit is contained in:
parent
5a34f66981
commit
5205dcdfa9
736 changed files with 115667 additions and 12203 deletions
44
apps/mobile-rn/src/lib/e2e-runtime-bootstrap.ts
Normal file
44
apps/mobile-rn/src/lib/e2e-runtime-bootstrap.ts
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
import { NativeModules, Platform } from 'react-native'
|
||||
|
||||
interface E2eRuntimeCandidate {
|
||||
e2eTestBuild?: unknown
|
||||
supabaseUrlOverride?: unknown
|
||||
supabaseAnonKeyOverride?: unknown
|
||||
}
|
||||
|
||||
export function resolveMobileE2eSupabaseOverride(
|
||||
candidate: E2eRuntimeCandidate | undefined,
|
||||
platform: string,
|
||||
): { url: string; anonKey: string } | null {
|
||||
const url = typeof candidate?.supabaseUrlOverride === 'string'
|
||||
? candidate.supabaseUrlOverride
|
||||
: ''
|
||||
const anonKey = typeof candidate?.supabaseAnonKeyOverride === 'string'
|
||||
? candidate.supabaseAnonKeyOverride
|
||||
: ''
|
||||
if (url === '' && anonKey === '') return null
|
||||
|
||||
if (
|
||||
platform !== 'android'
|
||||
|| candidate?.e2eTestBuild !== true
|
||||
|| url !== 'http://10.0.2.2:55321'
|
||||
|| !/^sb_publishable_[A-Za-z0-9_-]{20,}$/.test(anonKey)
|
||||
) {
|
||||
throw new Error('mobile_e2e_supabase_override_invalid')
|
||||
}
|
||||
|
||||
return { url, anonKey }
|
||||
}
|
||||
|
||||
const override = resolveMobileE2eSupabaseOverride(
|
||||
NativeModules.D3ROConfig as E2eRuntimeCandidate | undefined,
|
||||
Platform.OS,
|
||||
)
|
||||
|
||||
if (override !== null) {
|
||||
;(
|
||||
globalThis as typeof globalThis & {
|
||||
__D3RO_MOBILE_E2E_SUPABASE__?: { url: string; anonKey: string }
|
||||
}
|
||||
).__D3RO_MOBILE_E2E_SUPABASE__ = override
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue