generated from tpl/purs
Upgrade to PureScript 0.15, remove Bower related code
This commit is contained in:
parent
904acc2f6f
commit
cd4833a324
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,5 +1,4 @@
|
||||
/.spago
|
||||
/bower_components
|
||||
/generated-docs
|
||||
/node_modules
|
||||
/output
|
||||
|
25
bower.json
25
bower.json
@ -1,25 +0,0 @@
|
||||
{
|
||||
"name": "purescript-yaml-next",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/archaeron/purescript-yaml-next"
|
||||
},
|
||||
"ignore": [
|
||||
"**/.*",
|
||||
"node_modules",
|
||||
"bower_components",
|
||||
"output"
|
||||
],
|
||||
"dependencies": {
|
||||
"purescript-argonaut-codecs": "^v8.0.0",
|
||||
"purescript-argonaut-core": "^v6.0.0",
|
||||
"purescript-effect": "^v3.0.0",
|
||||
"purescript-foreign": "^v6.0.0",
|
||||
"purescript-functions": "^v5.0.0",
|
||||
"purescript-ordered-collections": "^v2.0.0",
|
||||
"purescript-unsafe-coerce": "^v5.0.0"
|
||||
}
|
||||
}
|
3986
package-lock.json
generated
3986
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -8,6 +8,10 @@
|
||||
"postinstall": "spago build"
|
||||
},
|
||||
"dependencies": {
|
||||
"js-yaml": "^4.0.0"
|
||||
"js-yaml": "^4.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"purescript": "^0.15.0",
|
||||
"spago": "^0.20.9"
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
let upstream =
|
||||
https://github.com/purescript/package-sets/releases/download/psc-0.14.0-20210317/packages.dhall sha256:e2e744972f9b60188dcf07f41418661b505c9ee2e9f91e57e67daefad3a5ae09
|
||||
https://github.com/purescript/package-sets/releases/download/psc-0.15.0-20220513/packages.dhall
|
||||
sha256:1ed784f37ae6131d99acd542d058d5ce39954ccaacc3adba5cc7cf1549d2bffa
|
||||
|
||||
let overrides = {=}
|
||||
|
||||
|
@ -1,11 +1,10 @@
|
||||
"use strict";
|
||||
import yaml from 'js-yaml'
|
||||
|
||||
var yaml = require('js-yaml');
|
||||
|
||||
exports.parseYAMLImpl = function(left, right, str) {
|
||||
export function parseYAMLImpl (left, right, str) {
|
||||
try {
|
||||
return right(yaml.load(str));
|
||||
} catch (e) {
|
||||
return left(e.toString());
|
||||
return right(yaml.load(str))
|
||||
}
|
||||
catch (e) {
|
||||
return left(e.toString())
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -1,18 +1,18 @@
|
||||
"use strict";
|
||||
import yaml from 'js-yaml'
|
||||
|
||||
var yaml = require('js-yaml');
|
||||
export const jsNull = null
|
||||
|
||||
exports.jsNull = null;
|
||||
export function objToHash (valueToYAMLImpl, fst, snd, obj) {
|
||||
const hash = {}
|
||||
|
||||
exports.objToHash = function(valueToYAMLImpl, fst, snd, obj) {
|
||||
var hash = {};
|
||||
for(var i = 0; i < obj.length; i++) {
|
||||
hash[fst(obj[i])] = valueToYAMLImpl(snd(obj[i]));
|
||||
for(let i = 0; i < obj.length; i++) {
|
||||
hash[fst(obj[i])] = valueToYAMLImpl(snd(obj[i]))
|
||||
}
|
||||
return hash;
|
||||
};
|
||||
|
||||
exports.toYAMLImpl = function(a) {
|
||||
return hash
|
||||
}
|
||||
|
||||
export function toYAMLImpl (a) {
|
||||
// noCompatMode does not support YAML 1.1
|
||||
return yaml.dump(a, {noCompatMode : true});
|
||||
return yaml.dump(a, {noCompatMode : true})
|
||||
}
|
||||
|
12
test.dhall
12
test.dhall
@ -2,5 +2,15 @@ let conf = ./spago.dhall
|
||||
|
||||
in conf // {
|
||||
sources = conf.sources # [ "test/**/*.purs" ],
|
||||
dependencies = conf.dependencies # [ "console", "psci-support", "spec" ]
|
||||
dependencies = conf.dependencies # [
|
||||
, "spec"
|
||||
, "aff"
|
||||
, "arrays"
|
||||
, "either"
|
||||
, "lists"
|
||||
, "maybe"
|
||||
, "prelude"
|
||||
, "transformers"
|
||||
, "tuples"
|
||||
]
|
||||
}
|
||||
|
@ -104,7 +104,7 @@ Y: 1
|
||||
|
||||
yamlToData :: forall a. (DecodeJson a) => String -> Either String a
|
||||
yamlToData s = case runExcept $ parseYAMLToJson s of
|
||||
Left err -> Left "Could not parse YAML"
|
||||
Left _ -> Left "Could not parse YAML"
|
||||
Right json -> case decodeJson json of
|
||||
Left error -> Left $ printJsonDecodeError error
|
||||
Right value -> Right value
|
||||
|
Loading…
Reference in New Issue
Block a user