@react-native-community/template 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +30 -0
- package/package.json +19 -0
- package/template/App.tsx +118 -0
- package/template/Gemfile +9 -0
- package/template/README.md +79 -0
- package/template/__tests__/App.test.tsx +17 -0
- package/template/_bundle/config +2 -0
- package/template/_eslintrc.js +4 -0
- package/template/_gitignore +74 -0
- package/template/_prettierrc.js +7 -0
- package/template/_watchmanconfig +1 -0
- package/template/android/app/build.gradle +119 -0
- package/template/android/app/debug.keystore +0 -0
- package/template/android/app/proguard-rules.pro +10 -0
- package/template/android/app/src/debug/AndroidManifest.xml +9 -0
- package/template/android/app/src/debug/java/com/helloworld/ReactNativeFlipper.java +75 -0
- package/template/android/app/src/debug/java/com/helloworld/ReactNativeFlipper.kt +54 -0
- package/template/android/app/src/main/AndroidManifest.xml +25 -0
- package/template/android/app/src/main/java/com/helloworld/MainActivity.java +32 -0
- package/template/android/app/src/main/java/com/helloworld/MainActivity.kt +22 -0
- package/template/android/app/src/main/java/com/helloworld/MainApplication.java +62 -0
- package/template/android/app/src/main/java/com/helloworld/MainApplication.kt +43 -0
- package/template/android/app/src/main/res/drawable/rn_edit_text_material.xml +37 -0
- package/template/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
- package/template/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png +0 -0
- package/template/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
- package/template/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png +0 -0
- package/template/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
- package/template/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png +0 -0
- package/template/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
- package/template/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png +0 -0
- package/template/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
- package/template/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png +0 -0
- package/template/android/app/src/main/res/values/strings.xml +3 -0
- package/template/android/app/src/main/res/values/styles.xml +9 -0
- package/template/android/app/src/release/java/com/helloworld/ReactNativeFlipper.java +20 -0
- package/template/android/app/src/release/java/com/helloworld/ReactNativeFlipper.kt +15 -0
- package/template/android/build.gradle +21 -0
- package/template/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/template/android/gradle/wrapper/gradle-wrapper.properties +7 -0
- package/template/android/gradle-wrapper.jar +0 -0
- package/template/android/gradle-wrapper.properties +7 -0
- package/template/android/gradle.properties +39 -0
- package/template/android/gradlew +249 -0
- package/template/android/gradlew.bat +92 -0
- package/template/android/settings.gradle +6 -0
- package/template/app.json +4 -0
- package/template/babel.config.js +3 -0
- package/template/index.js +9 -0
- package/template/ios/HelloWorld/AppDelegate.h +6 -0
- package/template/ios/HelloWorld/AppDelegate.mm +31 -0
- package/template/ios/HelloWorld/Images.xcassets/AppIcon.appiconset/Contents.json +53 -0
- package/template/ios/HelloWorld/Images.xcassets/Contents.json +6 -0
- package/template/ios/HelloWorld/Info.plist +52 -0
- package/template/ios/HelloWorld/LaunchScreen.storyboard +47 -0
- package/template/ios/HelloWorld/main.m +10 -0
- package/template/ios/HelloWorld.xcodeproj/project.pbxproj +686 -0
- package/template/ios/HelloWorld.xcodeproj/xcshareddata/xcschemes/HelloWorld.xcscheme +88 -0
- package/template/ios/HelloWorldTests/HelloWorldTests.m +66 -0
- package/template/ios/HelloWorldTests/Info.plist +24 -0
- package/template/ios/Podfile +40 -0
- package/template/ios/_xcode.env +11 -0
- package/template/jest.config.js +3 -0
- package/template/metro.config.js +11 -0
- package/template/package.json +37 -0
- package/template/template/App.tsx +118 -0
- package/template/template/Gemfile +8 -0
- package/template/template/README.md +79 -0
- package/template/template/__tests__/App.test.tsx +17 -0
- package/template/template/_bundle/config +2 -0
- package/template/template/_eslintrc.js +4 -0
- package/template/template/_gitignore +74 -0
- package/template/template/_prettierrc.js +7 -0
- package/template/template/_watchmanconfig +1 -0
- package/template/template/android/app/build.gradle +118 -0
- package/template/template/android/app/debug.keystore +0 -0
- package/template/template/android/app/proguard-rules.pro +10 -0
- package/template/template/android/app/src/debug/AndroidManifest.xml +9 -0
- package/template/template/android/app/src/main/AndroidManifest.xml +26 -0
- package/template/template/android/app/src/main/java/com/helloworld/MainActivity.kt +22 -0
- package/template/template/android/app/src/main/java/com/helloworld/MainApplication.kt +43 -0
- package/template/template/android/app/src/main/res/drawable/rn_edit_text_material.xml +37 -0
- package/template/template/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
- package/template/template/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png +0 -0
- package/template/template/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
- package/template/template/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png +0 -0
- package/template/template/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
- package/template/template/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png +0 -0
- package/template/template/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
- package/template/template/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png +0 -0
- package/template/template/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
- package/template/template/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png +0 -0
- package/template/template/android/app/src/main/res/values/strings.xml +3 -0
- package/template/template/android/app/src/main/res/values/styles.xml +9 -0
- package/template/template/android/build.gradle +21 -0
- package/template/template/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/template/template/android/gradle/wrapper/gradle-wrapper.properties +7 -0
- package/template/template/android/gradle.properties +41 -0
- package/template/template/android/gradlew +249 -0
- package/template/template/android/gradlew.bat +92 -0
- package/template/template/android/settings.gradle +4 -0
- package/template/template/app.json +4 -0
- package/template/template/babel.config.js +3 -0
- package/template/template/index.js +9 -0
- package/template/template/ios/HelloWorld/AppDelegate.h +6 -0
- package/template/template/ios/HelloWorld/AppDelegate.mm +31 -0
- package/template/template/ios/HelloWorld/Images.xcassets/AppIcon.appiconset/Contents.json +53 -0
- package/template/template/ios/HelloWorld/Images.xcassets/Contents.json +6 -0
- package/template/template/ios/HelloWorld/Info.plist +52 -0
- package/template/template/ios/HelloWorld/LaunchScreen.storyboard +47 -0
- package/template/template/ios/HelloWorld/PrivacyInfo.xcprivacy +38 -0
- package/template/template/ios/HelloWorld/main.m +10 -0
- package/template/template/ios/HelloWorld.xcodeproj/project.pbxproj +688 -0
- package/template/template/ios/HelloWorld.xcodeproj/xcshareddata/xcschemes/HelloWorld.xcscheme +88 -0
- package/template/template/ios/HelloWorldTests/HelloWorldTests.m +66 -0
- package/template/template/ios/HelloWorldTests/Info.plist +24 -0
- package/template/template/ios/Podfile +40 -0
- package/template/template/ios/_xcode.env +11 -0
- package/template/template/jest.config.js +3 -0
- package/template/template/metro.config.js +11 -0
- package/template/template/package.json +36 -0
- package/template/template/tsconfig.json +3 -0
- package/template/tsconfig.json +3 -0
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<Scheme
|
|
3
|
+
LastUpgradeVersion = "1210"
|
|
4
|
+
version = "1.3">
|
|
5
|
+
<BuildAction
|
|
6
|
+
parallelizeBuildables = "YES"
|
|
7
|
+
buildImplicitDependencies = "YES">
|
|
8
|
+
<BuildActionEntries>
|
|
9
|
+
<BuildActionEntry
|
|
10
|
+
buildForTesting = "YES"
|
|
11
|
+
buildForRunning = "YES"
|
|
12
|
+
buildForProfiling = "YES"
|
|
13
|
+
buildForArchiving = "YES"
|
|
14
|
+
buildForAnalyzing = "YES">
|
|
15
|
+
<BuildableReference
|
|
16
|
+
BuildableIdentifier = "primary"
|
|
17
|
+
BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
|
|
18
|
+
BuildableName = "HelloWorld.app"
|
|
19
|
+
BlueprintName = "HelloWorld"
|
|
20
|
+
ReferencedContainer = "container:HelloWorld.xcodeproj">
|
|
21
|
+
</BuildableReference>
|
|
22
|
+
</BuildActionEntry>
|
|
23
|
+
</BuildActionEntries>
|
|
24
|
+
</BuildAction>
|
|
25
|
+
<TestAction
|
|
26
|
+
buildConfiguration = "Debug"
|
|
27
|
+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
|
28
|
+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
|
29
|
+
shouldUseLaunchSchemeArgsEnv = "YES">
|
|
30
|
+
<Testables>
|
|
31
|
+
<TestableReference
|
|
32
|
+
skipped = "NO">
|
|
33
|
+
<BuildableReference
|
|
34
|
+
BuildableIdentifier = "primary"
|
|
35
|
+
BlueprintIdentifier = "00E356ED1AD99517003FC87E"
|
|
36
|
+
BuildableName = "HelloWorldTests.xctest"
|
|
37
|
+
BlueprintName = "HelloWorldTests"
|
|
38
|
+
ReferencedContainer = "container:HelloWorld.xcodeproj">
|
|
39
|
+
</BuildableReference>
|
|
40
|
+
</TestableReference>
|
|
41
|
+
</Testables>
|
|
42
|
+
</TestAction>
|
|
43
|
+
<LaunchAction
|
|
44
|
+
buildConfiguration = "Debug"
|
|
45
|
+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
|
46
|
+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
|
47
|
+
launchStyle = "0"
|
|
48
|
+
useCustomWorkingDirectory = "NO"
|
|
49
|
+
ignoresPersistentStateOnLaunch = "NO"
|
|
50
|
+
debugDocumentVersioning = "YES"
|
|
51
|
+
debugServiceExtension = "internal"
|
|
52
|
+
allowLocationSimulation = "YES">
|
|
53
|
+
<BuildableProductRunnable
|
|
54
|
+
runnableDebuggingMode = "0">
|
|
55
|
+
<BuildableReference
|
|
56
|
+
BuildableIdentifier = "primary"
|
|
57
|
+
BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
|
|
58
|
+
BuildableName = "HelloWorld.app"
|
|
59
|
+
BlueprintName = "HelloWorld"
|
|
60
|
+
ReferencedContainer = "container:HelloWorld.xcodeproj">
|
|
61
|
+
</BuildableReference>
|
|
62
|
+
</BuildableProductRunnable>
|
|
63
|
+
</LaunchAction>
|
|
64
|
+
<ProfileAction
|
|
65
|
+
buildConfiguration = "Release"
|
|
66
|
+
shouldUseLaunchSchemeArgsEnv = "YES"
|
|
67
|
+
savedToolIdentifier = ""
|
|
68
|
+
useCustomWorkingDirectory = "NO"
|
|
69
|
+
debugDocumentVersioning = "YES">
|
|
70
|
+
<BuildableProductRunnable
|
|
71
|
+
runnableDebuggingMode = "0">
|
|
72
|
+
<BuildableReference
|
|
73
|
+
BuildableIdentifier = "primary"
|
|
74
|
+
BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
|
|
75
|
+
BuildableName = "HelloWorld.app"
|
|
76
|
+
BlueprintName = "HelloWorld"
|
|
77
|
+
ReferencedContainer = "container:HelloWorld.xcodeproj">
|
|
78
|
+
</BuildableReference>
|
|
79
|
+
</BuildableProductRunnable>
|
|
80
|
+
</ProfileAction>
|
|
81
|
+
<AnalyzeAction
|
|
82
|
+
buildConfiguration = "Debug">
|
|
83
|
+
</AnalyzeAction>
|
|
84
|
+
<ArchiveAction
|
|
85
|
+
buildConfiguration = "Release"
|
|
86
|
+
revealArchiveInOrganizer = "YES">
|
|
87
|
+
</ArchiveAction>
|
|
88
|
+
</Scheme>
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
#import <UIKit/UIKit.h>
|
|
2
|
+
#import <XCTest/XCTest.h>
|
|
3
|
+
|
|
4
|
+
#import <React/RCTLog.h>
|
|
5
|
+
#import <React/RCTRootView.h>
|
|
6
|
+
|
|
7
|
+
#define TIMEOUT_SECONDS 600
|
|
8
|
+
#define TEXT_TO_LOOK_FOR @"Welcome to React"
|
|
9
|
+
|
|
10
|
+
@interface HelloWorldTests : XCTestCase
|
|
11
|
+
|
|
12
|
+
@end
|
|
13
|
+
|
|
14
|
+
@implementation HelloWorldTests
|
|
15
|
+
|
|
16
|
+
- (BOOL)findSubviewInView:(UIView *)view matching:(BOOL (^)(UIView *view))test
|
|
17
|
+
{
|
|
18
|
+
if (test(view)) {
|
|
19
|
+
return YES;
|
|
20
|
+
}
|
|
21
|
+
for (UIView *subview in [view subviews]) {
|
|
22
|
+
if ([self findSubviewInView:subview matching:test]) {
|
|
23
|
+
return YES;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
return NO;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
- (void)testRendersWelcomeScreen
|
|
30
|
+
{
|
|
31
|
+
UIViewController *vc = [[[RCTSharedApplication() delegate] window] rootViewController];
|
|
32
|
+
NSDate *date = [NSDate dateWithTimeIntervalSinceNow:TIMEOUT_SECONDS];
|
|
33
|
+
BOOL foundElement = NO;
|
|
34
|
+
|
|
35
|
+
__block NSString *redboxError = nil;
|
|
36
|
+
#ifdef DEBUG
|
|
37
|
+
RCTSetLogFunction(
|
|
38
|
+
^(RCTLogLevel level, RCTLogSource source, NSString *fileName, NSNumber *lineNumber, NSString *message) {
|
|
39
|
+
if (level >= RCTLogLevelError) {
|
|
40
|
+
redboxError = message;
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
#endif
|
|
44
|
+
|
|
45
|
+
while ([date timeIntervalSinceNow] > 0 && !foundElement && !redboxError) {
|
|
46
|
+
[[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]];
|
|
47
|
+
[[NSRunLoop mainRunLoop] runMode:NSRunLoopCommonModes beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]];
|
|
48
|
+
|
|
49
|
+
foundElement = [self findSubviewInView:vc.view
|
|
50
|
+
matching:^BOOL(UIView *view) {
|
|
51
|
+
if ([view.accessibilityLabel isEqualToString:TEXT_TO_LOOK_FOR]) {
|
|
52
|
+
return YES;
|
|
53
|
+
}
|
|
54
|
+
return NO;
|
|
55
|
+
}];
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
#ifdef DEBUG
|
|
59
|
+
RCTSetLogFunction(RCTDefaultLogFunction);
|
|
60
|
+
#endif
|
|
61
|
+
|
|
62
|
+
XCTAssertNil(redboxError, @"RedBox error: %@", redboxError);
|
|
63
|
+
XCTAssertTrue(foundElement, @"Couldn't find element with text '%@' in %d seconds", TEXT_TO_LOOK_FOR, TIMEOUT_SECONDS);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
@end
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
3
|
+
<plist version="1.0">
|
|
4
|
+
<dict>
|
|
5
|
+
<key>CFBundleDevelopmentRegion</key>
|
|
6
|
+
<string>en</string>
|
|
7
|
+
<key>CFBundleExecutable</key>
|
|
8
|
+
<string>$(EXECUTABLE_NAME)</string>
|
|
9
|
+
<key>CFBundleIdentifier</key>
|
|
10
|
+
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
|
11
|
+
<key>CFBundleInfoDictionaryVersion</key>
|
|
12
|
+
<string>6.0</string>
|
|
13
|
+
<key>CFBundleName</key>
|
|
14
|
+
<string>$(PRODUCT_NAME)</string>
|
|
15
|
+
<key>CFBundlePackageType</key>
|
|
16
|
+
<string>BNDL</string>
|
|
17
|
+
<key>CFBundleShortVersionString</key>
|
|
18
|
+
<string>1.0</string>
|
|
19
|
+
<key>CFBundleSignature</key>
|
|
20
|
+
<string>????</string>
|
|
21
|
+
<key>CFBundleVersion</key>
|
|
22
|
+
<string>1</string>
|
|
23
|
+
</dict>
|
|
24
|
+
</plist>
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# Resolve react_native_pods.rb with node to allow for hoisting
|
|
2
|
+
require Pod::Executable.execute_command('node', ['-p',
|
|
3
|
+
'require.resolve(
|
|
4
|
+
"@react-native-community/cli-platform-ios/autolinking.rb",
|
|
5
|
+
{paths: [process.argv[1]]},
|
|
6
|
+
)', __dir__]).strip
|
|
7
|
+
|
|
8
|
+
platform :ios, min_ios_version_supported
|
|
9
|
+
prepare_react_native_project!
|
|
10
|
+
|
|
11
|
+
linkage = ENV['USE_FRAMEWORKS']
|
|
12
|
+
if linkage != nil
|
|
13
|
+
Pod::UI.puts "Configuring Pod with #{linkage}ally linked Frameworks".green
|
|
14
|
+
use_frameworks! :linkage => linkage.to_sym
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
target 'HelloWorld' do
|
|
18
|
+
config = autolink_native_modules!
|
|
19
|
+
|
|
20
|
+
use_react_native!(
|
|
21
|
+
:path => config[:reactNativePath],
|
|
22
|
+
# An absolute path to your application root.
|
|
23
|
+
:app_path => "#{Pod::Config.instance.installation_root}/.."
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
target 'HelloWorldTests' do
|
|
27
|
+
inherit! :complete
|
|
28
|
+
# Pods for testing
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
post_install do |installer|
|
|
32
|
+
# https://github.com/facebook/react-native/blob/main/packages/react-native/scripts/react_native_pods.rb#L197-L202
|
|
33
|
+
react_native_post_install(
|
|
34
|
+
installer,
|
|
35
|
+
config[:reactNativePath],
|
|
36
|
+
:mac_catalyst_enabled => false,
|
|
37
|
+
# :ccache_enabled => true
|
|
38
|
+
)
|
|
39
|
+
end
|
|
40
|
+
end
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# This `.xcode.env` file is versioned and is used to source the environment
|
|
2
|
+
# used when running script phases inside Xcode.
|
|
3
|
+
# To customize your local environment, you can create an `.xcode.env.local`
|
|
4
|
+
# file that is not versioned.
|
|
5
|
+
|
|
6
|
+
# NODE_BINARY variable contains the PATH to the node executable.
|
|
7
|
+
#
|
|
8
|
+
# Customize the NODE_BINARY variable here.
|
|
9
|
+
# For example, to use nvm with brew, add the following line
|
|
10
|
+
# . "$(brew --prefix nvm)/nvm.sh" --no-use
|
|
11
|
+
export NODE_BINARY=$(command -v node)
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
const {getDefaultConfig, mergeConfig} = require('@react-native/metro-config');
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Metro configuration
|
|
5
|
+
* https://reactnative.dev/docs/metro
|
|
6
|
+
*
|
|
7
|
+
* @type {import('metro-config').MetroConfig}
|
|
8
|
+
*/
|
|
9
|
+
const config = {};
|
|
10
|
+
|
|
11
|
+
module.exports = mergeConfig(getDefaultConfig(__dirname), config);
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "HelloWorld",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"private": true,
|
|
5
|
+
"scripts": {
|
|
6
|
+
"android": "react-native run-android",
|
|
7
|
+
"ios": "react-native run-ios",
|
|
8
|
+
"lint": "eslint .",
|
|
9
|
+
"start": "react-native start",
|
|
10
|
+
"test": "jest"
|
|
11
|
+
},
|
|
12
|
+
"dependencies": {
|
|
13
|
+
"react": "18.2.0",
|
|
14
|
+
"react-native": "1000.0.0"
|
|
15
|
+
},
|
|
16
|
+
"devDependencies": {
|
|
17
|
+
"@babel/core": "^7.20.0",
|
|
18
|
+
"@babel/preset-env": "^7.20.0",
|
|
19
|
+
"@babel/runtime": "^7.20.0",
|
|
20
|
+
"@react-native/babel-preset": "0.74.0",
|
|
21
|
+
"@react-native/eslint-config": "0.74.0",
|
|
22
|
+
"@react-native/metro-config": "0.74.0",
|
|
23
|
+
"@react-native/typescript-config": "0.74.0",
|
|
24
|
+
"@react-native-community/cli": "latest",
|
|
25
|
+
"@types/react": "^18.2.6",
|
|
26
|
+
"@types/react-test-renderer": "^18.0.0",
|
|
27
|
+
"babel-jest": "^29.6.3",
|
|
28
|
+
"eslint": "^8.19.0",
|
|
29
|
+
"jest": "^29.6.3",
|
|
30
|
+
"prettier": "2.8.8",
|
|
31
|
+
"react-test-renderer": "18.2.0",
|
|
32
|
+
"typescript": "5.0.4"
|
|
33
|
+
},
|
|
34
|
+
"engines": {
|
|
35
|
+
"node": ">=18"
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sample React Native App
|
|
3
|
+
* https://github.com/facebook/react-native
|
|
4
|
+
*
|
|
5
|
+
* @format
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import React from 'react';
|
|
9
|
+
import type {PropsWithChildren} from 'react';
|
|
10
|
+
import {
|
|
11
|
+
SafeAreaView,
|
|
12
|
+
ScrollView,
|
|
13
|
+
StatusBar,
|
|
14
|
+
StyleSheet,
|
|
15
|
+
Text,
|
|
16
|
+
useColorScheme,
|
|
17
|
+
View,
|
|
18
|
+
} from 'react-native';
|
|
19
|
+
|
|
20
|
+
import {
|
|
21
|
+
Colors,
|
|
22
|
+
DebugInstructions,
|
|
23
|
+
Header,
|
|
24
|
+
LearnMoreLinks,
|
|
25
|
+
ReloadInstructions,
|
|
26
|
+
} from 'react-native/Libraries/NewAppScreen';
|
|
27
|
+
|
|
28
|
+
type SectionProps = PropsWithChildren<{
|
|
29
|
+
title: string;
|
|
30
|
+
}>;
|
|
31
|
+
|
|
32
|
+
function Section({children, title}: SectionProps): React.JSX.Element {
|
|
33
|
+
const isDarkMode = useColorScheme() === 'dark';
|
|
34
|
+
return (
|
|
35
|
+
<View style={styles.sectionContainer}>
|
|
36
|
+
<Text
|
|
37
|
+
style={[
|
|
38
|
+
styles.sectionTitle,
|
|
39
|
+
{
|
|
40
|
+
color: isDarkMode ? Colors.white : Colors.black,
|
|
41
|
+
},
|
|
42
|
+
]}>
|
|
43
|
+
{title}
|
|
44
|
+
</Text>
|
|
45
|
+
<Text
|
|
46
|
+
style={[
|
|
47
|
+
styles.sectionDescription,
|
|
48
|
+
{
|
|
49
|
+
color: isDarkMode ? Colors.light : Colors.dark,
|
|
50
|
+
},
|
|
51
|
+
]}>
|
|
52
|
+
{children}
|
|
53
|
+
</Text>
|
|
54
|
+
</View>
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function App(): React.JSX.Element {
|
|
59
|
+
const isDarkMode = useColorScheme() === 'dark';
|
|
60
|
+
|
|
61
|
+
const backgroundStyle = {
|
|
62
|
+
backgroundColor: isDarkMode ? Colors.darker : Colors.lighter,
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
return (
|
|
66
|
+
<SafeAreaView style={backgroundStyle}>
|
|
67
|
+
<StatusBar
|
|
68
|
+
barStyle={isDarkMode ? 'light-content' : 'dark-content'}
|
|
69
|
+
backgroundColor={backgroundStyle.backgroundColor}
|
|
70
|
+
/>
|
|
71
|
+
<ScrollView
|
|
72
|
+
contentInsetAdjustmentBehavior="automatic"
|
|
73
|
+
style={backgroundStyle}>
|
|
74
|
+
<Header />
|
|
75
|
+
<View
|
|
76
|
+
style={{
|
|
77
|
+
backgroundColor: isDarkMode ? Colors.black : Colors.white,
|
|
78
|
+
}}>
|
|
79
|
+
<Section title="Step One">
|
|
80
|
+
Edit <Text style={styles.highlight}>App.tsx</Text> to change this
|
|
81
|
+
screen and then come back to see your edits.
|
|
82
|
+
</Section>
|
|
83
|
+
<Section title="See Your Changes">
|
|
84
|
+
<ReloadInstructions />
|
|
85
|
+
</Section>
|
|
86
|
+
<Section title="Debug">
|
|
87
|
+
<DebugInstructions />
|
|
88
|
+
</Section>
|
|
89
|
+
<Section title="Learn More">
|
|
90
|
+
Read the docs to discover what to do next:
|
|
91
|
+
</Section>
|
|
92
|
+
<LearnMoreLinks />
|
|
93
|
+
</View>
|
|
94
|
+
</ScrollView>
|
|
95
|
+
</SafeAreaView>
|
|
96
|
+
);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
const styles = StyleSheet.create({
|
|
100
|
+
sectionContainer: {
|
|
101
|
+
marginTop: 32,
|
|
102
|
+
paddingHorizontal: 24,
|
|
103
|
+
},
|
|
104
|
+
sectionTitle: {
|
|
105
|
+
fontSize: 24,
|
|
106
|
+
fontWeight: '600',
|
|
107
|
+
},
|
|
108
|
+
sectionDescription: {
|
|
109
|
+
marginTop: 8,
|
|
110
|
+
fontSize: 18,
|
|
111
|
+
fontWeight: '400',
|
|
112
|
+
},
|
|
113
|
+
highlight: {
|
|
114
|
+
fontWeight: '700',
|
|
115
|
+
},
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
export default App;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
source 'https://rubygems.org'
|
|
2
|
+
|
|
3
|
+
# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
|
|
4
|
+
ruby ">= 2.6.10"
|
|
5
|
+
|
|
6
|
+
# Exclude problematic versions of cocoapods and activesupport that causes build failures.
|
|
7
|
+
gem 'cocoapods', '>= 1.13', '!= 1.15.0', '!= 1.15.1'
|
|
8
|
+
gem 'activesupport', '>= 6.1.7.5', '!= 7.1.0'
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
This is a new [**React Native**](https://reactnative.dev) project, bootstrapped using [`@react-native-community/cli`](https://github.com/react-native-community/cli).
|
|
2
|
+
|
|
3
|
+
# Getting Started
|
|
4
|
+
|
|
5
|
+
>**Note**: Make sure you have completed the [React Native - Environment Setup](https://reactnative.dev/docs/environment-setup) instructions till "Creating a new application" step, before proceeding.
|
|
6
|
+
|
|
7
|
+
## Step 1: Start the Metro Server
|
|
8
|
+
|
|
9
|
+
First, you will need to start **Metro**, the JavaScript _bundler_ that ships _with_ React Native.
|
|
10
|
+
|
|
11
|
+
To start Metro, run the following command from the _root_ of your React Native project:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
# using npm
|
|
15
|
+
npm start
|
|
16
|
+
|
|
17
|
+
# OR using Yarn
|
|
18
|
+
yarn start
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Step 2: Start your Application
|
|
22
|
+
|
|
23
|
+
Let Metro Bundler run in its _own_ terminal. Open a _new_ terminal from the _root_ of your React Native project. Run the following command to start your _Android_ or _iOS_ app:
|
|
24
|
+
|
|
25
|
+
### For Android
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
# using npm
|
|
29
|
+
npm run android
|
|
30
|
+
|
|
31
|
+
# OR using Yarn
|
|
32
|
+
yarn android
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### For iOS
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
# using npm
|
|
39
|
+
npm run ios
|
|
40
|
+
|
|
41
|
+
# OR using Yarn
|
|
42
|
+
yarn ios
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
If everything is set up _correctly_, you should see your new app running in your _Android Emulator_ or _iOS Simulator_ shortly provided you have set up your emulator/simulator correctly.
|
|
46
|
+
|
|
47
|
+
This is one way to run your app — you can also run it directly from within Android Studio and Xcode respectively.
|
|
48
|
+
|
|
49
|
+
## Step 3: Modifying your App
|
|
50
|
+
|
|
51
|
+
Now that you have successfully run the app, let's modify it.
|
|
52
|
+
|
|
53
|
+
1. Open `App.tsx` in your text editor of choice and edit some lines.
|
|
54
|
+
2. For **Android**: Press the <kbd>R</kbd> key twice or select **"Reload"** from the **Developer Menu** (<kbd>Ctrl</kbd> + <kbd>M</kbd> (on Window and Linux) or <kbd>Cmd ⌘</kbd> + <kbd>M</kbd> (on macOS)) to see your changes!
|
|
55
|
+
|
|
56
|
+
For **iOS**: Hit <kbd>Cmd ⌘</kbd> + <kbd>R</kbd> in your iOS Simulator to reload the app and see your changes!
|
|
57
|
+
|
|
58
|
+
## Congratulations! :tada:
|
|
59
|
+
|
|
60
|
+
You've successfully run and modified your React Native App. :partying_face:
|
|
61
|
+
|
|
62
|
+
### Now what?
|
|
63
|
+
|
|
64
|
+
- If you want to add this new React Native code to an existing application, check out the [Integration guide](https://reactnative.dev/docs/integration-with-existing-apps).
|
|
65
|
+
- If you're curious to learn more about React Native, check out the [Introduction to React Native](https://reactnative.dev/docs/getting-started).
|
|
66
|
+
|
|
67
|
+
# Troubleshooting
|
|
68
|
+
|
|
69
|
+
If you can't get this to work, see the [Troubleshooting](https://reactnative.dev/docs/troubleshooting) page.
|
|
70
|
+
|
|
71
|
+
# Learn More
|
|
72
|
+
|
|
73
|
+
To learn more about React Native, take a look at the following resources:
|
|
74
|
+
|
|
75
|
+
- [React Native Website](https://reactnative.dev) - learn more about React Native.
|
|
76
|
+
- [Getting Started](https://reactnative.dev/docs/environment-setup) - an **overview** of React Native and how setup your environment.
|
|
77
|
+
- [Learn the Basics](https://reactnative.dev/docs/getting-started) - a **guided tour** of the React Native **basics**.
|
|
78
|
+
- [Blog](https://reactnative.dev/blog) - read the latest official React Native **Blog** posts.
|
|
79
|
+
- [`@facebook/react-native`](https://github.com/facebook/react-native) - the Open Source; GitHub **repository** for React Native.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @format
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import 'react-native';
|
|
6
|
+
import React from 'react';
|
|
7
|
+
import App from '../App';
|
|
8
|
+
|
|
9
|
+
// Note: import explicitly to use the types shipped with jest.
|
|
10
|
+
import {it} from '@jest/globals';
|
|
11
|
+
|
|
12
|
+
// Note: test renderer must be required after react-native.
|
|
13
|
+
import renderer from 'react-test-renderer';
|
|
14
|
+
|
|
15
|
+
it('renders correctly', () => {
|
|
16
|
+
renderer.create(<App />);
|
|
17
|
+
});
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# OSX
|
|
2
|
+
#
|
|
3
|
+
.DS_Store
|
|
4
|
+
|
|
5
|
+
# Xcode
|
|
6
|
+
#
|
|
7
|
+
build/
|
|
8
|
+
*.pbxuser
|
|
9
|
+
!default.pbxuser
|
|
10
|
+
*.mode1v3
|
|
11
|
+
!default.mode1v3
|
|
12
|
+
*.mode2v3
|
|
13
|
+
!default.mode2v3
|
|
14
|
+
*.perspectivev3
|
|
15
|
+
!default.perspectivev3
|
|
16
|
+
xcuserdata
|
|
17
|
+
*.xccheckout
|
|
18
|
+
*.moved-aside
|
|
19
|
+
DerivedData
|
|
20
|
+
*.hmap
|
|
21
|
+
*.ipa
|
|
22
|
+
*.xcuserstate
|
|
23
|
+
**/.xcode.env.local
|
|
24
|
+
|
|
25
|
+
# Android/IntelliJ
|
|
26
|
+
#
|
|
27
|
+
build/
|
|
28
|
+
.idea
|
|
29
|
+
.gradle
|
|
30
|
+
local.properties
|
|
31
|
+
*.iml
|
|
32
|
+
*.hprof
|
|
33
|
+
.cxx/
|
|
34
|
+
*.keystore
|
|
35
|
+
!debug.keystore
|
|
36
|
+
|
|
37
|
+
# node.js
|
|
38
|
+
#
|
|
39
|
+
node_modules/
|
|
40
|
+
npm-debug.log
|
|
41
|
+
yarn-error.log
|
|
42
|
+
|
|
43
|
+
# fastlane
|
|
44
|
+
#
|
|
45
|
+
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
|
|
46
|
+
# screenshots whenever they are needed.
|
|
47
|
+
# For more information about the recommended setup visit:
|
|
48
|
+
# https://docs.fastlane.tools/best-practices/source-control/
|
|
49
|
+
|
|
50
|
+
**/fastlane/report.xml
|
|
51
|
+
**/fastlane/Preview.html
|
|
52
|
+
**/fastlane/screenshots
|
|
53
|
+
**/fastlane/test_output
|
|
54
|
+
|
|
55
|
+
# Bundle artifact
|
|
56
|
+
*.jsbundle
|
|
57
|
+
|
|
58
|
+
# Ruby / CocoaPods
|
|
59
|
+
**/Pods/
|
|
60
|
+
/vendor/bundle/
|
|
61
|
+
|
|
62
|
+
# Temporary files created by Metro to check the health of the file watcher
|
|
63
|
+
.metro-health-check*
|
|
64
|
+
|
|
65
|
+
# testing
|
|
66
|
+
/coverage
|
|
67
|
+
|
|
68
|
+
# Yarn
|
|
69
|
+
.yarn/*
|
|
70
|
+
!.yarn/patches
|
|
71
|
+
!.yarn/plugins
|
|
72
|
+
!.yarn/releases
|
|
73
|
+
!.yarn/sdks
|
|
74
|
+
!.yarn/versions
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{}
|