From 06d897e66e9c9ba20f8941bc34737f030686fb02 Mon Sep 17 00:00:00 2001 From: Adrian Sieber Date: Sat, 19 Oct 2019 21:13:45 +0000 Subject: [PATCH] Use Spago instead of Bower for dependency management --- .gitignore | 4 +--- bower.json | 28 ---------------------------- package-lock.json | 12 ++++++------ package.json | 7 +++---- packages.dhall | 8 ++++++++ spago.dhall | 20 ++++++++++++++++++++ src/Data/YAML/Foreign/Decode.purs | 3 +-- test/Instances.purs | 2 +- test/Main.purs | 10 ++++++---- 9 files changed, 46 insertions(+), 48 deletions(-) delete mode 100644 bower.json create mode 100644 packages.dhall create mode 100644 spago.dhall diff --git a/.gitignore b/.gitignore index e6bbe53..97ec975 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,5 @@ -/bower_components/ /node_modules/ /output/ -/.psci* /src/.webpack.js -.pulp-cache/ .psc-ide-port +/.spago diff --git a/bower.json b/bower.json deleted file mode 100644 index a7d4645..0000000 --- a/bower.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "name": "purescript-yaml-next", - "moduleType": [ - "node" - ], - "ignore": [ - "**/.*", - "node_modules", - "bower_components", - "output", - "test", - "docs" - ], - "dependencies": { - "js-yaml": "^3.4.6", - "purescript-argonaut-core": "^4.0.1", - "purescript-foreign": "^5.0.0", - "purescript-foreign-generic": "^7.0.0", - "purescript-functions": "^4.0.0", - "purescript-ordered-collections": "^1.1.0", - "purescript-unsafe-coerce": "^4.0.0" - }, - "devDependencies": { - "purescript-argonaut-codecs": "^4.0.2", - "purescript-console": "^4.1.0", - "purescript-spec": "^3.0.0" - } -} diff --git a/package-lock.json b/package-lock.json index a5a1e3a..4a1ed1e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,7 +8,7 @@ "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", "requires": { - "sprintf-js": "1.0.3" + "sprintf-js": "~1.0.2" } }, "esprima": { @@ -17,12 +17,12 @@ "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==" }, "js-yaml": { - "version": "3.12.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.12.0.tgz", - "integrity": "sha512-PIt2cnwmPfL4hKNwqeiuz4bKfnzHTBv6HyVgjahA6mPLwPDzjDWrplJBMjHUFxku/N3FlmrbyPclad+I+4mJ3A==", + "version": "3.13.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", + "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", "requires": { - "argparse": "1.0.10", - "esprima": "4.0.1" + "argparse": "^1.0.7", + "esprima": "^4.0.0" } }, "sprintf-js": { diff --git a/package.json b/package.json index db97dbd..e72debd 100644 --- a/package.json +++ b/package.json @@ -1,16 +1,15 @@ { "name": "purescript-yaml-next", "license": "SEE LICENSE FILE", - "repository": "", + "repository": "https://github.com/archaeron/purescript-yaml", "private": true, "contributors": [], "main": "main.js", "scripts": { - "postinstall": "bower install", - "build": "pulp build" + "postinstall": "spago build" }, "devDependencies": {}, "dependencies": { - "js-yaml": "^3.12.0" + "js-yaml": "^3.13.1" } } diff --git a/packages.dhall b/packages.dhall new file mode 100644 index 0000000..f5795de --- /dev/null +++ b/packages.dhall @@ -0,0 +1,8 @@ +let upstream = + https://github.com/purescript/package-sets/releases/download/psc-0.13.3-20191005/packages.dhall sha256:ba287d858ada09c4164792ad4e643013b742c208cbedf5de2e35ee27b64b6817 + +let overrides = {=} + +let additions = {=} + +in upstream // overrides // additions diff --git a/spago.dhall b/spago.dhall new file mode 100644 index 0000000..0dc8780 --- /dev/null +++ b/spago.dhall @@ -0,0 +1,20 @@ +{ name = + "yaml-next" +, dependencies = + [ "argonaut-codecs" + , "argonaut-core" + , "console" + , "effect" + , "foreign" + , "foreign-generic" + , "functions" + , "ordered-collections" + , "psci-support" + , "spec" + , "unsafe-coerce" + ] +, packages = + ./packages.dhall +, sources = + [ "src/**/*.purs", "test/**/*.purs" ] +} diff --git a/src/Data/YAML/Foreign/Decode.purs b/src/Data/YAML/Foreign/Decode.purs index ec0a88a..8483716 100644 --- a/src/Data/YAML/Foreign/Decode.purs +++ b/src/Data/YAML/Foreign/Decode.purs @@ -5,8 +5,7 @@ module Data.YAML.Foreign.Decode ( import Foreign (F, Foreign, ForeignError(..), fail) import Foreign.Generic (genericDecode) -import Foreign.Generic.Class (class GenericDecode) -import Foreign.Generic.Types (Options) +import Foreign.Generic.Class (class GenericDecode, Options) import Data.Function.Uncurried (Fn3, runFn3) import Data.Generic.Rep (class Generic) import Prelude ((>=>), (<<<), pure, (>>=)) diff --git a/test/Instances.purs b/test/Instances.purs index 0d8f5c2..b4d0ba4 100644 --- a/test/Instances.purs +++ b/test/Instances.purs @@ -2,7 +2,7 @@ module Test.Instances where import Data.YAML.Foreign.Encode import Data.Argonaut.Core (toObject, toString) -import Data.Argonaut.Decode (getField) +import Data.Argonaut.Decode.Combinators (getField) import Data.Argonaut.Decode.Class (class DecodeJson) import Data.Either (Either(..)) import Data.Generic.Rep (class Generic) diff --git a/test/Main.purs b/test/Main.purs index a107dcb..e3d0d9a 100644 --- a/test/Main.purs +++ b/test/Main.purs @@ -1,19 +1,21 @@ module Test.Main where -import Data.Map as Map import Control.Monad.Except (runExcept) import Data.Argonaut.Decode (class DecodeJson, decodeJson) import Data.Either (Either(..)) import Data.Map (Map) +import Data.Map as Map import Data.YAML.Foreign.Decode (parseYAMLToJson) import Data.YAML.Foreign.Encode (printYAML) -import Effect +import Effect (Effect) +import Effect.Aff (launchAff_) import Prelude (Unit, discard, pure, ($), (<<<), (>>=)) import Test.Instances (GeoObject(..), Mobility(..), Point(..)) import Test.Spec (describe, it) import Test.Spec.Assertions (shouldEqual) import Test.Spec.Reporter.Console (consoleReporter) -import Test.Spec.Runner (run) +import Test.Spec.Runner (runSpec) + yamlInput :: String yamlInput = """ @@ -134,7 +136,7 @@ fullCircle :: String -> Either String String fullCircle yamlString = (readPoint yamlString) >>= pure <<< printYAML main :: Effect Unit -main = run [consoleReporter] do +main = launchAff_ $ runSpec [consoleReporter] do describe "purescript-yaml" do describe "decode" do it "Decodes YAML" do