mix composer.gen.step (composer v0.2.0)

Copy Markdown View Source

Scaffolds a step in the current project's cookbook, with every facet stubbed out, and a test for it.

mix composer.gen.step tailwind_plugins
mix composer.gen.step ash/postgres

writes lib/composer/<app>/steps/ash/postgres.ex (module Composer.<App>.Steps.Ash.Postgres) and test/composer/<app>/steps/ash/postgres_test.exs.

A step's templates go in the directory named after its file with a leading underscore (lib/composer/<app>/steps/ash/_postgres/), and template/1 refers to them by a path relative to it. The directory is not created; add it when the step needs a template.

Group related steps with /: ash/postgres and ash/sqlite read better, and list together, than ash_postgres and ash_sqlite. Use a flat name for a step that stands alone.

If the cookbook module is guarded for bundling (see mix composer.gen.cookbook --bundled), the step and its test get the same guard.