From five optional fields to a discriminated union: CLI parsing with Optique 1.0
3 points by hongminhee
3 points by hongminhee
I'm unfamiliar with the Typescript ecosystem. Is it common to define implementation first and have the resulting type fall out like is done in this library?
Also, I'm glad you've addressed the multiple sources of truth. A project I worked on had some problems that arose out of config values coming from a manually specified file, a project-level file, a global file, and baked-in defaults. How do you feel about the ergonomics of the prompt(bindEnv(bindConfig(option(…), …), …) pattern? On first blush, I'm torn between enjoying the explicitness and being worried that I'm going to miss an option or flip env and config accidentally.