refrakt_cli/manifest

The generator manifest, .refrakt/generated.toml.

refrakt new creates it and every generator that writes templates (gen page, gen resource, gen auth, gen island, gen live, gen deploy) appends its arguments. refrakt diff replays the entries, in order, to render what the current templates would generate for the app.

[new]
name = "my_app"
db = "sqlite"

[[gen]]
args = ["resource", "posts", "title:string", "body:text"]

Types

What refrakt new was run with, and the generators run since.

pub type Manifest {
  Manifest(
    name: String,
    db: types.DbChoice,
    gens: List(List(String)),
  )
}

Constructors

  • Manifest(
      name: String,
      db: types.DbChoice,
      gens: List(List(String)),
    )

Values

pub fn db_name(db: types.DbChoice) -> String
pub fn new_content(name: String, db: types.DbChoice) -> String

The manifest refrakt new writes for a new app.

pub const path: String
pub fn read(dir: String) -> Result(Manifest, String)

Read .refrakt/generated.toml from the directory dir.

pub fn record(args: List(String)) -> Nil

Record a generator run in the manifest of the app in the current directory. Running the same generator with the same arguments again records nothing. Apps created before the manifest existed have none; for those this does nothing and refrakt diff infers the generators from the app’s files instead.

pub fn to_toml(manifest: Manifest) -> String
✨ Search Document