spikard 0.16.0 → 0.16.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: 52c7532be0d14ae2f5831e289646c21b62f81d07e9eddb67246d1e1bf1750312
4
+ data.tar.gz: a8e79f3c7a1abb1615ebb93844b2cbfc06a188e651d97f9e6d45e2170a5c78dd
5
5
  SHA512:
6
- metadata.gz: 56c04624eb0ae08a943514b67fd852f7adeb4e27c55287b27f29274f8cbbfb154bfcca4c98b096e8f686a3334d056166af549ca0b8d1d6e9ec46e745a2a00d57
7
- data.tar.gz: 8d9f438028202c3b34b5611a1acf84309e359c6cd91bab3e0f87fd55e0406d55edba9eebb34f7462dd1b6e06cc1b93af741a156ebcf16f53981c0f24729e0acd
6
+ metadata.gz: 0f600ad8cd6294fc7221c5b43a3784b7694851fd1f7acf2fb5e2416db3468cd02621b2e893a53161737b2afdaad1e2fce7f2d45482f91e897bd5021a5d73dfe2
7
+ data.tar.gz: e473668b73afcbac50f936f0e1923d98914c3d2ad8d8b8936c73c6981fc97e9e0848bcdc86fee6aa943bf54f5a51e7ebb116406bb619bada984da609067f786e
data/README.md CHANGED
@@ -1,85 +1,92 @@
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?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?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?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?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?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?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?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?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&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?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&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?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">
68
+ <img src="https://img.shields.io/badge/License-MIT-007ec6?style=flat-square" alt="License">
62
69
  </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">
70
+ <a href="https://github.com/Goldziher/spikard">
71
+ <img src="https://img.shields.io/github/stars/Goldziher/spikard?style=flat-square" alt="GitHub Stars">
65
72
  </a>
66
73
  </div>
