Start Elixir SDK - #1
Open
wingyplus wants to merge 2 commits into
Open
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.