GtBridge.ModuleCreator (gt_bridge v0.17.1)

Copy Markdown View Source

I create a fresh Elixir source file for a module name and recompile.

Used by the GT-side wrench "Create module" form to materialize a missing module reference into an actual .ex file under the chosen application's lib/ directory.

Public API

  • create/1 — write the skeleton under the main project's lib/.
  • create/2 — write under a specific app's lib/ (path-deps land in deps/<app>/lib/...).
  • project_apps/0 — apps the form's autocomplete offers.

Summary

Functions

I create the module under the main project's lib/.

I write defmodule <name> do; end under the chosen app's lib/. Path-deps land in their checked-out source tree so changes propagate back to the dep.

I list apps the form's autocomplete offers: the main project plus every top-level dep declared in mix.exs. Returns [atom()].

Functions

create(name)

@spec create(atom()) :: map() | {:error, :exists | :not_elixir_module | :unknown_app}

I create the module under the main project's lib/.

create(name, app)

@spec create(atom(), atom() | nil) ::
  map() | {:error, :exists | :not_elixir_module | :unknown_app}

I write defmodule <name> do; end under the chosen app's lib/. Path-deps land in their checked-out source tree so changes propagate back to the dep.

project_apps()

@spec project_apps() :: [atom()]

I list apps the form's autocomplete offers: the main project plus every top-level dep declared in mix.exs. Returns [atom()].