Profile img

joohoon

@jcha0713@hackers.pub · 12 following · 11 followers

GitHub
@jcha0713

https://github.com/bglgwyng/nix-x-cabal

한달간의 삽질끝에 Nix + Haskell 빌드 프레임워크를 완성했다. 늘 Nix, Haskell에 기여하고 싶었지만, 솔직히 이걸 내가 직접해야하는 상황이 올줄은 몰랐네. Nix 디버깅하느라 정말 개고통이었다..

4
5
6
5

joohoon shared the below article:

Stop writing CLI validation. Parse it right the first time.

洪 民憙 (Hong Minhee) @hongminhee@hackers.pub

This post introduces Optique, a new library created to address the pervasive problem of repetitive and often messy validation code in CLI tools. The author was motivated by the observation that nearly every CLI tool reinvents the wheel with similar validation patterns for dependent options, mutually exclusive options, and environment-specific requirements. Optique leverages parser combinators and TypeScript's type inference to ensure that CLI arguments are parsed directly into valid configurations, eliminating the need for manual validation. By describing the desired CLI configuration with Optique, TypeScript automatically infers the types and constraints, catching potential bugs at compile time. The author shares their experience of deleting large chunks of validation code and simplifying refactoring tasks. Optique aims to provide a more robust and maintainable approach to CLI argument parsing, potentially saving developers from writing the same validation logic repeatedly.

Read more →
20
3
1

joohoon shared the below article:

Optique 0.4.0: Better help, rich docs, and Temporal support

洪 民憙 (Hong Minhee) @hongminhee@hackers.pub

Optique 0.4.0 introduces enhancements to streamline CLI development in TypeScript. This release focuses on improving help text organization through labeled merge groups and a new `group()` combinator, making complex CLIs more user-friendly by organizing options under clear sections. Comprehensive documentation support is added via the `run()` function, allowing brief descriptions, detailed explanations, and footers without altering parser definitions. The update also includes Temporal API support with the `@optique/temporal` package, enabling type-safe parsing for dates, times, and time zones. Improved type inference for `merge()` and `tuple()` combinators enhances type safety, alongside minor breaking changes. These updates aim to make CLI construction more intuitive and maintainable, offering developers greater control over user experience and code structure.

Read more →
5
1
0