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.
package/CHANGELOG.md ADDED
@@ -0,0 +1,71 @@
1
+ # Changelog
2
+
3
+ All notable changes to `astralis-devtools`.
4
+
5
+ ## 0.2.0 (2026-11-21)
6
+
7
+ Uses astralis-cli 0.6.0 and reads the prop descriptions astralis-ui 0.10.0 puts in its system spec.
8
+
9
+ ### Added
10
+
11
+ - **Every prop a component takes, on its page.** Under the props it was
12
+ given, the component's page now lists every prop the installed system spec
13
+ says it accepts: its own props first, then its style props by group (Box,
14
+ Placement, Text…). Each shows the values it takes (a long scale shows its
15
+ first few and opens to the rest), whether it is required, its description
16
+ and default where the spec has them, and the value this instance uses. A
17
+ search finds a prop by name, long spelling (`padding` finds `p`) or value.
18
+ Groups other than the first open when asked for. On a trigger wrapping a
19
+ Button, both can be listed.
20
+ - **Minimize.** The panel's header has a minimize button that folds it down
21
+ to the launcher, leaving the page free to click. The launcher's mark,
22
+ `Shift+Alt+A` or Escape from inside the panel do the same, and bringing it
23
+ back returns to the screen it was on. Whether it is open stays for the
24
+ browser tab's session, as before.
25
+
26
+ ### Changed
27
+
28
+ - `Shift+Alt+A` brings the panel back on the screen it was minimized on,
29
+ instead of on Home.
30
+ - After a report is sent, a confirmation shows **Open the issue on GitHub**
31
+ and says how to add a screenshot or a file there. No tab opens by itself.
32
+
33
+ ### Removed
34
+
35
+ - **The Report screen's screenshot.** Capturing the tab could include the
36
+ open panel itself, and GitHub's API cannot attach images anyway. Pictures
37
+ and files are added on GitHub, in the issue. The snapshot DevTools builds
38
+ no longer carries a `screenshot` field; the snapshot format still accepts
39
+ one, so snapshots filed before and `astralis report` are unchanged.
40
+
41
+ ## 0.1.0 (2026-11-19)
42
+
43
+ The first release: a development overlay for Astralis UI. A launcher you can
44
+ drag anywhere on the page opens a panel with five screens.
45
+
46
+ - **Home.** The components on the page, the findings and the recommendations,
47
+ at a glance.
48
+ - **Components.** Every Astralis component on the page, grouped by kind. Each
49
+ opens a page of its own with its name, the props it was given, how it
50
+ reaches the browser (Server Component, client island or Client Component),
51
+ where it sits, a link to its docs, and the findings about it. Server
52
+ Components are included.
53
+ - **Findings** and **Recommendations.** The errors and the warnings of
54
+ `astralis validate` for the project, kept current as you save. On Next.js,
55
+ the files that render the current page are listed first.
56
+ - **Report.** Open a problem as a GitHub issue from your own account, with an
57
+ issue snapshot of the picked component and a reproduction. You see the
58
+ exact JSON first, page text is replaced by placeholders unless you include
59
+ it, and nothing is sent until you press Send. Sign-in is a code entered on
60
+ github.com; the token stays with the dev server. A likely duplicate is shown
61
+ before you send, and your report can be added to it instead. **Open on
62
+ GitHub instead** fills in GitHub's own form, with no sign-in. **Your issues**
63
+ lists the issues you have opened and where each stands.
64
+
65
+ `Shift+Alt+A` opens and closes it, and `Shift+Alt+C` picks a component on the
66
+ page. It wears the Astralis brand, with its fonts embedded, and needs no
67
+ network.
68
+
69
+ Set it up with `npx astralis-cli init --devtools`. It runs in development
70
+ only; production builds contain none of it. Requires astralis-ui 0.8.0 or
71
+ later, whose development builds name each component on the page.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Paul Andrew
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,86 @@
1
- # Temporary Holding Version
2
-
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
1
+ # astralis-devtools
2
+
3
+ A development overlay for [Astralis UI](https://astralis-ui.com). A small
4
+ launcher, which you can drag anywhere on the page, opens a panel with five
5
+ screens:
6
+
7
+ - **Home.** What is on the page at a glance.
8
+ - **Components.** Every Astralis component on the page, grouped by kind. Each
9
+ opens a page of its own: its name, the props it was given, every prop it
10
+ takes with the values each accepts (searchable by name or value), how it
11
+ reaches the browser (Server Component, client island or Client Component), where it
12
+ sits, a link to its documentation, and the findings about it. This includes
13
+ Server Components, which React DevTools cannot see because they never
14
+ hydrate.
15
+ - **Findings.** What `astralis validate` says is broken in your project, kept
16
+ current as you save. On Next.js, the files that render the current page are
17
+ listed first.
18
+ - **Recommendations.** The validator's warnings: what works but could be
19
+ better.
20
+ - **Report.** Open a problem as a GitHub issue on the Astralis repository,
21
+ from your own account, with an issue snapshot: the components under the one
22
+ you picked with their props, the versions in use, the validator's findings
23
+ and a small reproduction. You see the exact JSON first, page text is
24
+ replaced by placeholders unless you include it, and nothing is sent until
25
+ you press Send. To add a screenshot or a file, open the issue on GitHub
26
+ once it is created and drop it in there. **Your issues** lists the issues
27
+ you have opened and where each stands.
28
+
29
+ The minimize button in the panel's header, `Shift+Alt+A`, or Escape from
30
+ inside the panel fold it down to the launcher, so the page is free to use; the
31
+ launcher or `Shift+Alt+A` brings it back where it was. `Shift+Alt+C` picks a
32
+ component on the page and opens its page.
33
+
34
+ It runs in development only. Production builds contain none of it, and the
35
+ library's production HTML carries no DevTools attributes.
36
+
37
+ ## Set up
38
+
39
+ ```bash
40
+ npx astralis-cli init --devtools
41
+ ```
42
+
43
+ New projects made with `npm create astralis` have it already. To wire it by hand:
44
+
45
+ **Next.js.** Add the component to the root layout:
46
+
47
+ ```tsx
48
+ import { AstralisDevTools } from "astralis-devtools/next";
49
+
50
+ <body>
51
+ {children}
52
+ <AstralisDevTools />
53
+ </body>
54
+ ```
55
+
56
+ Then add the bridge's route at `app/api/astralis-devtools/[...path]/route.ts`:
57
+
58
+ ```ts
59
+ export { GET, POST } from "astralis-devtools/next/route";
60
+ ```
61
+
62
+ **Vite.** Add the plugin:
63
+
64
+ ```ts
65
+ import { astralisDevtools } from "astralis-devtools/vite";
66
+
67
+ export default defineConfig({ plugins: [react(), astralisDevtools()] });
68
+ ```
69
+
70
+ ## How it works
71
+
72
+ In development, every astralis-ui component names itself on the element it
73
+ renders (`data-astralis="Card.Body"`), together with the props it was
74
+ configured with. The overlay reads those attributes.
75
+
76
+ A small bridge runs inside your dev server. It validates your `.tsx` and
77
+ `.jsx` files against the installed astralis-ui's `system-spec.json` and
78
+ re-validates each file when you save it. It answers requests from your own
79
+ machine only. On Next.js it is the route above, and it returns 404 in
80
+ production. On Vite it is dev-server middleware that `vite build` never loads.
81
+
82
+ The overlay talks only to your own dev server. The bridge talks to GitHub only for you: to sign you in with a code (through the Astralis DevTools GitHub App, which can only read and write issues on the Astralis repository), to open a report you have read and sent, and, while you are signed in, to list your issues. The token is kept in a file in your user config directory that only you can read, never in the page, and `astralis report` shares it.
83
+
84
+ ## License
85
+
86
+ MIT
package/package.json CHANGED
@@ -1,6 +1,69 @@
1
1
  {
2
2
  "name": "astralis-devtools",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.2.0",
4
+ "description": "Development overlay for Astralis UI: inspect any component on the page (Server Components included) and see the validator's findings live as you edit. Next.js and Vite.",
5
+ "type": "module",
6
+ "license": "MIT",
7
+ "author": "Paul Andrew",
8
+ "homepage": "https://astralis-ui.com/docs/devtools",
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "git+https://github.com/sekiro-9/astralis-ui.git",
12
+ "directory": "packages/astralis-devtools"
13
+ },
14
+ "bugs": {
15
+ "url": "https://github.com/sekiro-9/astralis-ui/issues"
16
+ },
17
+ "keywords": [
18
+ "astralis-ui",
19
+ "devtools",
20
+ "react",
21
+ "nextjs",
22
+ "vite",
23
+ "design-system"
24
+ ],
25
+ "exports": {
26
+ "./next": {
27
+ "types": "./src/next/devtools.d.mts",
28
+ "default": "./src/next/devtools.mjs"
29
+ },
30
+ "./next/route": {
31
+ "types": "./src/next/route.d.mts",
32
+ "default": "./src/next/route.mjs"
33
+ },
34
+ "./vite": {
35
+ "types": "./src/vite.d.mts",
36
+ "default": "./src/vite.mjs"
37
+ },
38
+ "./client": {
39
+ "types": "./src/client/overlay.d.mts",
40
+ "default": "./src/client/overlay.mjs"
41
+ }
42
+ },
43
+ "files": [
44
+ "src",
45
+ "CHANGELOG.md"
46
+ ],
47
+ "engines": {
48
+ "node": "^22.18.0 || >=24.11.0"
49
+ },
50
+ "dependencies": {
51
+ "astralis-cli": "^0.6.0"
52
+ },
53
+ "peerDependencies": {
54
+ "react": "^19.1.1"
55
+ },
56
+ "peerDependenciesMeta": {
57
+ "react": {
58
+ "optional": true
59
+ }
60
+ },
61
+ "devDependencies": {
62
+ "jsdom": "^29.1.1",
63
+ "react": "^19.1.1",
64
+ "vite": "^7.1.2"
65
+ },
66
+ "scripts": {
67
+ "test": "node --test \"test/*.test.mjs\""
68
+ }
6
69
  }
