[improve-docs] Explain what the root package is, refs #500
parent
99c90cde5a
commit
3cccc29b55
|
@ -151,8 +151,8 @@ packagist is available automatically through composer. Since monolog
|
||||||
[is on packagist](http://packagist.org/packages/monolog/monolog), we can depend
|
[is on packagist](http://packagist.org/packages/monolog/monolog), we can depend
|
||||||
on it without having to specify any additional repositories.
|
on it without having to specify any additional repositories.
|
||||||
|
|
||||||
Assuming we want to share `hello-world` with the world, we would want to
|
If we wanted to share `hello-world` with the world, we would publish it on
|
||||||
publish it on packagist as well. And this is really easy.
|
packagist as well. Doing so is really easy.
|
||||||
|
|
||||||
You simply hit the big "Submit Package" button and sign up. Then you submit
|
You simply hit the big "Submit Package" button and sign up. Then you submit
|
||||||
the URL to your VCS repository, at which point packagist will start crawling
|
the URL to your VCS repository, at which point packagist will start crawling
|
||||||
|
|
|
@ -1,13 +1,27 @@
|
||||||
# composer.json
|
# composer.json
|
||||||
|
|
||||||
This chapter will explain all of the options available in `composer.json`.
|
This chapter will explain all of the fields available in `composer.json`.
|
||||||
|
|
||||||
## JSON schema
|
## JSON schema
|
||||||
|
|
||||||
We have a [JSON schema](http://json-schema.org) that documents the format and
|
We have a [JSON schema](http://json-schema.org) that documents the format and
|
||||||
can also be used to validate your `composer.json`. In fact, it is used by the
|
can also be used to validate your `composer.json`. In fact, it is used by the
|
||||||
`validate` command. You can find it at:
|
`validate` command. You can find it at:
|
||||||
[`Resources/composer-schema.json`](https://github.com/composer/composer/blob/master/res/composer-schema.json).
|
[`res/composer-schema.json`](https://github.com/composer/composer/blob/master/res/composer-schema.json).
|
||||||
|
|
||||||
|
## Root Package
|
||||||
|
|
||||||
|
The root package is the package defined by the `composer.json` at the root of
|
||||||
|
your project. It is the main `composer.json` that defines your project
|
||||||
|
requirements.
|
||||||
|
|
||||||
|
Certain fields only apply when in the root package context. One example of
|
||||||
|
this is the `config` field. Only the root package can define configuration.
|
||||||
|
The config of dependencies is ignored. This makes the `config` field
|
||||||
|
`root-only`.
|
||||||
|
|
||||||
|
If you clone one of those dependencies to work on it, then that package is the
|
||||||
|
root package. The `composer.json` is identical, but the context is different.
|
||||||
|
|
||||||
## Properties
|
## Properties
|
||||||
|
|
||||||
|
@ -346,7 +360,7 @@ Example:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
### scripts
|
### scripts <span>(root-only)</span>
|
||||||
|
|
||||||
Composer allows you to hook into various parts of the installation process
|
Composer allows you to hook into various parts of the installation process
|
||||||
through the use of scripts.
|
through the use of scripts.
|
||||||
|
|
Loading…
Reference in New Issue