Skip to content

Commit 358ab81

Browse files
committed
Update to match template
1 parent ad04ad6 commit 358ab81

File tree

11 files changed

+2163
-40
lines changed

11 files changed

+2163
-40
lines changed

.editorconfig

Lines changed: 9 additions & 0 deletions
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

Lines changed: 3 additions & 0 deletions
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

Lines changed: 30 additions & 0 deletions
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

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
1-
# OCaml / Reason / BuckleScript artifacts
2-
.bsb.lock
3-
**/lib/bs
4-
**/lib/ocaml
5-
**/.merlin
1+
*.log
62

7-
# macOS
3+
# macOS crap
84
.DS_Store
5+
96
# node
107
node_modules
8+
119
# npm unused lock file (we use yarn.lock)
12-
package-lock.json
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

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

.prettierignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*.bs.js
2+
package.json

README.md

Lines changed: 66 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,67 @@
1-
# keychain
1+
# `@reason-react-native/keychain`
22

3-
[ReasonML](https://reasonml.github.io)/[BuckleScript](https://bucklescript.github.io) bindings for [react-native-keychain](https://github.com/oblador/react-native-keychain).
3+
[![Build Status](https://github.com/reason-react-native/keychain/workflows/Build/badge.svg)](https://github.com/reason-react-native/keychain/actions)
4+
[![Version](https://img.shields.io/npm/v/@reason-react-native/keychain.svg)](https://www.npmjs.com/@reason-react-native/keychain)
5+
[![Chat](https://img.shields.io/discord/235176658175262720.svg?logo=discord&colorb=blue)](https://reason-react-native.github.io/discord/)
6+
7+
[ReasonML](https://reasonml.github.io) /
8+
[BuckleScript](https://bucklescript.github.io) bindings for
9+
[`react-native-keychain`](https://github.com/oblador/react-native-keychain).
10+
11+
Exposed as `ReactNativeSomething` module.
12+
13+
`@reason-react-native/keychain` X.y._ means it's compatible with
14+
`react-native-keychain` X.y._
15+
16+
## Installation
17+
18+
When [`react-native-keychain`](https://github.com/oblador/react-native-keychain)
19+
is properly installed & configured by following their installation instructions,
20+
you can install the bindings:
21+
22+
```console
23+
npm install @reason-react-native/keychain
24+
# or
25+
yarn add @reason-react-native/keychain
26+
```
27+
28+
`@reason-react-native/keychain` should be added to `bs-dependencies` in your
29+
`bsconfig.json`. Something like
30+
31+
```diff
32+
{
33+
//...
34+
"bs-dependencies": [
35+
"reason-react",
36+
"reason-react-native",
37+
// ...
38+
+ "@reason-react-native/keychain"
39+
],
40+
//...
41+
}
42+
```
43+
44+
## Usage
45+
46+
@todo
47+
48+
---
49+
50+
## Changelog
51+
52+
Check the [changelog](./CHANGELOG.md) for more informations about recent
53+
releases.
54+
55+
---
56+
57+
## Contribute
58+
59+
Read the
60+
[contribution guidelines](https://github.com/reason-react-native/.github/blob/master/CONTRIBUTING.md)
61+
before contributing.
62+
63+
## Code of Conduct
64+
65+
We want this community to be friendly and respectful to each other. Please read
66+
[our full code of conduct](https://github.com/reason-react-native/.github/blob/master/CODE_OF_CONDUCT.md)
67+
so that you can understand what actions will and will not be tolerated.

package.json

Lines changed: 39 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
"publishConfig": {
66
"access": "public"
77
},
8+
"peerDependencies": {
9+
"react-native-keychain": ">=3.1.3"
10+
},
811
"author": "Christoph Knittel <ck@cca.io>",
912
"repository": "https://github.com/reason-react-native/keychain.git",
1013
"license": "MIT",
@@ -19,23 +22,49 @@
1922
],
2023
"files": [
2124
"*",
25+
"!.github",
2226
"!.DS_Store",
2327
"!**/*.bs.js",
2428
"!.merlin",
2529
"!lib/bs",
2630
"!lib/ocaml"
2731
],
2832
"scripts": {
29-
"start": "bsb -make-world -w",
30-
"build": "bsb -make-world",
31-
"clean": "bsb -clean-world",
32-
"test": "bsb -clean-world -make-world"
33-
},
34-
"peerDependencies": {
35-
"react-native-keychain": ">=3.1.3"
33+
"format:most": "prettier --write \"**/*.{md,json,js,css}\"",
34+
"format:re": "find . -name \"*.re\" -or -name \"*.rei\" | grep -v \"node_modules\" | xargs bsrefmt --in-place",
35+
"format": "yarn format:most && yarn format:re",
36+
"re:start": "bsb -make-world -w",
37+
"re:build": "bsb -make-world",
38+
"re:clean-build": "bsb -clean-world -make-world",
39+
"start": "yarn re:start",
40+
"build": "yarn re:build",
41+
"test": "yarn re:clean-build",
42+
"release": "npmpub"
3643
},
3744
"devDependencies": {
38-
"bs-platform": "^5.0.6",
39-
"react-native-keychain": "^3.1.3"
45+
"bs-platform": "^5.2.0",
46+
"husky": "^1.3.0",
47+
"lint-staged": "^8.1.0",
48+
"npmpub": "^5.0.0",
49+
"prettier": "^1.18.0"
50+
},
51+
"prettier": {
52+
"trailingComma": "all",
53+
"proseWrap": "always"
54+
},
55+
"lint-staged": {
56+
"*.{md,json,js,css}": [
57+
"prettier --write",
58+
"git add"
59+
],
60+
"*.{re,rei}": [
61+
"bsrefmt --in-place",
62+
"git add"
63+
]
64+
},
65+
"husky": {
66+
"hooks": {
67+
"pre-commit": "lint-staged"
68+
}
4069
}
41-
}
70+
}

src/ReactNativeKeychain.bs.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,20 @@ var Js_dict = require("bs-platform/lib/js/js_dict.js");
44
var Js_json = require("bs-platform/lib/js/js_json.js");
55
var Belt_Option = require("bs-platform/lib/js/belt_Option.js");
66

7-
var SecurityLevel = /* module */[];
7+
var SecurityLevel = { };
88

9-
var Accessible = /* module */[];
9+
var Accessible = { };
1010

11-
var AccessControl = /* module */[];
11+
var AccessControl = { };
1212

13-
var AuthenticationType = /* module */[];
13+
var AuthenticationType = { };
1414

15-
var BiometryType = /* module */[];
15+
var BiometryType = { };
1616

1717
function decodeGetGenericPasswordResult(result) {
1818
var match = Js_json.classify(result);
19-
if (typeof match === "number" || match.tag !== 2) {
20-
return undefined;
19+
if (typeof match === "number" || match.tag !== /* JSONObject */2) {
20+
return ;
2121
} else {
2222
var dict = match[0];
2323
var match$1 = Belt_Option.map(Js_dict.get(dict, "service"), Js_json.classify);
@@ -26,15 +26,15 @@ function decodeGetGenericPasswordResult(result) {
2626
if (match$1 !== undefined) {
2727
var match$4 = match$1;
2828
if (typeof match$4 === "number" || match$4.tag || match$2 === undefined) {
29-
return undefined;
29+
return ;
3030
} else {
3131
var match$5 = match$2;
3232
if (typeof match$5 === "number" || match$5.tag || match$3 === undefined) {
33-
return undefined;
33+
return ;
3434
} else {
3535
var match$6 = match$3;
3636
if (typeof match$6 === "number" || match$6.tag) {
37-
return undefined;
37+
return ;
3838
} else {
3939
return /* record */[
4040
/* service */match$4[0],
@@ -45,7 +45,7 @@ function decodeGetGenericPasswordResult(result) {
4545
}
4646
}
4747
} else {
48-
return undefined;
48+
return ;
4949
}
5050
}
5151
}

src/ReactNativeKeychain.re

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,4 +180,4 @@ external resetGenericPasswordWithOptions:
180180

181181
[@bs.module "react-native-keychain"]
182182
external resetGenericPasswordWithService: string => Js.Promise.t(bool) =
183-
"resetGenericPassword";
183+
"resetGenericPassword";

0 commit comments

Comments
 (0)