Skip to content

refactor: 設定ファイル(TOML)のスキーマバリデーション強化 #11

Description

@mikana0918

概要

`smol-toml` で読込後、型/必須フィールドのバリデーションが弱い → 不正な config.toml で実行時エラー。

動機

  • 例: `kind = "ssh"` なのに `host` 未指定、`kind` typo("sshh"等)、`path` 未指定で何が起きるか予測しづらい。
  • 明示的なスキーマ検証 + 親切なエラーメッセージで debugging cost 削減。

設計案

  • `zod` / `valibot` 等のスキーマライブラリ導入、または手書きvalidator。
  • `cchist init` 生成テンプレートとスキーマを単一の真実とする。
  • `cchist config validate` サブコマンド追加検討。

やること

  • バリデーションライブラリ選定
  • `src/config.ts` にスキーマ層追加
  • 不正config時のエラーメッセージ整備
  • `cchist config validate` 検討

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions