git.iko.soy/rowtype-yoga/purescript-yoga-fetch-om
on main help sign in
Bump version to 0.5.0
commit94e2fccfdba6dc5d46931587bc8243713123939d authorMark <mark.eibes@gmail.com> dateMon 9 Feb 2026, 20:43 (8 months ago) parent71b0fbc
3 files changed+15−15
spago.lock+5−4 spago.yaml+3−2 test/Polymorphic.Spec.purs+7−9
spago.lock+5−4
@@ -681,7 +681,9 @@
681681 },
682682 "extra_packages": {
683683 "yoga-fastify": "0.2.3",
684− "yoga-fastify-om": "0.1.0",
684+ "yoga-fastify-om": {
685+ "path": "../purescript-yoga-fastify-om"
686+ },
685687 "yoga-http-api": {
686688 "path": "../purescript-yoga-http-api"
687689 },
@@ -2039,9 +2041,8 @@
20392041 ]
20402042 },
20412043 "yoga-fastify-om": {
2042− "type": "registry",
2043− "version": "0.1.0",
2044− "integrity": "sha256-cgkNDv2BP29DRpw/kY2p7vXhVUofDBZ7lkm1LHsE1Kg=",
2044+ "type": "local",
2045+ "path": "../purescript-yoga-fastify-om",
20452046 "dependencies": [
20462047 "aff",
20472048 "console",
spago.yaml+3−2
@@ -2,7 +2,8 @@ workspace:
22 packageSet:
33 registry: 73.0.0
44 extraPackages:
5− yoga-fastify-om: "0.1.0"
5+ yoga-fastify-om:
6+ path: ../purescript-yoga-fastify-om
67 yoga-fastify: "0.2.3"
78 yoga-http-api:
89 path: ../purescript-yoga-http-api
@@ -15,7 +16,7 @@ workspace:
1516package:
1617 name: yoga-fetch-om
1718 publish:
18− version: 0.3.0
19+ version: 0.5.0
1920 license: MIT
2021 location:
2122 githubOwner: rowtype-yoga
test/Polymorphic.Spec.purs+7−9
@@ -9,20 +9,20 @@ import Test.Spec (Spec, around, describe, it)
99import Test.Spec.Assertions (shouldEqual)
1010import Yoga.Fastify.Fastify as F
1111import Yoga.Fastify.Fastify (Port(..), Host(..))
12−import Yoga.Fastify.Om.Route (Handler, Request, handle, respond, handleRoute)
12+import Yoga.Fastify.Om.API (registerAPI)
13+import Yoga.Fastify.Om.Route (Handler, handle, respond)
1314import Yoga.Fetch.Om (GET, Route, type (/), type (:), client)
1415import Yoga.Om (Om, ask, runOm)
1516
1617type User = { id :: Int, name :: String }
1718
19+type GetUserRoute = Route GET ("users" / "id" : Int) {} (ok :: { body :: User })
20+
1821type TestAPI =
19− { getUser :: Route GET ("users" / "id" : Int) (Request {}) (ok :: { body :: User })
22+ { getUser :: GetUserRoute
2023 }
2124
22−api
23− :: forall ctx err
24− . { getUser :: { id :: Int } -> Om ctx err User
25− }
25+api :: forall ctx err. { getUser :: { id :: Int } -> Om ctx err User }
2626api = client @TestAPI "http://localhost:44931"
2727
2828spec :: Spec Unit
@@ -55,15 +55,13 @@ withServer test = bracket acquire release (\_ -> test unit)
5555 acquire = do
5656 fastify <- liftEffect do
5757 f <- F.fastify {}
58− handleRoute getUserHandler f
58+ registerAPI { getUser: getUserHandler } f
5959 pure f
6060 void $ F.listen { port: Port 44931, host: Host "0.0.0.0" } fastify
6161 pure fastify
6262
6363 release = F.close
6464
65−type GetUserRoute = Route GET ("users" / "id" : Int) (Request {}) (ok :: { body :: User })
66−
6765getUserHandler :: Handler GetUserRoute
6866getUserHandler = handle do
6967 { path } <- ask