Skip to content

Commit ea853ca

Browse files
Preps repo for breaking changes work (#15)
* Format via purs-tidy * Enforce formatting check via CI * Bump node to v18 * Bump CI actions to v3 * Bump node-fs to almost next release * Add changelog entry
1 parent 812ce31 commit ea853ca

File tree

6 files changed

+26
-16
lines changed

6 files changed

+26
-16
lines changed

.github/workflows/ci.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,16 @@ jobs:
1010
build:
1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: actions/checkout@v2
13+
- uses: actions/checkout@v3
1414

1515
- uses: purescript-contrib/setup-purescript@main
1616
with:
1717
purescript: "unstable"
18+
purs-tidy: "latest"
1819

19-
- uses: actions/setup-node@v2
20+
- uses: actions/setup-node@v3
2021
with:
21-
node-version: "14"
22+
node-version: "18"
2223

2324
- name: Install dependencies
2425
run: |
@@ -33,3 +34,7 @@ jobs:
3334
run: |
3435
bower install
3536
npm run-script test --if-present
37+
38+
- name: Check formatting
39+
run: |
40+
purs-tidy check src test

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,15 @@ Notable changes to this project are documented in this file. The format is based
55
## [Unreleased]
66

77
Breaking changes:
8+
- Bumped `node-buffer` and `node-fs` to v9.0.0 and latest release (#12 by @JordanMartinez)
89

910
New features:
1011

1112
Bugfixes:
1213

1314
Other improvements:
15+
- Bump CI node to v18 (#12 by @JordanMartinez)
16+
- Enforce formatting in CI via `purs-tidy` (#12 by @JordanMartinez)
1417

1518
## [v4.0.0](https://github.com/purescript-node/purescript-node-net/releases/tag/v4.0.0) - 2022-04-29
1619

bower.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
"purescript-exceptions": "^6.0.0",
1818
"purescript-foreign": "^7.0.0",
1919
"purescript-maybe": "^6.0.0",
20-
"purescript-node-buffer": "^8.0.0",
21-
"purescript-node-fs": "^8.0.0",
20+
"purescript-node-buffer": "^9.0.0",
21+
"purescript-node-fs": "#be0a346f4b72826947a124486c299b842c5e2601",
2222
"purescript-nullable": "^6.0.0",
2323
"purescript-options": "^7.0.0",
2424
"purescript-prelude": "^6.0.0",

src/Node/Net/Server.purs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@ import Foreign (F, Foreign, readInt, readString)
4242
import Foreign.Index (readProp)
4343
import Node.Net.Socket (Socket)
4444

45-
type Address
46-
= { address :: String
47-
, family :: String
48-
, port :: Int
49-
}
45+
type Address =
46+
{ address :: String
47+
, family :: String
48+
, port :: Int
49+
}
5050

5151
-- | Options to configure the listening side of a `Server`.
5252
-- | These options decide whether the `Server` is ICP or TCP.
@@ -76,10 +76,12 @@ address server = do
7676
where
7777
hush :: F ~> Maybe
7878
hush f = either (\_ -> Nothing) Just (runExcept f)
79+
7980
read :: Foreign -> Maybe (Either Address String)
8081
read value =
8182
hush (map Left $ readAddress value)
8283
<|> hush (map Right $ readString value)
84+
8385
readAddress :: Foreign -> F Address
8486
readAddress value = ado
8587
address <- readProp "address" value >>= readString

src/Node/Net/Socket.purs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,11 @@ import Node.FS (FileDescriptor)
7979
-- | Setting `port` will make the `Socket` TCP.
8080
data ConnectOptions
8181

82-
type Lookup
83-
= { address :: String
84-
, family :: Maybe Int
85-
, host :: String
86-
}
82+
type Lookup =
83+
{ address :: String
84+
, family :: Maybe Int
85+
, host :: String
86+
}
8787

8888
-- | An ICP endpoint or TCP socket.
8989
foreign import data Socket :: Type

test/Test/Main.purs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ main = do
4141
false -> infoShow { _message: "Socket closed without an error" }
4242
true -> errorShow { _message: "Socket closed with an error" }
4343
Node.Net.Socket.onConnect socket do
44-
infoShow {_message: "Socket connected"}
44+
infoShow { _message: "Socket connected" }
4545
Node.Net.Socket.onData socket case _ of
4646
Left buffer -> do
4747
bufferString <- toString UTF8 buffer

0 commit comments

Comments
 (0)