This version of the module is deprecated: This package is deprecated. moonbit-community/proton_config should be preferred.

    proton_config

    Typed config parser for Proton moon.proton and moon.ext files.

    Download zip
    Author
    Version
    0.1.5
    License
    Apache-2.0
    Last updated
    4 months ago
    Downloads
    2K

    justjavac/proton_config does not have a README file

    ConfigLoc

    using @moonbitlang/lexer/basic { type Location as ConfigLoc }

    ConfigField

    pub(all) struct ConfigField {
    key : String
    key_loc :
    Location

    value : Ast
    } derive(Eq,
    Debug
    )

    ProjectBundleConfig

    pub(all) struct ProjectBundleConfig {
    active : Bool
    targets : Array[String]
    icon : Array[String]
    resources : Array[String]
    output : String
    } derive(Eq,
    Debug
    )

    ProjectBundleConfig::active

    fn ProjectBundleConfig::active(self : ProjectBundleConfig) -> Bool

    ProjectBundleConfig::new

    fn ProjectBundleConfig::new(active? : Bool, targets? : Array[String], icon? : Array[String], resources? : Array[String], output? : String) -> ProjectBundleConfig

    ProjectBundleConfig::output

    fn ProjectBundleConfig::output(self : ProjectBundleConfig) -> String

    ProjectConfig

    pub(all) struct ProjectConfig {
    base_dir : String
    window : ProjectWindowConfig
    entry : ProjectEntry
    metadata : ProjectMetadata
    frontend : ProjectFrontendConfig?
    bundle : ProjectBundleConfig?
    debug : Int
    } derive(Eq,
    Debug
    )

    ProjectConfig::base_dir

    fn ProjectConfig::base_dir(self : ProjectConfig) -> String

    ProjectConfig::bundle

    ProjectConfig::debug

    fn ProjectConfig::debug(self : ProjectConfig) -> Int

    ProjectConfig::entry

    ProjectConfig::frontend

    ProjectConfig::metadata

    ProjectConfig::new

    fn ProjectConfig::new(base_dir : String, window : ProjectWindowConfig, entry : ProjectEntry, metadata : ProjectMetadata, frontend? : ProjectFrontendConfig?, bundle? : ProjectBundleConfig?, debug? : Int) -> ProjectConfig

    ProjectConfig::window

    ProjectEntry

    pub(all) enum ProjectEntry {
    Html(String)
    Url(String)
    File(String)
    Asset(String)
    } derive(Eq,
    Debug
    )

    ProjectFrontendConfig

    pub(all) struct ProjectFrontendConfig {
    dev_url : String?
    dist : String?
    before_dev : String?
    before_build : String?
    cwd : String?
    } derive(Eq,
    Debug
    )

    ProjectFrontendConfig::before_build

    fn ProjectFrontendConfig::before_build(self : ProjectFrontendConfig) -> String?

    ProjectFrontendConfig::before_dev

    fn ProjectFrontendConfig::before_dev(self : ProjectFrontendConfig) -> String?

    ProjectFrontendConfig::cwd

    fn ProjectFrontendConfig::cwd(self : ProjectFrontendConfig) -> String?

    ProjectFrontendConfig::dev_url

    fn ProjectFrontendConfig::dev_url(self : ProjectFrontendConfig) -> String?

    ProjectFrontendConfig::dist

    fn ProjectFrontendConfig::dist(self : ProjectFrontendConfig) -> String?

    ProjectFrontendConfig::new

    fn ProjectFrontendConfig::new(dev_url? : String?, dist? : String?, before_dev? : String?, before_build? : String?, cwd? : String?) -> ProjectFrontendConfig

    ProjectMetadata

    pub(all) struct ProjectMetadata {
    product_name : String
    identifier : String?
    version : String?
    description : String?
    license : String?
    } derive(Eq,
    Debug
    )

    ProjectMetadata::new

    fn ProjectMetadata::new(product_name : String, identifier? : String?, version? : String?, description? : String?, license? : String?) -> ProjectMetadata

    ProjectWindowConfig

    pub(all) struct ProjectWindowConfig {
    title : String
    width : Int
    height : Int
    size_hint : ProjectWindowSizeHint
    } derive(Eq,
    Debug
    )

    ProjectWindowConfig::new

    fn ProjectWindowConfig::new(title : String, width : Int, height : Int, size_hint? : ProjectWindowSizeHint) -> ProjectWindowConfig

    ProjectWindowSizeHint

    pub(all) enum ProjectWindowSizeHint {
    WindowSizeNone
    WindowSizeMin
    WindowSizeMax
    WindowSizeFixed
    } derive(Eq,
    Debug
    )

    load_project_config_from_file

    fn load_project_config_from_file(path : String) -> Result[ProjectConfig, String]

    load_project_config_from_text

    fn load_project_config_from_text(source : String, base_dir : String, name? : String) -> Result[ProjectConfig, String]

    parse_moon_ext

    fn parse_moon_ext(name? : String, source : String) -> (Ast, Array[
    Report
    ])

    parse_moon_mod

    fn parse_moon_mod(name? : String, source : String) -> (Ast, Array[
    Report
    ])

    parse_moon_proton

    fn parse_moon_proton(name? : String, source : String) -> (Ast, Array[
    Report
    ])