home.social

#optique — Public Fediverse posts

Live and recent posts from across the Fediverse tagged #optique, aggregated by home.social.

  1. Commander.jsの.conflicts().implies()は、排他的な組み合わせをランタイムではちゃんと検出してくれます。

    でも.opts()の型は賢くならず、戻り値は結局string | undefinedのままです。どのオプションが同時に使えないのかを、TypeScriptは知りません。

    このズレをパーサーコンビネータでどう型に落とし込めるか、Yargsとの比較も含めて書きました。後半では、環境変数・設定ファイル・対話プロンプトまで同じ型保証を広げる話もしています。

    https://zenn.dev/hongminhee/articles/6ba2a6247ec0c4

    #Optique #Commander #Yargs #TypeScript #JavaScript #CLI

  2. I wrote about a problem that's been bugging me with #Commander.js and #Yargs: .conflicts() and .implies() enforce constraints at runtime, but the type you get back is still a flat object with every field optional. The compiler has no idea which options belong together.

    The post walks through what happens when you express the same constraints in the parser structure instead, and how #TypeScript turns that into a discriminated union where each branch carries only its own fields.

    Second half covers a less obvious question: what happens when values come from env vars, config files, or prompts instead of argv, and whether the constraints should still hold across all of them.

    https://hackers.pub/@hongminhee/2026/optique-10-discriminated-unions-for-cli

    #JavaScript #CLI #Optique

  3. #Optique 1.0.0 is out! If you build #CLI tools with #TypeScript, it might be worth a look.

    I started it because I wanted a TypeScript CLI parser that felt more like optparse-applicative than the usual builder-style APIs. You build up small typed parsers, compose them, and TypeScript infers the result. It handles subcommands, option dependencies, shell completion, and man pages, and it runs on #Deno, #Node.js, and #Bun.

    For 1.0 I added @optique/env, so env vars can fill in missing flags, and @optique/inquirer, so missing values can fall back to Inquirer.js prompts. I also cleaned up a lot of awkward API edges and fixed a long backlog of completion bugs across five shells.

    Packages are on JSR and npm.

    https://github.com/dahlia/optique/discussions/796

  4. #Optique 1.0.0 is out! If you build #CLI tools with #TypeScript, it might be worth a look.

    I started it because I wanted a TypeScript CLI parser that felt more like optparse-applicative than the usual builder-style APIs. You build up small typed parsers, compose them, and TypeScript infers the result. It handles subcommands, option dependencies, shell completion, and man pages, and it runs on #Deno, #Node.js, and #Bun.

    For 1.0 I added @optique/env, so env vars can fill in missing flags, and @optique/inquirer, so missing values can fall back to Inquirer.js prompts. I also cleaned up a lot of awkward API edges and fixed a long backlog of completion bugs across five shells.

    Packages are on JSR and npm.

    https://github.com/dahlia/optique/discussions/796

  5. #Optique 1.0.0 is out! If you build #CLI tools with #TypeScript, it might be worth a look.

    I started it because I wanted a TypeScript CLI parser that felt more like optparse-applicative than the usual builder-style APIs. You build up small typed parsers, compose them, and TypeScript infers the result. It handles subcommands, option dependencies, shell completion, and man pages, and it runs on #Deno, #Node.js, and #Bun.

    For 1.0 I added @optique/env, so env vars can fill in missing flags, and @optique/inquirer, so missing values can fall back to Inquirer.js prompts. I also cleaned up a lot of awkward API edges and fixed a long backlog of completion bugs across five shells.

    Packages are on JSR and npm.

    https://github.com/dahlia/optique/discussions/796

  6. #Optique 1.0.0 is out! If you build #CLI tools with #TypeScript, it might be worth a look.

    I started it because I wanted a TypeScript CLI parser that felt more like optparse-applicative than the usual builder-style APIs. You build up small typed parsers, compose them, and TypeScript infers the result. It handles subcommands, option dependencies, shell completion, and man pages, and it runs on #Deno, #Node.js, and #Bun.

    For 1.0 I added @optique/env, so env vars can fill in missing flags, and @optique/inquirer, so missing values can fall back to Inquirer.js prompts. I also cleaned up a lot of awkward API edges and fixed a long backlog of completion bugs across five shells.

    Packages are on JSR and npm.

    https://github.com/dahlia/optique/discussions/796

  7. #Optique 1.0.0 is out! If you build #CLI tools with #TypeScript, it might be worth a look.

    I started it because I wanted a TypeScript CLI parser that felt more like optparse-applicative than the usual builder-style APIs. You build up small typed parsers, compose them, and TypeScript infers the result. It handles subcommands, option dependencies, shell completion, and man pages, and it runs on #Deno, #Node.js, and #Bun.

    For 1.0 I added @optique/env, so env vars can fill in missing flags, and @optique/inquirer, so missing values can fall back to Inquirer.js prompts. I also cleaned up a lot of awkward API edges and fixed a long backlog of completion bugs across five shells.

    Packages are on JSR and npm.

    https://github.com/dahlia/optique/discussions/796

  8. 📶 ⚡ Nos scientifiques, en collaboration avec des collègues de l’Université de Harvard, ont mis au point une puce capable de convertir des impulsions électromagnétiques dans les domaines térahertz et optique sur le même dispositif. Leur conception intégrée pourrait permettre le développement de dispositifs pour les télécommunications ultrarapides, la télémétrie, la spectroscopie et l’informatique.

    #Télécommunications #Optique #Puce

    En savoir plus: go.epfl.ch/ab900e

  9. [#OffreDEmploi à l'IRAP] Le laboratoire recrute, sur un contrat CDD de 12 mois, un(e) Ingénieur(e) de Recherche en #Optique disposant d'une expérience de 5 à 10 ans : emploi.cnrs.fr/Offres/CDD/UMR5

    L'ingénieur.e opticien.ne intègrera le projet Vision-CFHT / Wenaokeao : un système innovant proposant un nouvel environnement pour les instruments #SPIRou et #ESPaDONS au foyer Cassegrain du Télescope Canada France Hawaii (#CFHT).

    Date limite de candidature : le mercredi 18 juin 2025