ComposerNew.Preflight (composer_new v0.3.0)

Copy Markdown View Source

The checks mix composer.new makes before it creates anything, and reports all at once:

  • APP doesn't exist yet, unless --reset is given
  • the igniter_new archive is installed, at 0.5.32 or later: that is the first release that takes --no-git without also passing it to each --install package's installer
  • the --with task is available (phx.new needs the phx_new archive)
  • git is on the PATH

The lookups are functions in checks, so tests need no fakes on disk.

Summary

Functions

Checks plan. Returns {:ok, warnings} or {:error, problems}, each a list of messages.

The minimum igniter_new version.

Types

checks()

@type checks() :: [
  exists?: (Path.t() -> boolean()),
  task?: (String.t() -> boolean()),
  igniter_new_version: (-> String.t() | nil),
  executable?: (String.t() -> boolean())
]

Functions

check(plan, checks \\ [])

@spec check(ComposerNew.Plan.t(), checks()) ::
  {:ok, [String.t()]} | {:error, [String.t()]}

Checks plan. Returns {:ok, warnings} or {:error, problems}, each a list of messages.

min_igniter_new()

@spec min_igniter_new() :: String.t()

The minimum igniter_new version.