spikard 0.16.0 → 0.17.0.pre.rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2c9b22ae1b233215e4e86f08289fb64749d9f30f1a0f62f18d6352e2afd50c43
4
- data.tar.gz: 1b39eb8b78cb99cc15dde6e9aa782cdff1a3e60281b6d5bb7dbc9c80730684c9
3
+ metadata.gz: 2c70b591ea6a27df4ec1f4b3b8dfd349b9d63f7ec7bcd374b8161f4991030ac9
4
+ data.tar.gz: f38aa7abff1e4b77dee6567d44b71a7d34c1478ec19138ecd487973716e0a920
5
5
  SHA512:
6
- metadata.gz: 56c04624eb0ae08a943514b67fd852f7adeb4e27c55287b27f29274f8cbbfb154bfcca4c98b096e8f686a3334d056166af549ca0b8d1d6e9ec46e745a2a00d57
7
- data.tar.gz: 8d9f438028202c3b34b5611a1acf84309e359c6cd91bab3e0f87fd55e0406d55edba9eebb34f7462dd1b6e06cc1b93af741a156ebcf16f53981c0f24729e0acd
6
+ metadata.gz: e1143967742d18de4f9c9de94d6b32f0ed0f6d3eb644f52fb76968f78ae310edceccd8ca9711a63b1d7340822a340aad12ecb363047bb9fb4733e3a47b990999
7
+ data.tar.gz: 367367ee84b8e18f96c97eb65631728491de01521a294bd5d2e6db8fa47c023aa34cb9cdec2b1caa19a8c55b04002718d11ce37fc63cd3171a39445de7f765ac
data/README.md CHANGED
@@ -1,85 +1,89 @@
1
- # Spikard
1
+ <!-- markdownlint-disable MD033 MD041 -->
2
+ <div align="center">
3
+
4
+ <img src="https://raw.githubusercontent.com/Goldziher/spikard/main/docs/assets/spikard-banner.svg" alt="spikard - polyglot web toolkit" width="820">
5
+
6
+ **Spikard** — Part of the spikard polyglot web toolkit.
7
+
8
+ Rust-centric polyglot HTTP framework with OpenAPI/AsyncAPI/GraphQL/JSON-RPC codegen, tower-http middleware, and fixture-driven cross-language testing. Ruby bindings via Magnus with idiomatic Ruby API.
2
9
 
3
10
  <div align="center" style="display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 20px 0;">
4
- <!-- Built with -->
5
- <a href="https://github.com/kreuzberg-dev/alef">
6
- <img src="https://img.shields.io/badge/Bindings-alef%20%D7%90-007ec6" alt="Bindings">
11
+ <!-- Built with alef -->
12
+ <a href="https://github.com/xberg-io/alef">
13
+ <img src="https://img.shields.io/badge/built%20with-alef%20%D7%90-007ec6?style=flat-square" alt="Built with alef">
7
14
  </a>
8
15
 
9
- <!-- Language Bindings -->
16
+ <!-- Language bindings -->
10
17
  <a href="https://crates.io/crates/spikard">
11
- <img src="https://img.shields.io/crates/v/spikard?label=Rust&color=007ec6" alt="Rust">
18
+ <img src="https://img.shields.io/crates/v/spikard?color=007ec6&style=flat-square" alt="Rust">
12
19
  </a>
13
20
  <a href="https://pypi.org/project/spikard/">
14
- <img src="https://img.shields.io/pypi/v/spikard?label=Python&color=007ec6" alt="Python">
21
+ <img src="https://img.shields.io/pypi/v/spikard?color=007ec6&style=flat-square" alt="Python">
15
22
  </a>
16
23
  <a href="https://www.npmjs.com/package/@spikard/node">
17
- <img src="https://img.shields.io/npm/v/@spikard/node?label=Node.js&color=007ec6" alt="Node.js">
24
+ <img src="https://img.shields.io/npm/v/@spikard/node?color=007ec6&style=flat-square" alt="Node.js">
18
25
  </a>
