Skip to content

Commit 33c11a5

Browse files
authored
Merge branch 'main' into pr-reviewer-iterative-workflow
2 parents db9b3f3 + a2b9e06 commit 33c11a5

114 files changed

Lines changed: 21023 additions & 1778 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.cargo/config.toml

Lines changed: 39 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,44 @@
1+
# No global [build] target — the workspace contains adapters for multiple targets:
2+
# trusted-server-adapter-fastly → wasm32-wasip1 (Fastly Compute)
3+
# trusted-server-adapter-axum → native (dev server)
4+
# trusted-server-adapter-cloudflare → wasm32-unknown-unknown (Cloudflare Workers)
5+
# trusted-server-adapter-spin → wasm32-wasip1 (Fermyon Spin)
6+
#
7+
# All adapters are workspace members so `-p` resolves each.
8+
# default-members = [fastly] — required so Viceroy can locate the binary via `cargo run --bin`.
9+
# Use the aliases below to target each adapter with the correct toolchain.
10+
111
[alias]
2-
test_details = ["test", "--target", "aarch64-apple-darwin"]
12+
# Fastly adapter + shared crates (wasm32-wasip1 via Viceroy)
13+
# Excludes Axum (native-only), Cloudflare (wasm32-unknown-unknown), and Spin (separate wasm32-wasip1 job)
14+
test-fastly = ["test", "--workspace", "--exclude", "trusted-server-adapter-axum", "--exclude", "trusted-server-adapter-cloudflare", "--exclude", "trusted-server-adapter-spin", "--target", "wasm32-wasip1"]
15+
# Axum dev server adapter (native)
16+
test-axum = ["test", "-p", "trusted-server-adapter-axum"]
17+
# Cloudflare adapter (native host; WASM target checked separately in CI)
18+
test-cloudflare = ["test", "-p", "trusted-server-adapter-cloudflare"]
19+
# Cloudflare adapter WASM target check (wasm32-unknown-unknown requires --features cloudflare)
20+
check-cloudflare = ["check", "-p", "trusted-server-adapter-cloudflare", "--target", "wasm32-unknown-unknown", "--features", "cloudflare"]
21+
# Spin adapter (native host tests; WASM target checked separately with --features spin)
22+
test-spin = ["test", "-p", "trusted-server-adapter-spin"]
23+
check-spin = ["check", "-p", "trusted-server-adapter-spin", "--target", "wasm32-wasip1", "--features", "spin"]
24+
25+
# Clippy — target-matched to avoid cross-target compile failures
26+
clippy-fastly = ["clippy", "--workspace", "--exclude", "trusted-server-adapter-axum", "--exclude", "trusted-server-adapter-cloudflare", "--exclude", "trusted-server-adapter-spin", "--all-targets", "--all-features", "--target", "wasm32-wasip1", "--", "-D", "warnings"]
27+
clippy-axum = ["clippy", "-p", "trusted-server-adapter-axum", "--all-targets", "--all-features", "--", "-D", "warnings"]
28+
# No --all-features: the `cloudflare` feature has a compile_error! guard on
29+
# non-wasm32 targets. WASM-feature coverage comes from `cargo check-cloudflare`.
30+
clippy-cloudflare = ["clippy", "-p", "trusted-server-adapter-cloudflare", "--all-targets", "--", "-D", "warnings"]
31+
clippy-spin-native = ["clippy", "-p", "trusted-server-adapter-spin", "--all-targets", "--", "-D", "warnings"]
32+
clippy-spin-wasm = ["clippy", "-p", "trusted-server-adapter-spin", "--target", "wasm32-wasip1", "--features", "spin", "--lib", "--", "-D", "warnings"]
33+
34+
# Build — target-matched, same split as test/clippy
35+
build-fastly = ["build", "--workspace", "--exclude", "trusted-server-adapter-axum", "--exclude", "trusted-server-adapter-cloudflare", "--exclude", "trusted-server-adapter-spin", "--target", "wasm32-wasip1"]
36+
build-axum = ["build", "-p", "trusted-server-adapter-axum"]
37+
build-cloudflare = ["build", "-p", "trusted-server-adapter-cloudflare", "--target", "wasm32-unknown-unknown", "--features", "cloudflare"]
338

