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

Install TypeDoc and deploy TypeDoc documentation site #15

Merged
merged 5 commits into from
Sep 4, 2023
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 .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.d.ts
20 changes: 20 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
module.exports = {
plugins: [
"@typescript-eslint/eslint-plugin",
"eslint-plugin-tsdoc"
],
extends: [
'plugin:@typescript-eslint/recommended'
],
parser: '@typescript-eslint/parser',
parserOptions: {
project: "./tsconfig.json",
tsconfigRootDir: __dirname,
ecmaVersion: 2018,
sourceType: "module"
},
rules: {
"prefer-const": "off",
"tsdoc/syntax": "error"
}
};
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,5 @@ jobs:
- name: yarn prepare
if: steps.yarn-cache.outputs.cache-hit == 'true'
run: yarn prepare
- run: yarn lint
- run: yarn test
44 changes: 44 additions & 0 deletions .github/workflows/typedoc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: TypeDoc

on:
push:
branches:
- main

jobs:
typedoc:
runs-on: ubuntu-latest

permissions:
contents: write

steps:
- uses: actions/checkout@v3

- name: Set up Node.js and Yarn
uses: actions/setup-node@v3
with:
node-version: '18'

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT

- uses: actions/cache@v3
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
run: yarn install

- name: Build documentation
run: yarn run docs

- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./typedoc
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
/node_modules
/*.d.ts
/*.js
/*.js.map
/*.js.map
/*.log
/typedoc
!.eslintrc.js
15 changes: 14 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@
"scripts": {
"prepare": "tsc",
"start": "tsc --watch",
"test": "qunit test.js"
"test": "qunit test.js",
"docs": "typedoc index.ts --out typedoc/",
"docs:watch": "yarn docs -- --watch",
"docs:serve": "browser-sync start --server \"typedoc/\" --files \"**/*.html\"",
"docs:dev": "concurrently \"yarn docs:watch\" \"yarn docs:serve\"",
"lint": "eslint '*.ts'"
},
"files": [
"*.js",
Expand All @@ -35,7 +40,15 @@
"@types/qunit": "^2.11.3",
"@types/tmp": "^0.2.0",
"@types/yargs": "^16.0.0",
"@typescript-eslint/eslint-plugin": "^6.2.1",
"@typescript-eslint/parser": "^6.2.1",
"browser-sync": "^2.29.3",
"concurrently": "^8.2.0",
"eslint": "^8.46.0",
"eslint-plugin-tsdoc": "^0.2.17",
"lite-server": "^2.6.1",
"qunit": "^2.18.0",
"typedoc": "^0.24.8",
"typescript": "^5.1.6"
}
}
9 changes: 8 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,12 @@
"sourceMap": true,
"inlineSources": true,
"strict": true
}
},
"include": [
"*.ts"
],
"exclude": [
"node_modules/**/*",
"typedoc"
]
}
Loading