Writing composer.json
You have already been introduced to the composer.json
file in the previous chapter. The composer.json
file includes all the crucial information that controls what dependencies and requirements your project has. However, it also includes lots of meta-information. This metadata is used when your package is published on Packagist.
You don't need to worry about this too much while you are developing, but when you want to publish on Packagist, it is beneficial to ensure that your metadata is in good order.
Let's take a look at the composer.json
file for this project:
composer-module-hello-world/composer.json
Repo: https://git.io/JRw58
{ "name": "yourname/hello-world", "description": "A hello world package", "keywords": [ "hello world" ], "license": "GPL-3.0-or-later", ...