Skip to content

Commit 76ad402

Browse files
committed
Document composer package distribution
1 parent dfd3a02 commit 76ad402

File tree

1 file changed

+11
-31
lines changed

1 file changed

+11
-31
lines changed

README.md

Lines changed: 11 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -28,42 +28,22 @@ compatible with web and CLI environments on PHP 7.2+. There's not much technical
2828
at this point but you can refer to the [blueprints.php file](https://github.com/WordPress/php-toolkit/blob/219dc4e846af270a5009e523244d0ec23baaa32a/components/Blueprints/bin/blueprint.php#L226) to see
2929
how the runner is implemented.
3030

31-
### Using the libraries
32-
33-
Use composer to install the libraries in a non-WordPress project.
34-
35-
This is the minimal composer.json file you need to consume the libraries:
36-
37-
```json
38-
{
39-
"name": "my-namespace/my-package",
40-
"require": {
41-
"WordPress/php-toolkit": "^v0.0.21-alpha"
42-
},
43-
"repositories": [
44-
{
45-
"type": "github",
46-
"url": "https://github.com/WordPress/php-toolkit"
47-
}
48-
]
49-
}
50-
```
31+
### Using the components
5132

52-
You can also lock it in to a specific commit or tag:
33+
The individual components are now distributed via Composer at [https://packagist.org/packages/wp-php-toolkit](https://packagist.org/packages/wp-php-toolkit). You can install specific components you need rather than the entire toolkit.
5334

54-
```json
55-
{
56-
"require": {
57-
"WordPress/php-toolkit": "dev-trunk#122b547"
58-
}
59-
}
60-
```
35+
To install a specific component, use composer:
6136

62-
For now, there is no way to cherry-pick just the one library you need. It's all or nothing.
37+
```bash
38+
composer require wp-php-toolkit/http-client
39+
composer require wp-php-toolkit/data-liberation
40+
composer require wp-php-toolkit/git
41+
# ... and so on for other components
42+
```
6343

64-
Note that the composer.json example above downloads more files than the required minimum, e.g. markdowns, unit tests, the `plugins` directory, etc. That's about 50MB of code in total and, most likely, it's not a big deal for your project. If you want a smaller package, the Data Liberation plugin referenced above ships a minified phar file that's about ~500KB compressed.
44+
#### PHAR distribution
6545

66-
If you'd like to install just a single library, you'll need to contribute a PR to distribute each library as a separate package. Most likely, though, you don't really need that. If you have doubts, open a new issue and we'll figure it out together.
46+
For convenience, a standalone Blueprints runner and other tools from this repository are shipped as phar files available in the [GitHub releases](https://github.com/WordPress/php-toolkit/releases).
6747

6848
### Design goals
6949

0 commit comments

Comments
 (0)