|
1 |
| -# strapi-plugin-boilerplate |
| 1 | +<div style="text-align: center"> |
| 2 | + <h1>Strapi Plugin Boilerplate</h1> |
| 3 | + <h5>A test-driven template for building reliable Strapi Plugins</h5> |
| 4 | + |
| 5 | + <p> |
| 6 | + <a href="https://codecov.io/gh/pluginpal/strapi-plugin-boilerplate"> |
| 7 | + <img src="https://img.shields.io/github/actions/workflow/status/pluginpal/strapi-plugin-boilerplate/tests.yml?branch=main" alt="CI build status" /> |
| 8 | + </a> |
| 9 | +</p> |
| 10 | +</div> |
2 | 11 |
|
3 |
| -A test-driven template for building reliable Strapi Plugins |
| 12 | +## ✨ Features |
| 13 | + |
| 14 | +- [x] Setup using [@strapi/sdk-plugin](https://github.com/strapi/sdk-plugin) with commands for `build` and `watch`. |
| 15 | +- [x] An isolated Strapi instance for testing and development, the Playground. |
| 16 | +- [x] Github Actions workflow for linting and testing. |
| 17 | +- [x] Clear community files like [CONTRIBUTING.md](https://github.com/pluginpal/strapi-plugin-boilerplate/blob/main/CONTRIBUTING.md) and [CODE-OF-CONDUCT.md](https://github.com/pluginpal/strapi-plugin-boilerplate/blob/main/CODE_OF_CONDUCT.md). |
| 18 | +- [] Jest & Supertest for testing your plugin API's. |
| 19 | +- [] Cypress for GUI e2e tests |
| 20 | + |
| 21 | +## ⏳ How to use |
| 22 | + |
| 23 | +This repository is meant to be a template for new plugins. It can be used as a starting point, giving you the resources to built a test-driven Strapi plugin. |
| 24 | + |
| 25 | +After creating your copy of the template, do a find-replace through the code and change the following: |
| 26 | + |
| 27 | +1. Change `boilerplate` (lowercase) to be the identifier of your plugin. |
| 28 | +2. Change `Boilerplate` (uppercase) to be the human readable name of your plugin. |
| 29 | + |
| 30 | +You're all set! Go make your plugin and write some tests! |
| 31 | + |
| 32 | +## 📓 Tutorials |
| 33 | + |
| 34 | +This repository has been made alongside an article series called **"Automated Testing for Strapi Plugins"**. |
| 35 | +To better understand how and why this repository has been setup, please read the following articles: |
| 36 | + |
| 37 | +1. [Using a Playground Instance](https://www.pluginpal.io/automated-testing-for-strapi-plugins-using-a-playground-instance) |
| 38 | +2. Integration tests (In Progress) |
| 39 | +3. E2E tests (In Progress) |
| 40 | + |
| 41 | +## 🔌 Commands |
| 42 | + |
| 43 | +### Strapi Plugin SDK commands |
| 44 | + |
| 45 | +1. `yarn build` |
| 46 | + - The native build command of `@strapi/sdk-plugin`. |
| 47 | + - [Documentation can be found here](https://docs.strapi.io/dev-docs/plugins/development/plugin-sdk). |
| 48 | +2. `yarn watch` |
| 49 | + - The native watch command of `@strapi/sdk-plugin`. |
| 50 | + - [Documentation can be found here](https://docs.strapi.io/dev-docs/plugins/development/plugin-sdk). |
| 51 | +3. `yarn watch:link` |
| 52 | + - The native watch:link command of `@strapi/sdk-plugin`. |
| 53 | + - [Documentation can be found here](https://docs.strapi.io/dev-docs/plugins/development/plugin-sdk). |
| 54 | +4. `yarn verify` |
| 55 | + - The native verify command of `@strapi/sdk-plugin`. |
| 56 | + - [Documentation can be found here](https://docs.strapi.io/dev-docs/plugins/development/plugin-sdk). |
| 57 | + - Used in the linting step of the pipeline. |
| 58 | + |
| 59 | +### Testing commands |
| 60 | + |
| 61 | +5. `yarn test:ts:front` |
| 62 | + - A check for Typescript errors on the front-end side. |
| 63 | + - Used in the linting step of the pipeline. |
| 64 | +6. `yarn test:ts:back` |
| 65 | + - A check for Typescript errors on the back-end side. |
| 66 | + - Used in the linting step of the pipeline. |
| 67 | + |
| 68 | +### Playground commands |
| 69 | + |
| 70 | +7. `yarn playground:install` |
| 71 | + - Installs the plugin into the playground using `yalc-add-link`. |
| 72 | + - Installs all other dependencies of the playground. |
| 73 | +8. `yarn playground:yalc-add` |
| 74 | + - Installs a production-like version of the plugin, into the playground. |
| 75 | +9. `yarn playground:yalc-add-link` |
| 76 | + - Installs a development build of the plugin, into the playground. |
| 77 | +10. `yarn playground:build` |
| 78 | + - The native Strapi build command, ran in the playground. |
| 79 | + - [Documentation can be found here](https://docs.strapi.io/dev-docs/cli). |
| 80 | +11. `yarn playground:develop` |
| 81 | + - The native Strapi develop command, ran in the playground. |
| 82 | + - [Documentation can be found here](https://docs.strapi.io/dev-docs/cli). |
| 83 | +12. `yarn playground:start` |
| 84 | + - The native Strapi start command, ran in the playground. |
| 85 | + - [Documentation can be found here](https://docs.strapi.io/dev-docs/cli). |
0 commit comments