diff --git a/example/SampleProject/.buckconfig b/example/SampleApp/.buckconfig similarity index 100% rename from example/SampleProject/.buckconfig rename to example/SampleApp/.buckconfig diff --git a/example/SampleApp/.bundle/config b/example/SampleApp/.bundle/config new file mode 100644 index 000000000..848943bb5 --- /dev/null +++ b/example/SampleApp/.bundle/config @@ -0,0 +1,2 @@ +BUNDLE_PATH: "vendor/bundle" +BUNDLE_FORCE_RUBY_PLATFORM: 1 diff --git a/example/SampleProject/.eslintrc.js b/example/SampleApp/.eslintrc.js similarity index 100% rename from example/SampleProject/.eslintrc.js rename to example/SampleApp/.eslintrc.js diff --git a/example/SampleProject/.flowconfig b/example/SampleApp/.flowconfig similarity index 50% rename from example/SampleProject/.flowconfig rename to example/SampleApp/.flowconfig index 4afc766a2..975227dab 100644 --- a/example/SampleProject/.flowconfig +++ b/example/SampleApp/.flowconfig @@ -8,27 +8,26 @@ ; Ignore polyfills node_modules/react-native/Libraries/polyfills/.* -; These should not be required directly -; require from fbjs/lib instead: require('fbjs/lib/warning') -node_modules/warning/.* - ; Flow doesn't support platforms .*/Libraries/Utilities/LoadingView.js +.*/node_modules/resolve/test/resolver/malformed_package_json/package\.json$ + [untyped] .*/node_modules/@react-native-community/cli/.*/.* [include] [libs] -node_modules/react-native/Libraries/react-native/react-native-interface.js +node_modules/react-native/interface.js node_modules/react-native/flow/ [options] emoji=true -esproposal.optional_chaining=enable -esproposal.nullish_coalescing=enable +exact_by_default=true + +format.bracket_spacing=false module.file_ext=.js module.file_ext=.json @@ -36,19 +35,14 @@ module.file_ext=.ios.js munge_underscores=true -module.name_mapper='^react-native$' -> '/node_modules/react-native/Libraries/react-native/react-native-implementation' module.name_mapper='^react-native/\(.*\)$' -> '/node_modules/react-native/\1' -module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> '/node_modules/react-native/Libraries/Image/RelativeImageStub' +module.name_mapper='^@?[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> '/node_modules/react-native/Libraries/Image/RelativeImageStub' suppress_type=$FlowIssue suppress_type=$FlowFixMe suppress_type=$FlowFixMeProps suppress_type=$FlowFixMeState -suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(\\)? *\\(site=[a-z,_]*react_native\\(_ios\\)?_\\(oss\\|fb\\)[a-z,_]*\\)?)\\) -suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(\\)? *\\(site=[a-z,_]*react_native\\(_ios\\)?_\\(oss\\|fb\\)[a-z,_]*\\)?)\\)?:? #[0-9]+ -suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError - [lints] sketchy-null-number=warn sketchy-null-mixed=warn @@ -57,10 +51,8 @@ untyped-type-import=warn nonstrict-import=warn deprecated-type=warn unsafe-getters-setters=warn -inexact-spread=warn unnecessary-invariant=warn signature-verification-failure=warn -deprecated-utility=error [strict] deprecated-type @@ -72,4 +64,4 @@ untyped-import untyped-type-import [version] -^0.105.0 +^0.170.0 diff --git a/example/SampleProject/.gitignore b/example/SampleApp/.gitignore similarity index 94% rename from example/SampleProject/.gitignore rename to example/SampleApp/.gitignore index ad572e632..81570d991 100644 --- a/example/SampleProject/.gitignore +++ b/example/SampleApp/.gitignore @@ -28,6 +28,7 @@ build/ .gradle local.properties *.iml +*.hprof # node.js # @@ -55,5 +56,6 @@ buck-out/ # Bundle artifact *.jsbundle -# CocoaPods +# Ruby / CocoaPods /ios/Pods/ +/vendor/bundle/ diff --git a/example/SampleProject/.prettierrc.js b/example/SampleApp/.prettierrc.js similarity index 65% rename from example/SampleProject/.prettierrc.js rename to example/SampleApp/.prettierrc.js index 5c4de1a4f..2b540746a 100644 --- a/example/SampleProject/.prettierrc.js +++ b/example/SampleApp/.prettierrc.js @@ -1,6 +1,7 @@ module.exports = { + arrowParens: 'avoid', + bracketSameLine: true, bracketSpacing: false, - jsxBracketSameLine: true, singleQuote: true, trailingComma: 'all', }; diff --git a/example/SampleApp/.ruby-version b/example/SampleApp/.ruby-version new file mode 100644 index 000000000..a4dd9dba4 --- /dev/null +++ b/example/SampleApp/.ruby-version @@ -0,0 +1 @@ +2.7.4 diff --git a/example/SampleProject/.watchmanconfig b/example/SampleApp/.watchmanconfig similarity index 100% rename from example/SampleProject/.watchmanconfig rename to example/SampleApp/.watchmanconfig diff --git a/example/SampleApp/App.js b/example/SampleApp/App.js new file mode 100644 index 000000000..0455311ca --- /dev/null +++ b/example/SampleApp/App.js @@ -0,0 +1,129 @@ +/** + * Sample React Native App + * https://github.com/facebook/react-native + * + * @format + * @flow strict-local + */ + +import React from 'react'; +import type {Node} from 'react'; +import { + Button, + SafeAreaView, + ScrollView, + StatusBar, + StyleSheet, + Text, + useColorScheme, + View, +} from 'react-native'; + +import { + Colors, + DebugInstructions, + Header, + LearnMoreLinks, + ReloadInstructions, +} from 'react-native/Libraries/NewAppScreen'; + +import RazorpayCheckout from 'react-native-razorpay'; + +const Section = ({children, title}): Node => { + const isDarkMode = useColorScheme() === 'dark'; + return ( + + + {title} + + + {children} + + + ); +}; + +const App: () => Node = () => { + const isDarkMode = useColorScheme() === 'dark'; + + const backgroundStyle = { + backgroundColor: isDarkMode ? Colors.darker : Colors.lighter, + }; + + return ( + + + +
+ +