create-playcanvas 0.13.0 → 0.14.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-playcanvas",
3
- "version": "0.13.0",
3
+ "version": "0.14.0",
4
4
  "description": "Scaffold a PlayCanvas project",
5
5
  "keywords": [
6
6
  "playcanvas",
@@ -52,7 +52,7 @@
52
52
  "prettier": "^3.9.10",
53
53
  "unbuild": "^3.6.1",
54
54
  "vite": "^8.3.5",
55
- "vitest": "^5.0.5"
55
+ "vitest": "^5.1.0"
56
56
  },
57
57
  "engines": {
58
58
  "node": ">=22.23.2"
@@ -8,7 +8,8 @@ description: Use when adding visual effects to a PlayCanvas app, to choose betwe
8
8
  Pick the Engine building block first, then adapt its closest official example with
9
9
  `find-examples`:
10
10
 
11
- - Particle systems: the `particlesystem` component (`graphics/particles-*` examples).
11
+ - Particle systems: the `particlesystem` component (`particles/*` examples; `graphics/particles-*`
12
+ before 2.24).
12
13
  - Custom shading on existing surfaces: `StandardMaterial` chunk overrides
13
14
  (`override-shader-chunks`), or a `ShaderMaterial` when the effect needs its own shader pair.
14
15
  - Procedural or per-frame geometry: a runtime-updated `Mesh` on a `render` component
@@ -15,17 +15,18 @@ it locally. The npm package omits `examples/`, so otherwise fetch from the insta
15
15
 
16
16
  ```sh
17
17
  TAG="v$(node -p "JSON.parse(require('fs').readFileSync('node_modules/playcanvas/package.json')).version")" || exit 1
18
- gh api "repos/playcanvas/engine/git/trees/$TAG?recursive=1" | grep -o '"examples/src/examples/[^"]*\.example\.mjs"'
19
- gh api "repos/playcanvas/engine/contents/examples/src/examples/<category>/<name>.example.mjs?ref=$TAG" \
20
- --jq .content | base64 --decode
18
+ gh api "repos/playcanvas/engine/git/trees/$TAG?recursive=1" | grep -o '"examples/src/examples/[^"]*example\.mjs"'
19
+ gh api "repos/playcanvas/engine/contents/<listed path>?ref=$TAG" --jq .content | base64 --decode
21
20
  ```
22
21
 
23
22
  Read the resolved package, not the dependency list; `playcanvas` is often transitive. An empty list
24
- means an invalid tag: stop rather than guess. Use `main` only when the version has no tag.
23
+ means an invalid tag: stop rather than guess. Use `main` only when the version has no tag. From
24
+ 2.24, each Engine example is a folder with the shaders and other files it imports; earlier tags use
25
+ `<name>.example.mjs` with sibling `<name>.*` files.
25
26
 
26
27
  | Surface | Repository | Ref | Example paths |
27
28
  | --- | --- | --- | --- |
28
- | direct Engine | `playcanvas/engine` | `v<version>` | `examples/src/examples/<category>/<name>.example.mjs` |
29
+ | direct Engine | `playcanvas/engine` | `v<version>` | `examples/src/examples/<category>/<name>/example.mjs` |
29
30
  | Web Components | `playcanvas/web-components` | `v<version>` | `examples/<name>.html` |
30
31
  | React | `playcanvas/developer-site` | `main` | `docs/user-manual/react/examples/<name>.mdx` |
31
32
 
@@ -37,4 +37,5 @@ transforms:
37
37
  npx --yes @gltf-transform/cli@4.4.2 copy in.glb scratch.glb
38
38
  ```
39
39
 
40
- The Engine cannot load `EXT_meshopt_compression`; see `load-assets` before shipping such files.
40
+ The Engine loads Meshopt files only from 2.24, with a decoder; see `load-assets` before shipping
41
+ them.
@@ -16,10 +16,8 @@ From Engine 2.23, every app announces itself to a hook at
16
16
  - Page code then reads `globalThis.__playcanvasApps`, a `Map` from each live app to
17
17
  `{ version, revision, protocol }`. `app.init()` adds the entry and `app.destroy()` removes it.
18
18
  - The script chains a hook defined before it, such as a devtools extension's.
19
- - No entry means the Engine predates 2.23, the hook loaded late, or the app set
20
- `devtools: false`. The Engine swallows errors thrown by the hook.
21
- - In 2.23.0 only the debug build (`playcanvas/debug`, `build/playcanvas.dbg.*`) announces apps; the
22
- default import never calls the hook. Later 2.23 patches fix every build.
19
+ - No entry means the Engine predates 2.23, is a non-debug 2.23.0 build, the hook loaded late, or
20
+ the app set `devtools: false`. The Engine swallows hook errors.
23
21
 
24
22
  ## Read state
25
23
 
@@ -34,8 +32,11 @@ From Engine 2.23, every app announces itself to a hook at
34
32
 
35
33
  ## Inspector panel
36
34
 
37
- `@playcanvas/inspector` adds a panel for people: `new Inspector(app)` shows the hierarchy, assets,
38
- materials, shaders, textures, render targets, frame graph, and physics. It must import the app's
39
- own `playcanvas` package, so add it only to development builds. It draws over the canvas and
40
- applies view overrides, so destroy it before `verify-pixels` captures. Stepping through draws
41
- needs the debug build.
35
+ `@playcanvas/inspector` is a debug panel: `new Inspector(app)` shows the hierarchy, assets, GPU
36
+ resources, frame graph, physics, and frame timings; `record: true` records from creation. It must
37
+ import the app's own `playcanvas` package, so add it only to development builds. It draws over the
38
+ canvas and applies view overrides, so destroy it before `verify-pixels` captures. Stepping through
39
+ draws needs the debug build.
40
+
41
+ With `mcp: true` (0.5.0+), `await inspector.executeTool(name, args)` runs the tools `getTools()`
42
+ lists: find entities, get objects by `$id`, record frames, take screenshots, and read logs.
@@ -15,8 +15,9 @@ and `EXT_mesh_gpu_instancing`; do not rebuild these by hand. Preload asset sets
15
15
 
16
16
  ## Compress for size
17
17
 
18
- - Geometry: Draco (`KHR_draco_mesh_compression`). Meshopt is not supported, so decode such files
19
- before shipping.
18
+ - Geometry: Draco (`KHR_draco_mesh_compression`), or from Engine 2.24 Meshopt
19
+ (`EXT_meshopt_compression`, `KHR_meshopt_compression`). Older Engines cannot load Meshopt, so
20
+ decode such files before shipping.
20
21
  - Textures: KTX2 with Basis (`KHR_texture_basisu`) transcodes to a GPU format, cutting both
21
22
  download size and VRAM. ETC1S is smallest and lossy. UASTC is larger and keeps
22
23
  detail, which matters most for normal maps. Weigh size against visible detail.
@@ -42,6 +43,10 @@ basisInitialize({
42
43
  });
43
44
  ```
44
45
 
46
+ From 2.24, also copy `meshopt/` and call
47
+ `meshoptInitialize({ url: '/wasm/meshopt/meshopt_decoder.mjs' })` before loading Meshopt files;
48
+ without it they fail unless they carry uncompressed fallback buffers.
49
+
45
50
  In Web Components, a `<pc-wasm name="DracoDecoderModule">` element under `<pc-app>` sets the Draco
46
51
  config with `glue`, `wasm`, and `fallback` attributes.
47
52
 
@@ -8,7 +8,7 @@ description: Use when a PlayCanvas StandardMaterial needs custom shading its pro
8
8
  Overriding a `StandardMaterial` chunk keeps fog, tone mapping, shadows, skinning, and instancing
9
9
  intact. Use a `ShaderMaterial` only when the look needs its own vertex and fragment pair.
10
10
 
11
- - Set `material.shaderChunksVersion` to the installed major.minor, such as `'2.23'`. Chunk names
11
+ - Set `material.shaderChunksVersion` to the installed major.minor, such as `'2.24'`. Chunk names
12
12
  and contracts change between versions, so read the installed chunk source, not memory.
13
13
  - Set chunks with `material.getShaderChunks(SHADERLANGUAGE_GLSL).set(name, source)` and the WGSL
14
14
  equivalent, then call `material.update()`. For every material on a device, use
@@ -15,11 +15,11 @@
15
15
  "typecheck": "tsc --noEmit"
16
16
  },
