Skip to content

Commit 3d47b83

Browse files
committed
Initial commit
0 parents  commit 3d47b83

14 files changed

+2282
-0
lines changed

.editorconfig

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# https://EditorConfig.org
2+
root = true
3+
4+
[*]
5+
end_of_line = lf
6+
insert_final_newline = true
7+
charset = utf-8
8+
indent_style = space
9+
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

.github/workflows/build.yml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Build
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
9+
strategy:
10+
matrix:
11+
node-version:
12+
- 8.x
13+
- 10.x
14+
- 12.x
15+
16+
steps:
17+
- uses: actions/checkout@v1
18+
- name: Use Node.js ${{ matrix.node-version }}
19+
uses: actions/setup-node@v1
20+
with:
21+
node-version: ${{ matrix.node-version }}
22+
- name: Install
23+
run: |
24+
yarn install \
25+
--non-interactive \
26+
--frozen-lockfile
27+
- name: Test
28+
run: yarn test
29+
env:
30+
CI: true

.gitignore

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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+
# Ocaml / Reason / BuckleScript artifacts
13+
#*.bs.js # we do want this files to ensure zero-cost
14+
.bsb.lock
15+
**/lib/bs
16+
**/lib/ocaml
17+
**/.merlin

.node-version

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
12

.prettierignore

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

CHANGELOG.md

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Changelog of `@reason-react-native/__template__`
2+
3+
## X.Y.Z - 20YY-MM-DD
4+
5+
Short & concise description
6+
7+
### 💥 Breaking changes
8+
9+
- Something, in [1234567](<link to commit on github>) by @<usename>
10+
11+
### 🐛 Fixes
12+
13+
- Something else, in [1234567](<link to commit on github>) by @<usename>
14+
15+
### Internal changes
16+
17+
(If worth mentioning)

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2019 @reason-react-native contributors
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

