Build a separate driver app from the same codebase: APP_VARIANT=driver (app.config.ts) sets its name, bundle ID and scheme, eas.json gets driver build profiles, and Stack.Protected keeps each app to its own screens. metro.config.js keys Metro's cache by variant so switching apps never serves the other's baked-in config. Drivers get ride requests only in driving mode. While driving they see a waiting animation or, on a ride, turn-by-turn directions; requests slide up over either without disturbing it. Accepting mid-ride queues the ride (one in progress plus one queued). Going offline or online mid-round leaves or joins it. Simulated phones no longer touch the location API: each sits at a mocked position from its URL (default downtown San Francisco). Phone specs in sim.html move to named key=value options. Scenarios cover driving mode, interruptions, the ride queue and mocked location, each with a slow version. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
26 lines
942 B
TypeScript
26 lines
942 B
TypeScript
import type { ConfigContext, ExpoConfig } from 'expo/config';
|
|
|
|
// One codebase, two apps: the rider app (default) and the driver app. Pick one with
|
|
// APP_VARIANT=driver when starting the dev server or in an EAS build profile (eas.json).
|
|
// Static settings stay in app.json; only what differs between the apps is set here.
|
|
const variant = process.env.APP_VARIANT === 'driver' ? 'driver' : 'rider';
|
|
const isDriver = variant === 'driver';
|
|
|
|
export default ({ config }: ConfigContext): ExpoConfig => ({
|
|
...config,
|
|
name: isDriver ? 'RideRN Driver' : 'RideRN',
|
|
slug: config.slug ?? 'RideRN',
|
|
scheme: isDriver ? 'ridern-driver' : 'ridern',
|
|
ios: {
|
|
...config.ios,
|
|
bundleIdentifier: isDriver ? 'com.example.ridern.driver' : 'com.example.ridern',
|
|
},
|
|
android: {
|
|
...config.android,
|
|
package: isDriver ? 'com.example.ridern.driver' : 'com.example.ridern',
|
|
},
|
|
extra: {
|
|
...config.extra,
|
|
appVariant: variant,
|
|
},
|
|
});
|