Skip to content

Commit ce16b2f

Browse files
committed
Added sample project.
1 parent 5cb5541 commit ce16b2f

File tree

63 files changed

+11302
-15
lines changed

Some content is hidden

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

63 files changed

+11302
-15
lines changed

.npmignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
azure-pipelines.yml
22
.gitattributes
3+
sample

azure-pipelines.yml

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,9 @@ pool:
1010
vmImage: 'macOS-10.13'
1111

1212
steps:
13-
- checkout: self
14-
path: react-native-azurenotificationhub
15-
1613
- script: |
17-
git clone https://github.com/phongcao/react-native-azurenotificationhub-sample.git ../react-native-azurenotificationhub-sample
18-
displayName: 'Cloning react-native-azurenotificationhub-sample'
14+
mv ./sample ../
15+
displayName: 'Prepare sample project'
1916

2017
- task: NodeTool@0
2118
inputs:
@@ -24,34 +21,35 @@ steps:
2421

2522
- script: npm install
2623
displayName: 'Install dependencies'
27-
workingDirectory: '../react-native-azurenotificationhub-sample'
24+
workingDirectory: '../sample'
2825

2926
- script: |
30-
rm -R ../react-native-azurenotificationhub-sample/node_modules/react-native-azurenotificationhub
31-
cp -R ../react-native-azurenotificationhub ../react-native-azurenotificationhub-sample/node_modules
32-
displayName: 'Copying react-native-azurenotificationhub'
27+
rm -R ./node_modules/react-native-azurenotificationhub/*
28+
cp -R ../s/* ./node_modules/react-native-azurenotificationhub/
29+
displayName: 'Copying react-native-azurenotificationhub'
30+
workingDirectory: '../sample'
3331

3432
- script: npm run lint
3533
displayName: 'Run lint'
36-
workingDirectory: '../react-native-azurenotificationhub-sample'
34+
workingDirectory: '../sample'
3735

3836
- script: npm run test
3937
displayName: 'Run unit tests'
40-
workingDirectory: '../react-native-azurenotificationhub-sample'
38+
workingDirectory: '../sample'
4139

4240
- task: Gradle@2
4341
displayName: 'Building Android'
4442
inputs:
45-
workingDirectory: '../react-native-azurenotificationhub-sample/android'
46-
gradleWrapperFile: '../react-native-azurenotificationhub-sample/android/gradlew'
43+
workingDirectory: '../sample/android'
44+
gradleWrapperFile: '../sample/android/gradlew'
4745
tasks: 'assembleRelease'
4846
continueOnError: false
4947

5048
- script: |
5149
pod install
5250
sudo cp -R ../node_modules/react-native-azurenotificationhub/ios Pods/RNAzureNotificationHub
5351
displayName: 'Install CocoaPods dependencies'
54-
workingDirectory: '../react-native-azurenotificationhub-sample/ios'
52+
workingDirectory: '../sample/ios'
5553

5654
- task: Xcode@5
5755
displayName: 'Building iOS'
@@ -60,7 +58,7 @@ steps:
6058
scheme: 'ReactNativeAzureNotificationHubSample'
6159
sdk: 'iphoneos'
6260
configuration: 'Release'
63-
xcWorkspacePath: '../react-native-azurenotificationhub-sample/ios/ReactNativeAzureNotificationHubSample.xcworkspace'
61+
xcWorkspacePath: '../sample/ios/ReactNativeAzureNotificationHubSample.xcworkspace'
6462
xcodeVersion: '10'
6563
signingOption: 'nosign'
6664
useXcpretty: 'false'

sample/.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

sample/.eslintrc.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
module.exports = {
2+
root: true,
3+
extends: [
4+
'@react-native-community/eslint-config',
5+
'eslint-config-prettier',
6+
],
7+
rules: {
8+
'prettier/prettier': 0,
9+
},
10+
};

sample/.flowconfig

Lines changed: 75 additions & 0 deletions
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 "BUCK" generated dirs
6+
<PROJECT_ROOT>/\.buckd/
7+
8+
; Ignore polyfills
9+
node_modules/react-native/Libraries/polyfills/.*
10+
11+
; These should not be required directly
12+
; require from fbjs/lib instead: require('fbjs/lib/warning')
13+
node_modules/warning/.*
14+
15+
; Flow doesn't support platforms
16+
.*/Libraries/Utilities/LoadingView.js
17+
18+
[untyped]
19+
.*/node_modules/@react-native-community/cli/.*/.*
20+
21+
[include]
22+
23+
[libs]
24+
node_modules/react-native/Libraries/react-native/react-native-interface.js
25+
node_modules/react-native/flow/
26+
27+
[options]
28+
emoji=true
29+
30+
esproposal.optional_chaining=enable
31+
esproposal.nullish_coalescing=enable
32+
33+
module.file_ext=.js
34+
module.file_ext=.json
35+
module.file_ext=.ios.js
36+
37+
munge_underscores=true
38+
39+
module.name_mapper='^react-native$' -> '<PROJECT_ROOT>/node_modules/react-native/Libraries/react-native/react-native-implementation'
40+
module.name_mapper='^react-native/\(.*\)$' -> '<PROJECT_ROOT>/node_modules/react-native/\1'
41+
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\)$' -> '<PROJECT_ROOT>/node_modules/react-native/Libraries/Image/RelativeImageStub'
42+
43+
suppress_type=$FlowIssue
44+
suppress_type=$FlowFixMe
45+
suppress_type=$FlowFixMeProps
46+
suppress_type=$FlowFixMeState
47+
48+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native\\(_ios\\)?_\\(oss\\|fb\\)[a-z,_]*\\)?)\\)
49+
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native\\(_ios\\)?_\\(oss\\|fb\\)[a-z,_]*\\)?)\\)?:? #[0-9]+
50+
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError
51+
52+
[lints]
53+
sketchy-null-number=warn
54+
sketchy-null-mixed=warn
55+
sketchy-number=warn
56+
untyped-type-import=warn
57+
nonstrict-import=warn
58+
deprecated-type=warn
59+
unsafe-getters-setters=warn
60+
inexact-spread=warn
61+
unnecessary-invariant=warn
62+
signature-verification-failure=warn
63+
deprecated-utility=error
64+
65+
[strict]
66+
deprecated-type
67+
nonstrict-import
68+
sketchy-null
69+
unclear-type
70+
unsafe-getters-setters
71+
untyped-import
72+
untyped-type-import
73+
74+
[version]
75+
^0.105.0

