Skip to content

Start Elixir SDK - #1

Open
wingyplus wants to merge 2 commits into
mainfrom
start-elixir-sdk
Open

Start Elixir SDK#1
wingyplus wants to merge 2 commits into
mainfrom
start-elixir-sdk

Conversation

@wingyplus

Copy link
Copy Markdown
Contributor

No description provided.

wingyplus and others added 2 commits August 14, 2026 11:37
Port the Elixir SDK out of dagger/dagger:sdk/elixir into this standalone repo,
on the CLI 1.0 SDK contract.

Elixir has no built-in engine runtime, so this follows dagger/java-sdk: the repo
owns both the SDK contract module and the runtime that new modules reference.

- elixir-sdk.dang / mod.dang / template.dang implement the contract: initModule
  seeds only SDK-owned template files, targetRuntime points at
  github.com/dagger/elixir-sdk/runtime, and generateAll is the @generate hook.
- Code generation moves from module load to `dagger generate`. mod.dang vendors
  the library plus schema-derived bindings into <module>/dagger_sdk, which is
  committed; runtime/main.dang becomes build-only and its codegen is a no-op.
- runtime/main.dang guards on a missing dagger_sdk and points at `dagger
  generate` rather than failing on an unresolvable path dependency.
- helpers/render-template reimplements the runtime's name conversions instead of
  using a general-purpose case library, which disagrees on acronyms and digits
  (strcase.ToCamel("HTTPServer") == "Httpserver", not "HttpServer"). A mismatch
  would name an Elixir module that does not exist at call time.
- sdk/ holds the client library and dagger_codegen. Tests needing a live engine
  are tagged :integration and excluded by default, so `mix test` is hermetic.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Thanabodee Charoenpiriyakij <wingyminus@gmail.com>
A freshly scaffolded module has no committed dagger_sdk/ yet, but
`dagger generate` must load every workspace module to discover
generators before the SDK's @generate hook can write it. The runtime
previously raised on the missing directory, and the resulting error
spans crashed the release CLI's trace consumer, failing generate and
every sdk-sdk check behind it.

moduleRuntime now declares introspectionJson as required — the engine's
opt-in to always receive the introspection schema, even for
dagger-module.toml modules — and, when dagger_sdk/mix.exs is missing or
empty, vendors the SDK and generates the API bindings on the fly before
compiling. Committed sources remain the fast path and `dagger generate`
still owns writing dagger_sdk/ to the workspace. The SDK sources reach
the runtime's context through ../sdk include patterns in its
dagger.json.

Verified end-to-end against the engine at ac0edaa8: sdk install →
module init → generate (exit 0, dagger_sdk written, fallback exercised
at load) → `module engine required` prints v1.0.0-beta.10 →
`api functions test-mod` succeeds.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant