PHPackages                             aivopro/composer - 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. aivopro/composer

ActiveComposer-plugin[Utility &amp; Helpers](/categories/utility)

aivopro/composer
================

AiVoPro Composer plugin - Enhanced custom installer for plugins/themes with advanced asset management

00PHP

Since Jan 20Pushed 5mo agoCompare

[ Source](https://github.com/OARANHA/aivopro-composer)[ Packagist](https://packagist.org/packages/aivopro/composer)[ RSS](/packages/aivopro-composer/feed)WikiDiscussions main Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

oaranha/aivopro-composer
========================

[](#oaranhaaivopro-composer)

**AiVoPro Composer Plugin** - Enhanced custom installer for plugins/themes with advanced asset management.

[![License: MIT](https://camo.githubusercontent.com/08cef40a9105b6526ca22088bc514fbfdbc9aac1ddbf8d4e6c750e3a88a44dca/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d626c75652e737667)](LICENSE)[![PHP Version](https://camo.githubusercontent.com/c9f64f714c636ba27a3bba6dfd52f98426832db1262747efa54b212d16943651/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253545382e322d626c7565)](composer.json)

🚀 Installation
--------------

[](#-installation)

```
composer require oaranha/aivopro-composer
```

✨ Features
----------

[](#-features)

- 🎯 Custom installer for `aivopro-plugin` and `aivopro-theme` package types
- 📦 Automatic copying of public assets to the webroot
- 🧹 Automatic cleanup of public assets on uninstall
- 🌐 Support for glob patterns
- 🎨 Flexible target path resolution
- 💾 File mapping storage for safe removal

📋 Public Files Configuration
----------------------------

[](#-public-files-configuration)

AiVoPro plugins can define public files/directories that should be copied to the webroot during installation. This is configured in the package's `composer.json` under `extra.public`.

### Basic Syntax

[](#basic-syntax)

```
{
  "extra": {
    "public": [
      "path/to/file.js",
      "path/to/directory",
      {
        "source": "source/path",
        "target": "target/path"
      }
    ]
  }
}
```

### Target Path Resolution

[](#target-path-resolution)

The target path follows **"Model A"** where **target is ALWAYS the final destination path**:

Target FormatDescriptionResult`"file.js"`Package dir + target`public/e/{vendor}/{pkg}/file.js``"/file.js"`Webroot + target`public/file.js``"."`Package dir + source basename`public/e/{vendor}/{pkg}/{basename}``"/."` or `"/"`Webroot + source basename`public/{basename}``null` (omitted)Package dir + source basename`public/e/{vendor}/{pkg}/{basename}``"dir/*"`Glob: contents copied to targetContents copied to target directory📚 Usage Examples
----------------

[](#-usage-examples)

### 1️⃣ Legacy String Format (preserves full path)

[](#1️⃣-legacy-string-format-preserves-full-path)

```
{
  "extra": {
    "public": [
      "widget/dist/index.html",
      "widget/dist/styles.css"
    ]
  }
}
```

**Result:**

- `widget/dist/index.html` → `public/e/{vendor}/{pkg}/widget/dist/index.html`
- `widget/dist/styles.css` → `public/e/{vendor}/{pkg}/widget/dist/styles.css`

### 2️⃣ Copy to Package Directory (no leading `/`)

[](#2️⃣-copy-to-package-directory-no-leading-)

```
{
  "extra": {
    "public": [
      {
        "source": "widget/dist/sdk.js",
        "target": "sdk.js"
      },
      {
        "source": "assets",
        "target": "static"
      }
    ]
  }
}
```

**Result:**

- `widget/dist/sdk.js` → `public/e/{vendor}/{pkg}/sdk.js`
- `assets/` → `public/e/{vendor}/{pkg}/static/`

### 3️⃣ Copy to Webroot (leading `/`)

[](#3️⃣-copy-to-webroot-leading-)

```
{
  "extra": {
    "public": [
      {
        "source": "widget/dist/sdk.js",
        "target": "/sdk.js"
      },
      {
        "source": "assets",
        "target": "/static/assets"
      }
    ]
  }
}
```

**Result:**

- `widget/dist/sdk.js` → `public/sdk.js`
- `assets/` → `public/static/assets/`

### 4️⃣ Using Basename Shortcuts (`.` and `/.`)

[](#4️⃣-using-basename-shortcuts--and-)

```
{
  "extra": {
    "public": [
      {
        "source": "widget/dist",
        "target": "."
      },
      {
        "source": "widget/dist",
        "target": "/."
      },
      {
        "source": "widget/dist"
      }
    ]
  }
}
```

**Result:**

- `"."` → `public/e/{vendor}/{pkg}/dist/` (package dir + basename)
- `"/."` → `public/dist/` (webroot + basename)
- No target → `public/e/{vendor}/{pkg}/dist/` (same as `"."`)

### 5️⃣ Glob Patterns (copy contents)

[](#5️⃣-glob-patterns-copy-contents)

```
{
  "extra": {
    "public": [
      {
        "source": "widget/dist/*",
        "target": "/assets"
      }
    ]
  }
}
```

**Result:**

- Contents of `widget/dist/` (e.g., `index.html`, `css/`, `js/`) → `public/assets/`
- Files become `public/assets/index.html`, `public/assets/css/...`, etc.

⚙️ Environment Variables
------------------------

[](#️-environment-variables)

VariableDescriptionDefault`PUBLIC_DIR`Custom webroot path`public`**Example:**

```
export PUBLIC_DIR="web"
composer install
```

📦 Package Types
---------------

[](#-package-types)

This plugin handles the following package types:

- `aivopro-plugin` - Installed to `public/content/plugins/{vendor}/{package}`
- `aivopro-theme` - Installed to `public/content/plugins/{vendor}/{package}`

You can customize the installation path in your root `composer.json`:

```
{
  "extra": {
    "paths": {
      "extensions": "custom/path/to/extensions/"
    }
  }
}
```

🔧 Development
-------------

[](#-development)

### Quality Assurance

[](#quality-assurance)

```
# Run all checks
composer analyse

# Individual tools
composer phpstan      # Static analysis
composer phpcs        # Code style check
composer phpmd        # Mess detection
composer unit-test    # Unit tests

# Fix code style issues
composer fix
```

### Testing

[](#testing)

```
# Run tests
composer unit-test

# Generate coverage report
composer code-coverage
```

📄 License
---------

[](#-license)

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

👤 Author
--------

[](#-author)

**A.Aranha**

- Email:
- GitHub: [@OARANHA](https://github.com/OARANHA)

---

Made with ❤️ for the AiVoPro ecosystem

###  Health Score

17

—

LowBetter than 6% of packages

Maintenance48

Moderate activity, may be stable

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity13

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://avatars.githubusercontent.com/u/25003706?v=4)[A.Aranha](/maintainers/OARANHA)[@OARANHA](https://github.com/OARANHA)

---

Top Contributors

[![OARANHA](https://avatars.githubusercontent.com/u/25003706?v=4)](https://github.com/OARANHA "OARANHA (8 commits)")

### Embed Badge

![Health badge](/badges/aivopro-composer/health.svg)

```
[![Health](https://phpackages.com/badges/aivopro-composer/health.svg)](https://phpackages.com/packages/aivopro-composer)
```

###  Alternatives

[mmucklo/inflect

inflect - a memoizing inflector for php

4024.5M14](/packages/mmucklo-inflect)[producer/producer

Tools for releasing library packages; supports Git, Mercurial, Github, Gitlab, and Bitbucket.

10419.8k3](/packages/producer-producer)[naxeem/thaana-transliterator

Thaana transliterator

203.7k](/packages/naxeem-thaana-transliterator)

PHPackages © 2026

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