@scayle/storefront-devtools 0.2.0-alpha.5 → 0.2.0-alpha.7

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 (121) hide show
  1. package/CHANGELOG.md +67 -0
  2. package/LICENSE +21 -0
  3. package/README.md +107 -33
  4. package/dist/_chunks/{coalesce-MEMOF7Fy.mjs → coalesce-Ch1sV7RN.mjs} +361 -360
  5. package/dist/_chunks/frame-nav-DctWjxeG.mjs +3 -0
  6. package/dist/group.d.ts +14 -26
  7. package/dist/group.d.ts.map +1 -1
  8. package/dist/index.d.ts +29 -10
  9. package/dist/index.d.ts.map +1 -1
  10. package/dist/index.mjs +77 -106
  11. package/dist/inertia/channel.d.ts +18 -5
  12. package/dist/inertia/channel.d.ts.map +1 -1
  13. package/dist/inertia/client/index.mjs +156 -98
  14. package/dist/inertia/client/messages.d.ts +28 -0
  15. package/dist/inertia/client/messages.d.ts.map +1 -0
  16. package/dist/inertia/client/publish.d.ts +4 -2
  17. package/dist/inertia/client/publish.d.ts.map +1 -1
  18. package/dist/inertia/core/correlator.d.ts +7 -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/history-capture.d.ts.map +1 -1
  24. package/dist/inertia/core/interceptors.d.ts +1 -0
  25. package/dist/inertia/core/interceptors.d.ts.map +1 -1
  26. package/dist/inertia/core/protocol.d.ts +1 -1
  27. package/dist/inertia/core/protocol.d.ts.map +1 -1
  28. package/dist/inertia/core/request-filters.d.ts +19 -0
  29. package/dist/inertia/core/request-filters.d.ts.map +1 -0
  30. package/dist/inertia/core/request-tree.d.ts +6 -3
  31. package/dist/inertia/core/request-tree.d.ts.map +1 -1
  32. package/dist/inertia/core/response.d.ts +3 -2
  33. package/dist/inertia/core/response.d.ts.map +1 -1
  34. package/dist/inertia/core/store.d.ts +1 -0
  35. package/dist/inertia/core/store.d.ts.map +1 -1
  36. package/dist/inertia/core/types.d.ts +2 -1
  37. package/dist/inertia/core/types.d.ts.map +1 -1
  38. package/dist/inertia/core/url.d.ts +12 -0
  39. package/dist/inertia/core/url.d.ts.map +1 -1
  40. package/dist/inject.d.ts +3 -4
  41. package/dist/inject.d.ts.map +1 -1
  42. package/dist/og.d.ts +12 -0
  43. package/dist/og.d.ts.map +1 -0
  44. package/dist/orpc/channel.d.ts +9 -1
  45. package/dist/orpc/channel.d.ts.map +1 -1
  46. package/dist/orpc/client/index.mjs +30 -13
  47. package/dist/orpc/client/publish.d.ts +3 -1
  48. package/dist/orpc/client/publish.d.ts.map +1 -1
  49. package/dist/orpc/core/session.d.ts +1 -8
  50. package/dist/orpc/core/session.d.ts.map +1 -1
  51. package/dist/orpc/core/stats.d.ts +1 -1
  52. package/dist/orpc/core/stats.d.ts.map +1 -1
  53. package/dist/orpc/core/store.d.ts +1 -0
  54. package/dist/orpc/core/store.d.ts.map +1 -1
  55. package/dist/shared/clipboard.d.ts +23 -3
  56. package/dist/shared/clipboard.d.ts.map +1 -1
  57. package/dist/shared/panel-channel.d.ts +27 -1
  58. package/dist/shared/panel-channel.d.ts.map +1 -1
  59. package/dist/shared/prefs.d.ts +49 -0
  60. package/dist/shared/prefs.d.ts.map +1 -0
  61. package/dist/shared/redact.d.ts +2 -1
  62. package/dist/shared/redact.d.ts.map +1 -1
  63. package/dist/ui/assets/App-6RVVFLEC.js +4 -0
  64. package/dist/ui/assets/App-B2ZZO0Ti.js +1 -0
  65. package/dist/ui/assets/App-CBJXphAE.css +1 -0
  66. package/dist/ui/assets/App-DZWzqK2B.css +1 -0
  67. package/dist/ui/assets/App-DpdlSV8K.css +1 -0
  68. package/dist/ui/assets/App-eWdxlybE.js +5 -0
  69. package/dist/ui/assets/HeadersTab-BQDnjNCw.js +1 -0
  70. package/dist/ui/assets/HeadersTab-BUPAYMYI.css +1 -0
  71. package/dist/ui/assets/_plugin-vue_export-helper-DnlXueOW.js +2 -0
  72. package/dist/ui/assets/panels-XWiax2rN.css +1 -0
  73. package/dist/ui/assets/panels-oi-DKWXr.js +3 -0
  74. package/dist/ui/assets/store-CCDY0y91.js +1 -0
  75. package/dist/ui/panels/index.html +2 -3
  76. package/package.json +22 -26
  77. package/dist/inertia/plugin.d.ts +0 -13
  78. package/dist/inertia/plugin.d.ts.map +0 -1
  79. package/dist/orpc/plugin.d.ts +0 -13
  80. package/dist/orpc/plugin.d.ts.map +0 -1
  81. package/dist/storefront/plugin.d.ts +0 -11
  82. package/dist/storefront/plugin.d.ts.map +0 -1
  83. package/dist/ui/assets/App-25PW_NzC.css +0 -1
  84. package/dist/ui/assets/App-BHsYAu8T.js +0 -4
  85. package/dist/ui/assets/App-BqkxhJv0.css +0 -1
  86. package/dist/ui/assets/App-CQ-b0jtB.js +0 -5
  87. package/dist/ui/assets/App-Ct7Za--B.css +0 -1
  88. package/dist/ui/assets/App-DAtQapox.js +0 -1
  89. package/dist/ui/assets/_plugin-vue_export-helper-BDNMzG2s.js +0 -1
  90. package/dist/ui/assets/channel-D7V7aU79.js +0 -1
  91. package/dist/ui/assets/clipboard-Df0gl3GP.js +0 -1
  92. package/dist/ui/assets/clipboard-sKCUppVL.css +0 -1
  93. package/dist/ui/assets/css-8QJvnqUH.js +0 -1
  94. package/dist/ui/assets/css-lJZLS6R3.js +0 -1
  95. package/dist/ui/assets/diff-woXpYk--.js +0 -1
  96. package/dist/ui/assets/html-GueGcY0x.js +0 -1
  97. package/dist/ui/assets/html-WzJrCOnD.js +0 -1
  98. package/dist/ui/assets/javascript-BzbQS41l.js +0 -1
  99. package/dist/ui/assets/javascript-CpIGwZ_Y.js +0 -1
  100. package/dist/ui/assets/json-B88Oqtu5.js +0 -1
  101. package/dist/ui/assets/json-C3WlssX3.js +0 -1
  102. package/dist/ui/assets/panel-channel-BUrhmfqu.js +0 -2
  103. package/dist/ui/assets/panels-8x4hQPoN.css +0 -1
  104. package/dist/ui/assets/panels-C4yKz6cQ.js +0 -2
  105. package/dist/ui/assets/preload-helper-DLPYjEaE.js +0 -2
  106. package/dist/ui/assets/shellscript-CLZ0U2zV.js +0 -1
  107. package/dist/ui/assets/typescript-Bb1J8qyy.js +0 -1
  108. package/dist/ui/assets/typescript-j_1H8WHN.js +0 -1
  109. package/dist/ui/assets/vitesse-dark-BZCL-v6S.js +0 -1
  110. package/dist/ui/assets/vitesse-light-VbXTXTou.js +0 -1
  111. package/dist/ui/assets/vue-B1Tf5CHw.js +0 -1
  112. package/dist/ui/assets/vue-CEnfmNPK.js +0 -155
  113. package/dist/ui/assets/vue-Kq4tvBbL.css +0 -1
  114. package/dist/ui/assets/vue-html-CGMs_6qn.js +0 -1
  115. package/dist/ui/assets/yaml-rwi0_p6S.js +0 -1
  116. package/dist/ui/vue/index.html +0 -15
  117. package/dist/vue-devtools/client/index.mjs +0 -4864
  118. package/dist/vue-devtools/client.d.ts +0 -2
  119. package/dist/vue-devtools/client.d.ts.map +0 -1
  120. package/dist/vue-devtools/plugin.d.ts +0 -15
  121. package/dist/vue-devtools/plugin.d.ts.map +0 -1
