SkyLeite / generate-elm

easily generate elm using elm-review

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

πŸ‹ 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

License:MIT License


Languages

Language:Elm 98.5%Language:JavaScript 1.5%