Skip to content
This repository has been archived by the owner on Feb 2, 2023. It is now read-only.

Latest commit

 

History

History
56 lines (38 loc) · 2.63 KB

CONTRIBUTING.md

File metadata and controls

56 lines (38 loc) · 2.63 KB

How to Contribute to WP-Gistpen

Requirements

For development, WP-Gistpen requires these tools:

  1. PHP 5.4+
    • Note: WordPress is compatible back to 5.2, so not all users will be able to use this plugin.
  2. Composer, for back-end libraries.
  3. node, for build tools.

If you need help with any of these tools, please ask! We all had to learn at some point, and we're happy to help.

Installation

  1. Clone the repository.
  2. npm install && composer install && npm run build.
  3. Make and commit your changes. Don't forget to update the tests!
  4. Open a pull request against develop.
  5. We'll review the pull request and help you through any changes.
  6. If everything passes, we'll merge the

Development Scripts

Front-end

  • npm run dev:app - Starts a Webpack watcher to rebuild the assets as you modify them.
  • npm run dev:tdd - Starts a Mocha watcher to rerun your tests as you modify them.
  • npm run dev:storybook - Starts a Storybook development environment.
  • npm test - Run all the tests, including linting, type checking, and unit testing.

Back-end

  • composer test - Run the unit tests
    • NOTE: Before running the tests, run bash bin/install-wp-tests.sh wordpress_test <username> <password> to set up the support files and database. In a standard homebrew install on OS X, root & password worked for the local databases. Your mileage may vary.

Guidelines

Code style

WP-Gistpen adheres to the WordPress coding standards on the back-end, which are enforced by Scrutinizer & CodeClimate. When you open a pull request, please address any issues it raises for you, if possible. The front-end code style is enforced by ESLint and uses Valtech's code style.

Unit tests

If you're writing new functions or features, please include unit tests for them. Unit tests should test as few assumptions as possible, which means minimize the number of assertions per test. On the back-end, unit test function names start with test_should followed by what the test should prove.

On the front-end, unit tests are in files with *.spec.js as the extension or stories for front-end components with *.story.js as the extension. Stories describe how a component looks in various states, and unit tests describe how a component behaves and changes over time.