Skip to content

Commit 4571680

Browse files
committed
⭐ First commit: project initialization ⭐
0 parents  commit 4571680

10 files changed

+7244
-0
lines changed

.babelrc

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"presets": ["babel-preset-expo"],
3+
"env": {
4+
"development": {
5+
"plugins": ["transform-react-jsx-source"]
6+
}
7+
}
8+
}

.flowconfig

+75
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
[ignore]
2+
; We fork some components by platform
3+
.*/*[.]android.js
4+
5+
; Ignore templates for 'react-native init'
6+
<PROJECT_ROOT>/node_modules/react-native/local-cli/templates/.*
7+
8+
; Ignore RN jest
9+
<PROJECT_ROOT>/node_modules/react-native/jest/.*
10+
11+
; Ignore RNTester
12+
<PROJECT_ROOT>/node_modules/react-native/RNTester/.*
13+
14+
; Ignore the website subdir
15+
<PROJECT_ROOT>/node_modules/react-native/website/.*
16+
17+
; Ignore the Dangerfile
18+
<PROJECT_ROOT>/node_modules/react-native/danger/dangerfile.js
19+
20+
; Ignore Fbemitter
21+
<PROJECT_ROOT>/node_modules/fbemitter/.*
22+
23+
; Ignore "BUCK" generated dirs
24+
<PROJECT_ROOT>/node_modules/react-native/\.buckd/
25+
26+
; Ignore unexpected extra "@providesModule"
27+
.*/node_modules/.*/node_modules/fbjs/.*
28+
29+
; Ignore polyfills
30+
<PROJECT_ROOT>/node_modules/react-native/Libraries/polyfills/.*
31+
32+
; Ignore various node_modules
33+
<PROJECT_ROOT>/node_modules/react-native-gesture-handler/.*
34+
<PROJECT_ROOT>/node_modules/expo/.*
35+
<PROJECT_ROOT>/node_modules/react-navigation/.*
36+
<PROJECT_ROOT>/node_modules/xdl/.*
37+
<PROJECT_ROOT>/node_modules/reqwest/.*
38+
<PROJECT_ROOT>/node_modules/metro-bundler/.*
39+
40+
[include]
41+
42+
[libs]
43+
node_modules/react-native/Libraries/react-native/react-native-interface.js
44+
node_modules/react-native/flow/
45+
node_modules/expo/flow/
46+
47+
[options]
48+
emoji=true
49+
50+
module.system=haste
51+
52+
module.file_ext=.js
53+
module.file_ext=.jsx
54+
module.file_ext=.json
55+
module.file_ext=.ios.js
56+
57+
munge_underscores=true
58+
59+
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\)$' -> 'RelativeImageStub'
60+
61+
suppress_type=$FlowIssue
62+
suppress_type=$FlowFixMe
63+
suppress_type=$FlowFixMeProps
64+
suppress_type=$FlowFixMeState
65+
suppress_type=$FixMe
66+
67+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(5[0-6]\\|[1-4][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native_oss[a-z,_]*\\)?)\\)
68+
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(5[0-6]\\|[1-4][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native_oss[a-z,_]*\\)?)\\)?:? #[0-9]+
69+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
70+
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError
71+
72+
unsafe.enable_getters_and_setters=true
73+
74+
[version]
75+
^0.56.0

.gitignore

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# See https://help.github.com/ignore-files/ for more about ignoring files.
2+
3+
# expo
4+
.expo/
5+
6+
# dependencies
7+
/node_modules
8+
9+
# misc
10+
.env.local
11+
.env.development.local
12+
.env.test.local
13+
.env.production.local
14+
15+
npm-debug.log*
16+
yarn-debug.log*
17+
yarn-error.log*
18+
19+
# OS X
20+
.DS_Store
21+
22+
# Android builds
23+
*.apk
24+
*.ap_
25+
26+
# files for the dex VM
27+
*.dex
28+
29+
# Java class files
30+
*.class
31+
32+
# generated files
33+
bin/
34+
gen/
35+
build/
36+
build.log
37+
38+
# XCode
39+
build/
40+
*.pbxuser
41+
!default.pbxuser
42+
*.mode1v3
43+
!default.mode1v3
44+
*.mode2v3
45+
!default.mode2v3
46+
*.perspectivev3
47+
!default.perspectivev3
48+
xcuserdata
49+
*.xccheckout
50+
*.moved-aside
51+
DerivedData
52+
*.xcuserstatee
53+

