Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: include prebuilt sample apps in tsky docs #86

Merged
merged 2 commits into from
Mar 15, 2025
Merged
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
1 change: 1 addition & 0 deletions docs/.vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import typedocSidebar from '../api/typedoc-sidebar.json';
export default defineConfig({
title: 'tsky',
description: 'A Bluesky API client for nimble apps and tools',
ignoreDeadLinks: [/\/examples\//],
themeConfig: {
nav: [
{ text: 'Home', link: '/' },
Expand Down
2 changes: 1 addition & 1 deletion docs/examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ outline: deep

# Examples

TODO: Add examples here
- [User profile](/examples/user-profile/){target="_self"}
6 changes: 6 additions & 0 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,21 @@
"version": "1.0.0",
"private": true,
"main": "index.js",
"type": "module",
"scripts": {
"predev": "typedoc",
"dev": "vitepress dev",
"prebuild": "typedoc",
"build": "vitepress build",
"postbuild": "pnpm build:examples && pnpm copy-example-apps",
"build:examples": "pnpm --filter 'examples-*' build",
"copy-example-apps": "tsx scripts/copy-example-apps.ts",
"preview": "vitepress preview",
"test": "echo \"Error: no test specified\""
},
"devDependencies": {
"@types/node": "^22.13.10",
"tsx": "^4.19.2",
"typedoc": "^0.27.1",
"typedoc-plugin-markdown": "^4.3.0",
"typedoc-vitepress-theme": "^1.1.0",
Expand Down
10 changes: 10 additions & 0 deletions docs/scripts/copy-example-apps.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import fs from 'node:fs/promises';

const apps = await fs.readdir('../examples');

for (const app of apps) {
console.log(`copying example app ${app} ...`);
fs.cp(`../examples/${app}/dist`, `./.vitepress/dist/examples/${app}`, {
recursive: true,
});
}
31 changes: 31 additions & 0 deletions docs/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"compilerOptions": {
"target": "ESNext",
"lib": ["ESNext", "DOM"],
"moduleDetection": "force",
"useDefineForClassFields": false,
"experimentalDecorators": true,
"baseUrl": ".",
"module": "ESNext",
"moduleResolution": "bundler",
"resolveJsonModule": true,
"allowJs": true,
"strict": true,
"noFallthroughCasesInSwitch": true,
"noImplicitOverride": true,
"noImplicitReturns": true,
"noUnusedLocals": true,
"noImplicitAny": true,
"noUnusedParameters": true,
"declaration": false,
"noEmit": true,
"outDir": "dist/",
"sourceMap": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"isolatedModules": true,
"verbatimModuleSyntax": true,
"skipLibCheck": true
},
"include": ["./scripts/**/*"],
}
4 changes: 2 additions & 2 deletions examples/user-profile/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "user-profile",
"name": "examples-user-profile",
"private": true,
"version": "0.0.0",
"type": "module",
Expand All @@ -25,4 +25,4 @@
"typescript-eslint": "^8.24.1",
"vite": "^6.2.0"
}
}
}
2 changes: 1 addition & 1 deletion examples/user-profile/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ function App() {
rel="noreferrer"
>
<img
src="/tsky-logo.png"
src="/examples/user-profile/tsky-logo.png"
alt="tsky logo"
className="size-9 min-w-9 rounded"
/>
Expand Down
1 change: 1 addition & 0 deletions examples/user-profile/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ import tailwindcss from '@tailwindcss/vite';
// https://vite.dev/config/
export default defineConfig({
plugins: [react(), tailwindcss()],
base: '/examples/user-profile/',
});
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@
"biome check --write --"
]
}
}
}
75 changes: 44 additions & 31 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.