Skip to content

Commit 356586d

Browse files
committed
Merge branch 'main' into improve-FES-contributor-docs
2 parents 2092621 + af34dc8 commit 356586d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+20289
-12540
lines changed

.all-contributorsrc

Lines changed: 1483 additions & 2 deletions
Large diffs are not rendered by default.

.gitattributes

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Common settings that generally should always be used with your language specific settings
2+
3+
# Auto detect text files and perform LF normalization
4+
5+
# Scripts
6+
*.bash text eol=lf
7+
*.js text eol=lf
8+
9+
#
10+
# Exclude files from exporting
11+
#
12+
13+
.gitattributes export-ignore
14+
.gitignore export-ignore
15+
.gitkeep export-ignore
16+
17+
# Apply override to all files in the directory
18+
*.md linguist-detectable

.github/workflows/labeler.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
triage:
99
runs-on: ubuntu-latest
1010
steps:
11-
- uses: github/issue-labeler@v2.0
11+
- uses: github/issue-labeler@v3.2
1212
with:
1313
repo-token: "${{ secrets.GITHUB_TOKEN }}"
1414
configuration-path: .github/labeler.yml

.github/workflows/release.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,10 @@ jobs:
2525
id: version-number
2626
run: |
2727
version=$(echo ${{ github.ref_name }} | cut -c 2-)
28-
echo "::set-output name=version::$version"
28+
echo "version=$version" >> $GITHUB_OUTPUT
29+
- name: Get current date
30+
id: date
31+
run: echo "date=$(date +"%B %Oe, %Y")" >> $GITHUB_OUTPUT
2932
- name: Install dependencies
3033
run: npm ci
3134
env:
@@ -81,6 +84,11 @@ jobs:
8184
value: ${{ steps.version-number.outputs.version }}
8285
commitChange: false
8386
updateFile: true
87+
- name: Update version.json on website repo
88+
uses: restackio/[email protected]
89+
with:
90+
file: website/dist/download/version.json
91+
values: '{"version": "${{ steps.version-number.outputs.version }}", "date": "${{ steps.date.outputs.date }}"}'
8492
- name: Update en.json on website repo
8593
run: |
8694
cd website

Gruntfile.js

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,3 @@
1-
/**
2-
* Please see the contributor docs for usage of the build steps.
3-
* This header will only describe some of the more obscure tasks.
4-
*
5-
* Contributors list can be updated using all-contributors-cli:
6-
* https://www.npmjs.com/package/all-contributors-cli
7-
*
8-
* all-contributors generate - Generates new contributors list for README
9-
*/
10-
111
// these requires allow us to use es6 features such as
122
// `import`/`export` and `async`/`await` in the Grunt tasks
133
// we load from other files (`tasks/`)

README.md

Lines changed: 846 additions & 603 deletions
Large diffs are not rendered by default.

