yumemi/gen/face

面 package の発見。back の source.load とは別に、入口の隣の package を読む。

探索は dirname(app_dir) と app_dir の直下だけに限る。ここで再帰すると、 fixture の親を app として渡したときに別 fixture の面まで混ざる。

Types

見つけた package の候補。テストでは source 文字列から直接組める。

pub type Candidate {
  Candidate(
    name: String,
    path: String,
    has_package: Bool,
    has_layout: Bool,
  )
}

Constructors

  • Candidate(
      name: String,
      path: String,
      has_package: Bool,
      has_layout: Bool,
    )
pub type Discovery {
  Discovery(packages: List(Package), notes: List(stop.Note))
}

Constructors

pub type HttpEntry {
  HttpEntry(name: String, pages: Pages)
}

Constructors

  • HttpEntry(name: String, pages: Pages)
pub type Package {
  Package(
    name: String,
    path: String,
    pages: Pages,
    units: List(source.Unit),
  )
}

Constructors

  • Package(
      name: String,
      path: String,
      pages: Pages,
      units: List(source.Unit),
    )
pub type Pages {
  UndeclaredPages
  AllPages
  NoPages
}

Constructors

  • UndeclaredPages

    pages 欄が無い。面を持つかどうかは folder の有無で決める。

  • AllPages
  • NoPages
pub type Selection {
  Selection(packages: List(Candidate), notes: List(stop.Note))
}

Constructors

Values

pub fn discover(
  app_dir: String,
  units: List(source.Unit),
) -> Result(Discovery, source.Error)

<app>/src/entry.gleam の Http 入口と、直下の面 package を突き合わせる。

pub fn http_entries(units: List(source.Unit)) -> List(HttpEntry)

テストや reader が entry の宣言を再利用できるように公開する。

pub fn package_name(path: String) -> String

面の出力ディレクトリ名と、gleam package の name は別物である。 shell が無いときの title の既定値には manifest の name を使う。

pub fn select(
  entries: List(HttpEntry),
  candidates: List(Candidate),
) -> Selection

filesystem を使わない発見。負例を source 文字列だけで検査する入口。

✨ Search Document