diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..9cb89fa --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,31 @@ +name: CI + +on: + - push + - pull_request + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - uses: purescript-contrib/setup-purescript@main + + - uses: actions/setup-node@v1 + with: + node-version: "12" + + - name: Install dependencies + run: | + npm install -g bower + npm install + bower install --production + + - name: Build source + run: npm run-script build + + - name: Run tests + run: | + bower install + npm run-script test --if-present diff --git a/.gitignore b/.gitignore index 307f9c0..f97581b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,6 @@ /.* !/.gitignore -!/.travis.yml +!/.github /bower_components/ /node_modules/ /output/ diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 7f150a3..0000000 --- a/.travis.yml +++ /dev/null @@ -1,17 +0,0 @@ -language: node_js -dist: trusty -sudo: required -node_js: stable -install: - - npm install -g bower - - npm install - - bower install --production -script: - - npm run -s build - - bower install - - npm -s test -after_success: -- >- - test $TRAVIS_TAG && - echo $GITHUB_TOKEN | pulp login && - echo y | pulp publish --no-push diff --git a/bower.json b/bower.json index 45356ff..a74275d 100644 --- a/bower.json +++ b/bower.json @@ -3,7 +3,7 @@ "license": "Apache-2.0", "repository": { "type": "git", - "url": "git://github.com/slamdata/purescript-ejson.git" + "url": "https://github.com/slamdata/purescript-ejson.git" }, "ignore": [ "**/.*", @@ -15,16 +15,16 @@ "package.json" ], "dependencies": { - "purescript-ordered-collections": "^1.0.0", - "purescript-matryoshka": "^0.4.0", - "purescript-bifunctors": "^4.0.0", - "purescript-newtype": "^3.0.0", - "purescript-parsing": "^5.0.1", - "purescript-precise": "^4.0.0", - "purescript-profunctor-lenses": "^6.0.0", - "purescript-datetime": "^4.0.0" + "purescript-ordered-collections": "^2.0.1", + "purescript-matryoshka": "^0.5.0", + "purescript-bifunctors": "^5.0.0", + "purescript-newtype": "^4.0.0", + "purescript-parsing": "^6.0.1", + "purescript-precise": "^5.0.0", + "purescript-profunctor-lenses": "^7.0.0", + "purescript-datetime": "^5.0.2" }, "devDependencies": { - "purescript-quickcheck": "^6.0.0" + "purescript-quickcheck": "^7.0.0" } } diff --git a/package.json b/package.json index e5d7953..cda102b 100644 --- a/package.json +++ b/package.json @@ -6,9 +6,9 @@ "test": "pulp test" }, "devDependencies": { - "pulp": "^12.0.0", - "purescript": "^0.12.0", - "purescript-psa": "^0.6.0", - "rimraf": "^2.6.1" + "pulp": "^15.0.0", + "purescript": "^0.14.1", + "purescript-psa": "^0.8.2", + "rimraf": "^3.0.2" } } diff --git a/src/Data/Json/Extended/Cursor.purs b/src/Data/Json/Extended/Cursor.purs index 312ddf6..474059b 100644 --- a/src/Data/Json/Extended/Cursor.purs +++ b/src/Data/Json/Extended/Cursor.purs @@ -5,7 +5,7 @@ import Prelude import Data.Array as A import Data.Bifunctor (lmap) import Data.Eq (class Eq1) -import Data.Foldable (class Foldable) +import Data.Foldable (class Foldable, lookup) import Data.Functor.Mu (Mu) import Data.Json.Extended (EJson) import Data.Json.Extended as EJ @@ -13,8 +13,7 @@ import Data.Maybe (Maybe(..), maybe) import Data.Ord (class Ord1) import Data.TacitString (TacitString) import Data.Traversable (class Traversable, traverse) -import Data.Tuple (Tuple(..), lookup) - +import Data.Tuple (Tuple(..)) import Matryoshka (Algebra, cata, project, embed) -- | A cursor to a location in an EJson value. diff --git a/src/Data/Json/Extended/Signature/Parse.purs b/src/Data/Json/Extended/Signature/Parse.purs index c8967c1..f60735c 100644 --- a/src/Data/Json/Extended/Signature/Parse.purs +++ b/src/Data/Json/Extended/Signature/Parse.purs @@ -110,22 +110,6 @@ parseDigit = , 9 <$ PS.string "9" ] -parse10 ∷ ∀ m. Monad m ⇒ P.ParserT String m Int -parse10 = (tens <$> parseDigit <*> parseDigit) <|> parseDigit - where - tens x y = x * 10 + y - -parse1000 ∷ ∀ m. Monad m ⇒ P.ParserT String m Int -parse1000 - = (thousands <$> parseDigit <*> parseDigit <*> parseDigit <*> parseDigit) - <|> (hundreds <$> parseDigit <*> parseDigit <*> parseDigit) - <|> (tens <$> parseDigit <*> parseDigit) - <|> parseDigit - where - thousands x y z w = x * 1000 + y * 100 + z * 10 + w - hundreds x y z = x * 100 + y * 10 + z - tens x y = x * 10 + y - -- | This is used for parsing both `Int` and `HugeInt` values so has some extra -- | arguments. The `n` value should be 10 in the appropriate type, used to -- | move the place of each digit that is parsed. The `Int -> n` function diff --git a/src/Data/Json/Extended/Signature/Render.purs b/src/Data/Json/Extended/Signature/Render.purs index f0e6cad..f585483 100644 --- a/src/Data/Json/Extended/Signature/Render.purs +++ b/src/Data/Json/Extended/Signature/Render.purs @@ -43,9 +43,6 @@ commaSep = F.intercalate ", " renderPairs ∷ Array (T.Tuple String String) → String renderPairs = commaSep <<< map (\(T.Tuple k v) → k <> ": " <> v) -parens ∷ String → String -parens str = "(" <> str <> ")" - squares ∷ String → String squares str = "[" <> str <> "]"