sample/.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.pbxproj -text

sample/.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/

sample/.prettierrc.js

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

sample/.watchmanconfig

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

sample/App.js

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
/**
2+
* Sample React Native App
3+
* https://github.com/facebook/react-native
4+
*
5+
* @format
6+
* @flow
7+
*/
8+
9+
import React from 'react';
10+
import {
11+
SafeAreaView,
12+
StyleSheet,
13+
ScrollView,
14+
View,
15+
Text,
16+
StatusBar,
17+
} from 'react-native';
18+
19+
import {
20+
Header,
21+
LearnMoreLinks,
22+
Colors,
23+
DebugInstructions,
24+
ReloadInstructions,
25+
} from 'react-native/Libraries/NewAppScreen';
26+
27+
const App: () => React$Node = () => {
28+
return (
29+
<>
30+
<StatusBar barStyle="dark-content" />
31+
<SafeAreaView>
32+
<ScrollView
33+
contentInsetAdjustmentBehavior="automatic"
34+
style={styles.scrollView}>
35+
<Header />
36+
{global.HermesInternal == null ? null : (
37+
<View style={styles.engine}>
38+
<Text style={styles.footer}>Engine: Hermes</Text>
39+
</View>
40+
)}
41+
<View style={styles.body}>
42+
<View style={styles.sectionContainer}>
43+
<Text style={styles.sectionTitle}>Step One</Text>
44+
<Text style={styles.sectionDescription}>
45+
Edit <Text style={styles.highlight}>App.js</Text> to change this
46+
screen and then come back to see your edits.
47+
</Text>
48+
</View>
49+
<View style={styles.sectionContainer}>
50+
<Text style={styles.sectionTitle}>See Your Changes</Text>
51+
<Text style={styles.sectionDescription}>
52+
<ReloadInstructions />
53+
</Text>
54+
</View>
55+
<View style={styles.sectionContainer}>
56+
<Text style={styles.sectionTitle}>Debug</Text>
57+
<Text style={styles.sectionDescription}>
58+
<DebugInstructions />
59+
</Text>
60+
</View>
61+
<View style={styles.sectionContainer}>
62+
<Text style={styles.sectionTitle}>Learn More</Text>
63+
<Text style={styles.sectionDescription}>
64+
Read the docs to discover what to do next:
65+
</Text>
66+
</View>
67+
<LearnMoreLinks />
68+
</View>
69+
</ScrollView>
70+
</SafeAreaView>
71+
</>
72+
);
73+
};
74+
75+
const styles = StyleSheet.create({
76+
scrollView: {
77+
backgroundColor: Colors.lighter,
78+
},
79+
engine: {
80+
position: 'absolute',
81+
right: 0,
82+
},
83+
body: {
84+
backgroundColor: Colors.white,
85+
},
86+
sectionContainer: {
87+
marginTop: 32,
88+
paddingHorizontal: 24,
89+
},
90+
sectionTitle: {
91+
fontSize: 24,
92+
fontWeight: '600',
93+
color: Colors.black,
94+
},
95+
sectionDescription: {
96+
marginTop: 8,
97+
fontSize: 18,
98+
fontWeight: '400',
99+
color: Colors.dark,
100+
},
101+
highlight: {
102+
fontWeight: '700',
103+
},
104+
footer: {
105+
color: Colors.dark,
106+
fontSize: 12,
107+
fontWeight: '600',
108+
padding: 4,
109+
paddingRight: 12,
110+
textAlign: 'right',
111+
},
112+
});
113+
114+
export default App;

0 commit comments

Comments
 (0)