Liking cljdoc? Tell your friends :D

wagoe.scaffolder.core.template

Pure template rendering functions for module generation.

This namespace provides pure functions for transforming entity definitions into code templates. All functions are deterministic and have no side effects.

Pure template rendering functions for module generation.

This namespace provides pure functions for transforming entity definitions
into code templates. All functions are deterministic and have no side effects.
raw docstring

build-entity-contextclj

(build-entity-context entity-def module-name)

Build template context for an entity.

Args: entity-def - Entity definition map module-name - Module name string

Returns: Map with template placeholders for the entity

Pure: true

Build template context for an entity.

Args:
  entity-def - Entity definition map
  module-name - Module name string

Returns:
  Map with template placeholders for the entity

Pure: true
sourceraw docstring

build-field-contextclj

(build-field-context field-def)

Build template context for a single field.

Args: field-def - Field definition map

Returns: Map with template placeholders for the field

Pure: true

Build template context for a single field.

Args:
  field-def - Field definition map

Returns:
  Map with template placeholders for the field

Pure: true
sourceraw docstring

build-module-contextclj

(build-module-context request)

Build complete template context for module generation.

Args: request - Module generation request map

Returns: Map with all template placeholders

Pure: true

Build complete template context for module generation.

Args:
  request - Module generation request map

Returns:
  Map with all template placeholders

Pure: true
sourceraw docstring

field-type->malliclj

(field-type->malli {:keys [type enum-values]})

Convert scaffolder field type to Malli schema type.

Args: field-def - Field definition map with :type key

Returns: Malli schema keyword or vector

Pure: true

Example: (field-type->malli {:type :string}) => :string (field-type->malli {:type :enum :enum-values [:a :b]}) => [:enum :a :b]

Convert scaffolder field type to Malli schema type.

Args:
  field-def - Field definition map with :type key

Returns:
  Malli schema keyword or vector

Pure: true

Example:
  (field-type->malli {:type :string}) => :string
  (field-type->malli {:type :enum :enum-values [:a :b]}) => [:enum :a :b]
sourceraw docstring

field-type->sqlclj

(field-type->sql {:keys [type]})

Convert scaffolder field type to SQL type.

Generates PostgreSQL-compatible types. The production DDL generator in platform/utils/schema.clj handles dialect-specific conversions.

Args: field-def - Field definition map with :type key

Returns: SQL type string

Pure: true

Example: (field-type->sql {:type :string}) => "VARCHAR(255)" (field-type->sql {:type :uuid}) => "UUID"

Convert scaffolder field type to SQL type.

Generates PostgreSQL-compatible types. The production DDL generator
in platform/utils/schema.clj handles dialect-specific conversions.

Args:
  field-def - Field definition map with :type key

Returns:
  SQL type string

Pure: true

Example:
  (field-type->sql {:type :string}) => "VARCHAR(255)"
  (field-type->sql {:type :uuid}) => "UUID"
sourceraw docstring

kebab->pascalclj

(kebab->pascal s)

Convert kebab-case to PascalCase.

Args: s - String in kebab-case

Returns: String in PascalCase

Pure: true

Example: (kebab->pascal "user-profile") => "UserProfile"

Convert kebab-case to PascalCase.

Args:
  s - String in kebab-case

Returns:
  String in PascalCase

Pure: true

Example:
  (kebab->pascal "user-profile") => "UserProfile"
sourceraw docstring

kebab->snakeclj

(kebab->snake s)

Convert kebab-case to snake_case.

Args: s - String in kebab-case

Returns: String in snake_case

Pure: true

Example: (kebab->snake "user-profile") => "user_profile"

Convert kebab-case to snake_case.

Args:
  s - String in kebab-case

Returns:
  String in snake_case

Pure: true

Example:
  (kebab->snake "user-profile") => "user_profile"
sourceraw docstring

pluralizeclj

(pluralize s)

Simple pluralization (just adds 's' for now).

Args: s - Singular string

Returns: Plural string

Pure: true

Example: (pluralize "customer") => "customers"

Simple pluralization (just adds 's' for now).

Args:
  s - Singular string

Returns:
  Plural string

Pure: true

Example:
  (pluralize "customer") => "customers"
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close