Skip to content

Ir emitters#607

Open
wilmveel wants to merge 34 commits intomasterfrom
ir
Open

Ir emitters#607
wilmveel wants to merge 34 commits intomasterfrom
ir

Conversation

@wilmveel
Copy link
Copy Markdown
Contributor

@wilmveel wilmveel commented Mar 6, 2026

Description

Type of Change

  • Feature
  • Bug fix
  • Documentation update
  • Refactoring
  • Performance improvement
  • Build/CI pipeline changes
  • Other (please describe):

Checklist

  • I have followed the contribution guidelines
  • I have written tests for my changes
  • I have updated the documentation if necessary
  • I have written code in a functional style (using Arrow where appropriate)

Breaking Changes

@wilmveel wilmveel force-pushed the ir branch 2 times, most recently from ea7fe73 to ec9c43e Compare March 12, 2026 10:25
wilmveel and others added 3 commits March 12, 2026 13:50
# Conflicts:
#	src/compiler/emitters/java/src/commonTest/kotlin/community/flock/wirespec/emitters/java/JavaEmitterTest.kt
#	src/compiler/emitters/kotlin/src/commonTest/kotlin/community/flock/wirespec/emitters/kotlin/KotlinEmitterTest.kt
#	src/converter/openapi/src/commonTest/kotlin/community/flock/wirespec/openapi/v2/OpenAPIV2EmitterTest.kt
#	src/integration/avro/src/jvmTest/kotlin/community/flock/wirespec/integration/avro/java/emit/AvroJavaEmitterTest.kt
#	src/integration/avro/src/jvmTest/kotlin/community/flock/wirespec/integration/avro/kotlin/emit/AvroKotlinEmitterTest.kt

# Conflicts:
#	src/integration/wirespec/src/jvmTest/kotlin/community/flock/wirespec/kotlin/serde/DefaultPathSerializationTest.kt
Runs Testcontainers-based compilation tests for generated code
(Kotlin, Python, Rust, Scala) using Docker on ubuntu-latest.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
wilmveel and others added 24 commits March 12, 2026 14:50
Alias zio.http.Client as ZClient to avoid ambiguity with the generated
Wirespec Client type from the endpoint wildcard import.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The handler trait methods are now async fn, so client calls return
futures that need to be awaited. Use tokio runtime block_on to drive
them in the sync test.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Move per-endpoint client files from endpoint/ to client/ subdirectory
and the main client.rs to the gen root level, using Rust 2018+ module
layout (client.rs + client/ directory).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Parse the fixture's Wirespec source to extract endpoint and model names,
replacing hardcoded per-language import blocks with reusable helpers.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Apply the same pattern used for Rust to Java, Kotlin, Scala, TypeScript,
and Python: emit client files into a dedicated client/ subdirectory
instead of co-locating them in the endpoint/ directory.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Client code in the separate client/ package needs to explicitly import
the endpoint class it references. This was unnecessary when client and
endpoint code shared the same package.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The per-endpoint client files stay in client/, but the main Client
that aggregates all endpoints is emitted at the package root level,
matching the Rust pattern (client.rs at gen root, per-endpoint files
in client/ subdirectory).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…n warning

The node:20-slim Docker image now ships with TypeScript 7 which deprecated
"moduleResolution": "node" (renamed to "node10"). Added ignoreDeprecations
to unblock tsc --noEmit in verify tests.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Adds serializeBody, deserializeBody, serializePath, deserializePath,
serializeParam, and deserializeParam to support the IR-generated
Wirespec.Serialization interface while keeping existing serialize/deserialize.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The exit calls were a leftover workaround from initial development.
The generated Rust from_raw_response code works correctly without them.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…anguage generators

Implements optional case-insensitive keys for array lookup in generators and includes static content in `main` for Python, Kotlin, TypeScript, and related emitters.
…rators and tests

Eliminates the `BorrowExpression` IR type and its usage across all language generators, simplifying the IR structure and related code logic.
…rators and tests

Eliminates the `BorrowExpression` IR type and its usage across all language generators, simplifying the IR structure and related code logic.
…ined traits and simplify client parameter logic
…tic Kotlin

Unify all 6 IR emitters (Java, Kotlin, TypeScript, Python, Rust, Scala) to follow
the same section ordering and naming conventions. Apply idiomatic Kotlin patterns
including listOf() for static lists, buildList for conditional elements, private
visibility on internal extensions, and val+return over .let chains.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…orts

Introduce literal type variants for integer and string values in the IR type
system, enabling typed status codes in endpoint responses. Add Python import
grouping to consolidate same-path imports into single statements.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Cast response to any in the default branch of pattern switches to avoid
TypeScript narrowing the type to never after exhaustive literal matching.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…er transforms

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…mitter transform

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
wilmveel and others added 7 commits April 2, 2026 16:18
…to emitter transform

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…de()

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…sform

TypeDescriptor nodes are now replaced with RawExpression in the Java
emitter's transform pipeline, making the generator a pure syntax printer
that no longer contains Java-specific type descriptor logic.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ces in converter

Populate response variant struct interfaces (Response2XX, ResponseTodoDto, etc.)
directly in the converter instead of relying on generators to discover parent
unions at generation time. Remove isInterface(), resolveParentUnions(),
findAllUnions(), and allUnions from all generators (Java, Kotlin, Scala, Python,
Rust). Update DSL tests to explicitly set struct implements and union extends.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ator to emitter transform

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add transformTestFile() to IrEmitter so language-specific IR transforms
(TypeDescriptor, pattern switches, borrow args) are applied to verify
test files before code generation. Remove -it from docker test script.

Co-Authored-By: Claude Opus 4.6 (1M context) <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