Foundry.Studio (foundry v0.1.4)

Copy Markdown

Launch helpers for the local Foundry Studio runtime.

This module owns the standalone runtime contract used by mix foundry.studio and future packaged entrypoints.

Summary

Functions

complete_reused_launch(map)

@spec complete_reused_launch(map()) :: :ok

configure_runtime(project_root)

@spec configure_runtime(String.t()) :: :ok

finalize_launch(map)

@spec finalize_launch(map()) :: :ok | {:error, term()}

find_open_port(start_port \\ 4000)

@spec find_open_port(pos_integer()) :: {:ok, pos_integer()} | {:error, :no_open_port}

healthy_port?(port)

@spec healthy_port?(pos_integer()) :: boolean()

launch(opts \\ [])

@spec launch(keyword()) :: {:ok, map()} | {:error, term()}

mix_task_invoked?(task_name, opts \\ [])

@spec mix_task_invoked?(
  String.t(),
  keyword()
) :: boolean()

open_browser(url)

@spec open_browser(String.t()) :: :ok

parse_studio_argv(arg1)

@spec parse_studio_argv([String.t()]) ::
  {:ok, keyword()} | {:error, String.t()} | :no_command

port_file_path()

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

prepare_launch(opts)

@spec prepare_launch(keyword()) :: {:ok, map()} | {:error, term()}

read_port_file()

@spec read_port_file() :: {:ok, pos_integer()} | {:error, term()}

resolve_generic_server_port()

@spec resolve_generic_server_port() :: {:ok, pos_integer()} | {:error, :no_open_port}

url_for_port(port)

@spec url_for_port(pos_integer()) :: String.t()

write_port_file(port)

@spec write_port_file(pos_integer()) :: :ok | {:error, term()}