diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..ab34590 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,82 @@ +# CLAUDE.md + +This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. + +## Project Overview + +JBZoo Toolbox-Dev is a developer toolbox library that provides development dependencies and debugging utilities for JBZoo libraries on GitHub. It primarily serves as a development-only package to standardize debugging and development tools across JBZoo projects. + +## Core Architecture + +### Minimal Library Structure +This is a lightweight library with minimal source code: +- `src/var-dumper.php` - Main functionality: customized Symfony VarDumper configuration +- The library primarily serves as a composer dependency aggregator for development tools + +### Symfony VarDumper Integration +The main feature is a customized VarDumper configuration that: +- Outputs to `php://stderr` instead of `php://stdout` to avoid breaking main script output during debugging +- Optimized for CLI debugging with 16KB string limit +- Configures classic indentation style and UTF-8 encoding +- Disables PhpStorm file links for broader compatibility + +### Dependency Management +Acts as a meta-package providing standardized versions of: +- `jbzoo/phpunit` - PHPUnit testing framework extensions +- `jbzoo/codestyle` - Code quality and linting tools +- `jbzoo/markdown` - Markdown processing utilities +- `symfony/var-dumper` - Enhanced debugging output +- `php-coveralls/php-coveralls` - Coverage reporting +- `fakerphp/faker` - Test data generation + +## Common Commands + +### Development Setup +```bash +make update # Install/update all dependencies via composer +``` + +### Testing and Quality Assurance +```bash +make test-all # Run both PHPUnit tests and all code style checks +make test # Run PHPUnit tests only +make codestyle # Run all code quality tools (inherited from jbzoo/codestyle) +``` + +## Dependencies and Integration + +### JBZoo Ecosystem Integration +This package includes JBZoo's standardized toolchain via the Makefile system: +- Inherits comprehensive make targets from `jbzoo/codestyle` +- Provides unified development environment across JBZoo projects +- Acts as a single dependency to pull in all necessary development tools + +### PHP Version Requirements +- PHP 8.2+ required +- Compatible with PHP 8.3 and 8.4 (tested in CI) + +### Testing Framework +Uses JBZoo's extended PHPUnit framework: +- Tests extend `JBZoo\PHPUnit\PHPUnit` base class +- Test files in `tests/` directory with `*Test.php` naming pattern +- PHPUnit configuration in `phpunit.xml.dist` + +## Usage Pattern + +This package is typically included as a development dependency in other JBZoo projects: +```json +{ + "require-dev": { + "jbzoo/toolbox-dev": "^7.0" + } +} +``` + +The VarDumper configuration is automatically loaded via Composer's `files` autoloader, providing enhanced debugging capabilities across all JBZoo projects without additional setup. + +## Key Files + +- `composer.json` - Defines dependencies and autoload configuration +- `Makefile` - Minimal makefile that includes JBZoo codestyle system +- `src/var-dumper.php` - Main functionality for debugging enhancements +- `phpunit.xml.dist` - PHPUnit configuration with coverage reporting \ No newline at end of file diff --git a/README.md b/README.md index bd60f14..46e6ded 100644 --- a/README.md +++ b/README.md @@ -3,15 +3,78 @@ [![CI](https://github.com/JBZoo/Toolbox-Dev/actions/workflows/main.yml/badge.svg?branch=master)](https://github.com/JBZoo/Toolbox-Dev/actions/workflows/main.yml?query=branch%3Amaster) [![Coverage Status](https://coveralls.io/repos/github/JBZoo/Toolbox-Dev/badge.svg?branch=master)](https://coveralls.io/github/JBZoo/Toolbox-Dev?branch=master) [![Psalm Coverage](https://shepherd.dev/github/JBZoo/Toolbox-Dev/coverage.svg)](https://shepherd.dev/github/JBZoo/Toolbox-Dev) [![Psalm Level](https://shepherd.dev/github/JBZoo/Toolbox-Dev/level.svg)](https://shepherd.dev/github/JBZoo/Toolbox-Dev) [![CodeFactor](https://www.codefactor.io/repository/github/jbzoo/toolbox-dev/badge)](https://www.codefactor.io/repository/github/jbzoo/toolbox-dev/issues) [![Stable Version](https://poser.pugx.org/jbzoo/toolbox-dev/version)](https://packagist.org/packages/jbzoo/toolbox-dev/) [![Total Downloads](https://poser.pugx.org/jbzoo/toolbox-dev/downloads)](https://packagist.org/packages/jbzoo/toolbox-dev/stats) [![Dependents](https://poser.pugx.org/jbzoo/toolbox-dev/dependents)](https://packagist.org/packages/jbzoo/toolbox-dev/dependents?order_by=downloads) [![GitHub License](https://img.shields.io/github/license/jbzoo/toolbox-dev)](https://github.com/JBZoo/Toolbox-Dev/blob/master/LICENSE) +Developer toolbox library that provides standardized development dependencies and debugging utilities for JBZoo projects on GitHub. +## Features -## Unit tests and check code style -```sh -make update -make test-all +- **Enhanced Debugging**: Customized Symfony VarDumper configuration optimized for CLI development +- **Development Dependencies**: Unified package for all necessary JBZoo development tools +- **Standardized Toolchain**: Consistent development environment across JBZoo ecosystem +- **Quality Assurance**: Integrated code style checking and testing framework + +## Installation + +```bash +composer require --dev jbzoo/toolbox-dev +``` + +## Key Components + +### VarDumper Enhancement +Provides an optimized debugging experience with: +- Output redirected to `php://stderr` to avoid breaking script output +- 16KB string limit for performance +- Classic indentation style for better readability +- UTF-8 encoding support + +### Development Tools Integration +Includes standardized versions of: +- **jbzoo/phpunit** - Enhanced PHPUnit testing framework +- **jbzoo/codestyle** - Comprehensive code quality tools +- **jbzoo/markdown** - Markdown processing utilities +- **symfony/var-dumper** - Advanced debugging capabilities +- **php-coveralls/php-coveralls** - Coverage reporting +- **fakerphp/faker** - Test data generation + +## Usage + +### Development Setup +```bash +make update # Install/update all dependencies +``` + +### Testing and Quality Assurance +```bash +make test # Run PHPUnit tests +make test-all # Run tests and code style checks +make codestyle # Run all code quality tools ``` +### Debugging +The VarDumper configuration is automatically loaded, enhancing the `dump()` function: + +```php +// Enhanced debugging output +dump($variable); // Outputs to stderr with optimized formatting +``` + +## Requirements + +- PHP 8.2 or higher +- Composer for dependency management + +## Integration + +This package is designed to be included as a development dependency in JBZoo projects: + +```json +{ + "require-dev": { + "jbzoo/toolbox-dev": "^7.0" + } +} +``` -### License +## License MIT