67
74
 
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>
75
+ [Install](#installation) · [Quick example](#quick-example) · [Features](#features) · [Docs](https://github.com/Goldziher/spikard)
76
+
72
77
  </div>
73
78
 
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.
79
+ ---
75
80
 
76
- ## What This Package Provides
81
+ ## What this package provides
77
82
 
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.
83
+ - **Magnus-backed native extension** — Ruby 3.2+ with native performance for routing and validation
84
+
85
+ - **Type-safe routing** — HTTP definitions with path, query, body, and header validation across all bindings
86
+ - **Spec-driven codegen** — OpenAPI 3.0, AsyncAPI 3.0, GraphQL SDL, and JSON-RPC 2.0 support
87
+ - **Cross-language parity** — same DTOs, fixtures, and error model prevent runtime drift
88
+ - **Tower middleware** — compression, rate limiting, timeouts, auth (JWT/API key), static files
89
+ - **Lifecycle hooks** — `onRequest`, `preValidation`, `preHandler`, `onResponse`, `onError`
83
90
 
84
91
  ## Installation
85
92
 
@@ -99,7 +106,7 @@ gem 'spikard'
99
106
 
100
107
  - **Ruby 3.2+** required
101
108
 
102
- ## Quick Start
109
+ ## Quick example
103
110
 
104
111
  ```ruby
105
112
  require "spikard"
@@ -120,14 +127,19 @@ app.run(config: { port: 8000 })
120
127
 
121
128
  ## Features
122
129
 
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
130
+ | Feature | Support |
131
+ |---|---|
132
+ | **Type-safe routing** | Path, query, body, and header parameter validation |
133
+ | **Request extraction** | Typed structs for JSON, form data, multipart, and raw bodies |
134
+ | **Spec support** | OpenAPI 3.0 · AsyncAPI 3.0 · GraphQL SDL · JSON-RPC 2.0 |
135
+ | **Middleware** | Compression, rate limiting, timeouts, authentication, static files |
136
+ | **Lifecycle hooks** | Request, pre-validation, pre-handler, response, and error hooks |
137
+ | **WebSocket & SSE** | Bidirectional streams and server-sent events |
138
+ | **Error handling** | Consistent error responses across all bindings via ProblemDetails |
139
+ | **Fixture testing** | Shared JSON fixtures for behavioral consistency across languages |
129
140
 
130
- ## Routing
141
+ <details>
142
+ <summary><strong>Routing</strong></summary>
131
143
 
132
144
  ```ruby
133
145
  require "spikard"
@@ -138,7 +150,10 @@ app.get("/health") { |_params, _query, _body| { status: "ok" } }
138
150
  app.post("/users") { |_params, _query, body| body }
139
151
  ```
140
152
 
141
- ## Validation
153
+ </details>
154
+
155
+ <details>
156
+ <summary><strong>Validation</strong></summary>
142
157
 
143
158
  ```ruby
144
159
  require "spikard"
@@ -155,7 +170,10 @@ app.post("/payments") do |_params, _query, body|
155
170
  end
156
171
  ```
157
172
 
158
- ## Middleware
173
+ </details>
174
+
175
+ <details>
176
+ <summary><strong>Middleware & configuration</strong></summary>
159
177
 
160
178
  ```ruby
161
179
  require "spikard"
@@ -168,15 +186,13 @@ app.on_request do |request|
168
186
  end
169
187
  ```
170
188
 
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
189
+ </details>
176
190
 
177
- ## Contributing
191
+ ## Resources
178
192
 
179
- Contributions are welcome. See [CONTRIBUTING.md](https://github.com/Goldziher/spikard/blob/main/CONTRIBUTING.md).
193
+ - **[Repository](https://github.com/Goldziher/spikard)** — source code, examples, and issues
194
+ - **[Examples](https://github.com/Goldziher/spikard/tree/main/crates/spikard-http/examples)** — working implementations in all supported languages
195
+ - **[Contributing](https://github.com/Goldziher/spikard/blob/main/CONTRIBUTING.md)** — how to contribute
180
196
 
181
197
  ## License
182
198
 
@@ -3084,9 +3084,9 @@ dependencies = [
3084
3084
 
3085
3085
  [[package]]
3086
3086
  name = "spikard"
3087
- version = "0.16.0"
3087
+ version = "0.16.1"
3088
3088
  source = "registry+https://github.com/rust-lang/crates.io-index"
3089
- checksum = "a121f06236315265570f6e6664a5c0125975f4a2c04baec0e4c8de6ce26a7b95"
3089
+ checksum = "cbd7b529fbdbf74d0a43ab6f54ea2ef40e94cbea3a979e947a1c218973825b1e"
3090
3090
  dependencies = [
3091
3091
  "anyhow",
3092
3092
  "axum",
@@ -3104,9 +3104,9 @@ dependencies = [
3104
3104
 
3105
3105
  [[package]]
3106
3106
  name = "spikard-core"
3107
- version = "0.16.0"
3107
+ version = "0.16.1"
3108
3108
  source = "registry+https://github.com/rust-lang/crates.io-index"
3109
- checksum = "e604decda23b08f899803cc97c68f7d3a439f610c45d0725b440b0e515949490"
3109
+ checksum = "62c3699565933c674b2159ccea1160aec1bb6b94cb2eab2e502fe1bf998c8312"
3110
3110
  dependencies = [
3111
3111
  "anyhow",
3112
3112
  "base64",
@@ -3130,9 +3130,9 @@ dependencies = [
3130
3130
 
3131
3131
  [[package]]
3132
3132
  name = "spikard-graphql"
3133
- version = "0.16.0"
3133
+ version = "0.16.1"
3134
3134
  source = "registry+https://github.com/rust-lang/crates.io-index"
3135
- checksum = "c91bdbc87c985cb1f3940d21a6c5b02b4488e5c60473adc490c6bb9dcb3cca05"
3135
+ checksum = "6d048cf6a3e4b7b32588ae00a6fb0601420cbd8ad811e429ffdeff96c6bdecd5"
3136
3136
  dependencies = [
3137
3137
  "async-graphql",
3138
3138
  "axum",
@@ -3151,9 +3151,9 @@ dependencies = [
3151
3151
 
3152
3152
  [[package]]
3153
3153
  name = "spikard-http"
3154
- version = "0.16.0"
3154
+ version = "0.16.1"
3155
3155
  source = "registry+https://github.com/rust-lang/crates.io-index"
3156
- checksum = "d913f6b16125798145c7d40ec8a78d92744cea37dd10653b2a58fb4db7c5ac20"
3156
+ checksum = "cfc06211e6b910f816f9573eecafa18e9be538c3d967a8555e8e5e37b892de10"
3157
3157
  dependencies = [
3158
3158
  "ahash",
3159
3159
  "anyhow",
@@ -3206,7 +3206,7 @@ dependencies = [
3206
3206
 
3207
3207
  [[package]]
3208
3208
  name = "spikard-rb"
3209
- version = "0.16.0"
3209
+ version = "0.16.1"
3210
3210
  dependencies = [
3211
3211
  "magnus",
3212
3212
  "rb-sys",
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "spikard-rb"
3
- version = "0.16.0"
3
+ version = "0.16.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.16.1", features = ["di"] }
29
+ spikard-core = { version = "0.16.1" }
30
+ spikard-graphql = { version = "0.16.1" }
31
+ spikard-http = { version = "0.16.1" }
32
32
  tokio = { version = "1", features = ["rt-multi-thread"] }
@@ -1,5 +1,5 @@
1
1
  // This file is auto-generated by alef. DO NOT EDIT.
2
- // alef:hash:311daba6328f0b9c14dde594f82aef8bd216642a26bb32c123069d3cb499f1f3
2
+ // alef:hash:f158c5297df7a3d75b3974f31d3f21a0b02763bd16a3475432d2f5dc08c5e971
3
3
  // Re-generate with: alef generate
4
4
  #![allow(dead_code, unused_imports, unused_variables)]
5
5
  #![allow(
@@ -1,5 +1,5 @@
1
1
  # This file is auto-generated by alef — DO NOT EDIT.
2
- # alef:hash:311daba6328f0b9c14dde594f82aef8bd216642a26bb32c123069d3cb499f1f3
2
+ # alef:hash:f158c5297df7a3d75b3974f31d3f21a0b02763bd16a3475432d2f5dc08c5e971
3
3
  # To regenerate: alef generate
4
4
  # To verify freshness: alef verify --exit-code
5
5
  # frozen_string_literal: true
@@ -1,10 +1,10 @@
1
1
  # This file is auto-generated by alef — DO NOT EDIT.
2
- # alef:hash:311daba6328f0b9c14dde594f82aef8bd216642a26bb32c123069d3cb499f1f3
2
+ # alef:hash:f158c5297df7a3d75b3974f31d3f21a0b02763bd16a3475432d2f5dc08c5e971
3
3
  # To regenerate: alef generate
4
4
  # To verify freshness: alef verify --exit-code
5
5
  # frozen_string_literal: true
6
6
 
7
7
  module Spikard
8
8
  ## The version string for this package.
9
- VERSION = "0.16.0"
9
+ VERSION = "0.16.1"
10
10
  end
data/lib/spikard.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # This file is auto-generated by alef — DO NOT EDIT.
2
- # alef:hash:311daba6328f0b9c14dde594f82aef8bd216642a26bb32c123069d3cb499f1f3
2
+ # alef:hash:f158c5297df7a3d75b3974f31d3f21a0b02763bd16a3475432d2f5dc08c5e971
3
3
  # To regenerate: alef generate
4
4
  # To verify freshness: alef verify --exit-code
5
5
  # frozen_string_literal: true
data/lib/spikard_rb.so CHANGED
Binary file
data/sig/types.rbs CHANGED
@@ -1,5 +1,5 @@
1
1
  # This file is auto-generated by alef — DO NOT EDIT.
2
- # alef:hash:311daba6328f0b9c14dde594f82aef8bd216642a26bb32c123069d3cb499f1f3
2
+ # alef:hash:f158c5297df7a3d75b3974f31d3f21a0b02763bd16a3475432d2f5dc08c5e971
3
3
  # To regenerate: alef generate
4
4
  # To verify freshness: alef verify --exit-code
5
5
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spikard
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.16.0
4
+ version: 0.16.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Na'aman Hirschfeld <nhirschfeld@gmail.com>