# @leyman/docs The documentation site for the packages in this repo, built with [VitePress](https://vitepress.dev/) and deployed to GitHub Pages from `main`. It isn't published to npm. Documents [`aws-emulator-launch`](../tools/aws-emulator-launch/ts), [`barrelify`](../apps/barrelify), [`entry-script`](../tools/entry-script), [`generated-signature`](../tools/generated-signature/ts), [`genever`](../apps/genever/ts), [`haywire`](../tools/haywire), [`haywire-launcher`](../tools/haywire-launcher), [`idempotency-keys`](../tools/idempotency-keys/ts), [`juniper`](../apps/juniper), [`juniper-arbitrary`](../apps/juniper-arbitrary), [`juniper-validator`](../apps/juniper-validator), [`lease-cache`](../tools/lease-cache), [`load-populate-files`](../apps/populate-files/load-populate-files), [`mocha-chain`](../tools/test-chain/mocha-chain), [`normalized-react-query`](../tools/normalized-react-query), [`nx-lifecycle`](../apps/nx-lifecycle), [`pg-dolly`](../tools/pg-dolly), [`pg-dolly-schema`](../apps/pg-dolly-schema), [`populate-files`](../apps/populate-files/ts), [`unknown-error`](../tools/unknown-error), [`vitest-chain`](../tools/test-chain/vitest-chain) and [`xenever`](../apps/xenever) so far, plus the demos. Keep their pages in sync with the packages: see the [docs-site skill](../.agents/skills/docs-site/SKILL.md). ## Type-checked examples Every `ts` code block is compiled with [twoslash](https://twoslash.netlify.app/) against the built types of the packages it imports, which are installed like any other dependency. A type error fails the build, unless the block expects it: ````md ```ts // @errors: 2339 import { arraySchema } from 'juniper'; arraySchema().maxLength(10); ``` ```` - `// ^?` under an identifier renders its inferred type. - Lines above `// ---cut---` are compiled but not shown, for setup the reader doesn't need. - In a `WHY-.md` or a demo's README, which GitHub (and npm) show too, that setup and any directives go in a `` comment right above the fence instead: see [writing-readmes](../.agents/skills/writing-readmes/SKILL.md#readme-vs-why-file). - Compiler options are in [`tsconfig.twoslash.json`](./tsconfig.twoslash.json). Twoslash only checks types. Output shown in comments, like `// { type: 'string' }`, is not checked. Links between pages are checked too, and a dead link fails the build. ## Developing ```bash nx run @leyman/docs:vitepress-dev # dev server at http://localhost:5173/leyman/, type errors shown inline nx run @leyman/docs:build # build into dist/, failing on any type error or dead link ``` A package's docs live in `src/packages//`, and a demo's in `src/demos//`. Each has an entry in [`.vitepress/projects.ts`](./.vitepress/projects.ts), from which [`.vitepress/config.ts`](./.vitepress/config.ts) builds the nav, sidebars, redirects and `/llms.txt`, and the theme's components the home page, lists and cross-links. Pages are Markdown, with VitePress's [containers and code groups](https://vitepress.dev/guide/markdown). Document a package's types by adding it to `devDependencies` (`workspace:^`). The package lists in the root `README.md`, this file, the projects and docs-site skills, the issue templates' package dropdowns, and the paths of `.claude/rules/docs-site-sync.md` are generated from `projects.ts` and each project's `package.json`, the skills table of `AGENTS.md` from each skill's frontmatter, each package's `why.md` from its `WHY-.md`, and each demo's page from its READMEs (edit those, and only the page's `description` here), by [`scripts/populate-docs.mjs`](./scripts/populate-docs.mjs), run by `nx run @leyman/docs:populate-docs` (part of `build`). They're signed, so edit them only inside their manual sections. CI fails when one is out of date. VitePress 2 is in alpha, so its version is pinned exactly in the catalog. Bump it deliberately and check the build.