Upgrade to PureScript 0.15, remove Bower related code

This commit is contained in:
Adrian Sieber 2022-05-14 15:47:44 +00:00
parent 904acc2f6f
commit cd4833a324
No known key found for this signature in database
GPG Key ID: 15985EE18DE6224B
9 changed files with 4015 additions and 59 deletions

1
.gitignore vendored
View File

@ -1,5 +1,4 @@
/.spago
/bower_components
/generated-docs
/node_modules
/output

View File

@ -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

File diff suppressed because it is too large Load Diff

View File

@ -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"
}
}

View File

@ -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 = {=}

View File

@ -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())
}
}
};

View File

@ -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})
}

View File

@ -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"
]
}

View File

@ -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