19
26
  <a href="https://www.npmjs.com/package/@spikard/node-wasm">
20
- <img src="https://img.shields.io/npm/v/@spikard/node-wasm?label=WASM&color=007ec6" alt="WASM">
27
+ <img src="https://img.shields.io/npm/v/@spikard/node-wasm?color=007ec6&style=flat-square" alt="WASM">
21
28
  </a>
22
29
  <a href="https://rubygems.org/gems/spikard">
23
- <img src="https://img.shields.io/gem/v/spikard?label=Ruby&color=007ec6" alt="Ruby">
30
+ <img src="https://img.shields.io/gem/v/spikard?color=007ec6&style=flat-square" alt="Ruby">
24
31
  </a>
25
32
  <a href="https://packagist.org/packages/goldziher/spikard">
26
- <img src="https://img.shields.io/packagist/v/goldziher/spikard?label=PHP&color=007ec6" alt="PHP">
33
+ <img src="https://img.shields.io/packagist/v/goldziher/spikard?color=007ec6&style=flat-square" alt="PHP">
27
34
  </a>
28
35
  <a href="https://hex.pm/packages/spikard">
29
- <img src="https://img.shields.io/hexpm/v/spikard?label=Elixir&color=007ec6" alt="Elixir">
36
+ <img src="https://img.shields.io/hexpm/v/spikard?color=007ec6&style=flat-square" alt="Elixir">
30
37
  </a>
31
38
  <a href="https://central.sonatype.com/artifact/dev.spikard/spikard">
32
- <img src="https://img.shields.io/maven-central/v/dev.spikard/spikard?label=Java&color=007ec6" alt="Java">
39
+ <img src="https://img.shields.io/maven-central/v/dev.spikard/spikard?color=007ec6&style=flat-square" alt="Java">
33
40
  </a>
34
41
  <a href="https://github.com/Goldziher/spikard/releases">
35
- <img src="https://img.shields.io/github/v/tag/Goldziher/spikard?label=Go&color=007ec6" alt="Go">
42
+ <img src="https://img.shields.io/github/v/tag/Goldziher/spikard?label=Go&color=007ec6&style=flat-square" alt="Go">
36
43
  </a>
37
44
  <a href="https://www.nuget.org/packages/Spikard/">
38
- <img src="https://img.shields.io/nuget/v/Spikard?label=C%23&color=007ec6" alt="C#">
45
+ <img src="https://img.shields.io/nuget/v/Spikard?color=007ec6&style=flat-square" alt="C#">
39
46
  </a>
40
47
  <a href="https://central.sonatype.com/artifact/dev.spikard/spikard">
41
- <img src="https://img.shields.io/maven-central/v/dev.spikard/spikard?label=Kotlin&color=007ec6" alt="Kotlin">
48
+ <img src="https://img.shields.io/maven-central/v/dev.spikard/spikard?label=Kotlin&color=007ec6&style=flat-square" alt="Kotlin">
42
49
  </a>
43
50
  <a href="https://pub.dev/packages/spikard">
44
- <img src="https://img.shields.io/pub/v/spikard?label=Dart&color=007ec6" alt="Dart">
51
+ <img src="https://img.shields.io/pub/v/spikard?color=007ec6&style=flat-square" alt="Dart">
45
52
  </a>
46
53
  <a href="https://github.com/Goldziher/spikard/tree/main/packages/swift">
47
- <img src="https://img.shields.io/badge/Swift-Spikard-007ec6" alt="Swift">
54
+ <img src="https://img.shields.io/badge/Swift-Spikard-007ec6?style=flat-square" alt="Swift">
48
55
  </a>
49
56
  <a href="https://github.com/Goldziher/spikard/tree/main/packages/zig">
50
- <img src="https://img.shields.io/badge/Zig-spikard-007ec6" alt="Zig">
57
+ <img src="https://img.shields.io/badge/Zig-spikard-007ec6?style=flat-square" alt="Zig">
51
58
  </a>
52
59
  <a href="https://github.com/Goldziher/spikard/tree/main/crates/spikard-ffi">
