Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
DCKT committed Feb 17, 2024
1 parent befcb21 commit eb30a29
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 20 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,5 @@ test/bundle/*.js
test/bundle/*.js.gz
promise-*
_release

*.mjs
42 changes: 28 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,47 @@
# rescript-bindings-template
# rescript-<module>

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

## Setup

1. Install the module

```bash
bun install @dck/rescript-x
bun install @dck/rescript-<module>
# or
yarn install @dck/rescript-<module>
# or
npm install @dck/rescript-<module>
```

or
2. Add it to your `rescript.json` config

```bash
yarn install @dck/rescript-x
```json
{
"bsc-dependencies": ["@dck/rescript-<module>"]
}
```

or
## Usage

The functions can be accessed through `X` module.

## Development

Install deps

```bash
npm install @dck/rescript-x
bun install
```

2. Add it to your `rescript.json` config
Compiles files

```json
{
"bsc-flags": ["@dck/rescript-x"]
}
```bash
bun run dev
```

## API
Run tests

```bash
bun test
```
Binary file modified bun.lockb
Binary file not shown.
15 changes: 10 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@dck/rescript-bindings-template",
"name": "@dck/rescript-<module>",
"version": "0.0.0",
"description": "",
"description": "ReScript bindings for <module>",
"keywords": [
"rescript",
"bindings"
Expand All @@ -16,15 +16,20 @@
"rescript": ">=11.0.0"
},
"devDependencies": {
"rescript": ">=11.0.0"
"@rescript/core": "^1.0.0",
"rescript": ">=11.0.0",
"rescript-bun": "^0.4.1"
},
"scripts": {
"build": "rescript build",
"watch": "rescript build -w",
"dev": "rescript build -w",
"clean": "rescript clean"
},
"files": [
"src/*",
"rescript.json"
]
],
"engines": {
"node": ">=18"
}
}
15 changes: 14 additions & 1 deletion rescript.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,24 @@
{
"name": "@dck/rescript-bindings-template",
"name": "@dck/rescript-<module>",
"uncurried": true,
"namespace": false,
"sources": [
{
"dir": "src",
"subdirs": true
},
{
"dir": "tests",
"type": "dev",
"subdirs": true
}
],
"suffix": ".mjs",
"bs-dev-dependencies": ["@rescript/core", "rescript-bun"],
"package-specs": [
{
"module": "es6",
"in-source": true
}
]
}
12 changes: 12 additions & 0 deletions tests/Bindings_test.res
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
open RescriptCore
open RescriptBun
open RescriptBun.Globals
open Test

let wait = ms => {
Promise.make((resolve, _) => setTimeout(() => resolve(), ms)->ignore)
}

test("demo", () => {
expect(1)->Expect.toBe(1)
})

0 comments on commit eb30a29

Please sign in to comment.