Skip to content

Commit

Permalink
Use spago instead of bower
Browse files Browse the repository at this point in the history
  • Loading branch information
rnons committed Sep 6, 2020
1 parent c74dc0d commit 6d2a644
Show file tree
Hide file tree
Showing 9 changed files with 55 additions and 47 deletions.
6 changes: 3 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ jobs:

- restore_cache:
keys:
- deps-{{ checksum "bower.json" }}-{{ checksum "package.json" }}
- deps-{{ checksum "packages.dhall" }}-{{ checksum "package.json" }}

- run:
command: |
yarn add --dev bower purescript pulp
yarn add --dev purescript spago
yarn
yarn build
git checkout -- package.json
Expand All @@ -23,7 +23,7 @@ jobs:
- node_modules
- bower_components
- output
key: deps-{{ checksum "bower.json" }}-{{ checksum "package.json" }}
key: deps-{{ checksum "packages.dhall" }}-{{ checksum "package.json" }}

- run:
command: yarn jest
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@ yarn.lock

.psc-ide-port
.psci_modules
.purs-repl
.spago
output
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# purescript-nonbili

Prelude and helper modules shared by nonbili packages.

## Development

```
yarn
spago build -w
yarn jest
```
38 changes: 0 additions & 38 deletions bower.json

This file was deleted.

5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@
"private": true,
"license": "BSD-3-Clause",
"scripts": {
"build": "pulp build -I test -- +RTS -N2 -RTS",
"postinstall": "bower install",
"test": "pulp build -I test && jest"
"build": "spago build -u '+RTS -N2 -RTS'",
"test": "spago build && jest"
},
"devDependencies": {
"jest": "^24.0.0"
Expand Down
7 changes: 7 additions & 0 deletions packages.dhall
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
let upstream =
https://github.com/purescript/package-sets/releases/download/psc-0.13.8-20200831/packages.dhall sha256:cdb3529cac2cd8dd780f07c80fd907d5faceae7decfcaa11a12037df68812c83

let nonbili =
https://github.com/nonbili/package-sets/releases/download/v0.7/packages.dhall sha256:b09c8d62a7a1e04fd150d32d80f575c0f1e6d82f2dc2a763eb4271cdb61a154d

in upstream // nonbili
27 changes: 27 additions & 0 deletions spago.dhall
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{-
Welcome to a Spago project!
You can edit this file as you like.
-}
{ name = "nonbili"
, dependencies =
[ "aff"
, "argonaut-codecs"
, "arrays"
, "call-by-name"
, "console"
, "const"
, "debug"
, "effect"
, "either"
, "jest"
, "js-date"
, "prelude"
, "psci-support"
, "quickcheck"
, "strings"
, "transformers"
, "tuples"
]
, packages = ./packages.dhall
, sources = [ "src/**/*.purs", "test/**/*.purs" ]
}
4 changes: 2 additions & 2 deletions src/Nonbili/DateTime.purs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module Nonbili.DateTime
import Nonbili.Prelude

import Data.Argonaut.Core as A
import Data.Argonaut.Decode (class DecodeJson)
import Data.Argonaut.Decode (class DecodeJson, JsonDecodeError(..))
import Data.Argonaut.Encode (class EncodeJson)
import Data.JSDate (JSDate)
import Data.JSDate as JSDate
Expand All @@ -23,7 +23,7 @@ derive instance ordDateTime :: Ord DateTime

instance decodeJsonDateTime :: DecodeJson DateTime where
decodeJson json =
note "Invalid date" $ (A.toString json >>= read)
note (UnexpectedValue json) $ (A.toString json >>= read)

instance encodeJsonDateTime :: EncodeJson DateTime where
encodeJson (DateTime date) =
Expand Down
2 changes: 1 addition & 1 deletion test/Nonbili/String.purs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ spec :: Effect Unit
spec = do
test "padStart" $ do
let re = unsafeRegex "^0+$" RegexFlags.noFlags
quickCheck \n s -> do
liftEffect $ quickCheck \n s -> do
let
lengthDiff = n - String.length s
{ before, after } = String.splitAt lengthDiff $ padStart n s
Expand Down

0 comments on commit 6d2a644

Please sign in to comment.