Skip to content

Commit a51a723

Browse files
committed
combined storybook and docs
1 parent c3b9127 commit a51a723

File tree

5 files changed

+86
-57
lines changed

5 files changed

+86
-57
lines changed

.github/workflows/storybook.yml

Lines changed: 59 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,74 @@
1-
name: Build and Publish Storybook to GitHub Pages
1+
name: Build and Deploy Documentation
22

33
on:
44
push:
55
branches:
6-
- 'main' # Change this to your main branch name if different
6+
- main # or your default branch
77

88
permissions:
99
contents: read
1010
pages: write
1111
id-token: write
1212

1313
jobs:
14-
deploy:
14+
build-and-deploy:
15+
runs-on: ubuntu-latest
1516
environment:
1617
name: github-pages
17-
url: ${{ steps.build-publish.outputs.page_url }}
18-
runs-on: ubuntu-latest
18+
url: ${{ steps.deployment.outputs.page_url }}
1919
steps:
20-
- id: build-publish
21-
uses: bitovi/[email protected]
20+
- name: Checkout
21+
uses: actions/checkout@v3
22+
23+
- name: Setup Node.js
24+
uses: actions/setup-node@v3
25+
with:
26+
node-version: '18'
27+
cache: 'npm'
28+
29+
- name: Install dependencies
30+
run: npm ci
31+
32+
# Step 1: Build Storybook first
33+
- name: Build Storybook
34+
run: npm run build-storybook
35+
36+
# Step 2: Generate TypeDoc into a subdirectory of Storybook
37+
- name: Generate TypeDoc documentation
38+
run: npx typedoc --out storybook-static/api src/index.ts
39+
40+
# Step 3: Create a simple navigation page (optional)
41+
- name: Create navigation page
42+
run: |
43+
echo '<!DOCTYPE html>
44+
<html>
45+
<head>
46+
<meta charset="UTF-8">
47+
<title>Project Documentation</title>
48+
<style>
49+
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; max-width: 800px; margin: 0 auto; padding: 2rem; }
50+
h1 { border-bottom: 1px solid #eaecef; }
51+
.nav-links { display: flex; gap: 2rem; margin: 2rem 0; }
52+
.nav-link { display: inline-block; padding: 0.5rem 1rem; background-color: #0366d6; color: white; text-decoration: none; border-radius: 4px; }
53+
</style>
54+
</head>
55+
<body>
56+
<h1>Project Documentation</h1>
57+
<div class="nav-links">
58+
<a class="nav-link" href="./index.html">Component Library</a>
59+
<a class="nav-link" href="./api/index.html">API Documentation</a>
60+
</div>
61+
</body>
62+
</html>' > storybook-static/docs-home.html
63+
64+
- name: Setup Pages
65+
uses: actions/configure-pages@v3
66+
67+
- name: Upload artifact
68+
uses: actions/upload-pages-artifact@v2
2269
with:
23-
# Adjust these settings based on your project setup
24-
path: storybook-static # Output folder from the build-storybook command
25-
install_command: npm install # or yarn install
26-
build_command: npm run build-storybook # or yarn build-storybook
70+
path: './storybook-static'
71+
72+
- name: Deploy to GitHub Pages
73+
id: deployment
74+
uses: actions/deploy-pages@v2

.github/workflows/typedoc.yml

Lines changed: 0 additions & 45 deletions
This file was deleted.

package-lock.json

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
"build-storybook": "storybook build",
1919
"clean": "rimraf dist",
2020
"prepare": "npm run clean && npm run build && npm run build:types",
21-
"docs": "typedoc --tsconfig tsconfig.docs.json --out docs src/index.ts"
21+
"docs": "typedoc --tsconfig tsconfig.docs.json --out storybook-static/api src/index.ts",
22+
"build-docs": "npm run build-storybook && npm run docs"
2223
},
2324
"keywords": [
2425
"tanstack",
@@ -68,6 +69,7 @@
6869
"ts-jest": "^29.1.1",
6970
"tslib": "^2.6.2",
7071
"typedoc": "^0.28.6",
72+
"typedoc-plugin-markdown": "^4.7.0",
7173
"typescript": "^5.3.3"
7274
}
7375
}

tsconfig.docs.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,16 @@
33
"compilerOptions": {
44
"noUnusedLocals": false,
55
"noUnusedParameters": false
6+
},
7+
"typedocOptions": {
8+
"entryPoints": ["src/index.ts"],
9+
"out": "docs",
10+
"name": "TanStack Table Adapter API",
11+
"includeVersion": true,
12+
"excludePrivate": true,
13+
"excludeExternals": true,
14+
"hideGenerator": true,
15+
"readme": "README.md",
16+
"plugin": ["typedoc-plugin-markdown"]
617
}
718
}

0 commit comments

Comments
 (0)