Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

Refreshes documentation #35

Merged
merged 7 commits into from
Apr 28, 2018
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
File renamed without changes.
54 changes: 54 additions & 0 deletions ExampleProject/.flowconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
[ignore]
; We fork some components by platform
.*/*[.]android.js

; Ignore "BUCK" generated dirs
<PROJECT_ROOT>/\.buckd/

; Ignore unexpected extra "@providesModule"
.*/node_modules/.*/node_modules/fbjs/.*

; Ignore duplicate module providers
; For RN Apps installed via npm, "Libraries" folder is inside
; "node_modules/react-native" but in the source repo it is in the root
.*/Libraries/react-native/React.js

; Ignore polyfills
.*/Libraries/polyfills/.*

; Ignore metro
.*/node_modules/metro/.*

[include]

[libs]
node_modules/react-native/Libraries/react-native/react-native-interface.js
node_modules/react-native/flow/
node_modules/react-native/flow-github/

[options]
emoji=true

module.system=haste

munge_underscores=true

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'

module.file_ext=.js
module.file_ext=.jsx
module.file_ext=.json
module.file_ext=.native.js

suppress_type=$FlowIssue
suppress_type=$FlowFixMe
suppress_type=$FlowFixMeProps
suppress_type=$FlowFixMeState

suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError

[version]
^0.65.0
1 change: 1 addition & 0 deletions ExampleProject/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.pbxproj -text
16 changes: 12 additions & 4 deletions .gitignore → ExampleProject/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,16 @@ buck-out/
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
# screenshots whenever they are needed.
# For more information about the recommended setup visit:
# https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md
# https://docs.fastlane.tools/best-practices/source-control/

fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots
*/fastlane/report.xml
*/fastlane/Preview.html
*/fastlane/screenshots

# TypeScript
#
lib/

# Jest
#
.jest/
File renamed without changes.
23 changes: 15 additions & 8 deletions src/index.ios.tsx → ExampleProject/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,36 @@
* @flow
*/

import * as React from 'react';
import React from 'react'
import { Component } from 'react';
import {
AppRegistry,
Platform,
StyleSheet,
Text,
View
} from 'react-native';

export default class MyAwesomeProject extends React.Component<object, object> {
const instructions = Platform.select({
ios: 'Press Cmd+R to reload,\n' +
'Cmd+D or shake for dev menu',
android: 'Double tap R on your keyboard to reload,\n' +
'Shake or press menu button for dev menu',
});


type Props = {};
export default class App extends Component<Props> {
render() {
return (
<View style={styles.container}>
<Text style={styles.welcome}>
Welcome to React Native!
</Text>
<Text style={styles.instructions}>
To get started, edit index.ios.js
To get started, edit App.js
</Text>
<Text style={styles.instructions}>
Press Cmd+R to reload,{'\n'}
Cmd+D or shake for dev menu
{instructions}
</Text>
</View>
);
Expand All @@ -49,5 +58,3 @@ const styles = StyleSheet.create({
marginBottom: 5,
},
});

AppRegistry.registerComponent('MyAwesomeProject', () => MyAwesomeProject);
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import 'react-native';
import * as React from 'react';
import Index from '../index.ios';
import React from 'react';
import App from '../App';

// Note: test renderer must be required after react-native.
import * as renderer from 'react-test-renderer';
import renderer from 'react-test-renderer';

it('renders correctly', () => {
const tree = renderer.create(
<Index />
<App />
);
});
4 changes: 2 additions & 2 deletions android/app/BUCK → ExampleProject/android/app/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@ android_library(

android_build_config(
name = "build_config",
package = "com.myawesomeproject",
package = "com.exampleproject",
)

android_resource(
name = "res",
package = "com.myawesomeproject",
package = "com.exampleproject",
res = "src/main/res",
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@ import com.android.build.OutputFile
* // bundleInPaidRelease: true,
* // bundleInBeta: true,
*
* // whether to disable dev mode in custom build variants (by default only disabled in release)
* // for example: to disable dev mode in the staging build type (if configured)
* devDisabledInStaging: true,
* // The configuration property can be in the following formats
* // 'devDisabledIn${productFlavor}${buildType}'
* // 'devDisabledIn${buildType}'
*
* // the root of your project, i.e. where "package.json" lives
* root: "../../",
*
Expand Down Expand Up @@ -65,6 +72,10 @@ import com.android.build.OutputFile
* ]
*/

project.ext.react = [
entryFile: "index.js"
]

apply from: "../../node_modules/react-native/react.gradle"

/**
Expand All @@ -87,7 +98,7 @@ android {
buildToolsVersion "23.0.1"

defaultConfig {
applicationId "com.myawesomeproject"
applicationId "com.exampleproject"
minSdkVersion 16
targetSdkVersion 22
versionCode 1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,14 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.myawesomeproject"
android:versionCode="1"
android:versionName="1.0">
package="com.exampleproject">

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>

<uses-sdk
android:minSdkVersion="16"
android:targetSdkVersion="22" />

<application
android:name=".MainApplication"
android:allowBackup="true"
android:label="@string/app_name"
android:icon="@mipmap/ic_launcher"
android:allowBackup="false"
android:theme="@style/AppTheme">
<activity
android:name=".MainActivity"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.myawesomeproject;
package com.exampleproject;

import com.facebook.react.ReactActivity;

Expand All @@ -10,6 +10,6 @@ public class MainActivity extends ReactActivity {
*/
@Override
protected String getMainComponentName() {
return "MyAwesomeProject";
return "ExampleProject";
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.myawesomeproject;
package com.exampleproject;

import android.app.Application;

Expand All @@ -25,6 +25,11 @@ protected List<ReactPackage> getPackages() {
new MainReactPackage()
);
}

@Override
protected String getJSMainModuleName() {
return "index";
}
};

@Override
Expand Down
3 changes: 3 additions & 0 deletions ExampleProject/android/app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<resources>
<string name="app_name">ExampleProject</string>
</resources>
File renamed without changes.
Loading