Skip to content

Commit 30acc11

Browse files
authored
Merge branch '2.0' into update-script
2 parents 161719b + 86d9192 commit 30acc11

22 files changed

Lines changed: 1053 additions & 27 deletions

File tree

.github/workflows/test.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ jobs:
1212
steps:
1313
- name: Checkout your repository using git
1414
uses: actions/checkout@v4
15+
- name: Setup Node.js
16+
uses: actions/setup-node@v4
17+
with:
18+
node-version: '22'
1519
- name: Install dependencies
1620
run: npm ci
1721
- name: Test
@@ -21,6 +25,10 @@ jobs:
2125
steps:
2226
- name: Checkout your repository using git
2327
uses: actions/checkout@v4
28+
- name: Setup Node.js
29+
uses: actions/setup-node@v4
30+
with:
31+
node-version: '22'
2432
- name: Install dependencies
2533
run: npm ci
2634
- name: Lint
@@ -30,6 +38,10 @@ jobs:
3038
steps:
3139
- name: Checkout your repository using git
3240
uses: actions/checkout@v4
41+
- name: Setup Node.js
42+
uses: actions/setup-node@v4
43+
with:
44+
node-version: '22'
3345
- name: Install dependencies
3446
run: npm ci
3547
- name: Typecheck
@@ -39,6 +51,10 @@ jobs:
3951
steps:
4052
- name: Checkout your repository using git
4153
uses: actions/checkout@v4
54+
- name: Setup Node.js
55+
uses: actions/setup-node@v4
56+
with:
57+
node-version: '22'
4258
- name: Install dependencies
4359
run: npm ci
4460
- name: Build

.npmrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Force npm to fail (not just warn) if the node.js version in "engines" isn't met
2+
engine-strict=true

docs/technical_overview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
### Setup
66

