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

    #proton/bootstrap

    justjavac/proton/bootstrap loads Proton app configuration.

    It decodes moon.proton into runtime manifests and project tooling metadata. It does not install extensions or create windows.

    Primary entry points:

    • load_config_manifest_from_file(...)
    • load_proton_project_config_from_file(...)
    • load_proton_project_summary_from_file(...)
    • load_runtime_manifest_from_json(...)

    BootstrapError

    pub(all) suberror BootstrapError {
    ProjectConfig(
    ProjectConfigError
    )
    ManifestRead(path~ : String, detail~ : String)
    InvalidJson(context~ : String, detail~ : String)
    MissingField(path~ : String)
    InvalidField(path~ : String, expectation~ : String)
    UnsupportedField(path~ : String, reason~ : String)
    UnsupportedValue(path~ : String, value~ : String)
    } derive(Eq,
    Debug
    )

    Failures while loading user configuration or internal runtime manifests.

    BootstrapError::message

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

    LoadedAppManifest

    type LoadedAppManifest

    Loaded manifest plus the base directory used to resolve relative file paths.

    LoadedAppManifest::base_dir

    fn LoadedAppManifest::base_dir(self : LoadedAppManifest) -> String?

    Returns the manifest base directory, if the manifest came from disk. Relative file entries should be interpreted against this directory when it is present.

    LoadedAppManifest::manifest

    Returns the loaded manifest value. This is a cheap accessor over the normalized manifest captured at load time.

    LoadedAppManifest::new

    Creates a loaded manifest wrapper. This is primarily used by bootstrap helpers that need to carry both the typed manifest value and its optional base directory.

    ProtonAppMetadata

    type ProtonAppMetadata

    Release metadata resolved from moon.proton and the nearest moon.mod.

    ProtonAppMetadata::description

    fn ProtonAppMetadata::description(self : ProtonAppMetadata) -> String?

    ProtonAppMetadata::identifier

    fn ProtonAppMetadata::identifier(self : ProtonAppMetadata) -> String?

    ProtonAppMetadata::license

    fn ProtonAppMetadata::license(self : ProtonAppMetadata) -> String?

    ProtonAppMetadata::new

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

    ProtonAppMetadata::product_name

    fn ProtonAppMetadata::product_name(self : ProtonAppMetadata) -> String

    ProtonAppMetadata::version

    fn ProtonAppMetadata::version(self : ProtonAppMetadata) -> String?

    ProtonBackendConfig

    type ProtonBackendConfig

    Backend module settings from moon.proton.

    ProtonBackendConfig::app_package

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

    ProtonBackendConfig::new

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

    ProtonBackendConfig::path

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

    ProtonBundleConfig

    type ProtonBundleConfig

    Bundle input settings from moon.proton.

    ProtonBundleConfig::active

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

    ProtonBundleConfig::icon

    fn ProtonBundleConfig::icon(self : ProtonBundleConfig) -> Array[String]

    ProtonBundleConfig::new

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

    ProtonBundleConfig::output

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

    ProtonBundleConfig::resources

    fn ProtonBundleConfig::resources(self : ProtonBundleConfig) -> Array[String]

    ProtonBundleConfig::targets

    fn ProtonBundleConfig::targets(self : ProtonBundleConfig) -> Array[String]

    ProtonBundleConfig::url_schemes

    fn ProtonBundleConfig::url_schemes(self : ProtonBundleConfig) -> Array[String]

    ProtonFrontendConfig

    type ProtonFrontendConfig

    Frontend dev/build settings from moon.proton.

    ProtonFrontendConfig::before_build

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

    ProtonFrontendConfig::before_dev

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

    ProtonFrontendConfig::dev_url

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

    ProtonFrontendConfig::dist

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

    ProtonFrontendConfig::new

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

    ProtonFrontendConfig::path

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

    ProtonProjectConfig

    type ProtonProjectConfig

    Complete moon.proton document for developer tooling.

    ProtonProjectConfig::backend

    ProtonProjectConfig::bundle

    ProtonProjectConfig::dev_manifest

    Returns the runtime manifest that proton dev should start.

    When frontend.dev_url is present, the entry is replaced in memory with that URL. The source moon.proton file is not rewritten.

    ProtonProjectConfig::frontend

    ProtonProjectConfig::manifest

    ProtonProjectConfig::metadata

    ProtonProjectConfig::new

    ProtonProjectConfig::to_summary_json

    fn ProtonProjectConfig::to_summary_json(self : ProtonProjectConfig) -> Json

    Returns a normalized JSON summary suitable for proton inspect config.

    app_manifest_to_json

    fn app_manifest_to_json(manifest :
    AppManifest
    ) -> Json

    Converts a typed runtime manifest into JSON for native runtime handoff.

    load_config_manifest_from_file

    fn load_config_manifest_from_file(path : String) -> LoadedAppManifest raise BootstrapError

    load_proton_project_config_from_file

    fn load_proton_project_config_from_file(path : String) -> ProtonProjectConfig raise BootstrapError

    load_proton_project_summary_from_file

    fn load_proton_project_summary_from_file(path : String) -> Json raise BootstrapError

    load_runtime_manifest_from_json

    fn load_runtime_manifest_from_json(text : String) -> LoadedAppManifest raise BootstrapError

    Parses an internal runtime manifest from JSON text.

    User-facing app config is moon.proton. Runtime manifests are only used for native runtime bootstrap and may carry code-declared extension settings.