Skip to content

Commit bc3b0f2

Browse files
authored
docs(ams): port docs/env-reference.md to a generated website docs page (docs.ams-env-reference.tsx) (#6385)
* docs(ams): port docs/env-reference.md to a generated website docs page (docs.ams-env-reference.tsx) Extend packages/loopover-miner/scripts/generate-env-reference.mjs to also emit apps/loopover-ui/src/lib/ams-env-reference.ts (AMS_ENV_REFERENCE_ROWS + AMS_ENV_REFERENCE_MARKDOWN), mirroring scripts/gen-selfhost-env-reference.mjs's renderSelfHostEnvReferenceModule exactly. npm run miner:env-reference(:check) now writes/verifies both the existing markdown doc and the new TS module, so a new LOOPOVER_MINER_*/MINER_* read still fails CI drift-check until both are regenerated. packages/loopover-miner/docs/env-reference.md is untouched in content (still generator-owned, "do not edit manually") and stays the canonical source shipped in the npm package. Add content/docs/ams-env-reference.mdx, which imports AMS_ENV_REFERENCE_MARKDOWN and renders it via <CodeBlock>, the same pattern docs.self-hosting-configuration.tsx already uses for SELFHOST_ENV_REFERENCE_MARKDOWN -- not a hand-copied table. Add the page to docs-nav.tsx's "AMS: deployment" subgroup and to docs.index.tsx's Maintainers audience card, and repoint ams-operations-runbook.mdx's and ams-config-precedence.mdx's GitHub-blob env-reference.md cross-references to the new in-app route. Extend test/unit/miner-env-reference-script.test.ts with module-generation and drift-detection tests mirroring test/unit/selfhost-env-reference-script.test.ts. * fix(miner): add generate-env-reference.d.mts declarations for the new module-generation exports Root tsc --noEmit resolves types for generate-env-reference.mjs from its hand-maintained .d.mts sidecar, not from the .mjs source -- the sidecar was missed when renderMinerEnvReferenceModule/writeMinerEnvReferenceModule/ DEFAULT_MODULE_OUTPUT_PATH were added, so root typecheck failed with "has no exported member" even though the .mjs implementation was correct. * fix(miner): keep generated ams-env-reference.ts Prettier-clean at generation time The project's Prettier config prefers double quotes (singleQuote: false) but still switches a given string to single quotes when that needs fewer escapes. Every markdown line whose row has a quoted-string defaultValue (rendered as `""` / `"production"` in the table) embeds literal double quotes, so JSON.stringify-ing that line (always double-quoted) produced output ui:lint's prettier/prettier rule immediately flagged as needing single-quote reformatting -- and since this file is generated, a one-off --fix would just be undone by the next `npm run miner:env-reference`. Replicate Prettier's fewer-escapes quote choice in the generator itself (quoteJsStringLiteral), so a fresh run's output is already lint-clean.
1 parent aa83a48 commit bc3b0f2

11 files changed

Lines changed: 458 additions & 10 deletions

File tree

apps/loopover-ui/content/docs/ams-config-precedence.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,5 +182,5 @@ goal-spec override.
182182
## See also
183183

184184
- [`packages/loopover-miner/docs/miner-goal-spec.md`](https://github.com/JSONbored/loopover/blob/main/packages/loopover-miner/docs/miner-goal-spec.md) — goal-spec field reference
185-
- [`packages/loopover-miner/docs/env-reference.md`](https://github.com/JSONbored/loopover/blob/main/packages/loopover-miner/docs/env-reference.md) — generated operator env list
185+
- [AMS environment variable reference](/docs/ams-env-reference) — generated operator env list
186186
- ORB's `.loopover.yml` precedence (`yml > DB > defaults`) in [Self-hosting configuration](/docs/self-hosting-configuration) — analogous documentation style, different runtime
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
title: AMS environment variable reference
3+
description: Every LOOPOVER_MINER_* / MINER_* env var the miner reads, where it's first referenced in code, and its default -- generated from source, never hand-copied.
4+
---
5+
6+
import { AMS_ENV_REFERENCE_MARKDOWN } from "@/lib/ams-env-reference";
7+
8+
AMS's environment-variable reference: every `LOOPOVER_MINER_*` / `MINER_*` var the miner reads,
9+
where it's first referenced in code, and its default. This is the AMS-side counterpart to
10+
[Self-hosting configuration](/docs/self-hosting-configuration)'s generated env reference — see
11+
the [AMS deployment guide](/docs/ams-deployment) and [AMS config
12+
precedence](/docs/ams-config-precedence) for how these variables fit into the broader
13+
laptop/fleet setup and precedence model.
14+
15+
<Callout variant="note">
16+
This table is generated from `env.NAME` reads (and the `resolveLocalStoreDbPath` /
17+
`LOOPOVER_MINER_*_DB` per-store override pattern) under
18+
`packages/loopover-miner/{bin,lib,scripts}`. It intentionally includes names, first source
19+
references, and defaults only, never example values — and it's checked for drift in CI
20+
(`npm run miner:env-reference:check`), so a new `LOOPOVER_MINER_*`/`MINER_*` read that isn't
21+
reflected here fails the build until this reference is regenerated.
22+
</Callout>
23+
24+
<CodeBlock filename="AMS env vars" code={AMS_ENV_REFERENCE_MARKDOWN} />

apps/loopover-ui/content/docs/ams-operations-runbook.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,6 @@ store filename.
275275

276276
- [AMS deployment guide](/docs/ams-deployment) — laptop vs fleet, volumes, systemd, scaling rules
277277
- [`packages/loopover-miner/README.md`](https://github.com/JSONbored/loopover/blob/main/packages/loopover-miner/README.md#local-storage) — store inventory
278-
- [`packages/loopover-miner/docs/env-reference.md`](https://github.com/JSONbored/loopover/blob/main/packages/loopover-miner/docs/env-reference.md) — per-store path overrides
278+
- [AMS environment variable reference](/docs/ams-env-reference) — per-store path overrides
279279
- [`packages/loopover-miner/docs/coding-agent-driver.md`](https://github.com/JSONbored/loopover/blob/main/packages/loopover-miner/docs/coding-agent-driver.md) — attempt log semantics
280280
- [`packages/loopover-miner/docs/discovery-plane-operator-guide.md`](https://github.com/JSONbored/loopover/blob/main/packages/loopover-miner/docs/discovery-plane-operator-guide.md) — optional hosted plane (distinct from local ledger ops)

apps/loopover-ui/src/components/site/docs-nav.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ export const docsNav: DocsGroup[] = [
8181
{ to: "/docs/ams-unattended-scheduling", label: "Unattended scheduling" },
8282
{ to: "/docs/ams-sizing", label: "Resource sizing" },
8383
{ to: "/docs/ams-config-precedence", label: "Config precedence" },
84+
{ to: "/docs/ams-env-reference", label: "Env var reference" },
8485
],
8586
},
8687
],
Lines changed: 199 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,199 @@
1+
// Generated by scripts/generate-env-reference.mjs (npm run miner:env-reference). Do not edit manually.
2+
export type MinerEnvReferenceRow = {
3+
name: string;
4+
firstReference: string;
5+
defaultValue: string | null;
6+
};
7+
8+
export const AMS_ENV_REFERENCE_ROWS: MinerEnvReferenceRow[] = [
9+
{
10+
name: "LOOPOVER_MINER_AMS_COLLECTOR_TOKEN",
11+
firstReference: "lib/orb-export.js",
12+
defaultValue: "",
13+
},
14+
{
15+
name: "LOOPOVER_MINER_AMS_COLLECTOR_URL",
16+
firstReference: "lib/orb-export.js",
17+
defaultValue: "",
18+
},
19+
{
20+
name: "LOOPOVER_MINER_AMS_OAUTH_CLIENT_ID",
21+
firstReference: "lib/oauth-device-flow.js",
22+
defaultValue: "",
23+
},
24+
{
25+
name: "LOOPOVER_MINER_AMS_POLICY_PATH",
26+
firstReference: "lib/ams-policy.js",
27+
defaultValue: null,
28+
},
29+
{
30+
name: "LOOPOVER_MINER_ATTEMPT_LOG_DB",
31+
firstReference: "lib/attempt-log.js",
32+
defaultValue: null,
33+
},
34+
{
35+
name: "LOOPOVER_MINER_CLAIM_LEDGER_DB",
36+
firstReference: "lib/claim-ledger.js",
37+
defaultValue: null,
38+
},
39+
{
40+
name: "LOOPOVER_MINER_CONFIG_DIR",
41+
firstReference: "lib/deny-hook-synthesis.js",
42+
defaultValue: "",
43+
},
44+
{
45+
name: "LOOPOVER_MINER_DENY_HOOK_SYNTHESIS_DB",
46+
firstReference: "lib/deny-hook-synthesis.js",
47+
defaultValue: "",
48+
},
49+
{
50+
name: "LOOPOVER_MINER_EVENT_LEDGER_DB",
51+
firstReference: "lib/event-ledger.js",
52+
defaultValue: null,
53+
},
54+
{
55+
name: "LOOPOVER_MINER_GOVERNOR_LEDGER_DB",
56+
firstReference: "lib/governor-ledger.js",
57+
defaultValue: "",
58+
},
59+
{
60+
name: "LOOPOVER_MINER_GOVERNOR_STATE_DB",
61+
firstReference: "lib/governor-state.js",
62+
defaultValue: null,
63+
},
64+
{
65+
name: "LOOPOVER_MINER_KILL_SWITCH",
66+
firstReference: "lib/config-precedence.js",
67+
defaultValue: "",
68+
},
69+
{
70+
name: "LOOPOVER_MINER_LOG_LEVEL",
71+
firstReference: "lib/logger.js",
72+
defaultValue: "",
73+
},
74+
{
75+
name: "LOOPOVER_MINER_NO_UPDATE_CHECK",
76+
firstReference: "lib/update-check.js",
77+
defaultValue: "",
78+
},
79+
{
80+
name: "LOOPOVER_MINER_ORB_EXPORT_DB",
81+
firstReference: "lib/orb-export.js",
82+
defaultValue: "",
83+
},
84+
{
85+
name: "LOOPOVER_MINER_PLAN_STORE_DB",
86+
firstReference: "lib/plan-store.js",
87+
defaultValue: "",
88+
},
89+
{
90+
name: "LOOPOVER_MINER_POLICY_DOC_CACHE_DB",
91+
firstReference: "lib/policy-doc-cache.js",
92+
defaultValue: null,
93+
},
94+
{
95+
name: "LOOPOVER_MINER_POLICY_VERDICT_CACHE_DB",
96+
firstReference: "lib/policy-verdict-cache.js",
97+
defaultValue: null,
98+
},
99+
{
100+
name: "LOOPOVER_MINER_PORTFOLIO_QUEUE_DB",
101+
firstReference: "lib/portfolio-queue.js",
102+
defaultValue: null,
103+
},
104+
{
105+
name: "LOOPOVER_MINER_PREDICTION_LEDGER_DB",
106+
firstReference: "lib/prediction-ledger.js",
107+
defaultValue: "",
108+
},
109+
{
110+
name: "LOOPOVER_MINER_RANKED_CANDIDATES_DB",
111+
firstReference: "lib/ranked-candidates.js",
112+
defaultValue: null,
113+
},
114+
{
115+
name: "LOOPOVER_MINER_REPLAY_SNAPSHOT_DB",
116+
firstReference: "lib/replay-snapshot.js",
117+
defaultValue: null,
118+
},
119+
{
120+
name: "LOOPOVER_MINER_REPO_CLONE_DIR",
121+
firstReference: "lib/repo-clone.js",
122+
defaultValue: "",
123+
},
124+
{
125+
name: "LOOPOVER_MINER_RUN_STATE_DB",
126+
firstReference: "lib/run-state.js",
127+
defaultValue: null,
128+
},
129+
{
130+
name: "LOOPOVER_MINER_SENTRY_DSN",
131+
firstReference: "lib/sentry.js",
132+
defaultValue: null,
133+
},
134+
{
135+
name: "LOOPOVER_MINER_SENTRY_ENVIRONMENT",
136+
firstReference: "lib/sentry.js",
137+
defaultValue: "production",
138+
},
139+
{
140+
name: "LOOPOVER_MINER_VERSION",
141+
firstReference: "lib/version.js",
142+
defaultValue: "",
143+
},
144+
{
145+
name: "LOOPOVER_MINER_WORKTREE_ALLOCATOR_DB",
146+
firstReference: "lib/worktree-allocator.js",
147+
defaultValue: "",
148+
},
149+
{
150+
name: "LOOPOVER_MINER_WORKTREE_DIR",
151+
firstReference: "lib/worktree-allocator.js",
152+
defaultValue: "",
153+
},
154+
{
155+
name: "MINER_CODING_AGENT_PROVIDER",
156+
firstReference: "lib/laptop-init.js",
157+
defaultValue: null,
158+
},
159+
];
160+
161+
export const AMS_ENV_REFERENCE_MARKDOWN = [
162+
"# loopover-miner environment variable reference",
163+
"",
164+
"Generated by `npm run miner:env-reference`. Do not edit manually.",
165+
"",
166+
"| Name | First reference | Default |",
167+
"| --- | --- | --- |",
168+
'| `LOOPOVER_MINER_AMS_COLLECTOR_TOKEN` | `lib/orb-export.js` | `""` |',
169+
'| `LOOPOVER_MINER_AMS_COLLECTOR_URL` | `lib/orb-export.js` | `""` |',
170+
'| `LOOPOVER_MINER_AMS_OAUTH_CLIENT_ID` | `lib/oauth-device-flow.js` | `""` |',
171+
"| `LOOPOVER_MINER_AMS_POLICY_PATH` | `lib/ams-policy.js` | (none) |",
172+
"| `LOOPOVER_MINER_ATTEMPT_LOG_DB` | `lib/attempt-log.js` | (none) |",
173+
"| `LOOPOVER_MINER_CLAIM_LEDGER_DB` | `lib/claim-ledger.js` | (none) |",
174+
'| `LOOPOVER_MINER_CONFIG_DIR` | `lib/deny-hook-synthesis.js` | `""` |',
175+
'| `LOOPOVER_MINER_DENY_HOOK_SYNTHESIS_DB` | `lib/deny-hook-synthesis.js` | `""` |',
176+
"| `LOOPOVER_MINER_EVENT_LEDGER_DB` | `lib/event-ledger.js` | (none) |",
177+
'| `LOOPOVER_MINER_GOVERNOR_LEDGER_DB` | `lib/governor-ledger.js` | `""` |',
178+
"| `LOOPOVER_MINER_GOVERNOR_STATE_DB` | `lib/governor-state.js` | (none) |",
179+
'| `LOOPOVER_MINER_KILL_SWITCH` | `lib/config-precedence.js` | `""` |',
180+
'| `LOOPOVER_MINER_LOG_LEVEL` | `lib/logger.js` | `""` |',
181+
'| `LOOPOVER_MINER_NO_UPDATE_CHECK` | `lib/update-check.js` | `""` |',
182+
'| `LOOPOVER_MINER_ORB_EXPORT_DB` | `lib/orb-export.js` | `""` |',
183+
'| `LOOPOVER_MINER_PLAN_STORE_DB` | `lib/plan-store.js` | `""` |',
184+
"| `LOOPOVER_MINER_POLICY_DOC_CACHE_DB` | `lib/policy-doc-cache.js` | (none) |",
185+
"| `LOOPOVER_MINER_POLICY_VERDICT_CACHE_DB` | `lib/policy-verdict-cache.js` | (none) |",
186+
"| `LOOPOVER_MINER_PORTFOLIO_QUEUE_DB` | `lib/portfolio-queue.js` | (none) |",
187+
'| `LOOPOVER_MINER_PREDICTION_LEDGER_DB` | `lib/prediction-ledger.js` | `""` |',
188+
"| `LOOPOVER_MINER_RANKED_CANDIDATES_DB` | `lib/ranked-candidates.js` | (none) |",
189+
"| `LOOPOVER_MINER_REPLAY_SNAPSHOT_DB` | `lib/replay-snapshot.js` | (none) |",
190+
'| `LOOPOVER_MINER_REPO_CLONE_DIR` | `lib/repo-clone.js` | `""` |',
191+
"| `LOOPOVER_MINER_RUN_STATE_DB` | `lib/run-state.js` | (none) |",
192+
"| `LOOPOVER_MINER_SENTRY_DSN` | `lib/sentry.js` | (none) |",
193+
'| `LOOPOVER_MINER_SENTRY_ENVIRONMENT` | `lib/sentry.js` | `"production"` |',
194+
'| `LOOPOVER_MINER_VERSION` | `lib/version.js` | `""` |',
195+
'| `LOOPOVER_MINER_WORKTREE_ALLOCATOR_DB` | `lib/worktree-allocator.js` | `""` |',
196+
'| `LOOPOVER_MINER_WORKTREE_DIR` | `lib/worktree-allocator.js` | `""` |',
197+
"| `MINER_CODING_AGENT_PROVIDER` | `lib/laptop-init.js` | (none) |",
198+
"",
199+
].join("\n");

apps/loopover-ui/src/routeTree.gen.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ import { Route as DocsAmsUnattendedSchedulingRouteImport } from './routes/docs.a
6161
import { Route as DocsAmsSizingRouteImport } from './routes/docs.ams-sizing'
6262
import { Route as DocsAmsOperationsRunbookRouteImport } from './routes/docs.ams-operations-runbook'
6363
import { Route as DocsAmsObservabilityRouteImport } from './routes/docs.ams-observability'
64+
import { Route as DocsAmsEnvReferenceRouteImport } from './routes/docs.ams-env-reference'
6465
import { Route as DocsAmsDeploymentRouteImport } from './routes/docs.ams-deployment'
6566
import { Route as DocsAmsConfigPrecedenceRouteImport } from './routes/docs.ams-config-precedence'
6667
import { Route as DocsAiSummariesRouteImport } from './routes/docs.ai-summaries'
@@ -356,6 +357,11 @@ const DocsAmsObservabilityRoute = DocsAmsObservabilityRouteImport.update({
356357
path: '/ams-observability',
357358
getParentRoute: () => DocsRoute,
358359
} as any)
360+
const DocsAmsEnvReferenceRoute = DocsAmsEnvReferenceRouteImport.update({
361+
id: '/ams-env-reference',
362+
path: '/ams-env-reference',
363+
getParentRoute: () => DocsRoute,
364+
} as any)
359365
const DocsAmsDeploymentRoute = DocsAmsDeploymentRouteImport.update({
360366
id: '/ams-deployment',
361367
path: '/ams-deployment',
@@ -475,6 +481,7 @@ export interface FileRoutesByFullPath {
475481
'/docs/ai-summaries': typeof DocsAiSummariesRoute
476482
'/docs/ams-config-precedence': typeof DocsAmsConfigPrecedenceRoute
477483
'/docs/ams-deployment': typeof DocsAmsDeploymentRoute
484+
'/docs/ams-env-reference': typeof DocsAmsEnvReferenceRoute
478485
'/docs/ams-observability': typeof DocsAmsObservabilityRoute
479486
'/docs/ams-operations-runbook': typeof DocsAmsOperationsRunbookRoute
480487
'/docs/ams-sizing': typeof DocsAmsSizingRoute
@@ -544,6 +551,7 @@ export interface FileRoutesByTo {
544551
'/docs/ai-summaries': typeof DocsAiSummariesRoute
545552
'/docs/ams-config-precedence': typeof DocsAmsConfigPrecedenceRoute
546553
'/docs/ams-deployment': typeof DocsAmsDeploymentRoute
554+
'/docs/ams-env-reference': typeof DocsAmsEnvReferenceRoute
547555
'/docs/ams-observability': typeof DocsAmsObservabilityRoute
548556
'/docs/ams-operations-runbook': typeof DocsAmsOperationsRunbookRoute
549557
'/docs/ams-sizing': typeof DocsAmsSizingRoute
@@ -617,6 +625,7 @@ export interface FileRoutesById {
617625
'/docs/ai-summaries': typeof DocsAiSummariesRoute
618626
'/docs/ams-config-precedence': typeof DocsAmsConfigPrecedenceRoute
619627
'/docs/ams-deployment': typeof DocsAmsDeploymentRoute
628+
'/docs/ams-env-reference': typeof DocsAmsEnvReferenceRoute
620629
'/docs/ams-observability': typeof DocsAmsObservabilityRoute
621630
'/docs/ams-operations-runbook': typeof DocsAmsOperationsRunbookRoute
622631
'/docs/ams-sizing': typeof DocsAmsSizingRoute
@@ -691,6 +700,7 @@ export interface FileRouteTypes {
691700
| '/docs/ai-summaries'
692701
| '/docs/ams-config-precedence'
693702
| '/docs/ams-deployment'
703+
| '/docs/ams-env-reference'
694704
| '/docs/ams-observability'
695705
| '/docs/ams-operations-runbook'
696706
| '/docs/ams-sizing'
@@ -760,6 +770,7 @@ export interface FileRouteTypes {
760770
| '/docs/ai-summaries'
761771
| '/docs/ams-config-precedence'
762772
| '/docs/ams-deployment'
773+
| '/docs/ams-env-reference'
763774
| '/docs/ams-observability'
764775
| '/docs/ams-operations-runbook'
765776
| '/docs/ams-sizing'
@@ -832,6 +843,7 @@ export interface FileRouteTypes {
832843
| '/docs/ai-summaries'
833844
| '/docs/ams-config-precedence'
834845
| '/docs/ams-deployment'
846+
| '/docs/ams-env-reference'
835847
| '/docs/ams-observability'
836848
| '/docs/ams-operations-runbook'
837849
| '/docs/ams-sizing'
@@ -1257,6 +1269,13 @@ declare module '@tanstack/react-router' {
12571269
preLoaderRoute: typeof DocsAmsObservabilityRouteImport
12581270
parentRoute: typeof DocsRoute
12591271
}
1272+
'/docs/ams-env-reference': {
1273+
id: '/docs/ams-env-reference'
1274+
path: '/ams-env-reference'
1275+
fullPath: '/docs/ams-env-reference'
1276+
preLoaderRoute: typeof DocsAmsEnvReferenceRouteImport
1277+
parentRoute: typeof DocsRoute
1278+
}
12601279
'/docs/ams-deployment': {
12611280
id: '/docs/ams-deployment'
12621281
path: '/ams-deployment'
@@ -1438,6 +1457,7 @@ interface DocsRouteChildren {
14381457
DocsAiSummariesRoute: typeof DocsAiSummariesRoute
14391458
DocsAmsConfigPrecedenceRoute: typeof DocsAmsConfigPrecedenceRoute
14401459
DocsAmsDeploymentRoute: typeof DocsAmsDeploymentRoute
1460+
DocsAmsEnvReferenceRoute: typeof DocsAmsEnvReferenceRoute
14411461
DocsAmsObservabilityRoute: typeof DocsAmsObservabilityRoute
14421462
DocsAmsOperationsRunbookRoute: typeof DocsAmsOperationsRunbookRoute
14431463
DocsAmsSizingRoute: typeof DocsAmsSizingRoute
@@ -1484,6 +1504,7 @@ const DocsRouteChildren: DocsRouteChildren = {
14841504
DocsAiSummariesRoute: DocsAiSummariesRoute,
14851505
DocsAmsConfigPrecedenceRoute: DocsAmsConfigPrecedenceRoute,
14861506
DocsAmsDeploymentRoute: DocsAmsDeploymentRoute,
1507+
DocsAmsEnvReferenceRoute: DocsAmsEnvReferenceRoute,
14871508
DocsAmsObservabilityRoute: DocsAmsObservabilityRoute,
14881509
DocsAmsOperationsRunbookRoute: DocsAmsOperationsRunbookRoute,
14891510
DocsAmsSizingRoute: DocsAmsSizingRoute,
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
import { createFileRoute, notFound } from "@tanstack/react-router";
2+
import { Suspense } from "react";
3+
4+
import { DocsPage } from "@/components/site/docs-page";
5+
import { docsClientLoader } from "@/lib/docs-client-loader";
6+
7+
// Rendered from content/docs/ams-env-reference.mdx via fumadocs-mdx's browser entry
8+
// (docsClientLoader), through the existing DocsPage/Callout/CodeBlock primitives --
9+
// not fumadocs-ui's bundled components. See docs-source.ts's comment for why the
10+
// loader below resolves only a plain, serializable path string. The .mdx content
11+
// itself imports AMS_ENV_REFERENCE_MARKDOWN from @/lib/ams-env-reference (generated by
12+
// packages/loopover-miner/scripts/generate-env-reference.mjs, drift-checked in CI),
13+
// the same pattern docs.self-hosting-configuration.tsx uses for
14+
// SELFHOST_ENV_REFERENCE_MARKDOWN.
15+
export const Route = createFileRoute("/docs/ams-env-reference")({
16+
loader: async () => {
17+
const { docsSource } = await import("@/lib/docs-source");
18+
const page = docsSource.getPage(["ams-env-reference"]);
19+
if (!page) throw notFound();
20+
return { path: page.path, title: page.data.title, description: page.data.description };
21+
},
22+
head: () => ({
23+
meta: [
24+
{ title: "AMS environment variable reference — LoopOver docs" },
25+
{
26+
name: "description",
27+
content:
28+
"Every LOOPOVER_MINER_* / MINER_* env var the miner reads, where it's first referenced in code, and its default -- generated from source, never hand-copied.",
29+
},
30+
{ property: "og:title", content: "AMS environment variable reference — LoopOver docs" },
31+
{
32+
property: "og:description",
33+
content:
34+
"Every LOOPOVER_MINER_* / MINER_* env var the miner reads, where it's first referenced in code, and its default -- generated from source, never hand-copied.",
35+
},
36+
{ property: "og:url", content: "/docs/ams-env-reference" },
37+
],
38+
links: [{ rel: "canonical", href: "/docs/ams-env-reference" }],
39+
}),
40+
component: AmsEnvReference,
41+
});
42+
43+
function AmsEnvReference() {
44+
const { path, title, description } = Route.useLoaderData();
45+
const Content = docsClientLoader.getComponent(path);
46+
return (
47+
<DocsPage eyebrow="Maintainers" title={title} description={description}>
48+
<Suspense fallback={<p className="text-token-sm text-muted-foreground">Loading…</p>}>
49+
<Content />
50+
</Suspense>
51+
</DocsPage>
52+
);
53+
}

0 commit comments

Comments
 (0)