-
-
Notifications
You must be signed in to change notification settings - Fork 37
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Is your feature request related to a problem? Please describe.
Now, to create a DSL with Spark, you need to manually manipulate Entity
and Section
structs.
Describe the solution you'd like
I propose creating a DSL in Spark to ease the creation of Entities and Sections.
This is:
- In the spirit of Spark
- Demonstrates Spark in Spark
- Allows for compile time validation of types and helpful error messages for DSL creators.
Express the feature either with a change to resource syntax, or with a change to the resource interface
The highest-level syntax I propose would look like this:
defmodule MyCustomDsl do
defmodule Dsl do
use Spark
entity do
...
end
section do
...
end
end
sections = Spark.load(Dsl)
use Spark.Dsl.Extension, sections: sections
end
Which replaces/augments the current syntax:
defmodule MyCustomDsl do
@entity %Spark.Dsl.Entity{
...
}
@section %Spark.Dsl.Section{
...
}
use Spark.Dsl.Extension, sections: [@section]
end
Additional context
Thanks to @jimsynz for the idea!
I will comment on this issue with ideas for the DSL for specific fields so that we can discuss specifics as they arise.
Work remaining
- Add options fields to the
Field
entity- Determine types for each field in the
Field
entity - Determine required status for each field in the
Field
entity
- Determine types for each field in the
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request