Skip to content

Commit 1208517

Browse files
committed
Add example-macos
1 parent ad09621 commit 1208517

31 files changed

+7911
-0
lines changed

example-macos/.bundle/config

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
BUNDLE_PATH: "vendor/bundle"
2+
BUNDLE_FORCE_RUBY_PLATFORM: 1

example-macos/.gitignore

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

example-macos/.watchmanconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

example-macos/Gemfile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
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+
# Cocoapods 1.15 introduced a bug which break the build. We will remove the upper
7+
# bound in the template on Cocoapods with next React Native release.
8+
gem 'cocoapods', '>= 1.13', '< 1.15'
9+
gem 'activesupport', '>= 6.1.7.5', '< 7.1.0'

example-macos/Gemfile.lock

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
GEM
2+
remote: https://rubygems.org/
3+
specs:
4+
CFPropertyList (3.0.7)
5+
base64
6+
nkf
7+
rexml
8+
activesupport (7.0.6)
9+
concurrent-ruby (~> 1.0, >= 1.0.2)
10+
i18n (>= 1.6, < 2)
11+
minitest (>= 5.1)
12+
tzinfo (~> 2.0)
13+
addressable (2.8.7)
14+
public_suffix (>= 2.0.2, < 7.0)
15+
algoliasearch (1.27.5)
16+
httpclient (~> 2.8, >= 2.8.3)
17+
json (>= 1.5.1)
18+
atomos (0.1.3)
19+
base64 (0.2.0)
20+
claide (1.1.0)
21+
cocoapods (1.14.3)
22+
addressable (~> 2.8)
23+
claide (>= 1.0.2, < 2.0)
24+
cocoapods-core (= 1.14.3)
25+
cocoapods-deintegrate (>= 1.0.3, < 2.0)
26+
cocoapods-downloader (>= 2.1, < 3.0)
27+
cocoapods-plugins (>= 1.0.0, < 2.0)
28+
cocoapods-search (>= 1.0.0, < 2.0)
29+
cocoapods-trunk (>= 1.6.0, < 2.0)
30+
cocoapods-try (>= 1.1.0, < 2.0)
31+
colored2 (~> 3.1)
32+
escape (~> 0.0.4)
33+
fourflusher (>= 2.3.0, < 3.0)
34+
gh_inspector (~> 1.0)
35+
molinillo (~> 0.8.0)
36+
nap (~> 1.0)
37+
ruby-macho (>= 2.3.0, < 3.0)
38+
xcodeproj (>= 1.23.0, < 2.0)
39+
cocoapods-core (1.14.3)
40+
activesupport (>= 5.0, < 8)
41+
addressable (~> 2.8)
42+
algoliasearch (~> 1.0)
43+
concurrent-ruby (~> 1.1)
44+
fuzzy_match (~> 2.0.4)
45+
nap (~> 1.0)
46+
netrc (~> 0.11)
47+
public_suffix (~> 4.0)
48+
typhoeus (~> 1.0)
49+
cocoapods-deintegrate (1.0.5)
50+
cocoapods-downloader (2.1)
51+
cocoapods-plugins (1.0.0)
52+
nap
53+
cocoapods-search (1.0.1)
54+
cocoapods-trunk (1.6.0)
55+
nap (>= 0.8, < 2.0)
56+
netrc (~> 0.11)
57+
cocoapods-try (1.2.0)
58+
colored2 (3.1.2)
59+
concurrent-ruby (1.2.2)
60+
escape (0.0.4)
61+
ethon (0.16.0)
62+
ffi (>= 1.15.0)
63+
ffi (1.17.0)
64+
fourflusher (2.3.1)
65+
fuzzy_match (2.0.4)
66+
gh_inspector (1.1.3)
67+
httpclient (2.8.3)
68+
i18n (1.14.1)
69+
concurrent-ruby (~> 1.0)
70+
json (2.7.2)
71+
minitest (5.18.1)
72+
molinillo (0.8.0)
73+
nanaimo (0.3.0)
74+
nap (1.1.0)
75+
netrc (0.11.0)
76+
nkf (0.2.0)
77+
public_suffix (4.0.7)
78+
rexml (3.2.9)
79+
strscan
80+
ruby-macho (2.5.1)
81+
strscan (3.1.0)
82+
typhoeus (1.4.1)
83+
ethon (>= 0.9.0)
84+
tzinfo (2.0.6)
85+
concurrent-ruby (~> 1.0)
86+
xcodeproj (1.24.0)
87+
CFPropertyList (>= 2.3.3, < 4.0)
88+
atomos (~> 0.1.3)
89+
claide (>= 1.0.2, < 2.0)
90+
colored2 (~> 3.1)
91+
nanaimo (~> 0.3.0)
92+
rexml (~> 3.2.4)
93+
94+
PLATFORMS
95+
ruby
96+
97+
DEPENDENCIES
98+
activesupport (>= 6.1.7.5, < 7.1.0)
99+
cocoapods (>= 1.13, < 1.15)
100+
101+
RUBY VERSION
102+
ruby 2.7.4p191
103+
104+
BUNDLED WITH
105+
2.2.33

