Skip to content

Commit

Permalink
Add Yarn and GitHub workflow config for building docs to GitHub Pages
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisChinchilla committed Jan 16, 2024
1 parent 1f2b4b6 commit 4893a81
Show file tree
Hide file tree
Showing 6 changed files with 120 additions and 1 deletion.
24 changes: 24 additions & 0 deletions .github/workflows/docpublish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Build and Deploy API docs

on:
release:
types: [published]
workflow_dispatch:

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

- name: Install and Build
run: |
yarn install
yarn build:docs
- name: Deploy
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages # The branch the action should deploy to.
folder: docs/api # The folder the action should deploy to.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,7 @@ cjs
# VSCode

.vscode

# doc
**/docs/api
/docs/api
Empty file added docs/.nojekyll
Empty file.
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"eslint-plugin-license-header": "^0.6.0",
"prettier": "^3.0.0",
"rimraf": "^5.0.1",
"typedoc": "^0.24.8",
"typescript": "^5.3.2",
"vitest": "^0.33.0"
},
Expand All @@ -45,9 +46,11 @@
"scripts": {
"build": "yarn build:cjs && yarn build:esm",
"build:cjs": "run -T tsc -p tsconfig.cjs.json && echo '{\"type\": \"commonjs\"}' > ./dist/cjs/package.json",
"build:docs": "typedoc --theme default --out docs/api --tsconfig tsconfig.docs.json && touch docs/.nojekyll",
"build:esm": "run -T tsc -p tsconfig.esm.json && echo '{\"type\": \"module\"}' > ./dist/esm/package.json",
"check": "tsc -p tsconfig.json",
"clean": "yarn rimraf -g */{cjs,esm}",
"clean:docs": "rimraf docs/api",
"lint": "eslint --ext .ts . && prettier -c .",
"lint:fix": "prettier -w . && eslint --fix --ext .ts .",
"prepublish": "yarn exec cp -f ../../LICENSE .",
Expand Down
22 changes: 22 additions & 0 deletions tsconfig.docs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"extends": "./tsconfig.json",
"include": ["src/**/*"],
"typedocOptions": {
"entryPointStrategy": "resolve",
"entryPoints": ["src/runtime.ts", "src/sibling.ts", "src/utils.ts"],
"out": "docs/api",
"theme": "default",
"exclude": [
"**/*spec.ts",
"**/__mocks__/**",
"**/tests/**",
"**/*.js",
"**/node_modules/**"
],
"excludeExternals": true,
"excludePrivate": true,
"hideGenerator": true,
"name": "API Documentation",
"readme": "README.md"
}
}
68 changes: 67 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,7 @@ __metadata:
eslint-plugin-license-header: ^0.6.0
prettier: ^3.0.0
rimraf: ^5.0.1
typedoc: ^0.24.8
typescript: ^5.3.2
vitest: ^0.33.0
languageName: unknown
Expand Down Expand Up @@ -1516,6 +1517,13 @@ __metadata:
languageName: node
linkType: hard

"ansi-sequence-parser@npm:^1.1.0":
version: 1.1.1
resolution: "ansi-sequence-parser@npm:1.1.1"
checksum: ead5b15c596e8e85ca02951a844366c6776769dcc9fd1bd3a0db11bb21364554822c6a439877fb599e7e1ffa0b5f039f1e5501423950457f3dcb2f480c30b188
languageName: node
linkType: hard

"ansi-styles@npm:^4.0.0, ansi-styles@npm:^4.1.0":
version: 4.3.0
resolution: "ansi-styles@npm:4.3.0"
Expand Down Expand Up @@ -3621,6 +3629,13 @@ __metadata:
languageName: node
linkType: hard

"lunr@npm:^2.3.9":
version: 2.3.9
resolution: "lunr@npm:2.3.9"
checksum: 176719e24fcce7d3cf1baccce9dd5633cd8bdc1f41ebe6a180112e5ee99d80373fe2454f5d4624d437e5a8319698ca6837b9950566e15d2cae5f2a543a3db4b8
languageName: node
linkType: hard

