Skip to content

Commit eb30a29

Browse files
update
1 parent befcb21 commit eb30a29

File tree

6 files changed

+66
-20
lines changed

6 files changed

+66
-20
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,5 @@ test/bundle/*.js
1919
test/bundle/*.js.gz
2020
promise-*
2121
_release
22+
23+
*.mjs

README.md

Lines changed: 28 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,47 @@
1-
# rescript-bindings-template
1+
# rescript-<module>
22

3-
NOTE: For versioning & auto npm deploy, add a `NPM_TOKEN` to the repository secrets.
3+
ReScript bindings for [<module>](https://github.com/X/Y) (targeted version : `~X.X.X`)
44

55
## Setup
66

77
1. Install the module
88

99
```bash
10-
bun install @dck/rescript-x
10+
bun install @dck/rescript-<module>
11+
# or
12+
yarn install @dck/rescript-<module>
13+
# or
14+
npm install @dck/rescript-<module>
1115
```
1216

13-
or
17+
2. Add it to your `rescript.json` config
1418

15-
```bash
16-
yarn install @dck/rescript-x
19+
```json
20+
{
21+
"bsc-dependencies": ["@dck/rescript-<module>"]
22+
}
1723
```
1824

19-
or
25+
## Usage
26+
27+
The functions can be accessed through `X` module.
28+
29+
## Development
30+
31+
Install deps
2032

2133
```bash
22-
npm install @dck/rescript-x
34+
bun install
2335
```
2436

25-
2. Add it to your `rescript.json` config
37+
Compiles files
2638

27-
```json
28-
{
29-
"bsc-flags": ["@dck/rescript-x"]
30-
}
39+
```bash
40+
bun run dev
3141
```
3242

33-
## API
43+
Run tests
44+
45+
```bash
46+
bun test
47+
```

bun.lockb

836 Bytes
Binary file not shown.

package.json

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"name": "@dck/rescript-bindings-template",
2+
"name": "@dck/rescript-<module>",
33
"version": "0.0.0",
4-
"description": "",
4+
"description": "ReScript bindings for <module>",
55
"keywords": [
66
"rescript",
77
"bindings"
@@ -16,15 +16,20 @@
1616
"rescript": ">=11.0.0"
1717
},
1818
"devDependencies": {
19-
"rescript": ">=11.0.0"
19+
"@rescript/core": "^1.0.0",
20+
"rescript": ">=11.0.0",
21+
"rescript-bun": "^0.4.1"
2022
},
2123
"scripts": {
2224
"build": "rescript build",
23-
"watch": "rescript build -w",
25+
"dev": "rescript build -w",
2426
"clean": "rescript clean"
2527
},
2628
"files": [
2729
"src/*",
2830
"rescript.json"
29-
]
31+
],
32+
"engines": {
33+
"node": ">=18"
34+
}
3035
}

rescript.json

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,24 @@
11
{
2-
"name": "@dck/rescript-bindings-template",
2+
"name": "@dck/rescript-<module>",
33
"uncurried": true,
44
"namespace": false,
55
"sources": [
66
{
77
"dir": "src",
88
"subdirs": true
9+
},
10+
{
11+
"dir": "tests",
12+
"type": "dev",
13+
"subdirs": true
14+
}
15+
],
16+
"suffix": ".mjs",
17+
"bs-dev-dependencies": ["@rescript/core", "rescript-bun"],
18+
"package-specs": [
19+
{
20+
"module": "es6",
21+
"in-source": true
922
}
1023
]
1124
}

tests/Bindings_test.res

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
open RescriptCore
2+
open RescriptBun
3+
open RescriptBun.Globals
4+
open Test
5+
6+
let wait = ms => {
7+
Promise.make((resolve, _) => setTimeout(() => resolve(), ms)->ignore)
8+
}
9+
10+
test("demo", () => {
11+
expect(1)->Expect.toBe(1)
12+
})

0 commit comments

Comments
 (0)