For development, WP-Gistpen requires these tools:
- PHP 5.4+
- Note: WordPress is compatible back to 5.2, so not all users will be able to use this plugin.
- Composer, for back-end libraries.
- 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.
- Clone the repository.
npm install && composer install && npm run build
.- Make and commit your changes. Don't forget to update the tests!
- Open a pull request against
develop
. - We'll review the pull request and help you through any changes.
- If everything passes, we'll merge the
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.
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.
- NOTE: Before running the tests, run
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.
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.