@scayle/storefront-devtools 0.2.0-alpha.1

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 (131) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/README.md +222 -0
  3. package/dist/_chunks/clipboard-DrVHc2QA.mjs +61 -0
  4. package/dist/_chunks/diff-DzJ5arJj.mjs +169 -0
  5. package/dist/_chunks/panel-uV5ITqhY.mjs +51 -0
  6. package/dist/_chunks/redact-DmIF-iyk.mjs +96 -0
  7. package/dist/_chunks/useStore-Db8RZW8T.mjs +10 -0
  8. package/dist/group.d.ts +42 -0
  9. package/dist/group.d.ts.map +1 -0
  10. package/dist/index.d.ts +23 -0
  11. package/dist/index.d.ts.map +1 -0
  12. package/dist/index.mjs +178 -0
  13. package/dist/inertia/client/index.d.mts +13 -0
  14. package/dist/inertia/client/index.d.ts +7 -0
  15. package/dist/inertia/client/index.d.ts.map +1 -0
  16. package/dist/inertia/client/index.mjs +694 -0
  17. package/dist/inertia/core/capture.d.ts +15 -0
  18. package/dist/inertia/core/capture.d.ts.map +1 -0
  19. package/dist/inertia/core/correlator.d.ts +91 -0
  20. package/dist/inertia/core/correlator.d.ts.map +1 -0
  21. package/dist/inertia/core/diagnostics.d.ts +10 -0
  22. package/dist/inertia/core/diagnostics.d.ts.map +1 -0
  23. package/dist/inertia/core/diff.d.ts +33 -0
  24. package/dist/inertia/core/diff.d.ts.map +1 -0
  25. package/dist/inertia/core/events-tab.d.ts +20 -0
  26. package/dist/inertia/core/events-tab.d.ts.map +1 -0
  27. package/dist/inertia/core/feature-info.d.ts +14 -0
  28. package/dist/inertia/core/feature-info.d.ts.map +1 -0
  29. package/dist/inertia/core/features.d.ts +27 -0
  30. package/dist/inertia/core/features.d.ts.map +1 -0
  31. package/dist/inertia/core/history-capture.d.ts +15 -0
  32. package/dist/inertia/core/history-capture.d.ts.map +1 -0
  33. package/dist/inertia/core/interceptors.d.ts +69 -0
  34. package/dist/inertia/core/interceptors.d.ts.map +1 -0
  35. package/dist/inertia/core/markdown.d.ts +10 -0
  36. package/dist/inertia/core/markdown.d.ts.map +1 -0
  37. package/dist/inertia/core/network.d.ts +34 -0
  38. package/dist/inertia/core/network.d.ts.map +1 -0
  39. package/dist/inertia/core/protocol.d.ts +38 -0
  40. package/dist/inertia/core/protocol.d.ts.map +1 -0
  41. package/dist/inertia/core/request-tree.d.ts +18 -0
  42. package/dist/inertia/core/request-tree.d.ts.map +1 -0
  43. package/dist/inertia/core/response.d.ts +39 -0
  44. package/dist/inertia/core/response.d.ts.map +1 -0
  45. package/dist/inertia/core/session.d.ts +18 -0
  46. package/dist/inertia/core/session.d.ts.map +1 -0
  47. package/dist/inertia/core/store.d.ts +40 -0
  48. package/dist/inertia/core/store.d.ts.map +1 -0
  49. package/dist/inertia/core/types.d.ts +112 -0
  50. package/dist/inertia/core/types.d.ts.map +1 -0
  51. package/dist/inertia/core/url.d.ts +11 -0
  52. package/dist/inertia/core/url.d.ts.map +1 -0
  53. package/dist/inertia/plugin.d.ts +11 -0
  54. package/dist/inertia/plugin.d.ts.map +1 -0
  55. package/dist/inertia/renderer/index.d.mts +16 -0
  56. package/dist/inertia/renderer/index.mjs +771 -0
  57. package/dist/inject.d.ts +12 -0
  58. package/dist/inject.d.ts.map +1 -0
  59. package/dist/orpc/client/index.d.mts +13 -0
  60. package/dist/orpc/client/index.d.ts +7 -0
  61. package/dist/orpc/client/index.d.ts.map +1 -0
  62. package/dist/orpc/client/index.mjs +502 -0
  63. package/dist/orpc/core/capture.d.ts +32 -0
  64. package/dist/orpc/core/capture.d.ts.map +1 -0
  65. package/dist/orpc/core/classify.d.ts +14 -0
  66. package/dist/orpc/core/classify.d.ts.map +1 -0
  67. package/dist/orpc/core/curl.d.ts +11 -0
  68. package/dist/orpc/core/curl.d.ts.map +1 -0
  69. package/dist/orpc/core/markdown.d.ts +12 -0
  70. package/dist/orpc/core/markdown.d.ts.map +1 -0
  71. package/dist/orpc/core/orpc-error.d.ts +18 -0
  72. package/dist/orpc/core/orpc-error.d.ts.map +1 -0
  73. package/dist/orpc/core/serialize.d.ts +12 -0
  74. package/dist/orpc/core/serialize.d.ts.map +1 -0
  75. package/dist/orpc/core/session.d.ts +15 -0
  76. package/dist/orpc/core/session.d.ts.map +1 -0
  77. package/dist/orpc/core/store.d.ts +50 -0
  78. package/dist/orpc/core/store.d.ts.map +1 -0
  79. package/dist/orpc/core/types.d.ts +67 -0
  80. package/dist/orpc/core/types.d.ts.map +1 -0
  81. package/dist/orpc/core/url.d.ts +12 -0
  82. package/dist/orpc/core/url.d.ts.map +1 -0
  83. package/dist/orpc/plugin.d.ts +10 -0
  84. package/dist/orpc/plugin.d.ts.map +1 -0
  85. package/dist/orpc/renderer/index.d.mts +16 -0
  86. package/dist/orpc/renderer/index.mjs +457 -0
  87. package/dist/resource-center/client/index.mjs +21 -0
  88. package/dist/resource-center/client.d.ts +3 -0
  89. package/dist/resource-center/client.d.ts.map +1 -0
  90. package/dist/resource-center/plugin.d.ts +12 -0
  91. package/dist/resource-center/plugin.d.ts.map +1 -0
  92. package/dist/shared/clipboard.d.ts +9 -0
  93. package/dist/shared/clipboard.d.ts.map +1 -0
  94. package/dist/shared/redact.d.ts +27 -0
  95. package/dist/shared/redact.d.ts.map +1 -0
  96. package/dist/shared/safe-clone.d.ts +46 -0
  97. package/dist/shared/safe-clone.d.ts.map +1 -0
  98. package/dist/shared/session-storage.d.ts +18 -0
  99. package/dist/shared/session-storage.d.ts.map +1 -0
  100. package/dist/shared/use-window-store.d.ts +18 -0
  101. package/dist/shared/use-window-store.d.ts.map +1 -0
  102. package/dist/storefront/plugin.d.ts +9 -0
  103. package/dist/storefront/plugin.d.ts.map +1 -0
  104. package/dist/storefront/renderer/index.d.mts +16 -0
  105. package/dist/storefront/renderer/index.mjs +124 -0
  106. package/dist/vue-devtools/client/index.mjs +4912 -0
  107. package/dist/vue-devtools/client.d.ts +2 -0
  108. package/dist/vue-devtools/client.d.ts.map +1 -0
  109. package/dist/vue-devtools/plugin.d.ts +14 -0
  110. package/dist/vue-devtools/plugin.d.ts.map +1 -0
  111. package/dist/vue-devtools/ui/assets/css-8QJvnqUH.js +1 -0
  112. package/dist/vue-devtools/ui/assets/css-CaJ9TzKE.js +1 -0
  113. package/dist/vue-devtools/ui/assets/diff-woXpYk--.js +1 -0
  114. package/dist/vue-devtools/ui/assets/html-BHDw6EPc.js +1 -0
  115. package/dist/vue-devtools/ui/assets/html-GueGcY0x.js +1 -0
  116. package/dist/vue-devtools/ui/assets/index-Dby9TIQH.js +156 -0
  117. package/dist/vue-devtools/ui/assets/index-sSkqWPzY.css +1 -0
  118. package/dist/vue-devtools/ui/assets/javascript-BzbQS41l.js +1 -0
  119. package/dist/vue-devtools/ui/assets/javascript-Yelw-5ZN.js +1 -0
  120. package/dist/vue-devtools/ui/assets/json-B88Oqtu5.js +1 -0
  121. package/dist/vue-devtools/ui/assets/json-CaljABEy.js +1 -0
  122. package/dist/vue-devtools/ui/assets/shellscript-CLZ0U2zV.js +1 -0
  123. package/dist/vue-devtools/ui/assets/typescript-Utq2Cl8c.js +1 -0
  124. package/dist/vue-devtools/ui/assets/typescript-j_1H8WHN.js +1 -0
  125. package/dist/vue-devtools/ui/assets/vitesse-dark-BZCL-v6S.js +1 -0
  126. package/dist/vue-devtools/ui/assets/vitesse-light-VbXTXTou.js +1 -0
  127. package/dist/vue-devtools/ui/assets/vue-B1Tf5CHw.js +1 -0
  128. package/dist/vue-devtools/ui/assets/vue-html-CGMs_6qn.js +1 -0
  129. package/dist/vue-devtools/ui/assets/yaml-rwi0_p6S.js +1 -0
  130. package/dist/vue-devtools/ui/index.html +13 -0
  131. package/package.json +101 -0
