Skip to content

Commit 44c42e1

Browse files
committed
Update for PureScript 0.14
1 parent dcba522 commit 44c42e1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+908
-747
lines changed

packages.dhall

+82-44
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,20 @@
11
let upstream =
2-
https://github.com/purescript/package-sets/releases/download/psc-0.13.8-20210118/packages.dhall sha256:a59c5c93a68d5d066f3815a89f398bcf00e130a51cb185b2da29b20e2d8ae115
2+
https://github.com/purescript/package-sets/releases/download/psc-0.14.4-20211030/packages.dhall sha256:5cd7c5696feea3d3f84505d311348b9e90a76c4ce3684930a0ff29606d2d816c
33

44
let mkPackage =
55
https://raw.githubusercontent.com/purescript/package-sets/psc-0.13.0-20190626/src/mkPackage.dhall sha256:0b197efa1d397ace6eb46b243ff2d73a3da5638d8d0ac8473e8e4a8fc528cf57
66

7-
let overrides = {=}
8-
9-
107
let homogeneous = mkPackage
118
[ "assert", "console", "effect", "foreign-object", "psci-support"
129
, "record-extra", "typelevel-eval", "variant"
1310
]
1411
"https://github.com/paluh/purescript-homogeneous.git"
15-
"master"
12+
"v0.3.0"
1613

17-
let postgresql-client = mkPackage
18-
[ "aff", "arrays", "bifunctors", "bytestrings", "datetime", "decimals", "effect"
19-
, "either", "exceptions", "foldable-traversable", "foreign", "foreign-generic"
20-
, "foreign-object", "js-date", "lists", "maybe", "newtype", "nullable", "prelude"
21-
, "string-parsers", "transformers", "tuples"
22-
]
23-
"https://github.com/rightfold/purescript-postgresql-client.git"
24-
-- "v3.1.0"
25-
"pool-query"
14+
let js-uri = mkPackage
15+
[ "assert", "effect", "functions", "maybe", "prelude" ]
16+
"https://github.com/srghma/purescript-js-uri.git"
17+
"d25d83390ba9cf948f46695b55a5511895b0068c"
2618

