Skip to content

Commit

Permalink
Merge pull request #68 from poteat/231125-typedoc-workflow
Browse files Browse the repository at this point in the history
Configure TypeDoc, GitHub Pages for static documentation site generation and deployment
  • Loading branch information
MajorLift authored Dec 20, 2023
2 parents 5af1497 + f43ad06 commit cb60d8c
Show file tree
Hide file tree
Showing 8 changed files with 90 additions and 10 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/publish-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Publish docs to GitHub Pages

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
publish-docs-to-gh-pages:
name: Publish docs to GitHub Pages
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout the repository
uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
- name: Install npm dependencies
run: npm install
- name: Run build script
run: npm run build:docs
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./typedoc
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
dist
package-lock.json
node_modules
typedoc
*.js
.tsbuildinfo
*.tgz
Expand Down
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"test": "NODE_OPTIONS=--max-old-space-size=8192 tsc --project tsconfig.spec.json",
"stress": "NODE_OPTIONS=--max-old-space-size=24576 tsc --project tsconfig.stress.json",
"build": "./build.sh",
"build:docs": "typedoc --skipErrorChecking",
"precommit": "npm run lint-check && npm run test",
"prepush": "npm run lint && npm run test && npm run stress",
"lint-check": "npm run prettier-check && npm run eslint-check",
Expand All @@ -28,9 +29,10 @@
"eslint-plugin-prettier": "^5.0.0",
"eslint-plugin-unused-imports": "^3.0.0",
"prettier": "^3.0.1",
"prettier-plugin-organize-imports": "^3.2.3"
"prettier-plugin-organize-imports": "^3.2.3",
"typedoc": "^0.25.3"
},
"dependencies": {
"typescript": "^5.1.6"
}
}
}
16 changes: 13 additions & 3 deletions tsconfig.build.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,16 @@
"noEmit": false,
"emitDeclarationOnly": true
},
"include": ["src/index.ts"],
"exclude": ["node_modules", "prompts"]
}
"include": [
"src/index.ts"
],
"exclude": [
"node_modules",
"dist",
"docs",
"pkg",
"prompts",
"scaffolding",
"style-guide"
]
}
16 changes: 13 additions & 3 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
"target": "es2020",
"module": "commonjs",
"paths": {
"hkt-toolbelt": ["./src"]
"hkt-toolbelt": [
"./src"
]
},
"rootDir": "./",
"declaration": true,
Expand All @@ -18,5 +20,13 @@
"forceConsistentCasingInFileNames": false,
"strict": true
},
"exclude": ["node_modules", "prompts"]
}
"exclude": [
"node_modules",
"dist",
"docs",
"pkg",
"prompts",
"scaffolding",
"style-guide"
]
}
7 changes: 6 additions & 1 deletion tsconfig.spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@
"exclude": [
"src/**/*.stress.spec.ts",
"node_modules",
"prompts"
"dist",
"docs",
"pkg",
"prompts",
"scaffolding",
"style-guide"
]
}
7 changes: 6 additions & 1 deletion tsconfig.stress.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@
],
"exclude": [
"node_modules",
"prompts"
"dist",
"docs",
"pkg",
"prompts",
"scaffolding",
"style-guide"
]
}
17 changes: 17 additions & 0 deletions typedoc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"entryPoints": [
"./src/*/index.ts"
],
"entryPointStrategy": "expand",
"out": "./typedoc",
"exclude": [
"**/*.spec.ts",
],
"excludeNotDocumented": true,
"visibilityFilters": {
"protected": false,
"private": false,
"inherited": false,
"external": false
}
}

0 comments on commit cb60d8c

Please sign in to comment.