PHPackages                             valksor/php-dev-build - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. valksor/php-dev-build

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

valksor/php-dev-build
=====================

00PHPCI passing

Since Jan 24Pushed 3mo agoCompare

[ Source](https://github.com/valksor/php-dev-build)[ Packagist](https://packagist.org/packages/valksor/php-dev-build)[ RSS](/packages/valksor-php-dev-build/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

ValksorDev Build Tools
======================

[](#valksordev-build-tools)

[![valksor](https://camo.githubusercontent.com/2af5a6a7e5f7da47cd0a924c8b00038f208f45f9b0d5be8d7a497a9808168187/68747470733a2f2f62616467656e2e6e65742f7374617469632f6f72672f76616c6b736f722f677265656e)](https://github.com/valksor)[![BSD-3-Clause](https://camo.githubusercontent.com/72547f8afb6b5ace804caebbf95c3bcbfc027ce9214777bc452f308f3165db01/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4253442d2d332d2d436c617573652d677265656e3f7374796c653d666c6174)](https://github.com/valksor/php-dev-build/blob/master/LICENSE)[![Coverage Status](https://camo.githubusercontent.com/5dd842851fda184e43f8b71e5b8316bb97a6e9499ac51d0be25a289e712d1cd6/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f76616c6b736f722f7068702d6465762d6275696c642f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/valksor/php-dev-build?branch=master)[![php](https://camo.githubusercontent.com/77da2f7bbc049873edb2d1045a756d7a32e3ba50440a8e0e76a9109f62f0771b/68747470733a2f2f62616467656e2e6e65742f7374617469632f7068702f2533453d382e342f707572706c65)](https://www.php.net/releases/8.4/en.php)

A comprehensive development build tool suite for PHP applications that provides hot reloading, asset compilation, import map management, and development workflow automation. Designed to streamline modern PHP development with integrated tooling for Tailwind CSS, ESBuild, DaisyUI, and other frontend build tools.

What It Does
------------

[](#what-it-does)

The build system provides a modern development experience with:

- **Automatic Browser Reload**: Files change → browser refreshes automatically
- **Tailwind CSS Compilation**: Real-time CSS compilation with DaisyUI support
- **Import Map Management**: Modern JavaScript dependency handling
- **Binary Management**: Automatic download and management of build tools
- **Icon Generation**: SVG icon processing with Lucide integration

Configuration
-------------

[](#configuration)

### Basic Setup

[](#basic-setup)

```
# config/packages/valksor.yaml
valksor:
    build:
        enabled: true
        hot_reload:
            enabled: true
        tailwind:
            enabled: true
        importmap:
            enabled: true
```

### Complete Configuration Reference

[](#complete-configuration-reference)

```
# config/packages/valksor.yaml
valksor:
    build:
        enabled: true

        # Hot Reload Configuration
        hot_reload:
            enabled: true
            debounce_delay: 0.3 # Seconds to wait before triggering reload
            watch_dirs: # Directories to watch
                - "templates/"
                - "src/"
                - "assets/"
            extended_extensions: # File-specific debounce times
                php: 0.1 # PHP files: 100ms debounce
                js: 0.1 # JavaScript files: 100ms debounce
                css: 0.2 # CSS files: 200ms debounce
                twig: 0.3 # Twig files: 300ms debounce
            extended_suffixes: # File suffix-specific timing
                ".tailwind.css": 0.5 # Compiled CSS: 500ms debounce
                ".min.css": 0.3 # Minified CSS: 300ms debounce

        # Tailwind CSS Configuration
        tailwind:
            enabled: true
            minify: false # Set to true for production
            watch: true # Watch for changes in development

        # Import Map Configuration
        importmap:
            enabled: true
            watch: true # Auto-update import maps
            minify: false # Set to true for production

        # Binary Management
        binaries:
            required: # Tools to download automatically
                - "tailwindcss"
                - "esbuild"
            cache_duration: 3600 # Cache binary downloads for 1 hour

            # Download strategy for binaries
            download_strategy: "release" # 'release' (default), 'tag', 'commit'
            commit_ref: "main" # Optional: branch/commit for 'commit' strategy
```

### Service Configuration (Advanced)

[](#service-configuration-advanced)

For fine-grained control over which services run:

```
# config/packages/valksor.yaml
valksor:
    build:
        services:
            binaries:
                enabled: true
                flags: ["init", "dev", "prod"] # When to run this service
                options:
                    required: ["tailwindcss", "esbuild"]

            hot_reload:
                enabled: true
                flags: ["dev"] # Run only in development
                options:
                    debounce_delay: 0.3
                    watch_dirs: ["/src", "/templates"]

            tailwind:
                enabled: true
                flags: ["dev", "prod"] # Run in dev and production
                options:
                    minify: false # Will be true in prod

            importmap:
                enabled: true
                flags: ["dev", "prod"]
                options:
                    watch: true
                    minify: false
```

**Service Flags Explained:**

- `init`: Runs during initialization (binary downloads, setup)
- `dev`: Runs during development (`valksor:dev`, `valksor:watch`)
- `prod`: Runs during production builds (`valksor-prod:build`)

### Binary Download Strategies

[](#binary-download-strategies)

The build system supports multiple strategies for downloading binary tools:

#### Download Strategies

[](#download-strategies)

**release**: Downloads from GitHub releases with pre-compiled binaries (default)

**tag**: Downloads from Git tags when no GitHub releases exist

**commit**: Downloads from specific commits or branches

**Usage Examples:**

```
# Download from releases (default)
binaries:
    download_strategy: 'release'

# Download from tags
binaries:
    download_strategy: 'tag'

# Download from specific branch
binaries:
    download_strategy: 'commit'
    commit_ref: 'develop'
```

**Strategy Selection:**

- Use **release** for tools with proper GitHub releases and compiled binaries
- Use **tag** for tools that only publish tags without releases
- Use **commit** for tools that need the latest code from a specific branch

Development Commands
--------------------

[](#development-commands)

### Main Development Workflow

[](#main-development-workflow)

```
# Lightweight development (fast feedback)
php bin/console valksor:dev
# Runs: binaries + hot_reload

# Full development environment (all services)
php bin/console valksor:watch
# Runs: all services with 'dev' flag
```

### Individual Service Commands

[](#individual-service-commands)

```
# Build Tailwind CSS manually
php bin/console valksor:tailwind

# Update import maps manually
php bin/console valksor:importmap

# Hot reload only
php bin/console valksor:hot-reload

# Download/update build tools
php bin/console valksor:binary

# Generate icons
php bin/console valksor:icons

# Production build
php bin/console valksor-prod:build
```

### Command Options

[](#command-options)

```
# Multi-app projects: run on specific app
php bin/console valksor:watch --id=www
php bin/console valksor:watch --id=admin

# Non-interactive mode (for scripts/CI)
php bin/console valksor:watch --non-interactive

# Different environment
php bin/console valksor:dev --env=prod
```

Project Structure Support
-------------------------

[](#project-structure-support)

### Single-App Projects (Default)

[](#single-app-projects-default)

Works out of the box with standard Symfony structure:

- `src/` - PHP files
- `templates/` - Twig templates
- `assets/` - CSS, JavaScript, images
- `public/` - Compiled assets

### Multi-App Projects

[](#multi-app-projects)

For projects with multiple applications:

```
# config/packages/valksor.yaml
valksor:
    build:
        project:
            apps_dir: "apps" # Directory containing apps
            infrastructure_dir: "src" # Shared infrastructure code
```

This automatically discovers:

- Tailwind files in each app directory
- Import maps per application
- Icons for each app
- App-specific configuration

File Watching Patterns
----------------------

[](#file-watching-patterns)

### Default Watched Paths

[](#default-watched-paths)

- `templates/` - Twig templates
- `src/` - PHP files
- `assets/` - CSS, JavaScript, images

### Custom Watch Paths

[](#custom-watch-paths)

```
valksor:
    build:
        hot_reload:
            watch_dirs:
                - "config/" # Watch configuration files
                - "translations/" # Watch translation files
                - "public/assets/" # Watch compiled assets
```

### File-Specific Debounce

[](#file-specific-debounce)

Different file types can have different reload delays:

```
valksor:
    build:
        hot_reload:
            extended_extensions:
                php: 0.1 # PHP files: quick reload
                twig: 0.5 # Templates: slower reload
                css: 0.3 # CSS: medium speed
            extended_suffixes:
                ".tailwind.css": 1.0 # Compiled CSS: slowest
```

Tailwind CSS Integration
------------------------

[](#tailwind-css-integration)

### Basic Tailwind Setup

[](#basic-tailwind-setup)

1. Create your CSS file:

```
/* assets/css/app.css */
@tailwind base;
@tailwind components;
@tailwind utilities;
```

2. Configure Valksor:

```
valksor:
    build:
        tailwind:
            enabled: true
```

3. Start development:

```
php bin/console valksor:watch
```

### With DaisyUI

[](#with-daisyui)

```
valksor:
    build:
        tailwind:
            enabled: true
            # DaisyUI is automatically supported
```

### Tailwind Configuration

[](#tailwind-configuration)

Create `tailwind.config.js` in your project root:

```
module.exports = {
    content: [
        "./templates/**/*.html.twig",
        "./src/**/*.php",
        "./assets/js/**/*.js",
    ],
    theme: {
        extend: {},
    },
    plugins: [require("daisyui")],
    daisyui: {
        themes: ["light", "dark", "cupcake"],
    },
};
```

Import Map Management
---------------------

[](#import-map-management)

### Basic Setup

[](#basic-setup-1)

```
valksor:
    build:
        importmap:
            enabled: true
```

### Using Import Maps

[](#using-import-maps)

```
// assets/js/app.js
import { hotwire } from "@hotwired/turbo";
import { stimulus } from "@hotwired/stimulus";

// Import maps automatically resolve these imports
```

Icon Generation
---------------

[](#icon-generation)

### Basic Icon Setup

[](#basic-icon-setup)

```
valksor:
    build:
        icons:
            enabled: true
```

### Generate Icons

[](#generate-icons)

```
php bin/console valksor:icons
```

Icons are automatically available as Twig functions:

```
{{ icon('lucide-user') }}
{{ icon('custom-icon') }}
```

Troubleshooting
---------------

[](#troubleshooting)

### Common Issues

[](#common-issues)

**Binary Downloads Fail**

```
# Force re-download of build tools
php bin/console valksor:binary
```

**File Watching Not Working**

- Check file permissions on watched directories
- Verify inotify limits (Linux): `cat /proc/sys/fs/inotify/max_user_watches`
- For Docker, ensure volume mounts are correct

**Tailwind Compilation Issues**

- Check your `tailwind.config.js` exists
- Verify content paths in Tailwind config
- Ensure input CSS file exists with `@tailwind` directives

**Port Conflicts**The build system uses default ports that may conflict:

- Hot reload: Port 8080 (configurable)

### Debug Mode

[](#debug-mode)

Enable debug logging:

```
valksor:
    build:
        debug: true
        hot_reload:
            debug: true
```

Requirements
------------

[](#requirements)

- **PHP 8.4 or higher**
- **inotify extension** (for file watching - Linux only)
- **PCNTL extension** (for process management)
- **POSIX extension**
- **Symfony Framework** (7.2.0 or higher)
- **Valksor Bundle** (valksor/php-bundle)
- **Valksor SSE Component** (valksor/php-sse)

### Platform Requirements

[](#platform-requirements)

⚠️ **Linux Only Required**

The ValkDev Build Tools require **Linux** due to their dependency on the **inotify** extension for efficient file system monitoring.

- **inotify** is a Linux kernel subsystem available only on Linux platforms
- File watching is essential for the hot reload, Tailwind compilation, and development workflow features
- These build tools are not compatible with Windows or macOS
- All core functionality (hot reload, asset compilation, import map management) depends on real-time file monitoring

Installation
------------

[](#installation)

Install the package via Composer:

```
composer require valksor/php-dev-build
```

Note: This package is also included in the meta-package `valksor/php-dev`.

Support
-------

[](#support)

- **Documentation**: [Full documentation](https://github.com/valksor/php-dev)
- **Issues**: [GitHub Issues](https://github.com/valksor/php-dev/issues) for bug reports and feature requests
- **Discussions**: [GitHub Discussions](https://github.com/orgs/valksor/discussions/categories/php-dev) for questions and community support

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance53

Moderate activity, may be stable

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity12

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/c4db85e32518c5a6caa2fd625032a2b016ef42d60cf8a101c165cc5c0048b221?d=identicon)[k0d3r1s](/maintainers/k0d3r1s)

---

Top Contributors

[![k0d3r1s](https://avatars.githubusercontent.com/u/38725938?v=4)](https://github.com/k0d3r1s "k0d3r1s (78 commits)")

### Embed Badge

![Health badge](/badges/valksor-php-dev-build/health.svg)

```
[![Health](https://phpackages.com/badges/valksor-php-dev-build/health.svg)](https://phpackages.com/packages/valksor-php-dev-build)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
