Skip to content

Commit d29df70

Browse files
fixes: class name collision with native react-native-config (#724)
* fix: class name collision with native react-native-config * added 0.68.5 example project * more name collision changes * include latest changes * updated class prefix and added android example project * Bump github actions
1 parent c92150e commit d29df70

File tree

90 files changed

+10984
-273
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+10984
-273
lines changed

.github/workflows/windows-ci.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ jobs:
1313
- name: Setup Node.js
1414
uses: actions/setup-node@v1
1515
with:
16-
node-version: '12.9.1'
16+
node-version: '16.19.0'
1717

1818
- name: Setup MSBuild
19-
uses: microsoft/setup-msbuild@v1.0.0
19+
uses: microsoft/setup-msbuild@v1.1.3
2020
with:
2121
vs-version: 16.5
2222

Example/0.68.5/.env

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
ENV=dev
2+
API_URL=http://localhost

Example/0.68.5/.env.production

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
ENV=production
2+
API_URL=https://myapi.com

Example/0.68.5/.gitignore

+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
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+
*.xcshareddata
24+
25+
# Android/IntelliJ
26+
#
27+
build/
28+
.idea
29+
.gradle
30+
local.properties
31+
*.iml
32+
33+
# node.js
34+
#
35+
node_modules/
36+
npm-debug.log
37+
yarn-error.log
38+
39+
# BUCK
40+
buck-out/
41+
\.buckd/
42+
*.keystore
43+
!debug.keystore
44+
45+
# fastlane
46+
#
47+
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
48+
# screenshots whenever they are needed.
49+
# For more information about the recommended setup visit:
50+
# https://docs.fastlane.tools/best-practices/source-control/
51+
52+
*/fastlane/report.xml
53+
*/fastlane/Preview.html
54+
*/fastlane/screenshots
55+
56+
# Bundle artifact
57+
*.jsbundle
58+
59+
# CocoaPods
60+
/ios/Pods/
61+
62+
# MSBuild Binary and Structured Log
63+
*.binlog

Example/0.68.5/App.tsx

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
/**
2+
* Sample React Native App
3+
* https://github.com/facebook/react-native
4+
*
5+
* Generated with the TypeScript template
6+
* https://github.com/react-native-community/react-native-template-typescript
7+
*
8+
* @format
9+
*/
10+
11+
import React from 'react';
12+
import {
13+
StyleSheet,
14+
Text,
15+
View,
16+
} from 'react-native';
17+
import Config from 'react-native-config';
18+
19+
const App = () => {
20+
return (
21+
<View style={styles.container}>
22+
<Text style={styles.text}>ENV={Config.ENV}</Text>
23+
<Text style={styles.text}>API_URL={Config.API_URL}</Text>
24+
</View>
25+
);
26+
};
27+
28+
const styles = StyleSheet.create({
29+
container: {
30+
flex: 1,
31+
justifyContent: 'center',
32+
alignItems: 'center',
33+
backgroundColor: '#F5FCFF',
34+
},
35+
text: {
36+
fontSize: 20,
37+
textAlign: 'center',
38+
margin: 10,
39+
},
40+
});
41+
42+
export default App;

Example/0.68.5/Gemfile

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
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.7.4'
5+
6+
gem 'cocoapods', '~> 1.11', '>= 1.11.2'

Example/0.68.5/__tests__/App-test.tsx

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/**
2+
* @format
3+
*/
4+
5+
import 'react-native';
6+
import React from 'react';
7+
import App from '../App';
8+
9+
// Note: test renderer must be required after react-native.
10+
import renderer from 'react-test-renderer';
11+
12+
it('renders correctly', () => {
13+
renderer.create(<App />);
14+
});

Example/0.68.5/_bundle/config

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
BUNDLE_PATH: "vendor/bundle"
2+
BUNDLE_FORCE_RUBY_PLATFORM: 1

Example/0.68.5/_ruby-version

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2.7.4

Example/0.68.5/android/app/_BUCK

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# To learn about Buck see [Docs](https://buckbuild.com/).
2+
# To run your application with Buck:
3+
# - install Buck
4+
# - `npm start` - to start the packager
5+
# - `cd android`
6+
# - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"`
7+
# - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck
8+
# - `buck install -r android/app` - compile, install and run application
9+
#
10+
11+
load(":build_defs.bzl", "create_aar_targets", "create_jar_targets")
12+
13+
lib_deps = []
14+
15+
create_aar_targets(glob(["libs/*.aar"]))
16+
17+
create_jar_targets(glob(["libs/*.jar"]))
18+
19+
android_library(
20+
name = "all-libs",
21+
exported_deps = lib_deps,
22+
)
23+
24+
android_library(
25+
name = "app-code",
26+
srcs = glob([
27+
"src/main/java/**/*.java",
28+
]),
29+
deps = [
30+
":all-libs",
31+
":build_config",
32+
":res",
33+
],
34+
)
35+
36+
android_build_config(
37+
name = "build_config",
38+
package = "com.example",
39+
)
40+
41+
android_resource(
42+
name = "res",
43+
package = "com.example",
44+
res = "src/main/res",
45+
)
46+
47+
android_binary(
48+
name = "app",
49+
keystore = "//android/keystores:debug",
50+
manifest = "src/main/AndroidManifest.xml",
51+
package_type = "debug",
52+
deps = [
53+
":app-code",
54+
],
55+
)

0 commit comments

Comments
 (0)