1import { createRunOncePlugin } from '@expo/config-plugins';
2import { ExpoConfig } from 'expo/config';
3// @ts-expect-error missing types
4import withDevLauncher from 'expo-dev-launcher/app.plugin';
5import type { PluginConfigType } from 'expo-dev-launcher/plugin/build/pluginConfig';
6// @ts-expect-error missing types
7import withDevMenu from 'expo-dev-menu/app.plugin';
8
9import { withGeneratedAndroidScheme } from './withGeneratedAndroidScheme';
10import { withGeneratedIosScheme } from './withGeneratedIosScheme';
11
12const pkg = require('expo-dev-client/package.json');
13
14function withDevClient(config: ExpoConfig, props: PluginConfigType) {
15  config = withDevMenu(config);
16  config = withDevLauncher(config, props);
17  config = withGeneratedAndroidScheme(config);
18  config = withGeneratedIosScheme(config);
19  return config;
20}
21
22export default createRunOncePlugin<PluginConfigType>(withDevClient, pkg.name, pkg.version);
23