diff --git a/astro.config.mjs b/astro.config.mjs index 8d357f5..4f509c7 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -15,9 +15,6 @@ const docsRoot = fileURLToPath(new URL(".", import.meta.url)); const site = "https://bomb.sh/docs/"; -// Topics whose pages are all still drafts render under `astro dev` only. -const showDrafts = process.argv.includes("dev"); - // https://astro.build/config export default defineConfig({ site: "https://bomb.sh/", @@ -215,21 +212,17 @@ export default defineConfig({ }, ], }, - ...(showDrafts - ? [ - { - label: "Router", - id: "router", - icon: "random", - link: "/router/basics/overview", - items: [ - { label: "Basics", autogenerate: { directory: "router/basics" } }, - { label: "Guides", autogenerate: { directory: "router/guides" } }, - { label: "API", items: [{ label: "Reference", link: "/router/api/" }] }, - ], - }, - ] - : []), + { + label: "Router", + id: "router", + icon: "random", + link: "/router/basics/overview", + items: [ + { label: "Basics", autogenerate: { directory: "router/basics" } }, + { label: "Guides", autogenerate: { directory: "router/guides" } }, + { label: "API", items: [{ label: "Reference", link: "/router/api/" }] }, + ], + }, ]), ], }), diff --git a/router/src/app.test.ts b/router/src/app.test.ts index ecfe05f..cbbc088 100644 --- a/router/src/app.test.ts +++ b/router/src/app.test.ts @@ -40,6 +40,16 @@ test("redirects bare project roots to their landing page", async () => { ); }); +test("redirects the bare router root to its overview", async () => { + const { app } = appWith(() => undefined); + const res = await app.request("https://bomb.sh/docs/router"); + assert.equal(res.status, 308); + assert.equal( + res.headers.get("Location"), + "https://bomb.sh/docs/router/basics/overview/", + ); +}); + test("serves the markdown twin on Accept: text/markdown", async () => { const { app, calls } = appWith((url) => url.pathname === "/docs/args/api/index.md" ? markdown() : undefined, diff --git a/router/src/config.ts b/router/src/config.ts index 01aa10c..60f8981 100644 --- a/router/src/config.ts +++ b/router/src/config.ts @@ -9,4 +9,5 @@ export const PROJECT_LANDING_PAGES: Record = { tab: "/docs/tab/", args: "/docs/args/getting-started/", tty: "/docs/tty/basics/getting-started/", + router: "/docs/router/basics/overview/", }; diff --git a/src/content/docs/router/api/index.mdx b/src/content/docs/router/api/index.mdx index 9b5fd5b..0416c4d 100644 --- a/src/content/docs/router/api/index.mdx +++ b/src/content/docs/router/api/index.mdx @@ -1,7 +1,6 @@ --- title: API reference description: Every export of @bomb.sh/router 0.7.1, grouped by what it does -draft: true --- This page lists every export of `@bomb.sh/router` 0.7.1. Signatures leave out generic parameters, because TypeScript infers them from your definitions. diff --git a/src/content/docs/router/basics/installation.mdx b/src/content/docs/router/basics/installation.mdx index e7f9031..92acfdd 100644 --- a/src/content/docs/router/basics/installation.mdx +++ b/src/content/docs/router/basics/installation.mdx @@ -1,7 +1,6 @@ --- title: Installation description: Install @bomb.sh/router with your package manager -draft: true sidebar: order: 2 --- diff --git a/src/content/docs/router/basics/overview.mdx b/src/content/docs/router/basics/overview.mdx index aa8d441..ac96d9a 100644 --- a/src/content/docs/router/basics/overview.mdx +++ b/src/content/docs/router/basics/overview.mdx @@ -1,7 +1,6 @@ --- title: Overview description: Learn what @bomb.sh/router is and when to use it -draft: true sidebar: order: 1 --- diff --git a/src/content/docs/router/basics/quickstart.mdx b/src/content/docs/router/basics/quickstart.mdx index 55925d2..07912ff 100644 --- a/src/content/docs/router/basics/quickstart.mdx +++ b/src/content/docs/router/basics/quickstart.mdx @@ -1,7 +1,6 @@ --- title: Quickstart description: Define the routes of a CLI, parse argv, and dispatch on a typed intent -draft: true sidebar: order: 3 --- diff --git a/src/content/docs/router/guides/help-version-and-errors.mdx b/src/content/docs/router/guides/help-version-and-errors.mdx index beeac9e..ffa3602 100644 --- a/src/content/docs/router/guides/help-version-and-errors.mdx +++ b/src/content/docs/router/guides/help-version-and-errors.mdx @@ -1,7 +1,6 @@ --- title: Help, version, and errors description: Print help and version output, describe routes and parameters, and report parse failures -draft: true sidebar: order: 4 --- diff --git a/src/content/docs/router/guides/parameters.mdx b/src/content/docs/router/guides/parameters.mdx index ba8ebdd..09675fb 100644 --- a/src/content/docs/router/guides/parameters.mdx +++ b/src/content/docs/router/guides/parameters.mdx @@ -1,7 +1,6 @@ --- title: Parameters description: Read options, toggles, and positional arguments, and validate them with a schema -draft: true sidebar: order: 2 --- diff --git a/src/content/docs/router/guides/routes-and-methods.mdx b/src/content/docs/router/guides/routes-and-methods.mdx index 0895c11..90e8a04 100644 --- a/src/content/docs/router/guides/routes-and-methods.mdx +++ b/src/content/docs/router/guides/routes-and-methods.mdx @@ -1,7 +1,6 @@ --- title: Routes and methods description: Declare the entry points of a CLI and control which methods each one supports -draft: true sidebar: order: 1 --- diff --git a/src/content/docs/router/guides/sources.mdx b/src/content/docs/router/guides/sources.mdx index 4a2e15d..64c42ad 100644 --- a/src/content/docs/router/guides/sources.mdx +++ b/src/content/docs/router/guides/sources.mdx @@ -1,7 +1,6 @@ --- title: Value and environment sources description: Bind configuration values and environment variables onto the same typed model as command-line arguments -draft: true sidebar: order: 3 --- diff --git a/src/pages/index.md.ts b/src/pages/index.md.ts index 32862a3..54e1250 100644 --- a/src/pages/index.md.ts +++ b/src/pages/index.md.ts @@ -40,7 +40,7 @@ export const GET: APIRoute = async () => { "# Bombshell Documentation", "", "> Effortlessly build beautiful command-line apps. Documentation for", - "> Clack, Args, Tab, and TTY — an ecosystem of terminal primitives for", + "> Clack, Args, Tab, TTY, and Router — an ecosystem of terminal primitives for", "> Node.js CLIs and TUIs.", "", `Every page is available as markdown at \`{page}/index.md\`, or by`,