設定リファレンス

.spekta.yml の設定リファレンスです。プロジェクトルートに配置し、対象ディレクトリ、プラグイン、出力形式を設定します。

必須フィールドは versiontarget_direxporter の3つです。includeexcludeannotator は省略できます。

version: 1
target_dir: test/
include:
  - ".test.ts"
exclude:
  - "fixtures/"
annotator:
  "@ktmage/spekta-annotator-rspec":
exporter:
  "@ktmage/spekta-exporter-web":
    name: "My Project"
    description: "プロジェクトの説明"

version

設定ファイルのバージョン番号です。現在は 1 を指定します。

なぜ?
将来のスキーマ変更時に互換性を判断するために使われます。

必須フィールド

target_dir

テストファイルが配置されたディレクトリのパスです。Parser と Annotator はこのディレクトリ配下のファイルを対象にします。

必須フィールド

include / exclude

対象ファイルのフィルタリング設定です。

  • include — 対象ファイルの拡張子パターンの配列(例: [".test.ts"])。省略すると全ファイルがスキャンされる
  • exclude — 除外パターンの配列(例: ["fixtures/"])。パスに含まれる文字列でマッチする

省略可能

exporter

使用する Exporter プラグインを設定します。必須フィールドです。キーはパッケージ名、値はプラグイン固有の設定です。

exporter:
  "@ktmage/spekta-exporter-web":
    name: "My Project"
  "@ktmage/spekta-exporter-markdown":

必須フィールド

パッケージ名の命名規則

なぜ?
命名規則を統一することで、プラグインコマンド(spekta web:dev 等)の短縮名を自動導出できます。

パッケージ名は @{scope}/spekta-exporter-{name} 形式に従う必要があります。

  1. @{scope}/spekta-exporter-{name} 形式のパッケージ名は受け入れられる
  2. 規則に従わないパッケージ名はバリデーションエラーになる

annotator

Annotator プラグインを設定します。省略可能です。手書きでアノテーションを書く場合は不要です。

Tip
Annotator は spekta annotate コマンドで実行されます。spekta build は Annotator + Render を連続実行します。

パッケージ名は @{scope}/spekta-annotator-{name} 形式に従います。

annotator:
  "@ktmage/spekta-annotator-rspec":
    page_from: filename

省略可能