Skip to content

Commit

Permalink
typedoc
Browse files Browse the repository at this point in the history
  • Loading branch information
Narazaka committed Jul 13, 2023
1 parent 1fb9c64 commit b5f2e16
Show file tree
Hide file tree
Showing 5 changed files with 213 additions and 1 deletion.
49 changes: 49 additions & 0 deletions .github/workflows/doc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Deploy docs

on:
push:
branches: ["master"]

workflow_dispatch:

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

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

jobs:
# Build job
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 18.x
cache: "npm"
- run: npm ci
- run: npm run doc
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: doc

# Deployment job
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@v2
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ dist-ssr
*.d.ts
!/src/vite-env.d.ts
!/examples/src/vite-env-override.d.ts
/doc

# Editor directories and files
.vscode/*
Expand Down
137 changes: 137 additions & 0 deletions package-lock.json

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

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
"build": "tsc && vite build",
"dev": "vite -c examples/vite.config.ts",
"format:check": "prettier --check .",
"format:fix": "prettier --write ."
"format:fix": "prettier --write .",
"doc": "typedoc"
},
"files": [
"*.js",
Expand All @@ -30,6 +31,7 @@
"@types/three": "^0.152.1",
"prettier": "^2.8.8",
"rimraf": "^5.0.1",
"typedoc": "^0.24.8",
"typescript": "^5.0.2",
"vite": "^4.3.9",
"vite-plugin-dts": "^3.2.0",
Expand Down
23 changes: 23 additions & 0 deletions typedoc.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// @ts-check

const fs = require("fs");
const path = require("path");

/**
*
* @param {string} root
* @returns
*/
function listFiles(root) {
return fs
.readdirSync(root)
.map((entry) => path.join(root, entry))
.filter((entry) => fs.statSync(entry).isFile());
}

/** @type {import('typedoc').TypeDocOptions} */
module.exports = {
entryPoints: [...listFiles("src"), ...listFiles("src/util")],
basePath: "src",
out: "doc",
};

0 comments on commit b5f2e16

Please sign in to comment.