@@ -0,0 +1,3 @@
1
+ // src/ui/panels/frame-nav.ts
2
+ var e = "storefront-devtools:panels", t = "inertia";
3
+ export { e as n, t };
package/dist/group.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { Plugin } from 'vite';
2
+ import { PluginWithDevTools } from '@vitejs/devtools-kit';
2
3
  /** SCAYLE brand purple. Drives the dock's primary ramp and tints the group launcher. */
3
4
  export declare const SCAYLE_PRIMARY_COLOR: string;
4
5
  /**
@@ -12,39 +13,26 @@ export declare const STOREFRONT_GROUP_ICON: string;
12
13
  * Route the dock loads every iframe page from. `@scayle/storefront-build`
13
14
  * excludes it from the Hono dev server, so the country redirect leaves it alone.
14
15
  */
15
- export declare const UI_ROUTE = "/__storefront-devtools/";
16
+ export declare const UI_ROUTE: string;
16
17
  /**
17
18
  * Creates the Vite plugin that registers the "SCAYLE Storefront" dock group
18
- * and serves the iframe pages under {@link UI_ROUTE}. Panels (Inertia, oRPC,
19
- * Storefront) attach to the group through {@link createPanelPlugin}, so the
20
- * dock renders a single grouped launcher instead of one button per panel.
19
+ * and serves the iframe pages under {@link UI_ROUTE}. The group holds one
20
+ * shared iframe for the Inertia, oRPC, and Storefront panels. The panel app in
21
+ * it announces each panel as a dock tab over the hub's frame-nav protocol (see
22
+ * `src/ui/panels/frame-nav.ts`), so switching tabs shows another view in the
23
+ * same document instead of loading another iframe.
21
24
  *
22
25
  * @returns A Vite plugin with a `devtools.setup` hook.
23
26
  */
