Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
run: cargo test --workspace --all-targets

- name: Check feature compilation
run: cargo check --workspace --all-targets --features "fastly cloudflare"
run: cargo check --workspace --all-targets --features "fastly cloudflare spin"
Comment thread
ChristianPavilonis marked this conversation as resolved.

playwright:
name: playwright tests
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
**/bin/
**/pkg/

# Spin runtime logs
.spin/logs/
**/.spin/logs/

# env
.env

Expand Down
23 changes: 13 additions & 10 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
Mocktioneer is a deterministic OpenRTB banner bidder for edge platforms. It lets
you test client integrations (Prebid.js, Prebid Server, custom SDKs) without
depending on third-party bidders or origin backends. Write once, deploy to
Fastly Compute, Cloudflare Workers, or native Axum servers. The codebase is a
Cargo workspace with 4 crates under `crates/`, a VitePress documentation site
under `docs/`, Playwright e2e tests under `tests/playwright/`, and CI workflows
under `.github/workflows/`.
Fastly Compute, Cloudflare Workers, Fermyon Spin, or native Axum servers. The
codebase is a Cargo workspace with 5 crates under `crates/`, a VitePress
documentation site under `docs/`, Playwright e2e tests under
`tests/playwright/`, and CI workflows under `.github/workflows/`.

## Workspace Layout

Expand All @@ -18,6 +18,7 @@ crates/
mocktioneer-adapter-axum/ # Native Axum HTTP server
mocktioneer-adapter-cloudflare/ # Cloudflare Workers bridge (wasm32-unknown-unknown)
mocktioneer-adapter-fastly/ # Fastly Compute bridge (wasm32-wasip1)
mocktioneer-adapter-spin/ # Fermyon Spin bridge (wasm32-wasip2)
docs/ # VitePress documentation site (Node.js)
examples/ # curl/shell scripts for endpoint demos
tests/playwright/ # Playwright e2e tests (creative visibility, sizes)
Expand Down Expand Up @@ -64,11 +65,12 @@ faster iteration since nearly all business logic lives there.

## Compilation Targets

| Adapter | Target | Notes |
| ---------- | ------------------------ | ---------------------------------- |
| Fastly | `wasm32-wasip1` | Requires Viceroy for local testing |
| Cloudflare | `wasm32-unknown-unknown` | Requires `wrangler` for dev/deploy |
| Axum | Native (host triple) | Standard Tokio runtime |
| Adapter | Target | Notes |
| ---------- | ------------------------ | ------------------------------------- |
| Fastly | `wasm32-wasip1` | Requires Viceroy for local testing |
| Cloudflare | `wasm32-unknown-unknown` | Requires `wrangler` for dev/deploy |
| Spin | `wasm32-wasip2` | Requires `spin` CLI for local/deploy |
| Axum | Native (host triple) | Standard Tokio runtime |

## Coding Conventions

Expand Down Expand Up @@ -161,7 +163,7 @@ Every PR must pass:
1. `cargo fmt --all -- --check`
2. `cargo clippy --workspace --all-targets --all-features -- -D warnings`
3. `cargo test --workspace --all-targets`
4. `cargo check --workspace --all-targets --features "fastly cloudflare"`
4. `cargo check --workspace --all-targets --features "fastly cloudflare spin"`
5. Playwright e2e tests (`tests/playwright/`)
6. ESLint + Prettier on `docs/`

Expand Down Expand Up @@ -290,6 +292,7 @@ Custom commands live in `.claude/commands/`:
| Axum adapter entry | `crates/mocktioneer-adapter-axum/src/main.rs` |
| Cloudflare adapter | `crates/mocktioneer-adapter-cloudflare/src/lib.rs` |
| Fastly adapter | `crates/mocktioneer-adapter-fastly/src/main.rs` |
| Spin adapter | `crates/mocktioneer-adapter-spin/src/lib.rs` |
| Playwright tests | `tests/playwright/` |
| Example scripts | `examples/` |
| CI tests | `.github/workflows/test.yml` |
Expand Down
154 changes: 147 additions & 7 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ members = [
"crates/mocktioneer-adapter-axum",
"crates/mocktioneer-adapter-cloudflare",
"crates/mocktioneer-adapter-fastly",
"crates/mocktioneer-adapter-spin",
]
resolver = "2"

Expand All @@ -24,9 +25,13 @@ ed25519-dalek = "2.1"
edgezero-adapter-axum = { git = "https://github.com/stackpop/edgezero.git", branch = "main", package = "edgezero-adapter-axum", default-features = false }
edgezero-adapter-cloudflare = { git = "https://github.com/stackpop/edgezero.git", branch = "main", package = "edgezero-adapter-cloudflare", default-features = false }
edgezero-adapter-fastly = { git = "https://github.com/stackpop/edgezero.git", branch = "main", package = "edgezero-adapter-fastly", default-features = false }
edgezero-adapter-spin = { git = "https://github.com/stackpop/edgezero.git", branch = "main", package = "edgezero-adapter-spin", default-features = false }
edgezero-cli = { git = "https://github.com/stackpop/edgezero.git", branch = "main", package = "edgezero-cli" }
edgezero-core = { git = "https://github.com/stackpop/edgezero.git", branch = "main", package = "edgezero-core" }
fastly = "0.11.9"
# Keep the Spin SDK surface minimal; the adapter only uses `#[http_component]`
# and HTTP request/response types.
spin-sdk = { version = "5.2", default-features = false }
Comment thread
ChristianPavilonis marked this conversation as resolved.
futures = { version = "0.3", features = ["std", "executor"] }
futures-util = "0.3.31"
handlebars = "6"
Expand Down
24 changes: 24 additions & 0 deletions crates/mocktioneer-adapter-spin/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[package]
name = "mocktioneer-adapter-spin"
version = "0.1.0"
edition = "2021"
publish = false
Comment thread
ChristianPavilonis marked this conversation as resolved.
license.workspace = true

[lib]
crate-type = ["cdylib"]
path = "src/lib.rs"

[features]
default = []
spin = ["edgezero-adapter-spin/spin"]

[dependencies]
edgezero-adapter-spin = { workspace = true }
Comment thread
ChristianPavilonis marked this conversation as resolved.
edgezero-core = { workspace = true }
mocktioneer-core = { workspace = true }

[target.'cfg(target_arch = "wasm32")'.dependencies]
anyhow = { workspace = true }
edgezero-adapter-spin = { workspace = true, features = ["spin"] }
Comment thread
ChristianPavilonis marked this conversation as resolved.
spin-sdk = { workspace = true }
Loading
Loading