Skip to content

Commit

Permalink
Upgrade to latest package set, including new Node eventing model (#148)
Browse files Browse the repository at this point in the history
  • Loading branch information
fsoikin committed Feb 12, 2024
1 parent c66a79d commit 5a62bc8
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 25 deletions.
1 change: 0 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,3 @@ jobs:
- name: Run tests
run: |
spago -x test.dhall test
pulp test
10 changes: 0 additions & 10 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,5 @@
"purescript-tailrec": "^v6.1.0",
"purescript-transformers": "^v6.0.0",
"purescript-tuples": "^v7.0.0"
},
"devDependencies": {
"purescript-console": "^v6.0.0",
"purescript-node-buffer": "^v8.0.0",
"purescript-node-child-process": "^v9.0.0",
"purescript-node-fs": "^v8.2.0",
"purescript-node-fs-aff": "^v9.2.0",
"purescript-node-os": "^v4.0.0",
"purescript-node-process": "^v10.0.0",
"purescript-node-streams": "^v7.0.0"
}
}
10 changes: 5 additions & 5 deletions packages.dhall
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
let upstream =
https://github.com/purescript/package-sets/releases/download/psc-0.15.9-20230629/packages.dhall
sha256:f91d36c7e4793fe4d7e042c57fef362ff3f9e9ba88454cd38686701e30bf545a

in upstream
let upstream =
https://github.com/purescript/package-sets/releases/download/psc-0.15.14-20240211/packages.dhall
sha256:e3bb22a7511430536338ff964c9f2961faf9c8e19b409b89490e4c9513eec61b

in upstream
2 changes: 1 addition & 1 deletion test.dhall
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ in config // {
[ "console"
, "node-buffer"
, "node-child-process"
, "node-event-emitter"
, "node-fs"
, "node-fs-aff"
, "node-os"
, "node-process"
, "node-streams"
Expand Down
16 changes: 8 additions & 8 deletions test/Integration.purs
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ import Effect.Class (liftEffect)
import Effect.Class.Console (log)
import Effect.Ref as Ref
import Node.Buffer as Buffer
import Node.ChildProcess (defaultSpawnOptions)
import Node.ChildProcess as IO
import Node.ChildProcess as Proc
import Node.ChildProcess.Types as IO
import Node.Encoding (Encoding(..))
import Node.EventEmitter (on_)
import Node.FS.Aff as FS
import Node.FS.Stats (isDirectory)
import Node.OS (tmpdir)
Expand Down Expand Up @@ -110,17 +110,17 @@ prepareEnvironment { debug } =
output <- Ref.new ""
let return = cb <<< Right =<< Ref.read output

proc <- Proc.spawn cmd args defaultSpawnOptions { cwd = Just cwd, stdio = [Just IO.Ignore, Just IO.Pipe, Just IO.Pipe] }
proc <- Proc.spawn' cmd args _ { cwd = Just cwd, appendStdio = Just [IO.ignore, IO.pipe, IO.pipe] }

for_ [Proc.stdout, Proc.stderr] \pipe ->
Stream.onData (pipe proc) \buf -> do
pipe proc # on_ Stream.dataH \buf -> do
str <- Buffer.toString UTF8 buf
void $ output # Ref.modify (_ <> str)

Proc.onExit proc \_ -> return
Proc.onError proc \_ -> return
Proc.onDisconnect proc return
Proc.onClose proc \_ -> return
proc # on_ Proc.exitH \_ -> return
proc # on_ Proc.errorH \_ -> return
proc # on_ Proc.disconnectH return
proc # on_ Proc.closeH \_ -> return

pure nonCanceler

Expand Down

0 comments on commit 5a62bc8

Please sign in to comment.