Skip to content

Commit 60961da

Browse files
committed
Import template from reason-react-native repo
0 parents  commit 60961da

Some content is hidden

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

71 files changed

+8363
-0
lines changed

.editorconfig

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# EditorConfig is awesome: https://EditorConfig.org
2+
3+
# top-most EditorConfig file
4+
root = true
5+
6+
[*]
7+
end_of_line = lf
8+
insert_final_newline = true
9+
charset = utf-8
10+
indent_style = space
11+
indent_size = 2

.gitattributes

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Tell github that .re and .rei files are Reason, sometimes recognized as C/C++
2+
*.re linguist-language=Reason
3+
*.rei linguist-language=Reason

.gitignore

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
*.log
2+
3+
# macOS crap
4+
.DS_Store
5+
6+
# node
7+
node_modules
8+
9+
# npm unused lock file (we use yarn.lock)
10+
package-lock.json
11+
12+
# generated from template/.gitignore
13+
template/.npmignore

.prettierignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*.bs.js
2+
package.json

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# reason-react-native-template CHANGELOG
2+
3+
## 0.1.0 - 2019-06-17
4+
5+
✨ Initial release compatible with `react-native@0.60.0`

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2019-present reason-react-native
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Reason React Native HelloWorld
2+
3+
> This is a React Native application developed in Reason.
4+
5+
Please carefully read instructions below in order to enjoy ReasonML development
6+
experience.
7+
8+
## Setup
9+
10+
## Start a Reason React Native project with this template
11+
12+
```console
13+
npx react-native init MyApp --template reason-react-native-template
14+
cd MyApp
15+
```
16+
17+
⚠️ In case you got an error saying it's looking for
18+
`react-native-template-reason-react-native-template`, be sure to have
19+
uninstalled any previous react-native-cli version & rely on `npx`
20+
21+
```console
22+
npm -g uninstall react-native
23+
npm -g uninstall react-native-cli
24+
yarn global remove react-native
25+
yarn global remove react-native-cli
26+
```
27+
28+
Now that you are ready to go, you can check our documentation on
29+
[how to use Reason React Native](https://reasonml-community.github.io/reason-react-native/en/docs/usage/).

lerna.json

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"version": "0.0.0",
3+
"registry": "https://registry.npmjs.org/",
4+
"npmClient": "yarn",
5+
"useWorkspaces": true
6+
}

package.json

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
{
2+
"name": "reason-react-native-template",
3+
"version": "0.1.0-beta.3",
4+
"license": "MIT",
5+
"keywords": [
6+
"reason",
7+
"reasonml",
8+
"bucklescript",
9+
"react-native",
10+
"react-native-template"
11+
],
12+
"files": [
13+
"*",
14+
"!.DS_Store",
15+
"!template/**/*.bs.js",
16+
"!template/.merlin",
17+
"!template/android/app/build",
18+
"!template/ios/build",
19+
"!template/ios/Pods",
20+
"!template/lib/bs",
21+
"!template/lib/ocaml"
22+
],
23+
"devDependencies": {
24+
"bs-platform": "^5.0.4",
25+
"husky": "^1.3.1",
26+
"lerna": "^3.4.0",
27+
"lint-staged": "^8.1.5",
28+
"npm-run-all": "^3.0.0",
29+
"prettier": "^1.16.4"
30+
},
31+
"scripts": {
32+
"format:most": "prettier --write \"**/*.{md,json,js,css}\"",
33+
"format:re": "find . -name \"*.re\" -or -name \"*.rei\" | grep -v \"node_modules\" | xargs bsrefmt --in-place",
34+
"format": "yarn format:most && yarn format:re",
35+
"test": "cd template && yarn test",
36+
"#prepublishOnly": "this is to include debug.keystore for android. Using files here doesn't work as .gitignore of the other folder seems to be *stronger*",
37+
"prepublishOnly": "rm -f template/.npmignore && grep -w -v \"*.keystore\" template/.gitignore > template/.npmignore"
38+
},
39+
"prettier": {
40+
"trailingComma": "all",
41+
"proseWrap": "always"
42+
},
43+
"lint-staged": {
44+
"*.{md,json,js,css}": [
45+
"prettier --write"
46+
],
47+
"*.{re,rei}": [
48+
"bsrefmt --in-place",
49+
"git add"
50+
]
51+
},
52+
"husky": {
53+
"hooks": {
54+
"pre-commit": "lint-staged"
55+
}
56+
}
57+
}

script.js

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/usr/bin/env node
2+
3+
console.log(
4+
"You are now ready to use Reason React Native. Be sure to check the docs at https://reasonml-community.github.io/reason-react-native/",
5+
);

template.config.js

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module.exports = {
2+
placeholderName: "ProjectName",
3+
templateDir: "./template",
4+
postInitScript: "./script.js",
5+
};

template/.buckconfig

+6
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

template/.eslintrc.js

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module.exports = {
2+
root: true,
3+
extends: "@react-native-community",
4+
};

