Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
node_modules/
.vitepress/cache/
.vitepress/dist/
api/
10 changes: 9 additions & 1 deletion docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
import { defineConfig } from "vitepress";
import { readFileSync } from "node:fs";
import { type DefaultTheme, defineConfig } from "vitepress";
import llmstxt from "vitepress-plugin-llms";
import { withMermaid } from "vitepress-plugin-mermaid";

// Generated by docs/typedoc before every docs build.
const typedocSidebar: DefaultTheme.SidebarItem[] = JSON.parse(
readFileSync(new URL("../api/typedoc-sidebar.json", import.meta.url), "utf8"),
);

export default withMermaid(
defineConfig({
title: "Foundatio FetchClient",
Expand Down Expand Up @@ -38,9 +44,11 @@ export default withMermaid(
siteTitle: "FetchClient",
nav: [
{ text: "Guide", link: "/guide/what-is-fetchclient" },
{ text: "API", link: "/api/" },
{ text: "GitHub", link: "https://github.com/FoundatioFx/FetchClient" },
],
sidebar: {
"/api/": [{ text: "API Reference", link: "/api/", items: typedocSidebar }],

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Disable edit links on generated API pages

For every new /api/** page, VitePress still applies the global editLink pattern at lines 92–94, producing a GitHub edit URL under docs/api/.... That directory is generated and explicitly gitignored in docs/.gitignore, so the site's “Edit this page” link sends readers to create or edit a nonexistent generated file rather than the corresponding src/** source. Disable edit links for generated API pages or route them to their source files.

Useful? React with 👍 / 👎.

"/guide/": [
{
text: "Introduction",
Expand Down
4 changes: 3 additions & 1 deletion docs/guide/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -260,4 +260,6 @@ export async function deleteUser(id: number) {
For advanced use cases like connecting to multiple APIs with different
configurations, you can create separate `FetchClientProvider` instances. Each
provider has its own options, middleware, and cache, and
`provider.getFetchClient()` returns clients that use them.
`provider.getFetchClient()` returns clients that use them. See the
[`FetchClientProvider` API reference](/api/@foundatiofx/fetchclient/classes/FetchClientProvider)
for details.
3 changes: 3 additions & 0 deletions docs/guide/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ The docs site in `docs/` is part of the pnpm workspace:
- Dev: `vp run docs:dev`
- Build: `vp run docs:build`

The [API reference](/api/) is generated from the JSDoc comments in `src/` by
TypeDoc on every docs build, so document public APIs in the source.

## License

MIT © Foundatio
6 changes: 4 additions & 2 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@
"description": "FetchClient Documentation",
"type": "module",
"scripts": {
"dev": "vitepress dev",
"build": "vitepress build",
"api": "vp run @foundatiofx/fetchclient-typedoc#build",
"dev": "vp run api && vitepress dev",
"build": "vp run api && vitepress build",
"preview": "vitepress preview"
},
"devDependencies": {
"@types/node": "^24.19.1",
"mermaid": "^11.16.0",
"vitepress": "^2.0.0-alpha.18",
"vitepress-plugin-llms": "^1.13.4",
Expand Down
16 changes: 16 additions & 0 deletions docs/typedoc/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"name": "@foundatiofx/fetchclient-typedoc",
"version": "1.0.0",
"private": true,
"description": "Generates the FetchClient API reference for the docs site",
"type": "module",
"scripts": {
"build": "typedoc"
},
"devDependencies": {
"typedoc": "^0.28.20",
"typedoc-plugin-markdown": "^4.13.1",
"typedoc-vitepress-theme": "^1.1.4",
"typescript": "~6.0.3"
}
}
4 changes: 4 additions & 0 deletions docs/typedoc/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"extends": "../../tsconfig.json",
"include": ["../../src"]
}
15 changes: 15 additions & 0 deletions docs/typedoc/typedoc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"$schema": "https://typedoc.org/schema.json",
"name": "API Reference",
"entryPoints": ["../../src/index.ts", "../../src/mocks/index.ts"],
"tsconfig": "./tsconfig.json",
"out": "../api",
"docsRoot": "..",
"plugin": ["typedoc-plugin-markdown", "typedoc-vitepress-theme"],
"readme": "none",
"excludePrivate": true,
"excludeInternal": true,
"disableGit": true,
"gitRevision": "main",
"sourceLinkTemplate": "https://github.com/FoundatioFx/FetchClient/blob/{gitRevision}/src/{path}#L{line}"
}
Loading
Loading