diff --git a/README.md b/README.md index 21b6fc62a..fd19958ee 100644 --- a/README.md +++ b/README.md @@ -34,37 +34,63 @@ ## WORK IN PROGRESS -Please note that this plugin is under active development, and might not be ready to run on production code yet. - -## Contributing - -If you're interested in contributing to the development of Prettier for PHP, you can follow the [CONTRIBUTING guide from Prettier](https://github.com/prettier/prettier/blob/master/CONTRIBUTING.md), as it all applies to this repository too. - -To test it out on a PHP file: - -* Clone this repository. -* Run `yarn`. -* Create a file called `test.php`. -* Run `yarn prettier test.php` to check the output. +Please note that this plugin is currently in alpha stage and still under active development. We encourage everyone to try it and give feedback, but we don't recommend it for production use yet. ## Install +You'll need a current development version of prettier, because the plugin depends on currently unreleased features. + yarn: + ```bash -yarn add --dev prettier/prettier prettier/plugin-php +yarn add --dev prettier/prettier @prettier/plugin-php +# or globally +yarn global add prettier/prettier @prettier/plugin-php ``` npm: + ```bash -npm install --save-dev prettier/prettier prettier/plugin-php +npm install --save-dev prettier/prettier @prettier/plugin-php +# or globally +npm install --global prettier/prettier @prettier/plugin-php ``` ## Use +If you installed prettier as a local dependency, you can add prettier as a script in your `package.json`, + +```json +"scripts": { + "prettier": "prettier" +} +``` + +and then run it via + +```bash +yarn run prettier path/to/file.php --write +# or +npm run prettier path/to/file.php --write +``` + +If you installed globally, run + ```bash -prettier --write "**/*.php" +prettier path/to/file.php --write ``` +## Contributing + +If you're interested in contributing to the development of Prettier for PHP, you can follow the [CONTRIBUTING guide from Prettier](https://github.com/prettier/prettier/blob/master/CONTRIBUTING.md), as it all applies to this repository too. + +To test it out on a PHP file: + +* Clone this repository. +* Run `yarn`. +* Create a file called `test.php`. +* Run `yarn prettier test.php` to check the output. + ## Maintainers diff --git a/package.json b/package.json index 2e7b1c48d..407ae1f2f 100644 --- a/package.json +++ b/package.json @@ -1,12 +1,14 @@ { "name": "@prettier/plugin-php", - "version": "0.0.0-development", + "version": "0.1.0", "description": "Prettier PHP Plugin", "repository": "prettier/prettier-php", "author": "Lucas Azzola <@azz>", "license": "MIT", "main": "src", - "files": ["src"], + "files": [ + "src" + ], "dependencies": { "php-parser": "glayzzle/php-parser#a8f10d8c9aacf8e90b283229f8bed76363b99fcf" }, @@ -28,6 +30,8 @@ "prettier": "prettier --plugin=. --parser=php" }, "jest": { - "projects": ["/jest.*.config.js"] + "projects": [ + "/jest.*.config.js" + ] } }