@@ -0,0 +1,169 @@
1
+ import { readFileSync, statSync, watch } from "node:fs";
2
+ import { join, relative, resolve, sep } from "node:path";
3
+ import {
4
+ collectSourceFiles,
5
+ findInstalledSpec,
6
+ prepareSpec,
7
+ SKIP_DIRS,
8
+ SOURCE_FILE,
9
+ validateSource,
10
+ } from "astralis-cli/validate";
11
+ import { projectInfo, routeFiles } from "./project.mjs";
12
+
13
+ /* The local bridge: validates the project's source files against the
14
+ installed astralis-ui's spec, keeps the findings current as files change,
15
+ and tells whoever is listening (the overlay's event stream). It runs inside
16
+ the dev server process and only there. */
17
+
18
+ const DEBOUNCE_MS = 60;
19
+ /** Files validated per turn of the event loop, so a large project never stalls the dev server. */
20
+ const BATCH = 25;
21
+
22
+ const toPosix = (path) => path.split(sep).join("/");
23
+
24
+ /** fs.watch over the whole project; node_modules and build output are ignored by the caller. */
25
+ function watchProject(root, onChange) {
26
+ const watcher = watch(root, { recursive: true }, (_event, filename) => {
27
+ if (filename) onChange(join(root, filename.toString()));
28
+ });
29
+ watcher.on("error", () => {});
30
+ return () => watcher.close();
31
+ }
32
+
33
+ const nextTurn = () => new Promise((done) => setImmediate(done));
34
+
35
+ export class Bridge {
36
+ /**
37
+ * @param {object} options
38
+ * @param {string} options.root project directory
39
+ * @param {"next" | "vite"} options.framework
40
+ * @param {(onChange: (path: string) => void) => () => void} [options.watch]
41
+ * subscribe to file changes; defaults to fs.watch over `root`
42
+ */
43
+ constructor({ root, framework, watch: subscribe }) {
44
+ this.root = resolve(root);
45
+ this.framework = framework;
46
+ this.subscribe = subscribe ?? ((onChange) => watchProject(this.root, onChange));
47
+ this.results = new Map(); // relative path -> { errors, warnings }
48
+ this.listeners = new Set();
49
+ this.version = 0;
50
+ this.pending = new Map();
51
+ this.ready = null;
52
+ this.problem = null;
53
+ this.stopWatching = null;
54
+ }
55
+
56
+ /** Load the spec and validate everything once; later calls wait for the same run. */
57
+ start() {
58
+ this.ready ??= this.#load();
59
+ return this.ready;
60
+ }
61
+
62
+ async #load() {
63
+ const specPath = findInstalledSpec(this.root);
64
+ if (!specPath) {
65
+ this.problem = "astralis-ui is not installed in this project, so there is no spec to validate against.";
66
+ return;
67
+ }
68
+ this.specText = readFileSync(specPath, "utf8");
69
+ this.spec = JSON.parse(this.specText);
70
+ this.prepared = prepareSpec(this.spec);
71
+ this.info = projectInfo(this.root, this.framework, this.spec, this.specText);
72
+
73
+ const files = collectSourceFiles(this.root) ?? [];
74
+ for (let i = 0; i < files.length; i += BATCH) {
75
+ for (const file of files.slice(i, i + BATCH)) this.#validate(file);
76
+ await nextTurn();
77
+ }
78
+ this.version++;
79
+ this.stopWatching = this.subscribe((path) => this.#changed(path));
80
+ }
81
+
82
+ /** Whether a changed path is a source file the bridge tracks. */
83
+ #tracks(path) {
84
+ const rel = relative(this.root, path);
85
+ if (rel.startsWith("..") || !SOURCE_FILE.test(rel)) return false;
86
+ return !rel.split(sep).some((part) => SKIP_DIRS.has(part));
87
+ }
88
+
89
+ #validate(file) {
90
+ const rel = toPosix(relative(this.root, file));
91
+ let source;
92
+ try {
93
+ source = readFileSync(file, "utf8");
94
+ } catch {
95
+ return this.results.delete(rel);
96
+ }
97
+ // Raw colours are advice here: the DevTools show them under Recommendations.
98
+ const { errors, warnings } = validateSource(source, this.prepared, rel, { strictTokens: true });
99
+ this.results.set(rel, { errors, warnings });
100
+ return true;
101
+ }
102
+
103
+ #changed(path) {
104
+ if (!this.#tracks(path)) return;
105
+ clearTimeout(this.pending.get(path));
106
+ this.pending.set(
107
+ path,
108
+ setTimeout(() => {
109
+ this.pending.delete(path);
110
+ if (statSync(path, { throwIfNoEntry: false })?.isFile()) this.#validate(path);
111
+ else this.results.delete(toPosix(relative(this.root, path)));
112
+ this.version++;
113
+ const snapshot = this.findings();
114
+ for (const listener of this.listeners) listener(snapshot);
115
+ }, DEBOUNCE_MS),
116
+ );
117
+ }
118
+
119
+ /** Every tracked file with its findings, files with problems first. */
120
+ findings() {
121
+ if (this.problem) return { version: this.version, problem: this.problem };
122
+ let errors = 0;
123
+ let warnings = 0;
124
+ const results = [];
125
+ for (const [file, found] of this.results) {
126
+ errors += found.errors.length;
127
+ warnings += found.warnings.length;
128
+ if (found.errors.length || found.warnings.length) results.push({ file, ...found });
129
+ }
130
+ results.sort((a, b) => b.errors.length - a.errors.length || a.file.localeCompare(b.file));
131
+ return { version: this.version, files: this.results.size, errors, warnings, results };
132
+ }
133
+
134
+ /** The files that render `pathname` (Next.js app router), project-relative. */
135
+ routeFiles(pathname) {
136
+ return this.framework === "next" ? routeFiles([...this.results.keys()], pathname) : [];
137
+ }
138
+
139
+ /** Call `listener(findings)` after every change; returns the unsubscribe. */
140
+ listen(listener) {
141
+ this.listeners.add(listener);
142
+ return () => this.listeners.delete(listener);
143
+ }
144
+
145
+ close() {
146
+ this.stopWatching?.();
147
+ for (const timer of this.pending.values()) clearTimeout(timer);
148
+ this.pending.clear();
149
+ this.listeners.clear();
150
+ }
151
+ }
152
+
153
+ /*
154
+ * One bridge per project per process. Next.js re-evaluates a route module
155
+ * when it recompiles, so the instance lives on globalThis rather than in
156
+ * module scope, or every recompile would start a second watcher.
157
+ */
158
+ const INSTANCES = Symbol.for("astralis-devtools.bridges");
159
+
160
+ export function bridgeFor(root, framework, options = {}) {
161
+ const instances = (globalThis[INSTANCES] ??= new Map());
162
+ const key = `${framework}:${resolve(root)}`;
163
+ let bridge = instances.get(key);
164
+ if (!bridge) {
165
+ bridge = new Bridge({ root, framework, ...options });
166
+ instances.set(key, bridge);
167
+ }
168
+ return bridge;
169
+ }
@@ -0,0 +1,139 @@
1
+ import { checkSnapshot } from "astralis-cli/snapshot";
2
+ import {
3
+ GitHubError,
4
+ clientId,
5
+ commentFromSnapshot,
6
+ commentOnIssue,
7
+ createIssue,
8
+ findSimilar,
9
+ finishSignIn,
10
+ issueFromSnapshot,
11
+ issuesRepo,
12
+ listIssues,
13
+ matchKeys,
14
+ newIssueUrl,
15
+ startSignIn,
16
+ tokenStore,
17
+ } from "astralis-cli/github";
18
+
19
+ /** How long a search for similar issues is reused: typing in the form must not search GitHub per keystroke. */
20
+ const SIMILAR_TTL_MS = 60_000;
21
+
22
+ /* The bridge's GitHub session: signing in with a code, the saved sign-in
23
+ (shared with `astralis report`), and the reporter's issues. The token stays
24
+ in this process and in the user's config file; the page only ever learns
25
+ the login, the code to enter, and the issues. */
26
+
27
+ export class GitHubSession {
28
+ constructor({ store = tokenStore(), fetchImpl = globalThis.fetch, sleep } = {}) {
29
+ this.store = store;
30
+ this.fetchImpl = fetchImpl;
31
+ this.sleep = sleep;
32
+ this.pending = null; // { userCode, verificationUri, expiresAt, controller }
33
+ this.error = null; // the last sign-in's failure, shown once
34
+ this.searches = new Map(); // fingerprint -> { at, result }
35
+ }
36
+
37
+ /** What the page may know: whether sign-in is set up, who is signed in, and a sign-in under way. */
38
+ status() {
39
+ const saved = this.store.read();
40
+ const pending = this.pending && this.pending.expiresAt > Date.now() ? this.pending : null;
41
+ return {
42
+ configured: Boolean(clientId()),
43
+ repo: issuesRepo(),
44
+ login: saved?.login ?? null,
45
+ pending: pending ? { userCode: pending.userCode, verificationUri: pending.verificationUri, expiresAt: pending.expiresAt } : null,
46
+ error: this.error,
47
+ };
48
+ }
49
+
50
+ /** Start a sign-in, or return the one under way. GitHub is polled here, not by the page. */
51
+ async signIn() {
52
+ if (this.store.read()) return this.status();
53
+ if (this.pending && this.pending.expiresAt > Date.now()) return this.status();
54
+ this.error = null;
55
+ const flow = await startSignIn({ fetchImpl: this.fetchImpl });
56
+ const controller = new AbortController();
57
+ this.pending = { userCode: flow.userCode, verificationUri: flow.verificationUri, expiresAt: flow.expiresAt, controller };
58
+ const mine = this.pending;
59
+ finishSignIn(flow, { fetchImpl: this.fetchImpl, signal: controller.signal, ...(this.sleep ? { sleep: this.sleep } : {}) })
60
+ .then((signedIn) => {
61
+ if (this.pending === mine) this.store.write(signedIn);
62
+ })
63
+ .catch((error) => {
64
+ if (this.pending === mine && error.code !== "cancelled") this.error = error.message;
65
+ })
66
+ .finally(() => {
67
+ if (this.pending === mine) this.pending = null;
68
+ });
69
+ return this.status();
70
+ }
71
+
72
+ signOut() {
73
+ this.pending?.controller.abort();
74
+ this.pending = null;
75
+ this.error = null;
76
+ this.store.clear();
77
+ return this.status();
78
+ }
79
+
80
+ /** The saved token, or a GitHubError saying to sign in. */
81
+ #token() {
82
+ const saved = this.store.read();
83
+ if (!saved) throw new GitHubError("signed-out", "Sign in with GitHub first.");
84
+ return saved;
85
+ }
86
+
87
+ /** Run `work` with the token; a token GitHub no longer accepts is forgotten. */
88
+ async #withToken(work) {
89
+ const saved = this.#token();
90
+ try {
91
+ return await work(saved);
92
+ } catch (error) {
93
+ if (error.code === "signed-out") this.store.clear();
94
+ throw error;
95
+ }
96
+ }
97
+
98
+ issues() {
99
+ return this.#withToken(({ token, login }) => listIssues(token, login, { fetchImpl: this.fetchImpl }));
100
+ }
101
+
102
+ /** Issues that may already report this snapshot's problem, searched once per fingerprint a minute. */
103
+ async similar(snapshot) {
104
+ const { fingerprint } = matchKeys(snapshot ?? {});
105
+ if (!fingerprint) return { duplicates: [], related: [] };
106
+ const cached = this.searches.get(fingerprint);
107
+ if (cached && Date.now() - cached.at < SIMILAR_TTL_MS) return cached.result;
108
+ const result = await this.#withToken(({ token }) => findSimilar(token, snapshot, { fetchImpl: this.fetchImpl }));
109
+ this.searches.set(fingerprint, { at: Date.now(), result });
110
+ return result;
111
+ }
112
+
113
+ /** GitHub's own form for the snapshot, filled in: reporting with no sign-in. Makes no request. */
114
+ link(snapshot) {
115
+ const problems = checkSnapshot(snapshot);
116
+ if (problems.length) throw new GitHubError("invalid", `The snapshot is not valid: ${problems.join("; ")}`);
117
+ return { url: newIssueUrl(snapshot) };
118
+ }
119
+
120
+ /**
121
+ * Send a confirmed snapshot: a new issue, or, with `addTo`, a comment on
122
+ * that existing issue. Resolves to { number, url }.
123
+ */
124
+ submit(snapshot, { addTo = null } = {}) {
125
+ const problems = checkSnapshot(snapshot);
126
+ if (problems.length) return Promise.reject(new GitHubError("invalid", `The snapshot is not valid: ${problems.join("; ")}`));
127
+ // What was sent changes what a search should find next.
128
+ this.searches.clear();
129
+ return this.#withToken(({ token }) =>
130
+ addTo
131
+ ? commentOnIssue(token, addTo, commentFromSnapshot(snapshot), { fetchImpl: this.fetchImpl })
132
+ : createIssue(token, issueFromSnapshot(snapshot), { fetchImpl: this.fetchImpl }),
133
+ );
134
+ }
135
+ }
136
+
137
+ let shared = null;
138
+ /** The dev server's one session. */
139
+ export const githubSession = () => (shared ??= new GitHubSession());