@solidjs/start 1.2.1 → 2.0.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 (191) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/README.md +2 -2
  3. package/dist/client/StartClient.d.ts +0 -1
  4. package/dist/client/StartClient.jsx +2 -4
  5. package/dist/client/index.d.ts +2 -3
  6. package/dist/client/index.jsx +2 -4
  7. package/dist/client/mount.d.ts +1 -7
  8. package/dist/client/mount.js +1 -91
  9. package/dist/client/spa/index.d.ts +1 -2
  10. package/dist/client/spa/index.jsx +1 -2
  11. package/dist/config/constants.d.ts +16 -0
  12. package/dist/config/constants.js +16 -0
  13. package/dist/config/dev-server.d.ts +2 -0
  14. package/dist/config/dev-server.js +108 -0
  15. package/dist/config/fs-router.d.ts +37 -0
  16. package/dist/config/fs-router.js +141 -0
  17. package/dist/config/fs-routes/fs-watcher.d.ts +3 -0
  18. package/dist/config/fs-routes/fs-watcher.js +49 -0
  19. package/dist/config/fs-routes/index.d.ts +7 -0
  20. package/dist/config/fs-routes/index.js +107 -0
  21. package/dist/config/fs-routes/router.d.ts +37 -0
  22. package/dist/config/fs-routes/router.js +136 -0
  23. package/dist/config/fs-routes/tree-shake.d.ts +2 -0
  24. package/dist/config/fs-routes/tree-shake.js +348 -0
  25. package/dist/config/index.d.ts +10 -0
  26. package/dist/config/index.js +214 -0
  27. package/dist/config/lazy.d.ts +3 -0
  28. package/dist/config/lazy.js +82 -0
  29. package/dist/config/manifest.d.ts +3 -0
  30. package/dist/config/manifest.js +74 -0
  31. package/dist/config/utils.d.ts +4 -0
  32. package/dist/config/utils.js +6 -0
  33. package/dist/config/vite-utils.d.ts +16 -0
  34. package/dist/config/vite-utils.js +81 -0
  35. package/dist/http/index.d.ts +81 -0
  36. package/dist/http/index.js +129 -0
  37. package/dist/index.d.ts +5 -5
  38. package/dist/index.jsx +5 -5
  39. package/dist/middleware/index.d.ts +6 -6
  40. package/dist/middleware/index.js +39 -0
  41. package/dist/{router/FileRoutes.js → router.jsx} +7 -8
  42. package/dist/server/StartServer.d.ts +3 -3
  43. package/dist/server/StartServer.jsx +9 -63
  44. package/dist/server/assets/index.d.ts +2 -0
  45. package/dist/server/assets/index.js +52 -0
  46. package/dist/server/assets/render.d.ts +19 -0
  47. package/dist/server/{renderAsset.jsx → assets/render.jsx} +1 -1
  48. package/dist/server/collect-styles.d.ts +3 -0
  49. package/dist/server/collect-styles.js +69 -0
  50. package/dist/server/fetchEvent.d.ts +4 -3
  51. package/dist/server/fetchEvent.js +12 -74
  52. package/dist/server/fetchEvent.spec.js +18 -197
  53. package/dist/server/handler.d.ts +6 -12
  54. package/dist/server/handler.js +193 -96
  55. package/dist/server/index.d.ts +9 -6
  56. package/dist/server/index.jsx +14 -6
  57. package/dist/server/manifest/client-manifest.d.ts +9 -0
  58. package/dist/server/manifest/client-manifest.js +6 -0
  59. package/dist/server/manifest/dev-client-manifest.d.ts +4 -0
  60. package/dist/server/manifest/dev-client-manifest.js +24 -0
  61. package/dist/server/manifest/dev-ssr-manifest.d.ts +5 -0
  62. package/dist/server/manifest/dev-ssr-manifest.js +23 -0
  63. package/dist/server/manifest/prod-client-manifest.d.ts +5 -0
  64. package/dist/server/manifest/prod-client-manifest.js +26 -0
  65. package/dist/server/manifest/prod-ssr-manifest.d.ts +6 -0
  66. package/dist/server/manifest/prod-ssr-manifest.js +85 -0
  67. package/dist/server/manifest/ssr-manifest.d.ts +4 -0
  68. package/dist/server/manifest/ssr-manifest.js +6 -0
  69. package/dist/{router → server}/routes.d.ts +5 -10
  70. package/dist/{router → server}/routes.js +32 -33
  71. package/dist/{runtime → server}/server-fns-runtime.d.ts +1 -1
  72. package/dist/{runtime → server}/server-fns-runtime.js +8 -7
  73. package/dist/server/server-functions-handler.d.ts +2 -0
  74. package/dist/{runtime/server-handler.js → server/server-functions-handler.js} +57 -97
  75. package/dist/server/server-runtime.d.ts +3 -0
  76. package/dist/{runtime → server}/server-runtime.js +17 -24
  77. package/dist/server/spa/StartServer.d.ts +1 -1
  78. package/dist/server/spa/StartServer.jsx +7 -9
  79. package/dist/server/spa/handler.d.ts +3 -3
  80. package/dist/server/spa/handler.js +9 -11
  81. package/dist/server/spa/index.d.ts +4 -3
  82. package/dist/server/spa/index.jsx +4 -3
  83. package/dist/server/types.d.ts +7 -9
  84. package/dist/server/util.d.ts +2 -0
  85. package/dist/server/util.js +8 -0
  86. package/dist/shared/ErrorBoundary.jsx +2 -2
  87. package/dist/shared/HttpHeader.jsx +4 -2
  88. package/dist/shared/{HttpStatusCode.jsx → HttpStatusCode.js} +3 -1
  89. package/dist/shared/dev-overlay/CodeView.d.ts +1 -1
  90. package/dist/shared/dev-overlay/CodeView.jsx +23 -34
  91. package/dist/shared/dev-overlay/DevOverlayDialog.d.ts +2 -2
  92. package/dist/shared/dev-overlay/DevOverlayDialog.jsx +73 -64
  93. package/dist/shared/dev-overlay/createStackFrame.js +3 -3
  94. package/dist/shared/dev-overlay/get-source-map.d.ts +1 -1
  95. package/dist/shared/dev-overlay/get-source-map.js +5 -5
  96. package/dist/shared/dev-overlay/icons.d.ts +10 -10
  97. package/dist/shared/dev-overlay/icons.jsx +91 -91
  98. package/dist/shared/dev-overlay/index.jsx +6 -9
  99. package/dist/shared/lazy.d.ts +3 -0
  100. package/dist/shared/lazy.js +42 -0
  101. package/dist/shared/serverFunction.d.ts +1 -1
  102. package/env.d.ts +2 -19
  103. package/package.json +44 -65
  104. package/scripts/build.js +15 -0
  105. package/scripts/validate-imports.js +316 -0
  106. package/src/client/StartClient.tsx +34 -0
  107. package/src/client/index.tsx +2 -0
  108. package/src/client/mount.ts +1 -0
  109. package/src/client/spa/index.tsx +9 -0
  110. package/src/config/constants.ts +19 -0
  111. package/src/config/dev-server.ts +145 -0
  112. package/{config/fs-router.js → src/config/fs-router.ts} +49 -29
  113. package/src/config/fs-routes/fs-watcher.ts +77 -0
  114. package/src/config/fs-routes/index.ts +136 -0
  115. package/src/config/fs-routes/router.ts +169 -0
  116. package/src/config/fs-routes/tree-shake.ts +371 -0
  117. package/src/config/index.ts +233 -0
  118. package/src/config/lazy.ts +100 -0
  119. package/src/config/manifest.ts +84 -0
  120. package/src/config/utils.ts +5 -0
  121. package/src/config/vite-utils.ts +109 -0
  122. package/src/env.d.ts +17 -0
  123. package/src/http/index.ts +216 -0
  124. package/src/index.tsx +7 -0
  125. package/src/internal.d.ts +14 -0
  126. package/src/middleware/index.ts +72 -0
  127. package/src/router.tsx +37 -0
  128. package/src/server/StartServer.tsx +56 -0
  129. package/src/server/assets/index.ts +70 -0
  130. package/src/server/assets/render.tsx +46 -0
  131. package/src/server/collect-styles.ts +87 -0
  132. package/src/server/fetchEvent.spec.ts +85 -0
  133. package/src/server/fetchEvent.ts +36 -0
  134. package/src/server/handler.ts +257 -0
  135. package/src/server/index.tsx +29 -0
  136. package/src/server/manifest/client-manifest.ts +8 -0
  137. package/src/server/manifest/dev-client-manifest.ts +21 -0
  138. package/src/server/manifest/dev-ssr-manifest.ts +23 -0
  139. package/src/server/manifest/prod-client-manifest.ts +21 -0
  140. package/src/server/manifest/prod-ssr-manifest.ts +109 -0
  141. package/src/server/manifest/ssr-manifest.ts +10 -0
  142. package/src/server/routes.ts +126 -0
  143. package/src/server/server-fns-runtime.ts +31 -0
  144. package/src/server/server-functions-handler.ts +339 -0
  145. package/src/server/server-runtime.ts +240 -0
  146. package/src/server/spa/StartServer.tsx +40 -0
  147. package/src/server/spa/handler.ts +29 -0
  148. package/src/server/spa/index.tsx +5 -0
  149. package/src/server/types.ts +82 -0
  150. package/src/server/util.ts +12 -0
  151. package/src/shared/ErrorBoundary.tsx +52 -0
  152. package/src/shared/GET.ts +8 -0
  153. package/src/shared/HttpHeader.tsx +42 -0
  154. package/src/shared/HttpStatusCode.ts +27 -0
  155. package/src/shared/clientOnly.ts +44 -0
  156. package/src/shared/dev-overlay/CodeView.tsx +92 -0
  157. package/src/shared/dev-overlay/DevOverlayDialog.tsx +316 -0
  158. package/src/shared/dev-overlay/createStackFrame.ts +74 -0
  159. package/src/shared/dev-overlay/download.ts +6 -0
  160. package/src/shared/dev-overlay/env.d.ts +4 -0
  161. package/src/shared/dev-overlay/get-source-map.ts +33 -0
  162. package/src/shared/dev-overlay/icons.tsx +456 -0
  163. package/src/shared/dev-overlay/index.tsx +63 -0
  164. package/src/shared/dev-overlay/styles.css +292 -0
  165. package/src/shared/lazy.ts +52 -0
  166. package/src/shared/serverFunction.ts +10 -0
  167. package/src/virtual.d.ts +27 -0
  168. package/tsconfig.json +23 -0
  169. package/vitest.config.ts +9 -0
  170. package/config/index.d.ts +0 -40
  171. package/config/index.js +0 -304
  172. package/config/server-components.js +0 -106
  173. package/dist/client/islands.d.ts +0 -7
  174. package/dist/client/islands.jsx +0 -10
  175. package/dist/middleware/index.jsx +0 -35
  176. package/dist/router/index.d.ts +0 -1
  177. package/dist/router/index.jsx +0 -2
  178. package/dist/router/lazyRoute.d.ts +0 -6
  179. package/dist/router/lazyRoute.js +0 -53
  180. package/dist/runtime/server-handler.d.ts +0 -2
  181. package/dist/runtime/server-runtime.d.ts +0 -3
  182. package/dist/server/islands/index.d.ts +0 -19
  183. package/dist/server/islands/index.jsx +0 -62
  184. package/dist/server/islands/utils.d.ts +0 -1
  185. package/dist/server/islands/utils.jsx +0 -85
  186. package/dist/server/pageEvent.d.ts +0 -2
  187. package/dist/server/pageEvent.js +0 -56
  188. package/dist/server/renderAsset.d.ts +0 -2
  189. /package/dist/{router/FileRoutes.d.ts → router.d.ts} +0 -0
  190. /package/dist/shared/{clientOnly.jsx → clientOnly.js} +0 -0
  191. /package/dist/shared/{serverFunction.jsx → serverFunction.js} +0 -0
