How pedro-ivo-neves/classy works
Project type and purpose
• This is a Dart macro‐based code‐generation package (classy) that provides annotations (@data, @constructor, @fromJson, @toJson, @toString) to automatically generate boilerplate for Dart classes at compile time.
File structure
• Top‐level:
• lib/classy.dart: public entrypoint that exports or wires up all macros
• lib/src/constructors, lib/src/data, lib/src/methods: the three macro‐module areas
• example: shows how a consuming project writes code using classy
• test: unit tests driving each macro’s behavior
• Configuration files:
• analysis_options.yaml: enables the Dart macro experiment
• pubspec.yaml: declares package metadata and macro dependencies
README for additional insights
• The README confirms this is purely a compile‐time code generator.
• It calls out the need to run Dart with --enable-experiment=macros and how to apply the annotations in user code.
Important detail capture
• Delegation relationship of @data to the sub‐macros.
• That all codegen happens before the final compilation step.
• Highlights each macro component
• Shows exactly how annotations flow through the macro engine
• Maps directly to the lib/src/... folders and their responsibilities
• Guides both new and experienced engineers in understanding and extending the classy architecture