Skip to content

Commit 213a2b7

Browse files
authored
Move to spago; update bower dependencies (#20)
1 parent d66b38c commit 213a2b7

File tree

6 files changed

+164
-9
lines changed

6 files changed

+164
-9
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,6 @@ _site/
1717

1818
.jekyll-metadata
1919

20-
scratchpad.*
20+
scratchpad.*
21+
22+
.spago

bower.json

100755100644
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"purescript-aff": "^5.1.0",
1919
"purescript-signal": "^10.1.0",
2020
"purescript-foreign-object": "^2.0.1",
21-
"purescript-argonaut-generic": "^5.0.0"
21+
"purescript-argonaut-generic": "^6.0.0"
2222
},
2323
"devDependencies": {
2424
"purescript-psci-support": "^4.0.0",

packages.dhall

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
{-
2+
Welcome to your new Dhall package-set!
3+
4+
Below are instructions for how to edit this file for most use
5+
cases, so that you don't need to know Dhall to use it.
6+
7+
## Warning: Don't Move This Top-Level Comment!
8+
9+
Due to how `dhall format` currently works, this comment's
10+
instructions cannot appear near corresponding sections below
11+
because `dhall format` will delete the comment. However,
12+
it will not delete a top-level comment like this one.
13+
14+
## Use Cases
15+
16+
Most will want to do one or both of these options:
17+
1. Override/Patch a package's dependency
18+
2. Add a package not already in the default package set
19+
20+
This file will continue to work whether you use one or both options.
21+
Instructions for each option are explained below.
22+
23+
### Overriding/Patching a package
24+
25+
Purpose:
26+
- Change a package's dependency to a newer/older release than the
27+
default package set's release
28+
- Use your own modified version of some dependency that may
29+
include new API, changed API, removed API by
30+
using your custom git repo of the library rather than
31+
the package set's repo
32+
33+
Syntax:
34+
Replace the overrides' "{=}" (an empty record) with the following idea
35+
The "//" or "⫽" means "merge these two records and
36+
when they have the same value, use the one on the right:"
37+
-------------------------------
38+
let overrides =
39+
{ packageName =
40+
upstream.packageName // { updateEntity1 = "new value", updateEntity2 = "new value" }
41+
, packageName =
42+
upstream.packageName // { version = "v4.0.0" }
43+
, packageName =
44+
upstream.packageName // { repo = "https://www.example.com/path/to/new/repo.git" }
45+
}
46+
-------------------------------
47+
48+
Example:
49+
-------------------------------
50+
let overrides =
51+
{ halogen =
52+
upstream.halogen // { version = "master" }
53+
, halogen-vdom =
54+
upstream.halogen-vdom // { version = "v4.0.0" }
55+
}
56+
-------------------------------
57+
58+
### Additions
59+
60+
Purpose:
61+
- Add packages that aren't already included in the default package set
62+
63+
Syntax:
64+
Replace the additions' "{=}" (an empty record) with the following idea:
65+
-------------------------------
66+
let additions =
67+
{ package-name =
68+
{ dependencies =
69+
[ "dependency1"
70+
, "dependency2"
71+
]
72+
, repo =
73+
"https://example.com/path/to/git/repo.git"
74+
, version =
75+
"tag ('v4.0.0') or branch ('master')"
76+
}
77+
, package-name =
78+
{ dependencies =
79+
[ "dependency1"
80+
, "dependency2"
81+
]
82+
, repo =
83+
"https://example.com/path/to/git/repo.git"
84+
, version =
85+
"tag ('v4.0.0') or branch ('master')"
86+
}
87+
, etc.
88+
}
89+
-------------------------------
90+
91+
Example:
92+
-------------------------------
93+
let additions =
94+
{ benchotron =
95+
{ dependencies =
96+
[ "arrays"
97+
, "exists"
98+
, "profunctor"
99+
, "strings"
100+
, "quickcheck"
101+
, "lcg"
102+
, "transformers"
103+
, "foldable-traversable"
104+
, "exceptions"
105+
, "node-fs"
106+
, "node-buffer"
107+
, "node-readline"
108+
, "datetime"
109+
, "now"
110+
]
111+
, repo =
112+
"https://github.com/hdgarrood/purescript-benchotron.git"
113+
, version =
114+
"v7.0.0"
115+
}
116+
}
117+
-------------------------------
118+
-}
119+
120+
121+
let upstream =
122+
https://github.com/purescript/package-sets/releases/download/psc-0.13.8-20200822/packages.dhall sha256:b4f151f1af4c5cb6bf5437489f4231fbdd92792deaf32971e6bcb0047b3dd1f8
123+
124+
let overrides = {=}
125+
126+
let additions = {=}
127+
128+
in upstream // overrides // additions

spago.dhall

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{-
2+
Welcome to a Spago project!
3+
You can edit this file as you like.
4+
-}
5+
{ name = "flame"
6+
, dependencies =
7+
[ "aff"
8+
, "argonaut-codecs"
9+
, "argonaut-generic"
10+
, "console"
11+
, "debug"
12+
, "effect"
13+
, "foreign-object"
14+
, "integers"
15+
, "node-http"
16+
, "nullable"
17+
, "prelude"
18+
, "psci-support"
19+
, "random"
20+
, "record"
21+
, "signal"
22+
, "test-unit"
23+
, "web-events"
24+
, "web-html"
25+
]
26+
, packages = ./packages.dhall
27+
, sources = [ "src/**/*.purs", "test/**/*.purs" ]
28+
}

src/Flame/Application/PreMount.purs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
module Flame.Application.PreMount where
22

3-
import Flame.Types (Html(..), PreApplication)
4-
import Prelude (bind, discard, otherwise, pure, ($), (<<<), (<>), (==))
5-
63
import Control.Monad.Except as CME
74
import Data.Argonaut.Core as DAC
85
import Data.Argonaut.Decode.Generic.Rep (class DecodeRep)
@@ -13,6 +10,7 @@ import Data.Argonaut.Parser as DAP
1310
import Data.Array ((:))
1411
import Data.Array as DA
1512
import Data.Either (Either(..))
13+
import Data.Either as DE
1614
import Data.Generic.Rep (class Generic)
1715
import Data.Maybe (Maybe(..))
1816
import Data.Maybe as DM
@@ -25,7 +23,9 @@ import Flame.Application.DOM as FAD
2523
import Flame.HTML.Attribute as HA
2624
import Flame.HTML.Element as HE
2725
import Flame.Renderer.String as FRS
26+
import Flame.Types (Html(..), PreApplication)
2827
import Partial.Unsafe (unsafePartial)
28+
import Prelude (bind, discard, otherwise, pure, show, ($), (<<<), (<>), (==))
2929
import Web.DOM.ParentNode (QuerySelector(..))
3030

3131
tagSerializedState :: String
@@ -58,7 +58,7 @@ serializedState selector = do
5858
Nothing -> EE.throw $ "Error resuming application mount: serialized state not found!"
5959
where decoding contents = do
6060
json <- DAP.jsonParser contents
61-
DADEGR.genericDecodeJson json
61+
DE.either (Left <<< show) Right $ DADEGR.genericDecodeJson json
6262

6363
preMount :: forall model m message. Generic model m => EncodeRep m => QuerySelector -> PreApplication model message -> Effect String
6464
preMount (QuerySelector selector) application = do

src/Flame/Types.purs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ data Html message =
6161

6262
derive instance elementFunctor :: Functor Html
6363

64-
6564
instance showHtml :: Show (Html message) where
6665
show (Node tag nodeData children) = "(Node " <> tag <> " " <> show (isNonEventData nodeData) <> " " <> show children <> ")"
6766
show (Text t) = "(Text " <> t <> ")"
@@ -72,7 +71,6 @@ instance eqHtml :: Eq (Html message) where
7271
eq (Text t) (Text t2) = t == t2
7372
eq _ _ = false
7473

75-
7674
isNonEventData :: forall t. Array (NodeData t) -> Array (NodeData t)
7775
isNonEventData = DA.filter case _ of
7876
Attribute _ _ -> true
@@ -99,6 +97,5 @@ instance eqNodeData :: Eq (NodeData message) where
9997
eq (Property name val) (Property name2 val2) = name == name2 && val == val2
10098
eq _ _ = false
10199

102-
103100
-- | Infix tuple constructor
104101
infixr 6 Tuple as :>

0 commit comments

Comments
 (0)