@@ -1,56 +1,45 @@
1
1
  // @refresh skip
2
- import { getSingletonHighlighter } from 'shiki';
3
- import { loadWasm } from 'shiki/engine/oniguruma';
4
- import { createEffect, createResource } from 'solid-js';
5
- import url from 'shiki/onig.wasm?url';
6
- import langJS from 'shiki/langs/javascript.mjs';
7
- import langJSX from 'shiki/langs/jsx.mjs';
8
- import langTSX from 'shiki/langs/tsx.mjs';
9
- import langTS from 'shiki/langs/typescript.mjs';
10
- import darkPlus from 'shiki/themes/dark-plus.mjs';
2
+ import { getSingletonHighlighter } from "shiki";
3
+ import { loadWasm } from "shiki/engine/oniguruma";
4
+ import { createEffect, createResource } from "solid-js";
5
+ import url from "shiki/onig.wasm?url";
6
+ import langJS from "shiki/langs/javascript.mjs";
7
+ import langJSX from "shiki/langs/jsx.mjs";
8
+ import langTSX from "shiki/langs/tsx.mjs";
9
+ import langTS from "shiki/langs/typescript.mjs";
10
+ import darkPlus from "shiki/themes/dark-plus.mjs";
11
11
  let HIGHLIGHTER;
