generated from tpl/purs
feat: impl ToYAML for YValue, migrate to spago@next, bun, asdf
This commit is contained in:
parent
cd4833a324
commit
30b219d237
8
.prettierrc.cjs
Normal file
8
.prettierrc.cjs
Normal file
@ -0,0 +1,8 @@
|
||||
module.exports = {
|
||||
tabWidth: 2,
|
||||
trailingComma: 'all',
|
||||
singleQuote: true,
|
||||
semi: false,
|
||||
arrowParens: 'avoid',
|
||||
plugins: [],
|
||||
}
|
1
.psc-ide-port
Normal file
1
.psc-ide-port
Normal file
@ -0,0 +1 @@
|
||||
15163
|
3
.tool-versions
Normal file
3
.tool-versions
Normal file
@ -0,0 +1,3 @@
|
||||
bun 1.0.11
|
||||
purescript 0.15.12
|
||||
nodejs 20.9.0
|
27
bun/fmt.js
Normal file
27
bun/fmt.js
Normal file
@ -0,0 +1,27 @@
|
||||
/** @type {(parser: string, ps: string[]) => import("bun").Subprocess} */
|
||||
const prettier = (parser, ps) =>
|
||||
Bun.spawn(['bun', 'x', 'prettier', '--write', '--parser', parser, ...ps], {
|
||||
stdout: 'inherit',
|
||||
stderr: 'inherit',
|
||||
})
|
||||
|
||||
const procs = [
|
||||
prettier('babel', ['./src/**/*.js', './bun/**/*.js', './.prettierrc.cjs']),
|
||||
prettier('json', ['./package.json', './jsconfig.json']),
|
||||
Bun.spawn(
|
||||
[
|
||||
'bun',
|
||||
'x',
|
||||
'purs-tidy',
|
||||
'format-in-place',
|
||||
'src/**/*.purs',
|
||||
'test/**/*.purs',
|
||||
],
|
||||
{
|
||||
stdout: 'inherit',
|
||||
stderr: 'inherit',
|
||||
},
|
||||
),
|
||||
]
|
||||
|
||||
await Promise.all(procs.map(p => p.exited))
|
16
jsconfig.json
Normal file
16
jsconfig.json
Normal file
@ -0,0 +1,16 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"types": ["bun-types"],
|
||||
"lib": ["esnext"],
|
||||
"target": "esnext",
|
||||
"module": "esnext",
|
||||
"moduleResolution": "bundler",
|
||||
"moduleDetection": "force",
|
||||
"jsx": "react",
|
||||
"allowJs": true,
|
||||
"checkJs": true,
|
||||
"noEmit": true,
|
||||
"strict": true
|
||||
},
|
||||
"include": ["src/**/*.js", "bun/**/*.js"]
|
||||
}
|
4014
package-lock.json
generated
4014
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -4,14 +4,16 @@
|
||||
"repository": "https://github.com/archaeron/purescript-yaml-next",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"test": "spago -x test.dhall test",
|
||||
"fmt": "bun bun/fmt.js",
|
||||
"test": "spago test",
|
||||
"postinstall": "spago build"
|
||||
},
|
||||
"dependencies": {
|
||||
"js-yaml": "^4.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"purescript": "^0.15.0",
|
||||
"spago": "^0.20.9"
|
||||
"bun-types": "1.0.11",
|
||||
"purs-tidy": "^0.10.0",
|
||||
"spago": "next"
|
||||
}
|
||||
}
|
||||
|
@ -1,9 +0,0 @@
|
||||
let upstream =
|
||||
https://github.com/purescript/package-sets/releases/download/psc-0.15.0-20220513/packages.dhall
|
||||
sha256:1ed784f37ae6131d99acd542d058d5ce39954ccaacc3adba5cc7cf1549d2bffa
|
||||
|
||||
let overrides = {=}
|
||||
|
||||
let additions = {=}
|
||||
|
||||
in upstream // overrides // additions
|
15
spago.dhall
15
spago.dhall
@ -1,15 +0,0 @@
|
||||
{ name = "yaml-next"
|
||||
, license = "MIT"
|
||||
, repository = "https://github.com/archaeron/purescript-yaml-next"
|
||||
, dependencies =
|
||||
[ "argonaut-codecs"
|
||||
, "argonaut-core"
|
||||
, "effect"
|
||||
, "foreign"
|
||||
, "functions"
|
||||
, "ordered-collections"
|
||||
, "unsafe-coerce"
|
||||
]
|
||||
, packages = ./packages.dhall
|
||||
, sources = [ "src/**/*.purs" ]
|
||||
}
|
19
spago.yaml
Normal file
19
spago.yaml
Normal file
@ -0,0 +1,19 @@
|
||||
package:
|
||||
dependencies:
|
||||
- argonaut-codecs
|
||||
- argonaut-core
|
||||
- effect
|
||||
- foreign
|
||||
- functions
|
||||
- ordered-collections
|
||||
- unsafe-coerce
|
||||
name: yaml-next
|
||||
test:
|
||||
dependencies:
|
||||
- spec
|
||||
main: Test.Main
|
||||
workspace:
|
||||
extra_packages: {}
|
||||
package_set:
|
||||
url: https://raw.githubusercontent.com/purescript/package-sets/psc-0.15.10-20230930/packages.json
|
||||
hash: sha256-nTsd44o7/hrTdk0c6dh0wyBqhFFDJJIeKdQU6L1zv/A=
|
@ -14,7 +14,7 @@ import Data.Function.Uncurried (Fn4, runFn4)
|
||||
import Data.List (List)
|
||||
import Data.Maybe (Maybe, maybe)
|
||||
import Data.Tuple (Tuple(..), fst, snd)
|
||||
import Prelude (class Eq, class Show, map, show, ($), (<>), (==), (<<<))
|
||||
import Prelude (class Eq, class Show, identity, map, show, ($), (<>), (==), (<<<))
|
||||
import Unsafe.Coerce (unsafeCoerce)
|
||||
|
||||
type YObject = M.Map String YValue
|
||||
@ -73,6 +73,9 @@ instance arrayToYAML :: (ToYAML a) => ToYAML (Array a) where
|
||||
instance maybeToYAML :: (ToYAML a) => ToYAML (Maybe a) where
|
||||
toYAML = maybe YNull toYAML
|
||||
|
||||
instance yvalueToYAML :: ToYAML YValue where
|
||||
toYAML = identity
|
||||
|
||||
type Pair = Tuple String YValue
|
||||
|
||||
-- | Helper function to create a key-value tuple for a YAML object.
|
||||
|
16
test.dhall
16
test.dhall
@ -1,16 +0,0 @@
|
||||
let conf = ./spago.dhall
|
||||
|
||||
in conf // {
|
||||
sources = conf.sources # [ "test/**/*.purs" ],
|
||||
dependencies = conf.dependencies # [
|
||||
, "spec"
|
||||
, "aff"
|
||||
, "arrays"
|
||||
, "either"
|
||||
, "lists"
|
||||
, "maybe"
|
||||
, "prelude"
|
||||
, "transformers"
|
||||
, "tuples"
|
||||
]
|
||||
}
|
Loading…
Reference in New Issue
Block a user