4-
[build]
5-
target = "wasm32-wasip1"
39+
# Check — fast compile validation, same split
40+
check-fastly = ["check", "--workspace", "--exclude", "trusted-server-adapter-axum", "--exclude", "trusted-server-adapter-cloudflare", "--exclude", "trusted-server-adapter-spin", "--target", "wasm32-wasip1"]
41+
check-axum = ["check", "-p", "trusted-server-adapter-axum"]
642

743
[target.'cfg(all(target_arch = "wasm32"))']
844
runner = "viceroy run -C ../../fastly.toml -- "

.claude/agents/build-validator.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@ Validate that the project builds correctly across all targets.
88

99
## Steps
1010

11-
1. **Native build**
11+
1. **Per-target builds** (no global target — fastly is wasm32-wasip1, axum is
12+
native, cloudflare is wasm32-unknown-unknown)
1213

1314
```bash
14-
cargo build --workspace
15+
cargo build-fastly && cargo build-axum && cargo build-cloudflare
1516
```
1617

1718
2. **WASM build** (production target)
@@ -23,7 +24,7 @@ Validate that the project builds correctly across all targets.
2324
3. **Clippy**
2425

2526
```bash
26-
cargo clippy --workspace --all-targets --all-features -- -D warnings
27+
cargo clippy-fastly && cargo clippy-axum && cargo clippy-cloudflare
2728
```
2829

2930
4. **Format check**

.claude/agents/pr-creator.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ Before creating the PR, verify the branch is healthy:
2121

