Scaffolder module port definitions (abstract interfaces).
Scaffolder module port definitions (abstract interfaces).
Scaffolder service interface for module generation operations.
This port defines the service layer interface for generating new modules from templates. The service orchestrates template rendering, file generation, and validation.
Scaffolder service interface for module generation operations. This port defines the service layer interface for generating new modules from templates. The service orchestrates template rendering, file generation, and validation.
(add-adapter this request)Generate a new adapter implementation for a port.
Args: request: Map with: {:module-name "cache" :port "ICache" :adapter-name "redis" :dry-run false}
Returns: Map with :success, :files (adapter file), :errors
Example: (add-adapter service {:module-name "cache" :port "ICache" ...})
Generate a new adapter implementation for a port.
Args:
request: Map with:
{:module-name "cache"
:port "ICache"
:adapter-name "redis"
:dry-run false}
Returns:
Map with :success, :files (adapter file), :errors
Example:
(add-adapter service {:module-name "cache" :port "ICache" ...})(add-endpoint this request)Add an endpoint to an existing module.
Args: request: Map with: {:module-name "billing" :path "/invoices/:id/send" :method :post :handler-name "send-invoice" :dry-run false}
Returns: Map with :success, :files (route definition), :errors
Example: (add-endpoint service {:module-name "billing" :path "/send" ...})
Add an endpoint to an existing module.
Args:
request: Map with:
{:module-name "billing"
:path "/invoices/:id/send"
:method :post
:handler-name "send-invoice"
:dry-run false}
Returns:
Map with :success, :files (route definition), :errors
Example:
(add-endpoint service {:module-name "billing" :path "/send" ...})(add-entity this request)Add an entity to an existing module.
Args: request: {:module-name "billing" :entity {:name "InvoiceLineItem" :belongs-to "invoice" :fields [...]} :dry-run false}
Writes the entity's own core, service, persistence, migration and test files, and appends its defs to schema.clj and ports.clj. Refuses, and writes nothing, when one of those files exists or the module already defines a name the entity needs.
Returns: Map with :success, :files, :errors
Add an entity to an existing module.
Args:
request: {:module-name "billing"
:entity {:name "InvoiceLineItem" :belongs-to "invoice"
:fields [...]}
:dry-run false}
Writes the entity's own core, service, persistence, migration and test
files, and appends its defs to schema.clj and ports.clj. Refuses, and
writes nothing, when one of those files exists or the module already
defines a name the entity needs.
Returns:
Map with :success, :files, :errors(add-field this request)Add a field to an existing entity.
Args: request: Map with: {:module-name "billing" :entity "Invoice" :field {:name :discount :type :decimal :required true} :dry-run false}
Returns: Map with :success, :files (migration + schema patch info), :errors
Example: (add-field service {:module-name "billing" :entity "Invoice" ...})
Add a field to an existing entity.
Args:
request: Map with:
{:module-name "billing"
:entity "Invoice"
:field {:name :discount :type :decimal :required true}
:dry-run false}
Returns:
Map with :success, :files (migration + schema patch info), :errors
Example:
(add-field service {:module-name "billing" :entity "Invoice" ...})(add-subscriber this request)Add an event subscriber to an existing module (BOU-578).
Args: request: Map with: {:module-name "billing" :event :admin/entity-created :entity "invoices" ; optional: the payload's :entity :dry-run false}
Writes an Integrant component that subscribes through the events port,
its handle, a test, and the require that wires it in; the module starts
it when the event bus is on.
Returns: Map with :success, :files, :errors
Add an event subscriber to an existing module (BOU-578).
Args:
request: Map with:
{:module-name "billing"
:event :admin/entity-created
:entity "invoices" ; optional: the payload's :entity
:dry-run false}
Writes an Integrant component that subscribes through the events port,
its `handle`, a test, and the require that wires it in; the module starts
it when the event bus is on.
Returns:
Map with :success, :files, :errors(generate-module this request)Generate a complete module from template.
Args:
request: Map conforming to schema/ModuleGenerationRequest
{:module-name "customer"
:entities [{:name "Customer" :fields [...]}]
;; Optional, and every key in it optional: absent means
;; every interface. :cli is gone — the scaffolder has
;; never had a CLI generator (BOU-479).
:interfaces {:http true :web true}
:dry-run false}
Returns: Map conforming to schema/ModuleGenerationResult {:success true :module-name "customer" :files [{:path "..." :content "..." :action :create}] :errors [] :warnings []}
Example: (generate-module service {:module-name "customer" ...})
Generate a complete module from template.
Args:
request: Map conforming to schema/ModuleGenerationRequest
{:module-name "customer"
:entities [{:name "Customer" :fields [...]}]
;; Optional, and every key in it optional: absent means
;; every interface. `:cli` is gone — the scaffolder has
;; never had a CLI generator (BOU-479).
:interfaces {:http true :web true}
:dry-run false}
Returns:
Map conforming to schema/ModuleGenerationResult
{:success true
:module-name "customer"
:files [{:path "..." :content "..." :action :create}]
:errors []
:warnings []}
Example:
(generate-module service {:module-name "customer" ...})cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |