Skip to content

Commit

Permalink
Fix async-storage command (#27)
Browse files Browse the repository at this point in the history
This PR installs `AsyncStorage` and `react-native-safe-area-context`
with `npx expo install` instead of a regular `npm install`. The Expo
docs recommend using `npx expo install` for these packages, which
ensures that the correct versions are added that have been tested with
the current Expo version. We seeing a warning that we were using an
incompatible version of AsyncStorage.

Additionally, this PR adds `thoughtbelt` as a dev dependency in the new
project so users can continue to use thoughtbelt with eg. `yarn belt`.
  • Loading branch information
Stephen Hanson authored Jan 26, 2024
1 parent c3c4a8c commit 1045531
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/commands/createApp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,14 @@ export async function createApp(name: string | undefined, options: Options) {
await exec('git init');
await commit('Initial commit');
}
spinner.start('Adding dependencies');

// add dependencies that every project will use
await addDependency(
[
'react-native-keyboard-aware-scrollview',
'react-native-safe-area-context',
'@react-native-async-storage/async-storage',
].join(' '),
spinner.start('Adding dependencies');
await exec(
'npx expo install @react-native-async-storage/async-storage react-native-safe-area-context',
);
await addDependency('react-native-keyboard-aware-scrollview');
await addDependency('thoughtbelt', { dev: true });
await commit('Add dependencies');
spinner.succeed('Added dependencies');

Expand Down

0 comments on commit 1045531

Please sign in to comment.