aqua v0.9.2 Aqua.Schema.Scaffold

  • mix aqua new console my_proj --no-test --force

Link to this section Summary

Functions

Sets Scaffold to invalid, if the value of project_type is :flat

Calculate pathes for scaffolding project. Pathes for umbrella differs from pathes for flat project

This function populate generic assigns, that will be used inside injected document

Loads LocalTemplate, and stores it inside :template key inside

Identifies the type of a project, on which the mix aqua command is called. Set the valuse inside Inject structure under project_type

Link to this section Types

Link to this type

t()
t() :: %Aqua.Schema.Scaffold{
  assigns: Map.t(),
  path: term(),
  project_name: String.t(),
  project_type: :umbrella | :standalone,
  raw: nil,
  template: any(),
  valid?: :ok | {:error, atom()}
}

Link to this section Functions

Link to this function

assert_not_in_flat_project(scaffold)
assert_not_in_flat_project(Aqua.Schema.Scaffold.t()) :: Aqua.Schema.Scaffold.t()

Sets Scaffold to invalid, if the value of project_type is :flat.

If the project_type value is anything else - pathes the Inject struct as is.

Link to this function

calculate_pathes(inject)

Calculate pathes for scaffolding project. Pathes for umbrella differs from pathes for flat project.

Function will populate fils-system root path for scaffolding project under :path key;

Calculation is preformed from value of :raw key inside Inject. We should be inside either umbrella or no application.

This function as the result either will populate structure with pathes, or invalidate the Inject with well-formed error, if path or Elixir's module name from raw input are invalid for this type of a project and injection.

Link to this function

generate(scaffold)

Link to this function

generate_assigns(scaffold, args)

This function populate generic assigns, that will be used inside injected document

Link to this function

load_template(scaffold, template)

Loads LocalTemplate, and stores it inside :template key inside.

Populates errors, that appears during LocalTemplates loading from LocalTemplate struct into Scaffold struct.

Can return either Scaffold struct with populated valid LocalTemplate under :template key, or Inject with well-formed error under :valid? key.

Link to this function

set_project_type(scaffold)
set_project_type(inject :: Aqua.Schema.Scaffold.t()) :: Aqua.Schema.Scaffold.t()

Identifies the type of a project, on which the mix aqua command is called. Set the valuse inside Inject structure under project_type.

Project structure can be:

  • :none - we are not inside the project;
  • :flat - we are inside flat [common] project;
  • :umbrella - we are inside umbrella project;