Sign in

    proton_config

    Typed project configuration models and JSON decoding for Proton.

    Download zip
    Version
    0.1.17
    License
    Apache-2.0
    Last updated
    2 months ago
    Downloads
    26K

    moonbit-community/proton_config does not have a README file

    ProjectConfigError

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

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

    ProjectConfigError::equal

    ProjectConfigError::message

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

    ProjectConfigError::not_equal

    ProjectConfigError::output

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

    ProjectConfigError::to_string

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

    LoadedProjectConfig

    pub(all) struct LoadedProjectConfig {
    config : ProjectConfig
    warnings : Array[String]
    } derive(Eq,
    Debug
    )

    LoadedProjectConfig::config

    LoadedProjectConfig::equal

    LoadedProjectConfig::new

    fn LoadedProjectConfig::new(config : ProjectConfig, warnings? : Array[String]) -> LoadedProjectConfig

    LoadedProjectConfig::not_equal

    LoadedProjectConfig::warnings

    fn LoadedProjectConfig::warnings(self : LoadedProjectConfig) -> Array[String]

    MoonModMetadata

    pub(all) struct MoonModMetadata {
    root_dir : String?
    name : String?
    version : String?
    description : String?
    license : String?
    repository : String?
    readme : String?
    keywords : Array[String]
    } derive(Eq,
    Debug
    )

    Metadata read from a moon.mod file.

    MoonModMetadata::equal

    MoonModMetadata::not_equal

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

    ProjectAppWindowConfig

    pub(all) struct ProjectAppWindowConfig {
    id : String
    window : ProjectWindowConfig
    entry : ProjectEntry
    open_on_start : Bool
    } derive(Eq,
    Debug
    )

    ProjectAppWindowConfig::equal

    ProjectAppWindowConfig::new

    fn ProjectAppWindowConfig::new(id : String, window : ProjectWindowConfig, entry : ProjectEntry, open_on_start? : Bool) -> ProjectAppWindowConfig

    ProjectAppWindowConfig::not_equal

    ProjectBackendConfig

    pub(all) struct ProjectBackendConfig {
    path : String
    app_package : String
    } derive(Eq,
    Debug
    )

    ProjectBackendConfig::app_package

    fn ProjectBackendConfig::app_package(self : ProjectBackendConfig) -> String

    ProjectBackendConfig::equal

    ProjectBackendConfig::new

    fn ProjectBackendConfig::new(path : String, app_package : String) -> ProjectBackendConfig

    ProjectBackendConfig::not_equal

    ProjectBackendConfig::path

    fn ProjectBackendConfig::path(self : ProjectBackendConfig) -> String

    ProjectBundleConfig

    pub(all) struct ProjectBundleConfig {
    active : Bool
    targets : Array[String]
    icon : Array[String]
    resources : Array[String]
    sign : ProjectSignConfig?
    url_schemes : Array[String]
    document_types : Array[ProjectDocumentType]
    output : String
    } derive(Eq,
    Debug
    )

    ProjectBundleConfig::active

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

    ProjectBundleConfig::equal

    ProjectBundleConfig::new

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

    ProjectBundleConfig::not_equal

    ProjectBundleConfig::output

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

    ProjectConfig

    pub(all) struct ProjectConfig {
    base_dir : String
    window : ProjectWindowConfig
    entry : ProjectEntry
    windows : Array[ProjectAppWindowConfig]
    metadata : ProjectMetadata
    backend : ProjectBackendConfig?
    frontend : ProjectFrontendConfig?
    bundle : ProjectBundleConfig?
    updater : ProjectUpdaterConfig?
    permissions : Array[ProjectPermissionGrant]
    debug : Int
    single_instance : Bool
    } derive(Eq,
    Debug
    )

    ProjectConfig::backend

    ProjectConfig::base_dir

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

    ProjectConfig::bundle

    ProjectConfig::debug

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

    ProjectConfig::entries

    Returns the primary entry followed by each secondary window entry in declaration order.

    ProjectConfig::entry

    ProjectConfig::equal

    ProjectConfig::frontend

    ProjectConfig::metadata

    ProjectConfig::new

    fn ProjectConfig::new(base_dir : String, window : ProjectWindowConfig, entry : ProjectEntry, metadata : ProjectMetadata, windows? : Array[ProjectAppWindowConfig], backend? : ProjectBackendConfig?, frontend? : ProjectFrontendConfig?, bundle? : ProjectBundleConfig?, updater? : ProjectUpdaterConfig?, permissions? : Array[ProjectPermissionGrant], debug? : Int, single_instance? : Bool) -> ProjectConfig

    ProjectConfig::not_equal

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

    ProjectConfig::permissions

    ProjectConfig::single_instance

    fn ProjectConfig::single_instance(self : ProjectConfig) -> Bool

    ProjectConfig::updater

    ProjectConfig::window

    ProjectConfig::windows

    ProjectDocumentType

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

    ProjectDocumentType::equal

    ProjectDocumentType::extensions

    fn ProjectDocumentType::extensions(self : ProjectDocumentType) -> Array[String]

    ProjectDocumentType::new

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

    ProjectDocumentType::not_equal

    ProjectEntry

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

    ProjectEntry::equal

    ProjectEntry::not_equal

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

    ProjectFrontendConfig

    pub(all) struct ProjectFrontendConfig {
    dev_url : String?
    dist : String?
    before_dev : String?
    before_build : String?
    path : 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::dev_url

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

    ProjectFrontendConfig::dist

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

    ProjectFrontendConfig::equal

    ProjectFrontendConfig::new

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

    ProjectFrontendConfig::not_equal

    ProjectFrontendConfig::path

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

    ProjectMetadata

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

    ProjectMetadata::equal

    ProjectMetadata::new

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

    ProjectMetadata::not_equal

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

    ProjectPermissionGrant

    pub(all) struct ProjectPermissionGrant {
    window : String
    origin : String
    extension : String
    scope : Json
    } derive(Eq,
    Debug
    )

    One renderer capability grant from proton.project.json.

    window is main or a declared secondary window id. origin is app for bundled Proton pages or entry for the configured window entry. Extension-specific restrictions live in scope.

    ProjectPermissionGrant::equal

    ProjectPermissionGrant::new

    fn ProjectPermissionGrant::new(window : String, origin : String, extension : String, scope? : Json) -> ProjectPermissionGrant

    ProjectPermissionGrant::not_equal

    ProjectSignConfig

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

    Signing settings for files copied through bundle.resources.

    ProjectSignConfig::binaries

    fn ProjectSignConfig::binaries(self : ProjectSignConfig) -> Array[String]

    Returns the project paths whose packaged copies must be signed.

    ProjectSignConfig::equal

    ProjectSignConfig::new

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

    Creates signing settings for package-relative resource binaries.

    ProjectSignConfig::not_equal

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

    ProjectTitlebarStyle

    pub(all) enum ProjectTitlebarStyle {
    TitlebarDefault
    TitlebarOverlay
    } derive(Eq,
    Debug
    )

    ProjectTitlebarStyle::equal

    ProjectTitlebarStyle::not_equal

    ProjectUpdaterConfig

    pub(all) struct ProjectUpdaterConfig {
    active : Bool
    endpoint : String
    public_keys : Array[String]
    check_on_launch : Bool
    freshness_days : Int
    } derive(Eq,
    Debug
    )

    The application's update channel, as declared in proton.project.json.

    This carries only what the runtime needs in order to decide whether to check, and whom to trust when it does. No private key material appears here, or anywhere else the framework can reach.

    ProjectUpdaterConfig::checks_on_launch

    fn ProjectUpdaterConfig::checks_on_launch(self : ProjectUpdaterConfig) -> Bool

    ProjectUpdaterConfig::endpoint

    fn ProjectUpdaterConfig::endpoint(self : ProjectUpdaterConfig) -> String

    ProjectUpdaterConfig::equal

    ProjectUpdaterConfig::freshness_days

    fn ProjectUpdaterConfig::freshness_days(self : ProjectUpdaterConfig) -> Int

    ProjectUpdaterConfig::is_active

    fn ProjectUpdaterConfig::is_active(self : ProjectUpdaterConfig) -> Bool

    ProjectUpdaterConfig::new

    fn ProjectUpdaterConfig::new(endpoint : String, public_keys : Array[String], active? : Bool, check_on_launch? : Bool, freshness_days? : Int) -> ProjectUpdaterConfig

    ProjectUpdaterConfig::not_equal

    ProjectUpdaterConfig::public_keys

    fn ProjectUpdaterConfig::public_keys(self : ProjectUpdaterConfig) -> Array[String]

    ProjectWindowConfig

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

    ProjectWindowConfig::equal

    ProjectWindowConfig::new

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

    ProjectWindowConfig::not_equal

    ProjectWindowSizeHint

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

    ProjectWindowSizeHint::equal

    ProjectWindowSizeHint::not_equal

    load_project_config_from_file

    fn load_project_config_from_file(path : String) -> LoadedProjectConfig raise ProjectConfigError

    load_project_config_from_json

    fn load_project_config_from_json(json : Json, base_dir : String) -> LoadedProjectConfig raise ProjectConfigError

    Validates an already parsed Proton project JSON document without serializing it through an intermediate string.

    load_project_config_from_text

    fn load_project_config_from_text(source : String, base_dir : String, name? : String) -> LoadedProjectConfig raise ProjectConfigError

    Parses project JSON text at an I/O boundary, then validates the resulting native Json value.

    read_moon_mod_metadata

    fn read_moon_mod_metadata(root_dir : String) -> MoonModMetadata

    Reads metadata from moon.mod in exactly the specified module root. Missing, unreadable, and malformed manifests produce empty metadata.

    read_nearest_moon_mod_metadata

    fn read_nearest_moon_mod_metadata(start_dir : String) -> MoonModMetadata

    Reads metadata from the nearest enclosing moon.mod file. Missing, unreadable, and malformed manifests produce empty metadata.

    Powered by MoonBit

    Site sourceReport issuePackagesBuild queueSkillsStatistics

    © 2026 mooncakes.io