+101
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
**How to use this template**
2+
3+
- Put your bindings in `src/ReactNativeSomething` & rename accordingly or use
4+
`bsconfig.json` `"namespace"` field (more on this below),
5+
- Update all occurences of
6+
7+
- `@reason-react-native/__template__`
8+
- `https://github.com/reason-react-native/__template__`
9+
- `__template__`
10+
- `@react-native-community/something`
11+
- `https://github.com/react-native-community/something`
12+
- `ReactNativeSomething`. If you have more than a file exposed, you should
13+
consider using BuckleScript custom namespace by adjusting `bsconfig.json`
14+
and adding a `"namespace": "react-native-something"` (note that it will be
15+
converted to `ReactNativeSomething`)
16+
17+
- Add your `@react-native-community/something` (adjusted) in `peerDependencies`
18+
& `devDependencies` section
19+
- Adjust the changelog (and/or clean it)
20+
- Remove this part ⬆ & keep everything below ⬇
21+
22+
---
23+
24+
# `@reason-react-native/__template__`
25+
26+
[![Build Status](https://github.com/reason-react-native/__template__/workflows/Build/badge.svg)](https://github.com/reason-react-native/__template__/actions)
27+
[![Version](https://img.shields.io/npm/v/@reason-react-native/__template__.svg)](https://www.npmjs.com/@reason-react-native/__template__)
28+
[![Chat](https://img.shields.io/discord/235176658175262720.svg?logo=discord&colorb=blue)](https://reasonml-community.github.io/reason-react-native/discord/)
29+
30+
[ReasonML](https://reasonml.github.io) /
31+
[BuckleScript](https://bucklescript.github.io) bindings for
32+
[`@react-native-community/something`](https://github.com/react-native-community/something).
33+
34+
Exposed as `ReactNativeSomething` module.
35+
36+
`@reason-react-native/__template__` X.y._ means it's compatible with
37+
`@react-native-community/something` X.y._
38+
39+
## Installation
40+
41+
When
42+
[`@react-native-community/something`](https://github.com/react-native-community/something)
43+
is properly installed & configured by following their installation instructions,
44+
you can install the bindings:
45+
46+
```console
47+
npm install @reason-react-native/__template__
48+
# or
49+
yarn add @reason-react-native/__template__
50+
```
51+
52+
`@reason-react-native/__template__` should be added to `bs-dependencies` in your
53+
`bsconfig.json`. Something like
54+
55+
```diff
56+
{
57+
//...
58+
"bs-dependencies": [
59+
"reason-react",
60+
"reason-react-native",
61+
// ...
62+
+ "@reason-react-native/__template__"
63+
],
64+
//...
65+
}
66+
```
67+
68+
## Usage
69+
70+
### Types
71+
72+
#### `ReactNativeSomething.t`
73+
74+
...
75+
76+
### Methods
77+
78+
#### `ReactNativeSomething.method`
79+
80+
...
81+
82+
---
83+
84+
## Changelog
85+
86+
Check the [changelog](./CHANGELOG.md) for more informations about recent
87+
releases.
88+
89+
---
90+
91+
## Contribute
92+
93+
Read the
94+
[contribution guidelines](https://github.com/reason-react-native/.github/blob/master/CONTRIBUTING.md)
95+
before contributing.
96+
97+
## Code of Conduct
98+
99+
We want this community to be friendly and respectful to each other. Please read
100+
[our full code of conduct](https://github.com/reason-react-native/.github/blob/master/CODE_OF_CONDUCT.md)
101+
so that you can understand what actions will and will not be tolerated.

bsconfig.json

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"name": "@reason-react-native/__template__",
3+
"refmt": 3,
4+
"reason": {
5+
"react-jsx": 3
6+
},
7+
"package-specs": {
8+
"module": "commonjs",
9+
"in-source": true
10+
},
11+
"suffix": ".bs.js",
12+
"sources": [
13+
{
14+
"dir": "src",
15+
"subdirs": false
16+
}
17+
],
18+
"bsc-flags": ["-bs-no-version-header", "-warn-error @a"],
19+
"bs-dependencies": []
20+
}

package.json

+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
{
2+
"name": "@reason-react-native/__template__",
3+
"version": "0.0.0",
4+
"publishConfig": {
5+
"access": "public"
6+
},
7+
"peerDependencies": {
8+
},
9+
"repository": "https://github.com/reason-react-native/__template__.git",
10+
"license": "MIT",
11+
"keywords": [
12+
"reason",
13+
"reasonml",
14+
"bucklescript",
15+
"react-native"
16+
],
17+
"files": [
18+
"*",
19+
"!.DS_Store",
20+
"!**/*.bs.js",
21+
"!.merlin",
22+
"!lib/bs",
23+
"!lib/ocaml"
24+
],
25+
"scripts": {
26+
"format:most": "prettier --write \"**/*.{md,json,js,css}\"",
27+
"format:re": "find . -name \"*.re\" -or -name \"*.rei\" | grep -v \"node_modules\" | xargs bsrefmt --in-place",
28+
"format": "yarn format:most && yarn format:re",
29+
"re:start": "bsb -make-world -w",
30+
"re:build": "bsb -make-world",
31+
"re:clean-build": "bsb -clean-world -make-world",
32+
"start": "yarn re:start",
33+
"build": "yarn re:build",
34+
"test": "yarn re:clean-build",
35+
"release": "npmpub"
36+
},
37+
"devDependencies": {
38+
"bs-platform": "^5.2.0",
39+
"husky": "^1.3.0",
40+
"lint-staged": "^8.1.0",
41+
"npmpub": "^5.0.0",
42+
"prettier": "^1.18.0"
43+
},
44+
"prettier": {
45+
"trailingComma": "all",
46+
"proseWrap": "always"
47+
},
48+
"lint-staged": {
49+
"*.{md,json,js,css}": [
50+
"prettier --write",
51+
"git add"
52+
],
53+
"*.{re,rei}": [
54+
"bsrefmt --in-place",
55+
"git add"
56+
]
57+
},
58+
"husky": {
59+
"hooks": {
60+
"pre-commit": "lint-staged"
61+
}
62+
}
63+
}

src/ReactNativeSomething.bs.js

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */

src/ReactNativeSomething.re

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
type t;
2+
3+
[@bs.module "@react-native-community/something"]
4+
external method: unit => unit = "method";

0 commit comments

Comments
 (0)