Skip to content

Commit f7170a6

Browse files
committed
initial commit
0 parents  commit f7170a6

58 files changed

Lines changed: 28827 additions & 0 deletions

Some content is hidden

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

.buckconfig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
[android]
3+
target = Google Inc.:Google APIs:23
4+
5+
[maven_repositories]
6+
central = https://repo1.maven.org/maven2

.editorconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Windows files
2+
[*.bat]
3+
end_of_line = crlf

.eslintrc.js

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
module.exports = {
2+
env: {
3+
es6: true,
4+
node: true,
5+
jest: true,
6+
},
7+
extends: [
8+
'plugin:@typescript-eslint/recommended',
9+
'prettier',
10+
'plugin:prettier/recommended',
11+
'prettier/react',
12+
'prettier/@typescript-eslint',
13+
],
14+
15+
parser: '@typescript-eslint/parser',
16+
parserOptions: {
17+
createDefaultProgram: true,
18+
ecmaFeatures: {
19+
jsx: true,
20+
impliedStrict: true,
21+
},
22+
ecmaVersion: 2018,
23+
sourceType: 'module',
24+
project: './tsconfig.json',
25+
},
26+
// plugins: ['react', 'react-native'],
27+
28+
plugins: ['react', 'react-hooks', 'react-native', 'prettier'],
29+
30+
rules: {
31+
indent: ['error', 2, { SwitchCase: 1 }],
32+
quotes: ['error', 'single', { avoidEscape: true }],
33+
'@typescript-eslint/no-var-requires': 0,
34+
'react-native/no-unused-styles': 2,
35+
'react-native/split-platform-components': 2,
36+
'react-native/no-inline-styles': 2,
37+
'react-native/no-color-literals': 2,
38+
'react-native/no-single-element-style-arrays': 2,
39+
'global-require': 0,
40+
'linebreak-style': [2, 'unix'],
41+
'prefer-const': 0,
42+
'no-console': [
43+
'warn',
44+
{
45+
allow: ['warn', 'error', 'log', 'info', 'disableYellowBox'],
46+
},
47+
],
48+
'no-param-reassign': 0,
49+
'@typescript-eslint/explicit-module-boundary-types': 'off',
50+
'no-restricted-globals': 0,
51+
'no-unused-vars': 0,
52+
'no-use-before-define': 0,
53+
'no-underscore-dangle': 0,
54+
'no-useless-constructor': 0,
55+
'no-unused-expressions': 0,
56+
'no-plusplus': 0,
57+
'no-nested-ternary': 0,
58+
'lines-between-class-members': [
59+
1,
60+
'always',
61+
{
62+
exceptAfterSingleLine: true,
63+
},
64+
],
65+
'prefer-destructuring': [
66+
2,
67+
{
68+
array: false,
69+
object: true,
70+
},
71+
],
72+
'max-classes-per-file': 0,
73+
'import/prefer-default-export': 0,
74+
'react/prefer-stateless-function': 0,
75+
'react/destructuring-assignment': 0,
76+
'react/prop-types': 0,
77+
'react/react-in-jsx-scope': 0,
78+
'react/jsx-props-no-spreading': 0,
79+
'react/jsx-filename-extension': [
80+
2,
81+
{
82+
extensions: ['.jsx', '.tsx'],
83+
},
84+
],
85+
'jsx-a11y/accessible-emoji': 0,
86+
'react/static-property-placement': 0,
87+
'@typescript-eslint/explicit-member-accessibility': [2, { accessibility: 'no-public' }],
88+
'@typescript-eslint/no-empty-interface': 1,
89+
'@typescript-eslint/explicit-function-return-type': [
90+
0,
91+
{
92+
allowExpressions: true,
93+
allowTypedFunctionExpressions: true,
94+
},
95+
],
96+
'@typescript-eslint/no-explicit-any': 0,
97+
'@typescript-eslint/no-use-before-define': [
98+
2,
99+
{
100+
functions: true,
101+
classes: true,
102+
variables: false,
103+
},
104+
],
105+
'@typescript-eslint/no-unused-vars': [1, { args: 'none' }],
106+
'@typescript-eslint/no-non-null-assertion': 0,
107+
'@typescript-eslint/camelcase': 0,
108+
'@typescript-eslint/ban-ts-ignore': 0,
109+
'@typescript-eslint/no-empty-function': 'off',
110+
},
111+
settings: {
112+
react: {
113+
version: 'detect',
114+
},
115+
},
116+
};

.gitattributes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Windows files should use crlf line endings
2+
# https://help.github.com/articles/dealing-with-line-endings/
3+
*.bat text eol=crlf

.gitignore

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

.prettierrc.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module.exports = {
2+
jsxBracketSameLine: true,
3+
singleQuote: true,
4+
trailingComma: 'all',
5+
printWidth: 100,
6+
};

.watchmanconfig

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

App.tsx

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
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+
SafeAreaView,
14+
ScrollView,
15+
StatusBar,
16+
StyleSheet,
17+
Text,
18+
useColorScheme,
19+
View,
20+
} from 'react-native';
21+
22+
import {
23+
Colors,
24+
DebugInstructions,
25+
Header,
26+
LearnMoreLinks,
27+
ReloadInstructions,
28+
} from 'react-native/Libraries/NewAppScreen';
29+
30+
const Section: React.FC<{
31+
title: string;
32+
}> = ({ children, title }) => {
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+
const App = () => {
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 barStyle={isDarkMode ? 'light-content' : 'dark-content'} />
68+
<ScrollView contentInsetAdjustmentBehavior="automatic" style={backgroundStyle}>
69+
<Header />
70+
<View
71+
style={{
72+
backgroundColor: isDarkMode ? Colors.black : Colors.white,
73+
}}>
74+
<Section title="Step One">
75+
Edit <Text style={styles.highlight}>App.tsx</Text> to change this screen and then come
76+
back to see your edits.
77+
</Section>
78+
<Section title="See Your Changes">
79+
<ReloadInstructions />
80+
</Section>
81+
<Section title="Debug">
82+
<DebugInstructions />
83+
</Section>
84+
<Section title="Learn More">Read the docs to discover what to do next:</Section>
85+
<LearnMoreLinks />
86+
</View>
87+
</ScrollView>
88+
</SafeAreaView>
89+
);
90+
};
91+
92+
const styles = StyleSheet.create({
93+
sectionContainer: {
94+
marginTop: 32,
95+
paddingHorizontal: 24,
96+
},
97+
sectionTitle: {
98+
fontSize: 24,
99+
fontWeight: '600',
100+
},
101+
sectionDescription: {
102+
marginTop: 8,
103+
fontSize: 18,
104+
fontWeight: '400',
105+
},
106+
highlight: {
107+
fontWeight: '700',
108+
},
109+
});
110+
111+
export default App;

__tests__/App-test.tsx

Lines changed: 14 additions & 0 deletions
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+
});

android/app/_BUCK

Lines changed: 55 additions & 0 deletions
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.myapp",
39+
)
40+
41+
android_resource(
42+
name = "res",
43+
package = "com.myapp",
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)