Skip to content

Commit 4c59191

Browse files
authored
Migrate dependabot reviewers to CODEOWNERS and update dependencies (#516)
* Migrate dependabot reviewers to CODEOWNERS and update dependencies * Formatting fixes * Tidy the demo examples (#515) * Tidy the demo examples * Formatting fixes
1 parent 19d53b4 commit 4c59191

9 files changed

Lines changed: 888 additions & 741 deletions

File tree

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@jamesrweb @yevdyko

.github/dependabot.yml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,11 @@ updates:
44
directory: "/"
55
schedule:
66
interval: "monthly"
7-
reviewers:
8-
- "jamesrweb"
97
labels:
108
- "npm"
119
- "dependencies"
1210
groups:
11+
production-dependencies:
12+
dependency-type: "production"
1313
development-dependencies:
1414
dependency-type: "development"
15-
react:
16-
patterns:
17-
- "react*"
18-
ignore:
19-
- dependency-name: "*"
20-
update-types: ["version-update:semver-patch"]

.npmrc

Lines changed: 0 additions & 1 deletion
This file was deleted.

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@
55
A component to integrate [P5.js](https://p5js.org/) sketches into
66
[React](https://reactjs.org/) apps.
77

8-
> Note: Version 5 is still in development, currently the `5.0.0-rc.x` range has been
9-
> released for internal development or experimental testing ONLY. It is recommended to continue
10-
> utilising version `4.4.1` until version `5.0.0` is out of the `rc` versioning scheme.
8+
> Note: Version 5 is still in development, currently the `5.0.0-rc.x` range has
9+
> been released for internal development or experimental testing ONLY. It is
10+
> recommended to continue utilising version `4.4.1` until version `5.0.0` is out
11+
> of the `rc` versioning scheme.
1112
1213
## Installation
1314

demo/app.jsx

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,21 @@
11
import React, { useCallback, useMemo, useState } from "react";
22
import { createRoot } from "react-dom/client";
33

4-
import * as box from "./sketches/box";
5-
import * as plane from "./sketches/plane";
6-
import * as torus from "./sketches/torus";
74
import { ReactP5Wrapper } from "../src/main.tsx";
85
import "./demo.css";
6+
import { sketch as box } from "./sketches/box";
7+
import { sketch as plane } from "./sketches/plane";
8+
import { sketch as torus } from "./sketches/torus";
99

1010
function App() {
11-
const sketches = useMemo(
12-
() => [box.sketch, torus.sketch, plane.sketch],
13-
[box, torus, plane]
14-
);
11+
const sketches = useMemo(() => [box, torus, plane], [box, torus, plane]);
12+
1513
const [state, setState] = useState({
1614
rotation: 160,
17-
sketch: box.sketch,
15+
sketch: box,
1816
unmount: false
1917
});
18+
2019
const onChangeSketch = useCallback(() => {
2120
setState(state => {
2221
const currentSketchIndex = sketches.findIndex(sketch => {
@@ -32,9 +31,11 @@ function App() {
3231
return { ...state, sketch };
3332
});
3433
}, [sketches]);
34+
3535
const onMountStateChange = useCallback(() => {
3636
setState(state => ({ ...state, unmount: !state.unmount }));
3737
}, []);
38+
3839
const onRotationChange = useCallback(
3940
event => {
4041
setState(state => ({

demo/sketches/capture.jsx

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import "p5.capture";
2+
3+
export function sketch(p5) {
4+
p5.setup = () => {
5+
p5.createCanvas(300, 300);
6+
p5.capture.initialize(p5);
7+
};
8+
9+
p5.draw = () => {
10+
if (p5.frameCount === 1) {
11+
const capture = p5.capture.getInstance();
12+
capture.start({
13+
format: "gif",
14+
duration: 100
15+
});
16+
}
17+
};
18+
19+
p5.keyPressed = () => {
20+
if (key === "c") {
21+
const capture = p5.capture.getInstance();
22+
23+
if (capture.state === "idle") {
24+
capture.start();
25+
} else {
26+
capture.stop();
27+
}
28+
}
29+
};
30+
}

package.json

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -88,37 +88,38 @@
8888
},
8989
"devDependencies": {
9090
"@babel/eslint-plugin": "^7.27.1",
91-
"@eslint/compat": "^1.2.9",
92-
"@eslint/js": "^9.28.0",
91+
"@eslint/compat": "^1.3.1",
92+
"@eslint/js": "^9.30.1",
9393
"@testing-library/jest-dom": "6.6.3",
9494
"@testing-library/react": "^16.3.0",
9595
"@trivago/prettier-plugin-sort-imports": "^5.2.2",
96-
"@types/jest": "^29.5.14",
97-
"@types/node": "^22.15.29",
96+
"@types/jest": "^30.0.0",
97+
"@types/node": "^24.0.10",
9898
"@types/p5": "^1.7.6",
99-
"@types/react": "^19.1.6",
100-
"@types/react-dom": "^19.1.5",
101-
"@typescript-eslint/eslint-plugin": "^8.33.0",
102-
"@vitejs/plugin-react": "^4.5.0",
103-
"@vitest/coverage-v8": "^3.1.4",
99+
"@types/react": "^19.1.8",
100+
"@types/react-dom": "^19.1.6",
101+
"@typescript-eslint/eslint-plugin": "^8.35.1",
102+
"@vitejs/plugin-react": "^4.6.0",
103+
"@vitest/coverage-v8": "^3.2.4",
104104
"babel-plugin-react-compiler": "19.1.0-rc.2",
105-
"eslint": "^9.28.0",
105+
"eslint": "^9.30.1",
106106
"eslint-plugin-react": "^7.37.5",
107107
"eslint-plugin-react-compiler": "19.1.0-rc.2",
108108
"eslint-plugin-react-hooks": "^5.2.0",
109109
"gh-pages": "^6.3.0",
110110
"jiti": "^2.4.2",
111111
"js": "^0.1.0",
112112
"jsdom": "^26.1.0",
113-
"prettier": "^3.5.3",
113+
"p5.capture": "^1.6.0",
114+
"prettier": "^3.6.2",
114115
"react": "19.1.0",
115116
"react-dom": "19.1.0",
116117
"rimraf": "^6.0.1",
117118
"typescript": "^5.8.3",
118-
"typescript-eslint": "^8.33.0",
119-
"vite": "^6.3.5",
119+
"typescript-eslint": "^8.35.1",
120+
"vite": "^7.0.2",
120121
"vite-plugin-dts": "^4.5.4",
121-
"vitest": "^3.1.4",
122+
"vitest": "^3.2.4",
122123
"vitest-canvas-mock": "^0.3.3"
123124
}
124125
}

0 commit comments

Comments
 (0)