headroom/docs/source.config.ts

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

45 lines
1.2 KiB
TypeScript
Raw Permalink Normal View History

2026-04-12 13:15:58 +06:00
import { defineConfig, defineDocs } from 'fumadocs-mdx/config';
import { metaSchema, pageSchema } from 'fumadocs-core/source/schema';
import { transformerTwoslash } from 'fumadocs-twoslash';
import { rehypeCodeDefaultOptions } from 'fumadocs-core/mdx-plugins';
export const docs = defineDocs({
dir: 'content/docs',
docs: {
schema: pageSchema,
postprocess: {
includeProcessedMarkdown: true,
},
},
meta: {
schema: metaSchema,
},
});
export default defineConfig({
mdxOptions: {
rehypeCodeOptions: {
themes: {
light: 'github-light',
dark: 'github-dark',
},
transformers: [
...(rehypeCodeDefaultOptions.transformers ?? []),
transformerTwoslash({
twoslashOptions: {
compilerOptions: {
target: 9, // ES2022
lib: ['lib.es2022.d.ts', 'lib.dom.d.ts', 'lib.dom.iterable.d.ts'],
},
// Documentation code snippets are illustrative — don't require full type validity
handbookOptions: {
noErrors: true,
},
},
}),
],
docs(ci): add CI/CD flow diagrams (#1062) ## Description Adds a visual CI/CD flow reference for Headroom so contributors can quickly understand the gated PR, release, Docker, docs deploy, fork approval, and manual validation paths. Also updates the release documentation to match the current release-please release flow instead of the stale push-to-main release model. ## Type of Change - [ ] Bug fix (non-breaking change that fixes an issue) - [ ] New feature (non-breaking change that adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [x] Documentation update - [ ] Performance improvement - [ ] Code refactoring (no functional changes) ## Changes Made - Added `docs/content/docs/ci-cd-flows.mdx` with Mermaid diagrams and decision trees for PR review, release publishing, Docker publishing, docs deploys, fork workflow approval, and manual validation. - Updated `docs/content/docs/releases.mdx` to describe the current `release-please` -> GitHub Release -> `release.yml` publishing path. - Added the CI/CD flow page and existing release page to docs navigation. - Added Mermaid to the docs code highlighter language list. - Restored missing docs helper modules and aligned Fumadocs dependencies so the docs app can install, generate sources, type-check, and build. ## Testing - [ ] Unit tests pass (`pytest`) - [ ] Linting passes (`ruff check .`) - [ ] Type checking passes (`mypy headroom`) - [ ] New tests added for new functionality - [x] Manual testing performed ### Test Output ```text $ npm ci > headroom-docs@0.0.0 postinstall > fumadocs-mdx [MDX] generated files added 365 packages, and audited 367 packages $ npm run types:check > fumadocs-mdx && next typegen && tsc --noEmit [MDX] generated files Generating route types... ✓ Types generated successfully $ npm run build > next build ✓ Compiled successfully Running TypeScript ... Generating static pages ... ✓ Generating static pages (122/122) Note: next build completed successfully and emitted two existing Recharts container-size warnings during static generation. $ git diff --check # no output $ act workflow_dispatch -W .github/workflows/docs.yml -n *DRYRUN* [Deploy Documentation/deploy] 🏁 Job succeeded ``` ## Real Behavior Proof - Environment: Windows local checkout, branch `docs-ci-flow`, Node.js v22.22.0, `act` 0.2.87. - Exact command / steps: Ran `npm ci`, `npm run types:check`, and `npm run build` from `docs/`; ran `git diff --check` and `act workflow_dispatch -W .github/workflows/docs.yml -n` from the repository root. - Observed result: Docs dependencies install, Fumadocs source generation includes `ci-cd-flows.mdx`, TypeScript passes, Next production build completes, whitespace check passes, and the docs workflow dry-run succeeds under `act`. - Not tested: Full live GitHub Pages deploy and registry/release publishing, because this PR only changes docs and docs build wiring. ## Review Readiness - [x] I have performed a self-review - [x] This PR is ready for human review ## Checklist - [x] My code follows the project's style guidelines - [x] I have performed a self-review of my code - [x] I have commented my code, particularly in hard-to-understand areas - [x] I have made corresponding changes to the documentation - [ ] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] New and existing unit tests pass locally with my changes - [ ] I have updated the CHANGELOG.md if applicable ## Screenshots (if applicable) N/A. This is documentation and build wiring; the diagrams are Mermaid source blocks in the docs page. ## Additional Notes - No issue is linked because this PR was not opened for a specific tracked issue. - `npm run build` still reports two pre-existing Recharts container-size warnings while completing successfully. - Python unit/lint/type checks and changelog updates are not applicable to this docs-only change.
2026-06-17 01:05:15 -05:00
langs: ['js', 'jsx', 'ts', 'tsx', 'python', 'bash', 'json', 'yaml', 'toml', 'css', 'mermaid'],
2026-04-12 13:15:58 +06:00
},
},
});