These tools are needed to develop the site locally.
Most of this can be acquired using MAMP or Docker. Use you preferred method for developing locally.
During the Alpha/Beta stages, due to constant changes, documentation will be mainly written in-line. With a dedicated section being created at the first major release.
├── config
├── public
│ ├── index.php
│ ├── wp-config.php
│ ├── app
│ │ ├── plugins
│ │ ├── mu-plugins
│ │ ├── themes
│ │ └── languages
│ └── wp
├── tests
├── tools
├── vendor
├── example.env
├── package.json
└── composer.json
/public
files that need to be accessed by the public./public/app/
contains WordPress dependencies./tests/
All configs related to testing the project./tools/
Development tools not specific to the project./vendor
Dependencies install location.composer.json
loads the PHP dependencies for this project.example.env
sampled file with our environment variables are set.
- Set the http authentication for composer eg
composer config -g http-basic.composer.deliciousbrains.com <username> <password>
. - Install composers dependencies
composer install
. - Update environment variables in the
.env
file. Wrap values that may contain non-alphanumeric characters with quotes, or they may be incorrectly parsed. * Database variablesDB_NAME
- Database nameDB_USER
- Database userDB_PASSWORD
- Database passwordDB_HOST
- Database host- Optionally, you can define
DATABASE_URL
for using a DSN instead of using the variables above (e.g.mysql://user:password@127.0.0.1:3306/db_name
) WP_ENV
- Set to environment (development
,staging
,production
)WP_HOME
- Full URL to WordPress home (https://example.com)WP_SITEURL
- Full URL to WordPress including subdirectory (https://example.com/wp)AUTH_KEY
,SECURE_AUTH_KEY
,LOGGED_IN_KEY
,NONCE_KEY
,AUTH_SALT
,SECURE_AUTH_SALT
,LOGGED_IN_SALT
,NONCE_SALT
- Generate with [wp-cli-dotenv-command] (https://github.com/aaemnnosttv/wp-cli-dotenv-command)
- Generate with our WordPress salts generator
Watch theme files for changes and compile:
npm run build:watch
Build files for deployment:
npm run build
We automatically run our code against the following tests at the commit, pull request, and build stages.
composer run test:lint
: Check our code is able to run without fatal errorscomposer run test:security
: 3rd Party Dependencies we rely on do not contain known vulnerabilitiescomposer run test:unit
: Unit tests written during the development of our codecomposer run test:analysis
: Check our code is writen to the highest standards we can
Deployable branches should be appended with -built
(eg. main-built
). For development environments this could bedevelop-built
.
You should never push code to built branches. All code should be pushed to the corrisponding branch. Where the built branch will pull from.
To contribute to this project:
- Create a branch off
main
eg,feature/feature-name
,hotfix/broken-part
, or{issue-number}-{name-of-feature}
- Push code to this branch once is becomes usable. Checking against our Coding Standards
composer run test
. Pushing often giving other chance to review and run QA tests against your new code. Rebasing frommain
will let you check you code works against production code - When finished or requiring feedback, test your code on staging, pushing it to a branch prefixed with
staging/
to deploy to this projects staging server - Any fixes should be applied to the origin branch and merged into your staging branch
- Once ready to be signed-off, create a pull request from your original branch in to
main
, assign a review and message the appropriate developer or channel. Detailing any changes that need to be made to the database/CMS - With sign-off and passings tests, rebase and merge your branch into
main
If you spot any issues please create a ticket via the project's Issue Tracker. Including the issue, the browser and operating system, and how to replicate it. If the issue is security related please use the contact information below.
This project follow the WordPress Coding Standard for PHP, HTML, CSS and JavaScript.
Vatu - info@vatu.co.uk