24
27
  export declare function createGroupPlugin(): Plugin;
25
28
  /**
26
- * Views the panel app can mount. `VIEWS` in `src/ui/panels/main.ts` is typed
27
- * from this union, so the compiler flags a view added to one but not the other.
28
- */
29
- export type PanelView = 'inertia' | 'orpc' | 'storefront';
30
- /** Options for an iframe panel registered via {@link createPanelPlugin}. */
31
- export interface PanelPluginOptions {
32
- /** Dock entry id, e.g. `storefront-devtools:inertia`. */
33
- id: string;
34
- /** Dock launcher title, e.g. `Inertia.js`. */
35
- title: string;
36
- /** Dock launcher icon, a data URI or Iconify name. */
37
- icon: string;
38
- /** The `?view=` value the panel app mounts for this entry. */
39
- view: PanelView;
40
- }
41
- /**
42
- * Creates the Vite plugin that registers one iframe dock entry, attached to the
43
- * "SCAYLE Storefront" group. The iframe loads the panel app served under
44
- * {@link UI_ROUTE} and mounts the view named in `options.view`.
29
+ * Registers the upstream Messages dock, the one dock that
30
+ * `builtinDevTools: false` drops and this package brings back. The dock draws
31
+ * its toasts from this plugin's list RPC, and the Inertia page script sends
32
+ * its diagnostics into that feed. The dock button stays hidden while the feed
33
+ * is empty, as in the built-in setup of `@vitejs/devtools`.
45
34
  *
46
- * @param options - The entry's id, title, icon, and view.
47
- * @returns A Vite plugin with a `devtools.setup` hook.
35
+ * @returns The Vite plugin that mounts the Messages dock.
48
36
  */
49
- export declare function createPanelPlugin(options: PanelPluginOptions): Plugin;
37
+ export declare function createMessagesDockPlugin(): PluginWithDevTools;
50
38
  //# sourceMappingURL=group.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"group.d.ts","sourceRoot":"","sources":["../src/group.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;AAWlC,wFAAwF;AACxF,eAAO,MAAM,oBAAoB,EAAE,MAAkB,CAAA;AAErD;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,EAAE,MAEjC,CAAA;AAEH;;;GAGG;AACH,eAAO,MAAM,QAAQ,4BAA4B,CAAA;AAOjD;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,CAyB1C;AAED;;;GAGG;AACH,MAAM,MAAM,SAAS,GAAG,SAAS,GAAG,MAAM,GAAG,YAAY,CAAA;AAEzD,4EAA4E;AAC5E,MAAM,WAAW,kBAAkB;IACjC,yDAAyD;IACzD,EAAE,EAAE,MAAM,CAAA;IACV,8CAA8C;IAC9C,KAAK,EAAE,MAAM,CAAA;IACb,sDAAsD;IACtD,IAAI,EAAE,MAAM,CAAA;IACZ,8DAA8D;IAC9D,IAAI,EAAE,SAAS,CAAA;CAChB;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,kBAAkB,GAAG,MAAM,CAgBrE"}