2222
```
2323
cargo fmt --all -- --check
24-
cargo clippy --workspace --all-targets --all-features -- -D warnings
25-
cargo test --workspace
24+
cargo clippy-fastly && cargo clippy-axum && cargo clippy-cloudflare
25+
cargo test-fastly && cargo test-axum && cargo test-cloudflare
2626
cd crates/trusted-server-js/lib && npx vitest run
2727
cd crates/trusted-server-js/lib && npm run format
2828
cd docs && npm run format

.claude/agents/pr-reviewer.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,7 @@ For each changed file, evaluate:
524524
- Are new code paths tested?
525525
- Are edge cases covered (empty input, max values, error paths)?
526526
- If config-derived regex/pattern compilation changed: are invalid enabled-config startup failures and explicit `enabled = false` bypass cases both covered?
527-
- Rust tests: `cargo test --workspace`
527+
- Rust tests: `cargo test-fastly && cargo test-axum && cargo test-cloudflare`
528528
- JS tests: `npx vitest run` in `crates/trusted-server-js/lib/`
529529

530530
### 5. Classify findings

.claude/agents/verify-app.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ cargo fmt --all -- --check
1919
### 2. Clippy
2020

2121
```bash
22-
cargo clippy --workspace --all-targets --all-features -- -D warnings
22+
cargo clippy-fastly && cargo clippy-axum
2323
```
2424

2525
### 3. Rust Tests
2626

2727
```bash
28-
cargo test --workspace
28+
cargo test-fastly && cargo test-axum
2929
```
3030

3131
### 4. JS Tests

.claude/commands/check-ci.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
Run all CI checks locally, in order. Stop and report if any step fails.
22

33
1. `cargo fmt --all -- --check`
4-
2. `cargo clippy --workspace --all-targets --all-features -- -D warnings`
5-
3. `cargo test --workspace`
6-
4. `cd crates/trusted-server-js/lib && npx vitest run`
7-
5. `cd crates/trusted-server-js/lib && npm run format`
8-
6. `cd docs && npm run format`
4+
2. `cargo clippy-fastly && cargo clippy-axum && cargo clippy-cloudflare`
5+
3. `cargo test-fastly && cargo test-axum && cargo test-cloudflare`
6+
4. `cargo check-cloudflare` (wasm32-unknown-unknown target check, mirrors CI)
7+
5. `cd crates/trusted-server-js/lib && npx vitest run`
8+
6. `cd crates/trusted-server-js/lib && npm run format`
9+
7. `cd docs && npm run format`
910

1011
Report a summary of all results when done.

.claude/commands/test-all.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Run the full test suite for both Rust and JavaScript.
22

33
```bash
4-
cargo test --workspace
4+
cargo test-fastly && cargo test-axum && cargo test-cloudflare
55
```
66

77
Then run JS tests:

.claude/commands/verify.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
Full verification: build, test, and lint the entire project.
22

3-
1. `cargo build --workspace`
3+
1. `cargo build-fastly && cargo build-axum && cargo build-cloudflare`
44
2. `cargo build --package trusted-server-adapter-fastly --release --target wasm32-wasip1`
55
3. `cargo fmt --all -- --check`
6-
4. `cargo clippy --workspace --all-targets --all-features -- -D warnings`
7-
5. `cargo test --workspace`
6+
4. `cargo clippy-fastly && cargo clippy-axum && cargo clippy-cloudflare`
7+
5. `cargo test-fastly && cargo test-axum && cargo test-cloudflare`
88
6. `cd crates/trusted-server-js/lib && npx vitest run`
99
7. `cd crates/trusted-server-js/lib && npm run format`
1010
8. `cd docs && npm run format`

.github/actions/setup-integration-test-env/action.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,18 @@ inputs:
1717
description: Build the trusted-server WASM binary for integration tests.
1818
required: false
1919
default: "true"
20+
build-axum:
21+
description: Build the trusted-server-axum native binary for integration tests.
22+
required: false
23+
default: "true"
2024
build-test-images:
2125
description: Build the framework Docker images used by integration tests.
2226
required: false
2327
default: "true"
28+
build-cloudflare:
29+
description: Build the Cloudflare Workers bundle (wasm32-unknown-unknown) for integration tests.
30+
required: false
31+
default: "false"
2432

2533
outputs:
2634
node-version:
@@ -84,6 +92,16 @@ runs:
8492
TRUSTED_SERVER__PROXY__CERTIFICATE_CHECK: "false"
8593
run: cargo build --package trusted-server-adapter-fastly --release --target wasm32-wasip1
8694

95+
- name: Build Axum native binary
96+
if: ${{ inputs.build-axum == 'true' }}
97+
shell: bash
98+
env:
99+
TRUSTED_SERVER__PUBLISHER__ORIGIN_URL: http://127.0.0.1:${{ inputs.origin-port }}
100+
TRUSTED_SERVER__PUBLISHER__PROXY_SECRET: integration-test-proxy-secret
101+
TRUSTED_SERVER__EC__PASSPHRASE: integration-test-ec-secret-padded-32
102+
TRUSTED_SERVER__PROXY__CERTIFICATE_CHECK: "false"
103+
run: cargo build -p trusted-server-adapter-axum
104+
87105
- name: Build WordPress test container
88106
if: ${{ inputs.build-test-images == 'true' }}
89107
shell: bash
@@ -99,3 +117,18 @@ runs:
99117
--build-arg NODE_VERSION=${{ steps.node-version.outputs.node-version }} \
100118
-t test-nextjs:latest \
101119
crates/trusted-server-integration-tests/fixtures/frameworks/nextjs/
120+
121+
- name: Add wasm32-unknown-unknown target for Cloudflare build
122+
if: ${{ inputs.build-cloudflare == 'true' }}
123+
shell: bash
124+
run: rustup target add wasm32-unknown-unknown
125+
126+
- name: Build Cloudflare Workers bundle
127+
if: ${{ inputs.build-cloudflare == 'true' }}
128+
shell: bash
129+
env:
130+
TRUSTED_SERVER__PUBLISHER__ORIGIN_URL: http://127.0.0.1:${{ inputs.origin-port }}
131+
TRUSTED_SERVER__PUBLISHER__PROXY_SECRET: integration-test-proxy-secret
132+
TRUSTED_SERVER__EC__PASSPHRASE: integration-test-ec-secret-padded-32
133+
TRUSTED_SERVER__PROXY__CERTIFICATE_CHECK: "false"
134+
run: bash crates/trusted-server-adapter-cloudflare/build.sh

.github/pull_request_template.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ Closes #
2323

2424
<!-- How did you verify this works? Check all that apply -->
2525

26-
- [ ] `cargo test --workspace`
27-
- [ ] `cargo clippy --workspace --all-targets --all-features -- -D warnings`
26+
- [ ] `cargo test-fastly && cargo test-axum`
27+
- [ ] `cargo clippy-fastly && cargo clippy-axum`
2828
- [ ] `cargo fmt --all -- --check`
2929
- [ ] JS tests: `cd crates/trusted-server-js/lib && npx vitest run`
3030
- [ ] JS format: `cd crates/trusted-server-js/lib && npm run format`

0 commit comments

Comments
 (0)