Skip to content

Commit

Permalink
Remove Expo app.json configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
ProchaLu committed Nov 18, 2024
1 parent 3e088b9 commit c39362d
Showing 1 changed file with 0 additions and 32 deletions.
32 changes: 0 additions & 32 deletions bin/expo-setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,38 +10,6 @@
import { readFile, writeFile } from 'node:fs/promises';
import isPlainObject from 'is-plain-obj';

const appFilePath = 'app.json';
const appJson = JSON.parse(await readFile(appFilePath, 'utf8'));

if (!isPlainObject(appJson) || !isPlainObject(appJson.expo)) {
throw new Error(
'app.json either contains non-object or contains object without .expo property',
);
}

appJson.expo.experiments ||= {};
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- Set to empty object in previous line, if falsy
appJson.expo.experiments.typedRoutes = true;

appJson.expo.plugins = [
[
'expo-build-properties',
{
ios: {
newArchEnabled: true,
},
android: {
newArchEnabled: true,
},
},
],
];

await writeFile(appFilePath, JSON.stringify(appJson, null, 2), 'utf8');
console.log(
'✅ Enabled New Architecture and typedRoutes experiment in app.json',
);

await writeFile('.env.development', 'EXPO_USE_FAST_RESOLVER=1', 'utf8');
console.log('✅ Enabled new Metro resolver in .env.development');
await writeFile('.env.production', 'EXPO_USE_FAST_RESOLVER=1', 'utf8');
Expand Down

0 comments on commit c39362d

Please sign in to comment.