template/.flowconfig

+99
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
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 unexpected extra "@providesModule"
9+
.*/node_modules/.*/node_modules/fbjs/.*
10+
11+
; Ignore duplicate module providers
12+
; For RN Apps installed via npm, "Libraries" folder is inside
13+
; "node_modules/react-native" but in the source repo it is in the root
14+
node_modules/react-native/Libraries/react-native/React.js
15+
16+
; Ignore polyfills
17+
node_modules/react-native/Libraries/polyfills/.*
18+
19+
; These should not be required directly
20+
; require from fbjs/lib instead: require('fbjs/lib/warning')
21+
node_modules/warning/.*
22+
23+
; Flow doesn't support platforms
24+
.*/Libraries/Utilities/HMRLoadingView.js
25+
26+
[untyped]
27+
.*/node_modules/@react-native-community/cli/.*/.*
28+
29+
[include]
30+
31+
[libs]
32+
node_modules/react-native/Libraries/react-native/react-native-interface.js
33+
node_modules/react-native/flow/
34+
35+
[options]
36+
emoji=true
37+
38+
esproposal.optional_chaining=enable
39+
esproposal.nullish_coalescing=enable
40+
41+
module.file_ext=.js
42+
module.file_ext=.json
43+
module.file_ext=.ios.js
44+
45+
module.system=haste
46+
module.system.haste.use_name_reducers=true
47+
# get basename
48+
module.system.haste.name_reducers='^.*/\([a-zA-Z0-9$_.-]+\.js\(\.flow\)?\)$' -> '\1'
49+
# strip .js or .js.flow suffix
50+
module.system.haste.name_reducers='^\(.*\)\.js\(\.flow\)?$' -> '\1'
51+
# strip .ios suffix
52+
module.system.haste.name_reducers='^\(.*\)\.ios$' -> '\1'
53+
module.system.haste.name_reducers='^\(.*\)\.android$' -> '\1'
54+
module.system.haste.name_reducers='^\(.*\)\.native$' -> '\1'
55+
module.system.haste.paths.blacklist=.*/__tests__/.*
56+
module.system.haste.paths.blacklist=.*/__mocks__/.*
57+
module.system.haste.paths.whitelist=<PROJECT_ROOT>/node_modules/react-native/Libraries/.*
58+
module.system.haste.paths.whitelist=<PROJECT_ROOT>/node_modules/react-native/RNTester/.*
59+
module.system.haste.paths.whitelist=<PROJECT_ROOT>/node_modules/react-native/IntegrationTests/.*
60+
module.system.haste.paths.blacklist=<PROJECT_ROOT>/node_modules/react-native/Libraries/react-native/react-native-implementation.js
61+
module.system.haste.paths.blacklist=<PROJECT_ROOT>/node_modules/react-native/Libraries/Animated/src/polyfills/.*
62+
63+
munge_underscores=true
64+
65+
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'
66+
67+
suppress_type=$FlowIssue
68+
suppress_type=$FlowFixMe
69+
suppress_type=$FlowFixMeProps
70+
suppress_type=$FlowFixMeState
71+
72+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native\\(_ios\\)?_\\(oss\\|fb\\)[a-z,_]*\\)?)\\)
73+
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native\\(_ios\\)?_\\(oss\\|fb\\)[a-z,_]*\\)?)\\)?:? #[0-9]+
74+
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError
75+
76+
[lints]
77+
sketchy-null-number=warn
78+
sketchy-null-mixed=warn
79+
sketchy-number=warn
80+
untyped-type-import=warn
81+
nonstrict-import=warn
82+
deprecated-type=warn
83+
unsafe-getters-setters=warn
84+
inexact-spread=warn
85+
unnecessary-invariant=warn
86+
signature-verification-failure=warn
87+
deprecated-utility=error
88+
89+
[strict]
90+
deprecated-type
91+
nonstrict-import
92+
sketchy-null
93+
unclear-type
94+
unsafe-getters-setters
95+
untyped-import
96+
untyped-type-import
97+
98+
[version]
99+
^0.98.0

template/.gitattributes

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Xcode pbxproj are text
2+
*.pbxproj -text
3+
4+
# .re and .rei files are Reason, sometimes recognized as C/C++ (on GitHub)
5+
*.re linguist-language=Reason
6+
*.rei linguist-language=Reason

template/.gitignore

+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
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+
project.xcworkspace
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+
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/
60+
61+
# BuckleScript artifacts
62+
*.bs.js
63+
.bsb.lock
64+
.merlin
65+
lib/bs
66+
lib/ocaml

template/.watchmanconfig

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

template/App.js

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/**
2+
* Do not modify this file - it is a proxy to your `App.re` file
3+
* located in the `src/` folder.
4+
*/
5+
export { app as default } from "./src/App.bs.js";

template/__tests__/App-test.js

+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+
});

0 commit comments

Comments
 (0)