Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use ReScript 10 record types in most places #20

Merged
merged 9 commits into from
Dec 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changes/header.tpl.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Changelog
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html),
and is generated by [Changie](https://github.com/miniscruff/changie).
Empty file added .changes/unreleased/.gitkeep
Empty file.
5 changes: 5 additions & 0 deletions .changes/unreleased/Changed-20231210-063131.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
kind: Changed
body: 'BREAKING: Record types are now used where possible. Requires ReScript 10.'
time: 2023-12-10T06:31:31.479826+11:00
custom:
Github Issue: "12"
32 changes: 32 additions & 0 deletions .changie.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
changesDir: .changes
unreleasedDir: unreleased
headerPath: header.tpl.md
changelogPath: CHANGELOG.md
versionExt: md
versionFormat: '## {{.Version}} - {{.Time.Format "2006-01-02"}}'
kindFormat: "### {{.Kind}}"
changeFormat: "* [#{{.Custom.Issue}}](https://github.com/miniscruff/changie/issues/{{.Custom.Issue}}) {{.Body}}"
kinds:
- label: Added
auto: minor
- label: Changed
auto: major
- label: Deprecated
auto: minor
- label: Removed
auto: major
- label: Fixed
auto: patch
newlines:
afterChangelogHeader: 1
beforeChangelogVersion: 1
endOfVersion: 1
envPrefix: CHANGIE_
custom:
- key: Github Issue
type: int
minInt: 1
replacements:
- path: package.json
find: ' "version": ".*",'
replace: ' "version": "{{.VersionNoPrefix}}",'
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
node-version: 20
cache: yarn
- run: yarn install
- run: yarn test
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Changelog
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html),
and is generated by [Changie](https://github.com/miniscruff/changie).


No releases yet, this file will be updated when generating your first release.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,15 @@ Node.js bindings for ReScript
```shell
npm install rescript-nodejs
```

or

```shell
yarn add rescript-nodejs
```

Then add rescript-nodejs to `bsconfig.json`:

```
"bs-dependencies": [
"rescript-nodejs"
Expand Down Expand Up @@ -59,6 +63,7 @@ We welcome and encourage anyone to contribute! In order to minimize confusion an
- If you want to request a feature/improvement, it's best to create an issue first and start a discussion. Don't spend a lot of valuable time and energy creating a pull request when it might not fit in with the project goals. Your PR may still be merged if it isn't based on an issue but expect to have a discussion first.
- If you notice gaps in the documentation and want to help fill them in, feel free to go straight to PR. Or create an issue and provide a draft of the docs you want to add.
- If you have concerns about implementation style or design decisions (e.g. type soundness, complexity, ergonomics, edge cases, etc.), please submit an issue voicing your concerns. Critique from the community is welcome. This library is only useful so long as it works for everyone!
- A changelog has finally been added, managed by [changie](https://changie.dev). Please use this tool (available via `yarn changie new`) to add changelog entries.

## License and Credits

Expand Down
4 changes: 1 addition & 3 deletions examples/ReadFileByLine.res
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
open NodeJs

// example from the NodeJS docs
let rl = Readline.make(
Readline.interfaceOptions(~input=Fs.createReadStream("sample.txt"), ~crlfDelay=infinity, ()),
)
let rl = Readline.make({input: Fs.createReadStream("sample.txt"), crlfDelay: infinity})

rl
->Readline.Interface.on(Event.fromString("line"), line => {
Expand Down
4 changes: 2 additions & 2 deletions lib/js/test/atomic/Console.test.bs.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 8 additions & 8 deletions lib/js/test/atomic/Stream.test.bs.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
"name": "rescript-nodejs",
"version": "15.0.0",
"scripts": {
"build": "rescript || rescript",
"build": "rescript",
"clean": "rescript clean",
"start": "rescript build -w",
"test": "rescript && pta lib/js/test/atomic/*.test.bs.js",
"clean-build": "yarn clean && yarn build",
"clean-start": "yarn clean && yarn start",
"clean-test": "yarn clean && yarn build test",
"test-start": "onchange --await-write-finish 1000 --initial 'lib/js/{test,src}/**/*.bs.js' -- yarn test",
"test-watchexec": "watchexec -r -d 0 -w lib/bs -e log -- yarn test"
"test-watchexec": "watchexec -r -d 0 -w src -w test -e res -- yarn test"
},
"keywords": [
"rescript",
Expand All @@ -27,6 +27,7 @@
"license": "MIT",
"devDependencies": {
"@dusty-phillips/rescript-zora": "^4.0.0",
"changie": "^1.16.1",
"onchange": "^7.1.0",
"pta": "^1.2.0",
"rescript": "^11.0.0-beta.3",
Expand Down
2 changes: 1 addition & 1 deletion src/Buffer.res
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
type t
type t = {length: int}
open Js.TypedArray2

module Constants = {
Expand Down
Loading