Skip to content

Wirespec IR Language#587

Open
wilmveel wants to merge 28 commits intomasterfrom
feat/wirespec-language
Open

Wirespec IR Language#587
wilmveel wants to merge 28 commits intomasterfrom
feat/wirespec-language

Conversation

@wilmveel
Copy link
Contributor

…structs

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 feat/wirespec-language branch from 7220eef to d026348 Compare February 3, 2026 11:47
@wilmveel wilmveel changed the title Wirespec Language Wirespec IR Language Feb 11, 2026
@wilmveel wilmveel force-pushed the feat/wirespec-language branch 6 times, most recently from d8b6d55 to 6f04737 Compare February 15, 2026 20:11
@wilmveel wilmveel force-pushed the feat/wirespec-language branch from 2888e48 to 2b1be4c Compare February 20, 2026 08:19
intellij = "2.6.0"
jackson = "2.20.1"
java = "17"
junit = "5.10.0"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use kotest

val isOverride: Boolean = false,
) : HasName

data class Static(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Namespace


import community.flock.wirespec.language.core.Element

interface CodeGenerator {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generator

import community.flock.wirespec.language.core.Type
import community.flock.wirespec.language.core.file
import org.junit.Test
import java.io.File
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verwijderen

wilmveel and others added 20 commits March 1, 2026 22:58
# Conflicts:
#	examples/maven-spring-convert/src/main/kotlin/community/flock/wirespec/examples/openapi/app/WirespecConfiguration.kt
#	src/integration/wirespec/src/jvmMain/kotlin/community/flock/wirespec/kotlin/Wirespec.kt
Extract PetstoreService into a shared service module, add lib.rs to
expose modules for integration tests, and refactor server/client binaries
to import from the lib crate. Includes a fix for deserialize_param to
handle single-element arrays correctly.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Simplify the Transform DSL with a builder-pattern API, add Reflect type
support, expand Rust generator and emitter with tests, and update verify
tool with broader conversion test coverage.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Includes:
- `CirceSerialization.scala` for custom serialization.
- `GuruClient.scala` as an HTTP client implementation.
- Unit tests in `GuruClientSpec.scala`.
- SBT project configuration, `.gitignore`, and `gen.sh` script to automate Scala code generation.
- Introduce a `GuruServer` with ZIO HTTP routing and Circe serialization.
- Add `GuruHandler` to implement and mock API endpoints.
- Include unit and integration tests: `GuruServerSpec` for routes and `GuruClientSpec` for API client.
- Refactor serialization with streamlined Circe codec implementations.
- Simplify `GuruClient` using extension methods for request handling.
Update serialization.rs to use serde traits directly (generated wirespec.rs
no longer defines Serialize/Deserialize traits), and rename camelCase fields
to snake_case across client, service, and tests.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…d improve Rust/Scala examples with serializer refactoring and added tools.
…n, and Python generators to replace `camelCase` and `pascalCase` logic with `value()` for improved field emission.
…name emission logic

- Add platform detection to `example.sh` for building platform-specific CLI binaries.
- Fix IR emitter to use `name.value()` for accurate file name generation.
Deleted redundant code for the following endpoints: `add_pet`, `create_user`, `create_users_with_array_input`, `create_users_with_list_input`, `delete_order`, `delete_pet`, and `delete_user`. Cleaned up unused modules to simplify the codebase.
Streamline the generated Rust code by eliminating unnecessary `serde` attributes and `Serialize`/`Deserialize` traits from test structures and enums. Adjust test implementations accordingly for cleaner output.
…support type-specific handling for `Vec<TodoDto>`, `String`, and `bool`, with improved error handling for unsupported types.
…mon struct flattening logic

Replace raw string templates in Kotlin and Scala emitters with structured IR DSL builders for ClientEdge/ServerEdge/Client/Server interfaces. Extract duplicated `flattenNestedStructs` and `qualifyNestedRefs` logic from Python, Rust, and Scala emitters into a shared `Restructure.kt` utility. Simplify TypeScript refined type emission by exposing `generateExpression()` on the TypeScript generator.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@wilmveel wilmveel force-pushed the feat/wirespec-language branch from 487de34 to 4a2c0b0 Compare March 1, 2026 22:00
wilmveel and others added 8 commits March 1, 2026 23:24
…elper

Add statementAndExpression to TransformerBuilder and TransformScope to
eliminate duplicated statement/expression transformer blocks. Apply across
all 6 emitters: remove unnecessary asSequence(), replace listOf('_') with
== '_', use buildString instead of StringBuilder, replace mutable lists
with partition/buildList, and flatten nested transforms.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…bility and consistency

- Simplify `generateExpression` in `TypeScriptGenerator` by reducing line breaks.
- Enhance `Restructure` transform logic with clearer formatting and explicit braces for better readability.
- Remove redundant test assertion in `TransformTest`.
Documents the plan to replace the raw string template in RustIrEmitter.shared
with the standard AstShared.convert() -> transform -> generateRust() pipeline.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
8-task plan: scaffold pipeline, add element transforms, inject Rust-only
traits, fix formatting, and verify all tests pass.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…peline

Replace the hardcoded raw string template in RustIrEmitter.shared with
a pipeline-based implementation using AstShared.convert() -> transform
-> generateRust(), aligning Rust with all other language emitters.

The pipeline extracts elements from the Namespace("Wirespec") wrapper,
adds Rust-specific imports, replaces interfaces the generator cannot
produce correctly (Enum, Refined, Request, Response, serialization
traits, Transportation) with RawElement, injects Rust-only traits
(RequestHeaders, ResponseHeaders, Client, Server), and adds &self
to interface function parameters for idiomatic Rust trait methods.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…rEmitter

Merge the interface replacement and header injection into a single
LanguageFile pass so injection decisions are based on interface names
rather than matching against generated RawElement code strings. Fix the
RustGenerator to emit ": " instead of " : " for trait extends, removing
the need for the regex workaround in the emitter.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…onsistency, and efficiency

- Simplify logic with `filterNot`, `when`, and improved string templating.
- Consolid
…t pipeline

Extract transform logic into focused helper methods (flattenForRust, rustifyEndpoint,
fixRawExpressionIdentifiers, fixResponseSwitchPatterns, fixConstructorCalls, etc.)
and fix derive macro injection to use flatMap instead of matchingElements to avoid
recursion issues.

Co-Authored-By: Claude Opus 4.6 <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