From d477e83bfcff0af65ff61e847acb1044c83f6694 Mon Sep 17 00:00:00 2001 From: Adrian Sieber Date: Sat, 20 Mar 2021 11:13:39 +0000 Subject: [PATCH] Clean up package.json and README.md --- README.md | 47 +++++++++++++++++++---------------------------- package.json | 7 ++----- 2 files changed, 21 insertions(+), 33 deletions(-) diff --git a/README.md b/README.md index 532c686..68a43f1 100644 --- a/README.md +++ b/README.md @@ -2,23 +2,10 @@ ## Install -First install [js-yaml](https://github.com/connec/yaml-js). Note, purescript-yaml is not compatible with YAML 1.1. - ``` -npm install js-yaml@^3.4.6 +spago install yaml-next ``` -Then add purescript-yaml-next as a project dependency. - -``` -bower install --save purescript-yaml-next -``` - -Alternatively, you can add the repo itself as a project dependency, e.g. - -``` -bower install --save git://github.com/archaeron/purescript-yaml#tagOrBranch -``` ## YAML to Data Type Usage @@ -35,10 +22,14 @@ Y: 1 ``` We can read a `Point` from the YAML by converting the YAML into JSON -and then using [purescript-argonaut](https://github.com/purescript-contrib/purescript-argonaut)'s encoding functionality to get the -type we need (specifically, [purescript-argonaut-codecs](https://github.com/purescript-contrib/purescript-argonaut-codecs) +and then using [purescript-argonaut]'s encoding functionality to get the +type we need (specifically, [purescript-argonaut-codecs] functionality). +[purescript-argonaut]: https://github.com/purescript-contrib/purescript-argonaut +[purescript-argonaut-codecs]: + https://github.com/purescript-contrib/purescript-argonaut-codecs + ```purescript getPoint :: Either String Point getPoint = case runExcept $ parseYAMLToJson yamlPoint of @@ -69,7 +60,7 @@ data YValue | YNull ``` -To convert data into a aYValue, create instances of the ToYAML class for your +To convert data into a `YValue`, create instances of the `ToYAML` class for your data types. ```purescript @@ -91,32 +82,32 @@ instance pointToYAML :: ToYAML Point where ``` You can find helper functions for converting basic types into `YValue` -in the Data.YAML.Foreign.Encode module. +in the `Data.YAML.Foreign.Encode` module. Finally, if you want to convert `YValue` into a String, you can use the -`printYAML` function from Data.YAML.Foreign.Encode. +`printYAML` function from `Data.YAML.Foreign.Encode`. ```purescript printYAML :: forall a. (ToYAML a) => a -> String ``` + ## Summary -Using the previous code and the type classes we defined earlier, we can go -full circle from a YAML string to a PureScript Data Type and back to a YAML string. +Using the previous code and the type classes we defined earlier, +we can go full circle from a YAML string to a PureScript Data Type +and back to a YAML string. ```purescript fullCircle :: String -> Either String String fullCircle yamlString = (readPoint yamlString) >>= pure <<< printYAML ``` + ## Contributing -Check out the repo and make changes. You can run/add tests by running pulp test. - -``` -bower install -npm install -pulp test -``` +1. Check out the repo +1. Run `npm install` +1. Make changes +1. Test them by running `npm test` diff --git a/package.json b/package.json index 06ab484..62c521f 100644 --- a/package.json +++ b/package.json @@ -1,15 +1,12 @@ { "name": "purescript-yaml-next", - "license": "SEE LICENSE FILE", - "repository": "https://github.com/archaeron/purescript-yaml", + "license": "MIT", + "repository": "https://github.com/archaeron/purescript-yaml-next", "private": true, - "contributors": [], - "main": "main.js", "scripts": { "test": "spago -x test.dhall test", "postinstall": "spago build" }, - "devDependencies": {}, "dependencies": { "js-yaml": "^4.0.0" }