From c1fe3edcefc4edbf744587da14bb6a743a5a8b4b Mon Sep 17 00:00:00 2001 From: Tyson Date: Sat, 3 May 2025 08:06:05 -0700 Subject: [PATCH 1/9] create runed file --- src/lib/client/SuperDebugRuned.svelte | 720 ++++++++++++++++++++++++++ 1 file changed, 720 insertions(+) create mode 100644 src/lib/client/SuperDebugRuned.svelte diff --git a/src/lib/client/SuperDebugRuned.svelte b/src/lib/client/SuperDebugRuned.svelte new file mode 100644 index 00000000..12350ca0 --- /dev/null +++ b/src/lib/client/SuperDebugRuned.svelte @@ -0,0 +1,720 @@ + + +{#if !styleInit} + + + {@const init = styleInit = true} +{/if} + + +{#if display} +
+
+
{label}
+
+ + {#if status} +
= 200 && $page.status < 300} + class:super-debug--redirect={$page.status >= 300 && $page.status < 400} + class:super-debug--error={$page.status >= 400} + > + {$page.status} +
+ {/if} +
+
+
{#if assertPromise($debugData, raw, promise)}{#await $debugData}
Loading data...
{:then result}{@html syntaxHighlight( + assertStore(result, raw) ? get(result) : result + )}{:catch error}Rejected: {@html syntaxHighlight(error)}{/await}{:else}{@html syntaxHighlight( + $debugData + )}{/if}
+ {#if collapsible} + + {/if} +
+{/if} + + From 5450c509219e47ed3953c116a1065c1700f6f4bf Mon Sep 17 00:00:00 2001 From: Tyson Date: Sat, 3 May 2025 08:43:45 -0700 Subject: [PATCH 2/9] convert SuperDebug to ts --- src/lib/client/SuperDebugRuned.svelte | 53 ++++++++++++++++----------- 1 file changed, 32 insertions(+), 21 deletions(-) diff --git a/src/lib/client/SuperDebugRuned.svelte b/src/lib/client/SuperDebugRuned.svelte index 12350ca0..0ceb8d75 100644 --- a/src/lib/client/SuperDebugRuned.svelte +++ b/src/lib/client/SuperDebugRuned.svelte @@ -1,4 +1,5 @@ - {#if !styleInit} @@ -619,7 +632,7 @@ >
{label}
-
@@ -672,20 +685,21 @@ class:super-debug--with-label={label} class:super-debug--hidden={collapsed} bind:this={ref}>{#if assertPromise($debugData, raw, promise)}{#await $debugData}
Loading data...
{:then result}{@html syntaxHighlight( - assertStore(result, raw) ? get(result) : result - )}{:catch error}Rejected: {@html syntaxHighlight(error)}{/await}{:else}{@html syntaxHighlight( - $debugData - )}{/if}
{#if children}{@render children()}{:else if assertPromise($debugData, raw, promise)}{#await $debugData}
Loading data...
{:then result}{@html syntaxHighlight( + assertStore(result, raw) ? get(result) : result + )}{:catch error}Rejected: {@html syntaxHighlight(error)}{/await}{:else}{@html syntaxHighlight( + $debugData + )}{/if} {#if collapsible} - {#if status} -
= 200 && $page.status < 300} - class:super-debug--redirect={$page.status >= 300 && $page.status < 400} - class:super-debug--error={$page.status >= 400} - > - {$page.status} -
- {/if} - - -
{#if assertPromise($debugData, raw, promise)}{#await $debugData}
Loading data...
{:then result}{@html syntaxHighlight( - assertStore(result, raw) ? get(result) : result - )}{:catch error}Rejected: {@html syntaxHighlight(error)}{/await}{:else}{@html syntaxHighlight( - $debugData - )}{/if}
- {#if collapsible} - - {/if} - +{#if VERSION[0] == '3' || VERSION[0] == '4'} + +{:else} + {/if} + {@const init = styleInit = true} +{/if} + + +{#if display} +
+
+
{label}
+
+ + {#if status} +
= 200 && $page.status < 300} + class:super-debug--redirect={$page.status >= 300 && $page.status < 400} + class:super-debug--error={$page.status >= 400} + > + {$page.status} +
+ {/if} +
+
+
{#if assertPromise($debugData, raw, promise)}{#await $debugData}
Loading data...
{:then result}{@html syntaxHighlight( + assertStore(result, raw) ? get(result) : result + )}{:catch error}Rejected: {@html syntaxHighlight(error)}{/await}{:else}{@html syntaxHighlight( + $debugData + )}{/if}
+ {#if collapsible} + + {/if} +
+{/if} + + diff --git a/src/lib/client/SuperDebugRuned.svelte b/src/lib/client/SuperDebugRuned.svelte index f559065d..a59c1fdb 100644 --- a/src/lib/client/SuperDebugRuned.svelte +++ b/src/lib/client/SuperDebugRuned.svelte @@ -732,7 +732,7 @@ ```svelte - -{#if VERSION[0] == '3' || VERSION[0] == '4'} +{#if VERSION.startsWith('3') || VERSION.startsWith('4')} {:else} From 592a4eec341416d53d515347e03d2a7c2ebd3c10 Mon Sep 17 00:00:00 2001 From: Tyson Date: Mon, 5 May 2025 15:32:16 -0700 Subject: [PATCH 7/9] resolve ts error --- src/lib/client/SuperDebug.svelte | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/lib/client/SuperDebug.svelte b/src/lib/client/SuperDebug.svelte index d6223f02..ea6df25b 100644 --- a/src/lib/client/SuperDebug.svelte +++ b/src/lib/client/SuperDebug.svelte @@ -4,13 +4,15 @@ import SuperDebugLegacy from './SuperDebugLegacy.svelte'; import SuperDebugRuned from './SuperDebugRuned.svelte'; - export let props: ComponentProps | ComponentProps; + type $$Props = ComponentProps; + + export let data: $$Props['data']; {#if VERSION.startsWith('3') || VERSION.startsWith('4')} - + {:else} - + {/if} - {@const init = styleInit = true} {/if}