Skip to content

Commit

Permalink
Merge pull request #20 from Trusted97/chore/add-documentation
Browse files Browse the repository at this point in the history
chore: add docs for command
  • Loading branch information
Trusted97 authored Dec 8, 2023
2 parents b50889b + 6ea2c23 commit 1bf6b14
Show file tree
Hide file tree
Showing 10 changed files with 347 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/.* export-ignore
/docker/ export-ignore
/docs/ export-ignore
/docker-compose.yaml export-ignore
/phpunit.xml export-ignore
/php-cs-fixer.dist.php export-ignore
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,9 @@ vendor/bin/whitecat phpunit:init

## Compatibility

| Version | Status | PHP compatibility |
|---------|------------|-------------------|
| 1.x | maintained | `^8.1` |
| Repository Branch | PHP Compatibility | Status | Docs |
|-------------------|-------------------|----------------------------|-----------------------------|
| `1.x` | `^8.1` | New features and bug fixes | [Documentation 1.x](./docs) |

## Contributing

Expand Down
43 changes: 43 additions & 0 deletions docs/docker-setup-command-doc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Docker Setup Command Documentation

## Introduction

The `docker:setup` command generates a basic Docker setup for a PHP library. It creates necessary directories and copies configuration files to enable Docker support for the library.

## Usage

`vendor/bin/whitecat docker:setup`

## Command Options

The command does not accept any additional options or arguments. It is a self-contained setup process.

## Command Execution

To execute the `docker:setup` command, run the following:

`vendor/bin/whitecat docker:setup`

## Generated Docker Setup

The command performs the following tasks:

1. Checks for the existence of the Docker directory. If it doesn't exist, it creates the directory.
2. Copies PHP 8.1 configuration files from the Docker directory to the specified distribution directory.
3. Copies the `docker-compose.yml` file to the specified distribution directory.

## Confirmation Prompts

The command prompts the user for confirmation in the following scenarios:

* If the Docker directory already exists, the user can choose to continue and override it.
* If the PHP 8.1 configuration already exists, the user can choose to override it.
* If the `docker-compose.yml` file already exists, the user can choose to override it.

## Command Output

Upon successful execution, the command outputs a success message.

## Exceptions

If any errors occur during directory or file creation, appropriate error messages are displayed.
41 changes: 41 additions & 0 deletions docs/github-init-command-doc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# GitHub Init Command Documentation

## Introduction

The `github:init` command generates a basic Github directory with starter files including `.editorconfig`, `.gitattributes`, `.gitignore`, and `README.md`.

## Usage

`vendor/bin/whitecat github:init`

## Command Options

The command does not accept any additional options or arguments. It is a self-contained setup process.

## Command Execution

To execute the `github:init` command, run the following:

`vendor/bin/whitecat github:init`

Generated GitHub Setup

The command performs the following tasks:

1. Checks for the existence of the GitHub directory. If it doesn't exist, it creates the directory.
2. Copies `.editorconfig`, `.gitattributes`, `.gitignore`, and `README.md` files to the specified distribution directory.

## Confirmation Prompts

The command prompts the user for confirmation in the following scenarios:

* If the GitHub directory already exists, the user can choose to continue and override it.
* If any of the starter files already exist, the user can choose to override them.

## Command Output

Upon successful execution, the command outputs a success message.

## Exceptions

If any errors occur during file or directory creation, appropriate error messages are displayed.
41 changes: 41 additions & 0 deletions docs/github-issue-command-doc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# GitHub Issue Command Documentation

## Introduction

The `github:issue` command generates a basic template for GitHub issues, including bug reports and feature requests.

## Usage

`vendor/bin/whitecat github:issue`

## Command Options

The command does not accept any additional options or arguments. It is a self-contained setup process.

## Command Execution

To execute the `github:issue` command, run the following:

`vendor/bin/whitecat github:issue`

## Generated GitHub Issue Setup

The command performs the following tasks:

1. Checks for the existence of the GitHub issue directory. If it doesn't exist, it creates the directory.
2. Copies `BUG-REPORT.yml`, `FEATURE-REQUEST.yml`, and `config.yml` files to the specified distribution directory.

## Confirmation Prompts

The command prompts the user for confirmation in the following scenarios:

* If the GitHub issue directory already exists, the user can choose to continue and override it.
* If any of the issue templates or the configuration file already exist, the user can choose to override them.

## Command Output

Upon successful execution, the command outputs a success message.

## Exceptions

If any errors occur during file or directory creation, appropriate error messages are displayed.
41 changes: 41 additions & 0 deletions docs/github-pull-command-doc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# GitHub Pull Command Documentation

## Introduction

The `github:pull` command generates basic templates for GitHub pull requests, including fix, improvement, and new feature templates.

## Usage

`vendor/bin/whitecat github:pull`

## Command Options

The command does not accept any additional options or arguments. It is a self-contained setup process.

## Command Execution

To execute the `github:pull` command, run the following:

`vendor/bin/whitecat github:pull`

## Generated GitHub Pull Request Setup

The command performs the following tasks:

1. Checks for the existence of the GitHub pull request directory. If it doesn't exist, it creates the directory.
2. Copies `FIX.md`, `IMPROVEMENT.md`, and `NEW_FEATURE.md` files to the specified distribution directory.

## Confirmation Prompts

The command prompts the user for confirmation in the following scenarios:

