Skip to content

Commit 12acaad

Browse files
koriymclaude
andcommitted
Add CHANGELOG.md and CLAUDE.md for v1.1.0 release
- Add comprehensive CHANGELOG.md with version history - Add CLAUDE.md with development guidance for future Claude instances πŸ€– Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 947267b commit 12acaad

2 files changed

Lines changed: 89 additions & 0 deletions

File tree

β€ŽCHANGELOG.mdβ€Ž

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Changelog
2+
3+
## [1.1.0] - 2025-09-24
4+
5+
- Add code example for Fastly CDN integration
6+
- Refactor Injector instantiation
7+
8+
## [1.0.0] - 2024-05-14
9+
10+
- Support multiple Fastly SDK versions (^1.0 || ^2.0 || ^3.0 || ^4.0 || ^5.0)
11+
12+
## [0.1.1] - 2023-09-08
13+
14+
- Remove bear/query-repository, bear/resource dependencies
15+
- Add PHP 8.3 support
16+
17+
## [0.1.0] - 2022-12-23
18+
19+
- Initial release

β€ŽCLAUDE.mdβ€Ž

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# CLAUDE.md
2+
3+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4+
5+
## Project Overview
6+
7+
BEAR.FastlyModule is a PHP library providing Fastly CDN integration for the BEAR.Sunday framework. It implements cache purging functionality through Fastly's API using a dependency injection module pattern.
8+
9+
## Development Commands
10+
11+
### Testing and Quality Assurance
12+
- `composer test` - Run PHPUnit tests
13+
- `composer coverage` - Generate test coverage with Xdebug
14+
- `composer pcov` - Generate coverage with PCOV extension
15+
- `composer cs` - Check coding standards (PHP_CodeSniffer)
16+
- `composer cs-fix` - Fix coding standards violations
17+
- `composer sa` - Run static analysis (PHPStan + Psalm)
18+
- `composer metrics` - Generate code metrics report
19+
20+
### Composite Commands
21+
- `composer tests` - Full QA suite (coding standards + static analysis + tests)
22+
- `composer build` - Complete build process (clean + cs + sa + coverage + metrics)
23+
- `composer clean` - Clear analysis caches
24+
25+
## Architecture
26+
27+
### Core Design Patterns
28+
- **Dependency Injection**: Uses Ray.Di container with modules extending `AbstractModule`
29+
- **Interface-Based Design**: `FastlyCachePurgerInterface` with concrete `FastlyCachePurger` implementation
30+
- **Module Composition**: `FastlyPurgeModule` (core) + `FastlyEnableSoftPurgeModule` (feature toggle)
31+
- **Callable Objects**: Cache purger implements `__invoke()` for functional interface
32+
33+
### Key Components
34+
- `FastlyCachePurger`: Main purging implementation with `__invoke(string $tag)`
35+
- `PurgeApi`: Fastly SDK wrapper for API communication
36+
- DI Attributes: `#[ServiceId]`, `#[SoftPurge]`, `#[FastlyApi]` for dependency qualification
37+
38+
### Module Structure
39+
```
40+
src/
41+
β”œβ”€β”€ Attribute/ # DI qualifier attributes
42+
β”œβ”€β”€ Exception/ # Custom exceptions
43+
β”œβ”€β”€ FastlyPurgeModule.php # Main DI module
44+
β”œβ”€β”€ FastlyEnableSoftPurgeModule.php # Soft purge feature module
45+
β”œβ”€β”€ FastlyCachePurgerInterface.php # Core contract
46+
└── FastlyCachePurger.php # Implementation
47+
```
48+
49+
### Testing Structure
50+
- **Test Doubles**: Extensive fakes in `tests/Fake/`
51+
- **Integration Tests**: Uses actual DI container with module bindings
52+
- **Fake Application**: Complete BEAR.Sunday app in `tests/Fake/fake-app/`
53+
- **Module Override Pattern**: `$module->override(new FakeFastlyPurgeModule())` for testing
54+
55+
## PHP Requirements
56+
- **PHP 8.0+** (uses modern attributes)
57+
- **Strict Types**: All files use `declare(strict_types=1)`
58+
- **Maximum Static Analysis**: PHPStan level max, Psalm strict mode
59+
60+
## Development Workflow
61+
1. Write tests first using fake modules for isolation
62+
2. Run `composer cs-fix` to fix coding standards
63+
3. Run `composer sa` for static analysis
64+
4. Run `composer test` for full test suite
65+
5. Use `composer build` for complete verification before commits
66+
67+
## Integration Points
68+
- **BEAR.Sunday**: Integrates with resource caching via `Header::SURROGATE_KEY`
69+
- **Fastly SDK**: Supports versions 1.0-5.0 with flexible HTTP client configuration
70+
- **DI Container**: Ray.Di with attribute-based dependency qualification

0 commit comments

Comments
Β (0)