contributor_docs/contributor_guidelines.md

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ This is a fairly long and comprehensive document but we will try to deliniate al
1414
- [New Feature Request](#new-feature-request)
1515
- [Discussion](#discussion)
1616
- [Working on p5.js codebase](#working-on-p5js-codebase)
17-
- [Using the GitHub edit functionality](#using-the-github-edit-functionality)
17+
- [Quick Get Started For Developers](#quick-get-started-for-developers)
18+
- [Using the Github edit functionality](#using-the-github-edit-functionality)
1819
- [Forking p5.js and working from your fork](#forking-p5js-and-working-from-your-fork)
1920
- [Codebase breakdown](#codebase-breakdown)
2021
- [Build setup](#build-setup)
@@ -37,7 +38,6 @@ This is a fairly long and comprehensive document but we will try to deliniate al
3738
The majority of the activity on p5.js' GitHub repositories (repo for short) happens in issues and issues will most likely be the place to start your contribution process as well.
3839

3940
## What are issues?
40-
4141
Issue is the generic name for a post on GitHub that aims to describe, well, an issue. This "issue" can be a bug report, a request to add new feature, a discussion, a question, an announcement, or anything that works as a post. Comments can be added below each issue by anyone with a GitHub account, including bots! It is the place where contributors dicuss topics related to the development of the project in the repo.
4242

4343
While an issue can be opened for a wide variety of reasons, for p5.js' repos we usually only use issues to discuss p5.js source code development related topics. Topics such as debugging your own code, inviting collaborators to your project, or other unrelated topics should be discuss either on the [forum](https://discourse.processing.com) or on other platforms.
@@ -93,8 +93,26 @@ Similarly, if you have come across an issue or joined in discussions of an issue
9393

9494
You should not "jump the queue" by filing a PR for an issue that either someone else has indicated willingness to submit a contribution or has already been assigned to someone else. We will always prioritise "first assigned first serve" order for accepting code contribution for an issue, if you file a PR for an issue while someone else is still working on the same issue, your PR will be closed. If you see that it has been a few months since last activity on an issue with an assigned individual, you can check in with them by leaving a polite comment on the issue asking for progress and if they need help with the implementation. We generally allow for fairly long time frame for people to work on their contributions as we understand that most people will often be working on a volunteer basis or it simply takes more time for them to work on the feature; similarly, you should work at your own pace and be confident that there is no hard time limit on how long you can spend working on something. That being said, if you are having trouble with any aspect of your code contribution, do not hesitate to ask for help in the issue, the stewards and maintainers, as well as members of our community, will do their best to guide you!
9595

96-
## Using the GitHub edit functionality
97-
When viewing a file on the GitHub web interface, near the top of the content of the file you are viewing will be a pencil icon button. This button is a convenient edit feature provided by GitHub that simplifies many of the processes we will be covering below and can be used to make quick and simple edits to the file you are viewing.
96+
## Quick Get Started For Developers
97+
If you want to work/contribute to p5.js'🌸 codebase as a developer, either directly for improving p5.js or for improving it's sub projects like [Friendly Error Systems](https://github.com/processing/p5.js/blob/main/contributor_docs/friendly_error_system.md), you can follow the following steps directly :
98+
99+
1. Create a fork of p5.js.
100+
2. Clone your locally created fork.
101+
3. Add upstream using the following command :
102+
`git remote add upstream https://github.com/processing/p5.js`
103+
[More information on Configuring a remote repository for a fork](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/configuring-a-remote-repository-for-a-fork)
104+
4. Make sure your machine has [NodeJs](https://nodejs.org/en/download) installed, check it with the following command :
105+
`node -v`
106+
5. Run : `npm ci`
107+
6. Create a git branch of the `main` branch having a descriptive branch name using :
108+
`git checkout -b [branch_name]`
109+
7. As you start making changes to the codebase, frequently run :
110+
`npm test`
111+
(it takes time, but it ensures that existing behaviours are not being broken)
112+
8. Once it is done, you can commit the changes and create a [Pull Request](https://p5js.org/contributor-docs/#/./contributor_guidelines?id=pull-requests).
113+
114+
## Using the Github edit functionality
115+
When viewing a file on the Github web interface, near the top of the content of the file you are viewing will be a pencil icon button. This button is a convenient edit feature provided by Github that simplifies many of the processes we will be covering below and can be used to make quick and simple edits to the file you are viewing.
98116

99117
However, it is not recommended to use this feature other than for very simple changes. One of the main reason for this is that for more complex changes to the source code, it should be built and tested locally before being filed as a PR. Using a local development environment is also often much more fluent for most as compared to the basic editing environment provided by this edit functionality.
100118

@@ -228,4 +246,4 @@ Once a steward has reviewed your PR, one of two things may happen: 1. Your PR is
228246

229247
If changes are requested of your PR and you are able to make those changes, follow the [same process as before](#git-workflow) but just continue from your local copy of the repo and relevant branch, make those changes, commit them into git, and push them to your forked remote repo. Once you have pushed additional commits to your forked remote repo, you will see that the new commits automatically show up in the PR. Leave a comment in the PR to let the reviewer know you have made the changes requested and if no additional changes are needed, your PR will be merged!
230248

231-
---
249+
---

contributor_docs/creating_libraries.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,22 +73,29 @@ p5.prototype.getData = function (callback) {
7373
return ret;
7474
};
7575
```
76-
77-
### Use **registerMethod()** to register functions with _**p5**_ that should be called at various times.
76+
77+
### Use **registerMethod()** and **unregisterMethod()** to register and unregister functions with _**p5**_ that should be called at various times.
7878

7979
```js
8080
p5.prototype.doRemoveStuff = function () {
8181
// library cleanup stuff
8282
};
8383
p5.prototype.registerMethod('remove', p5.prototype.doRemoveStuff);
84+
85+
// Unregister the method when it's no longer needed.
86+
p5.prototype.unregisterMethod('remove', p5.prototype.doRemoveStuff);
8487
```
85-
86-
Method names you can register include the following list. Note that you may need to define the function before you register it.
88+
89+
Method names you can register and unregister include the following list. Note that you may need to define the function before you register it.
8790

8891
* **pre** — Called at the beginning of `draw()`. It can affect drawing.
8992
* **post** — Called at the end of `draw()`.
9093
* **remove** — Called when `remove()` is called.
9194
* **init** — Called when the sketch is first initialized, just before the sketch initialization function (the one that was passed into the `p5` constructor) is executed. This is also called before any global mode setup, so your library can add anything to the sketch and it will automatically be copied to `window` if global mode is active.
95+
* **beforePreload** — Called before the `preload()` function is executed.
96+
* **afterPreload** — Called after the `preload()` function is executed.
97+
* **beforeSetup** — Called before the `setup()` function is executed.
98+
* **afterSetup** — Called after the `setup()` function is executed.
9299

93100
More to come shortly, lining up roughly with this list:
94101
https://GitHub.com/processing/processing/wiki/Library-Basics#library-methods

contributor_docs/documentation_style_guide.md

Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -196,24 +196,35 @@ let magicWord = 'Please';
196196
let magicWord = 'Please';
197197
```
198198

199-
- Use `/** ... */` for multiline comments.
199+
- Use `//` for multiline comments.
200200

201201
```javascript
202-
// Bad.
203-
// I will not use // for multiline comments.
204-
// I will not use // for multiline comments.
205-
// I will not use // for multiline comments.
206-
// I will not use // for multiline comments.
207-
// I will not use // for multiline comments.
208202

209-
// Good.
203+
// Bad.
210204
/**
211-
* I will not use // for multiline comments.
212-
* I will not use // for multiline comments.
213-
* I will not use // for multiline comments.
214-
* I will not use // for multiline comments.
215-
* I will not use // for multiline comments.
205+
* I will use // for multiline comments.
206+
* I will use // for multiline comments.
207+
* I will use // for multiline comments.
208+
* I will use // for multiline comments.
209+
* I will use // for multiline comments.
210+
*/
211+
212+
//Bad.
213+
/*
214+
I will use // for multiline comments.
215+
I will use // for multiline comments.
216+
I will use // for multiline comments.
217+
I will use // for multiline comments.
218+
I will use // for multiline comments.
216219
*/
220+
221+
// Good.
222+
// I will use // for multiline comments.
223+
// I will use // for multiline comments.
224+
// I will use // for multiline comments.
225+
// I will use // for multiline comments.
226+
// I will use // for multiline comments.
227+
217228
```
218229

219230
**[⬆ back to top](#table-of-contents)**
@@ -1204,4 +1215,4 @@ function preload() {
12041215
}
12051216
```
12061217

1207-
**[⬆ back to top](#table-of-contents)**
1218+
**[⬆ back to top](#table-of-contents)**

contributor_docs/friendly_error_system.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ You can find the translation files used by the `translator()` inside:
129129
These functions are mainly responsible for catching errors and generating FES messages:
130130
* [`_friendlyFileLoadError()`] catches file loading errors.
131131
* [`_validateParameters()`] checks a p5.js function’s input parameters based on inline documents.
132-
* [`_fesErrorMontitor()`] handles global errors.
132+
* [`_fesErrorMonitor()`] handles global errors.
133133

134134
For full reference, please see our [Dev Notes].
135135

@@ -165,4 +165,4 @@ function setup() {
165165

166166
The single minified file of p5 (i.e., p5.min.js) automatically omits the FES.
167167

168-
[disable the FES for performance]: https://github.com/processing/p5.js/wiki/Optimizing-p5.js-Code-for-Performance#disable-the-friendly-error-system-fes
168+
[disable the FES for performance]: https://github.com/processing/p5.js/wiki/Optimizing-p5.js-Code-for-Performance#disable-the-friendly-error-system-fes

contributor_docs/project_wrapups/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@ This folder contains wrap-up reports from p5.js related [Google Summer of Code](
55

66
## Google Summer of Code
77

8+
### Google Summer of Code 2023
9+
* [Mobile/Responsive Design Implementation of p5.js Web Editor](https://github.com/processing/p5.js/blob/main/contributor_docs/project_wrapups/dewansDT_gsoc_2023.md) by Dewansh Thakur, 2023
10+
* [Friendly Error System(FES) and Documentation](https://github.com/processing/p5.js/blob/main/contributor_docs/project_wrapups/ayush23dash_gsoc_2023.md) by Ayush Shankar, 2023
11+
* [Supporting shader-based filters in p5js](https://github.com/processing/p5.js/blob/main/contributor_docs/project_wrapups/wong_gsoc_2023.md) by Justin Wong, 2023
12+
* [Updating p5js.org Site Documentation and Accessibility](https://github.com/processing/p5.js/blob/main/contributor_docs/project_wrapups/lichlyter_gsoc_2023.md), by Kathryn Lichlyter, 2023
13+
* [A Typographic Revamp for p5.js](https://github.com/processing/p5.js/blob/main/contributor_docs/project_wrapups/munusshih_gsoc_2023.md), by Munus Shih, 2023
14+
15+
816
### Google Summer of Code 2022
917
* [p5 /teach reorganize & update](https://github.com/processing/p5.js/blob/main/contributor_docs/project_wrapups/graciazhang_gsoc_2022.md) by Gracia Zhang, 2022
1018
* [p5xr Immersive Session Process and Controller API update](https://github.com/processing/p5.js/blob/main/contributor_docs/project_wrapups/smrghsh_gsoc_2022.md) by Samir Ghosh, 2022

0 commit comments

Comments
 (0)