17
17
  "dependencies": {
18
- "playcanvas": "^2.23.3"
18
+ "playcanvas": "^2.24.0"
19
19
  },
20
20
  "devDependencies": {
21
21
  "@playcanvas/eslint-config": "3.0.0",
22
- "@playcanvas/inspector": "^0.4.0",
22
+ "@playcanvas/inspector": "^0.5.0",
23
23
  "eslint": "^9.39.5",
24
24
  "prettier": "^3.9.10",
25
25
  "typescript": "~6.0.3",
@@ -16,16 +16,16 @@
16
16
  },
17
17
  "dependencies": {
18
18
  "@playcanvas/react": "^0.11.7",
19
- "playcanvas": "^2.23.3",
19
+ "playcanvas": "^2.24.0",
20
20
  "react": "^19.3.1",
21
21
  "react-dom": "^19.3.1"
22
22
  },
23
23
  "devDependencies": {
24
24
  "@playcanvas/eslint-config": "3.0.0",
25
- "@playcanvas/inspector": "^0.4.0",
25
+ "@playcanvas/inspector": "^0.5.0",
26
26
  "@types/react": "^19.3.0",
27
27
  "@types/react-dom": "^19.3.0",
28
- "@vitejs/plugin-react": "^6.1.2",
28
+ "@vitejs/plugin-react": "^6.2.1",
29
29
  "eslint": "^9.39.5",
30
30
  "prettier": "^3.9.10",
31
31
  "typescript": "~6.0.3",
@@ -15,12 +15,12 @@
15
15
  "typecheck": "tsc --noEmit"
16
16
  },
17
17
  "dependencies": {
18
- "@playcanvas/web-components": "^0.28.1",
19
- "playcanvas": "^2.23.3"
18
+ "@playcanvas/web-components": "^0.29.0",
19
+ "playcanvas": "^2.24.0"
20
20
  },
21
21
  "devDependencies": {
22
22
  "@playcanvas/eslint-config": "3.0.0",
23
- "@playcanvas/inspector": "^0.4.0",
23
+ "@playcanvas/inspector": "^0.5.0",
24
24
  "eslint": "^9.39.5",
25
25
  "prettier": "^3.9.10",
26
26
  "typescript": "~6.0.3",