洪 民憙 (Hong Minhee) :nonbinary:'s avatar
洪 民憙 (Hong Minhee) :nonbinary:

@hongminhee@hollo.social · Reply to 洪 民憙 (Hong Minhee) :nonbinary:'s post

After deep thinking, I've designed a satisfying solution and broke it down into 4 issues:

  • Annotations system (#83): Low-level primitive that allows passing runtime context to parsers via parse() options

  • SourceContext interface (#85): High-level system for composing multiple data sources (env, config, etc.) with clear priority ordering via runWith()

  • @optique/config (#84): Configuration file support with Standard Schema validation (Zod, Valibot, etc.)

  • @optique/env (#86): Environment variables support with automatic type conversion

The key insight: use a two-pass parsing approach where the first pass extracts the config file path, then the second pass runs with config data injected as annotations. All sources can be composed together with runWith([envContext, configContext]) for automatic priority handling: CLI > environment variables > configuration file > default values.