glendix/configuration

Reads and interprets Glendix project configuration from gleam.toml.

Missing files and missing Glendix tables are valid and produce the same defaults as an empty configuration. Present values are decoded strictly so malformed TOML and schema mismatches cannot silently select tooling.

Types

One configured JavaScript module, its exported components, and lifecycle.

pub type BindingConfiguration {
  BindingConfiguration(
    module_name: String,
    exports: List(String),
    initialization: BindingInitialization,
  )
}

Constructors

  • BindingConfiguration(
      module_name: String,
      exports: List(String),
      initialization: BindingInitialization,
    )

Describes whether and how one configured module is initialized.

pub type BindingInitialization {
  NoInitialization
  Initialize(
    export_name: String,
    failure_policy: InitializationFailurePolicy,
  )
}

Constructors

  • NoInitialization

    The module can be consumed immediately without asynchronous initialization.

  • Initialize(
      export_name: String,
      failure_policy: InitializationFailurePolicy,
    )

    The module calls one configured zero-argument Promise-returning export.

The compatibility mode selected by the project.

pub type Compatibility {
  Standard
  ExperimentalNative
}

Constructors

  • Standard

    Uses the package manager’s standard command runner.

  • ExperimentalNative

    Runs Pluggable Widgets Tools through Glendix’s native runtime adapter.

A parsed project configuration.

pub opaque type Configuration

Describes a project configuration failure without discarding its cause.

pub type ConfigurationError {
  ConfigurationCouldNotBeRead(
    path: String,
    reason: simplifile.FileError,
  )
  ConfigurationCouldNotBeParsed(
    path: String,
    reason: tom.ParseError,
  )
  ConfiguredValueHasWrongType(
    key: List(String),
    expected: String,
    got: String,
  )
  CompatibilityIsUnsupported(value: String)
}

Constructors

  • ConfigurationCouldNotBeRead(
      path: String,
      reason: simplifile.FileError,
    )

    The configuration file exists but could not be read.

  • ConfigurationCouldNotBeParsed(
      path: String,
      reason: tom.ParseError,
    )

    The configuration file contains malformed TOML.

  • ConfiguredValueHasWrongType(
      key: List(String),
      expected: String,
      got: String,
    )

    A configured value does not have the schema’s required TOML type.

  • CompatibilityIsUnsupported(value: String)

    The configured compatibility mode is not supported.

Controls what happens after an asynchronous module initializer fails.

pub type InitializationFailurePolicy {
  CacheFailure
  RetryFailure
}

Constructors

  • CacheFailure

    Reuses the failed result until the caller explicitly resets the lifecycle.

  • RetryFailure

    Allows the next initialization call to start a new attempt.

Search Document