refrakt_cli/templates
File templates for code generation.
Each function returns the complete file content as a String. Templates use string concatenation — no macros, no interpolation engine.
Values
pub fn config_module(name: String) -> String
pub fn context_module(name: String, db: types.DbChoice) -> String
pub fn error_handler(name: String) -> String
pub fn flash_component() -> String
pub fn gleam_toml(name: String, db: types.DbChoice) -> String
pub fn home_handler(name: String) -> String
pub fn home_handler_test(name: String) -> String
pub fn main_module(name: String, db: types.DbChoice) -> String
pub fn readme(name: String, db: types.DbChoice) -> String
pub fn repo_module(name: String, db: types.DbChoice) -> String
pub fn resource_domain_type(
type_name: String,
fields: List(#(String, String)),
) -> String
pub fn resource_handler(
app_name: String,
resource_plural: String,
resource_singular: String,
type_name: String,
first_field: String,
db: types.DbChoice,
relation: option.Option(types.Relation),
) -> String
pub fn root_layout() -> String
pub fn router_module(name: String, db: types.DbChoice) -> String
pub fn router_test(name: String, db: types.DbChoice) -> String
pub fn test_context(db: types.DbChoice) -> #(String, String)
Imports and the Context expression a generated test uses to call the
router. The database is never opened: the tests only take paths that
do not reach a repo.
pub fn test_db_module(name: String, db: types.DbChoice) -> String
test/<app>/support/test_db.gleam: a real, migrated database for
tests that need one. gen resource and gen auth write it when it is
missing.