53
- <img src="https://img.shields.io/badge/C-FFI-007ec6" alt="C FFI">
60
+ <img src="https://img.shields.io/badge/C%20FFI-007ec6?style=flat-square" alt="C FFI">
54
61
  </a>
55
62
  <a href="https://github.com/Goldziher/homebrew-tap">
56
- <img src="https://img.shields.io/badge/Homebrew-007ec6?logo=homebrew&logoColor=white" alt="Homebrew">
63
+ <img src="https://img.shields.io/badge/Homebrew-007ec6?style=flat-square&logo=homebrew&logoColor=white" alt="Homebrew">
57
64
  </a>
58
65
 
59
- <!-- Project Info -->
66
+ <!-- Project info -->
60
67
  <a href="https://github.com/Goldziher/spikard/blob/main/LICENSE">
61
- <img src="https://img.shields.io/badge/License-MIT-007ec6" alt="License">
62
- </a>
63
- <a href="https://github.com/Goldziher/spikard/tree/main/docs">
64
- <img src="https://img.shields.io/badge/Docs-spikard-007ec6" alt="Documentation">
68
+ <img src="https://img.shields.io/badge/License-MIT-007ec6?style=flat-square" alt="License">
65
69
  </a>
66
70
  </div>
67
71
 
68
- <div align="center" style="display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin: 28px 0 24px;">
69
- <a href="https://discord.gg/pXxagNK2zN">
70
- <img height="22" src="https://img.shields.io/badge/Discord-Chat-007ec6?logo=discord&logoColor=white" alt="Join Discord">
71
- </a>
72
+ [Install](#installation) · [Quick example](#quick-example) · [Features](#features) · [Docs](https://github.com/Goldziher/spikard)
73
+
72
74
  </div>
73
75
 
74
- Rust-centric polyglot HTTP framework with OpenAPI/AsyncAPI/GraphQL/JSON-RPC codegen, tower-http middleware, and fixture-driven cross-language testing. Ruby bindings via Magnus with idiomatic Ruby API.
76
+ ---
75
77
 
76
- ## What This Package Provides
78
+ ## What this package provides
77
79
 
78
- - **HTTP application core** — typed routing, request data extraction, validation, lifecycle hooks, and Tower middleware from the Rust engine.
79
- - **Spec-driven work** — OpenAPI, AsyncAPI, GraphQL SDL, JSON-RPC, and SQL-to-HTTP codegen are shared across bindings.
80
- - **Cross-language parity** — generated bindings use the same DTOs, fixtures, and error model, so behavior does not drift between runtimes.
81
- - **Native integration** — no sidecar server required; each package calls the Rust core through its language-native bridge.
82
- - **Ruby package** — Magnus-backed native extension with Ruby route objects.
80
+ - **Magnus-backed native extension** — Ruby 3.2+ with native performance for routing and validation
81
+
82
+ - **Type-safe routing** — HTTP definitions with path, query, body, and header validation across all bindings
83
+ - **Spec-driven codegen** — OpenAPI 3.0, AsyncAPI 3.0, GraphQL SDL, and JSON-RPC 2.0 support
84
+ - **Cross-language parity** — same DTOs, fixtures, and error model prevent runtime drift
85
+ - **Tower middleware** — compression, rate limiting, timeouts, auth (JWT/API key), static files
86
+ - **Lifecycle hooks** — `onRequest`, `preValidation`, `preHandler`, `onResponse`, `onError`
83
87
 
84
88
  ## Installation
85
89
 
@@ -99,7 +103,7 @@ gem 'spikard'
99
103
 
100
104
  - **Ruby 3.2+** required
101
105
 
102
- ## Quick Start
106
+ ## Quick example
103
107
 
104
108
  ```ruby
105
109
  require "spikard"
@@ -120,14 +124,19 @@ app.run(config: { port: 8000 })
120
124
 
121
125
  ## Features
122
126
 
123
- - **HTTP routing** type-safe route definitions with path, query, and body parameter validation
124
- - **OpenAPI / AsyncAPI / GraphQL / JSON-RPC** — code generation and spec parsing built in
125
- - **Tower middleware** compression, rate limiting, timeouts, auth (JWT/API key), static files
126
- - **Lifecycle hooks** `onRequest`, `preValidation`, `preHandler`, `onResponse`, `onError`
127
- - **Fixture-driven testing** shared JSON fixtures drive tests across all language bindings
128
- - **Polyglot** single Rust core, thin bindings for Python, Node.js, Ruby, PHP, Elixir, Go, Java, C#, Kotlin, Dart, Gleam, WASM, Swift, Zig, and C FFI
127
+ | Feature | Support |
128
+ |---|---|
129
+ | **Type-safe routing** | Path, query, body, and header parameter validation |
130
+ | **Request extraction** | Typed structs for JSON, form data, multipart, and raw bodies |
131
+ | **Spec support** | OpenAPI 3.0 · AsyncAPI 3.0 · GraphQL SDL · JSON-RPC 2.0 |
132
+ | **Middleware** | Compression, rate limiting, timeouts, authentication, static files |
133
+ | **Lifecycle hooks** | Request, pre-validation, pre-handler, response, and error hooks |
134
+ | **WebSocket & SSE** | Bidirectional streams and server-sent events |
135
+ | **Error handling** | Consistent error responses across all bindings via ProblemDetails |
136
+ | **Fixture testing** | Shared JSON fixtures for behavioral consistency across languages |
129
137
 
130
- ## Routing
138
+ <details>
139
+ <summary><strong>Routing</strong></summary>
131
140
 
132
141
  ```ruby
133
142
  require "spikard"
@@ -138,7 +147,10 @@ app.get("/health") { |_params, _query, _body| { status: "ok" } }
138
147
  app.post("/users") { |_params, _query, body| body }
139
148
  ```
140
149
 
141
- ## Validation
150
+ </details>
151
+
152
+ <details>
153
+ <summary><strong>Validation</strong></summary>
142
154
 
143
155
  ```ruby
144
156
  require "spikard"
@@ -155,7 +167,10 @@ app.post("/payments") do |_params, _query, body|
155
167
  end
156
168
  ```
157
169
 
158
- ## Middleware
170
+ </details>
171
+
172
+ <details>
173
+ <summary><strong>Middleware & configuration</strong></summary>
159
174
 
160
175
  ```ruby
161
176
  require "spikard"
@@ -168,15 +183,13 @@ app.on_request do |request|
168
183
  end
169
184
  ```
170
185
 
171
- ## Documentation
172
-
173
- - **[Repository](https://github.com/Goldziher/spikard)** — source code, examples, and contributing guide
174
- - **[Examples](https://github.com/Goldziher/spikard/tree/main/crates/spikard-http/examples)** — working server examples
175
- - **[Issues](https://github.com/Goldziher/spikard/issues)** — bug reports and feature requests
186
+ </details>
176
187
 
177
- ## Contributing
188
+ ## Resources
178
189
 
179
- Contributions are welcome. See [CONTRIBUTING.md](https://github.com/Goldziher/spikard/blob/main/CONTRIBUTING.md).
190
+ - **[Repository](https://github.com/Goldziher/spikard)** — source code, examples, and issues
191
+ - **[Examples](https://github.com/Goldziher/spikard/tree/main/crates/spikard-http/examples)** — working implementations in all supported languages
192
+ - **[Contributing](https://github.com/Goldziher/spikard/blob/main/CONTRIBUTING.md)** — how to contribute
180
193
 
181
194
  ## License
182
195
 
@@ -3084,11 +3084,12 @@ dependencies = [
3084
3084
 
3085
3085
  [[package]]
3086
3086
  name = "spikard"
3087
- version = "0.16.0"
3087
+ version = "0.17.0-rc.1"
3088
3088
  source = "registry+https://github.com/rust-lang/crates.io-index"
3089
- checksum = "a121f06236315265570f6e6664a5c0125975f4a2c04baec0e4c8de6ce26a7b95"
3089
+ checksum = "ed92ef402b2f345fd29d2a8a2985a8118494284358a7ccfffc40370e24a31afb"
3090
3090
  dependencies = [
3091
3091
  "anyhow",
3092
+ "async-graphql",
3092
3093
  "axum",
3093
3094
  "axum-test",
3094
3095
  "base64",
@@ -3104,9 +3105,9 @@ dependencies = [
3104
3105
 
3105
3106
  [[package]]
3106
3107
  name = "spikard-core"
3107
- version = "0.16.0"
3108
+ version = "0.17.0-rc.1"
3108
3109
  source = "registry+https://github.com/rust-lang/crates.io-index"
3109
- checksum = "e604decda23b08f899803cc97c68f7d3a439f610c45d0725b440b0e515949490"
3110
+ checksum = "f8bf6a0d9e169d9364533851d319d0423935f097f199bf79bbf0a72bd97f9626"
3110
3111
  dependencies = [
3111
3112
  "anyhow",
3112
3113
  "base64",
@@ -3130,11 +3131,12 @@ dependencies = [
3130
3131
 
3131
3132
  [[package]]
3132
3133
  name = "spikard-graphql"
3133
- version = "0.16.0"
3134
+ version = "0.17.0-rc.1"
3134
3135
  source = "registry+https://github.com/rust-lang/crates.io-index"
3135
- checksum = "c91bdbc87c985cb1f3940d21a6c5b02b4488e5c60473adc490c6bb9dcb3cca05"
3136
+ checksum = "8794a34de3eb8879f3614eed484006904cff9341d3b608fc6207bfda53170aff"
3136
3137
  dependencies = [
3137
3138
  "async-graphql",
3139
+ "async-graphql-parser",
3138
3140
  "axum",
3139
3141
  "bytes",
3140
3142
  "futures",
@@ -3151,9 +3153,9 @@ dependencies = [
3151
3153
 
3152
3154
  [[package]]
3153
3155
  name = "spikard-http"
3154
- version = "0.16.0"
3156
+ version = "0.17.0-rc.1"
3155
3157
  source = "registry+https://github.com/rust-lang/crates.io-index"
3156
- checksum = "d913f6b16125798145c7d40ec8a78d92744cea37dd10653b2a58fb4db7c5ac20"
3158
+ checksum = "7f66529f82b9680ceb142e52ad5da732258cafe92f2999d9f49e9d8678847c0e"
3157
3159
  dependencies = [
3158
3160
  "ahash",
3159
3161
  "anyhow",
@@ -3206,7 +3208,7 @@ dependencies = [
3206
3208
 
3207
3209
  [[package]]
3208
3210
  name = "spikard-rb"
3209
- version = "0.16.0"
3211
+ version = "0.17.0-rc.1"
3210
3212
  dependencies = [
3211
3213
  "magnus",
3212
3214
  "rb-sys",
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "spikard-rb"
3
- version = "0.16.0"
3
+ version = "0.17.0-rc.1"
4
4
  edition = "2024"
5
5
  license = "MIT"
6
6
  description = "Rust-centric multi-language HTTP framework with polyglot bindings"
@@ -25,8 +25,8 @@ magnus = "0.8"
25
25
  rb-sys = ">=0.9, <0.9.128"
26
26
  serde = { version = "1", features = ["derive"] }
27
27
  serde_json = "1"
28
- spikard = { version = "0.16.0", features = ["di"] }
29
- spikard-core = { version = "0.16.0" }
30
- spikard-graphql = { version = "0.16.0" }
31
- spikard-http = { version = "0.16.0" }
28
+ spikard = { version = "0.17.0-rc.1", features = ["di"] }
29
+ spikard-core = { version = "0.17.0-rc.1" }
30
+ spikard-graphql = { version = "0.17.0-rc.1" }
31
+ spikard-http = { version = "0.17.0-rc.1" }
32
32
  tokio = { version = "1", features = ["rt-multi-thread"] }