Skip to content

Commit

Permalink
refactor: update example app as expo
Browse files Browse the repository at this point in the history
  • Loading branch information
enesozturk committed Jul 19, 2022
1 parent 5986c82 commit 9bdbd6b
Show file tree
Hide file tree
Showing 44 changed files with 29,934 additions and 1 deletion.
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,8 @@ lib/
.env.development

# Build
*.tgz
*.tgz

# Example App
example/node_modules/
example/.expo/
4 changes: 4 additions & 0 deletions example/.expo-shared/assets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"12bb71342c6255bbf50437ec8f4441c083f47cdb74bd89160c15e4f43e52a1cb": true,
"40b842e832070c58deac6aa9e08fa459302ee3f9da492c7e77d93d2fbf4a56fd": true
}
12 changes: 12 additions & 0 deletions example/App.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import 'react-native-gesture-handler';

import { SafeAreaProvider } from 'react-native-safe-area-context';
import MainApp from './src/App';

export default function App() {
return (
<SafeAreaProvider>
<MainApp />
</SafeAreaProvider>
);
}
33 changes: 33 additions & 0 deletions example/app.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"expo": {
"name": "example-expo",
"slug": "example-expo",
"version": "1.0.0",
"orientation": "portrait",
"icon": "./assets/icon.png",
"userInterfaceStyle": "light",
"splash": {
"image": "./assets/splash.png",
"resizeMode": "contain",
"backgroundColor": "#ffffff"
},
"updates": {
"fallbackToCacheTimeout": 0
},
"assetBundlePatterns": [
"**/*"
],
"ios": {
"supportsTablet": true
},
"android": {
"adaptiveIcon": {
"foregroundImage": "./assets/adaptive-icon.png",
"backgroundColor": "#FFFFFF"
}
},
"web": {
"favicon": "./assets/favicon.png"
}
}
}
Binary file added example/assets/adaptive-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added example/assets/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added example/assets/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added example/assets/splash.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions example/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module.exports = function (api) {
api.cache(true);
return {
presets: [['babel-preset-expo', { jsxRuntime: 'automatic' }]],
plugins: ['react-native-reanimated/plugin'],
};
};
49 changes: 49 additions & 0 deletions example/metro.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/**
* Metro configuration for React Native
* https://github.com/facebook/react-native
*
* @format
*/

const path = require('path');
const fs = require('fs');
const blacklist = require('metro-config/src/defaults/blacklist');
const escape = require('escape-string-regexp');

const root = path.resolve(__dirname, '..');
const pak = JSON.parse(
fs.readFileSync(path.join(root, 'package.json'), 'utf8')
);

const modules = [
'@babel/runtime',
...Object.keys({
...pak.dependencies,
...pak.peerDependencies,
}),
];

module.exports = {
projectRoot: __dirname,
watchFolders: [root],

resolver: {
blacklistRE: blacklist([
new RegExp(`^${escape(path.join(root, 'node_modules'))}\\/.*$`),
]),

extraNodeModules: modules.reduce((acc, name) => {
acc[name] = path.join(__dirname, 'node_modules', name);
return acc;
}, {}),
},

transformer: {
getTransformOptions: async () => ({
transform: {
experimentalImportSupport: false,
inlineRequires: false,
},
}),
},
};
Loading

0 comments on commit 9bdbd6b

Please sign in to comment.