1
+ {"version":3,"file":"group.d.ts","sourceRoot":"","sources":["../src/group.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;AAKlC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AAS9D,wFAAwF;AACxF,eAAO,MAAM,oBAAoB,EAAE,MAAkB,CAAA;AAErD;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,EAAE,MAEjC,CAAA;AAEH;;;GAGG;AACH,eAAO,MAAM,QAAQ,EAAE,MAAkC,CAAA;AAOzD;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,CAyC1C;AAED;;;;;;;;GAQG;AACH,wBAAgB,wBAAwB,IAAI,kBAAkB,CAuB7D"}
package/dist/index.d.ts CHANGED
@@ -1,14 +1,23 @@
1
1
  import { PluginOption } from 'vite';
2
+ import { DevToolsConfig } from '@vitejs/devtools/config';
3
+ /**
4
+ * Dock connection options that `storefrontDevtools()` passes to
5
+ * `@vitejs/devtools`. `allowedOrigins` adds origins to the loopback allowlist
6
+ * of the dock's WebSocket. `clientAuth: false` skips the one-time code, which
7
+ * upstream warns lets any browser that reaches the dev server access your
8
+ * server and file system.
9
+ */
10
+ export type StorefrontDevtoolsOptions = Pick<DevToolsConfig, 'allowedOrigins' | 'clientAuth'>;
2
11
  /**
3
12
  * Vite plugin that orchestrates the SCAYLE Storefront Vite DevTools dock.
4
13
  * Hosts the dock and on-page launcher, registers a "SCAYLE Storefront" dock
5
- * group, and adds the Inertia visit panel, an oRPC panel, a Storefront context
6
- * panel, and a Vue DevTools panel. The dock client is injected into the
7
- * application entry, so no app code changes are needed.
8
- *
9
- * This owns the full Vue DevTools integration (backend bridge and applet UI)
10
- * and surfaces it as the dock's "Vue" entry, so the app does not add
11
- * `vite-plugin-vue-devtools` separately.
14
+ * group with the Inertia visit panel, an oRPC panel, and a Storefront context
15
+ * panel, and adds the Vue DevTools dock entry from `vite-plugin-vue-devtools`,
16
+ * the Inspect dock entry from `vite-plugin-inspect`, and the Open Graph viewer
17
+ * from `@devframes/plugin-og`.
18
+ * The dock client is injected into the application entry, so no app code
19
+ * changes are needed, and the app does not add `vite-plugin-vue-devtools`
20
+ * itself.
12
21
  *
13
22
  * @example
14
23
  * ```ts
@@ -19,8 +28,18 @@ import { PluginOption } from 'vite';
19
28
  * })
20
29
  * ```
21
30
  *
22
- * @returns The dock host, the inject plugin, and every panel plugin, to
23
- * spread into the Vite `plugins` array.
31
+ * A dev hostname other than `localhost`, such as a reverse proxy, a tunnel, or
32
+ * an `/etc/hosts` entry, needs its origin allowed for the dock connection:
33
+ *
34
+ * ```ts
35
+ * ...storefrontDevtools({ allowedOrigins: ['https://dev-my-app.example.com'] })
36
+ * ```
37
+ *
38
+ * @param options - Dock connection options passed to `@vitejs/devtools`.
39
+ * Leave them out to keep the loopback-only origin check and the one-time code.
40
+ * @returns The dock host, the inject plugin, the panel plugins, the Vue
41
+ * DevTools plugins, and the Inspect plugin, to spread into the Vite `plugins`
42
+ * array.
24
43
  */
25
- export default function storefrontDevtools(): PluginOption[];
44
+ export default function storefrontDevtools(options?: StorefrontDevtoolsOptions): PluginOption[];
26
45
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,MAAM,CAAA;AAaxC;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,CAAC,OAAO,UAAU,kBAAkB,IAAI,YAAY,EAAE,CAkD3D"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,MAAM,CAAA;AAExC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAY7D;;;;;;GAMG;AACH,MAAM,MAAM,yBAAyB,GAAG,IAAI,CAC1C,cAAc,EACd,gBAAgB,GAAG,YAAY,CAChC,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,MAAM,CAAC,OAAO,UAAU,kBAAkB,CACxC,OAAO,GAAE,yBAA8B,GACtC,YAAY,EAAE,CAwFhB"}
package/dist/index.mjs CHANGED
@@ -1,146 +1,117 @@
1
- import { DevTools as e } from "@vitejs/devtools";
2
- import { DEVTOOLS_MOUNT_PATH as t } from "@vitejs/devtools-kit/constants";
3
- import { existsSync as n } from "node:fs";
4
- import { fileURLToPath as r } from "node:url";
1
+ import { n as e } from "./_chunks/frame-nav-DctWjxeG.mjs";
2
+ import { DevTools as t } from "@vitejs/devtools";
3
+ import n from "vite-plugin-inspect";
4
+ import { vueDevtools as r } from "vite-plugin-vue-devtools";
5
+ import { existsSync as i } from "node:fs";
6
+ import { fileURLToPath as a } from "node:url";
7
+ import { PLUGIN_ID as o, createMessagesDevframe as s } from "@devframes/plugin-messages";
8
+ import { createPluginFromDevframe as c } from "@vitejs/devtools-kit/node";
9
+ import { createOgDevframe as l } from "@devframes/plugin-og";
5
10
  // src/inject.ts
