proton_config

    Typed application configuration shared by Proton and its CLI.

    Download zip
    Version
    0.7.0
    License
    Apache-2.0
    Last updated
    2 days ago
    Downloads
    27K

    moonbit-community/proton_config does not have a README file

    AppConfigError

    pub(all) suberror AppConfigError {
    FileRead(path~ : String, detail~ : String)
    Syntax(name~ : String, diagnostics~ : String)
    InvalidRoot
    Validation(errors~ : Array[AppConfigError])
    MissingField(path~ : String)
    DuplicateValue(path~ : String, value~ : String)
    UnknownField(path~ : String)
    InvalidField(path~ : String, expectation~ : String)
    UnsupportedValue(path~ : String, value~ : String)
    } derive(Eq,
    Debug
    )

    Failures produced while loading and validating proton.project.json.

    AppConfigError::equal

    AppConfigError::message

    fn AppConfigError::message(self : AppConfigError) -> String

    AppConfigError::not_equal

    fn AppConfigError::not_equal(x : AppConfigError, y : AppConfigError) -> Bool

    AppConfigError::output

    fn AppConfigError::output(self : AppConfigError, logger : &Logger) -> Unit

    AppConfigError::to_string

    fn AppConfigError::to_string(self : AppConfigError) -> String

    AppConfig

    pub(all) struct AppConfig {
    identifier : String
    backend : BackendConfig?
    frontend : FrontendConfig?
    package_config : PackageConfig?
    } derive(Eq,
    Debug
    )

    Effective host-platform configuration shared by tooling and applications. Loading resolves root platform overrides; relative paths remain unchanged.
    impl ToJson for AppConfig

    AppConfig::AppConfig

    fn AppConfig::AppConfig(identifier : String, backend? : BackendConfig?, frontend? : FrontendConfig?, package_config? : PackageConfig?) -> AppConfig

    AppConfig::copy

    fn AppConfig::copy(self : AppConfig) -> AppConfig

    Returns an independent effective configuration snapshot.

    AppConfig::decode

    fn AppConfig::decode(json : Json, platform? : Platform) -> AppConfig raise AppConfigError

    Resolves a project into a typed configuration without changing path strings. All platform sections are checked, including those not selected by this host.

    AppConfig::equal

    fn AppConfig::equal(AppConfig, AppConfig) -> Bool

    AppConfig::load

    fn AppConfig::load(path : String, platform? : Platform) -> AppConfig raise AppConfigError

    Reads project configuration and resolves the selected host's overrides.

    AppConfig::not_equal

    fn AppConfig::not_equal(x : AppConfig, y : AppConfig) -> Bool

    AppConfig::parse

    fn AppConfig::parse(source : String, name? : String, platform? : Platform) -> AppConfig raise AppConfigError

    Decodes project configuration. Defaults are applied after platform overrides.

    AppConfig::to_json

    fn AppConfig::to_json(self : AppConfig) -> Json

    AppConfig::validate

    fn AppConfig::validate(self : AppConfig) -> Unit raise AppConfigError

    Checks semantic constraints on an effective configuration.

    BackendConfig

    pub(all) struct BackendConfig {
    path : String
    app_package : String
    } derive(Eq, ToJson,
    Debug
    ,
    FromJson
    )

    The MoonBit backend that proton_cli builds and launches.

    BackendConfig::BackendConfig

    fn BackendConfig::BackendConfig(path : String, app_package : String) -> BackendConfig

    BackendConfig::equal

    BackendConfig::not_equal

    fn BackendConfig::not_equal(x : BackendConfig, y : BackendConfig) -> Bool

    BackendConfig::to_json

    DocumentType

    pub(all) struct DocumentType {
    name : String
    extensions : Array[String]
    role : String
    } derive(Eq, ToJson,
    Debug
    ,
    FromJson
    )

    DocumentType::DocumentType

    fn DocumentType::DocumentType(name : String, extensions : Array[String], role? : String) -> DocumentType

    DocumentType::equal

    DocumentType::not_equal

    fn DocumentType::not_equal(x : DocumentType, y : DocumentType) -> Bool

    DocumentType::to_json

    FrontendConfig

    pub(all) struct FrontendConfig {
    dev_url : String?
    dist : String?
    before_dev : String?
    before_build : String?
    path : String?
    } derive(Eq, ToJson,
    Debug
    ,
    FromJson
    )

    Frontend commands and paths needed before the application can run.

    FrontendConfig::FrontendConfig

    fn FrontendConfig::FrontendConfig(dev_url? : String?, dist? : String?, before_dev? : String?, before_build? : String?, path? : String?) -> FrontendConfig

    FrontendConfig::equal

    FrontendConfig::not_equal

    fn FrontendConfig::not_equal(x : FrontendConfig, y : FrontendConfig) -> Bool

    FrontendConfig::to_json

    PackageConfig

    pub(all) struct PackageConfig {
    product_name : String
    version : String
    formats : Array[String]
    icons : Array[String]
    prepare : String?
    resources : Array[String]
    sign : SignConfig?
    url_schemes : Array[String]
    document_types : Array[DocumentType]
    output : String
    minimum_system_version : String?
    nsis_install_mode : String?
    } derive(Eq, ToJson,
    Debug
    ,
    FromJson
    )

    Package metadata, input preparation, and payloads consumed by proton_cli package.

    PackageConfig::PackageConfig

    fn PackageConfig::PackageConfig(product_name : String, version : String, formats? : Array[String], icons? : Array[String], prepare? : String?, resources? : Array[String], sign? : SignConfig?, url_schemes? : Array[String], document_types? : Array[DocumentType], output? : String, minimum_system_version? : String?, nsis_install_mode? : String?) -> PackageConfig

    PackageConfig::equal

    PackageConfig::not_equal

    fn PackageConfig::not_equal(x : PackageConfig, y : PackageConfig) -> Bool

    PackageConfig::to_json

    Platform

    pub(all) enum Platform {
    Macos
    Windows
    Linux
    } derive(Eq,
    Debug
    )

    Desktop host used to select project overrides, independently of build targets.

    Platform::equal

    fn Platform::equal(Platform, Platform) -> Bool

    Platform::not_equal

    fn Platform::not_equal(x : Platform, y : Platform) -> Bool

    Platform::to_repr

    SignConfig

    pub(all) struct SignConfig {
    binaries : Array[String]
    } derive(Eq, ToJson,
    Debug
    ,
    FromJson
    )

    SignConfig::SignConfig

    fn SignConfig::SignConfig(binaries? : Array[String]) -> SignConfig

    SignConfig::equal

    fn SignConfig::equal(SignConfig, SignConfig) -> Bool

    SignConfig::not_equal

    fn SignConfig::not_equal(x : SignConfig, y : SignConfig) -> Bool

    SignConfig::to_json

    fn SignConfig::to_json(SignConfig) -> Json

    current_platform

    fn current_platform() -> Platform

    Returns the operating system on which the configuration is being used.

    validate_application_identifier

    fn validate_application_identifier(value : String) -> String raise AppConfigError

    Validates and trims a canonical reverse-DNS application identifier.