Aikeedo Composer plugin to register custom installer for Aikeedo plugins/themes.
composer require heyaikeedo/composer- Custom installer for
aikeedo-pluginandaikeedo-themepackage types - Automatic copying of public assets to the webroot
- Automatic cleanup of public assets on uninstall
- Support for glob patterns
Aikeedo 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.
{
"extra": {
"public": [
"path/to/file.js",
"path/to/directory",
{
"source": "source/path",
"target": "target/path"
}
]
}
}The target path follows "Model A" where target is ALWAYS the final destination path:
| Target Format | Description | Result |
|---|---|---|
"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 target | Contents copied to target directory |
{
"extra": {
"public": ["widget/dist/index.html", "widget/dist/styles.css"]
}
}Result:
widget/dist/index.html→public/e/{vendor}/{pkg}/widget/dist/index.htmlwidget/dist/styles.css→public/e/{vendor}/{pkg}/widget/dist/styles.css
{
"extra": {
"public": [
{
"source": "widget/dist/sdk.js",
"target": "sdk.js"
},
{
"source": "assets",
"target": "static"
}
]
}
}Result:
widget/dist/sdk.js→public/e/{vendor}/{pkg}/sdk.jsassets/→public/e/{vendor}/{pkg}/static/
{
"extra": {
"public": [
{
"source": "widget/dist/sdk.js",
"target": "/sdk.js"
},
{
"source": "assets",
"target": "/static/assets"
}
]
}
}Result:
widget/dist/sdk.js→public/sdk.jsassets/→public/static/assets/
{
"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".")
{
"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.
| Variable | Description | Default |
|---|---|---|
PUBLIC_DIR |
Custom webroot path | public |
This plugin handles the following package types:
aikeedo-plugin- Installed toextra/extensions/{vendor}/{package}aikeedo-theme- Installed toextra/extensions/{vendor}/{package}
See LICENSE file.