.watchmanconfig

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

App.js

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import React from 'react';
2+
import { StyleSheet, Text, View } from 'react-native';
3+
4+
export default class App extends React.Component {
5+
render() {
6+
return (
7+
<View style={styles.container}>
8+
<Text>Open up App.js to start working on your app!</Text>
9+
<Text>Changes you make will automatically reload.</Text>
10+
<Text>Shake your phone to open the developer menu.</Text>
11+
</View>
12+
);
13+
}
14+
}
15+
16+
const styles = StyleSheet.create({
17+
container: {
18+
flex: 1,
19+
backgroundColor: '#fff',
20+
alignItems: 'center',
21+
justifyContent: 'center',
22+
},
23+
});

App.test.js

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import React from 'react';
2+
import App from './App';
3+
4+
import renderer from 'react-test-renderer';
5+
6+
it('renders without crashing', () => {
7+
const rendered = renderer.create(<App />).toJSON();
8+
expect(rendered).toBeTruthy();
9+
});

README.md

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
This is the mobile version of Gutenberg, targetting Android and iOS. It's a React Native library bootstrapped by CRNA.
2+
3+
## Full Documentation
4+
5+
The most recent and complete version of this guide is available [here](https://github.com/react-community/create-react-native-app/blob/master/react-native-scripts/template/README.md).
6+
7+
## Available Scripts
8+
9+
If Yarn was installed when the project was initialized, then dependencies will have been installed via Yarn, and you should probably use it to run these commands as well. Unlike dependency installation, command running syntax is identical for Yarn and NPM at the time of this writing.
10+
11+
### `npm start`
12+
13+
Runs your app in development mode.
14+
15+
Open it in the [Expo app](https://expo.io) on your phone to view it. It will reload if you save edits to your files, and you will see build errors and logs in the terminal.
16+
17+
Sometimes you may need to reset or clear the React Native packager's cache. To do so, you can pass the `--reset-cache` flag to the start script:
18+
19+
```
20+
npm start -- --reset-cache
21+
# or
22+
yarn start -- --reset-cache
23+
```
24+
25+
#### `npm test`
26+
27+
Runs the [jest](https://github.com/facebook/jest) test runner on your tests.
28+
29+
#### `npm run ios`
30+
31+
Like `npm start`, but also attempts to open your app in the iOS Simulator if you're on a Mac and have it installed.
32+
33+
#### `npm run android`
34+
35+
Like `npm start`, but also attempts to open your app on a connected Android device or emulator. Requires an installation of Android build tools (see [React Native docs](https://facebook.github.io/react-native/docs/getting-started.html) for detailed setup). We also recommend installing Genymotion as your Android emulator. Once you've finished setting up the native build environment, there are two options for making the right copy of `adb` available to Create React Native App:
36+
37+
## Writing and Running Tests
38+
39+
This project is set up to use [jest](https://facebook.github.io/jest/) for tests. You can configure whatever testing strategy you like, but jest works out of the box. Create test files in directories called `__tests__` or with the `.test` extension to have the files loaded by jest. See the [the template project](https://github.com/react-community/create-react-native-app/blob/master/react-native-scripts/template/App.test.js) for an example test. The [jest documentation](https://facebook.github.io/jest/docs/en/getting-started.html) is also a wonderful resource, as is the [React Native testing tutorial](https://facebook.github.io/jest/docs/en/tutorial-react-native.html).

app.json

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"expo": {
3+
"sdkVersion": "25.0.0"
4+
}
5+
}

package.json

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"name": "gutenberg-mobile",
3+
"version": "0.1.0",
4+
"private": true,
5+
"devDependencies": {
6+
"react-native-scripts": "1.11.1",
7+
"jest-expo": "25.0.0",
8+
"react-test-renderer": "16.2.0"
9+
},
10+
"main": "./node_modules/react-native-scripts/build/bin/crna-entry.js",
11+
"scripts": {
12+
"start": "react-native-scripts start",
13+
"eject": "react-native-scripts eject",
14+
"android": "react-native-scripts android",
15+
"ios": "react-native-scripts ios",
16+
"test": "node node_modules/jest/bin/jest.js"
17+
},
18+
"jest": {
19+
"preset": "jest-expo"
20+
},
21+
"dependencies": {
22+
"expo": "^25.0.0",
23+
"react": "16.2.0",
24+
"react-native": "0.52.0"
25+
}
26+
}

0 commit comments

Comments
 (0)