purescript-contrib / purescript-pathy

A type-safe abstraction for platform-independent file system paths.
Apache License 2.0
33 stars 17 forks source link

feat: use Variant, 5 more parsers + spago.yaml #52

Open srghma opened 2 weeks ago

srghma commented 2 weeks ago

Description of the change

parse Either variants


Checklist:

garyb commented 2 weeks ago

Why switch to Variant? It's not obvious to me that it'd have better ergonomics in this case. Do you have an example where you think it's better?

srghma commented 2 weeks ago

@garyb

So, I wanted to parse Path any any I see there is type AnyPath a = Either (Path a Dir) (Path a File)

... well, I need type AnyAnyPath = Path Rel Dir /\ Path Abs Dir /\ Path Rel File /\ Path Abs File

so, I thought, better to use variant

PLUS, custom parsers, e.g. Path Rel Dir /\ Path Abs Dir /\ Path Rel File

garyb commented 1 week ago

Ah I see, yeah I guess that does make sense!

garyb commented 1 week ago

Not sure what the deal is with the npm issue now 🤨, I'm still mostly not using spago so I don't know if that's a known thing/there's a workaround.

srghma commented 1 week ago

https://stackoverflow.com/a/46384631/3574379

https://github.com/purescript-contrib/setup-purescript/blob/0bbf7c38ed9c1125e801509e3219b4e146a6c187/action.yml#L18


https://github.com/actions/setup-node?tab=readme-ov-file

The action defaults to search for the dependency file (package-lock.json, npm-shrinkwrap.json or yarn.lock) in the repository root, and uses its hash as a part of the cache key

maybe they dont say it, but they cache global node_modules too

and I need to remove to reinstall

srghma commented 1 week ago

can I become a member of contrib? do I need to do sm special activities?

Everyone is welcome! People of all experience levels can join, begin contributing

lenient) awesome) I want)

garyb commented 1 week ago

I sent an invite 🙂

jamesdbrock commented 1 week ago

If you are going to make pathy depend on https://github.com/natefaubion/purescript-variant , @srghma , then you should consider talking to Nate Faubion about moving variant to purescript-contrib. The packages in purescript-contrib should depend only on core libs and other purescript-contrib packages, and not on stuff in people’s personal accounts ( as @garyb once explained to me.)