arcanis / clipanion

Type-safe CLI library / framework with no runtime dependencies
https://mael.dev/clipanion/
1.12k stars 66 forks source link

Clipanion 2 Yup Validation Context #61

Open elmpp opened 3 years ago

elmpp commented 3 years ago

It'd be nice if the Clipanion context could be supplied as a Yup validate context so that we could have additional abilities in .when conditions. My use case is to validate based on the user's cwd

Of course this is Clipanion 2. Would you accept a PR (with tests haha)?

arcanis commented 3 years ago

Actually we don't use Yup anymore in Clipanion 2 (still in dev)! The integration is now with Typanion, a sibling library of mine 🙂

That said, I'm not sure how it would work with passing a context, since this concept doesn't really exist in Typanion 🤔

elmpp commented 3 years ago

Feels a pretty natural fit what with Clipanion's Context already typed and available. I'll leave this open as a reminder perhaps