dpp / composer-plugin
Composer plugin for integration with the Drupal Project Platform
Requires
- composer-plugin-api: ^2.3
Requires (Dev)
- composer/composer: ^2.6.4
- czproject/git-php: ^4.2
- friendsofphp/php-cs-fixer: ^3.22
- phpstan/phpstan: ^1.10
- phpunit/phpunit: ^10
- dev-main
- 1.0.0-beta13
- 1.0.0-beta12
- 1.0.0-beta11
- 1.0.0-beta10
- 1.0.0-beta9
- 1.0.0-beta8
- 1.0.0-beta7
- 1.0.0-beta6
- 1.0.0-beta5
- 1.0.0-beta4
- 1.0.0-beta3
- 1.0.0-beta2
- dev-alex.a.pott-main-patch-17095
- dev-improve-onboard-command
- dev-add-dev-requirements
- dev-refactor-tests
- dev-onboard-command
- dev-config-validator
This package is auto-updated.
Last update: 2024-12-08 11:21:39 UTC
README
This plugin adds the ability to use the DPP package manager.
Installation
The plugin needs to be installed globally, because it needs to be present before composer resolves the dependencies.
composer global config repositories.dpp-composer-plugin vcs https://gitlab.burdaverlag.dev/thunder/dpp-composer-plugin.git
composer global require dpp/composer-plugin
Configuration
Onboard existing project via command
You can run the custom onboard command to configure your existing project.
composer dpp-onboard
It automatically updates your composer.json so your project is set up for DPP and finally performs composer update
to make sure all dependencies are supported.
Options
The command lets you set your own DPP base project git url
composer dpp-onboard --dpp-base-project-git-url git@gitlab.burdaverlag.dev:dpp/DPP-Base-Project.git
and your preferred DPP version constraint
composer dpp-onboard --dpp-version ^2.0
Manually configure your DPP project
Add the git url of your DPP base project to your composer.json extra section.
"extra": {
"dpp-base-project-git-url": "git@gitlab.burdaverlag.dev:dpp/DPP-Base-Project.git"
},
Or set the environment variable
COMPOSER_DPP_BASE_PROJECT_GIT_URL="git@gitlab.burdaverlag.dev:dpp/DPP-Base-Project.git"
Also it's recommended to disable the packagist.org repo.
"repositories": [
{
"packagist.org": false
}
]
Usage
You can now set the dpp version constraint in your composer.json.
"require": {
"dpp/version": "^1.0.0"
},
All your other required packages will be resolved by the DPP package manager.
Dev Mode
To create a composer.dev.json
with access to all packagist.org packages run:
composer dpp-create-dev-json
To use the composer.dev.json
file run composer commands like
COMPOSER=./composer.json.dev composer <command>
Development
Create a new directory and add a composer.json file with the following content:
{
"name": "dpp/dpp-project",
"type": "project",
"repositories": {
"dpp/composer-plugin": {
"type": "path",
"url": "../plugin"
}
},
"require": {
"dpp/composer-plugin": "^1",
"cweagans/composer-patches": "*"
},
"extra": {
"enable-patching": true,
"dpp-base-project-git-url": "git@gitlab.burdaverlag.dev:dpp/DPP-Base-Project.git"
},
"config": {
"allow-plugins": {
"dpp/composer-plugin": true
}
}
}
Change the url in the repositories section to the path to the plugin directory.
Then run composer install
to install the plugin.
After that, you can run composer require dpp/version
to test the plugin.