12
12
  async function loadHighlighter() {
13
13
  if (!HIGHLIGHTER) {
14
14
  await loadWasm(await fetch(url));
15
15
  HIGHLIGHTER = await getSingletonHighlighter({
16
- themes: [
17
- darkPlus,
18
- ],
19
- langs: [
20
- langJS,
21
- langJSX,
22
- langTS,
23
- langTSX,
24
- ],
16
+ themes: [darkPlus],
17
+ langs: [langJS, langJSX, langTS, langTSX],
25
18
  });
26
19
  }
27
20
  return HIGHLIGHTER;
28
21
  }
29
22
  const RANGE = 8;
30
23
  export function CodeView(props) {
31
- const lines = () => props.content.split('\n').map((item, index) => ({
24
+ const lines = () => props.content.split("\n").map((item, index) => ({
32
25
  index: index + 1,
33
26
  line: item,
34
27
  }));
35
28
  const minLine = () => Math.max(props.line - (1 + RANGE), 0);
36
29
  const maxLine = () => Math.min(props.line + RANGE, lines().length - 1);
37
30
  let ref;
38
- const [data] = createResource(() => (lines()
31
+ const [data] = createResource(() => lines()
39
32
  .slice(minLine(), maxLine())
40
33
  .map(item => item.line)
41
- .join('\n')), async (value) => {
34
+ .join("\n"), async (value) => {
42
35
  const highlighter = await loadHighlighter();
43
- const fileExtension = props.fileName
44
- .split(/[#?]/)[0]
45
- .split('.')
46
- .pop()
47
- ?.trim();
36
+ const fileExtension = props.fileName.split(/[#?]/)[0].split(".").pop()?.trim();
48
37
  let lang = fileExtension;
49
- if (fileExtension === 'mjs' || fileExtension === 'cjs') {
50
- lang = 'js';
38
+ if (fileExtension === "mjs" || fileExtension === "cjs") {
39
+ lang = "js";
51
40
  }
52
41
  return highlighter.codeToHtml(value, {
53
- theme: 'dark-plus',
42
+ theme: "dark-plus",
54
43
  lang,
55
44
  });
56
45
  });
@@ -61,13 +50,13 @@ export function CodeView(props) {
61
50
  const lines = ref.querySelectorAll('span[class="line"]');
62
51
  for (let i = 0, len = lines.length; i < len; i++) {
63
52
  const el = lines[i];
64
- if ((props.line - minLine() - 1) === i) {
65
- el.classList.add('dev-overlay-error-line');
53
+ if (props.line - minLine() - 1 === i) {
54
+ el.classList.add("dev-overlay-error-line");
66
55
  }
67
56
  }
68
57
  }
69
58
  });
70
- return <div ref={ref} class="dev-overlay-code-view" style={{
71
- '--dev-overlay-code-view-start': minLine() + 1,
72
- }}/>;
59
+ return (<div ref={ref} class="dev-overlay-code-view" style={{
60
+ "--dev-overlay-code-view-start": minLine() + 1,
61
+ }}/>);
73
62
  }
@@ -1,5 +1,5 @@
1
- import type { JSX } from 'solid-js';
2
- import './styles.css';
1
+ import type { JSX } from "solid-js";
2
+ import "./styles.css";
3
3
  export declare function classNames(...classes: (string | boolean | undefined)[]): string;
4
4
  interface DevOverlayDialogProps {
5
5
  errors: any[];
@@ -1,17 +1,18 @@
1
1
  // @refresh skip
2
- import ErrorStackParser from 'error-stack-parser';
3
- import * as htmlToImage from 'html-to-image';
4
- import { ErrorBoundary, For, Show, Suspense, createMemo, createSignal } from 'solid-js';
5
- import { Portal } from 'solid-js/web';
6
- import { Dialog, DialogOverlay, DialogPanel, Select, SelectOption } from 'terracotta';
7
- import info from '../../../package.json';
8
- import { CodeView } from './CodeView';
9
- import { createStackFrame } from './createStackFrame';
10
- import download from './download';
11
- import { ArrowLeftIcon, ArrowRightIcon, CameraIcon, DiscordIcon, GithubIcon, RefreshIcon, SolidStartIcon, ViewCompiledIcon, ViewOriginalIcon } from './icons';
12
- import './styles.css';
2
+ import ErrorStackParser from "error-stack-parser";
3
+ import * as htmlToImage from "html-to-image";
4
+ import { ErrorBoundary, For, Show, Suspense, createMemo, createSignal } from "solid-js";
5
+ import { Portal } from "solid-js/web";
6
+ // @ts-ignore - terracotta module resolution issue with NodeNext
7
+ import { Dialog, DialogOverlay, DialogPanel, Select, SelectOption } from "terracotta";
8
+ import info from "../../../package.json" with { type: "json" };
9
+ import { CodeView } from "./CodeView.jsx";
10
+ import { createStackFrame } from "./createStackFrame.js";
11
+ import download from "./download.js";
12
+ import { ArrowLeftIcon, ArrowRightIcon, CameraIcon, DiscordIcon, GithubIcon, RefreshIcon, SolidStartIcon, ViewCompiledIcon, ViewOriginalIcon, } from "./icons.jsx";
13
+ import "./styles.css";
13
14
  export function classNames(...classes) {
14
- return classes.filter(Boolean).join(' ');
15
+ return classes.filter(Boolean).join(" ");
15
16
  }
16
17
  function ErrorInfo(props) {
17
18
  const error = createMemo(() => {
@@ -31,8 +32,8 @@ function ErrorInfo(props) {
31
32
  }
32
33
  function getFileName(source) {
33
34
  try {
34
- const path = source.startsWith('/') ? new URL(source, 'file://') : new URL(source);
35
- const paths = path.pathname.split('/');
35
+ const path = source.startsWith("/") ? new URL(source, "file://") : new URL(source);
36
+ const paths = path.pathname.split("/");
36
37
  return paths[paths.length - 1];
37
38
  }
38
39
  catch (error) {
@@ -40,71 +41,77 @@ function getFileName(source) {
40
41
  }
41
42
  }
42
43
  function getFilePath(source) {
43
- const line = source.line ? `:${source.line}` : '';
44
- const column = source.column ? `:${source.column}` : '';
44
+ const line = source.line ? `:${source.line}` : "";
45
+ const column = source.column ? `:${source.column}` : "";
45
46
  return `${getFileName(source.source)}${line}${column}`;
46
47
  }
47
48
  function CodeFallback() {
48
- return <div class="dev-overlay-stack-frames-code-fallback">
49
- <span>Source not available.</span>
50
- </div>;
49
+ return (<div class="dev-overlay-stack-frames-code-fallback">
50
+ <span>Source not available.</span>
51
+ </div>);
51
52
  }
52
53
  function StackFramesContent(props) {
53
54
  const stackframes = ErrorStackParser.parse(props.error);
54
55
  const [selectedFrame, setSelectedFrame] = createSignal(stackframes[0]);
55
56
  return (<div class="dev-overlay-stack-frames-content">
56
- <div class="dev-overlay-stack-frames-code">
57
- <ErrorBoundary fallback={null}>
58
- {(() => {
57
+ <div class="dev-overlay-stack-frames-code">
58
+ <ErrorBoundary fallback={null}>
59
+ {(() => {
59
60
  const data = createStackFrame(selectedFrame(), () => props.isCompiled);
60
61
  return (<Suspense fallback={<CodeFallback />}>
61
- <Show when={data()} keyed fallback={<CodeFallback />}>
62
- {(source) => (<>
63
- <span class="dev-overlay-stack-frames-code-source">{source.source}</span>
64
- <div class="dev-overlay-stack-frames-code-container">
65
- <CodeView fileName={source.source} line={source.line} content={source.content}/>
66
- </div>
67
- </>)}
68
- </Show>
69
- </Suspense>);
62
+ <Show when={data()} keyed fallback={<CodeFallback />}>
63
+ {source => (<>
64
+ <span class="dev-overlay-stack-frames-code-source">{source.source}</span>
65
+ <div class="dev-overlay-stack-frames-code-container">
66
+ <CodeView fileName={source.source} line={source.line} content={source.content}/>
67
+ </div>
68
+ </>)}
69
+ </Show>
70
+ </Suspense>);
70
71
  })()}
71
- </ErrorBoundary>
72
- </div>
73
- <Select class="dev-overlay-stack-frames" value={selectedFrame()} onChange={setSelectedFrame}>
74
- <For each={stackframes}>
75
- {(current) => (<ErrorBoundary fallback={(<div class="dev-overlay-stack-frame">
76
- <span class="dev-overlay-stack-frame-function">{current.functionName ?? '<anonymous>'}</span>
77
- <span class="dev-overlay-stack-frame-file">{getFilePath({
72
+ </ErrorBoundary>
73
+ </div>
74
+ <Select class="dev-overlay-stack-frames" value={selectedFrame()} onChange={setSelectedFrame}>
75
+ <For each={stackframes}>
76
+ {current => (<ErrorBoundary fallback={<div class="dev-overlay-stack-frame">
77
+ <span class="dev-overlay-stack-frame-function">
78
+ {current.functionName ?? "<anonymous>"}
79
+ </span>
80
+ <span class="dev-overlay-stack-frame-file">
81
+ {getFilePath({
78
82
  source: current.getFileName(),
79
- content: '',
83
+ content: "",
80
84
  line: current.getLineNumber(),
81
85
  column: current.getColumnNumber(),
82
86
  name: current.getFunctionName(),
83
- })}</span>
84
- </div>)}>
87
+ })}
88
+ </span>
89
+ </div>}>
85
90
  {(() => {
86
91
  const data = createStackFrame(current, () => props.isCompiled);
87
92
  return (<Suspense>
88
93
  <Show when={data()} keyed>
89
- {(source) => (<SelectOption class="dev-overlay-stack-frame" value={current}>
90
- <span class="dev-overlay-stack-frame-function">{source.name ?? '<anonymous>'}</span>
94
+ {source => (<SelectOption class="dev-overlay-stack-frame" value={current}>
95
+ <span class="dev-overlay-stack-frame-function">
96
+ {source.name ?? "<anonymous>"}
97
+ </span>
91
98
  <span class="dev-overlay-stack-frame-file">{getFilePath(source)}</span>
92
99
  </SelectOption>)}
93
100
  </Show>
94
101
  </Suspense>);
95
102
  })()}
96
103
  </ErrorBoundary>)}
97
- </For>
98
- </Select>
99
- </div>);
104
+ </For>
105
+ </Select>
106
+ </div>);
100
107
  }
101
108
  function StackFrames(props) {
102
109
  return (<Show when={props.error instanceof Error && props.error} keyed>
103
- {(current) => (<StackFramesContent error={current} isCompiled={props.isCompiled}/>)}
110
+ {current => <StackFramesContent error={current} isCompiled={props.isCompiled}/>}
104
111
  </Show>);
105
112
  }
106
- const ISSUE_THREAD = 'https://github.com/solidjs/solid-start/issues/new';
107
- const DISCORD_INVITE = 'https://discord.com/invite/solidjs';
113
+ const ISSUE_THREAD = "https://github.com/solidjs/solid-start/issues/new";
114
+ const DISCORD_INVITE = "https://discord.com/invite/solidjs";
108
115
  export default function DevOverlayDialog(props) {
109
116
  const [currentPage, setCurrentPage] = createSignal(1);
110
117
  const [isCompiled, setIsCompiled] = createSignal(false);
@@ -113,7 +120,7 @@ export default function DevOverlayDialog(props) {
113
120
  return Math.min(currentPage(), length());
114
121
  });
115
122
  function goPrev() {
116
- setCurrentPage((c) => {
123
+ setCurrentPage(c => {
117
124
  if (c > 1) {
118
125
  return c - 1;
119
126
  }
@@ -121,7 +128,7 @@ export default function DevOverlayDialog(props) {
121
128
  });
122
129
  }
123
130
  function goNext() {
124
- setCurrentPage((c) => {
131
+ setCurrentPage(c => {
125
132
  if (c < length()) {
126
133
  return c + 1;
127
134
  }
@@ -129,31 +136,33 @@ export default function DevOverlayDialog(props) {
129
136
  });
130
137
  }
131
138
  function toggleIsCompiled() {
132
- setIsCompiled((c) => !c);
139
+ setIsCompiled(c => !c);
133
140
  }
134
141
  const [panel, setPanel] = createSignal();
135
142
  function downloadScreenshot() {
136
143
  const current = panel();
137
144
  if (current) {
138
- htmlToImage.toPng(current, {
145
+ htmlToImage
146
+ .toPng(current, {
139
147
  style: {
140
- transform: 'scale(0.75)',
148
+ transform: "scale(0.75)",
141
149
  },
142
- }).then((url) => {
143
- download(url, 'start-screenshot.png');
150
+ })
151
+ .then(url => {
152
+ download(url, "start-screenshot.png");
144
153
  });
145
154
  }
146
155
  }
147
156
  function redirectToGithub() {
148
157
  const url = new URL(ISSUE_THREAD);
149
- url.searchParams.append('labels', 'bug');
150
- url.searchParams.append('labels', 'needs+triage');
151
- url.searchParams.append('template', 'bug.yml');
152
- url.searchParams.append('title', `[Bug?]:` + props.errors[truncated() - 1].toString());
153
- window.open(url, '_blank').focus();
158
+ url.searchParams.append("labels", "bug");
159
+ url.searchParams.append("labels", "needs+triage");
160
+ url.searchParams.append("template", "bug.yml");
161
+ url.searchParams.append("title", `[Bug?]:` + props.errors[truncated() - 1].toString());
162
+ window.open(url, "_blank").focus();
154
163
  }
155
164
  function redirectToDiscord() {
156
- window.open(DISCORD_INVITE, '_blank').focus();
165
+ window.open(DISCORD_INVITE, "_blank").focus();
157
166
  }
158
167
  return (<Portal>
159
168
  <Dialog class="dev-overlay" isOpen>
@@ -194,7 +203,7 @@ export default function DevOverlayDialog(props) {
194
203
  <CameraIcon title="Capture Error Overlay"/>
195
204
  </button>
196
205
  <button class="dev-overlay-button" onClick={toggleIsCompiled} type="button">
197
- <Show when={isCompiled()} fallback={(<ViewOriginalIcon title="View Original Source"/>)}>
206
+ <Show when={isCompiled()} fallback={<ViewOriginalIcon title="View Original Source"/>}>
198
207
  <ViewCompiledIcon title="View Compiled Source"/>
199
208
  </Show>
200
209
  </button>
@@ -204,7 +213,7 @@ export default function DevOverlayDialog(props) {
204
213
  </div>
205
214
  </div>
206
215
  <Show when={props.errors[truncated() - 1]} keyed>
207
- {(current) => (<div class="dev-overlay-content">
216
+ {current => (<div class="dev-overlay-content">
208
217
  <ErrorInfo error={current}/>
209
218
  <StackFrames error={current} isCompiled={isCompiled()}/>
210
219
  </div>)}
@@ -1,8 +1,8 @@
1
1
  import { createMemo, createResource } from "solid-js";
2
- import getSourceMap from "./get-source-map";
2
+ import getSourceMap from "./get-source-map.js";
3
3
  function getActualFileSource(path) {
4
- if (path.startsWith('file://')) {
5
- return '/_build/@fs' + path.substring('file://'.length);
4
+ if (path.startsWith("file://")) {
5
+ return "/_build/@fs" + path.substring("file://".length);
6
6
  }
7
7
  return path;
8
8
  }
@@ -1,2 +1,2 @@
1
- import { SourceMapConsumer } from 'source-map-js';
1
+ import { SourceMapConsumer } from "source-map-js";
2
2
  export default function getSourceMap(url: string, content: string): Promise<SourceMapConsumer | null>;
@@ -1,8 +1,8 @@
1
- import { SourceMapConsumer } from 'source-map-js';
1
+ import { SourceMapConsumer } from "source-map-js";
2
2
  const INLINE_SOURCEMAP_REGEX = /^data:application\/json[^,]+base64,/;
3
3
  const SOURCEMAP_REGEX = /(?:\/\/[@#][ \t]+sourceMappingURL=([^\s'"]+?)[ \t]*$)|(?:\/\*[@#][ \t]+sourceMappingURL=([^*]+?)[ \t]*(?:\*\/)[ \t]*$)/;
4
4
  export default async function getSourceMap(url, content) {
5
- const lines = content.split('\n');
5
+ const lines = content.split("\n");
6
6
  let sourceMapUrl;
7
7
  for (let i = lines.length - 1; i >= 0 && !sourceMapUrl; i--) {
8
8
  const result = lines[i].match(SOURCEMAP_REGEX);
@@ -13,11 +13,11 @@ export default async function getSourceMap(url, content) {
13
13
  if (!sourceMapUrl) {
14
14
  return null;
15
15
  }
16
- if (!(INLINE_SOURCEMAP_REGEX.test(sourceMapUrl) || sourceMapUrl.startsWith('/'))) {
16
+ if (!(INLINE_SOURCEMAP_REGEX.test(sourceMapUrl) || sourceMapUrl.startsWith("/"))) {
17
17
  // Resolve path if it's a relative access
18
- const parsedURL = url.split('/');
18
+ const parsedURL = url.split("/");
19
19
  parsedURL[parsedURL.length - 1] = sourceMapUrl;
20
- sourceMapUrl = parsedURL.join('/');
20
+ sourceMapUrl = parsedURL.join("/");
21
21
  }
22
22
  const response = await fetch(sourceMapUrl);
23
23
  const rawSourceMap = await response.json();
@@ -1,28 +1,28 @@
1
- import type { JSX } from 'solid-js';
2
- export declare function ArrowRightIcon(props: JSX.IntrinsicElements['svg'] & {
1
+ import type { JSX } from "solid-js";
2
+ export declare function ArrowRightIcon(props: JSX.IntrinsicElements["svg"] & {
3
3
  title: string;
4
4
  }): JSX.Element;
5
- export declare function ArrowLeftIcon(props: JSX.IntrinsicElements['svg'] & {
5
+ export declare function ArrowLeftIcon(props: JSX.IntrinsicElements["svg"] & {
6
6
  title: string;
7
7
  }): JSX.Element;
8
- export declare function RefreshIcon(props: JSX.IntrinsicElements['svg'] & {
8
+ export declare function RefreshIcon(props: JSX.IntrinsicElements["svg"] & {
9
9
  title: string;
10
10
  }): JSX.Element;
11
- export declare function ViewCompiledIcon(props: JSX.IntrinsicElements['svg'] & {
11
+ export declare function ViewCompiledIcon(props: JSX.IntrinsicElements["svg"] & {
12
12
  title: string;
13
13
  }): JSX.Element;
14
- export declare function ViewOriginalIcon(props: JSX.IntrinsicElements['svg'] & {
14
+ export declare function ViewOriginalIcon(props: JSX.IntrinsicElements["svg"] & {
15
15
  title: string;
16
16
  }): JSX.Element;
17
- export declare function CameraIcon(props: JSX.IntrinsicElements['svg'] & {
17
+ export declare function CameraIcon(props: JSX.IntrinsicElements["svg"] & {
18
18
  title: string;
19
19
  }): JSX.Element;
20
- export declare function DiscordIcon(props: JSX.IntrinsicElements['svg'] & {
20
+ export declare function DiscordIcon(props: JSX.IntrinsicElements["svg"] & {
21
21
  title: string;
22
22
  }): JSX.Element;
23
- export declare function GithubIcon(props: JSX.IntrinsicElements['svg'] & {
23
+ export declare function GithubIcon(props: JSX.IntrinsicElements["svg"] & {
24
24
  title: string;
25
25
  }): JSX.Element;
26
- export declare function SolidStartIcon(props: JSX.IntrinsicElements['svg'] & {
26
+ export declare function SolidStartIcon(props: JSX.IntrinsicElements["svg"] & {
27
27
  title: string;
28
28
  }): JSX.Element;