@scayle/storefront-devtools 0.2.0-alpha.4 → 0.2.0-alpha.6

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.
Files changed (127) hide show
  1. package/CHANGELOG.md +77 -0
  2. package/README.md +234 -111
  3. package/dist/_chunks/{coalesce-D-Q8NzYg.mjs → coalesce-PetLUcf2.mjs} +388 -404
  4. package/dist/_chunks/frame-nav-DctWjxeG.mjs +3 -0
  5. package/dist/group.d.ts +14 -26
  6. package/dist/group.d.ts.map +1 -1
  7. package/dist/index.d.ts +29 -10
  8. package/dist/index.d.ts.map +1 -1
  9. package/dist/index.mjs +80 -116
  10. package/dist/inertia/channel.d.ts +18 -5
  11. package/dist/inertia/channel.d.ts.map +1 -1
  12. package/dist/inertia/client/index.mjs +242 -210
  13. package/dist/inertia/client/messages.d.ts +28 -0
  14. package/dist/inertia/client/messages.d.ts.map +1 -0
  15. package/dist/inertia/client/publish.d.ts +4 -2
  16. package/dist/inertia/client/publish.d.ts.map +1 -1
  17. package/dist/inertia/core/capture.d.ts.map +1 -1
  18. package/dist/inertia/core/correlator.d.ts +16 -0
  19. package/dist/inertia/core/correlator.d.ts.map +1 -1
  20. package/dist/inertia/core/diagnostics.d.ts.map +1 -1
  21. package/dist/inertia/core/diff.d.ts +2 -1
  22. package/dist/inertia/core/diff.d.ts.map +1 -1
  23. package/dist/inertia/core/feature-info.d.ts +9 -5
  24. package/dist/inertia/core/feature-info.d.ts.map +1 -1
  25. package/dist/inertia/core/features.d.ts.map +1 -1
  26. package/dist/inertia/core/history-capture.d.ts.map +1 -1
  27. package/dist/inertia/core/interceptors.d.ts +1 -0
  28. package/dist/inertia/core/interceptors.d.ts.map +1 -1
  29. package/dist/inertia/core/markdown.d.ts.map +1 -1
  30. package/dist/inertia/core/protocol.d.ts +1 -1
  31. package/dist/inertia/core/protocol.d.ts.map +1 -1
  32. package/dist/inertia/core/request-filters.d.ts +19 -0
  33. package/dist/inertia/core/request-filters.d.ts.map +1 -0
  34. package/dist/inertia/core/request-tree.d.ts +6 -3
  35. package/dist/inertia/core/request-tree.d.ts.map +1 -1
  36. package/dist/inertia/core/response.d.ts +3 -2
  37. package/dist/inertia/core/response.d.ts.map +1 -1
  38. package/dist/inertia/core/store.d.ts +1 -0
  39. package/dist/inertia/core/store.d.ts.map +1 -1
  40. package/dist/inertia/core/types.d.ts +2 -2
  41. package/dist/inertia/core/types.d.ts.map +1 -1
  42. package/dist/inertia/core/url.d.ts +12 -0
  43. package/dist/inertia/core/url.d.ts.map +1 -1
  44. package/dist/inject.d.ts +3 -4
  45. package/dist/inject.d.ts.map +1 -1
  46. package/dist/og.d.ts +12 -0
  47. package/dist/og.d.ts.map +1 -0
  48. package/dist/orpc/channel.d.ts +9 -1
  49. package/dist/orpc/channel.d.ts.map +1 -1
  50. package/dist/orpc/client/index.mjs +118 -102
  51. package/dist/orpc/client/publish.d.ts +3 -1
  52. package/dist/orpc/client/publish.d.ts.map +1 -1
  53. package/dist/orpc/core/session.d.ts +1 -8
  54. package/dist/orpc/core/session.d.ts.map +1 -1
  55. package/dist/orpc/core/stats.d.ts +1 -1
  56. package/dist/orpc/core/stats.d.ts.map +1 -1
  57. package/dist/orpc/core/store.d.ts +1 -0
  58. package/dist/orpc/core/store.d.ts.map +1 -1
  59. package/dist/shared/clipboard.d.ts +23 -3
  60. package/dist/shared/clipboard.d.ts.map +1 -1
  61. package/dist/shared/panel-channel.d.ts +27 -1
  62. package/dist/shared/panel-channel.d.ts.map +1 -1
  63. package/dist/shared/prefs.d.ts +49 -0
  64. package/dist/shared/prefs.d.ts.map +1 -0
  65. package/dist/shared/redact.d.ts +6 -3
  66. package/dist/shared/redact.d.ts.map +1 -1
  67. package/dist/shared/safe-clone.d.ts +2 -1
  68. package/dist/shared/safe-clone.d.ts.map +1 -1
  69. package/dist/ui/assets/App-BDAG24ch.js +4 -0
  70. package/dist/ui/assets/App-CBJXphAE.css +1 -0
  71. package/dist/ui/assets/App-CoMIIpFn.js +5 -0
  72. package/dist/ui/assets/App-CrZKW7ZD.js +1 -0
  73. package/dist/ui/assets/App-D9h2xKeA.css +1 -0
  74. package/dist/ui/assets/App-DIxgDJPh.css +1 -0
  75. package/dist/ui/assets/HeadersTab-BAgPi_LJ.css +1 -0
  76. package/dist/ui/assets/HeadersTab-YiDZOc7w.js +1 -0
  77. package/dist/ui/assets/_plugin-vue_export-helper-DnlXueOW.js +2 -0
  78. package/dist/ui/assets/panels-BZNAuOBL.css +1 -0
  79. package/dist/ui/assets/panels-X7JpniLo.js +3 -0
  80. package/dist/ui/assets/store-CmrV1otI.js +1 -0
  81. package/dist/ui/panels/index.html +2 -3
  82. package/package.json +23 -26
  83. package/dist/inertia/plugin.d.ts +0 -13
  84. package/dist/inertia/plugin.d.ts.map +0 -1
  85. package/dist/orpc/plugin.d.ts +0 -13
  86. package/dist/orpc/plugin.d.ts.map +0 -1
  87. package/dist/storefront/plugin.d.ts +0 -11
  88. package/dist/storefront/plugin.d.ts.map +0 -1
  89. package/dist/ui/assets/App-BMyWBnLQ.js +0 -4
  90. package/dist/ui/assets/App-C5-JscO0.css +0 -1
  91. package/dist/ui/assets/App-CCUPtzNx.js +0 -5
  92. package/dist/ui/assets/App-Ct7Za--B.css +0 -1
  93. package/dist/ui/assets/App-Ctfis9Sq.js +0 -1
  94. package/dist/ui/assets/App-jiQKInbo.css +0 -1
  95. package/dist/ui/assets/_plugin-vue_export-helper-BDNMzG2s.js +0 -1
  96. package/dist/ui/assets/channel-D7V7aU79.js +0 -1
  97. package/dist/ui/assets/clipboard-BY7CN-yK.js +0 -1
  98. package/dist/ui/assets/clipboard-BnEeWyfh.css +0 -1
  99. package/dist/ui/assets/css-8QJvnqUH.js +0 -1
  100. package/dist/ui/assets/css-lJZLS6R3.js +0 -1
  101. package/dist/ui/assets/diff-woXpYk--.js +0 -1
  102. package/dist/ui/assets/html-GueGcY0x.js +0 -1
  103. package/dist/ui/assets/html-WzJrCOnD.js +0 -1
  104. package/dist/ui/assets/javascript-BzbQS41l.js +0 -1
  105. package/dist/ui/assets/javascript-CpIGwZ_Y.js +0 -1
  106. package/dist/ui/assets/json-B88Oqtu5.js +0 -1
  107. package/dist/ui/assets/json-C3WlssX3.js +0 -1
  108. package/dist/ui/assets/panel-channel-qxy-vGGq.js +0 -2
  109. package/dist/ui/assets/panels-B4LTsmli.css +0 -1
  110. package/dist/ui/assets/panels-BcOW2Xog.js +0 -2
  111. package/dist/ui/assets/preload-helper-CSlQMSTd.js +0 -2
  112. package/dist/ui/assets/shellscript-CLZ0U2zV.js +0 -1
  113. package/dist/ui/assets/typescript-Bb1J8qyy.js +0 -1
  114. package/dist/ui/assets/typescript-j_1H8WHN.js +0 -1
  115. package/dist/ui/assets/vitesse-dark-BZCL-v6S.js +0 -1
  116. package/dist/ui/assets/vitesse-light-VbXTXTou.js +0 -1
  117. package/dist/ui/assets/vue-B1Tf5CHw.js +0 -1
  118. package/dist/ui/assets/vue-C0gCEhF7.js +0 -155
  119. package/dist/ui/assets/vue-Kq4tvBbL.css +0 -1
  120. package/dist/ui/assets/vue-html-CGMs_6qn.js +0 -1
  121. package/dist/ui/assets/yaml-rwi0_p6S.js +0 -1
  122. package/dist/ui/vue/index.html +0 -15
  123. package/dist/vue-devtools/client/index.mjs +0 -4899
  124. package/dist/vue-devtools/client.d.ts +0 -2
  125. package/dist/vue-devtools/client.d.ts.map +0 -1
  126. package/dist/vue-devtools/plugin.d.ts +0 -15
  127. package/dist/vue-devtools/plugin.d.ts.map +0 -1
package/README.md CHANGED
@@ -10,7 +10,7 @@
10
10
  </h4>
11
11
 
12
12
  <p align="center">
13
- The SCAYLE <strong>Storefront DevTools</strong> package adds the Vite DevTools dock to the Storefront Application V3 with one Vite plugin call. The dock holds an Inertia.js inspector, an oRPC call inspector, a Storefront context viewer, and Vue DevTools.
13
+ The SCAYLE <strong>Storefront DevTools</strong> package adds the Vite DevTools dock to the Storefront Application V3 with one Vite plugin call. The dock holds an Inertia.js inspector, an oRPC call inspector, a Storefront context viewer, Vue DevTools, Vite Inspect, and an Open Graph viewer.
14
14
  </p>
15
15
  <p align="center">
16
16
  <a href="#"><img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="SCAYLE's Storefront DevTools is released under the MIT license." /></a>
@@ -18,29 +18,45 @@
18
18
 
19
19
  ## Overview
20
20
 
21
- `@scayle/storefront-devtools` is a dev-only Vite plugin. It hosts the Vite DevTools dock and registers two dock groups, **SCAYLE Storefront** and **Vue**:
21
+ `@scayle/storefront-devtools` is a dev-only Vite plugin. It hosts the Vite DevTools dock and adds three entries to it:
22
22
 