6
- var i = `${t}embedded.js`, a = /src\/client\/main\.ts$/;
7
- function o(e) {
11
+ var u = /src\/client\/main\.ts$/;
12
+ function d(e) {
8
13
  return {
9
14
  name: "storefront-devtools:inject",
10
15
  enforce: "pre",
11
16
  apply: "serve",
12
17
  transform(t, n) {
13
- return a.test(n) ? `${e.map((e) => `import '${e}'`).join("\n")}
14
- ${t}
15
- if (typeof document !== 'undefined') {
16
- const s = document.createElement('script')
17
- s.type = 'module'
18
- s.src = ${JSON.stringify(i)}
19
- document.body.appendChild(s)
20
- }
21
- ` : null;
18
+ return u.test(n) ? `${e.map((e) => `import '${e}'`).join("\n")}\n${t}` : null;
22
19
  }
23
20
  };
24
21
  }
25
22
  // src/group.ts
26
- var s = "scayle-storefront", c = "#5328e1", l = "data:image/svg+xml,%3Csvg%20width%3D%2228%22%20height%3D%2228%22%20viewBox%3D%220%200%2028%2028%22%20fill%3D%22%235328E1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Crect%20width%3D%2228%22%20height%3D%2228%22%20rx%3D%227%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M14%207a7%207%200%201%201%200%2014%207%207%200%200%201%200-14Zm0%202.051c-2.625%200-4.755%202.216-4.755%204.948s2.13%204.948%204.755%204.948c2.628%200%204.755-2.215%204.755-4.948%200-.948-.255-1.834-.7-2.587l-2.106%202.15-1.518-1.55%202.137-2.178A4.6%204.6%200%200%200%2014%209.05Z%22%20fill%3D%22%23fff%22%20stroke%3D%22%23fff%22%20stroke-width%3D%22.2%22%2F%3E%3C%2Fsvg%3E", u = "/__storefront-devtools/", d = r(new URL(
23
+ var f = "scayle-storefront", p = "#5328e1", m = "data:image/svg+xml,%3Csvg%20width%3D%2228%22%20height%3D%2228%22%20viewBox%3D%220%200%2028%2028%22%20fill%3D%22%235328E1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Crect%20width%3D%2228%22%20height%3D%2228%22%20rx%3D%227%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M14%207a7%207%200%201%201%200%2014%207%207%200%200%201%200-14Zm0%202.051c-2.625%200-4.755%202.216-4.755%204.948s2.13%204.948%204.755%204.948c2.628%200%204.755-2.215%204.755-4.948%200-.948-.255-1.834-.7-2.587l-2.106%202.15-1.518-1.55%202.137-2.178A4.6%204.6%200%200%200%2014%209.05Z%22%20fill%3D%22%23fff%22%20stroke%3D%22%23fff%22%20stroke-width%3D%22.2%22%2F%3E%3C%2Fsvg%3E", h = "/__storefront-devtools/", g = a(new URL(
27
24
  /* @vite-ignore */
28
25
  "./ui",
29
26
  import.meta.url
30
27
  ));
31
- function f() {
28
+ function _() {
32
29
  return {
33
30
  name: "storefront-devtools:group",
34
- devtools: { setup(e) {
35
- n(d) ? e.views.hostStatic(u, d) : console.warn(`[storefront-devtools] Panel UI not found at ${d}. Build @scayle/storefront-devtools and restart the dev server to serve the panels.`), e.docks.register({
36
- id: s,
31
+ devtools: { setup(t) {
32
+ i(g) ? t.views.hostStatic(h, g) : console.warn(`[storefront-devtools] Panel UI not found at ${g}. Build @scayle/storefront-devtools and restart the dev server to serve the panels.`), t.docks.register({
33
+ id: f,
37
34
  title: "SCAYLE Storefront",
38
- icon: l,
35
+ icon: m,
39
36
  type: "group",
40
- accentColor: c
41
- });
42
- } }
43
- };
44
- }
45
- function p(e) {
46
- return {
47
- name: `storefront-devtools:${e.id}`,
48
- devtools: { setup(t) {
49
- t.docks.register({
50
- id: e.id,
51
- title: e.title,
52
- icon: e.icon,
37
+ accentColor: p,
38
+ defaultChildId: e
39
+ }), t.docks.register({
40
+ id: e,
41
+ title: "SCAYLE Storefront",
42
+ icon: m,
53
43
  type: "iframe",
54
- url: `${u}panels/?view=${e.view}`,
55
- groupId: s
44
+ url: `${h}panels/`,
45
+ groupId: f,
46
+ subTabs: { protocol: "postmessage" },
47
+ visibility: "false"
56
48
  });
57
49
  } }
58
50
  };
59
51
  }
60
- // src/inertia/plugin.ts
61
- var m = "data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22128%22%20height%3D%22128%22%20viewBox%3D%220%200%20128%20128%22%3E%3Cpath%20fill%3D%22%23fff%22%20d%3D%22M92.433%2028.433H55.625L91.192%2064L55.625%2099.567h36.808L128%2064zm-55.625%200H0L35.567%2064L0%2099.567h36.808L72.375%2064z%22%2F%3E%3C%2Fsvg%3E";
62
- function h() {
63
- return p({
64
- id: "storefront-devtools:inertia",
65
- title: "Inertia.js",
66
- icon: m,
67
- view: "inertia"
68
- });
69
- }
70
- // src/orpc/plugin.ts
71
- var g = "data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%23fff%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M4%207h16M4%2012h16M4%2017h10%22%2F%3E%3C%2Fsvg%3E";
72
- function _() {
73
- return p({
74
- id: "storefront-devtools:orpc",
75
- title: "oRPC",
76
- icon: g,
77
- view: "orpc"
52
+ function v() {
53
+ return c(s(), {
54
+ base: "/__storefront-devtools-messages/",
55
+ setup(e) {
56
+ let t = e.docks.views.get(o);
57
+ t && Object.defineProperty(t, "when", {
58
+ enumerable: !0,
59
+ configurable: !0,
60
+ get: () => e.messages.entries.size === 0 ? "false" : void 0
61
+ });
62
+ }
78
63
  });
79
64
  }
80
- // src/storefront/plugin.ts
81
- var v = "data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%23fff%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M3%209l1.5-5h15L21%209M4%209h16v10a1%201%200%200%201-1%201H5a1%201%200%200%201-1-1V9zM9%2020v-6h6v6%22%2F%3E%3C%2Fsvg%3E";
82
- function y() {
83
- return p({
84
- id: "storefront-devtools:storefront",
85
- title: "Storefront",
86
- icon: v,
87
- view: "storefront"
88
- });
65
+ // src/og.ts
66
+ var y = `${h}og/`;
67
+ function b(e) {
68
+ let t = e?.cause ?? e;
69
+ return t instanceof AggregateError ? t.errors.map((e) => e.message).join(", ") : t instanceof Error ? t.message : String(t);
89
70
  }
90
- // src/vue-devtools/plugin.ts
91
- var b = "data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20width%3D%2224%22%20height%3D%2224%22%3E%3Cpath%20fill%3D%22%2341b883%22%20d%3D%22M12%202%201%2021h22z%22%20opacity%3D%22.4%22%2F%3E%3Cpath%20fill%3D%22%2341b883%22%20d%3D%22M2%203h4l6%2010.5L18%203h4L12%2021z%22%2F%3E%3Cpath%20fill%3D%22%2335495e%22%20d%3D%22M6%203h3l3%205%203-5h3l-6%2010z%22%2F%3E%3C%2Fsvg%3E", x = `${u}vue/`;
92
- function S() {
71
+ function x() {
93
72
  return {
94
- name: "storefront-devtools:vue-panel",
73
+ name: "storefront-devtools:og",
95
74
  apply: "serve",
96
- devtools: { setup(e) {
97
- let t = "storefront-devtools:vue";
98
- e.docks.register({
99
- id: t,
100
- title: "Vue",
101
- icon: b,
102
- type: "group",
103
- accentColor: "#41b883",
104
- defaultChildId: "storefront-devtools:vue-components"
105
- }), e.docks.register({
106
- id: "storefront-devtools:vue-components",
107
- title: "Components",
108
- icon: b,
109
- type: "iframe",
110
- url: `${x}?view=components`,
111
- groupId: t
112
- }), e.docks.register({
113
- id: "storefront-devtools:vue-timeline",
114
- title: "Timeline",
115
- icon: b,
116
- type: "iframe",
117
- url: `${x}?view=timeline`,
118
- groupId: t
119
- });
120
- } }
75
+ devtools: { setup: (e) => e.install(l({
76
+ defaultUrl: `${e.host.resolveOrigin()}/`,
77
+ fetch: (e, t) => fetch(e, t).catch((e) => {
78
+ throw Error(b(e), { cause: e });
79
+ })
80
+ }), {
81
+ base: y,
82
+ dock: { category: "web" }
83
+ }) }
121
84
  };
122
85
  }
123
86
  // src/index.ts
124
- function C() {
87
+ function S(e = {}) {
88
+ let { allowedOrigins: i, clientAuth: a } = e;
125
89
  return [
126
- e({
90
+ t({
91
+ allowedOrigins: i,
92
+ clientAuth: a,
127
93
  builtinDevTools: !1,
94
+ mcp: !1,
128
95
  branding: {
129
96
  productName: "SCAYLE Storefront DevTools",
130
- logo: l,
131
- primaryColor: c
97
+ logo: m,
98
+ primaryColor: p
132
99
  }
133
100
  }),
134
- o([
135
- "@scayle/storefront-devtools/vue-devtools/client",
136
- "@scayle/storefront-devtools/orpc/client",
137
- "@scayle/storefront-devtools/inertia/client"
138
- ]),
139
- f(),
140
- h(),
101
+ d(["@scayle/storefront-devtools/orpc/client", "@scayle/storefront-devtools/inertia/client"]),
141
102
  _(),
142
- y(),
143
- S()
103
+ v(),
104
+ x(),
105
+ r(),
106
+ {
107
+ ...n(),
108
+ apply: "serve"
109
+ },
110
+ {
111
+ name: "storefront-devtools:optimize-deps",
112
+ apply: "serve",
113
+ config: () => ({ optimizeDeps: { include: ["@scayle/storefront-devtools > vite-plugin-vue-devtools/client"] } })
114
+ }
144
115
  ];
145
116
  }
146
- export { C as default };
117
+ export { S as default };
@@ -3,14 +3,25 @@ import { InertiaPage } from './core/protocol';
3
3
  import { RequestRecord, SessionRequestSummary } from './core/types';
4
4
  /** Channel between the Inertia page script and the Inertia panel. */
5
5
  export declare const INERTIA_CHANNEL = "storefront-devtools:inertia";
6
- /** Channel between the Inertia page script and the Storefront context panel. */
6
+ /**
7
+ * Channel that carries the page Inertia currently shows, sent only when it
8
+ * changes. The Storefront context panel and the Inertia panel's Page view read
9
+ * it.
10
+ */
7
11
  export declare const STOREFRONT_CHANNEL = "storefront-devtools:storefront";
12
+ /**
13
+ * The fields of a captured request that the request list renders and filters
14
+ * on. The panel loads the full {@link RequestRecord} with `getRequest` only for
15
+ * the selected request.
16
+ */
17
+ export type RequestListItem = Pick<RequestRecord, 'visitId' | 'parentVisitId' | 'type' | 'method' | 'url' | 'finishedAt' | 'duration' | 'status'> & {
18
+ /** Number of diagnostics attached to the request. */
19
+ diagnosticCount: number;
20
+ };
8
21
  /** Snapshot of the Inertia capture that the page script sends to the Inertia panel. */
9
22
  export interface InertiaPanelState {
10
23
  /** Captured requests, oldest first. */
11
- requests: RequestRecord[];
12
- /** The page Inertia currently shows, `null` before the first page loads. */
13
- currentPage: InertiaPage | null;
24
+ requests: RequestListItem[];
14
25
  /** Number of requests dropped because the capture hit its record limit. */
15
26
  evictedCount: number;
16
27
  /** Whether capture is paused. */
@@ -23,6 +34,8 @@ export interface InertiaChannelProtocol extends InPageChannelProtocol {
23
34
  functions: {
24
35
  pageScript: {
25
36
  getState: () => InertiaPanelState;
37
+ /** Returns the full record, `null` once it was cleared or evicted. */
38
+ getRequest: (visitId: number) => RequestRecord | null;
26
39
  clear: () => void;
27
40
  setPaused: (paused: boolean) => void;
28
41
  };
@@ -33,7 +46,7 @@ export interface InertiaChannelProtocol extends InPageChannelProtocol {
33
46
  };
34
47
  };
35
48
  }
36
- /** Snapshot that the page script sends to the Storefront context panel. */
49
+ /** Snapshot that the page script sends over {@link STOREFRONT_CHANNEL}. */
37
50
  export interface StorefrontPanelState {
38
51
  /** The page Inertia currently shows, `null` before the first page loads. */
39
52
  currentPage: InertiaPage | null;
@@ -1 +1 @@
1
- {"version":3,"file":"channel.d.ts","sourceRoot":"","sources":["../../src/inertia/channel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAA;AACrE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAClD,OAAO,KAAK,EAAE,aAAa,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAA;AAExE,qEAAqE;AACrE,eAAO,MAAM,eAAe,gCAAgC,CAAA;AAE5D,gFAAgF;AAChF,eAAO,MAAM,kBAAkB,mCAAmC,CAAA;AAElE,uFAAuF;AACvF,MAAM,WAAW,iBAAiB;IAChC,uCAAuC;IACvC,QAAQ,EAAE,aAAa,EAAE,CAAA;IACzB,4EAA4E;IAC5E,WAAW,EAAE,WAAW,GAAG,IAAI,CAAA;IAC/B,2EAA2E;IAC3E,YAAY,EAAE,MAAM,CAAA;IACpB,iCAAiC;IACjC,MAAM,EAAE,OAAO,CAAA;IACf,wFAAwF;IACxF,eAAe,EAAE,qBAAqB,EAAE,CAAA;CACzC;AAED,2CAA2C;AAC3C,MAAM,WAAW,sBAAuB,SAAQ,qBAAqB;IACnE,SAAS,EAAE;QACT,UAAU,EAAE;YACV,QAAQ,EAAE,MAAM,iBAAiB,CAAA;YACjC,KAAK,EAAE,MAAM,IAAI,CAAA;YACjB,SAAS,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAA;SACrC,CAAA;KACF,CAAA;IACD,MAAM,EAAE;QACN,KAAK,EAAE;YACL,KAAK,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,IAAI,CAAA;SAC1C,CAAA;KACF,CAAA;CACF;AAED,2EAA2E;AAC3E,MAAM,WAAW,oBAAoB;IACnC,4EAA4E;IAC5E,WAAW,EAAE,WAAW,GAAG,IAAI,CAAA;CAChC;AAED,8CAA8C;AAC9C,MAAM,WAAW,yBAA0B,SAAQ,qBAAqB;IACtE,SAAS,EAAE;QACT,UAAU,EAAE;YACV,QAAQ,EAAE,MAAM,oBAAoB,CAAA;SACrC,CAAA;KACF,CAAA;IACD,MAAM,EAAE;QACN,KAAK,EAAE;YACL,KAAK,EAAE,CAAC,KAAK,EAAE,oBAAoB,KAAK,IAAI,CAAA;SAC7C,CAAA;KACF,CAAA;CACF"}
1
+ {"version":3,"file":"channel.d.ts","sourceRoot":"","sources":["../../src/inertia/channel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAA;AACrE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAClD,OAAO,KAAK,EAAE,aAAa,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAA;AAExE,qEAAqE;AACrE,eAAO,MAAM,eAAe,gCAAgC,CAAA;AAE5D;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,mCAAmC,CAAA;AAElE;;;;GAIG;AACH,MAAM,MAAM,eAAe,GAAG,IAAI,CAChC,aAAa,EACX,SAAS,GACT,eAAe,GACf,MAAM,GACN,QAAQ,GACR,KAAK,GACL,YAAY,GACZ,UAAU,GACV,QAAQ,CACX,GAAG;IACF,qDAAqD;IACrD,eAAe,EAAE,MAAM,CAAA;CACxB,CAAA;AAED,uFAAuF;AACvF,MAAM,WAAW,iBAAiB;IAChC,uCAAuC;IACvC,QAAQ,EAAE,eAAe,EAAE,CAAA;IAC3B,2EAA2E;IAC3E,YAAY,EAAE,MAAM,CAAA;IACpB,iCAAiC;IACjC,MAAM,EAAE,OAAO,CAAA;IACf,wFAAwF;IACxF,eAAe,EAAE,qBAAqB,EAAE,CAAA;CACzC;AAED,2CAA2C;AAC3C,MAAM,WAAW,sBAAuB,SAAQ,qBAAqB;IACnE,SAAS,EAAE;QACT,UAAU,EAAE;YACV,QAAQ,EAAE,MAAM,iBAAiB,CAAA;YACjC,sEAAsE;YACtE,UAAU,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,aAAa,GAAG,IAAI,CAAA;YACrD,KAAK,EAAE,MAAM,IAAI,CAAA;YACjB,SAAS,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAA;SACrC,CAAA;KACF,CAAA;IACD,MAAM,EAAE;QACN,KAAK,EAAE;YACL,KAAK,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,IAAI,CAAA;SAC1C,CAAA;KACF,CAAA;CACF;AAED,2EAA2E;AAC3E,MAAM,WAAW,oBAAoB;IACnC,4EAA4E;IAC5E,WAAW,EAAE,WAAW,GAAG,IAAI,CAAA;CAChC;AAED,8CAA8C;AAC9C,MAAM,WAAW,yBAA0B,SAAQ,qBAAqB;IACtE,SAAS,EAAE;QACT,UAAU,EAAE;YACV,QAAQ,EAAE,MAAM,oBAAoB,CAAA;SACrC,CAAA;KACF,CAAA;IACD,MAAM,EAAE;QACN,KAAK,EAAE;YACL,KAAK,EAAE,CAAC,KAAK,EAAE,oBAAoB,KAAK,IAAI,CAAA;SAC7C,CAAA;KACF,CAAA;CACF"}