refactor: migrate app.config and Expo config plugins to TypeScript (#1718)

This commit is contained in:
Gauvain
2026-06-30 09:03:47 +02:00
committed by GitHub
parent 97b6a912e0
commit 286a3cad47
19 changed files with 216 additions and 89 deletions

32
plugins/withGitPod.ts Normal file
View File

@@ -0,0 +1,32 @@
import { type ConfigPlugin, withPodfile } from "expo/config-plugins";
interface GitPodOptions {
podName: string;
podspecUrl: string;
}
const withGitPod: ConfigPlugin<GitPodOptions> = (
config,
{ podName, podspecUrl },
) => {
return withPodfile(config, (config) => {
const podfile = config.modResults.contents;
const podLine = ` pod '${podName}', :podspec => '${podspecUrl}'`;
// Check if already added
if (podfile.includes(podLine)) {
return config;
}
// Insert after "use_expo_modules!"
config.modResults.contents = podfile.replace(
"use_expo_modules!",
`use_expo_modules!\n${podLine}`,
);
return config;
});
};
export default withGitPod;