2719
let polyform = mkPackage
2820
[ "newtype", "ordered-collections", "variant", "profunctor", "invariant", "foreign-object"
@@ -44,34 +36,49 @@ let polyform-batteries-env = mkPackage
4436
let polyform-batteries-urlencoded = mkPackage
4537
[ "polyform-batteries-core", "argonaut", "prelude", "affjax", "numbers" ]
4638
"https://github.com/purescript-polyform/batteries-urlencoded.git"
47-
"master"
39+
"v0.1.0"
40+
41+
let postgresql-client = mkPackage
42+
[ "aff", "arrays", "bifunctors", "bytestrings", "datetime", "decimals", "effect"
43+
, "either", "exceptions", "foldable-traversable", "foreign", "foreign-generic"
44+
, "foreign-object", "js-date", "lists", "maybe", "newtype", "nullable", "prelude"
45+
, "string-parsers", "transformers", "tuples"
46+
]
47+
"https://github.com/rightfold/purescript-postgresql-client.git"
48+
"v4.0.0-pre"
49+
4850

4951
let prettyprinter = mkPackage
5052
[ "prelude", "unfoldable", "random", "ansi", "console" ]
5153
"https://github.com/Kamirus/purescript-prettyprinter.git"
5254
"master"
5355

54-
let routing-duplex-variant = mkPackage
55-
[ "routing-duplex" ]
56-
"https://github.com/paluh/purescript-routing-duplex-variant.git"
57-
"master"
58-
5956
let resourcet = mkPackage
6057
[ "aff", "ordered-collections", "refs", "transformers" ]
6158
"https://github.com/robertdp/purescript-resourcet.git"
6259
"2183bac0f1a528a5d6cdddb4fa223c4a8b9bb604"
6360

61+
let routing-duplex-variant = mkPackage
62+
[ "routing-duplex" ]
63+
"https://github.com/paluh/purescript-routing-duplex-variant.git"
64+
"v0.1.0"
65+
66+
let run-streaming = mkPackage
67+
[ "prelude", "run" ]
68+
"https://github.com/paluh/purescript-run-streaming.git"
69+
"master"
70+
6471
let selda = mkPackage
6572
[ "console", "exists", "heterogeneous", "lists", "node-sqlite3", "postgresql-client"
6673
, "prelude", "simple-json", "strings", "test-unit", "transformers", "variant", "prettyprinter"
6774
]
68-
"https://github.com/Kamirus/purescript-selda.git"
69-
"scope-as-backend-with-new-pg-client"
75+
"https://github.com/paluh/purescript-selda.git"
76+
"postgresql-client-v4.0.0"
7077

7178
let typelevel-eval = mkPackage
7279
[ "prelude", "typelevel-prelude", "tuples", "unsafe-coerce", "leibniz" ]
7380
"https://github.com/natefaubion/purescript-typelevel-eval.git"
74-
"master"
81+
"polykinds"
7582

7683
-- { dependencies =
7784
-- [ "effect"
@@ -86,24 +93,55 @@ let typelevel-eval = mkPackage
8693
-- "master"
8794
-- }
8895

89-
let additions =
90-
{ homogeneous
91-
, polyform = ../polyform/spago.dhall as Location
92-
, polyform-batteries-core = ../batteries-core/spago.dhall as Location
93-
, polyform-batteries-env = ../batteries-env/spago.dhall as Location
94-
, polyform-batteries-json = ../batteries-json/spago.dhall as Location
95-
, polyform-batteries-urlencoded = ../batteries-urlencoded/spago.dhall as Location
96-
, postgresql-client = ../postgresql-client/spago.dhall as Location
97-
, prettyprinter
98-
, resourcet
99-
, routing-duplex-variant
100-
, typelevel-eval
101-
, selda = ../selda/spago.dhall as Location
102-
}
103-
104-
let overrides =
105-
{ httpure = upstream.httpure // { version = "b3eb977096b5ea177fdffd8fc9c61bcbbcfab49d" }
106-
, media-types = upstream.media-types // { version = "4c685071074065506403197b7a5f22eb661ff17c" }
107-
}
108-
109-
in upstream // overrides // additions
96+
in upstream
97+
with
98+
httpure = upstream.httpure // { version = "6ce52417f79c95c9fac413189825f35472c8f937" }
99+
with
100+
homogeneous = homogeneous
101+
with
102+
js-unsafe-stringify = ../purescript-js-unsafe-stringify/spago.dhall as Location
103+
with
104+
js-uri = js-uri
105+
with
106+
logging-journald = ../purescript-logging-journald/spago.dhall as Location
107+
with
108+
media-types = upstream.media-types // { version = "4c685071074065506403197b7a5f22eb661ff17c" }
109+
with
110+
polyform = ../polyform/spago.dhall as Location
111+
with
112+
polyform-batteries-core = ../batteries-core/spago.dhall as Location
113+
with
114+
polyform-batteries-env = ../batteries-env/spago.dhall as Location
115+
with
116+
polyform-batteries-json = ../batteries-json/spago.dhall as Location
117+
with
118+
polyform-batteries-urlencoded = ../batteries-urlencoded/spago.dhall as Location
119+
with
120+
postgresql-client = ../postgresql-client/spago.dhall as Location
121+
with
122+
prettyprinter = prettyprinter
123+
with
124+
resourcet = resourcet
125+
with
126+
routing-duplex-variant = routing-duplex-variant
127+
with
128+
run-streaming = run-streaming
129+
with
130+
typelevel-eval = typelevel-eval
131+
with
132+
selda = ../selda/spago.dhall as Location
133+
with
134+
smolder = mkPackage
135+
[ "bifunctors"
136+
, "catenable-lists"
137+
, "free"
138+
, "js-uri"
139+
, "ordered-collections"
140+
, "prelude"
141+
, "strings"
142+
, "test-unit"
143+
, "transformers"
144+
, "tuples"
145+
]
146+
"https://github.com/nsaunders/purescript-smolder.git"
147+
"ps-0.14"

spago.dhall

+39-7
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,53 @@ You can edit this file as you like.
44
-}
55
{ name = "audiocarrier"
66
, dependencies =
7-
[ "b64"
7+
[ "aff"
8+
, "argonaut"
9+
, "arrays"
10+
, "b64"
11+
, "bifunctors"
812
, "console"
9-
, "crypto"
13+
, "control"
14+
, "datetime"
15+
, "dotenv"
1016
, "effect"
11-
, "homogeneous"
17+
, "either"
18+
, "exceptions"
19+
, "foldable-traversable"
20+
, "foreign"
21+
, "foreign-object"
1222
, "httpure"
13-
, "logging-journald"
23+
, "identity"
24+
, "invariant"
25+
, "js-date"
26+
, "js-unsafe-stringify"
27+
, "js-uri"
28+
, "lazy"
29+
, "lists"
30+
, "maybe"
1431
, "media-types"
32+
, "newtype"
33+
, "node-buffer"
34+
, "node-fs-aff"
35+
, "node-http"
36+
, "node-process"
37+
, "node-streams"
1538
, "optparse"
39+
, "ordered-collections"
40+
, "partial"
1641
, "polyform"
1742
, "polyform-batteries-core"
1843
, "polyform-batteries-env"
1944
, "polyform-batteries-json"
2045
, "polyform-batteries-urlencoded"
2146
, "postgresql-client"
47+
, "prelude"
48+
, "profunctor"
2249
, "profunctor-lenses"
2350
, "psci-support"
51+
, "random"
2452
, "record"
25-
, "record-extra"
53+
, "refs"
2654
, "resourcet"
2755
, "routing-duplex"
2856
, "routing-duplex-variant"
@@ -33,10 +61,14 @@ You can edit this file as you like.
3361
, "smolder"
3462
, "spec"
3563
, "strings"
36-
, "string-parsers"
37-
, "typelevel-eval"
64+
, "transformers"
65+
, "tuples"
66+
, "typelevel-prelude"
3867
, "undefined-is-not-a-problem"
68+
, "unsafe-coerce"
3969
, "uuid"
70+
, "validation"
71+
, "variant"
4072
]
4173
, packages = ./packages.dhall
4274
, sources = [ "src/**/*.purs", "test/**/*.purs" ]

src/WebRow/Applets/Auth.purs

+9-6
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@ import Data.Maybe (Maybe(..))
1111
import Data.Tuple (Tuple(..))
1212
import Data.Variant (Variant, inj, on)
1313
import HTTPure as HTTPure
14+
import Polyform.Batteries.UrlEncoded.Validators (MissingValue)
1415
import Run (Run)
1516
import Type.Row (type (+))
16-
import WebRow.Applets.Auth.Effects (Auth, User)
1717
import WebRow.Applets.Auth.Effects (Auth, User) as Exports
18+
import WebRow.Applets.Auth.Effects (Auth, User, AUTH)
1819
import WebRow.Applets.Auth.Forms (AuthPayload, loginForm)
1920
import WebRow.Applets.Auth.Messages (Messages) as Exports
2021
import WebRow.Applets.Auth.Responses (LoginResponse(..), Response(..), ResponseRow)
@@ -25,6 +26,7 @@ import WebRow.Applets.Auth.Routes (localDuplex, routeBuilder, Route(..), RouteRo
2526
import WebRow.Applets.Auth.Types (_auth, namespace)
2627
import WebRow.Forms.Payload (fromBody)
2728
import WebRow.Forms.Uni (default, validate) as Forms.Uni
29+
import WebRow.Forms.Validators (InvalidEmailFormat)
2830
import WebRow.HTTP (methodNotAllowed', method, redirect)
2931
import WebRow.Routing (fromRelativeUrl)
3032
import WebRow.Routing (printRoute) as Routing
@@ -34,14 +36,15 @@ import WebRow.Types (WebRow)
3436

3537
type AuthRow messages routes session user eff
3638
= ( WebRow
37-
( authFailed AuthPayload
38-
, invalidEmailFormat String
39-
, missingValue Unit
40-
| messages
39+
( MissingValue
40+
+ InvalidEmailFormat
41+
+ ( authFailed AuthPayload
42+
| messages
43+
)
4144
)
4245
{ user Maybe (User user) | session }
4346
(RouteRow + routes)
44-
+ Auth user
47+
+ AUTH user
4548
+ eff
4649
)
4750

src/WebRow/Applets/Auth/Effects.purs

+11-12
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,21 @@
11
module WebRow.Applets.Auth.Effects where
22

33
import Prelude
4+
45
import Data.Maybe (Maybe)
5-
import Run (FProxy, Run)
6+
import Run (Run)
67
import Run (lift) as Run
8+
import Type.Row (type (+))
79
import WebRow.Applets.Auth.Types (Password, _auth)
810
import WebRow.Mailer (Email)
911

10-
data AuthF user a
12+
data Auth user a
1113
= Authenticate Email Password (Maybe (User user) a)
1214

13-
derive instance functorAuthFFunctor (AuthF user)
14-
15-
type AUTH user
16-
= FProxy (AuthF user)
15+
derive instance functorAuthFunctor (Auth user)
1716

18-
type Auth user r
19-
= ( auth AUTH user | r )
17+
type AUTH user r
18+
= ( auth Auth user | r )
2019

2120
type User user
2221
= { email Email | user }
@@ -25,16 +24,16 @@ authenticate ∷
2524
eff user.
2625
Email
2726
Password
28-
Run ( auth AUTH user | eff ) (Maybe (User user))
27+
Run ( AUTH user + eff ) (Maybe (User user))
2928
authenticate email password = Run.lift _auth (Authenticate email password identity)
3029

31-
-- data AuthF user a
30+
-- data Auth user a
3231
-- = CurrentUser (Maybe (User user) → a)
3332
-- | CheckPassword Email Password (Boolean → a)
3433
--
35-
-- derive instance functorAuthF ∷ Functor (AuthF user)
34+
-- derive instance functorAuth ∷ Functor (Auth user)
3635
--
37-
-- type AUTH user = FProxy (AuthF user)
36+
-- type AUTH user = Proxy (Auth user)
3837
--
3938
-- currentUser ∷ ∀ eff user. Run ( auth ∷ AUTH user | eff ) (Maybe (User user))
4039
-- currentUser = Run.lift _auth (CurrentUser identity)

src/WebRow/Applets/Auth/Forms.purs

+9-10
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,22 @@ import Prelude
44

55
import Data.Either (note)
66
import Data.Validation.Semigroup (V(..))
7-
import Data.Variant (Variant)
87
import Polyform.Batteries (Msg, error) as Batteries
98
import Polyform.Batteries.UrlEncoded.Validators (MissingValue)
109
import Polyform.Validator (liftFnMV) as Validator
11-
import Run (Run(..))
12-
import Type.Prelude (SProxy(..))
10+
import Run (Run)
11+
import Type.Prelude (Proxy(..))
1312
import Type.Row (type (+))
14-
import WebRow.Applets.Auth.Effects (Auth, authenticate) as Effects
15-
import WebRow.Applets.Auth.Effects (User)
13+
import WebRow.Applets.Auth.Effects (authenticate) as Effects
14+
import WebRow.Applets.Auth.Effects (User, AUTH)
1615
import WebRow.Applets.Auth.Types (Password(..))
1716
import WebRow.Forms (Uni, Layout) as Forms
1817
import WebRow.Forms.Uni (Builder, build, emailInputBuilder, passwordInputBuilder, sectionValidator) as Uni
1918
import WebRow.Forms.Validators (InvalidEmailFormat)
2019
import WebRow.Forms.Widgets (TextInput)
2120
import WebRow.Mailer (Email)
2221

23-
_authFailed = SProxy SProxy "authFailed"
22+
_authFailed = Proxy Proxy "authFailed"
2423

2524
type Msg = Batteries.Msg (AuthFailed + MissingValue + InvalidEmailFormat + ())
2625

@@ -37,9 +36,9 @@ type AuthFailed r
3736
= ( authFailed AuthPayload | r )
3837

3938
loginForm ::
40-
forall eff errs user.
39+
forall eff user.
4140
Forms.Uni
42-
(Run (Effects.Auth user + eff))
41+
(Run (AUTH user + eff))
4342
Msg
4443
(TextInput () + ())
4544
(User user)
@@ -49,9 +48,9 @@ loginForm =
4948
<<< ({ email: _, password: _ } <$> emailFormBuilder <*> passwordFormBuilder)
5049
where
5150
autheticateBuilder
52-
errs' widgets'.
51+
widgets'.
5352
Uni.Builder
54-
(Run (Effects.Auth user + eff))
53+
(Run (AUTH user + eff))
5554
Msg
5655
-- (AuthFailed + errs')
5756
widgets'

0 commit comments

Comments
 (0)