Skip to content

About

Alchemy for MoonBit: infrastructure described as Effects, on opraying/effect.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

22 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

opraying/alchemy

Alchemy for MoonBit. MoonBit compiles to JavaScript. A stack, a resource, or an output is the Alchemy object itself, typed with Effect from opraying/effect. There is no second runtime.

@alchemy.run/sigil is not bound. The core can build a neutral bundle that does not import Node or Bun.

Scripts

./scripts/alchemy-build.sh is the entry point: setup, generate, check, and test. ./scripts/ci.sh is the full gate. ./scripts/new-app.sh scaffolds an example. Commands and invariants are in AGENTS.md.

Design

The binding follows Alchemy: infrastructure described as Effects. Providers are generated from the published @alchemy.run/* packages. The stack, engine, state, and secrets are hand-written so a program can plan and apply without a generated provider. The upstream pin lives in the repository package.json.

Example

examples/app defines a resource class, a provider, and a stack. The provider's reconcile returns the outputs later stages read:

let kv_cls : @Alchemy.ResourceClass[Json] = @Alchemy.ResourceClass::make("Core.KV")
let provider = @Alchemy.ProviderTag::succeed_json(
  kv_cls,
  reconcile=fn(input) {
    @Effect.succeed(Json::object({
      "endpoint": Json::string("https://kv.internal/" + input.id()),
    }))
  },
  delete=fn(_) { @Effect.succeed(()) },
)

examples/cloud-stack uses real providers. examples/combinators covers names, retention, and outputs. examples/module is the TypeScript consumer of the emitted .d.ts.

What is included

The core is Alchemy, Engine, State, Secrets, Auth, Bundle, Command, and Dns. Generated packages cover the cloud providers. A resource prop accepts either a literal or an Output, and an Output resolves to the MoonBit value, not the JavaScript one.

Hand-written sources

Cloud provider packages (Aws/, Cloudflare/, Gcp/, etc.) are generated bindings linked from the generated/ submodule (opraying/mbt-generated, branch alchemy). Focus edits on the hand-written core and generator:

License

Apache-2.0. Copyright the opraying contributors.

About

Alchemy for MoonBit: infrastructure described as Effects, on opraying/effect.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages