Meet Mason: Intro to Templating and Custom Code Generation
summary
Mason is a set of four Dart packages (including mason_cli) that generate code from reusable templates called bricks using Mustache; the CLI installs bricks (mason get), scaffolds (mason make), and locks versions, with a CI flag (--set-exit-if-changed) to fail when generated files drift. Bricks support pre/post-gen hooks, lambdas for casing, partials, and can publish to BrickHub (over 100 bricks, ~53,000 downloads; some bricks hit ~4,000). Hooks run custom Dart code and run successfully in examples shown.
AI-written summary · about
chapters (16)
- 0:00Introduction to Mason
- 4:24Mason core components
- 5:49Installing and initializing Mason
- 8:14Fetching and listing bricks
- 9:58Generating code with Mason make
- 13:49Creating custom bricks
- 17:42Brick.yaml structure
- 19:25Mustache templating basics
- 21:36Advanced templating features
- 24:02Understanding hooks
- 26:49Brick management with BrickHub
- 29:00Adding bricks from sources
- 32:09Global bricks and VS Code integration
- 34:13Team workflow with Mason
- 35:17Using Mason in custom tooling
- 36:41Mason roadmap and future
related talks
41mBrick by Brick: Building Open Source libraries
32mcode generation productivity for Dart and Flutter
42mA tale of Skeletons and Bones
40mMaven Marvels: Project Generation at Warp Speed
28mLego Bricks for Developers: Turning Insights Into Golden Paths
02mLightning Talk
19mAutomate what you repeat: From boilerplate to automation
01h 56mSupercharge Your Coding Agents