@@ -0,0 +1,112 @@
1
+ import { PendingVisit } from '@inertiajs/core';
2
+ import { InertiaEventName, InertiaPage } from './protocol';
3
+ import { NetworkTiming } from './network';
4
+ /** Teardown function returned by capture starters. */
5
+ export type StopFunction = () => void;
6
+ /** A captured event with timestamp and serialized payload. */
7
+ export interface CapturedEvent {
8
+ id: number;
9
+ name: InertiaEventName;
10
+ /** `performance.now()` */
11
+ timestamp: number;
12
+ detail: Record<string, unknown>;
13
+ }
14
+ /**
15
+ * Classifies how a navigation was triggered: a `full` page visit, a `partial`
16
+ * reload, a `prefetch`, a `deferred` props load, a server `redirect`, or a
17
+ * `client` history change (`router.push`/`replace`).
18
+ *
19
+ * @see https://inertiajs.com/manual-visits
20
+ */
21
+ export type VisitType = 'full' | 'partial' | 'prefetch' | 'deferred' | 'redirect' | 'client';
22
+ /** Active Inertia feature detected on a request. */
23
+ export interface ActiveFeature {
24
+ type: 'partial' | 'deferred' | 'merge' | 'prepend' | 'deep-merge' | 'scroll' | 'once' | 'encrypted' | 'clear-history' | 'prefetch' | 'flash' | 'remember' | 'cached';
25
+ label: string;
26
+ details?: Record<string, unknown>;
27
+ }
28
+ /** Ranks an inline diagnostic by how much attention it warrants. */
29
+ export type DiagnosticSeverity = 'warning' | 'error' | 'info';
30
+ /** Inline diagnostic attached to a request. */
31
+ export interface Diagnostic {
32
+ id: string;
33
+ severity: DiagnosticSeverity;
34
+ message: string;
35
+ /** Optional link to relevant documentation. */
36
+ docsUrl?: string;
37
+ }
38
+ /** A logical request (navigation) grouping correlated events. */
39
+ export interface RequestRecord {
40
+ visitId: number;
41
+ parentVisitId?: number;
42
+ type: VisitType;
43
+ method: string;
44
+ url: string;
45
+ only?: string[];
46
+ except?: string[];
47
+ status?: number;
48
+ startedAt: number;
49
+ finishedAt?: number;
50
+ duration?: number;
51
+ page?: InertiaPage;
52
+ previousPage?: InertiaPage;
53
+ events: CapturedEvent[];
54
+ features: ActiveFeature[];
55
+ cancelled: boolean;
56
+ interrupted: boolean;
57
+ completed: boolean;
58
+ error?: unknown;
59
+ redirectUrl?: string;
60
+ visitOptions?: Record<string, unknown>;
61
+ diagnostics: Diagnostic[];
62
+ network?: NetworkTiming;
63
+ /**
64
+ * Inertia's own visit id (`visit.id` from `@inertiajs/core`), captured at
65
+ * `inertia:before` time. Used to attribute the interceptor-captured headers
66
+ * and response body below back to this record, since the interceptor
67
+ * hooks only ever hand us the visit object, not our own `visitId`.
68
+ */
69
+ inertiaVisitId?: string;
70
+ /** Lowercased request headers actually sent for this visit, for example `x-inertia-partial-data`. */
71
+ headers?: Record<string, string>;
72
+ /** Lowercased response headers actually received for this visit, for example `x-inertia-location`. */
73
+ responseHeaders?: Record<string, string>;
74
+ /** The response body's top-level props, parsed from the raw `x-inertia` JSON payload. */
75
+ responseProps?: Record<string, unknown>;
76
+ }
77
+ /** Snapshot of the devtools state exposed to subscribers. */
78
+ export interface DevToolsState {
79
+ requests: RequestRecord[];
80
+ currentPage: InertiaPage | null;
81
+ evictedCount: number;
82
+ /** Whether capture is currently paused. */
83
+ paused: boolean;
84
+ /** Monotonically increasing counter; changes on every state update. */
85
+ tick: number;
86
+ }
87
+ /**
88
+ * Visit object carried on Inertia event details (`event.detail.visit`). Extends
89
+ * core's `PendingVisit` with an index signature for `Object.entries` iteration
90
+ * and forward compatibility.
91
+ *
92
+ * @see https://inertiajs.com/events
93
+ */
94
+ export type InertiaVisitDetail = PendingVisit & Record<string, unknown>;
95
+ /**
96
+ * Compact request summary for sessionStorage persistence. Holds only the
97
+ * fields the "Previous session" list renders — a reload discards every live
98
+ * record, so nothing else survives long enough to be worth storing.
99
+ */
100
+ export interface SessionRequestSummary {
101
+ visitId: number;
102
+ type: VisitType;
103
+ method: string;
104
+ url: string;
105
+ status?: number;
106
+ }
107
+ /** Persisted snapshot of one capture session, stored in `sessionStorage`. */
108
+ export interface SessionSnapshot {
109
+ savedAt: number;
110
+ requests: SessionRequestSummary[];
111
+ }
112
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/inertia/core/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AACnD,OAAO,KAAK,EAAE,gBAAgB,EAAE,WAAW,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;;GAMG;AACH,MAAM,MAAM,kBAAkB,GAAG,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;AAEvE;;;;GAIG;AACH,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,EAAE,SAAS,CAAA;IACf,MAAM,EAAE,MAAM,CAAA;IACd,GAAG,EAAE,MAAM,CAAA;IACX,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED,6EAA6E;AAC7E,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,CAAA;IACf,QAAQ,EAAE,qBAAqB,EAAE,CAAA;CAClC"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Normalizes a URL to its pathname and search string so absolute and relative
3
+ * forms of the same request compare equal. Used to match visits against network
4
+ * timing entries and to detect same-URL history replaces.
5
+ *
6
+ * @param url - Absolute or relative URL to normalize.
7
+ * @returns The pathname and search (for example `/products?page=2`). Returns the
8
+ * input unchanged when it cannot be parsed.
9
+ */
10
+ export declare function normalizeUrl(url: string): string;
11
+ //# sourceMappingURL=url.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"url.d.ts","sourceRoot":"","sources":["../../../src/inertia/core/url.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAOhD"}
@@ -0,0 +1,11 @@
1
+ import { Plugin } from 'vite';
2
+ /**
3
+ * Creates the Vite plugin that registers the Inertia devtools panel: a
4
+ * custom-render dock entry whose renderer mounts the Vue panel directly into
5
+ * the dock panel DOM. The panel runs in the same page context as the host app,
6
+ * so it reads the capture store off `window` with no iframe crossing. The
7
+ * capture client itself is injected into the app entry alongside the other
8
+ * panels' clients; see `src/index.ts`.
9
+ */
10
+ export declare function createInertiaPlugin(): Plugin;
11
+ //# sourceMappingURL=plugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../src/inertia/plugin.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;AASlC;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,IAAI,MAAM,CAO5C"}
@@ -0,0 +1,16 @@
1
+ import type { DockClientScriptContext } from '@vitejs/devtools-kit/client'
2
+
3
+ /**
4
+ * Custom-render entry that mounts a devtools panel's Vue app into the dock
5
+ * panel DOM via `mountPanel` (see `src/shared/mount-panel.ts`). The Vite
6
+ * DevTools dock imports this by module specifier at runtime. This
7
+ * hand-authored declaration is the typed contract shared by the `./inertia/renderer`,
8
+ * `./orpc/renderer`, and `./storefront/renderer` exports. The Vue UI each
9
+ * renderer mounts has no emittable types and is excluded from declaration
10
+ * generation.
11
+ *
12
+ * @param ctx - The dock client-script context provided by the Vite DevTools dock.
13
+ */
14
+ declare function setupRenderer(ctx: DockClientScriptContext): void
15
+
16
+ export default setupRenderer