diff --git a/examples/react-native/App.js b/examples/react-native/App.js new file mode 100644 index 0000000..e298398 --- /dev/null +++ b/examples/react-native/App.js @@ -0,0 +1,29 @@ +import 'event-target-polyfill'; +import 'text-encoding-polyfill'; +import { StatusBar } from 'expo-status-bar'; +import { StyleSheet, Text, View } from 'react-native'; + +import { createLightNode } from "@waku/sdk"; + +export default function App() { + return ( + + Open up App.js to start working on your app! + + + + ); +} + +const Waku = () => { + const node = createLightNode(); +}; + +const styles = StyleSheet.create({ + container: { + flex: 1, + backgroundColor: '#fff', + alignItems: 'center', + justifyContent: 'center', + }, +}); diff --git a/examples/react-native/app.json b/examples/react-native/app.json new file mode 100644 index 0000000..e3e1e3f --- /dev/null +++ b/examples/react-native/app.json @@ -0,0 +1,31 @@ +{ + "expo": { + "name": "tmp", + "slug": "tmp", + "version": "1.0.0", + "orientation": "portrait", + "icon": "./assets/icon.png", + "userInterfaceStyle": "light", + "splash": { + "image": "./assets/splash.png", + "resizeMode": "contain", + "backgroundColor": "#ffffff" + }, + "assetBundlePatterns": [ + "**/*" + ], + "ios": { + "supportsTablet": true + }, + "android": { + "adaptiveIcon": { + "foregroundImage": "./assets/adaptive-icon.png", + "backgroundColor": "#ffffff" + } + }, + "web": { + "bundler": "webpack", + "favicon": "./assets/favicon.png" + } + } +} diff --git a/examples/react-native/assets/adaptive-icon.png b/examples/react-native/assets/adaptive-icon.png new file mode 100644 index 0000000..03d6f6b Binary files /dev/null and b/examples/react-native/assets/adaptive-icon.png differ diff --git a/examples/react-native/assets/favicon.png b/examples/react-native/assets/favicon.png new file mode 100644 index 0000000..e75f697 Binary files /dev/null and b/examples/react-native/assets/favicon.png differ diff --git a/examples/react-native/assets/icon.png b/examples/react-native/assets/icon.png new file mode 100644 index 0000000..a0b1526 Binary files /dev/null and b/examples/react-native/assets/icon.png differ diff --git a/examples/react-native/assets/splash.png b/examples/react-native/assets/splash.png new file mode 100644 index 0000000..0e89705 Binary files /dev/null and b/examples/react-native/assets/splash.png differ diff --git a/examples/react-native/babel.config.js b/examples/react-native/babel.config.js new file mode 100644 index 0000000..fccd774 --- /dev/null +++ b/examples/react-native/babel.config.js @@ -0,0 +1,6 @@ +module.exports = function(api) { + api.cache(true); + return { + "presets": ['babel-preset-expo'], + }; +}; diff --git a/examples/react-native/metro.config.js b/examples/react-native/metro.config.js new file mode 100644 index 0000000..eb756a2 --- /dev/null +++ b/examples/react-native/metro.config.js @@ -0,0 +1,13 @@ +// Learn more https://docs.expo.io/guides/customizing-metro +const { getDefaultConfig } = require('expo/metro-config'); +const path = require("path"); + +/** @type {import('expo/metro-config').MetroConfig} */ +const config = getDefaultConfig(__dirname); + +config.resolver.unstable_enablePackageExports = true; +config.resolver.extraNodeModules = { + "url": path.resolve(__dirname, "node_modules", "react-native-url-polyfill"), +}; + +module.exports = config; diff --git a/examples/react-native/package.json b/examples/react-native/package.json new file mode 100644 index 0000000..7b3a305 --- /dev/null +++ b/examples/react-native/package.json @@ -0,0 +1,32 @@ +{ + "name": "tmp", + "version": "1.0.0", + "main": "node_modules/expo/AppEntry.js", + "scripts": { + "start": "expo start", + "android": "expo start --android", + "ios": "expo start --ios", + "web": "expo start --web" + }, + "dependencies": { + "@expo/metro-runtime": "~3.1.3", + "@expo/webpack-config": "~19.0.1", + "@waku/sdk": "^0.0.23", + "event-target-polyfill": "^0.0.4", + "event-target-shim": "^6.0.2", + "expo": "~50.0.13", + "expo-status-bar": "~1.11.1", + "react": "18.2.0", + "react-dom": "18.2.0", + "react-native": "0.73.6", + "react-native-url-polyfill": "^2.0.0", + "react-native-web": "~0.19.6", + "text-encoding": "^0.7.0", + "text-encoding-polyfill": "^0.6.7" + }, + "devDependencies": { + "@babel/core": "^7.20.0", + "babel-plugin-module-resolver": "^5.0.0" + }, + "private": true +}