Search by

esn-cy / omnia-dev

wpa-esncy

Development environment utilities for Omnia Drupal modules and themes.

Package info

github.com/esn-cy/Omnia-Dev

Homepage

Issues

pkg:composer/esn-cy/omnia-dev

Statistics

Installs: 38

Dependents: 1

Suggesters: 0

Stars: 0

v1.1.0 2026-12-01 14:55 UTC

This package is auto-updated.

Last update: 2026-12-01 15:13:21 UTC


README

Omnia Dev Logo
Omnia Developer Utilities

Automated developer tooling for Omnia Drupal modules and themes to instantly scaffold and manage local DDEV test environments powered by ESN Satellite 5.

Features

  • Automated Satellite 5 Scaffolding: Runs composer create-project esn/satellite-project:^5.0 targeting the test environment directory.
  • Dependency Detection: Automatically discovers your module's or theme's requirements from .info.yml and composer.json and installs them into the test environment.
  • Loop-Safe Relative Symlinks: Symlinks src/, assets/, config/, templates/, css/, js/, and all extension root files intoweb/modules/custom/<module> (or web/themes/custom/<theme> for type: theme) using relative paths that resolve seamlessly on macOS, Linux, and inside Docker containers while preventing infinite recursive scanning loops.
  • Automated DDEV Configuration:
    • Configures DDEV with docroot: web and PHP 8.3+.
    • Creates .ddev/docker-compose.module.yaml to mount your working repository into the container.
    • Automatically registers post-start hooks to ensure container symmetry and keep JetBrains DB connection ports in sync.
  • Automated JetBrains Database Configuration:
    • Automatically creates and updates .idea/dataSources.xml and .idea/dataSources.local.xml with your DDEV database connection (127.0.0.1:<port>/db) so PhpStorm / DataGrip connects without manual setup or port mismatches.
  • Automated Drupal & Satellite Installation: Runs drush site:install satellite, enables your custom module or theme (setting custom themes as default), and prints a one-time admin login link.
  • Cross-Platform Local Test-Matrix Runner (test-matrix): Runs PHPUnit inside isolated Docker/Podman containers across Drupal 10 and Drupal 11 and supported PHP versions (8.3, 8.4, 8.5) without modifying your host PHP version, composer.json, composer.lock, or vendor/.

Prerequisites

  • PHP 8.3+ and Composer 2 on the host (to install and invoke omnia-dev).
  • Docker (Docker Desktop, OrbStack, Docker Engine, or Podman) — required for test-matrix (and by DDEV).
  • DDEV — required for the Satellite test environment commands (init, uli, db).

Installation

Add omnia-dev to your Drupal module's composer.json under require-dev:

composer require --dev esn-cy/omnia-dev

(Or point to your local path repository during development).

Usage

1. Command Line Interface (CLI)

Run the CLI binary from your module repository root:

# Full end-to-end setup (Satellite project, DDEV, symlinks, site-install, enable module)
./vendor/bin/omnia-dev init

# Options:
./vendor/bin/omnia-dev init --dir=test-env --php=8.3 --account-name=admin --account-pass=admin --force

# Update or refresh module symlinks if you added new directories/files
./vendor/bin/omnia-dev link

# Generate a one-time admin login link for the test environment
./vendor/bin/omnia-dev uli

# Configure or refresh the JetBrains IDE database connection (.idea/dataSources.xml)
./vendor/bin/omnia-dev db

# Run the full local Drupal 10/11 & PHP test matrix in Docker
./vendor/bin/omnia-dev test-matrix

2. Local Test-Matrix Runner (test-matrix)

Test any Drupal module locally against both Drupal 10 and Drupal 11 across supported PHP versions on macOS, Linux, and Windows using Docker Desktop, OrbStack, Docker Engine, or Podman.

Supported Matrix

Drupal Version Composer Constraint Supported PHP Versions PHPUnit Config
Drupal 10 ^10.3 8.3, 8.4 (PHP 8.5 skipped — unsupported by D10) phpunit.d10.xml (falls back to phpunit.xml)
Drupal 11 ^11 8.3, 8.4, 8.5 phpunit.xml

How It Works

  • Builds parameterized php:<version>-cli images (docker/test-matrix/Dockerfile) with gd, openssl, simplexml, pdo, mbstring, xdebug, git, unzip, and Composer 2 pre-installed.
  • Persists Composer's download cache in a named Docker volume (omnia-dev-composer-cache) so repeat runs are fast.
  • Mounts the target module read-only into the container, copies project files into /app (excluding vendor/, composer.lock, .phpunit.cache/, reports/, and any local DDEV sandbox directory), pins drupal/core and drupal/core-dev, runs composer update --prefer-dist --no-interaction --no-progress, and executes ./vendor/bin/phpunit.
  • Never modifies your host PHP version, composer.json, composer.lock, or vendor/.
  • Prints a pass/fail summary table at the end and exits non-zero if any combination fails.

Usage Examples

# Run the full matrix against the current directory (all 5 Drupal/PHP combinations)
./vendor/bin/omnia-dev test-matrix

# Test a specific module directory
./vendor/bin/omnia-dev test-matrix /path/to/my-drupal-module

# Filter by Drupal version (10, 11, or all) and/or PHP version (8.3, 8.4, 8.5, or all)
./vendor/bin/omnia-dev test-matrix --drupal=10
./vendor/bin/omnia-dev test-matrix --drupal=11 --php=8.5
./vendor/bin/omnia-dev test-matrix --php=8.4

# Enable Xdebug code coverage (XDEBUG_MODE=coverage; omitted by default with --no-coverage for speed)
./vendor/bin/omnia-dev test-matrix --drupal=11 --php=8.4 --coverage

# Pass arbitrary arguments straight through to PHPUnit after "--"
./vendor/bin/omnia-dev test-matrix -- --filter=MyTest
./vendor/bin/omnia-dev test-matrix /path/to/module --drupal=10 -- --filter=MyTest --stop-on-failure

# Force rebuilding cached test-matrix Docker images without cache
./vendor/bin/omnia-dev test-matrix --rebuild

3. Composer Scripts Integration

Add the script handlers to your module's composer.json:

{
  "scripts": {
    "dev:setup": "Drupal\\omnia_dev\\Composer\\ScriptHandler::setup",
    "dev:link": "Drupal\\omnia_dev\\Composer\\ScriptHandler::link",
    "dev:uli": "Drupal\\omnia_dev\\Composer\\ScriptHandler::uli",
    "dev:db": "Drupal\\omnia_dev\\Composer\\ScriptHandler::db",
    "test:matrix": "Drupal\\omnia_dev\\Composer\\ScriptHandler::testMatrix"
  }
}

Now any developer checking out your repository can run:

# Sets up DDEV, installs Satellite, and links your module
composer dev:setup

# Get an instant login URL
composer dev:uli

# Refresh symlinks
composer dev:link

# Configure or refresh JetBrains IDE database connection
composer dev:db

# Run the local Drupal 10/11 & PHP test matrix
composer test:matrix

# Pass options and PHPUnit arguments through Composer
composer test:matrix -- --drupal=11 --php=8.4 -- --filter=MyTest

Licence

This project is under the Apache 2.0 Licence.