Skip to content

fix(docs): move to docgen 4 so generated pages keep their frontmatter - #742

Open
emmanuel-musau wants to merge 1 commit into
mainfrom
chore/docgen-v4
Open

emmanuel-musau wants to merge 1 commit into
mainfrom
chore/docgen-v4

Conversation

@emmanuel-musau

Copy link
Copy Markdown
Collaborator

Closes #741. Supersedes #724.

Moves @effect/docgen from 0.5.2 to 4.1.5, which writes the frontmatter at the top of each generated page, so the docs build no longer depends on how Prettier prints a thematic break. docgen 4 is released from the Effect monorepo (packages/tools/docgen, releases); Effect-TS/docgen stops at 0.5.2.

Changes

  • package.json: @effect/docgen ^4.1.5, and effect ^3.21.1 at the root so @effect/vitest stays on effect 3. Without it, docgen's effect 4 is picked up and the devnet tests fail to load, as on chore(deps-dev): bump @effect/docgen from 0.5.2 to 4.1.2 #724.
  • packages/evolution/docgen.json: drops the 8 keys docgen 4's schema rejects and sets srcLink, so the new Source links point at packages/evolution/src/…. The file validates against the installed schema.json.
  • 29 @example blocks in 9 files: fence changed from ```typescript to ```ts. docgen 4 only takes an example as is when it starts with ```ts; otherwise it wraps it in a second fence and the raw ```typescript line shows in the rendered block.

Checks

  • pnpm install --frozen-lockfile, turbo run build (6/6), check:dts (7/7), lint (4/4), tsc -b
  • evolution: 2,048 passed, 75 skipped; devnet: 147/147 passed (local Docker)
  • docgen: 193 modules, module check and all 15 examples type-check (docgen 4 has no skip option)
  • Deploy steps (build, docgen, copy, docs build): 324 static pages; all 140 generated .mdx start with ---
  • Compared all 193 API pages of the local build against the live site:
    • same number of code blocks on every page, no raw fences
    • headings identical apart from the overview title, the contents heading, nested module titles (sdk/client/Client.ts becomes Client.ts) and the order of CBOR's type aliases
    • signatures are more precise: any across changed signatures drops from 439 to 1, and class methods show their full declaration instead of toJSON()
    • layout: the example sits above the signature, versions read "Since vX", and each export has a Source link; all 135 linked source files exist

One known difference: docgen 4 drops the first inline comment of the Data and DataEncoded type aliases (// Constr (...)); the other comments stay.

docgen 4 requires TypeScript below 7, which matters for #468.

@emmanuel-musau emmanuel-musau added documentation Improvements or additions to documentation dependencies Pull requests that update a dependency file labels Nov 24, 2026
@emmanuel-musau emmanuel-musau self-assigned this Nov 24, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Docs deploy fails: generated module pages lose their frontmatter

1 participant