Skip to content

Commit

Permalink
Move import to code usage
Browse files Browse the repository at this point in the history
  • Loading branch information
ProchaLu committed Jan 24, 2025
1 parent 78bb7ef commit ca81b51
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions bin/expo-setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,6 @@ import { readFile, unlink, writeFile } from 'node:fs/promises';
import { promisify } from 'node:util';
import isPlainObject from 'is-plain-obj';

// Install Prettier to format `app.config.ts`, colocated in this script for
// easier removal
//
// TODO: Remove if `create-expo-app` creates `app.config.ts` in future:
// - https://github.com/expo/expo/issues/34357
await promisify(exec)('pnpm add --save-dev prettier');
const { format } = await import('prettier');

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

Expand All @@ -32,6 +24,14 @@ if (!isPlainObject(appJson) || !isPlainObject(appJson.expo)) {
);
}

// Install Prettier to format `app.config.ts`, colocated in this script for
// easier removal
//
// TODO: Remove if `create-expo-app` creates `app.config.ts` in future:
// - https://github.com/expo/expo/issues/34357
await promisify(exec)('pnpm add --save-dev prettier');
const { format } = await import('prettier');

await writeFile(
'app.config.ts',
await format(
Expand Down

0 comments on commit ca81b51

Please sign in to comment.