astralis-devtools 0.0.0-stage → 0.2.0

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.
@@ -0,0 +1,459 @@
1
+ import { h, icon, plural } from "../dom.mjs";
2
+ import { readIdentity } from "../identity.mjs";
3
+ import { GITHUB_MARK, ICONS } from "../icons.mjs";
4
+ import { browserEnvironment, treeFromElement } from "../report.mjs";
5
+ import { empty } from "./shared.mjs";
6
+
7
+ /* Report: a problem sent to the maintainers as a GitHub issue, opened from
8
+ the reporter's own account, and the issues they have opened so far.
9
+
10
+ A report is an issue snapshot of one component and everything inside it.
11
+ The exact JSON is shown before anything is sent, and nothing is sent until
12
+ the reporter presses Send. The form keeps its input across screens and
13
+ while findings stream in. Pictures and files are added on GitHub, in the
14
+ issue itself: its API cannot attach them. */
15
+
16
+ /** The form for a new report. */
17
+ function newReport(app) {
18
+ const { state } = app;
19
+ const r = state.report;
20
+ const element = state.selected?.isConnected ? state.selected : null;
21
+
22
+ if (!element) {
23
+ const root = h(
24
+ "div",
25
+ {},
26
+ empty(ICONS.report, "Which component is it?", "Pick the component the problem is in. The report describes it and everything inside it.", { neutral: true }),
27
+ h(
28
+ "div",
29
+ { class: "row", style: "justify-content:center" },
30
+ h("button", { class: "btn primary", type: "button", onclick: () => app.startPicking("report") }, icon(ICONS.pick), "Pick a component"),
31
+ h("button", { class: "btn", type: "button", onclick: () => app.navigate("components") }, "Choose from the list"),
32
+ ),
33
+ );
34
+ return { root, update() {} };
35
+ }
36
+
37
+ let timer = null;
38
+ let request = 0;
39
+
40
+ function schedule() {
41
+ clearTimeout(timer);
42
+ timer = setTimeout(assemble, 250);
43
+ }
44
+
45
+ /** Ask the bridge to complete the snapshot from the page's part. Nothing leaves the machine. */
46
+ async function assemble() {
47
+ if (!element.isConnected) return;
48
+ const mine = ++request;
49
+ const body = {
50
+ tree: treeFromElement(element, state.spec, { includeText: r.includeText, skip: app.host }),
51
+ route: location.pathname,
52
+ environment: browserEnvironment(window),
53
+ description: { title: r.title, happened: r.happened, expected: r.expected },
54
+ include: { findings: r.includeFindings, console: r.includeConsole },
55
+ console: [...app.consoleErrors.messages],
56
+ };
57
+ try {
58
+ const response = await fetch(`${app.base}/snapshot`, { method: "POST", headers: { "content-type": "application/json" }, body: JSON.stringify(body) });
59
+ const result = await response.json();
60
+ if (mine !== request) return; // a newer edit is on its way
61
+ if (!response.ok) throw new Error(result?.error ?? `The bridge answered ${response.status}.`);
62
+ r.snapshot = result.snapshot;
63
+ r.problems = result.problems;
64
+ if (r.status === "notice") r.status = "idle";
65
+ checkSimilar(result.snapshot);
66
+ } catch (error) {
67
+ if (mine !== request) return;
68
+ r.snapshot = null;
69
+ r.problems = [error.message];
70
+ }
71
+ refresh();
72
+ }
73
+
74
+ /** Issues that may already report this. The bridge searches GitHub once per problem, not per keystroke. */
75
+ async function checkSimilar(snapshot) {
76
+ if (!app.state.github?.login) return;
77
+ try {
78
+ const response = await fetch(`${app.base}/github/similar`, { method: "POST", headers: { "content-type": "application/json" }, body: JSON.stringify(snapshot) });
79
+ if (!response.ok) return;
80
+ r.similar = await response.json();
81
+ } catch {
82
+ return; // no check is no reason to stop a report
83
+ }
84
+ refresh();
85
+ }
86
+
87
+ /** Open a new issue, or, with `addTo`, add the report to that existing one. */
88
+ async function send(addTo = null) {
89
+ if (!r.snapshot || r.problems.length) return;
90
+ r.status = "sending";
91
+ r.message = "";
92
+ refresh();
93
+ try {
94
+ const where = addTo ? `submit?addTo=${addTo}` : "submit";
95
+ const response = await fetch(`${app.base}/${where}`, { method: "POST", headers: { "content-type": "application/json" }, body: JSON.stringify(r.snapshot) });
96
+ const result = await response.json();
97
+ if (response.status === 401) app.github.reload();
98
+ if (!response.ok) throw new Error(result?.error ?? `The bridge answered ${response.status}.`);
99
+ r.status = "sent";
100
+ r.url = result.url;
101
+ r.number = result.number;
102
+ r.added = Boolean(addTo);
103
+ r.similar = null;
104
+ app.github.loadIssues();
105
+ } catch (error) {
106
+ r.status = "failed";
107
+ r.message = error.message;
108
+ }
109
+ refresh();
110
+ }
111
+
112
+ function notice(message) {
113
+ r.status = "notice";
114
+ r.message = message;
115
+ refresh();
116
+ }
117
+
118
+ async function copy() {
119
+ try {
120
+ await navigator.clipboard.writeText(JSON.stringify(r.snapshot, null, 2));
121
+ notice("Copied the snapshot's JSON.");
122
+ } catch {
123
+ notice("The browser did not allow copying; use Download instead.");
124
+ }
125
+ }
126
+
127
+ function download() {
128
+ const blob = new Blob([`${JSON.stringify(r.snapshot, null, 2)}\n`], { type: "application/json" });
129
+ const link = h("a", { href: URL.createObjectURL(blob), download: "astralis-snapshot.json" });
130
+ link.click();
131
+ setTimeout(() => URL.revokeObjectURL(link.href), 1000);
132
+ notice("Saved astralis-snapshot.json.");
133
+ }
134
+
135
+ /** Open GitHub's own form, filled in, to submit there: no sign-in. The page asks the bridge to build the link. */
136
+ async function openOnGitHub() {
137
+ try {
138
+ const response = await fetch(`${app.base}/github/link`, { method: "POST", headers: { "content-type": "application/json" }, body: JSON.stringify(r.snapshot) });
139
+ const result = await response.json();
140
+ if (!response.ok) throw new Error(result?.error ?? `The bridge answered ${response.status}.`);
141
+ window.open(result.url, "_blank", "noopener");
142
+ notice("GitHub's form is open in a new tab: check it, add any picture or file there, and press Create.");
143
+ } catch (error) {
144
+ notice(`${error.message} Copy JSON or Download keeps the snapshot.`);
145
+ }
146
+ }
147
+
148
+ const field = (label, key, multiline, placeholder) => {
149
+ const input = h(multiline ? "textarea" : "input", { class: "field", rows: multiline ? 3 : null, maxlength: multiline ? 4000 : 200, "aria-label": label, placeholder });
150
+ input.value = r[key];
151
+ input.addEventListener("input", () => {
152
+ r[key] = input.value;
153
+ schedule();
154
+ });
155
+ return h("label", { class: "field-label" }, label, input);
156
+ };
157
+ const toggle = (label, key, hint) => {
158
+ const box = h("input", { type: "checkbox" });
159
+ box.checked = r[key];
160
+ box.addEventListener("change", () => {
161
+ r[key] = box.checked;
162
+ schedule();
163
+ });
164
+ const text = h("span", {}, label);
165
+ return { row: h("label", { class: "switch-row toggle" }, h("span", {}, text, h("small", {}, hint)), h("span", { class: "switch" }, box, h("span"))), text };
166
+ };
167
+
168
+ const textToggle = toggle("Include page text", "includeText", "Off: text is replaced by its length.");
169
+ const findingsToggle = toggle("Include the validator's findings", "includeFindings", "For the files that render this page.");
170
+ const consoleToggle = toggle("Include console errors", "includeConsole", "Paths are trimmed to the app.");
171
+ const preview = h("pre", { class: "json", "aria-label": "Snapshot JSON" });
172
+ const problems = h("ul", { class: "problems" });
173
+ const status = h("div", { class: "report-status", role: "status" });
174
+ const similar = h("div", {});
175
+ const sendButton = h("button", { class: "btn primary", type: "button", onclick: () => send() }, icon(GITHUB_MARK), h("span", {}, "Open issue on GitHub"));
176
+ const linkButton = h("button", { class: "btn", type: "button", title: "Opens GitHub's own form, filled in; you submit it there. No sign-in.", onclick: openOnGitHub }, icon(ICONS.external), "Open on GitHub instead");
177
+ const copyButton = h("button", { class: "btn", type: "button", onclick: copy }, icon(ICONS.copy), "Copy JSON");
178
+ const downloadButton = h("button", { class: "btn", type: "button", onclick: download }, icon(ICONS.download), "Download");
179
+
180
+ const root = h(
181
+ "div",
182
+ { class: "report stack" },
183
+ h(
184
+ "div",
185
+ { class: "card target" },
186
+ h("span", { class: "detail-icon" }, icon(ICONS.components)),
187
+ h("div", { class: "grow" }, h("div", { class: "name" }, readIdentity(element)[0]?.name ?? "Component"), h("div", { class: "muted", style: "font-size:12px" }, "and everything inside it. Nothing is sent until you press Send.")),
188
+ h("button", { class: "btn ghost", type: "button", onclick: () => app.startPicking("report") }, icon(ICONS.pick), "Change"),
189
+ ),
190
+ field("Title", "title", false, "Card loses its border in dark mode"),
191
+ field("What happened?", "happened", true, "What you saw"),
192
+ field("What did you expect?", "expected", true, "What should have happened"),
193
+ h("div", { class: "card", style: "padding:2px 14px" }, textToggle.row, findingsToggle.row, consoleToggle.row),
194
+ problems,
195
+ similar,
196
+ h("details", { class: "json-box" }, h("summary", {}, icon(ICONS.chevron), "Exactly what will be sent"), preview),
197
+ h("div", { class: "row" }, sendButton, linkButton, copyButton, downloadButton),
198
+ status,
199
+ );
200
+
201
+ /** The issues that may already report this, with a way to add to one instead of opening another. */
202
+ function similarCard() {
203
+ const found = r.similar;
204
+ if (!found || (!found.duplicates.length && !found.related.length)) return null;
205
+ const row = (issue, canAdd) =>
206
+ h(
207
+ "div",
208
+ { class: "similar-row" },
209
+ icon(issue.state === "closed" ? ICONS.issueClosed : ICONS.issueOpen, `icon state ${issue.state}`),
210
+ h(
211
+ "a",
212
+ { class: "grow similar-title", href: issue.url, target: "_blank", rel: "noreferrer" },
213
+ h("span", { class: "faint" }, `#${issue.number} `),
214
+ issue.title,
215
+ ),
216
+ canAdd
217
+ ? h("button", { class: "btn", type: "button", disabled: !r.snapshot || r.problems.length > 0 || r.status === "sending", onclick: () => send(issue.number) }, "Add my report here")
218
+ : null,
219
+ );
220
+ return h(
221
+ "div",
222
+ { class: `card similar${found.duplicates.length ? " likely" : ""}` },
223
+ found.duplicates.length
224
+ ? [
225
+ h("div", { class: "similar-head" }, icon(ICONS.copy), "This may already be reported"),
226
+ h("p", { class: "muted small" }, "Same component, same rule codes, same astralis-ui version. Adding your report to it tells the maintainers it happens to more people."),
227
+ found.duplicates.slice(0, 3).map((issue) => row(issue, true)),
228
+ ]
229
+ : null,
230
+ found.related.length
231
+ ? [
232
+ h("div", { class: "similar-head quiet" }, `Open issues about ${r.snapshot?.tree?.[0]?.component ?? "this component"}`),
233
+ found.related.map((issue) => row(issue, false)),
234
+ ]
235
+ : null,
236
+ );
237
+ }
238
+
239
+ function refresh() {
240
+ consoleToggle.text.textContent = `Include console errors (${app.consoleErrors.messages.length})`;
241
+ preview.textContent = r.snapshot ? JSON.stringify(r.snapshot, null, 2) : "Assembling…";
242
+ problems.replaceChildren(...r.problems.map((p) => h("li", {}, p)));
243
+ const signedIn = Boolean(app.state.github?.login);
244
+ sendButton.disabled = !signedIn || !r.snapshot || r.problems.length > 0 || r.status === "sending";
245
+ sendButton.title = signedIn ? "" : "Sign in with GitHub first";
246
+ linkButton.disabled = !r.snapshot || r.problems.length > 0;
247
+ copyButton.disabled = !r.snapshot;
248
+ downloadButton.disabled = !r.snapshot;
249
+ sendButton.lastChild.textContent = r.status === "sending" ? "Opening…" : "Open issue on GitHub";
250
+ similar.replaceChildren(...[similarCard()].filter(Boolean));
251
+ status.className = `report-status ${r.status}`;
252
+ status.replaceChildren(
253
+ r.status === "sent"
254
+ ? h(
255
+ "div",
256
+ { class: "card sent-card" },
257
+ h("span", { class: "sent-icon" }, icon(ICONS.check)),
258
+ h(
259
+ "div",
260
+ { class: "grow" },
261
+ h("div", { class: "sent-title" }, r.added ? `Added your report to #${r.number}` : `Opened #${r.number} on GitHub`),
262
+ h("p", { class: "muted small" }, "To add a screenshot or a file, open the issue and drop it into a comment there."),
263
+ h("a", { class: "btn primary", href: r.url, target: "_blank", rel: "noreferrer" }, icon(GITHUB_MARK), "Open the issue on GitHub", icon(ICONS.external)),
264
+ ),
265
+ )
266
+ : r.status === "failed"
267
+ ? `${r.message} Nothing was sent; Copy JSON or Download keeps the snapshot.`
268
+ : r.status === "notice"
269
+ ? r.message
270
+ : "",
271
+ );
272
+ }
273
+
274
+ refresh();
275
+ schedule();
276
+ return {
277
+ root,
278
+ // Current findings, not the ones from when the form was opened.
279
+ update(reason) {
280
+ refresh();
281
+ if (reason === "findings") schedule();
282
+ },
283
+ dispose: () => clearTimeout(timer),
284
+ };
285
+ }
286
+
287
+ /** Who is signed in to GitHub, or how to sign in. */
288
+ function accountCard(app) {
289
+ const gh = app.state.github;
290
+ const repo = gh?.repo ?? "sekiro-9/astralis-ui";
291
+ if (!gh) return h("div", { class: "card account" }, h("div", { class: "skeleton", style: "width:50%" }));
292
+ if (!gh.configured) {
293
+ return h(
294
+ "div",
295
+ { class: "notice" },
296
+ "GitHub sign-in is not set up in this version of the DevTools. Use Open on GitHub instead below: it fills in GitHub's own form, and you submit it there.",
297
+ );
298
+ }
299
+ if (gh.login) {
300
+ return h(
301
+ "div",
302
+ { class: "card account" },
303
+ h("span", { class: "gh-avatar" }, gh.login[0].toUpperCase()),
304
+ h("div", { class: "grow" }, h("div", { class: "account-name" }, gh.login), h("div", { class: "muted small" }, `Reports open issues on ${repo} as you.`)),
305
+ h("button", { class: "btn ghost", type: "button", onclick: () => app.github.signOut() }, icon(ICONS.signOut), "Sign out"),
306
+ );
307
+ }
308
+ if (gh.pending) {
309
+ const copied = h("span", {}, "Copy code");
310
+ return h(
311
+ "div",
312
+ { class: "card account pending" },
313
+ h(
314
+ "div",
315
+ { class: "grow" },
316
+ h("div", { class: "muted small" }, "Enter this code on GitHub"),
317
+ h("div", { class: "device-code", "aria-label": "Sign-in code" }, gh.pending.userCode),
318
+ h("div", { class: "row waiting" }, h("span", { class: "spinner" }), "Waiting for you to enter it…"),
319
+ ),
320
+ h(
321
+ "div",
322
+ { class: "account-actions" },
323
+ h("a", { class: "btn primary", href: gh.pending.verificationUri, target: "_blank", rel: "noreferrer" }, icon(GITHUB_MARK), "Open GitHub"),
324
+ h(
325
+ "button",
326
+ {
327
+ class: "btn",
328
+ type: "button",
329
+ onclick: async () => {
330
+ try {
331
+ await navigator.clipboard.writeText(gh.pending.userCode);
332
+ copied.textContent = "Copied";
333
+ } catch {
334
+ copied.textContent = "Copy it by hand";
335
+ }
336
+ },
337
+ },
338
+ icon(ICONS.copy),
339
+ copied,
340
+ ),
341
+ h("button", { class: "btn ghost", type: "button", onclick: () => app.github.signOut() }, "Cancel"),
342
+ ),
343
+ );
344
+ }
345
+ return h(
346
+ "div",
347
+ { class: "card account" },
348
+ h("span", { class: "gh-avatar muted-avatar" }, icon(GITHUB_MARK)),
349
+ h(
350
+ "div",
351
+ { class: "grow" },
352
+ h("div", { class: "account-name" }, "Sign in to report"),
353
+ h("div", { class: "muted small" }, `Issues open on ${repo} from your own account. The app can only read and write issues there. Or use Open on GitHub instead, with no sign-in.`),
354
+ gh.error ? h("div", { class: "account-error" }, gh.error) : null,
355
+ ),
356
+ h("button", { class: "btn primary", type: "button", onclick: () => app.github.signIn() }, icon(GITHUB_MARK), "Sign in with GitHub"),
357
+ );
358
+ }
359
+
360
+ const ago = (iso) => {
361
+ const seconds = Math.max(0, (Date.now() - Date.parse(iso)) / 1000);
362
+ const units = [["year", 31536000], ["month", 2592000], ["day", 86400], ["hour", 3600], ["minute", 60]];
363
+ for (const [unit, size] of units) if (seconds >= size) return `${plural(Math.floor(seconds / size), unit)} ago`;
364
+ return "just now";
365
+ };
366
+
367
+ /** The issues the reporter has opened, and where each stands. */
368
+ function yourIssues(app) {
369
+ const root = h("div", {});
370
+ function update() {
371
+ const gh = app.state.github;
372
+ const issues = app.state.issues;
373
+ if (!gh?.login) {
374
+ root.replaceChildren(empty(ICONS.report, "Your issues show here", "Sign in with GitHub to see the issues you have opened and where each stands.", { neutral: true }));
375
+ return;
376
+ }
377
+ const list = issues.list;
378
+ const head = h(
379
+ "div",
380
+ { class: "row", style: "margin-bottom:10px" },
381
+ h("span", { class: "muted grow small" }, list ? `${list.filter((i) => i.state === "open").length} open, ${list.filter((i) => i.state === "closed").length} closed` : ""),
382
+ h(
383
+ "button",
384
+ { class: "icon-button", type: "button", "aria-label": "Refresh", title: "Refresh", onclick: () => app.github.loadIssues() },
385
+ icon(ICONS.refresh, `icon${issues.loading ? " spinning" : ""}`),
386
+ ),
387
+ );
388
+ if (issues.error) return root.replaceChildren(head, h("div", { class: "notice" }, issues.error));
389
+ if (!list) return root.replaceChildren(head, h("div", { class: "stack" }, h("div", { class: "skeleton" }), h("div", { class: "skeleton", style: "width:70%" })));
390
+ if (!list.length) return root.replaceChildren(head, empty(ICONS.check, "No issues yet", "Reports you send open here, with their status as the maintainers work on them."));
391
+ root.replaceChildren(
392
+ head,
393
+ h(
394
+ "div",
395
+ { class: "file-card issue-list" },
396
+ list.map((issue) => {
397
+ const closed = issue.state === "closed";
398
+ const skipped = closed && issue.stateReason === "not_planned";
399
+ const status = closed ? (skipped ? "Closed, not planned" : "Closed, done") : "Open";
400
+ return h(
401
+ "a",
402
+ { class: `issue-row ${closed ? (skipped ? "skipped" : "done") : "open"}`, href: issue.url, target: "_blank", rel: "noreferrer" },
403
+ icon(closed ? ICONS.issueClosed : ICONS.issueOpen, "icon state"),
404
+ h(
405
+ "div",
406
+ { class: "grow" },
407
+ h("div", { class: "issue-title" }, issue.title),
408
+ h("div", { class: "issue-meta" }, `#${issue.number} · ${status} · updated ${ago(issue.updatedAt)}`, issue.comments ? ` · ${plural(issue.comments, "comment")}` : ""),
409
+ issue.labels.length ? h("div", { class: "tags", style: "margin-top:6px" }, issue.labels.map((label) => h("span", { class: "pill" }, label))) : null,
410
+ ),
411
+ icon(ICONS.external, "icon go"),
412
+ );
413
+ }),
414
+ ),
415
+ );
416
+ }
417
+ update();
418
+ return { root, update };
419
+ }
420
+
421
+ export function reportScreen(app) {
422
+ const { state } = app;
423
+ const account = h("div", {});
424
+ const tabs = h("div", { class: "segmented", role: "tablist", style: "margin:0 0 14px" });
425
+ const body = h("div", {});
426
+ let view = null;
427
+
428
+ function drawTabs() {
429
+ const count = state.issues.list?.length;
430
+ const tab = (id, label) =>
431
+ h("button", { type: "button", role: "tab", "data-tab": id, "aria-selected": String(state.reportTab === id), "aria-pressed": String(state.reportTab === id), onclick: () => show(id) }, label);
432
+ tabs.replaceChildren(tab("new", "New report"), tab("issues", count ? `Your issues (${count})` : "Your issues"));
433
+ }
434
+
435
+ function show(tab) {
436
+ state.reportTab = tab;
437
+ view?.dispose?.();
438
+ view = tab === "issues" ? yourIssues(app) : newReport(app);
439
+ body.replaceChildren(view.root);
440
+ drawTabs();
441
+ if (tab === "issues" && state.github?.login && !state.issues.list && !state.issues.loading) app.github.loadIssues();
442
+ }
443
+
444
+ const root = h("div", { class: "stack" }, account, h("div", {}, tabs, body));
445
+ account.replaceChildren(accountCard(app));
446
+ show(state.reportTab ?? "new");
447
+ return {
448
+ title: [{ label: "Report" }],
449
+ root,
450
+ update(reason) {
451
+ if (reason === "github") {
452
+ account.replaceChildren(accountCard(app));
453
+ drawTabs();
454
+ }
455
+ view.update(reason);
456
+ },
457
+ dispose: () => view?.dispose?.(),
458
+ };
459
+ }
@@ -0,0 +1,59 @@
1
+ import { filePath, h, icon } from "../dom.mjs";
2
+ import { ICONS } from "../icons.mjs";
3
+
4
+ /* Pieces more than one screen draws. */
5
+
6
+ /**
7
+ * One finding: where it is, what is wrong, and the component it is on. The
8
+ * component is a link to that component on the page when the page has it.
9
+ */
10
+ export function findingRow(app, finding, { showFile = false, exactLabel = null, showComponent = true } = {}) {
11
+ const target = finding.component ? app.instanceFor(finding) : null;
12
+ const component = finding.component && showComponent
13
+ ? target
14
+ ? h("button", { class: "chip", type: "button", title: "Inspect it on the page", onclick: () => app.openComponent(target.element) }, finding.component, icon(ICONS.chevron))
15
+ : h("span", { class: "chip", title: "Not on this page" }, finding.component)
16
+ : null;
17
+ return h(
18
+ "div",
19
+ { class: `finding ${finding.kind}` },
20
+ h("span", { class: "at" }, `${finding.line}:${finding.column}`),
21
+ h("span", { class: "message" }, finding.message),
22
+ h(
23
+ "div",
24
+ { class: "meta" },
25
+ exactLabel ? h("span", { class: "chip exact" }, icon(ICONS.check), exactLabel) : null,
26
+ component,
27
+ showFile ? h("span", { class: "chip" }, filePath(finding.file)) : null,
28
+ h("span", { class: "rule" }, finding.code),
29
+ ),
30
+ );
31
+ }
32
+
33
+ /** A friendly empty state. */
34
+ export function empty(iconMarkup, title, text, { neutral = false } = {}) {
35
+ return h("div", { class: `empty${neutral ? " neutral" : ""}` }, icon(iconMarkup), h("h3", {}, title), text ? h("p", {}, text) : null);
36
+ }
37
+
38
+ /** The bridge cannot be reached: say what to add, for the framework in use. */
39
+ export function bridgeMissing(app) {
40
+ const { base, framework } = app;
41
+ return h(
42
+ "div",
43
+ { class: "notice" },
44
+ h("p", { style: "margin-bottom:8px" }, "The DevTools bridge is not answering at ", h("code", {}, base), "."),
45
+ framework === "next"
46
+ ? h(
47
+ "p",
48
+ {},
49
+ "Add ",
50
+ h("code", {}, "app/api/astralis-devtools/[...path]/route.ts"),
51
+ " containing ",
52
+ h("code", {}, 'export { GET, POST } from "astralis-devtools/next/route";'),
53
+ ", or run ",
54
+ h("code", {}, "astralis init --devtools"),
55
+ ".",
56
+ )
57
+ : h("p", {}, "Is the dev server running? The bridge answers this machine only."),
58
+ );
59
+ }