@p5-wrapper/common 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -12
- package/dist/main.cjs +1 -1
- package/dist/main.mjs +7 -13
- package/package.json +19 -29
package/README.md
CHANGED
|
@@ -35,15 +35,13 @@ Vite config in the same commit.
|
|
|
35
35
|
|
|
36
36
|
## Development
|
|
37
37
|
|
|
38
|
-
| Command | Action
|
|
39
|
-
| :------------------- |
|
|
40
|
-
| `pnpm install` | Install dependencies (updates the lock file).
|
|
41
|
-
| `pnpm format` | Format all files with
|
|
42
|
-
| `pnpm
|
|
43
|
-
| `pnpm
|
|
44
|
-
| `pnpm
|
|
45
|
-
| `pnpm test`
|
|
46
|
-
| `pnpm
|
|
47
|
-
| `pnpm
|
|
48
|
-
| `pnpm build` | Clean, type check, and build the npm library. |
|
|
49
|
-
| `pnpm integrate` | format:check → lint → test → build (CI mirror). |
|
|
38
|
+
| Command | Action |
|
|
39
|
+
| :------------------- | :-------------------------------------------- |
|
|
40
|
+
| `pnpm install` | Install dependencies (updates the lock file). |
|
|
41
|
+
| `pnpm format` | Format all files with Biome. |
|
|
42
|
+
| `pnpm lint` | Check formatting and lint with Biome. |
|
|
43
|
+
| `pnpm test` | Run the Vitest suite. |
|
|
44
|
+
| `pnpm test:coverage` | Run tests with coverage (what CI runs). |
|
|
45
|
+
| `pnpm test:watch` | Watch mode. |
|
|
46
|
+
| `pnpm build` | Clean, type check, and build the npm library. |
|
|
47
|
+
| `pnpm integrate` | lint → test → build (CI mirror). |
|
package/dist/main.cjs
CHANGED
|
@@ -4,4 +4,4 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=Object.
|
|
|
4
4
|
${f}
|
|
5
5
|
|
|
6
6
|
${e}
|
|
7
|
-
`)}function h(e){return e instanceof Error?`${e.name}("${e.message}")`:typeof e==`symbol`?e.toString():typeof e==`string`?`String("${e}")`:typeof e==`number`?`Number(${e})`:typeof e==`bigint`?`BigInt(${e})`:e
|
|
7
|
+
`)}function h(e){return e instanceof Error?`${e.name}("${e.message}")`:typeof e==`symbol`?e.toString():typeof e==`string`?`String("${e}")`:typeof e==`number`?`Number(${e})`:typeof e==`bigint`?`BigInt(${e})`:Array.isArray(e)?`Array(${JSON.stringify([...e])})`:e instanceof Set?`Set(${JSON.stringify([...e])})`:Object.getPrototypeOf(e)===Object.prototype?`Object(${JSON.stringify(e)})`:`Unknown(${typeof e})`}function g(e){let t=m(h(e));console.error(t)}function _(e,t){return(0,l.default)(e,t).length===0}function v(e){e.current?.remove(),e.current=null}function y(e,t,n){return t.current===null?null:(v(e),d(n,t.current))}exports.CanvasContainerClassName=u,exports.createP5CanvasInstance=d,exports.logErrorBoundaryError=g,Object.defineProperty(exports,"p5",{enumerable:!0,get:function(){return c.default}}),exports.propsAreEqual=_,exports.removeP5CanvasInstance=v,exports.updateP5CanvasInstance=y;
|
package/dist/main.mjs
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import e from "p5";
|
|
2
2
|
import t from "microdiff";
|
|
3
|
-
|
|
3
|
+
// src/constants/CanvasContainerClassName.ts
|
|
4
4
|
var n = "canvas-container";
|
|
5
|
-
|
|
6
|
-
//#region src/utils/createP5CanvasInstance.ts
|
|
5
|
+
// src/utils/createP5CanvasInstance.ts
|
|
7
6
|
function r(t, n) {
|
|
8
7
|
return new e(t, n);
|
|
9
8
|
}
|
|
10
|
-
|
|
11
|
-
//#region src/utils/logErrorBoundaryError.ts
|
|
9
|
+
// src/utils/logErrorBoundaryError.ts
|
|
12
10
|
var i = "[P5Canvas] The error boundary was triggered. The error message was:";
|
|
13
11
|
function a(e) {
|
|
14
12
|
return e.trim().split("\n").map((e) => e.trim()).join("\n");
|
|
@@ -21,26 +19,22 @@ function o(e) {
|
|
|
21
19
|
`);
|
|
22
20
|
}
|
|
23
21
|
function s(e) {
|
|
24
|
-
return e instanceof Error ? `${e.name}("${e.message}")` : typeof e == "symbol" ? e.toString() : typeof e == "string" ? `String("${e}")` : typeof e == "number" ? `Number(${e})` : typeof e == "bigint" ? `BigInt(${e})` : e
|
|
22
|
+
return e instanceof Error ? `${e.name}("${e.message}")` : typeof e == "symbol" ? e.toString() : typeof e == "string" ? `String("${e}")` : typeof e == "number" ? `Number(${e})` : typeof e == "bigint" ? `BigInt(${e})` : Array.isArray(e) ? `Array(${JSON.stringify([...e])})` : e instanceof Set ? `Set(${JSON.stringify([...e])})` : Object.getPrototypeOf(e) === Object.prototype ? `Object(${JSON.stringify(e)})` : `Unknown(${typeof e})`;
|
|
25
23
|
}
|
|
26
24
|
function c(e) {
|
|
27
25
|
let t = o(s(e));
|
|
28
26
|
console.error(t);
|
|
29
27
|
}
|
|
30
|
-
|
|
31
|
-
//#region src/utils/propsAreEqual.ts
|
|
28
|
+
// src/utils/propsAreEqual.ts
|
|
32
29
|
function l(e, n) {
|
|
33
30
|
return t(e, n).length === 0;
|
|
34
31
|
}
|
|
35
|
-
|
|
36
|
-
//#region src/utils/removeP5CanvasInstance.ts
|
|
32
|
+
// src/utils/removeP5CanvasInstance.ts
|
|
37
33
|
function u(e) {
|
|
38
34
|
e.current?.remove(), e.current = null;
|
|
39
35
|
}
|
|
40
|
-
|
|
41
|
-
//#region src/utils/updateP5CanvasInstance.ts
|
|
36
|
+
// src/utils/updateP5CanvasInstance.ts
|
|
42
37
|
function d(e, t, n) {
|
|
43
38
|
return t.current === null ? null : (u(e), r(n, t.current));
|
|
44
39
|
}
|
|
45
|
-
//#endregion
|
|
46
40
|
export { n as CanvasContainerClassName, r as createP5CanvasInstance, c as logErrorBoundaryError, e as p5, l as propsAreEqual, u as removeP5CanvasInstance, d as updateP5CanvasInstance };
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@p5-wrapper/common",
|
|
3
3
|
"description": "Common types and utilities for use across p5 wrapper libraries.",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.1",
|
|
5
5
|
"type": "module",
|
|
6
|
-
"packageManager": "pnpm@12.
|
|
6
|
+
"packageManager": "pnpm@12.18.0",
|
|
7
7
|
"engines": {
|
|
8
8
|
"node": ">=24.20.0"
|
|
9
9
|
},
|
|
@@ -25,15 +25,12 @@
|
|
|
25
25
|
},
|
|
26
26
|
"scripts": {
|
|
27
27
|
"build": "rimraf dist && pnpm build:library",
|
|
28
|
-
"build:library": "tsc
|
|
29
|
-
"format": "
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"prettier": "prettier --config config/prettier/prettier.json --ignore-path .gitignore --ignore-path config/prettier/.prettierignore",
|
|
35
|
-
"test": "vitest run --silent --config config/vite/vite.config.ts",
|
|
36
|
-
"test:coverage": "vitest run --silent --coverage --config config/vite/vite.config.ts",
|
|
28
|
+
"build:library": "tsc && vite build --config config/vite/vite.config.ts --mode lib",
|
|
29
|
+
"format": "biome check --write .",
|
|
30
|
+
"integrate": "pnpm lint && pnpm test && pnpm build",
|
|
31
|
+
"lint": "biome check .",
|
|
32
|
+
"test": "vitest run --config config/vite/vite.config.ts",
|
|
33
|
+
"test:coverage": "vitest run --coverage --config config/vite/vite.config.ts",
|
|
37
34
|
"test:watch": "vitest watch --config config/vite/vite.config.ts"
|
|
38
35
|
},
|
|
39
36
|
"keywords": [
|
|
@@ -62,24 +59,17 @@
|
|
|
62
59
|
"p5": ">= 2.0.0"
|
|
63
60
|
},
|
|
64
61
|
"devDependencies": {
|
|
65
|
-
"@
|
|
66
|
-
"@
|
|
67
|
-
"@
|
|
68
|
-
"@
|
|
69
|
-
"
|
|
70
|
-
"
|
|
71
|
-
"
|
|
72
|
-
"eslint": "^10.10.0",
|
|
73
|
-
"happy-dom": "^20.14.0",
|
|
74
|
-
"jiti": "^2.7.0",
|
|
75
|
-
"p5": "^2.3.2",
|
|
76
|
-
"prettier": "^3.9.6",
|
|
77
|
-
"rimraf": "^6.1.3",
|
|
62
|
+
"@biomejs/biome": "2.6.6",
|
|
63
|
+
"@microsoft/api-extractor": "^7.60.1",
|
|
64
|
+
"@types/node": "^26.6.6",
|
|
65
|
+
"@vitest/coverage-v8": "^5.1.0",
|
|
66
|
+
"happy-dom": "^21.0.4",
|
|
67
|
+
"p5": "2.3.4",
|
|
68
|
+
"rimraf": "^6.1.4",
|
|
78
69
|
"typescript": "6.0.3",
|
|
79
|
-
"
|
|
80
|
-
"vite": "^
|
|
81
|
-
"
|
|
82
|
-
"vitest": "^
|
|
83
|
-
"vitest-canvas-mock": "^1.1.5"
|
|
70
|
+
"vite": "^8.3.6",
|
|
71
|
+
"vite-plugin-dts": "^5.1.2",
|
|
72
|
+
"vitest": "^5.1.0",
|
|
73
|
+
"vitest-canvas-mock": "^1.2.0"
|
|
84
74
|
}
|
|
85
75
|
}
|