From 89d6f53135860a866faec2a1dffb03701e9fb72c Mon Sep 17 00:00:00 2001 From: Christian Zosel Date: Mon, 9 Apr 2018 21:29:01 +0200 Subject: [PATCH 1/3] README update for alpha release --- README.md | 54 +++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 39 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 21b6fc62a..07d4e1fdd 100644 --- a/README.md +++ b/README.md @@ -34,37 +34,61 @@ ## 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 yarn: + ```bash -yarn add --dev prettier/prettier prettier/plugin-php +yarn add --dev prettier @prettier/plugin-php +# or globally +yarn global add prettier @prettier/plugin-php ``` npm: + ```bash -npm install --save-dev prettier/prettier prettier/plugin-php +npm install --save-dev prettier @prettier/plugin-php +# or globally +npm install --global 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 From 377fae4c6d3af296e65a150cc4dff558d2242533 Mon Sep 17 00:00:00 2001 From: Christian Zosel Date: Mon, 9 Apr 2018 22:00:12 +0200 Subject: [PATCH 2/3] Install current dev build of prettier --- README.md | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 07d4e1fdd..fd19958ee 100644 --- a/README.md +++ b/README.md @@ -38,20 +38,22 @@ Please note that this plugin is currently in alpha stage and still under active ## 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/plugin-php +yarn add --dev prettier/prettier @prettier/plugin-php # or globally -yarn global add prettier @prettier/plugin-php +yarn global add prettier/prettier @prettier/plugin-php ``` npm: ```bash -npm install --save-dev prettier @prettier/plugin-php +npm install --save-dev prettier/prettier @prettier/plugin-php # or globally -npm install --global prettier @prettier/plugin-php +npm install --global prettier/prettier @prettier/plugin-php ``` ## Use @@ -59,8 +61,8 @@ npm install --global prettier @prettier/plugin-php If you installed prettier as a local dependency, you can add prettier as a script in your `package.json`, ```json -scripts: { - "prettier":"prettier" +"scripts": { + "prettier": "prettier" } ``` From 675a053e7b9d264510cc321eb7b852ff156252b9 Mon Sep 17 00:00:00 2001 From: Christian Zosel Date: Mon, 9 Apr 2018 22:08:39 +0200 Subject: [PATCH 3/3] 0.1.0 --- package.json | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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" + ] } }