@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.
- package/CHANGELOG.md +77 -0
- package/README.md +234 -111
- package/dist/_chunks/{coalesce-D-Q8NzYg.mjs → coalesce-PetLUcf2.mjs} +388 -404
- package/dist/_chunks/frame-nav-DctWjxeG.mjs +3 -0
- package/dist/group.d.ts +14 -26
- package/dist/group.d.ts.map +1 -1
- package/dist/index.d.ts +29 -10
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +80 -116
- package/dist/inertia/channel.d.ts +18 -5
- package/dist/inertia/channel.d.ts.map +1 -1
- package/dist/inertia/client/index.mjs +242 -210
- package/dist/inertia/client/messages.d.ts +28 -0
- package/dist/inertia/client/messages.d.ts.map +1 -0
- package/dist/inertia/client/publish.d.ts +4 -2
- package/dist/inertia/client/publish.d.ts.map +1 -1
- package/dist/inertia/core/capture.d.ts.map +1 -1
- package/dist/inertia/core/correlator.d.ts +16 -0
- package/dist/inertia/core/correlator.d.ts.map +1 -1
- package/dist/inertia/core/diagnostics.d.ts.map +1 -1
- package/dist/inertia/core/diff.d.ts +2 -1
- package/dist/inertia/core/diff.d.ts.map +1 -1
- package/dist/inertia/core/feature-info.d.ts +9 -5
- package/dist/inertia/core/feature-info.d.ts.map +1 -1
- package/dist/inertia/core/features.d.ts.map +1 -1
- package/dist/inertia/core/history-capture.d.ts.map +1 -1
- package/dist/inertia/core/interceptors.d.ts +1 -0
- package/dist/inertia/core/interceptors.d.ts.map +1 -1
- package/dist/inertia/core/markdown.d.ts.map +1 -1
- package/dist/inertia/core/protocol.d.ts +1 -1
- package/dist/inertia/core/protocol.d.ts.map +1 -1
- package/dist/inertia/core/request-filters.d.ts +19 -0
- package/dist/inertia/core/request-filters.d.ts.map +1 -0
- package/dist/inertia/core/request-tree.d.ts +6 -3
- package/dist/inertia/core/request-tree.d.ts.map +1 -1
- package/dist/inertia/core/response.d.ts +3 -2
- package/dist/inertia/core/response.d.ts.map +1 -1
- package/dist/inertia/core/store.d.ts +1 -0
- package/dist/inertia/core/store.d.ts.map +1 -1
- package/dist/inertia/core/types.d.ts +2 -2
- package/dist/inertia/core/types.d.ts.map +1 -1
- package/dist/inertia/core/url.d.ts +12 -0
- package/dist/inertia/core/url.d.ts.map +1 -1
- package/dist/inject.d.ts +3 -4
- package/dist/inject.d.ts.map +1 -1
- package/dist/og.d.ts +12 -0
- package/dist/og.d.ts.map +1 -0
- package/dist/orpc/channel.d.ts +9 -1
- package/dist/orpc/channel.d.ts.map +1 -1
- package/dist/orpc/client/index.mjs +118 -102
- package/dist/orpc/client/publish.d.ts +3 -1
- package/dist/orpc/client/publish.d.ts.map +1 -1
- package/dist/orpc/core/session.d.ts +1 -8
- package/dist/orpc/core/session.d.ts.map +1 -1
- package/dist/orpc/core/stats.d.ts +1 -1
- package/dist/orpc/core/stats.d.ts.map +1 -1
- package/dist/orpc/core/store.d.ts +1 -0
- package/dist/orpc/core/store.d.ts.map +1 -1
- package/dist/shared/clipboard.d.ts +23 -3
- package/dist/shared/clipboard.d.ts.map +1 -1
- package/dist/shared/panel-channel.d.ts +27 -1
- package/dist/shared/panel-channel.d.ts.map +1 -1
- package/dist/shared/prefs.d.ts +49 -0
- package/dist/shared/prefs.d.ts.map +1 -0
- package/dist/shared/redact.d.ts +6 -3
- package/dist/shared/redact.d.ts.map +1 -1
- package/dist/shared/safe-clone.d.ts +2 -1
- package/dist/shared/safe-clone.d.ts.map +1 -1
- package/dist/ui/assets/App-BDAG24ch.js +4 -0
- package/dist/ui/assets/App-CBJXphAE.css +1 -0
- package/dist/ui/assets/App-CoMIIpFn.js +5 -0
- package/dist/ui/assets/App-CrZKW7ZD.js +1 -0
- package/dist/ui/assets/App-D9h2xKeA.css +1 -0
- package/dist/ui/assets/App-DIxgDJPh.css +1 -0
- package/dist/ui/assets/HeadersTab-BAgPi_LJ.css +1 -0
- package/dist/ui/assets/HeadersTab-YiDZOc7w.js +1 -0
- package/dist/ui/assets/_plugin-vue_export-helper-DnlXueOW.js +2 -0
- package/dist/ui/assets/panels-BZNAuOBL.css +1 -0
- package/dist/ui/assets/panels-X7JpniLo.js +3 -0
- package/dist/ui/assets/store-CmrV1otI.js +1 -0
- package/dist/ui/panels/index.html +2 -3
- package/package.json +23 -26
- package/dist/inertia/plugin.d.ts +0 -13
- package/dist/inertia/plugin.d.ts.map +0 -1
- package/dist/orpc/plugin.d.ts +0 -13
- package/dist/orpc/plugin.d.ts.map +0 -1
- package/dist/storefront/plugin.d.ts +0 -11
- package/dist/storefront/plugin.d.ts.map +0 -1
- package/dist/ui/assets/App-BMyWBnLQ.js +0 -4
- package/dist/ui/assets/App-C5-JscO0.css +0 -1
- package/dist/ui/assets/App-CCUPtzNx.js +0 -5
- package/dist/ui/assets/App-Ct7Za--B.css +0 -1
- package/dist/ui/assets/App-Ctfis9Sq.js +0 -1
- package/dist/ui/assets/App-jiQKInbo.css +0 -1
- package/dist/ui/assets/_plugin-vue_export-helper-BDNMzG2s.js +0 -1
- package/dist/ui/assets/channel-D7V7aU79.js +0 -1
- package/dist/ui/assets/clipboard-BY7CN-yK.js +0 -1
- package/dist/ui/assets/clipboard-BnEeWyfh.css +0 -1
- package/dist/ui/assets/css-8QJvnqUH.js +0 -1
- package/dist/ui/assets/css-lJZLS6R3.js +0 -1
- package/dist/ui/assets/diff-woXpYk--.js +0 -1
- package/dist/ui/assets/html-GueGcY0x.js +0 -1
- package/dist/ui/assets/html-WzJrCOnD.js +0 -1
- package/dist/ui/assets/javascript-BzbQS41l.js +0 -1
- package/dist/ui/assets/javascript-CpIGwZ_Y.js +0 -1
- package/dist/ui/assets/json-B88Oqtu5.js +0 -1
- package/dist/ui/assets/json-C3WlssX3.js +0 -1
- package/dist/ui/assets/panel-channel-qxy-vGGq.js +0 -2
- package/dist/ui/assets/panels-B4LTsmli.css +0 -1
- package/dist/ui/assets/panels-BcOW2Xog.js +0 -2
- package/dist/ui/assets/preload-helper-CSlQMSTd.js +0 -2
- package/dist/ui/assets/shellscript-CLZ0U2zV.js +0 -1
- package/dist/ui/assets/typescript-Bb1J8qyy.js +0 -1
- package/dist/ui/assets/typescript-j_1H8WHN.js +0 -1
- package/dist/ui/assets/vitesse-dark-BZCL-v6S.js +0 -1
- package/dist/ui/assets/vitesse-light-VbXTXTou.js +0 -1
- package/dist/ui/assets/vue-B1Tf5CHw.js +0 -1
- package/dist/ui/assets/vue-C0gCEhF7.js +0 -155
- package/dist/ui/assets/vue-Kq4tvBbL.css +0 -1
- package/dist/ui/assets/vue-html-CGMs_6qn.js +0 -1
- package/dist/ui/assets/yaml-rwi0_p6S.js +0 -1
- package/dist/ui/vue/index.html +0 -15
- package/dist/vue-devtools/client/index.mjs +0 -4899
- package/dist/vue-devtools/client.d.ts +0 -2
- package/dist/vue-devtools/client.d.ts.map +0 -1
- package/dist/vue-devtools/plugin.d.ts +0 -15
- package/dist/vue-devtools/plugin.d.ts.map +0 -1
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
|
|
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}.
|
|
19
|
-
*
|
|
20
|
-
*
|
|
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
|
-
*
|
|
27
|
-
*
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
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
|
-
* @
|
|
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
|
|
37
|
+
export declare function createMessagesDockPlugin(): PluginWithDevTools;
|
|
50
38
|
//# sourceMappingURL=group.d.ts.map
|
package/dist/group.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"group.d.ts","sourceRoot":"","sources":["../src/group.ts"],"names":[],"mappings":"
|
|
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
|
|
6
|
-
* panel, and
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
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
|
-
*
|
|
23
|
-
*
|
|
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
|
package/dist/index.d.ts.map
CHANGED
|
@@ -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;
|
|
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,153 +1,117 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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";
|
|
10
|
+
// src/inject.ts
|
|
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
|
|
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
|
-
|
|
26
|
-
|
|
27
|
-
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(
|
|
22
|
+
// src/group.ts
|
|
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(
|
|
28
24
|
/* @vite-ignore */
|
|
29
25
|
"./ui",
|
|
30
26
|
import.meta.url
|
|
31
27
|
));
|
|
32
|
-
function
|
|
28
|
+
function _() {
|
|
33
29
|
return {
|
|
34
30
|
name: "storefront-devtools:group",
|
|
35
|
-
devtools: { setup(
|
|
36
|
-
|
|
37
|
-
id:
|
|
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,
|
|
38
34
|
title: "SCAYLE Storefront",
|
|
39
|
-
icon:
|
|
35
|
+
icon: m,
|
|
40
36
|
type: "group",
|
|
41
|
-
accentColor:
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
return {
|
|
48
|
-
name: `storefront-devtools:${e.id}`,
|
|
49
|
-
devtools: { setup(t) {
|
|
50
|
-
t.docks.register({
|
|
51
|
-
id: e.id,
|
|
52
|
-
title: e.title,
|
|
53
|
-
icon: e.icon,
|
|
37
|
+
accentColor: p,
|
|
38
|
+
defaultChildId: e
|
|
39
|
+
}), t.docks.register({
|
|
40
|
+
id: e,
|
|
41
|
+
title: "SCAYLE Storefront",
|
|
42
|
+
icon: m,
|
|
54
43
|
type: "iframe",
|
|
55
|
-
url: `${
|
|
56
|
-
groupId:
|
|
44
|
+
url: `${h}panels/`,
|
|
45
|
+
groupId: f,
|
|
46
|
+
subTabs: { protocol: "postmessage" },
|
|
47
|
+
visibility: "false"
|
|
57
48
|
});
|
|
58
49
|
} }
|
|
59
50
|
};
|
|
60
51
|
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
}
|
|
72
|
-
//#endregion
|
|
73
|
-
//#region src/orpc/plugin.ts
|
|
74
|
-
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";
|
|
75
|
-
function _() {
|
|
76
|
-
return p({
|
|
77
|
-
id: "storefront-devtools:orpc",
|
|
78
|
-
title: "oRPC",
|
|
79
|
-
icon: g,
|
|
80
|
-
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
|
+
}
|
|
81
63
|
});
|
|
82
64
|
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
return
|
|
88
|
-
id: "storefront-devtools:storefront",
|
|
89
|
-
title: "Storefront",
|
|
90
|
-
icon: v,
|
|
91
|
-
view: "storefront"
|
|
92
|
-
});
|
|
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);
|
|
93
70
|
}
|
|
94
|
-
|
|
95
|
-
//#region src/vue-devtools/plugin.ts
|
|
96
|
-
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/`;
|
|
97
|
-
function S() {
|
|
71
|
+
function x() {
|
|
98
72
|
return {
|
|
99
|
-
name: "storefront-devtools:
|
|
73
|
+
name: "storefront-devtools:og",
|
|
100
74
|
apply: "serve",
|
|
101
|
-
devtools: { setup(e) {
|
|
102
|
-
|
|
103
|
-
e.
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
}), e.docks.register({
|
|
111
|
-
id: "storefront-devtools:vue-components",
|
|
112
|
-
title: "Components",
|
|
113
|
-
icon: b,
|
|
114
|
-
type: "iframe",
|
|
115
|
-
url: `${x}?view=components`,
|
|
116
|
-
groupId: t
|
|
117
|
-
}), e.docks.register({
|
|
118
|
-
id: "storefront-devtools:vue-timeline",
|
|
119
|
-
title: "Timeline",
|
|
120
|
-
icon: b,
|
|
121
|
-
type: "iframe",
|
|
122
|
-
url: `${x}?view=timeline`,
|
|
123
|
-
groupId: t
|
|
124
|
-
});
|
|
125
|
-
} }
|
|
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
|
+
}) }
|
|
126
84
|
};
|
|
127
85
|
}
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
86
|
+
// src/index.ts
|
|
87
|
+
function S(e = {}) {
|
|
88
|
+
let { allowedOrigins: i, clientAuth: a } = e;
|
|
131
89
|
return [
|
|
132
|
-
|
|
90
|
+
t({
|
|
91
|
+
allowedOrigins: i,
|
|
92
|
+
clientAuth: a,
|
|
133
93
|
builtinDevTools: !1,
|
|
94
|
+
mcp: !1,
|
|
134
95
|
branding: {
|
|
135
96
|
productName: "SCAYLE Storefront DevTools",
|
|
136
|
-
logo:
|
|
137
|
-
primaryColor:
|
|
97
|
+
logo: m,
|
|
98
|
+
primaryColor: p
|
|
138
99
|
}
|
|
139
100
|
}),
|
|
140
|
-
|
|
141
|
-
"@scayle/storefront-devtools/vue-devtools/client",
|
|
142
|
-
"@scayle/storefront-devtools/orpc/client",
|
|
143
|
-
"@scayle/storefront-devtools/inertia/client"
|
|
144
|
-
]),
|
|
145
|
-
f(),
|
|
146
|
-
h(),
|
|
101
|
+
d(["@scayle/storefront-devtools/orpc/client", "@scayle/storefront-devtools/inertia/client"]),
|
|
147
102
|
_(),
|
|
148
|
-
|
|
149
|
-
|
|
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
|
+
}
|
|
150
115
|
];
|
|
151
116
|
}
|
|
152
|
-
|
|
153
|
-
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
|
-
/**
|
|
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:
|
|
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
|
|
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
|
|
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"}
|