Skip to content

Conversation

Copy link

Copilot AI commented Oct 20, 2025

This PR implements a comprehensive TypeDoc-powered documentation website for type-fest that will be automatically deployed to GitHub Pages.

Overview

The repository now has a professional API documentation site that showcases all 250+ exported types with their definitions, examples, and direct links to source code. The documentation is automatically generated and deployed whenever changes are pushed to the main branch.

What's New

Documentation Generation

  • TypeDoc integration generates beautiful, searchable API documentation
  • Source code links - every type links directly to its .d.ts file on GitHub with line numbers
  • Category organization - types are grouped by functionality (Array, Object, String, JSON, etc.)
  • Interactive search - full-text search across all types and their descriptions
  • Examples preserved - all JSDoc examples and use cases are included

Automated Deployment

  • GitHub Actions workflow automatically builds and deploys documentation on every push to main
  • GitHub Pages ready - configuration uses the official actions/deploy-pages action
  • No manual maintenance - documentation stays in sync with the codebase automatically

Developer Experience

  • npm run docs - generate documentation locally for testing
  • Clean repository - generated files are git-ignored and excluded from TypeScript compilation
  • Minimal overhead - only adds TypeDoc as a single dev dependency

Documentation Preview

Homepage:
Documentation Homepage

The documentation homepage presents the README content with the type-fest branding and provides categorized navigation to all types.

Type Page Example (Merge):
Merge Type Documentation

Each type page shows the complete type definition, parameters, examples, and a "Defined in" link that takes you directly to the source code on GitHub.

Files Modified

  • .github/workflows/docs.yml - New workflow for automated documentation deployment
  • typedoc.json - TypeDoc configuration with GitHub integration
  • package.json - Added TypeDoc dependency and docs script
  • tsconfig.json - Excluded docs/ directory from compilation
  • .gitignore - Added docs/ to ignore generated files
  • readme.md - Added documentation section with link to the site

Activation

To enable the documentation website, a repository admin needs to:

  1. Go to SettingsPages
  2. Under Source, select GitHub Actions
  3. Save

Once enabled, documentation will be available at https://sindresorhus.github.io/type-fest/

The workflow will automatically run on the next push to main and deploy the site.

Testing

✅ All existing tests pass
✅ Documentation generates successfully (250+ types documented)
✅ CodeQL security scan passed (no vulnerabilities)
✅ Local preview tested and verified

Original prompt

Create a documentation website for the sindresorhus/type-fest repository that exposes all the exported types and their corresponding .d.ts source code. Use TypeDoc to generate the documentation. The documentation should be configured to include all relevant exported types and display their source locations. Additionally, set up the project to publish the generated documentation on GitHub Pages.

This pull request was created as a result of the following prompt from Copilot chat.

Create a documentation website for the sindresorhus/type-fest repository that exposes all the exported types and their corresponding .d.ts source code. Use TypeDoc to generate the documentation. The documentation should be configured to include all relevant exported types and display their source locations. Additionally, set up the project to publish the generated documentation on GitHub Pages.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Add documentation website for type-fest repository Add TypeDoc documentation website with GitHub Pages deployment Oct 20, 2025
Copilot AI requested a review from fregante October 20, 2025 11:42
Copilot finished work on behalf of fregante October 20, 2025 11:42
@fregante
Copy link
Collaborator

Demo deployment: https://demo-type-fest-docs-only-qul87138q-fregante-team.vercel.app/types/UndefinedOnPartialDeep.html

@sindresorhus @som-sm it's not the prettiest site, but it has a couple of advantages:

  • searchable (the index can include the descriptions as well)
  • syntax highlighted
  • real links
  • appears on Google
  • auto-generated, not too difficult to maintain

Drawbacks of removing the index from the readme:

  • no short descriptions
  • no grouping

Probably the latter can be configured in type-doc.

Other sections like "Declined types" and "Built-in types" would remain in the readme.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants