Skip to content

Commit

Permalink
docs: generate api documentation as a GitHub workflow
Browse files Browse the repository at this point in the history
Fixes: #212
  • Loading branch information
lance committed Jun 8, 2020
1 parent ed1d328 commit 87a9d90
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 15 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/api-docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: API Docs

on: release

jobs:
publish:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v2
-
name: Generate API documentation
run: npm install && npm run generate-docs
-
name: Deploy to GitHub Pages
if: success()
uses: crazy-max/ghaction-github-pages@v2
with:
target_branch: gh-pages
build_dir: docs
commit_message: |
Deploy to GitHub Pages
Signed-off-by: Lance Ball <lball@redhat.com>
allow_empty_commit: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
17 changes: 6 additions & 11 deletions package-lock.json

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

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "2.0.2",
"description": "CloudEvents SDK for JavaScript",
"main": "index.js",
"type": "module",
"scripts": {
"watch": "tsc --project tsconfig.json --watch",
"build": "tsc --project tsconfig.json",
Expand All @@ -14,7 +15,7 @@
"test:ts": "mocha --require ts-node/register ./test-ts/**/*.ts",
"coverage": "nyc --reporter=lcov --reporter=text npm run test",
"coverage-publish": "wget -qO - https://coverage.codacy.com/get.sh | bash -s report -l JavaScript -r coverage/lcov.info",
"generate-docs": "typedoc --tsconfig ./tsconfig.json --plugin typedoc-plugin-markdown src",
"generate-docs": "typedoc --excludeNotDocumented --out docs src",
"release": "standard-version",
"prepublish": "npm run build"
},
Expand Down Expand Up @@ -99,6 +100,7 @@
"dependencies": {
"ajv": "~6.12.0",
"axios": "~0.19.2",
"typedoc-clarity-theme": "^1.1.0",
"uuid": "~8.0.0"
},
"devDependencies": {
Expand All @@ -118,7 +120,6 @@
"standardx": "^5.0.0",
"ts-node": "^8.10.2",
"typedoc": "^0.17.7",
"typedoc-plugin-markdown": "^2.2.17",
"typescript": "^3.8.3"
},
"publishConfig": {
Expand Down
2 changes: 1 addition & 1 deletion src/lib/formats/json/parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const nullOrUndefinedPayload = new ValidationError("null or undefined payload");
const asJSON = (v: object|string) => (isString(v) ? JSON.parse(v as string) : v);

class JSONParser {
decorator: any
decorator: Base64Parser
constructor(decorator: Base64Parser) {
this.decorator = decorator;
}
Expand Down
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
],
"typedocOptions": {
"out": "docs",
"mode": "file"
"mode": "file",
"theme": "node_modules/typedoc-clarity-theme/bin"
}
}

0 comments on commit 87a9d90

Please sign in to comment.