This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
This is a Rust implementation of the WordPress REST API client library with cross-platform bindings for iOS, Android, and other platforms. The project uses a workspace structure with multiple crates providing modular functionality.
# Start WordPress test instance
make test-server
# Run unit tests
cargo test --lib
# Run integration tests
cargo test -p wp_api_integration_tests
# Run integration tests for a specific file
cargo test -p wp_api_integration_tests --test '{file_name}'
# Run linting and format checks
cargo fmt --all -- --check
cargo clippy --tests --all-targets --all-features -- -D warnings
swift package plugin swiftlint --strict
# Generate API documentation
cargo doc --no-deps --all-features
# Generate Swift bindings (use this to verify UniFFI changes work correctly)
make xcframeworkwp_api/- Core REST API implementationwp_api_integration_tests/- Integration tests requiring Dockerized WordPress instancewp_contextual/- Procedural macro for context-aware typeswp_serde/- Custom serialization helpersuniffi-bindgen/- Cross-platform binding generatorkotlin/- Kotlin/Android wrapper for generated bindingsnative/apple/- Swift/iOS wrapper for generated bindings
Tests require a WordPress instance. Use Docker:
# Start test server (keep running)
make test-server
# Run the integration tests
cargo test -p wp_api_integration_testsTest credentials are configured in:
test_credentials.json(WordPress.org)wp_com_test_credentials.json(WordPress.com)
Makefile- Build automation and platform-specific targetswp_api/src/lib.rs- Main library entry pointwp_api/src/request.rs- Core request/response handlingwp_api/src/api_client.rs- Request builder & executor wrapper API client typeswp_api/src/api_error.rs- Error types and handlingwp_api_integration_tests/src/lib.rs- Helpers for integration tests
- Platform bindings are generated automatically - don't edit generated files directly
When writing PR descriptions, use the template in .github/PULL_REQUEST_TEMPLATE.md as the base format.
Format Rules:
- Always output PR descriptions as raw markdown inside a code block so users can copy them directly
- Use bullet points or numbered lists for changes