Crafting Fully Custom Code Generators
summary
Custom Elixir generators take an Elixir input file (keyword lists or structs), run a preprocessing digestor that pulls from legacy source code, an Oracle schema, and human notes, then use a mix task to evaluate EEx templates plus helper modules to emit migrations, schemas, tests, LiveView files and factory snippets. The workflow uses mix generator.create_file, runs the formatter, iterates in a temp dir to avoid compile breaks, and doubles test coverage in the demo—generators work and save time.
AI-written summary · about
chapters (12)
- 0:00Introduction
- 1:04Why build generators
- 3:53Phoenix generator challenges
- 7:25Arcane Assist demo
- 8:52Generator in action
- 11:00Core components
- 13:25Helper modules
- 15:31Mix task details
- 17:20EEx template magic
- 18:45Maintainable generators
- 21:15Avoid over-engineering
- 23:41Future improvements
related talks
59mSave Time with Custom Rails Generators
51mGenerate You Some Code for Great Good
24mNX Generators or how to skip boring tasks
28mCode Spelunking for Knowledge and Profit
32mWriting Command Line Applications with Elixir
53mWhat To Expect When You Are Elixiring
38mA Blueprint for Intuitive Internal Elixir Ecosystems
35mExtracting Specifications from Legacy Software with Elixir
