Skip to content

Feature: Factory Presets and Traits #42

@Goldziher

Description

@Goldziher

Focused Scope

Add a small presets/traits API for named partial overrides and ordered composition.

Proposed v1

  • Register named presets on a factory.
  • Apply one or more presets during build/batch.
  • Later presets override earlier presets.
  • Explicit build overrides win over presets.
  • Keep the implementation sync-first; async behavior should only be added if it naturally fits buildAsync().

Out of Scope

  • State machines or lifecycle transitions.
  • Discriminated-union specialization.
  • ORM-style association presets.
  • A broad variants framework.

Existing extend(), compose(), kwargs, and hooks already cover many variant use cases; this issue should focus only on the missing named-preset ergonomics.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestgood first issueGood for newcomershelp wantedExtra attention is neededonlydust-waveContribute to awesome OSS repos during OnlyDust's open source week

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions