Skip to content

Commit ec85010

Browse files
authored
Use spago for client's PS dependencies (#147)
Fixes #145
1 parent e51fcb4 commit ec85010

File tree

6 files changed

+192
-73
lines changed

6 files changed

+192
-73
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ Most of these features can be controlled not only from the toolbar, but also usi
4646
git clone [email protected]:purescript/trypurescript.git
4747
cd trypurescript/client
4848

49-
bower install
5049
npm install
5150
npm run build
5251
npm run bundle

client/.gitignore

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
1-
/bower_components/
21
/node_modules/
3-
/.pulp-cache/
42
/package-lock.json
53
/output/
64
/generated-docs/
7-
/.psc-package/
85
/.psc*
96
/.purs*
107
/.psa*
118
/.stack*
129
/js/index.js
13-
10+
.spago/

client/bower.json

Lines changed: 0 additions & 62 deletions
This file was deleted.

client/package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
{
22
"private": true,
33
"scripts": {
4-
"clean": "rimraf output && rimraf .pulp-cache",
5-
"build": "pulp build -- --censor-lib --strict",
6-
"bundle": "pulp build -O --to js/index.js"
4+
"clean": "rimraf output",
5+
"build": "spago build --purs-args '--censor-lib --strict'",
6+
"bundle": "spago bundle-app --to js/index.js"
77
},
88
"devDependencies": {
9-
"pulp": "^13.0.0",
10-
"purescript-psa": "^0.7.3",
119
"purescript": "^0.13.6",
12-
"rimraf": "^2.5.4"
10+
"purescript-psa": "^0.7.3",
11+
"rimraf": "^2.5.4",
12+
"spago": "^0.14.0"
1313
}
1414
}

client/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.6-20200404/packages.dhall sha256:f239f2e215d0cbd5c203307701748581938f74c4c78f4aeffa32c11c131ef7b6
123+
124+
let overrides = {=}
125+
126+
let additions = {=}
127+
128+
in upstream // overrides // additions

client/spago.dhall

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
{-
2+
Welcome to a Spago project!
3+
You can edit this file as you like.
4+
-}
5+
{ name = "try-purescript"
6+
, dependencies =
7+
[ "arrays"
8+
, "bifunctors"
9+
, "console"
10+
, "const"
11+
, "contravariant"
12+
, "control"
13+
, "distributive"
14+
, "effect"
15+
, "either"
16+
, "enums"
17+
, "exceptions"
18+
, "exists"
19+
, "foldable-traversable"
20+
, "foreign"
21+
, "foreign-generic"
22+
, "foreign-object"
23+
, "free"
24+
, "functions"
25+
, "functors"
26+
, "generics-rep"
27+
, "globals"
28+
, "identity"
29+
, "integers"
30+
, "jquery"
31+
, "js-timers"
32+
, "lazy"
33+
, "math"
34+
, "maybe"
35+
, "ordered-collections"
36+
, "parallel"
37+
, "prelude"
38+
, "profunctor"
39+
, "proxy"
40+
, "psci-support"
41+
, "quickcheck"
42+
, "random"
43+
, "refs"
44+
, "semirings"
45+
, "st"
46+
, "strings"
47+
, "tailrec"
48+
, "transformers"
49+
, "tuples"
50+
, "typelevel-prelude"
51+
, "unfoldable"
52+
, "validation"
53+
, "web-html"
54+
]
55+
, packages = ./packages.dhall
56+
, sources = [ "src/**/*.purs" ]
57+
}

0 commit comments

Comments
 (0)