example-macos/app.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"name": "RNSACExample"
3+
}

example-macos/babel.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
presets: ['module:@react-native/babel-preset'],
3+
};

example-macos/index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { AppRegistry } from 'react-native';
2+
import App from '../example/src/App';
3+
import { name as appName } from './app.json';
4+
5+
AppRegistry.registerComponent(appName, () => App);

example-macos/macos/.xcode.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export NODE_BINARY=$(command -v node)
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#import <Cocoa/Cocoa.h>
2+
#import <RCTAppDelegate.h>
3+
#import <React/RCTLinkingManager.h>
4+
5+
@interface AppDelegate : RCTAppDelegate
6+
7+
@end
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#import "AppDelegate.h"
2+
3+
#import <React/RCTBundleURLProvider.h>
4+
#import <React/RCTLinkingManager.h>
5+
6+
@implementation AppDelegate
7+
8+
- (void)applicationDidFinishLaunching:(NSNotification *)notification
9+
{
10+
self.moduleName = @"Example";
11+
// You can add your custom initial props in the dictionary below.
12+
// They will be passed down to the ViewController used by React Native.
13+
self.initialProps = @{};
14+
15+
return [super applicationDidFinishLaunching:notification];
16+
}
17+
18+
- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
19+
{
20+
#if DEBUG
21+
return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index"];
22+
#else
23+
return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
24+
#endif
25+
}
26+
27+
/// This method controls whether the `concurrentRoot`feature of React18 is turned on or off.
28+
///
29+
/// @see: https://reactjs.org/blog/2022/03/29/react-v18.html
30+
/// @note: This requires to be rendering on Fabric (i.e. on the New Architecture).
31+
/// @return: `true` if the `concurrentRoot` feature is enabled. Otherwise, it returns `false`.
32+
- (BOOL)concurrentRootEnabled
33+
{
34+
#ifdef RN_FABRIC_ENABLED
35+
return true;
36+
#else
37+
return false;
38+
#endif
39+
}
40+
41+
@end
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
{
2+
"images" : [
3+
{
4+
"idiom" : "mac",
5+
"scale" : "1x",
6+
"size" : "16x16"
7+
},
8+
{
9+
"idiom" : "mac",
10+
"scale" : "2x",
11+
"size" : "16x16"
12+
},
13+
{
14+
"idiom" : "mac",
15+
"scale" : "1x",
16+
"size" : "32x32"
17+
},
18+
{
19+
"idiom" : "mac",
20+
"scale" : "2x",
21+
"size" : "32x32"
22+
},
23+
{
24+
"idiom" : "mac",
25+
"scale" : "1x",
26+
"size" : "128x128"
27+
},
28+
{
29+
"idiom" : "mac",
30+
"scale" : "2x",
31+
"size" : "128x128"
32+
},
33+
{
34+
"idiom" : "mac",
35+
"scale" : "1x",
36+
"size" : "256x256"
37+
},
38+
{
39+
"idiom" : "mac",
40+
"scale" : "2x",
41+
"size" : "256x256"
42+
},
43+
{
44+
"idiom" : "mac",
45+
"scale" : "1x",
46+
"size" : "512x512"
47+
},
48+
{
49+
"idiom" : "mac",
50+
"scale" : "2x",
51+
"size" : "512x512"
52+
}
53+
],
54+
"info" : {
55+
"author" : "xcode",
56+
"version" : 1
57+
}
58+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"info" : {
3+
"author" : "xcode",
4+
"version" : 1
5+
}
6+
}

0 commit comments

Comments
 (0)