When contributing to this repository, please first discuss the change you wish to make via issue with the owners of this repository before making a change.
Please report bugs you find via GitHub issues.
A bug report should consist of:
- A descriptive title
- Steps to reproduce the problem (what you clicked, tapped, typed, saw and heard)
- What happened ("actual results")
- How this differed from what you expected to happen ("expected results")
When relevant, include configuration information (such as "Chrome 87 on macOS"), URLs and screenshots.
- Clone the repository from GitHub
- Install Composer
- Install Node and NPM
- Run
composer install
- Run
npm install
- Run
npm install -g grunt
(you may need to usesudo
)
This project uses Grunt, SASS, ESLint, stylelint and PHPCS. PHP modules are installed using Composer. JavaScript modules are installed using node.
We use VVV for local development. This is not a requirement, but you may find it helpful.
The Query Monitor plugin is recommended in development and staging environments.
Ensure your hostname ends with .test
, such as elections.test
.
In your config.yml
file;
- Under
extensions
, uncomment the- php83
line - Place a block like this:
elections:
repo: https://github.com/Varying-Vagrant-Vagrants/custom-site-template.git
allow_customfile: true
php: 8.3
hosts:
- elections.test
Clone the repository inside your site’s themes folder, i.e.
git clone https://github.com/CTCL/election-websites ~/vagrant-local/www/ctcl/public_html/wp-content/themes/election-websites
- Create feature and bugfix branches off of
master
. - Name branches
fix/xyz
orfeature/abc
, depending on the type of work being done. - Test branches locally, and then merge into
develop
to test on staging. - Open a pull request to merge your branch in to
master
.
Be sure to run phpcs
and fix all warnings before committing.
- Use descriptive commit messages.
- Commit compiled CSS and JS files separately from source files.
- Ensure version numbers have major, minor and patch versions.
- Update
style.css
,functions.php
,package.json
andpackage-lock.json
.
- Give your pull request a descriptive title.
- Tag related issues (i.e.
Fixes #14
).
Run grunt watch
before starting development. It will check your source files for errors, automatically fix many of them, and compile assets for you.
A precommit task will lint your PHP files.
Modify files in assets/css/src
and assets/js/src
. If you're not running grunt watch
, you can lint and compile them manually with grunt css
, grunt js
or grunt css-js
.
SVG files are not automatically minified. When you add a or modify and SVG file, run grunt svg
twice.
Modify readme.txt
. After making changes, run grunt readme
to update the markdown version (readme.md
).