### Problem
Projects like [[ https://www.drupal.org/docs/develop/using-composer/using-composer-to-install-drupal-and-manage-dependencies#download-core | Drupal ]], [[ https://symfony.com/doc/current/setup.html | Symfony ]], and [[ https://laravel.com/docs/5.8/installation#installing-laravel | Laravel ]], allow users to create a new project with Composer and then manage extensions, themes, or other dependencies with [[ https://getcomposer.org/doc/03-cli.md | Composer's CLI ]]. While you can edit the `composer.local.json` in a new MediaWiki project, you cannot use the [[ https://getcomposer.org/doc/03-cli.md | Composer CLI ]]. If a user attempts to use the CLI, which is the only interface for Composer, then it will modify the root `composer.json` which users of MediaWiki are not supposed to do as it will make upgrading more difficult as they will have to merge their changes with the changes from MediaWiki core.
### Example
From the mediawiki root, execute:
```
composer require pear/mail
```
which is one of the [[ https://phabricator.wikimedia.org/source/mediawiki/browse/master/composer.json;fc3300e36ddffa6418ea987ca5e5e44b40353d5e$76 | suggested dependencies ]].
doing a `git status` will reveal that you've now modified the `composer.json` in the root. It's now more difficult to upgrade MediaWiki because you'll have to merge these changes with whatever comes from upstream.
### Solution
# Create a new `mediawiki-project` repo with the namespace `mediawiki/mediawiki`
# Create a `composer.json` in the root of this repo that would require `mediawiki/core` in a `./core` folder. ([[ https://github.com/drupal/drupal/blob/8.4.x/composer.json | Example ]])
Doing this would not affect current packaging workflows. It would allow packaging to continue as normal.
### Features
In addition to solving the problem, it also enables:
# People can do a `composer create-project mediawiki/mediawiki` to setup a new project ("This is the equivalent of doing a git clone/svn checkout followed by a `composer install` of the vendors"). Within their project, `mediawiki/core` would be pulled in as a dependency, excluded from version control. The root `composer.json` and `composer.lock` can be tracked in their version control since the user will have their own Git repo and `/html/core` will be updated with composer.
# Allow extensions and skins to be downloaded with the [[ https://getcomposer.org/doc/03-cli.md | Composer CLI ]], e.g. using `composer require mediawiki/vector-skin`
### Testing
```
composer create-project davidbarratt/mediawiki
```
### Demo
https://asciinema.org/a/jAtsbgvx0EJ2cUQ33EeQ85miN
### See also
* {T158726}
* {T173141}
* {T178137}