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 +4 -4
- data/README.md +69 -53
- data/ext/spikard_rb/native/Cargo.lock +9 -9
- data/ext/spikard_rb/native/Cargo.toml +5 -5
- data/ext/spikard_rb/src/lib.rs +1 -1
- data/lib/spikard/native.rb +1 -1
- data/lib/spikard/version.rb +2 -2
- data/lib/spikard.rb +1 -1
- data/lib/spikard_rb.so +0 -0
- data/sig/types.rbs +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 52c7532be0d14ae2f5831e289646c21b62f81d07e9eddb67246d1e1bf1750312
|
|
4
|
+
data.tar.gz: a8e79f3c7a1abb1615ebb93844b2cbfc06a188e651d97f9e6d45e2170a5c78dd
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 0f600ad8cd6294fc7221c5b43a3784b7694851fd1f7acf2fb5e2416db3468cd02621b2e893a53161737b2afdaad1e2fce7f2d45482f91e897bd5021a5d73dfe2
|
|
7
|
+
data.tar.gz: e473668b73afcbac50f936f0e1923d98914c3d2ad8d8b8936c73c6981fc97e9e0848bcdc86fee6aa943bf54f5a51e7ebb116406bb619bada984da609067f786e
|
data/README.md
CHANGED
|
@@ -1,85 +1,92 @@
|
|
|
1
|
-
|
|
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/
|
|
6
|
-
<img src="https://img.shields.io/badge/
|
|
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
|
|
16
|
+
<!-- Language bindings -->
|
|
10
17
|
<a href="https://crates.io/crates/spikard">
|
|
11
|
-
<img src="https://img.shields.io/crates/v/spikard?
|
|
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?
|
|
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?
|
|
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?
|
|
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?
|
|
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?
|
|
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?
|
|
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?
|
|
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&
|
|
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?
|
|
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&
|
|
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?
|
|
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-
|
|
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
|
|
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
|
|
64
|
-
<img src="https://img.shields.io/
|
|
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
|
-
|
|
69
|
-
|
|
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
|
-
|
|
79
|
+
---
|
|
75
80
|
|
|
76
|
-
## What
|
|
81
|
+
## What this package provides
|
|
77
82
|
|
|
78
|
-
- **
|
|
79
|
-
|
|
80
|
-
- **
|
|
81
|
-
- **
|
|
82
|
-
- **
|
|
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
|
|
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
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
##
|
|
191
|
+
## Resources
|
|
178
192
|
|
|
179
|
-
|
|
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.
|
|
3087
|
+
version = "0.16.1"
|
|
3088
3088
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
3089
|
-
checksum = "
|
|
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.
|
|
3107
|
+
version = "0.16.1"
|
|
3108
3108
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
3109
|
-
checksum = "
|
|
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.
|
|
3133
|
+
version = "0.16.1"
|
|
3134
3134
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
3135
|
-
checksum = "
|
|
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.
|
|
3154
|
+
version = "0.16.1"
|
|
3155
3155
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
3156
|
-
checksum = "
|
|
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.
|
|
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.
|
|
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.
|
|
29
|
-
spikard-core = { version = "0.16.
|
|
30
|
-
spikard-graphql = { version = "0.16.
|
|
31
|
-
spikard-http = { version = "0.16.
|
|
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"] }
|
data/ext/spikard_rb/src/lib.rs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// This file is auto-generated by alef. DO NOT EDIT.
|
|
2
|
-
// alef:hash:
|
|
2
|
+
// alef:hash:f158c5297df7a3d75b3974f31d3f21a0b02763bd16a3475432d2f5dc08c5e971
|
|
3
3
|
// Re-generate with: alef generate
|
|
4
4
|
#![allow(dead_code, unused_imports, unused_variables)]
|
|
5
5
|
#![allow(
|
data/lib/spikard/native.rb
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# This file is auto-generated by alef — DO NOT EDIT.
|
|
2
|
-
# alef:hash:
|
|
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/version.rb
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# This file is auto-generated by alef — DO NOT EDIT.
|
|
2
|
-
# alef:hash:
|
|
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.
|
|
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:
|
|
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:
|
|
2
|
+
# alef:hash:f158c5297df7a3d75b3974f31d3f21a0b02763bd16a3475432d2f5dc08c5e971
|
|
3
3
|
# To regenerate: alef generate
|
|
4
4
|
# To verify freshness: alef verify --exit-code
|
|
5
5
|
|