gesso-devtools 0.1.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/CHANGELOG.md ADDED
@@ -0,0 +1,21 @@
1
+ # gesso-devtools
2
+
3
+ ## 0.1.0
4
+
5
+ First public release.
6
+
7
+ **The error overlay.** A canvas application that throws leaves its last good
8
+ frame on screen, looking exactly like one that works. `mountErrorOverlay(host)`
9
+ returns a `report` matching `WorkerAppOptions.onError`, so wiring it is one
10
+ line. It draws the message over the application, says which of five sources it
11
+ came from and what that costs the running app, quotes the original source line
12
+ with a caret under the column, and maps every stack frame back through the
13
+ source maps -- decoded in this package, with no dependency. A repeat counts
14
+ instead of stacking up, and a dismissal survives an error that throws every
15
+ frame.
16
+
17
+ **The panels**, each written against a port and hosted either by the Chrome
18
+ devtools extension or by a pane in the page: the node tree with owners, a
19
+ node's report (props with their sources, `listens`, `beneath`, and the layout
20
+ explanation), the frame profiler, the action log, and the render and
21
+ application workers' consoles with the thread named.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Kevin Baker
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,34 @@
1
+ # gesso-devtools
2
+
3
+ See what a Gesso application is doing, and what it threw.
4
+
5
+ ```bash
6
+ npm install --save-dev gesso-devtools
7
+ ```
8
+
9
+ ## The error overlay
10
+
11
+ A canvas application that throws leaves its last good frame on screen, looking exactly like one that works. This draws the failure over it:
12
+
13
+ ```ts
14
+ import { mountErrorOverlay } from 'gesso-devtools';
15
+
16
+ createApp({ onError: mountErrorOverlay(document.body) }).mount('#app');
17
+ ```
18
+
19
+ `mountErrorOverlay(host)` returns a `report` matching `WorkerAppOptions.onError`, so wiring it is one line. It names which of five sources the failure came from and decodes the source maps of the scripts the stack names, so a frame points at the file somebody wrote rather than at a bundled line and column.
20
+
21
+ ## The panels
22
+
23
+ - **Node inspector** -- the tree with owners, and a node's report: props with their sources, `listens`, `beneath`, and the layout explanation
24
+ - **Frame profiler** -- where a frame's milliseconds went, by phase
25
+ - **Action log** -- what crossed the barrier, with the cause that started it
26
+ - **Worker consoles** -- `console.*` from the render and application workers, with the thread named
27
+
28
+ `connectDevtools()` in your render worker is the one line that makes an application answer a panel. The same panel is hosted two ways: a Chrome devtools extension, and a pane inside the page.
29
+
30
+ ## Documentation
31
+
32
+ [Devtools](https://github.com/kevinpbaker/gesso/blob/main/apps/docs/tooling/devtools.md) | [Errors and the overlay](https://github.com/kevinpbaker/gesso/blob/main/apps/docs/structure/errors-and-the-overlay.md) | [Frames and phases](https://github.com/kevinpbaker/gesso/blob/main/apps/docs/tooling/frames-and-phases.md)
33
+
34
+ MIT (c) Kevin Baker