contributor_docs/steward_guidelines.md
Whether you are new to p5.js contribution, are already active on the p5.js GitHub repositories, or are somewhere in between, you'll find what you need in this guide to p5.js stewardship. If you are not sure what to expect from stewards, or if you are considering how to volunteer or get started as a steward, read on!
An open source ethos includes accessibility, education, collaboration, transparency, and agency. To live and practice these values while we write code together needs a lot of community care. These are the community care practices that are part of our definition of stewardship:
The rest of these guidelines provide some tips and tricks that will help you effectively contribute to p5.js, and to helpfully guide others' contributions. Most of what is written here are guidelines unless otherwise stated, which means you can adapt the practices shown here to suit your workflow.
Everyone is invited to help steward the community when they can! We are happy to see contributors welcome new contributors, review others' code, and provide API design feedback. There are also some concrete roles:
Stewards can also be contributors: they can make Issues and PRs as contributors, while they also take on responsibility, when they are stewarding a particular area, to comment on issues and do code reviews, especially when tagged by other contributors to help with discussion and review.
As a contributor, you can check the current stewards in the p5.js repository's README file and tag relevant stewards - but please be mindful of our contributor guidelines, which emphasize patience and mindfulness that most of the technical work on an open-source project is volunteer.
As a steward, we hope that you regularly chime in on code reviews on Issues or PRs that you did not make, if they are in your area and if you are able to provide helpful guidance!
There are different areas of work that stewards can be responsible for. These areas match the GitHub Labels in most cases, with a couple of exceptions. Below is the list of areas.
describe(..) as well as accessibility support on the reference websitees, hi, ko, zhThese focus areas may change over time depending on the needs of the project - so if you are going through the process of applying to be a steward, you are welcome to proposals new areas!
There are two ways to become a steward:
stewards.yml with your GitHub @ and proposed areas. Please keep in mind each area should have 1-3 stewards. We are always looking for translation stewards! Once you make your application PR, other maintainers or stewards may ask for additional supporting material, like making a PR related to the areas you're interested in, or participating in some related discussion.To remain a steward, you must contribute as a steward to at least 1 of the 2 most recent minor releases (e.g., 2.1.0 or 1.11.0 - when the middle number changes). These are not as frequent as patches (e.g., 2.0.3 to 2.0.4 - when the rightmost number changes), and in practice this means that stewards are expected to be active every 4-6 months or so, supporting other contributors through discussion or code review - not necessarily writing code. To step down from stewardship, you can make a PR to remove yourself from stewards.yml. You are always welcome to take a pause and reapply in the future!
#contribute-to-p5 you're welcome to ask any questions you have about this process - or suggest how it can be improved!We encourage most source code contributions to start with an issue, and as such, issues are the place where most of the discussions will take place. The steps to take when reviewing an issue will depend on what kind of issue it is. The repo uses GitHub issue templates in order to better organize different kinds of issues and encourage issue authors to provide all relevant information about their problems. The first step in reviewing the issue will often be looking through the filled-out template and determining if you need additional information (e.g., because some fields weren't filled in or the incorrect template was used).
Bug report issues should use the "Found a bug" issue template. The following workflow is typical for addressing bug reports:
help wanted label to signal an issue needing a fix.help wanted label to the issue and ask for someone else with the setup specified in the issue to try to replicate the bug.Feature request issues should use the "New Feature Request" issue template. The following workflow is typical for addressing feature requests:
join(["Hello", "world!"]), the native JavaScript ["Hello", "world!"].join() should be preferred instead.Feature enhancement issues should use the "Existing Feature Enhancement" issue template. The process is very similar to new feature requests. The difference between a new feature request and feature enhancement can be blurry sometimes. Feature enhancement mainly deals with existing functions of p5.js while a new feature request could be requesting entirely new functions to be added.
This type of issue has a minimal template ("Discussion") and should be used to gather feedback around a topic in general before coalescing it into something more specific, like a feature request. These sorts of discussion issues can be closed when the conversation finishes and the resulting more specific issues have been created:
Almost all code contributions to the p5.js repositories happen through pull requests. Stewards and maintainers may have push access to the repositories but are still encouraged to follow the same issue > PR > review process when contributing code. Here are the steps to review a PR:
Simple fixes, such as a small typo fix, can be merged directly by anyone with merge access. Check on the PR "Files Changed" tab to ensure that the automated CI test passes.
Bug fixes should be reviewed by the relevant area steward, ideally the same one that approved the referenced issue for fixing.
The PR "Files Changed" tab can be used to initially review whether the fix is implemented as described in the issue discussion.
The PR should be tested locally whenever possible and relevant. The GitHub CLI can help streamline some of the process. (See more below in Tips & Tricks).
If any additional changes are required, line comments should be added to the relevant lines as described here.
Once the PR has been reviewed and no additional changes are required, a steward can mark the PR as "Approved" by choosing the "Approve" option in the previous step, with or without additional comments. The steward can then either request additional review by another steward or maintainer if desired, merge the PR if they have merge access, or request a merge from a maintainer.
@all-contributors bot should be called to add any new contributors to the list of contributors in the README.md file. Each type of contribution can be indicated in place of [contribution type] below, the full list of available types of contributions can be found in the link above.
@all-contributors please add @[GitHub handle] for [contribution type]
The process for new feature or feature enhancement PR is similar to bug fixes with just one notable difference:
Dependabot PRs are usually only visible to repo admins so if this does not apply to you, please skip this section.
This section will not cover the general build setup nor commands but rather details about what's happening behind the scenes. Please see the contributor’s guidelines for more detailed build info.
Starting with p5.js version 2.0, the project no longer uses Grunt for task automation. Instead, the build and test processes are handled using modern tools like npm scripts, ESLint, and Vitest.
To run lint checks and unit tests, simply run:
npm test
This command runs ESLint to check code style and then execute unit and visual tests using Vitest.
lint TaskIn p5.js 2.0, ESLint is used directly via npm scripts for all linting tasks.
To run lint checks on the codebase:
npm run lint
This checks the source files, build scripts, test files, and documentation examples using ESLint.
If you only want to run linting for specific files or directories, you can use ESLint directly:
npx eslint src/
npx eslint test/
There is no separate sample linter or YUIDoc-based pipeline anymore.
test TaskIn p5.js 2.0, the testing system no longer uses Mocha via Grunt. Instead, tests are run using Vitest through npm scripts.
To run the full test suite (unit and visual tests), use:
npm test
This command performs:
Tests are located in the test/unit folder, organized to mirror the src directory structure. For example, tests for src/color/p5.Color.js live in test/unit/color/p5.Color.js.
To run tests interactively in a browser-like environment (useful for debugging), run:
npx vitest --ui
Code coverage is also supported using Vitest's built-in tools. Run:
npx vitest run --coverage
Note: The Browserify/Grunt build pipeline (e.g., browserify, uglify, brfs-babel) was removed in v2.
Please see release_process.md.
Sometimes, the number of issues and PR that require review can get a bit overwhelming. While we try to put in place processes that make things easier, there are some tips and tricks that you can utilize to help with reviewing issues and PRs.
A handy GitHub feature that you can use is the Saved Replies feature, which is available to use when authoring a reply to issues or pull requests. Some of the workflow described above may require responding to issues or PRs with identical or very similar replies (redirecting questions to the forum, accepting an issue for fixing, etc.), and using Saved Replies can just ever so slightly make this more efficient.
Below are some of the Saved Replies that are being used by p5.js maintainers. You can use them yourself or create your own!
We're not able to reproduce this, but please feel free to reopen if you can provide a code sample that demonstrates the issue. Thanks!
I'm closing this for organizational purposes. Please reopen if you can provide a code snippet that illustrates the issue. Thanks!
The GitHub issues here are a good place for bugs and issues with the p5.js library itself. For questions about writing your own code, tests, or following tutorials, the forum is the best place to post. Thanks!
Thanks! The best place to discuss GSOC proposals is on our forum.
I'm not seeing a lot of interest in this feature, and we don't have a clear explanation of how it expands access, so I will close this for now. If an access statement can be added to the issue request, please feel welcome to reopen.
We do not see a further explanation of how this issue expands access, so I will close this issue for now. If a more detailed access statement can be added to the feature request, please feel welcome to reopen it. Thank you!
I think this function is beyond the scope of the p5.js API (we try to keep it as minimal as possible), but it could be a great starting point for an addon library. See the docs here for how to create an addon: Creating an Addon Library
Thank you. As a reminder, issues need to be opened before pull requests are opened and tagged with the issue. This is necessary for tracking development and keeping discussion clear. Thanks!
You can go ahead with a fix. Thanks.
Looks good. Thanks!
Reviewing a complex PR can be difficult with complex git commands required to get the PR's version of code locally for you to test. Fortunately, the GitHub CLI tool can help greatly with this process and more.
After installing the CLI and logging in, reviewing a PR locally can be done by running the command gh pr checkout [pull_request_id], and the process of fetching a remote fork, creating a branch, and checking out the branch are all done automatically for you. Going back to the main branch will be the same as switching a branch by running git checkout main. You can even leave a comment in the PR from the CLI without needing to visit the webpage at all!
There are many other commands available in the GitHub CLI as well that you may or may not find useful, but it is a good tool to have around in any case.
Instead of manually monitoring the "Issues" or "Pull Requests" tabs of the repo for new issues or PRs, you can "watch" the repo by clicking on the "Watch" button with an eye icon on the top of the repo page opposite the repo name.
By watching a repo, events such as new issues, new pull requests, mentions of your user handle, and other activities you subscribed to on the repo will be sent as notifications to your notification page, where they can be marked as read or dismissed much like an email inbox.
In some cases, you may receive emails from GitHub about events in the repo you are watching as well, and you can customize these (including unsubscribing from them completely) from your notifications settings page.
Setting these up to fit the way you work can be the difference between having to find relevant issues/PRs to review manually and being overwhelmed by endless notifications from GitHub. A good balance is required here. As a starting suggestion, stewards should watch this repo for "Issues" and "Pull Requests" and set it to only receive emails on "Participating, @mentions and custom."