opvasger / develm / DevElm


type Flags
    = Batch (List Flags)
    | Sequence (List Flags)
    | OneOf (List ( String, Flags ))
    | Log LogFlags
    | Build BuildFlags
    | Serve ServeFlags
    | Test TestFlags
    | Benchmark BenchmarkFlags

Flags for the develm program.


type LogFlags
    = Text String
    | Version

Log text to the console.


type alias BuildFlags =
{ moduleName : String
, outputPath : Maybe String
, format : Format
, mode : Mode 
}

Flag DevElm to build an elm program.


type Format
    = ImmediatelyInvokedFunctionInvocation
    | EcmaScriptModule

Flag what format the program should be built to.


type Mode
    = Develop
    | Debug
    | Optimize

Flag what mode the program should be built in.

defaultBuild : BuildFlags

The default-flags for building Elm programs. It makes an unoptimized build of a module named Main into build/main.js


type alias ServeFlags =
{ moduleName : String
, hostname : String
, port_ : Basics.Int
, mode : Mode
, outputPath : String
, documentPath : Maybe String
, contentTypes : Dict String String
, headers : Dict String String 
}

Flag DevElm to serve an elm program over HTTP.

defaultServe : ServeFlags

The default-flags for serving Elm programs. It assumes no HTML-document is present.


type alias TestFlags =
{ seed : Maybe Basics.Int
, fuzz : Basics.Int
, moduleName : String
, testName : String 
}

Flag DevElm to test Elm functions.

defaultTest : TestFlags

The default-flags for testing Elm functions.


type alias BenchmarkFlags =
{ moduleName : String
, benchmarkName : String 
}

Flag DevElm to benchmark Elm functions.

defaultBenchmark : BenchmarkFlags

The default-flags for benchmarking Elm functions.

Internals

These definitions are for program-authors who want to consume the flags for their own programs.

encodeFlags : Flags -> Json.Encode.Value

Encode flags as JSON.