23
- - The Inertia.js panel lists every visit your app makes, one request per navigation. It shows the response body and headers, the Inertia protocol details (partial reload keys, asset version, redirects), and a lifecycle timeline, and it flags common mistakes such as a missing partial-reload prop. The [Inertia.js panel](#inertiajs-panel) section covers it in depth.
24
- - The oRPC panel lists every call to your `/api` endpoint and decodes each call's `{ json, meta }` envelope back to typed input and output. It groups calls by procedure, classifies failures, and tracks timing per procedure. The [oRPC panel](#orpc-panel) section covers it in depth.
25
- - The Storefront context panel is a read-only view of the resolved shop, country, locale, and session for the page you're looking at, taken from the Inertia page the SDK ships. The [Storefront context panel](#storefront-context-panel) section covers it.
26
- - The Vue panel gives you the component tree and timeline in the same dock, so you don't need a separate `vite-plugin-vue-devtools` install.
23
+ - The **SCAYLE Storefront** group with the Inertia.js, oRPC, and Storefront entries.
24
+ - **Vue DevTools**, the full Vue DevTools from `vite-plugin-vue-devtools`.
25
+ - **Inspect**, Vite's module graph and plugin transforms from `vite-plugin-inspect`.
26
+ - **Open Graph**, the link preview viewer from `@devframes/plugin-og`.
27
27
 
28
- The plugin only runs on the dev server and drops out of production builds without an environment flag. [Production safety](#production-safety) explains why.
28
+ The panels cover these jobs:
29
+
30
+ - The [Inertia.js panel](#inertiajs-panel) lists every visit your app makes. It shows the response props, the headers, the Inertia protocol details, a lifecycle timeline, and the changes since the last page. It also flags common mistakes, such as a prop you asked for with `only` that the response left out.
31
+ - The [oRPC panel](#orpc-panel) lists every call to your `/api` endpoint. It decodes each `{ json, meta }` envelope back to the typed input and output, groups calls by procedure, and classifies failures.
32
+ - The [Storefront context panel](#storefront-context-panel) shows the shop, country, locale, and session the app resolved for the current page.
33
+ - [Vue DevTools](#vue-devtools) gives you the component tree, the timeline, and the inspectors of Vue plugins such as vue-i18n, so you don't add `vite-plugin-vue-devtools` yourself.
34
+ - [Vite Inspect](#vite-inspect) shows every module Vite has loaded and what each plugin did to it, for the client and the server render.
35
+ - The [Open Graph viewer](#open-graph-viewer) shows the meta tags the controllers render for the current page and previews how a shared link to it looks.
36
+
37
+ The plugin runs on the dev server only. [Production safety](#production-safety) explains why a build carries none of it.
29
38
 
30
39
  ## Beyond the browser Network tab
31
40
 
32
- Use the browser's Network tab for raw HTTP. These panels cover what it can't show.
41
+ Use the Network tab for raw HTTP. The panels cover what it can't show.
42
+
43
+ - Many Inertia visits never touch the network. The initial page load embeds the page object in the HTML, and client-side history navigations and prefetch cache hits send no request. The Inertia.js panel reads them from Inertia's DOM events and from the history API.
44
+ - The Network tab shows one request at a time. The Inertia.js panel compares visits. It diffs the props of consecutive visits, nests a deferred-prop reload under the visit that triggered it, and draws the lifecycle events on a timeline.
45
+ - An oRPC request body isn't the argument your code passed. Every oRPC call is a `POST` under `/api` with a `{ json, meta }` envelope, and JSON can't represent the `Date`, `Map`, `Set`, or `BigInt` values it encodes. The oRPC panel decodes the envelope back to the value your handler received.
46
+ - oRPC calls get lost between the images, scripts, and page visits a storefront loads. The oRPC panel lists only those calls, adds up the timing per procedure, and labels each failure as a validation, server, or network error.
47
+
48
+ For the raw transaction of a single request, the Network tab stays the better tool.
33
49
 
34
- - Many Inertia visits never hit the network. The initial page load embeds the page object in the HTML, so no XHR fires. Client-side history navigations, prefetch cache hits, and `preserveState` updates send no request at all, and the Network tab has no row for them. The Inertia.js panel picks them up from Inertia's DOM events and from history.
35
- - The Inertia.js panel compares visits. It diffs the props of consecutive visits, links a deferred-prop reload to the visit that triggered it, and draws the lifecycle event timeline. The Network tab shows one request at a time and forgets the one before.
36
- - An oRPC request body isn't the argument your code passed. Every oRPC call is a `POST` under `/api` with a `{ json, meta }` envelope. The Network tab shows that envelope as raw JSON and can't rebuild the `Date`, `Map`, `Set`, or `BigInt` values it encodes, because JSON has no way to represent them. The oRPC panel decodes the envelope back to the typed value your handler received.
37
- - oRPC calls get lost in the Network tab, between the images, scripts, and page visits a storefront loads. The oRPC panel lists only oRPC calls, groups them by procedure, adds up the timing per procedure, and classifies each failure as validation, server, or network.
50
+ ## Requirements
38
51
 
39
- Where the two overlap, in the HTTP view of a single oRPC request, the panels don't try to replace the Network tab. Use the Network tab for the raw transaction and the panels for what it means to Inertia and oRPC.
52
+ - Node.js 24 or newer
53
+ - Vite 8.3.5 or newer. Vite 8.3.5 is the first release that lists `@vitejs/devtools` 0.8 as a supported peer. Earlier 8.x releases install, but your package manager can report a peer mismatch.
54
+ - Vue 3.5 or newer
55
+ - `@inertiajs/core` 3 and `@orpc/client` 1
40
56
 
41
57
  ## Installation
42
58
 
43
- The package ships with Storefront Application V3 by default. To add it yourself:
59
+ The Storefront Application V3 ships with the package. To add it to another project:
44
60
 
45
61
  ```bash
46
62
  pnpm add -D @scayle/storefront-devtools
@@ -48,7 +64,7 @@ pnpm add -D @scayle/storefront-devtools
48
64
 
49
65
  ## Integration
50
66
 
51
- The only file you change is the Storefront Application V3 `vite.config.ts`. The plugin injects the dock client and the Inertia and oRPC page scripts into the app's client entry, so the rest of your app code stays as it is.
67
+ The only file you change is the Storefront Application V3 `vite.config.ts`. The plugin injects the dock client and the page scripts into the app's client entry (`src/client/main.ts`), so your app code stays as it is.
52
68
 
53
69
  Import the default export and spread it into the `plugins` array, after `@vitejs/plugin-vue`:
54
70
 
@@ -62,7 +78,7 @@ import storefrontBuild from '@scayle/storefront-build'
62
78
  export default defineConfig({
63
79
  plugins: [
64
80
  vue(),
65
- // The Vite DevTools dock with the SCAYLE Storefront panels.
81
+ // The Vite DevTools dock with the SCAYLE Storefront and Vue panels.
66
82
  ...storefrontDevtools(),
67
83
  storefrontBuild({
68
84
  serverEntry: './src/server/index.ts',
@@ -74,178 +90,285 @@ export default defineConfig({
74
90
  })
75
91
  ```
76
92
 
77
- `storefrontDevtools()` returns an array of Vite plugins, so you have to spread it. It includes the Vue DevTools panel, so you don't need `vite-plugin-vue-devtools` on top.
93
+ `storefrontDevtools()` returns an array of Vite plugins, so you have to spread it. It always registers every panel. Its only options are the dock connection options `allowedOrigins` and `clientAuth`, described in [Security and browser authorization](#security-and-browser-authorization).
78
94
 
79
- ### Dev server path exclusion
95
+ ### Dev server paths
80
96
 
81
- Vite serves the dock and its assets under `/__devtools/` and `/__storefront-devtools/`. The Storefront Application V3 serves pages through a Hono dev server with a country-prefix redirect, which would catch those paths and rewrite them. `@scayle/storefront-build` already excludes the DevTools paths from the Hono dev server, so with both packages installed you need no extra configuration.
82
-
83
- `storefrontDevtools()` takes no options. It always registers the Inertia.js, oRPC, Storefront context, and Vue panels, and it always injects into the Storefront Application V3's own client entry (`src/client/main.ts`).
97
+ Vite serves the dock under `/__devtools/`, the Vue DevTools UI under `/__devtools__/`, the panel app and the Open Graph viewer under `/__storefront-devtools/`, and the Inspect UI under `/.vite-inspect/`. The Storefront Application V3 renders pages through a Hono dev server with a country-prefix redirect, which would catch those paths and rewrite them. `@scayle/storefront-build` already excludes the first three paths, so with both packages installed you need no extra configuration. The Inspect UI needs no exclusion, because `vite-plugin-inspect` serves it from a middleware that runs before the Hono dev server.
84
98
 
85
99
  ## Opening the dock
86
100
 
87
- Run the Storefront Application V3 dev server (`pnpm dev`) and open the app. A floating launcher appears on the page. Open it, then open the **SCAYLE Storefront** group for the **Inertia.js**, **oRPC**, and **Storefront** entries, or the **Vue** group for the component tree and timeline.
101
+ Start the dev server with `pnpm dev` and open the app. A launcher appears at the bottom of the page. Open it, then pick an entry from the **SCAYLE Storefront** group (Storefront, oRPC, Inertia.js) or the **Vue** group (Components, Timeline).
88
102
 
89
- The plugin injects the launcher into the client entry instead of the HTML. The Storefront Application V3 builds its HTML in the SSR renderer, so Vite's `transformIndexHtml` hook never fires. Every panel's page script arrives through the same injection.
103
+ The launcher and the Vue DevTools hook reach the page through Vite's `transformIndexHtml` hook. `@scayle/storefront` runs the HTML template through that hook in dev, so update it together with this package. With a `@scayle/storefront` version that reads the template without it, the page loads neither the launcher nor the Vue DevTools hook.
90
104
 
91
- ## Security and browser authorization
105
+ ## Panels
92
106
 
93
- The dock in the browser talks to the Vite dev server over a WebSocket RPC channel (`@devframes/hub`, with `crossws` as its transport layer). Our panels aren't the only thing on that channel. `@vitejs/devtools` ships its own RPC functions with real reach into your machine, for example `vite:core:open-in-editor`, which opens any file path in your editor, and a terminals feed. This package sets `builtinDevTools: false`, which drops the upstream Terminals, Messages, and Inspector docks and their UI. The RPC declarations behind them stay, because they belong to `@vitejs/devtools` itself and a consumer can't remove them. Two independent checks protect the channel.
107
+ Page props, response props, event details, and oRPC input and output appear as trees that start collapsed. Each row has **Copy value**, which copies a string as is and an object or array as JSON, and **Copy path**, which copies the access path from the tree's root, such as `props.user.addresses[0]`. Both show on hover and on the focused row. The trees work with the keyboard: Tab moves into a tree, Up and Down move between rows, Right expands a row or moves to its first child, Left collapses a row or moves to its parent, and Home and End jump to the first and last row. Tab from a row reaches its copy actions, then leaves the tree.
94
108
 
95
- ### Origin allowlist
109
+ ### Inertia.js panel
96
110
 
97
- `@vitejs/devtools` accepts a WebSocket connection only when its `Origin` header matches a built-in loopback allowlist (`localhost`, `127.0.0.1`, and similar). The check compares strings. It doesn't resolve DNS or read your hosts file, so a custom dev hostname that points at loopback through `/etc/hosts` or a local DNS override (for example `dev-my-app.example.com`) gets rejected by default. If your setup needs another hostname, such as a reverse proxy, a tunnel, or a custom `/etc/hosts` entry, add it with `devtools: { allowedOrigins: ['https://dev-my-app.example.com'] }` in the app's Vite config.
111
+ Inertia drives navigation over XHR and swaps page props without a reload. The browser shows you raw JSON and nothing about the visit. The Inertia.js panel reads the Inertia lifecycle and shows the visit.
98
112
 
99
- ### One-time client authorization
113
+ It has a **Requests** tab and a **Page** tab. **Pause** and **Clear** sit in the top bar.
100
114
 
101
- On top of the origin check, `@vitejs/devtools` puts the RPC connection behind a one-time code by default (`clientAuth: true`). The first time a new browser connects, the `pnpm dev` terminal prints `devframe auth code <code>` and a magic-link URL (`...#devframe_otp=<code>`). Enter the code in the dock's prompt, or open the printed URL, to authorize that browser. The dock stays unauthorized until you do, and that's expected.
115
+ #### Requests tab
102
116
 
103
- ### Turning off the authorization check
117
+ The list shows each visit as it happens, with its method, URL, visit type, duration, and a count of diagnostics. A URL on your app's origin shows as its path, and hovering a row shows the full URL. Drag the grip in the list's bottom corner to widen it, and the panel keeps that width across reloads. Filter by type (full, partial, deferred, prefetch, redirect, client), by method (GET, POST, PUT, PATCH, DELETE), or by status range (2xx, 4xx, 5xx), or type into the URL box. There is no 3xx option, because the browser follows a redirect before Inertia sees the response. A visit without a response status, such as a client visit or the initial page load, shows only under **All**. Deferred reloads nest under the visit that triggered them. Once the list passes 200 visits, a footer tells you how many older ones dropped off. After a full reload, a collapsible **Previous session** block keeps a summary of the earlier visits. It holds the method, URL, type, and status for five minutes.
104
118
 
105
- Setting `devtools: { clientAuth: false }` (or the `VITE_DEVTOOLS_DISABLE_CLIENT_AUTH=true` environment variable) skips the one-time code. The `@vitejs/devtools` documentation warns about this: _"if you disable client authentication, any browsers can connect to the devtools and access to your server and filesystem (including other devices, if you open server `host` option to LAN or WAN)."_ Only turn it off where every request comes from a trusted developer. Never do it with `server.host` bound to a LAN or WAN interface, or in a shared environment or anything close to production.
119
+ Select a visit to see its detail. The header shows the method, URL, type, status, component, duration, and the redirect target of a 409 response. Below it you find the feature badges, the diagnostics, and four tabs:
106
120
 
107
- ### Production safety
121
+ - **Response** lists the response props, each tagged with how it arrived: full, partial, deferred, merged, prepended, or deep-merged. It names the props you requested with `only` that the response left out, and counts the props carried over from the previous page. **Show changes since last page** swaps the list for a diff that marks added, removed, and changed values.
122
+ - **Headers** shows the request and response headers as tables.
123
+ - **Network** shows the protocol side of the request: visit type, asset version, the `only` and `except` keys, the error bag, and the reset keys. It also shows the duration, transfer size, and start and finish times when the browser recorded them.
124
+ - **Events** shows a lifecycle timeline (`before`, `start`, `success`, `finish`, and the rest) with each step's offset from the first event, colored by outcome. Below it, every captured event appears as a collapsible tree.
108
125
 
109
- `storefrontDevtools()` registers its plugins in every build, with no `import.meta.env.PROD` check of its own. The safety comes from `@vitejs/devtools`. Its plugin opens the WebSocket RPC server from Vite's `configureServer` hook, and Vite calls that hook during `vite dev` and `vite serve`, never during `vite build`. A production build and its runtime output carry no RPC server, no WebSocket endpoint, and none of the injected page scripts or launcher code.
126
+ **Copy as Markdown** in the detail header copies the visit, its features, its error, and the page JSON, ready to paste into an issue or an AI chat. The copy contains the same redacted values the panel shows.
110
127
 
111
- ## Page scripts and panel apps
128
+ The initial page load arrives inside the HTML, so it has no response body and no headers. The Headers tab and the Response tab fill in for visits that go through XHR.
112
129
 
113
- The package has two halves. Page scripts run in the app's own page and capture what happens there. Panel apps run in iframes inside the dock and render what the page scripts publish. The two talk over `devframe/in-page-channel`, a `postMessage` channel between the page and the iframes the dock hosts for it.
130
+ #### Feature badges
114
131
 
115
- ```
116
- app page (browser) dock iframe
117
- page script (injected into the client entry) panel app (/__storefront-devtools/panels/)
118
- DOM-event capture (inertia:*) ?view=inertia | orpc | storefront
119
- -> Correlator -> RequestRecords
120
- history-capture (pushState/replaceState)
121
- network timing (PerformanceObserver)
122
- -> DevToolsStore
123
- createPageScriptChannel() ── state snapshots ──▶ connectPanelChannel()
124
- ◀── getState, clear, mirrors the latest
125
- setPaused ─────── snapshot into a Vue ref
126
- ```
132
+ A badge marks each Inertia feature active on a visit: partial reload, deferred props, the merge, deep-merge, and prepend strategies, scroll regions, once props, prefetch, cached (a prefetch hit that skipped the network), flash data, remembered state, encrypted history, and clear history. Hover or focus a badge to read its description and a link to the matching Inertia docs.
127
133
 
128
- ### Capture in the app page
134
+ #### Diagnostics
129
135
 
130
- On load, the Inertia page script builds a `DevToolsStore` and feeds it from three sources, none of which change how Inertia behaves:
136
+ Diagnostics flag common mistakes:
131
137
 
132
- - Inertia 3.x's `inertia:*` DOM events, through `document.addEventListener`. The script copies each event's detail with a depth limit, drops functions and abort signals, and hands it to the store. It doesn't patch `router.on()`.
133
- - A `PerformanceObserver` over resource-timing entries, matched to in-flight requests by URL.
134
- - A `history.pushState` / `replaceState` patch that catches client visits (`router.push` / `router.replace`) that skip the normal Inertia event lifecycle.
138
+ - an asset version mismatch that forced a 409 reload, as Inertia's `inertia:location` event reports it
139
+ - a canceled or interrupted visit
140
+ - a prop you requested with `only` that the response left out
141
+ - validation errors lost because `only` didn't include `errors`
142
+ - deferred props that failed to load
143
+ - a history replace to the same URL
135
144
 
136
- Every handler runs inside a guard, so a devtools error can't crash the app.
145
+ Each diagnostic links to the relevant documentation.
137
146
 
138
- ### Correlation
147
+ #### Toasts in the dock
139
148
 
140
- A correlator groups the raw events into one `RequestRecord` per visit. It matches events by a visit fingerprint plus a pointer to the active visit, and it handles deferred prop reloads, prefetch cache hits, POST→redirect flows, 409 asset-version mismatches, and the initial page load. The store keeps the latest 200 records and saves a compact summary to `sessionStorage`, so the requests from before a reload stay visible.
149
+ Some Inertia.js mistakes fail without a sound. When a partial reload asks for a prop with `only` and the response leaves it out, or a deferred prop fails to load, the page renders without that data and the browser console stays quiet. The Inertia.js panel already flags these, but only while you look at it. The toasts bring these warnings to you while you work on a page, and one click takes you to the request.
141
150
 
142
- ### oRPC capture
151
+ Storefront Application V3 uses partial reloads and deferred props on many of its pages, so these mistakes are easy to make there. The toasts reuse the panel's existing rules, run in the dev server only, and need no setup.
143
152
 
144
- The oRPC panel follows the same shape with its own store and page script. The page script patches `window.fetch` once on load. For each request whose path starts with `/api`, it records one `OrpcCall`: the procedure name (the path after `/api`), the input from the request body, and, once the response arrives, the output, status, duration, and any error. Every other fetch passes through untouched, and the app always gets the original response or rejection, so the patch can't break a real request. The store keeps the latest 200 calls, classifies each failure as validation, server, or network, and saves a previous-session summary the way the Inertia store does. It keeps each input, output, and error in two forms: decoded to typed values, and as the raw `{ json, meta }` envelope, which the Data tab can show too.
153
+ The version mismatch, the missing partial-reload prop, the filtered validation errors, and the failed deferred props are warnings or errors. Each one also shows up as a toast in the bottom-right corner of the page, so you see it without opening the Inertia.js tab. The toast names the rule, the request method, and the path, and its **Open Inertia Panel** button opens the panel. A rule shows once per visit. The notes on canceled, interrupted, and history-replace visits stay in the panel only. Toasts appear once you have authorized the dock in that browser. A diagnostic found before that shows with the next visit after you authorize it. The toasts also collect in the Messages dock, see below. Click a toast to open it there.
145
154
 
146
- ### Publishing to the panels
155
+ The toasts cover only the warning and error rules above, once per visit, and they disappear after a few seconds. The Messages dock keeps them. They catch a mistake in a visit that happens. They don't check visits you never trigger, so they are no replacement for tests.
147
156
 
148
- Each page script opens its own channel (`storefront-devtools:inertia`, `storefront-devtools:orpc`) and pushes a snapshot of its store to the connected panels whenever the store changes. It sends at most one snapshot per 16 ms, so a burst of Inertia events costs one message instead of twenty. A timer paces this rather than `requestAnimationFrame`, because the browser pauses animation frames in a hidden tab, and the dock can sit in a Picture-in-Picture window while the app's tab is in the background. A panel that opens later asks for the current snapshot with `getState`. **Pause** and **Clear** reach the store the same way, as channel calls.
157
+ #### Page tab
149
158
 
150
- Snapshots cross the channel through structured clone, which rejects functions, so the page scripts run captured values through `safeClone` before they store them. The channel stays inside one browser tab, so two open tabs never see each other's requests.
159
+ The Page tab shows the current page props as a collapsible tree, with the page-level feature badges. Use it to inspect what your component renders right now, apart from any single visit.
151
160
 
152
- ### Storefront context
161
+ #### Pausing and clearing
153
162
 
154
- Unlike the Inertia and oRPC panels, the Storefront context panel has no page script of its own. The Inertia page script serves it on a second channel, `storefront-devtools:storefront`, which carries only the current Inertia page and sends a new snapshot only when that page changes. The panel shows what the Inertia store has already captured, nothing more.
163
+ Pause stops capture so a busy page doesn't flood the list while you read a visit. Resume continues from that point. Clear empties the list. The panel remembers the active top-level tab, the type, method, and status filters, the list width, and the rows you opened in the Response tab and the Page tab, but not the URL search. It keeps them in `sessionStorage` for the browser tab, and ignores a stored value it can't read.
155
164
 
156
- ### Panel apps
165
+ ### oRPC panel
157
166
 
158
- The dock loads every panel as an `iframe` entry. The package builds one small Vue app for the three storefront panels and serves it, together with the Vue DevTools UI, from `/__storefront-devtools/` on the dev server. The `?view=` query picks the panel the app mounts. Each iframe is its own document, so the panel styles never touch the app, and the panel's own Vue instance stays out of the app's Vue DevTools. The dock keeps a hidden panel's iframe alive while you use another entry, and that panel keeps receiving snapshots.
167
+ The Storefront Application V3 changes state through oRPC calls to `/api`: add to basket, toggle the wishlist, apply a promotion code, run a search. The oRPC panel shows them as calls, labeled by procedure.
159
168
 
160
- ## Panels
169
+ It has a **Calls** tab and a **Stats** tab. **Pause** and **Clear** sit in the top bar.
161
170
 
162
- ### Inertia.js panel
171
+ #### Calls tab
163
172
 
164
- Inertia drives navigation over XHR and swaps page props without a full reload, so the browser Network tab shows you raw JSON and nothing about the visit itself. This panel reads the Inertia lifecycle and shows you the visit. It's the main reason the package exists.
173
+ The list shows each call as it fires, with its method, procedure (`basket/add`, `wishlist/remove`, and so on), a status badge, and the duration. The badge is green for success, amber for a validation error, and red for a server or network error. Filter by domain (the first path segment, such as `basket` or `search`) or type into the box to match a procedure. A collapsible **Previous session** block keeps the calls from before a reload. Like the Inertia.js list, the call list widens from the grip in its bottom corner.
165
174
 
166
- It opens on the **Requests** tab and has a second **Page** tab. A top bar holds **Pause** and **Clear**.
175
+ Select a call to see its overview and two tabs:
167
176
 
168
- #### Requests tab
177
+ - **Data** shows the input and the output as collapsible trees. A failed call shows its error instead, with the oRPC code, status, message, and data. When the decoded value differs from the wire format, for example because it holds a `Date` or a `Map`, a toggle switches an input or output to the raw `{ json, meta }` envelope. A streaming response shows a note in place of a body.
178
+ - **Headers** shows the request and response headers as tables.
169
179
 
170
- The left side lists each visit as it happens: method, URL, visit type, timing, and a badge for any diagnostics. Filter by type (full, partial, deferred, prefetch, redirect, client), or type into the URL box to narrow the list. Deferred reloads nest under the visit that triggered them, so you can see which page started which background load. Once the list passes 200 visits, a footer tells you how many older ones dropped off. After a reload, a collapsible **Previous session** block keeps the visits from before it, because a full reload would otherwise empty the list. This tab answers "did that click fire a visit, and what kind?"
180
+ **Copy as curl** copies a runnable `curl` command with the JSON body. **Copy as markdown** copies the call for an issue or an AI chat.
171
181
 
172
- Select a visit and the right side shows its detail in four tabs:
182
+ #### Stats tab
173
183
 
174
- - **Response** shows the props captured for that visit, each tagged with how it arrived (full, partial, deferred, merged, prepended, or deep-merged). It notes any prop you asked for with `only` that the response left out, and counts the props carried over unchanged from the previous page. The **Show changes since last page** toggle switches to a before/after diff that marks added keys, removed keys, and changed values. Use it to confirm a partial or deferred reload returned the prop you asked for, or to spot a prop that changed when it shouldn't have.
175
- - **Headers** shows the request and response headers of that visit as a table. The store redacts credential headers (`authorization`, `cookie`, and similar) before it saves anything.
176
- - **Network** shows the Inertia protocol side of the request: asset version, the `only` / `except` partial-reload keys, the `errorBag` name, reset keys, and resource timing and transfer size when the browser recorded them. Use it to check that a partial reload sent the right `only` set, or to see how long a visit spent on the network.
177
- - **Events** shows a lifecycle timeline (`before`, `start`, `success`, `finish`, and the rest) with each step's offset in milliseconds from the first event, colored by outcome. Below the timeline sits every captured event with its full payload as a collapsible tree. Come here to debug a visit that hung, got canceled, or fired events in an order you didn't expect.
184
+ The Stats tab lists every procedure with its call count, error count, average duration, and last duration. Sort by count to find the procedure a page fires ten times, or by average to find the slow one.
178
185
 
179
- The detail header also has **Copy as Markdown**, which copies the visit (header, features, error, and the raw page JSON) for pasting into an issue or an AI chat.
186
+ ### Storefront context panel
180
187
 
181
- Above the tabs, the detail shows an overview (method, URL, type, status, component, duration, and the redirect URL on a 409), the active feature badges, and any diagnostics.
188
+ A read-only view of what the app resolved for the current page:
182
189
 
183
- #### Feature badges
190
+ - Shop and locale: tenant space, shop key, domain, country, locale, currency, shop-country ID, default country, country selector, available countries and languages, whether consent is required, and the OAuth client ID.
191
+ - Session: whether the customer is logged in, whether the session is a guest session, and the customer groups.
192
+ - Page: the current URL, the page version, and the public fields the SDK sends to the client for the config and for the country.
184
193
 
185
- Feature badges mark the Inertia features active on a visit: partial reload, deferred props, the merge, deep-merge, and prepend strategies, scroll regions, once props, prefetch, cached (a prefetch hit that skipped the network), flash data, remembered state, encrypted history, and clear-history. Click a badge to see its description and a link to the matching Inertia docs, so you don't have to remember what each one means.
194
+ The panel reads the Inertia page the SDK ships, so it shows no secrets and no session token. Use it to check which shop, country, and locale a request resolved to without digging through page props.
186
195
 
187
- #### Diagnostics
196
+ ### Messages dock
188
197
 
189
- Diagnostics flag common mistakes on a visit: an asset-version mismatch that forced a 409 reload, a canceled or interrupted visit, a partial-reload prop you requested that the response left out, validation errors lost because an `only` option didn't include `errors`, deferred props that failed to load, and a history replace to the same URL. Each one links to the relevant docs.
198
+ The Messages dock lists every message the dock received, including the Inertia.js diagnostics behind the toasts. Its button shows up in the dock bar with the first message and stays hidden until then. Select an entry to read it in full, with an **Open Inertia Panel** button that jumps to the panel. You can search the list, filter it by level, source, and label, delete single entries, or dismiss all of them. It lasts as long as the dev server runs, so a diagnostic you missed while its toast was up is still there.
190
199
 
191
- #### Page tab
200
+ The dev server keeps one feed for every browser tab connected to it. A toast and its entry show in each open tab, also for a visit another tab made, while each tab's Inertia.js panel holds only its own visits. After a reload, the Open Inertia Panel button of an older entry does nothing until you have opened the SCAYLE Storefront group once in the new page. An entry sent before the panel first loaded in a page opens the panel on the tab you picked last, so it can land on oRPC or Storefront instead of Inertia.js. This is the upstream Messages dock of Vite DevTools. The rest of the upstream docks, such as Terminals and the Inspector, stay off.
192
201
 
193
- The Page tab shows the current page props as a collapsible tree, with the page-level feature badges. Use it to inspect the props your component renders right now, apart from any single visit.
202
+ ### Vue DevTools
194
203
 
195
- #### Pausing and clearing
204
+ The **Vue DevTools** entry is the full Vue DevTools UI from `vite-plugin-vue-devtools` 9, the same integration Nuxt DevTools 4 uses. It covers the component tree with props and setup state, the timeline, the inspectors that Vue plugins such as vue-i18n register, and the settings. **Select component in the page** lets you click a rendered element to jump to its component. Don't add `vite-plugin-vue-devtools` to your own Vite config, this package already does. The dock's MCP endpoint stays off (`mcp: false`), so the Vue DevTools agent tools, which would read component props and setup state without the redaction the storefront panels apply, never register.
196
205
 
197
- Pause stops capture, so a busy page doesn't flood the list while you read a visit. Resume picks up new visits from that point. Clear empties the list. The panel keeps your active tab and list filter when you reopen it, but not the URL search.
206
+ The **Pages** tab lists Vue Router routes. The Storefront Application V3 routes on the server through Hono and Inertia.js, so the tab only shows `No routes`. `vite-plugin-vue-devtools` has no option to remove it, but you can hide it yourself: open the Vue DevTools settings and switch Pages off under **Tabs**. The choice is saved in your browser's `localStorage` for the app's origin, so it stays hidden until you reset the Vue DevTools settings.
198
207
 
199
- ### oRPC panel
208
+ Two more upstream behaviors are worth knowing. Hovering a component in the tree paints a highlight on the page, and that highlight can stay after you switch to another dock entry. A page reload clears it. The Vue DevTools UI also loads its DM Sans and DM Mono fonts from `fonts.googleapis.com`, so opening it sends a request to Google, and without network access it falls back to your system fonts.
200
209
 
201
- The Storefront Application V3 changes state through oRPC calls to `/api`: add to basket, toggle wishlist, apply a promotion code, run a search. In the browser Network tab they show up as POST requests with a JSON envelope for a body, mixed in with everything else the page loads. This panel shows them as oRPC calls, labeled by procedure.
210
+ `vite-plugin-vue-devtools` 9 is still a release candidate (9.0.0-rc.2). It declares `@vitejs/devtools ^0.7.6` but imports nothing from it, only types from `@vitejs/devtools-kit`, so it runs on the 0.8.0 this package uses. Your package manager reports that as an unmet peer dependency until a release declares 0.8.
202
211
 
203
- It opens on the **Calls** tab and has a second **Stats** tab. A top bar holds **Pause** and **Clear**.
212
+ ### Vite Inspect
204
213
 
205
- #### Calls tab
214
+ The **Inspect** entry is the UI of `vite-plugin-inspect` 12, the same integration Nuxt DevTools 4 offers. It lists every module Vite has loaded so far, with the plugins that touched it, and switches between the `client` and `ssr` environments. Pick a module to see its transform stack: the code after each plugin's `load` and `transform` step, with a diff to the step before. The other views show the import graph and the time each plugin and middleware takes.
206
215
 
207
- The left side lists each oRPC call as it fires: method, procedure (`basket/add`, `wishlist/remove`, and so on), a status badge, and the duration. The badge is green for success, amber for a validation error, and red for a server or network error. Filter by domain (the first path segment, such as `basket`, `wishlist`, or `search`), or type into the box to match a procedure. A collapsible **Previous session** block keeps the calls from before a reload.
216
+ Use it when a module doesn't contain what you expect, for example an alias resolves to the wrong file, an unused CMS provider directory shows up in the module list, or a plugin rewrites code it shouldn't. It also points at the plugin that makes a cold start or a hot update slow. The list only holds modules a request has loaded since the dev server started, so open the page first. The UI shows your source code to anyone the dock trusts, the same as the dev server itself. Its metrics view also lists every URL the dev server answered, query string included, without the redaction the SCAYLE Storefront panels apply. A password reset link's `hash`, for example, shows up there.
208
217
 
209
- Select a call and the right side shows its detail in two tabs:
218
+ A lot of what the Storefront Application V3 runs never appears in your own source files. `@scayle/storefront-build` turns `storefront.config.*` into the `virtual:storefront-config` module, `vite.config.ts` points the `@cms-client`, `@cms-server`, and `@cms-shared` aliases at the selected `CMS_PROVIDER`, and this package prepends its page scripts to `src/client/main.ts`. Inspect shows the result per module: what a virtual module contains, which file an alias resolved to, and what the client entry looks like after every plugin ran. The `client` and `ssr` switch shows which modules the browser loads and which the server render runs through Vite, so a server-only import that reaches the client graph stands out.
210
219
 
211
- - **Data** shows the request input and the success output as collapsible trees. For a failed call it shows the **Error** instead, with its oRPC code, status, message, and data. A streaming response shows a note in place of a buffered body.
212
- - **Headers** shows the request and response headers of that call as a table. The store redacts credential headers and sensitive input fields (passwords, tokens, and similar) before it saves anything.
220
+ These plugins ship inside SCAYLE packages, so without Inspect you'd have to read their source to see what they do to your code. That's why `storefrontDevtools()` includes it: there is nothing to install or configure, and like the rest of this package it stays out of production builds.
213
221
 
214
- The overview above the tabs shows the procedure, method, URL, status, duration, and the error kind for a failed call.
222
+ Inspect answers build and transform questions only. It doesn't show runtime state, such as page props, the session, or the requests a page makes. The Inertia.js, oRPC, and Storefront panels and Vue DevTools cover those.
215
223
 
216
- The detail header has **Copy as curl**, which copies the call as a runnable `curl` command with its JSON body, for replaying it in a terminal or pasting it into an issue.
224
+ Inspect keeps the output of every plugin step for every module it has seen, per environment, in the dev server's memory for the whole session, whether you open the entry or not. An edit replaces the entries of the changed module, so the memory grows with the number of modules, not with every edit. To turn Inspect off, filter it out of the returned plugins by name:
217
225
 
218
- #### Stats tab
226
+ ```ts
227
+ export default defineConfig({
228
+ plugins: [
229
+ vue(),
230
+ ...storefrontDevtools().filter(
231
+ (plugin) =>
232
+ !(plugin && 'name' in plugin && plugin.name === 'vite-plugin-inspect'),
233
+ ),
234
+ // storefrontBuild(...) and the other plugins, as in the setup example
235
+ ],
236
+ })
237
+ ```
219
238
 
220
- The Stats tab lists every procedure with its call count, average duration, and last duration. Sort by count to find the chatty procedure a page fires ten times, or by average to find the slow one.
239
+ ### Open Graph viewer
221
240
 
222
- #### Pausing and clearing
241
+ The **Open Graph** entry is the viewer from `@devframes/plugin-og`, the same one Nuxt DevTools 4 ships. It lists the head metadata of the page the app shows: the title, the description, the canonical link, the `hreflang` alternates, and the `og:*` and `twitter:*` tags. It flags the tags a link preview would miss and draws the card the way Twitter, Facebook, LinkedIn, and Telegram show it. The URL field follows the page in the app, client-side visits included. Enter another path to inspect that page instead.
223
242
 
224
- Pause stops capture while you read a call. Clear empties the list.
243
+ Use it while you build or change a page. The Storefront Application V3 builds the page meta in its controllers, and shops adjust it per page type, such as product detail, product listing, and CMS pages. A missing or wrong tag shows up on your machine, before a release, without deploying the page or opening an external link preview debugger. The viewer runs on the dev server only and needs no setup in the app.
225
244
 
226
- ### Storefront context panel
245
+ Know these limits:
246
+
247
+ - The viewer doesn't read the page in your browser. The dev server fetches the URL with Node's `fetch` and parses the HTML that comes back, so you see what the controllers render into the SSR response. The request carries no cookies, which shows the page the way a signed-out user and a link preview crawler get it.
248
+ - The previews are drawn from the tags, not fetched by the platforms. A real crawler can still show something else, for example a card it cached earlier or no image because it can't download the one in `og:image`.
249
+ - Node has to trust the dev server's TLS certificate, and by default it ignores the system keychain that `mkcert -install` writes to. The viewer then reports `unable to verify the first certificate`. Start the dev server with `NODE_USE_SYSTEM_CA=1`, or set `NODE_EXTRA_CA_CERTS` to the path that `echo "$(mkcert -CAROOT)/rootCA.pem"` prints.
250
+ - While the viewer is open, every visit in the app makes the dev server render the page a second time, without cookies. That shows up as an extra request in traces and logs, so close the viewer before you trace or profile a request.
251
+ - In the dock's Popup mode, the viewer can't follow the app page. Its URL field shows `blank` and the fetch fails with `ENOTFOUND blank`. Enter an absolute URL, such as `https://localhost:3000/de/wishlist`, or switch back to Float or Edge mode.
252
+ - The **Nuxt snippet** tab of the suggestions offers a `useSeoMeta` call for Nuxt. It doesn't apply here. Set missing tags in the page meta that the controller builds.
227
253
 
228
- A read-only view of the resolved shop, country, locale, and session for the current page, plus the config public fields the SDK sends to the client. It shows only what the Inertia page props already contain, so it never renders secrets or the full session token. Use it to check which shop, country, and locale the app resolved for a request without digging through page props.
254
+ The viewer lives in its own dock entry, outside the SCAYLE Storefront group, and its UI ships in `@devframes/plugin-og--assets`, so nothing is downloaded from a CDN at runtime.
229
255
 
230
- ### Vue
256
+ ## Captured data
231
257
 
232
- The Vue DevTools component tree and timeline, in a **Vue** dock group next to the SCAYLE Storefront group. It replaces a separate `vite-plugin-vue-devtools` install. Every panel in this package runs as an iframe app. The Vue panels load the `@vue/devtools-applet` UI, which reaches the app page over a `BroadcastChannel` RPC bridge. The storefront panels use the package's own panel app.
258
+ ### Redaction
233
259
 
234
- Click-to-inspect, where you click a rendered element to jump to its component in the tree, isn't included. It needs `vite-plugin-vue-inspector` in the app's own Vite config, and this package doesn't add it.
260
+ The panels never show credentials. Every capture path in the store replaces the value of a key whose name contains `password`, `passphrase`, `secret`, `token`, `jwt`, `credential`, `authorization`, `cookie`, `session-id`, or `api-key` (also `api_key`, `apikey`, and `session_id`, case-insensitive) with `[redacted]`. This covers page props, flash data, form data, response props, headers, and oRPC input and output. The oRPC panel also redacts `code` for `auth/exchangeAuthCode`, where it carries an OAuth code.
235
261
 
236
- ## Architecture notes
262
+ Request and response headers follow the same rule. A header such as `authorization`, `cookie`, `x-api-key`, or `x-auth-token` is dropped from the captured headers, and shows as `[redacted]` inside an event's `visit.headers`.
237
263
 
238
- Each panel that captures live app state (Inertia, oRPC) splits into three parts. `src/<feature>/core/` is plain TypeScript with no Vue import, and handles capture, classification, diffing, diagnostics, and persistence. `src/<feature>/client/` is the page script: it runs the core in the app page and publishes the store over `devframe/in-page-channel`. `src/<feature>/panel/` holds the Vue components that render it. Both features share panel UI (`TreeView`, the clipboard helper, panel styles) and generic building blocks (snapshot pacing, snapshot mirroring, `sessionStorage` persistence) from `src/shared/`.
264
+ Two details to know:
239
265
 
240
- The storefront panels load from `/__storefront-devtools/panels/`, one iframe per view, and the Vue DevTools UI loads from `/__storefront-devtools/vue/`. The panel styles are dark-mode only. Each panel runs in its own iframe document, so its styles never leak into the host application.
266
+ - Matching works on key names only. A credential inside a value, such as a token in a URL query string, isn't detected.
267
+ - Dock toasts carry the request path without its query string or hash, and no header or prop values.
268
+ - Validation messages stay readable. The `inertia:error` event keeps its error bag as is, so `errors.password: "Must be 8 characters"` shows in the Events tab. The error bag in a response's page props is still redacted by key.
269
+
270
+ A prop whose name matches, such as `token` or `cookieConsent`, shows as `[redacted]` even when it holds harmless data. Rename the prop if you need to read it in the panel.
271
+
272
+ ### Limits and persistence
273
+
274
+ | What | Limit |
275
+ | ----------------------------- | ------------------------------------------------------ |
276
+ | Inertia requests kept | 200, the oldest drop first |
277
+ | oRPC calls kept | 200, the oldest drop first |
278
+ | Events per Inertia request | 100, upload `progress` events drop first |
279
+ | Depth of a captured value | 10 levels, deeper values show as `[too deep]` |
280
+ | Previous session after reload | Summaries only, kept in `sessionStorage` for 5 minutes |
281
+ | Snapshot rate to the panels | One per 16 ms, none while no panel is open |
282
+
283
+ Each browser tab keeps its own capture. Two open tabs never see each other's requests.
284
+
285
+ ## Security and browser authorization
286
+
287
+ The dock in the browser talks to the Vite dev server over a WebSocket RPC channel (`@devframes/hub`, with `crossws` as its transport layer). Your panels share that channel with RPC functions from `@vitejs/devtools` that reach into your machine, for example `vite:core:open-in-editor`, which opens any file path in your editor, a terminals feed, and the Open Graph viewer's `devframes:plugin:og:resolve-metadata`, which makes the dev server fetch any HTTP or HTTPS URL. This package sets `builtinDevTools: false`, which drops the upstream Terminals and Inspector docks and their UI. The Messages dock is the one upstream dock it brings back, see [Messages dock](#messages-dock). The RPC declarations behind them stay, because they belong to `@vitejs/devtools` and a consumer can't remove them. Two independent checks protect the channel.
288
+
289
+ ### Origin allowlist
290
+
291
+ `@vitejs/devtools` accepts a WebSocket connection only when its `Origin` header matches a built-in loopback allowlist (`localhost`, `127.0.0.1`, and similar). The check compares strings. It doesn't resolve DNS or read your hosts file, so a custom dev hostname that points at loopback through `/etc/hosts` or a local DNS override (for example `dev-my-app.example.com`) gets rejected by default. Add such an origin with the `allowedOrigins` option:
292
+
293
+ ```ts
294
+ ...storefrontDevtools({ allowedOrigins: ['https://dev-my-app.example.com'] }),
295
+ ```
296
+
297
+ Set it on `storefrontDevtools()`, not as `devtools: { allowedOrigins }` in the app's Vite config. This package registers the dock host itself, so turning on Vite's `devtools` option registers the dock a second time, and Vite stops with `DTK0034`. Turning off the one-time code below doesn't help here either, because the origin check runs on its own.
298
+
299
+ ### One-time client authorization
300
+
301
+ On top of the origin check, `@vitejs/devtools` puts the RPC connection behind a one-time code by default (`clientAuth: true`). The first time a new browser connects, the `pnpm dev` terminal prints `devframe auth code <code>` and a magic-link URL (`...#devframe_otp=<code>`). Enter the code in the dock's prompt, or open the printed URL, to authorize that browser. The dock stays unauthorized until you do.
302
+
303
+ ### Turning off the authorization check
304
+
305
+ `storefrontDevtools({ clientAuth: false })`, or the `VITE_DEVTOOLS_DISABLE_CLIENT_AUTH=true` environment variable, skips the one-time code. As with `allowedOrigins`, set it on `storefrontDevtools()` and not as Vite's own `devtools` option. The `@vitejs/devtools` documentation warns about this: _"if you disable client authentication, any browsers can connect to the devtools and access to your server and filesystem (including other devices, if you open server `host` option to LAN or WAN)."_ Turn it off only where every request comes from a trusted developer. Never do it with `server.host` bound to a LAN or WAN interface, in a shared environment, or anywhere close to production.
306
+
307
+ ### Production safety
308
+
309
+ The plugin that adds imports to your client entry, the Vue DevTools plugins, the Inspect plugin, and the Open Graph viewer set `apply: 'serve'`, so Vite skips them in `vite build`. The dock host opens its WebSocket RPC server from the `configureServer` hook, which Vite calls for `vite dev` and never for `vite build`. The upstream build-time injection options (`devtools.build.withApp` and `devtools.build.injection`) default to off, and this package doesn't turn them on. A production build and its runtime output carry no RPC server, no WebSocket endpoint, and none of the injected page scripts or launcher code.
310
+
311
+ ## How it works
312
+
313
+ The package has two halves. Page scripts run in the app's own page and capture what happens there. Panel apps run in iframes inside the dock and render what the page scripts publish. The two talk over `devframe/in-page-channel`, a `postMessage` channel between the page and the iframes the dock hosts for it.
314
+
315
+ ```
316
+ app page (browser) dock iframe
317
+ page script (injected into the client entry) panel app (/__storefront-devtools/panels/)
318
+ inertia:* DOM events one dock tab per view: inertia | orpc | storefront
319
+ interceptors (headers, response props)
320
+ history capture (pushState/replaceState)
321
+ network timing (PerformanceObserver)
322
+ -> Correlator -> RequestRecords -> DevToolsStore
323
+ createPageScriptChannel() ── state snapshots ──▶ connectPanelChannel()
324
+ ◀── getState, mirrors the latest
325
+ getRequest/getCall, snapshot into a Vue ref,
326
+ clear, setPaused ─ loads the selected item
327
+ ```
328
+
329
+ ### Inertia capture
330
+
331
+ The Inertia page script builds a `DevToolsStore` and feeds it from four sources. None of them change how Inertia behaves.
332
+
333
+ - Inertia 3's `inertia:*` DOM events, through `document.addEventListener`. The script doesn't patch `router.on()`. It copies each event's detail with a depth limit, drops functions and abort signals, and redacts credentials before the store sees the data.
334
+ - Inertia's interceptor registry, `window.__inertia_interceptors__`, for the request headers and the response props. `createInertiaApp` exposes the registry in dev mode, and the script polls for it every 100 ms for up to 10 seconds. Without the registry, the Headers tab and the response props stay empty.
335
+ - A `history.pushState` and `replaceState` patch that catches client visits (`router.push`, `router.replace`) that skip the Inertia event lifecycle. It tracks the server visits still in flight by their Inertia visit id and treats a changed page as one of their writes, so a visit that ends without a history write (a 409 redirect, a network error, or a `before` listener that cancels the visit) doesn't hide the next client visit. Writes that leave the page unchanged, such as `router.remember()`, never count as visits.
336
+ - A `PerformanceObserver` over resource timing entries, matched to in-flight requests by URL.
337
+
338
+ Every handler runs inside a guard, so a devtools error can't crash the app.
339
+
340
+ ### Correlation
341
+
342
+ A correlator groups the raw events into one `RequestRecord` per visit. It matches an event by the visit fingerprint, then by the visit id that `navigate`, `success`, and `error` events carry, and falls back to the most recently started visit for events without one. It handles deferred prop reloads, prefetch cache hits, POST to redirect flows, 409 location visits (`inertia:location`, which says whether the asset version changed), and the initial page load. Browser back and forward navigation restores a page from history without a request, so it updates the current page but adds no record. The store keeps the latest 200 records and saves a compact summary to `sessionStorage`.
343
+
344
+ ### oRPC capture
345
+
346
+ The oRPC page script patches `window.fetch` once on load. For each request whose path starts with `/api`, it records one call: the procedure name (the path after `/api`), the input from the request body, and, once the response arrives, the output, status, duration, and any error. Every other fetch passes through untouched, and the app always gets the original response or rejection, so the patch can't break a real request. The store keeps the latest 200 calls and classifies each failure as a validation error (a 422 or an `INPUT_VALIDATION_FAILED` body), a network error (a thrown fetch), or a server error. It keeps each input, output, and error in two forms: decoded to typed values, and as the raw `{ json, meta }` envelope.
347
+
348
+ ### Publishing to the panels
349
+
350
+ Each page script opens its own channel (`storefront-devtools:inertia`, `storefront-devtools:orpc`) and pushes a snapshot of its store to the connected panels, at most one per 16 ms. A snapshot lists each request or call with only the fields the list shows and filters on, such as the method, URL, type, status, and timing. The panel loads the full record of the selected item with `getRequest` (Inertia) or `getCall` (oRPC), and loads it again after each snapshot while it stays selected and its view is on screen. A view counts as off screen while another storefront tab is shown or the dock is closed. A different dock entry opened in front of the storefront panels hides them without the panels noticing, so the selected item keeps loading then. While no panel is connected, the page scripts keep capturing but build no snapshots. A panel that opens later gets the current snapshot as it connects, and asks for it with `getState` after a reconnect. Pause and Clear reach the store as channel calls. Snapshots cross the channel through structured clone, so the page scripts copy every captured value with `safeClone` first. The Storefront context panel has no page script of its own. The Inertia page script serves it on a second channel, `storefront-devtools:storefront`, which sends the current page only when it changes. The Page tab of the Inertia panel reads the current page from that channel too, so the Inertia snapshots leave it out.
351
+
352
+ The package builds one small Vue app for the three storefront panels and serves it from `/__storefront-devtools/`. The three panels share one dock iframe, so their styles never touch your app. The panel app announces each panel to the dock as its own tab, and picking a tab switches the view inside that iframe instead of loading another one. A view mounts the first time you open it and stays mounted, so it keeps its selection and filters and keeps receiving snapshots while another tab is open. `/__storefront-devtools/panels/#orpc` (or `#inertia`, `#storefront`) opens a view outside the dock. Without a hash it opens the Inertia.js view, and a hash that names no view shows an `Unknown Storefront DevTools view` message. The panel styles are dark mode only. The dock tab icons come in a light and a dark variant, so they stay visible in either dock color scheme.
353
+
354
+ The tabs follow the WAI-ARIA tabs pattern: the arrow keys, Home, and End move between tabs, and only the selected tab is in the tab order. In the request and call lists, the up and down arrow keys move the selection.
355
+
356
+ ## Development
357
+
358
+ The layout, the rules that keep the panels correct, and the test setup are in [CLAUDE.md](./CLAUDE.md). After a change to the injection, the build, or a panel, run the Storefront Application V3 with `pnpm dev` and open every panel, because unit tests and builds don't exercise the dock itself.
241
359
 
242
360
  ## Upstream stability
243
361
 
244
- `@vitejs/devtools` and `@vitejs/devtools-kit` are still `0.x` releases, so any minor version can ship a breaking change without a deprecation period. `@devframes/hub` and `@devframes/hub-ui` reached 1.0.0 in September 2026. If you upgrade any of them:
362
+ `@vitejs/devtools` and `@vitejs/devtools-kit` are `0.x` releases, so any minor version can ship a breaking change without a deprecation period. This package pins both to the same version in the workspace catalog and currently uses 0.8.0. `@devframes/hub` and `@devframes/hub-ui` reached 1.0 in September 2026 and arrive as transitive dependencies of `@vitejs/devtools`. A routine `pnpm update` can move them without any `@vitejs/devtools` bump. They resolve to 1.2.6 today, next to `devframe` 1.3.0, the library behind the page-script channel. `@devframes/plugin-og` and `@devframes/plugin-og--assets` are pinned to the same version, because the plugin declares an exact `devframe` peer. Upstream marks the plugin's API as experimental, so it can change in a patch release. Read its changelog on every bump.
363
+
364
+ When you upgrade any of these packages:
245
365
 
246
- - Check the peer range `@vitejs/devtools` declares against the Vite version this repository pins. `@vitejs/devtools` 0.6.x and 0.7.x have at times shipped outside the range `vite` itself declares for it, so a newer devtools version doesn't always work with the pinned Vite.
247
- - `@devframes/hub` and `@devframes/hub-ui` are transitive dependencies of `@vitejs/devtools`. A routine `pnpm update`, or a fresh install after a range widens, can move them without any `@vitejs/devtools` bump.
248
- - After any bump, run `pnpm exec vitest run`, `pnpm run build`, and `pnpm run verify-packaging` again, then open every panel in the dock. The unit tests cover this package's capture and classification logic, not the dock's runtime.
366
+ - Check the `@vitejs/devtools` peer range that `vite` declares. Vite 8.3.5 accepts `^0.7.1 || ^0.8.0`, and earlier 8.3 releases accept only `^0.7.1`, so `vite` and `@vitejs/devtools` move together.
367
+ - Read the release notes of `@vitejs/devtools` for changes to the dock host, the RPC functions, or the `DevTools()` options. This package passes `builtinDevTools` and `branding`.
368
+ - Move `@devframes/plugin-og` and `@devframes/plugin-og--assets` with `devframe`, to the same version.
369
+ - Check the `@vitejs/devtools-kit` range of `vite-plugin-vue-devtools` and `vite-plugin-inspect`, the `@vitejs/devtools` peer range of `vite-plugin-vue-devtools`, and whether the `@vitejs/devtools-kit` override in the root `pnpm-workspace.yaml` is still needed.
370
+ - Check that diagnostics still show as toasts and in the Messages dock. They depend on the hub's `hub:messages:add` RPC and on `@devframes/plugin-messages`, which registers the Messages dock and the list RPC the toasts read from. Its UI ships in `@devframes/plugin-messages--assets`, so move both packages together.
371
+ - After the bump, run the commands from the Development section, then open every panel in the dock.
249
372
 
250
373
  ## License
251
374