Skip to content

lue-bird/generate-elm

Repository files navigation

🐋 The API is quite big, so expect lots of changes! 🔨

elm-review-codegen

There are many use-cases for generating elm code:

Elm code generation can be simplified! elm-review-codegen 🤜🤛 elm-review 🤜🤛 elm-codegen:

  • run without separate command line tools or IDE plugins
  • one simple way to configure, customize and create all code generators
  • adding necessary imports, reporting failed/successful code generation etc. is handled automatically by elm-codegen

configuration

module ReviewConfig exposing (config)

import Review.Generate
import Elm.Generator.RecordFieldHelper as RecordFieldHelper
import Elm.Generator.Svg as Svg
import Review.Rule exposing (Rule)


config : List Rule
config =
    [ Review.Generate.inModule
        ( "Accessors", [ "Library", "Fields" ] )
        RecordFieldHelper.accessors
        |> Review.Generate.rule
    , Review.Generate.replaceStub "svgToGenerate"
        Svg.generator
        |> Review.Generate.rule
    ]

↑ more details

limits of elm-review 😢

  • can't make new modules or directories (yet)
  • can't access online resources

To overcome these limitations, you can build a tool that generates an elm module with the necessary information and run elm-review with generate-elm as a second step.

suggestions?

contributing.

Nice resources

About

easily generate elm using elm-review

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published