{"id":25317871,"url":"https://github.com/vaimo/composer-repository-bundle","last_synced_at":"2025-10-28T21:30:55.859Z","repository":{"id":33144073,"uuid":"140471720","full_name":"vaimo/composer-repository-bundle","owner":"vaimo","description":"Allow packages to be installed from a repository or tar-ball (or zip files) bundle that have multiple packages in the sub-folders","archived":false,"fork":false,"pushed_at":"2022-05-04T14:27:33.000Z","size":78,"stargazers_count":9,"open_issues_count":0,"forks_count":2,"subscribers_count":12,"default_branch":"master","last_synced_at":"2024-09-15T15:24:24.000Z","etag":null,"topics":["bundles","composer-installer","composer-plugin","downloader"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vaimo.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE_VAIMO.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-07-10T18:20:14.000Z","updated_at":"2023-03-31T08:52:53.000Z","dependencies_parsed_at":"2022-08-08T09:30:17.951Z","dependency_job_id":null,"html_url":"https://github.com/vaimo/composer-repository-bundle","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vaimo%2Fcomposer-repository-bundle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vaimo%2Fcomposer-repository-bundle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vaimo%2Fcomposer-repository-bundle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vaimo%2Fcomposer-repository-bundle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vaimo","download_url":"https://codeload.github.com/vaimo/composer-repository-bundle/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238725864,"owners_count":19520115,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bundles","composer-installer","composer-plugin","downloader"],"created_at":"2025-02-13T19:55:22.030Z","updated_at":"2025-10-28T21:30:55.458Z","avatar_url":"https://github.com/vaimo.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Vaimo Composer Repository Bundle\n\n[![Latest Stable Version](https://poser.pugx.org/vaimo/composer-patches/v/stable)](https://packagist.org/packages/vaimo/composer-patches)\n[![Total Downloads](https://poser.pugx.org/vaimo/composer-repository-bundle/downloads)](https://packagist.org/packages/vaimo/composer-repository-bundle)\n[![Daily Downloads](https://poser.pugx.org/vaimo/composer-repository-bundle/d/daily)](https://packagist.org/packages/vaimo/composer-repository-bundle)\n[![Minimum PHP Version](https://img.shields.io/packagist/php-v/vaimo/composer-repository-bundle.svg)](https://php.net/)\n[![License](https://poser.pugx.org/vaimo/composer-repository-bundle/license)](https://packagist.org/packages/vaimo/composer-repository-bundle)\n\nAllows composer package installation from repositories or zip files that have multiple packages \ninside of them or declare certain folder within the project as local repository.\n\nIn short: it removes the need to declare each local package as PATH repository and allows users to\ninstall things from remote .zip files (by downloading them and registering them - again - as PATH repositories).\n\nMore information on recent changes [HERE](./CHANGELOG.md).\n\n## Overview\n\nEnvironment variables can be defined as key value pairs in the project's composer.json\n\n```json\n{\n    \"_ignoreme\": \"this is the main level of composer.json\",\n  \n    \"extra\": {\n        \"bundles\": {},\n        \"bundles-package\": {}\n    }\n}\n```\n\nThese values will be declared for system-wide use. The main idea of the module is to provide\na way to pre-configure any flags for any of the composer plugins in case the flag setting\nhas not been properly exposed to the end-user.\n\n## Quick-start\n\nIf you want to make local folder behave as if it's a package repository.\n\n1. require this plugin `composer require vaimo/composer-repository-bundle`\n2. configure it (see above)\n3. add module under modules/mypackage with a composer.json (let's say that package name inside composer.json will be myvendor/module-mypackage).\n4. install it with `composer require myvendor/module-mypackage:dev-my-bundle`\n\n```json\n{\n    \"_ignoreme\": \"this is the main level of composer.json\",\n    \n    \"extra\": {\n        \"bundles\": {\n            \"my-bundle\": \"modules\"\n        }\n    }\n}\n```\n\nThe installation will be done from packages that are declared as ...\n\n```txt\nmodules/module1\nmodules/module2\n...\n```\n\nIf you want the files to be mirrored instead on sym-linked, which is the default behaviour, configure \nthe [deploy mode](#configuration-deploy-mode) for your bundle.\n\nIf you have a plan to group your local packages different sub-folders, use [wildcards in path definition](#configuration-group-by-vendor).\n\n## Configuration: adding bundle definition\n\nCan be done against zip file ...\n\n```json\n{\n    \"_ignoreme\": \"this is the main level of composer.json\",\n    \n    \"extra\": {\n        \"bundles\": {\n            \"my-bundle\": {\n                \"url\": \"https://github.com/magento-research/pwa-studio/archive/master.tar.gz\"\n            }\n        }\n    }\n}\n```\n\nSame can be done against repository (in which case either branch name of change-set reference is required)\n\n```json\n{\n    \"_ignoreme\": \"this is the main level of composer.json\",\n    \n    \"extra\": {\n        \"bundles\": {\n            \"my-bundle\": {\n                \"url\": \"git@github.com:magento-research/pwa-studio.git\",\n                \"reference\": \"9c6dfcc955df4b88218cd6c0eb6d0260df27117d\"\n            }\n        }\n    }\n}\n```\n\n## Configuration: local directory as repository\n\nThe plugin can also be used to configure local project-embedded bundle folders from where modules will\nbecome installable.\n\n```json\n{\n    \"_ignoreme\": \"this is the main level of composer.json\",\n    \n    \"extra\": {\n        \"bundles\": {\n            \"my-bundle\": {\n                \"source\": \"modules\"\n            }\n        }\n    }\n}\n```\n\nThis allows any module to be installed from \u003cproject-root\u003e/modules. Note that the modules from a local \nbundle like this will sym-linked instead of being mirrored by default, but can be forced to be also \nmirrored by defining the installation mode. See the guide about [installation](#usage-installing-packages-from-bundle) \nfor more details on how to install the package can be installed from the bundled repository.\n  \nThe above (due to it's minimalistic setup) can also be configred as:\n\n```json\n{\n    \"_ignoreme\": \"this is the main level of composer.json\",\n    \n    \"extra\": {\n        \"bundles\": {\n            \"my-bundle\": \"modules\"\n        }\n    }\n}\n```\n\n## Configuration: deploy mode\n\nBy default the module makes its own decision on how to deploy the package. \n\n* **symlink** - done when bundle situated under the project root (bundle is part of the project).\n* **mirror** - done when bundle situates in composer package cache (bundle is part of global composer). \n\nDeveloper can override this by providing the mode in the bundle configuration.\n\n```json\n{\n    \"_ignoreme\": \"this is the main level of composer.json\",\n    \n    \"extra\": {\n        \"bundles\": {\n            \"my-bundle\": {\n                \"source\": \"modules\",\n                \"mode\": \"mirror\"\n            }\n        }\n    }\n}\n```\n\n## Configuration: group by vendor\n\nBy default, all the packages will be included from the main level of the path that you pointed the bundle \ntowards. This can be changed by using GLOB pattern in the path definition.\n\n```json\n{\n    \"_ignoreme\": \"this is the main level of composer.json\",\n    \n    \"extra\": {\n        \"bundles\": {\n            \"my-bundle\": {\n                \"source\": \"modules/*\"\n            }\n        }\n    }\n}\n```\n\nThis configuration will make it possible to define packages under several folders in format of ... \n\n```txt\nmodules/myvendor/module1\nmodules/myvendor/module2\nmodules/othervendor/module2\n...\n```\n\n## Configuration: defining bundle sub-folders as repository root\n\nBy default, the bundle repository will consider every sub-folder on the main level of the bundle as potential\ninstallable package, in case the packages are available in some sub-folder(s), relative paths can be defined.\n\n```json\n{\n    \"_ignoreme\": \"this is the main level of composer.json\",\n    \n    \"extra\": {\n        \"bundles\": {\n            \"my-bundle\": {\n                \"url\": \"https://github.com/magento-research/pwa-studio/archive/master.tar.gz\",\n                \"paths\": [\"packages\"]\n            }\n        }\n    }\n}\n```\n\n## Configuration: package template\n\nIn case some of the installable sub-folders of the bundle are not directly installable (lack composer.json), \nthe bundle plugin will create the missing package definitions. The only requirement is that the package.\n\nIf there are special parts of the composer.json that need to be defined, declare those under 'extra-package'\nas in same format as one would be declaring normal package configuration. The contents will be used as default\nvalues for generated package definitions:\n\n```json\n{\n    \"_ignoreme\": \"this is the main level of composer.json\",\n    \n    \"extra\": {\n        \"bundles-package\": {\n            \"autoload\": {\n                \"files\": [\"registration.php\"]\n            }\n        }\n    }\n}\n```\n\n## Configuration: custom target path for bundle download\n\nIn case you want bundle to be downloaded into the root of your directory, configure a target folder for it.\n\n```json\n{\n    \"_ignoreme\": \"this is the main level of composer.json\",\n    \n    \"extra\": {\n        \"bundles\": {\n            \"my-bundle\": {\n                \"url\": \"https://github.com/magento-research/pwa-studio/archive/master.tar.gz\",\n                \"paths\": [\"packages\"],\n                \"target\": \"pwa-studio\"\n            }\n        }\n    }\n}\n```\n\nNote that the package installation in this case will result in packages being sym-linked instead of being\nmirrored. \n\n## Usage: installing packages from bundle\n\nMake sure that you have installed this plugin separately before you start installing packages from\nregistered bundles.\n\nAfter bundles have been registered in composer.json, user can just install them as any other composer\npackage. Note that package versions are ignored, use dev-bundle instead. \n\n    composer require magento/theme-frontend-venia:'dev-my-bundle'\n\nNote that 'composer require' is somewhat special as a command and does require a non-version string\nto be used when adding the module to the repository. \n\nThe constraint will be generated from bundle repository name, so in case you want to require the package \nas \"dev-local\", use the following:\n\n```json\n{\n    \"_ignoreme\": \"this is the main level of composer.json\",\n    \n    \"extra\": {\n        \"bundles\": {\n            \"local\": {\n                \"source\": \"modules\"\n            }\n        }\n    }\n}\n```\n\nNote that this configuration will use the folder \u003cproject-root\u003e/modules as bundle repository and packages\nfrom there can be installed with\n\n    composer require vaimo/some-package:'dev-local' \n\n## Usage: updating the package\n\nThe Composer run will be provided with MD5 fingerprint of all the contents of every file in the pacakges, so updating\na package (in case it was not symlinked to vendor). Can be done by just running normal composer update command.\n\n    composer update vaimo/some-package\n\n\n## Development: debugging\n\nIn case the packages don't become installable, the developer is advised to run the require command with verbose mode.\n\n    composer require vaimo/some-package:'dev-local' -vvv\n\nThis should expose output similar to this one (if everything has been configured correctly):\n\n```txt\nRegistering package endpoints\n  - Including vaimo/some-package (e9db459e445a5fa10d4c6ff264332815)\n    ~ Bundle: local\n```\n\nIf something similar to this was not visible in the console output then the packages in the bundle folders are not visible for the Compsoer to install.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvaimo%2Fcomposer-repository-bundle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvaimo%2Fcomposer-repository-bundle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvaimo%2Fcomposer-repository-bundle/lists"}