|
| 1 | +import { BaseMods } from '../ExpoConfigPlugins.js'; |
| 2 | +import { makeNullProvider } from '../provider.js'; |
| 3 | +import type { CustomModProvider, IosModFileProviders } from '../types.js'; |
| 4 | + |
| 5 | +export function createModFileProviders( |
| 6 | + modifyFilePath: CustomModProvider |
| 7 | +): IosModFileProviders { |
| 8 | + const nullProvider = makeNullProvider(); |
| 9 | + |
| 10 | + // https://github.com/expo/expo/blob/sdk-51/packages/%40expo/config-plugins/src/plugins/withIosBaseMods.ts |
| 11 | + const expoProviders = BaseMods.getIosModFileProviders(); |
| 12 | + |
| 13 | + const defaultProviders: IosModFileProviders = { |
| 14 | + dangerous: expoProviders.dangerous, |
| 15 | + finalized: expoProviders.finalized, |
| 16 | + appDelegate: modifyFilePath( |
| 17 | + expoProviders.appDelegate, |
| 18 | + // @todo rewrite template finding and copying logic |
| 19 | + 'App76/AppDelegate.swift' |
| 20 | + ), |
| 21 | + // @ts-expect-error todo fix |
| 22 | + expoPlist: nullProvider, |
| 23 | + xcodeproj: modifyFilePath( |
| 24 | + expoProviders.xcodeproj, |
| 25 | + // @todo rewrite template finding and copying logic |
| 26 | + 'App76.xcodeproj/project.pbxproj' |
| 27 | + ), |
| 28 | + infoPlist: modifyFilePath(expoProviders.infoPlist, 'Info.plist'), |
| 29 | + // @ts-expect-error todo fix |
| 30 | + entitlements: nullProvider, |
| 31 | + // @ts-expect-error todo fix |
| 32 | + podfile: makeNullProvider({ |
| 33 | + path: '', |
| 34 | + language: /** @type {const} */ 'rb', |
| 35 | + contents: '', |
| 36 | + }), |
| 37 | + // @ts-expect-error todo fix |
| 38 | + podfileProperties: makeNullProvider(), |
| 39 | + }; |
| 40 | + |
| 41 | + return defaultProviders; |
| 42 | +} |
0 commit comments