From 9ce23f9b0808749f4da2dfda210d3edde7e2b961 Mon Sep 17 00:00:00 2001 From: sagautam5 Date: Sun, 28 Apr 2024 12:07:15 +0545 Subject: [PATCH] update docs and add contribution guideline --- CONTRIBUTING.md | 19 +++++++++++++++---- docs/docker/setup.md | 20 ++++++++++---------- 2 files changed, 25 insertions(+), 14 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f8e0173..1300aac 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -34,20 +34,31 @@ Before filing an issue: Before submitting a pull request: - Fetch the phpunit testing dependency by executing following command on root of the project. ```sh -composer update -```- Check the pull requests tab to ensure that the bug doesn't have a fix in progress. + composer install +``` +- Check the pull requests tab to ensure that the bug doesn't have a fix in progress. - Create and test the feature/issue and make sure it doesn't affect codebase by running full tests by executing following console command for two different environment variables. Set APP_LANG to np and en respectively and run following command for each value of language. ```sh -vendor/bin/phpunit + vendor/bin/phpunit +``` +- Make sure contribution align with phpstan standards. You can run following command to ensure this. +```sh + vendor/bin/phpunit analyse --level=9 ``` - Check the codebase to ensure that your feature doesn't already exist. - Check the pull requests to ensure that another person hasn't already submitted the feature or fix. +## Docker Option + +We have recently added workflow to setup this package with Docker Desktop. You can find guidelines in the following document. + +- [Local setup with Docker](https://github.com/sagautam5/local-states-nepal/tree/master/docs/docker/setup.md) + ## Requirements If the project maintainer has any additional requirements, you will find them listed here. @@ -61,4 +72,4 @@ If the project maintainer has any additional requirements, you will find them li - **Send coherent history** - Make sure each individual commit in your pull request is meaningful. If you had to make multiple intermediate commits while developing, please [squash them](https://www.git-scm.com/book/en/v2/Git-Tools-Rewriting-History#Changing-Multiple-Commit-Messages) before submitting. -**Happy coding**! +**Happy coding** ! diff --git a/docs/docker/setup.md b/docs/docker/setup.md index 6ed5d9e..e2168a0 100644 --- a/docs/docker/setup.md +++ b/docs/docker/setup.md @@ -1,20 +1,20 @@ -## Local setup with docker +## Local setup with Docker -In order to make contribution and bug reporting easier, we have recently dockerized this package so that contributors can setup, run tests and view demo locally in just few steps. -You can clone this repository in your computer. Assuming you have docker desktop configured in your computer, you just have to run following command. +In order to make contribution and bug reporting easier, we have recently Dockerized this package so that contributors can setup, run tests and view demo locally in just a few steps. +You can clone this repository on your computer. Assuming you have docker desktop configured in your computer, you just have to run the following command: -If docker desktop is not installed in your computer, You can setup docker desktop from official docs [Docker Desktop](https://docs.docker.com/desktop/) +If Docker Desktop is not installed on your computer, you can setup Docker Desktop from th official docs [Docker Desktop](https://docs.docker.com/desktop/) docker compose up -d -On successful execution of above command, you will have a docker container `localstates` and `nginx` configuration too. You can access demo by visiting following url +On successful execution of the above command, you will have a Docker container `localstates` and `nginx` configuration too. You can access demo by visiting the following url [localstates.test](http://localstates.test) -With following command, we can enter to our container. +With the following command, we can enter our container. docker compose exec localstates bash @@ -29,11 +29,11 @@ vendor/bin/phpstan analyse --level=9 We have uploaded docker images for various version of the php. If you find bug related to specific version of the php, then you can report the bug or contribute on bug fixing by using respective docker image in your setup. -In the docker file, you can update following line with specific docker image. +In the `Dockerfile`, you can update the following line with an specific Docker image. FROM sagautam5/localstates_8.3:v1.0 -As you can see, Above image is for php 8.3. We have the following docker images for respective php versions. +As you can see,the above image is for PHP 8.3. We have the following Docker images for the respective PHP versions. - [sagautam5/localstates_7.1:v1.0](https://hub.docker.com/r/sagautam5/localstates_7.1) - [sagautam5/localstates_7.2:v1.0](https://hub.docker.com/r/sagautam5/localstates_7.2) @@ -44,8 +44,8 @@ As you can see, Above image is for php 8.3. We have the following docker images - [sagautam5/localstates_8.2:v1.0](https://hub.docker.com/r/sagautam5/localstates_8.2) - [sagautam5/localstates_8.3:v1.0](https://hub.docker.com/r/sagautam5/localstates_8.3) -After updating docker file, you have recreate the container with following command. +After updating `Dockerfile`, you have to recreate the container with the following command: docker compose up -d --force-recreate -Now, it's ready with specific version of php \ No newline at end of file +Now, it's ready with an specific version of PHP \ No newline at end of file