The mix capstone.new argv contract: exactly one switch, --path.
Illegal combinations are unrepresentable: parse!/1 either returns a fully
populated struct or raises. --path is the only recognised switch — there
is no NAME positional and no --base/--github-org/--module/--app/
--capstone-path any more: target.exs (read via Capstone.Config, which
lives in this same project) already carries everything those flags used to
supply.
Summary
Types
Which stock project generator/1 produces: :otp runs plain mix new;
:api, :web and :both all run mix phx.new against the same stock
tree (see generator_argv/1 for why the three don't diverge here).
Where mix capstone.new fetches its own :capstone dev dependency from — hex, or a local path for development.
Functions
The dependency line to splice into the generated project's deps/0.
Every plugin that should actually be installed: base-implied plugins plus whatever
was explicitly declared, deduplicated. This is the ONLY place the two lists merge —
plugins: itself (declared-only) is never mutated, so target.exs (written from
plugins:, never from this) stays an honest record of what the user asked for.
Builds a %Capstone.New.Options{} from an already-validated %Capstone.Config{}.
The Mix task that generates this base's stock project.
The argv to hand the generator.
Plugins base implies, in addition to whatever target.exs lists explicitly.
Parses argv (just --path PATH) into a fully validated %Capstone.New.Options{}.
Types
@type base() :: :otp | :api | :web | :both
Which stock project generator/1 produces: :otp runs plain mix new;
:api, :web and :both all run mix phx.new against the same stock
tree (see generator_argv/1 for why the three don't diverge here).
Where mix capstone.new fetches its own :capstone dev dependency from — hex, or a local path for development.
Functions
The dependency line to splice into the generated project's deps/0.
Every plugin that should actually be installed: base-implied plugins plus whatever
was explicitly declared, deduplicated. This is the ONLY place the two lists merge —
plugins: itself (declared-only) is never mutated, so target.exs (written from
plugins:, never from this) stays an honest record of what the user asked for.
@spec from_config!(Capstone.Config.t()) :: t()
Builds a %Capstone.New.Options{} from an already-validated %Capstone.Config{}.
capstone is always {:hex, @default_requirement} here: target.exs has
no dependency-source field — it describes the generated project's
identity, not the generator's own development conveniences. A {:path, ...} source stays constructible directly (see Capstone.New.Factory's
options_factory/0 and its callers), just not through this function.
The Mix task that generates this base's stock project.
The argv to hand the generator.
:api, :web and :both all produce the SAME stock tree, and that is not
an oversight: priv/baselines.exs records :web as derived_from: :api
plus the :web_layer plugin, so the asset pipeline arrives when that
plugin is applied and never from phx.new. :both follows the identical
reasoning: it is a project that will eventually carry both layers via
plugins, not a different stock tree to generate. Generating any of the
three with HTML and assets here would hand a plugin a tree it did not
derive against.
Plugins base implies, in addition to whatever target.exs lists explicitly.
:api implies nothing — it is the bare tree every other base is generated
from and derived against. :web and :both both imply :web_layer: the
LiveView/Svelte layer never comes from the generator (generator_argv/1
strips --no-html --no-assets for all three phx.new-driven bases
identically), only from this plugin being applied.
Parses argv (just --path PATH) into a fully validated %Capstone.New.Options{}.