"magic-string@npm:^0.30.1":
version: 0.30.5
resolution: "magic-string@npm:0.30.5"
Expand Down Expand Up @@ -3656,6 +3671,15 @@ __metadata:
languageName: node
linkType: hard

"marked@npm:^4.3.0":
version: 4.3.0
resolution: "marked@npm:4.3.0"
bin:
marked: bin/marked.js
checksum: 0db6817893952c3ec710eb9ceafb8468bf5ae38cb0f92b7b083baa13d70b19774674be04db5b817681fa7c5c6a088f61300815e4dd75a59696f4716ad69f6260
languageName: node
linkType: hard

"merge-stream@npm:^2.0.0":
version: 2.0.0
resolution: "merge-stream@npm:2.0.0"
Expand Down Expand Up @@ -3721,7 +3745,7 @@ __metadata:
languageName: node
linkType: hard

"minimatch@npm:^9.0.1, minimatch@npm:^9.0.3":
"minimatch@npm:^9.0.0, minimatch@npm:^9.0.1, minimatch@npm:^9.0.3":
version: 9.0.3
resolution: "minimatch@npm:9.0.3"
dependencies:
Expand Down Expand Up @@ -4738,6 +4762,18 @@ __metadata:
languageName: node
linkType: hard

"shiki@npm:^0.14.1":
version: 0.14.7
resolution: "shiki@npm:0.14.7"
dependencies:
ansi-sequence-parser: ^1.1.0
jsonc-parser: ^3.2.0
vscode-oniguruma: ^1.7.0
vscode-textmate: ^8.0.0
checksum: 2aec3b3519df977c4391df9e1825cb496e9a4d7e11395f05a0da77e4fa2f7c3d9d6e6ee94029ac699533017f2b25637ee68f6d39f05f311535c2704d0329b520
languageName: node
linkType: hard

"side-channel@npm:^1.0.4":
version: 1.0.4
resolution: "side-channel@npm:1.0.4"
Expand Down Expand Up @@ -5286,6 +5322,22 @@ __metadata:
languageName: node
linkType: hard

"typedoc@npm:^0.24.8":
version: 0.24.8
resolution: "typedoc@npm:0.24.8"
dependencies:
lunr: ^2.3.9
marked: ^4.3.0
minimatch: ^9.0.0
shiki: ^0.14.1
peerDependencies:
typescript: 4.6.x || 4.7.x || 4.8.x || 4.9.x || 5.0.x || 5.1.x
bin:
typedoc: bin/typedoc
checksum: a46a14497f789fb3594e6c3af2e45276934ac46df40b7ed15a504ee51dc7a8013a2ffb3a54fd73abca6a2b71f97d3ec9ad356fa9aa81d29743e4645a965a2ae0
languageName: node
linkType: hard

"typescript-logging@npm:^1.0.0":
version: 1.0.1
resolution: "typescript-logging@npm:1.0.1"
Expand Down Expand Up @@ -5540,6 +5592,20 @@ __metadata:
languageName: node
linkType: hard

"vscode-oniguruma@npm:^1.7.0":
version: 1.7.0
resolution: "vscode-oniguruma@npm:1.7.0"
checksum: 53519d91d90593e6fb080260892e87d447e9b200c4964d766772b5053f5699066539d92100f77f1302c91e8fc5d9c772fbe40fe4c90f3d411a96d5a9b1e63f42
languageName: node
linkType: hard

"vscode-textmate@npm:^8.0.0":
version: 8.0.0
resolution: "vscode-textmate@npm:8.0.0"
checksum: 127780dfea89559d70b8326df6ec344cfd701312dd7f3f591a718693812b7852c30b6715e3cfc8b3200a4e2515b4c96f0843c0eacc0a3020969b5de262c2a4bb
languageName: node
linkType: hard

"w3c-xmlserializer@npm:^5.0.0":
version: 5.0.0
resolution: "w3c-xmlserializer@npm:5.0.0"
Expand Down

0 comments on commit 4893a81

Please sign in to comment.