* If the GitHub pull request directory already exists, the user can choose to continue and override it.
* If any of the pull request templates already exist, the user can choose to override them.

## Command Output

Upon successful execution, the command outputs a success message.

## Exceptions

If any errors occur during file or directory creation, appropriate error messages are displayed.
52 changes: 52 additions & 0 deletions docs/github-workflow-command-doc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# GitHub Workflow Command Documentation

## Introduction

The `github:workflow` command generates basic GitHub workflow templates for various actions such as PHPUnit testing, deployment to Amazon ECS, deployment to Google Kubernetes Engine, and Terraform deployment.

## Usage

`vendor/bin/whitecat github:workflow`

## Command Options

The command does not accept any additional options or arguments. It provides an interactive interface to choose the desired workflow actions.

## Command Execution

To execute the `github:workflow` command, run the following:

`vendor/bin/whitecat github:workflow`

## Generated GitHub Workflow Setup

The command performs the following tasks:

1. Checks for the existence of the GitHub workflow directory. If it doesn't exist, it creates the directory.
2. Allows the user to choose specific workflow actions or select "All" to generate all available workflows.
3. Copies the selected workflow files to the specified distribution directory.

## Available Workflow Options

The user can choose from the following workflow options:

* PHPUnit & Coverage (CodeCov)
* Deploy to Amazon ECS
* Deploy to Google Kubernetes Engine
* Terraform Deploy
* All

## Confirmation Prompts

The command prompts the user for confirmation in the following scenarios:

* If the GitHub workflow directory already exists, the user can choose to continue and override it.
* If any of the workflow templates already exist, the user can choose to override them.

## Command Output

Upon successful execution, the command outputs a success message.

## Exceptions

If any errors occur during file or directory creation, appropriate error messages are displayed.
41 changes: 41 additions & 0 deletions docs/php-cs-fixer-init-command-doc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# PHP CS Fixer Initialization Command Documentation

## Introduction

The `php-cs-fixer:init` command sets up basic configuration for PHP-CS-Fixer in a PHP library.

## Usage

`vendor/bin/whitecat php-cs-fixer:init`

## Command Options

The command does not accept any additional options or arguments. It automatically detects the presence of PHP-CS-Fixer in the `require-dev` section of the `composer.json` file.

## Command Execution

To execute the `php-cs-fixer:init` command, run the following:

`vendor/bin/whitecat php-cs-fixer:init`

## Generated PHP-CS-Fixer Setup

The command performs the following tasks:

1. Checks if PHP-CS-Fixer is installed as a development dependency.
2. If PHP-CS-Fixer is not installed, it displays a warning message with instructions on how to install it using Composer.
3. Copies the `.php-cs-fixer.dist.php` configuration file to the specified distribution directory.

## Confirmation Prompts

The command prompts the user for confirmation in the following scenario:

* If the `.php-cs-fixer.dist.php` file already exists, the user can choose to override it.

## Command Output

Upon successful execution, the command outputs a success message.

## Exceptions

If any errors occur during the validation or file copying process, appropriate error messages are displayed.
41 changes: 41 additions & 0 deletions docs/phpstan-init-command-doc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# PHPStan Initialization Command Documentation

## Introduction

The `phpstan:init` command sets up basic configuration for PHPStan in a PHP library.

## Usage

`vendor/bin/whitecat phpstan:init`

## Command Options

The command does not accept any additional options or arguments. It automatically detects the presence of PHPStan in the `require-dev` section of the `composer.json` file.

## Command Execution

To execute the `phpstan:init` command, run the following:

`vendor/bin/whitecat phpstan:init`

## Generated PHPStan Setup

The command performs the following tasks:

1. Checks if PHPStan is installed as a development dependency.
2. If PHPStan is not installed, it displays a warning message with instructions on how to install it using Composer.
3. Copies the `phpstan.neon` configuration file to the specified distribution directory.

## Confirmation Prompts

The command prompts the user for confirmation in the following scenario:

* If the `phpstan.neon` file already exists, the user can choose to override it.

## Command Output

Upon successful execution, the command outputs a success message.

## Exceptions

If any errors occur during the validation or file copying process, appropriate error messages are displayed.
43 changes: 43 additions & 0 deletions docs/phpunit-init-command-doc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# PHPUnit Initialization Command Documentation

## Introduction

The `phpunit:init` command sets up basic configuration for PHPUnit in a PHP library.

## Usage

`vendor/bin/whitecat phpunit:init`

## Command Options

The command does not accept any additional options or arguments. It automatically detects the presence of PHPUnit in the `require-dev` section of the `composer.json` file.

## Command Execution

To execute the `phpunit:init` command, run the following:

`vendor/bin/whitecat phpunit:init`

## Generated PHPUnit Setup

The command performs the following tasks:

1. Checks if PHPUnit is installed as a development dependency.
2. If PHPUnit is not installed, it displays a warning message with instructions on how to install it using Composer.
3. Copies the `phpunit.xml` configuration file to the specified distribution directory.
4. Copies the PHPUnit configuration directory to the specified distribution directory.

## Confirmation Prompts

The command prompts the user for confirmation in the following scenarios:

* If the `phpunit.xml` file already exists, the user can choose to override it.
* If the PHPUnit configuration directory already exists, the user can choose to override it.

## Command Output

Upon successful execution, the command outputs a success message.

## Exceptions

If any errors occur during the validation or file copying process, appropriate error messages are displayed.

0 comments on commit 1bf6b14

Please sign in to comment.