7-
1. Make sure you have [node and npm installed on your machine](https://nodejs.org/en/learn/getting-started/how-to-install-nodejs).
7+
1. Make sure you have [node (at least version 22) and npm installed on your machine](https://nodejs.org/en/learn/getting-started/how-to-install-nodejs).
88
2. Clone this repo by typing git clone https://github.com/processing/p5.js-website/ in your terminal. (You can also use [GitHub Desktop](https://desktop.github.com/)).
99
3. Then install the project's dependencies with:
1010

package-lock.json

Lines changed: 33 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
"custom:dev": "tsx ./src/scripts/branchTest.ts",
2020
"custom:cleanup": "tsx ./src/scripts/resetBranchTest.ts"
2121
},
22+
"engines": {
23+
"node": ">=22.0.0"
24+
},
2225
"dependencies": {
2326
"@astrojs/check": "^0.9.6",
2427
"@astrojs/mdx": "^4.3.13",

src/components/Banner/index.astro

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ const { Content } = await entry.render();
55
const { link, title } = entry.data;
66
---
77

8-
<div class="banner bg-accent-color text-accent-type-color" style={{ display: 'none' }} data-title={title}>
8+
<footer class="banner bg-accent-color text-accent-type-color" style={{ display: 'none' }} data-title={title} aria-label="sticky">
99
<a class="banner-content" href={link} target="_blank">
1010
<Content />
1111
</a>
1212
<button id="hideBanner" aria-label="Hide banner"><Icon kind="close" /></button>
13-
</div>
13+
</footer>
1414

1515
<script>
1616
const banner = document.querySelector('.banner');

src/components/CodeEmbed/index.jsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { useState, useEffect, useRef } from "preact/hooks";
22
import { useLiveRegion } from '../hooks/useLiveRegion';
33
import CodeMirror, { EditorView } from "@uiw/react-codemirror";
44
import { javascript } from "@codemirror/lang-javascript";
5-
import { cdnLibraryUrl, cdnSoundUrl } from "@/src/globals/globals";
5+
import { cdnLibraryUrl, cdnSoundUrl, cdnWebGPUUrl } from "@/src/globals/globals";
66

77
import { CodeFrame } from "./frame";
88
import { CopyCodeButton } from "../CopyCodeButton";
@@ -39,7 +39,7 @@ export const CodeEmbed = (props) => {
3939
);
4040

4141
let { previewWidth, previewHeight } = props;
42-
const canvasMatch = /createCanvas\(\s*(\d+),\s*(\d+)\s*(?:,\s*(?:\w+\.)?(?:P2D|WEBGL)\s*)?\)/m.exec(initialCode);
42+
const canvasMatch = /createCanvas\(\s*(\d+),\s*(\d+)\s*(?:,\s*(?:\w+\.)?(?:P2D|WEBGL|WEBGPU)\s*)?\)/m.exec(initialCode);
4343
if (canvasMatch) {
4444
previewWidth = previewWidth || parseFloat(canvasMatch[1]);
4545
previewHeight = previewHeight || parseFloat(canvasMatch[2]);
@@ -99,6 +99,7 @@ export const CodeEmbed = (props) => {
9999
lazyLoad={props.lazyLoad}
100100
scripts={[
101101
...(props.includeSound ? [cdnSoundUrl] : []),
102+
...(props.includeWebGPU ? [cdnWebGPUUrl] : []),
102103
...(props.scripts ?? []),
103104
]}
104105
/>

src/content/contributor-docs/en/contributor_guidelines.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,9 @@ To file a new issue, simply go to the "Issues" tab on the p5.js repo and click o
7979

8080
![Cropped screenshot of the GitHub repository's issue page with the green "New issue" button highlighted with a red box surrounding it.](src/content/contributor-docs/images/new-issue.png)
8181

82-
### ["Found a bug"](https://github.com/processing/p5.js/issues/new?assignees=\&labels=Bug\&projects=\&template=found-a-bug.yml)
82+
### ["Found a bug"](https://github.com/processing/p5.js/issues/new?assignees=\&labels=Bug\&projects=\&template=2-found-a-bug.yml)
8383

84-
When you encounter possible incorrect behavior in p5.js or something not behaving as described in the documentation, use [this template](https://github.com/processing/p5.js/issues/new?assignees=\&labels=Bug\&projects=\&template=found-a-bug.yml). Please note that if you are trying to debug your sketch and you think it may be a problem with your code, you should first ask on the [Discourse forum](https://discourse.processing.org) instead.
84+
When you encounter possible incorrect behavior in p5.js or something not behaving as described in the documentation, use [this template](https://github.com/processing/p5.js/issues/new?assignees=\&labels=Bug\&projects=\&template=2-found-a-bug.yml). Please note that if you are trying to debug your sketch and you think it may be a problem with your code, you should first ask on the [Discourse forum](https://discourse.processing.org) instead.
8585

8686
There are a few fields for you to fill in for this template:
8787

@@ -135,7 +135,7 @@ If you wish to contribute a fix to the bug you just reported, you can indicate s
135135

136136
For bug reports to be accepted for fixing, they must be approved by at least one [area steward or maintainer](https://github.com/processing/p5.js#stewards) before work can begin on a pull request.
137137

138-
### ["Existing Feature Enhancement"](https://github.com/processing/p5.js/issues/new?assignees=\&labels=Enhancement\&projects=\&template=existing-feature-enhancement.yml)
138+
### ["Existing Feature Enhancement"](https://github.com/processing/p5.js/issues/new?assignees=\&labels=Enhancement\&projects=\&template=3-existing-feature-enhancement.yml)
139139

140140
This template should be used if you wish to propose changes or add functionality to existing features of p5.js (functions, constants, rendering, etc). For example, if you want to add a new way to define a color to the `color()` function and other functions that accept colors, this is the template to use.
141141

@@ -149,7 +149,7 @@ For feature enhancement proposals to be accepted they must be approved by at lea
149149

150150
**You should not file a pull request (or start working on code changes) without a corresponding issue or before an issue has been approved for implementation**, because there is no guarantee that the proposal will be accepted. Any pull requests filed before a proposal has been approved will be closed until approval is given to the issue.
151151

152-
### ["New Feature Request"](https://github.com/processing/p5.js/issues/new?assignees=\&labels=Feature+Request\&projects=\&template=feature-request.yml)
152+
### ["New Feature Request"](https://github.com/processing/p5.js/issues/new?assignees=\&labels=Feature+Request\&projects=\&template=4-feature-request.yml)
153153

154154
This template should be used if you wish to propose a new feature to be added to p5.js. For example to add support for drawing native HTML `<table>` elements with a new `createTable` function. Some proposals may overlap with existing feature enhancement proposals, in these cases you should just choose whichever template you feel is most appropriate.
155155

@@ -159,7 +159,7 @@ For new feature request proposals to be accepted, they must be approved by at le
159159

160160
**You should not file a pull request (or start working on code changes) without a corresponding issue or before an issue has been approved for implementation**, that is because there is no guarantee that the proposal will be accepted. Any pull requests filed before a proposal has been approved will be closed until approval is given to the issue.
161161

162-
### ["Discussion"](https://github.com/processing/p5.js/issues/new?assignees=\&labels=Discussion\&projects=\&template=discussion.yml)
162+
### ["Discussion"](https://github.com/processing/p5.js/issues/new?assignees=\&labels=Discussion\&projects=\&template=5-discussion.yml)
163163

164164
This template is used when the issue you are filing does not fit into any of the above in any way. An issue not fitting into any of the above templates should be relatively rare in practice. For example, a discussion about whether to adopt a specific Web API feature in p5.js should be filed as a [new feature request](#new-feature-request); a discussion about adding an additional color mode to the various color functions should be filed as a [feature enchancement](#existing-feature-enchancement); an announcement about a local creative coding event that you are organizing should be posted on the forum and contacting the Processing Foundation if you are looking for support or publicity; etc.
165165

0 commit comments

Comments
 (0)