Skip to content

Commit 44b791b

Browse files
authored
docs: generate api documentation as a GitHub workflow (cloudevents#217)
Fixes: cloudevents#212 Signed-off-by: Lance Ball <lball@redhat.com>
1 parent ed1d328 commit 44b791b

File tree

5 files changed

+38
-15
lines changed

5 files changed

+38
-15
lines changed

.github/workflows/api-docs.yaml

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: API Docs
2+
3+
on: release
4+
5+
jobs:
6+
publish:
7+
runs-on: ubuntu-latest
8+
steps:
9+
-
10+
name: Checkout
11+
uses: actions/checkout@v2
12+
-
13+
name: Generate API documentation
14+
run: npm install && npm run generate-docs
15+
-
16+
name: Deploy to GitHub Pages
17+
if: success()
18+
uses: crazy-max/ghaction-github-pages@v2
19+
with:
20+
target_branch: gh-pages
21+
build_dir: docs
22+
commit_message: |
23+
Deploy to GitHub Pages
24+
Signed-off-by: Lance Ball <lball@redhat.com>
25+
allow_empty_commit: false
26+
env:
27+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

package-lock.json

+6-11
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"test:ts": "mocha --require ts-node/register ./test-ts/**/*.ts",
1515
"coverage": "nyc --reporter=lcov --reporter=text npm run test",
1616
"coverage-publish": "wget -qO - https://coverage.codacy.com/get.sh | bash -s report -l JavaScript -r coverage/lcov.info",
17-
"generate-docs": "typedoc --tsconfig ./tsconfig.json --plugin typedoc-plugin-markdown src",
17+
"generate-docs": "typedoc --excludeNotDocumented --out docs src",
1818
"release": "standard-version",
1919
"prepublish": "npm run build"
2020
},
@@ -99,6 +99,7 @@
9999
"dependencies": {
100100
"ajv": "~6.12.0",
101101
"axios": "~0.19.2",
102+
"typedoc-clarity-theme": "^1.1.0",
102103
"uuid": "~8.0.0"
103104
},
104105
"devDependencies": {
@@ -118,7 +119,6 @@
118119
"standardx": "^5.0.0",
119120
"ts-node": "^8.10.2",
120121
"typedoc": "^0.17.7",
121-
"typedoc-plugin-markdown": "^2.2.17",
122122
"typescript": "^3.8.3"
123123
},
124124
"publishConfig": {

src/lib/formats/json/parser.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const nullOrUndefinedPayload = new ValidationError("null or undefined payload");
1111
const asJSON = (v: object|string) => (isString(v) ? JSON.parse(v as string) : v);
1212

1313
class JSONParser {
14-
decorator: any
14+
decorator: Base64Parser
1515
constructor(decorator: Base64Parser) {
1616
this.decorator = decorator;
1717
}

tsconfig.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
],
2222
"typedocOptions": {
2323
"out": "docs",
24-
"mode": "file"
24+
"mode": "file",
25+
"theme": "node_modules/typedoc-clarity-theme/bin"
2526
}
2627
}

0 commit comments

Comments
 (0)