Skip to content
Draft
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
53 changes: 53 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Documentation

on:
push:
branches:
- main
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: "pages"
cancel-in-progress: false

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v5

- name: Setup Node.js
uses: actions/setup-node@v5
with:
node-version: 24

- name: Install dependencies
run: npm install

- name: Generate documentation
run: npm run docs

- name: Setup Pages
uses: actions/configure-pages@v5

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: './docs'

deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules
yarn.lock
docs
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
"test:tsd": "tsd",
"test:xo": "xo",
"test:linter": "node --test",
"test": "run-p test:*"
"test": "run-p test:*",
"docs": "typedoc"
},
"files": [
"index.d.ts",
Expand Down Expand Up @@ -59,6 +60,7 @@
"expect-type": "^1.2.2",
"npm-run-all2": "^8.0.4",
"tsd": "^0.33.0",
"typedoc": "^0.28.14",
"typescript": "^5.9.2",
"xo": "^1.2.2"
},
Expand Down
13 changes: 13 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,19 @@ type FooWithoutRainbow = Except<Foo, 'rainbow'>;
//=> {unicorn: string}
```

## Documentation

Full API documentation with TypeDoc will be available at:
**https://sindresorhus.github.io/type-fest/**

*(Once GitHub Pages is enabled in repository settings)*

The documentation includes:
- Complete type definitions with source code links
- Detailed examples and use cases
- Categorized type listings
- Interactive search functionality

## API

Click the type names for complete docs.
Expand Down
5 changes: 4 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,8 @@
"exactOptionalPropertyTypes": true,
"skipLibCheck": false, // Ensures .d.ts files are checked: https://github.com/sindresorhus/tsconfig/issues/15
"erasableSyntaxOnly": false // We cannot do this as we need to be able to test enums.
}
},
"exclude": [
"docs"
]
}
45 changes: 45 additions & 0 deletions typedoc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"$schema": "https://typedoc.org/schema.json",
"entryPoints": ["./index.d.ts"],
"out": "docs",
"exclude": ["**/node_modules/**", "**/test-d/**"],
"excludePrivate": false,
"excludeProtected": false,
"excludeExternals": true,
"readme": "readme.md",
"plugin": [],
"githubPages": true,
"disableSources": false,
"sourceLinkTemplate": "https://github.com/sindresorhus/type-fest/blob/{gitRevision}/{path}#L{line}",
"gitRevision": "main",
"includeVersion": true,
"navigation": {
"includeCategories": true,
"includeGroups": false
},
"categorizeByGroup": false,
"sort": ["source-order"],
"kindSortOrder": [
"TypeAlias",
"Interface",
"Class",
"Enum",
"Function",
"Variable",
"Constructor",
"Property",
"Method",
"CallSignature",
"IndexSignature",
"ConstructorSignature",
"Accessor",
"GetSignature",
"SetSignature"
],
"visibilityFilters": {
"protected": false,
"private": false,
"inherited": true,
"external": false
}
}