Skip to content

Commit

Permalink
Merge branch 'main' into improve-FES-contributor-docs
Browse files Browse the repository at this point in the history
  • Loading branch information
limzykenneth committed Oct 25, 2023
2 parents 2092621 + af34dc8 commit 356586d
Show file tree
Hide file tree
Showing 70 changed files with 20,289 additions and 12,540 deletions.
1,485 changes: 1,483 additions & 2 deletions .all-contributorsrc

Large diffs are not rendered by default.

18 changes: 18 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Common settings that generally should always be used with your language specific settings

# Auto detect text files and perform LF normalization

# Scripts
*.bash text eol=lf
*.js text eol=lf

#
# Exclude files from exporting
#

.gitattributes export-ignore
.gitignore export-ignore
.gitkeep export-ignore

# Apply override to all files in the directory
*.md linguist-detectable
2 changes: 1 addition & 1 deletion .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
triage:
runs-on: ubuntu-latest
steps:
- uses: github/issue-labeler@v2.0
- uses: github/issue-labeler@v3.2
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
configuration-path: .github/labeler.yml
Expand Down
10 changes: 9 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ jobs:
id: version-number
run: |
version=$(echo ${{ github.ref_name }} | cut -c 2-)
echo "::set-output name=version::$version"
echo "version=$version" >> $GITHUB_OUTPUT
- name: Get current date
id: date
run: echo "date=$(date +"%B %Oe, %Y")" >> $GITHUB_OUTPUT
- name: Install dependencies
run: npm ci
env:
Expand Down Expand Up @@ -81,6 +84,11 @@ jobs:
value: ${{ steps.version-number.outputs.version }}
commitChange: false
updateFile: true
- name: Update version.json on website repo
uses: restackio/[email protected]
with:
file: website/dist/download/version.json
values: '{"version": "${{ steps.version-number.outputs.version }}", "date": "${{ steps.date.outputs.date }}"}'
- name: Update en.json on website repo
run: |
cd website
Expand Down
10 changes: 0 additions & 10 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
/**
* Please see the contributor docs for usage of the build steps.
* This header will only describe some of the more obscure tasks.
*
* Contributors list can be updated using all-contributors-cli:
* https://www.npmjs.com/package/all-contributors-cli
*
* all-contributors generate - Generates new contributors list for README
*/

// these requires allow us to use es6 features such as
// `import`/`export` and `async`/`await` in the Grunt tasks
// we load from other files (`tasks/`)
Expand Down
1,449 changes: 846 additions & 603 deletions README.md

Large diffs are not rendered by default.

28 changes: 23 additions & 5 deletions contributor_docs/contributor_guidelines.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ This is a fairly long and comprehensive document but we will try to deliniate al
- [New Feature Request](#new-feature-request)
- [Discussion](#discussion)
- [Working on p5.js codebase](#working-on-p5js-codebase)
- [Using the GitHub edit functionality](#using-the-github-edit-functionality)
- [Quick Get Started For Developers](#quick-get-started-for-developers)
- [Using the Github edit functionality](#using-the-github-edit-functionality)
- [Forking p5.js and working from your fork](#forking-p5js-and-working-from-your-fork)
- [Codebase breakdown](#codebase-breakdown)
- [Build setup](#build-setup)
Expand All @@ -37,7 +38,6 @@ This is a fairly long and comprehensive document but we will try to deliniate al
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.

## What are issues?

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.

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.
Expand Down Expand Up @@ -93,8 +93,26 @@ Similarly, if you have come across an issue or joined in discussions of an issue

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!

## Using the GitHub edit functionality
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.
## Quick Get Started For Developers
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 :

1. Create a fork of p5.js.
2. Clone your locally created fork.
3. Add upstream using the following command :
`git remote add upstream https://github.com/processing/p5.js`
[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)
4. Make sure your machine has [NodeJs](https://nodejs.org/en/download) installed, check it with the following command :
`node -v`
5. Run : `npm ci`
6. Create a git branch of the `main` branch having a descriptive branch name using :
`git checkout -b [branch_name]`
7. As you start making changes to the codebase, frequently run :
`npm test`
(it takes time, but it ensures that existing behaviours are not being broken)
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).

## Using the Github edit functionality
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.

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.

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

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!

---
---
15 changes: 11 additions & 4 deletions contributor_docs/creating_libraries.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,22 +73,29 @@ p5.prototype.getData = function (callback) {
return ret;
};
```
### Use **registerMethod()** to register functions with _**p5**_ that should be called at various times.

### Use **registerMethod()** and **unregisterMethod()** to register and unregister functions with _**p5**_ that should be called at various times.

```js
p5.prototype.doRemoveStuff = function () {
// library cleanup stuff
};
p5.prototype.registerMethod('remove', p5.prototype.doRemoveStuff);

// Unregister the method when it's no longer needed.
p5.prototype.unregisterMethod('remove', p5.prototype.doRemoveStuff);
```
Method names you can register include the following list. Note that you may need to define the function before you register it.

Method names you can register and unregister include the following list. Note that you may need to define the function before you register it.

* **pre** — Called at the beginning of `draw()`. It can affect drawing.
* **post** — Called at the end of `draw()`.
* **remove** — Called when `remove()` is called.
* **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.
* **beforePreload** — Called before the `preload()` function is executed.
* **afterPreload** — Called after the `preload()` function is executed.
* **beforeSetup** — Called before the `setup()` function is executed.
* **afterSetup** — Called after the `setup()` function is executed.

More to come shortly, lining up roughly with this list:
https://GitHub.com/processing/processing/wiki/Library-Basics#library-methods
Expand Down
39 changes: 25 additions & 14 deletions contributor_docs/documentation_style_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -196,24 +196,35 @@ let magicWord = 'Please';
let magicWord = 'Please';
```

- Use `/** ... */` for multiline comments.
- Use `//` for multiline comments.

```javascript
// Bad.
// I will not use // for multiline comments.
// I will not use // for multiline comments.
// I will not use // for multiline comments.
// I will not use // for multiline comments.
// I will not use // for multiline comments.

// Good.
// Bad.
/**
* I will not use // for multiline comments.
* I will not use // for multiline comments.
* I will not use // for multiline comments.
* I will not use // for multiline comments.
* I will not use // for multiline comments.
* I will use // for multiline comments.
* I will use // for multiline comments.
* I will use // for multiline comments.
* I will use // for multiline comments.
* I will use // for multiline comments.
*/

//Bad.
/*
I will use // for multiline comments.
I will use // for multiline comments.
I will use // for multiline comments.
I will use // for multiline comments.
I will use // for multiline comments.
*/

// Good.
// I will use // for multiline comments.
// I will use // for multiline comments.
// I will use // for multiline comments.
// I will use // for multiline comments.
// I will use // for multiline comments.

```

**[⬆ back to top](#table-of-contents)**
Expand Down Expand Up @@ -1204,4 +1215,4 @@ function preload() {
}
```

**[⬆ back to top](#table-of-contents)**
**[⬆ back to top](#table-of-contents)**
4 changes: 2 additions & 2 deletions contributor_docs/friendly_error_system.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ You can find the translation files used by the `translator()` inside:
These functions are mainly responsible for catching errors and generating FES messages:
* [`_friendlyFileLoadError()`] catches file loading errors.
* [`_validateParameters()`] checks a p5.js function’s input parameters based on inline documents.
* [`_fesErrorMontitor()`] handles global errors.
* [`_fesErrorMonitor()`] handles global errors.

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

Expand Down Expand Up @@ -165,4 +165,4 @@ function setup() {

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

[disable the FES for performance]: https://github.com/processing/p5.js/wiki/Optimizing-p5.js-Code-for-Performance#disable-the-friendly-error-system-fes
[disable the FES for performance]: https://github.com/processing/p5.js/wiki/Optimizing-p5.js-Code-for-Performance#disable-the-friendly-error-system-fes
8 changes: 8 additions & 0 deletions contributor_docs/project_wrapups/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ This folder contains wrap-up reports from p5.js related [Google Summer of Code](

## Google Summer of Code

### Google Summer of Code 2023
* [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
* [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
* [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
* [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
* [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


### Google Summer of Code 2022
* [p5 /teach reorganize & update](https://github.com/processing/p5.js/blob/main/contributor_docs/project_wrapups/graciazhang_gsoc_2022.md) by Gracia Zhang, 2022
* [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
Expand Down
Loading

0 comments on commit 356586d

Please sign in to comment.