Skip to content

Commit

Permalink
feat: rest docs (#7281)
Browse files Browse the repository at this point in the history
  • Loading branch information
vaporoxx committed Jan 17, 2022
1 parent ecf2430 commit 9054f2f
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:
max-parallel: 1
fail-fast: false
matrix:
package: ['builders', 'collection', 'discord.js', 'voice']
package: ['builders', 'collection', 'discord.js', 'rest', 'voice']
runs-on: ubuntu-latest
env:
BRANCH_NAME: ${{ needs.build.outputs.BRANCH_NAME }}
Expand Down
4 changes: 3 additions & 1 deletion packages/rest/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ pids
# Dist
dist/
typings/
docs/
docs/**/*
!docs/index.yml
!docs/README.md

# Miscellaneous
.tmp/
Expand Down
1 change: 1 addition & 0 deletions packages/rest/docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
## [View the documentation here.](https://discord.js.org/#/docs/rest)
5 changes: 5 additions & 0 deletions packages/rest/docs/index.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
- name: General
files:
- name: Welcome
id: welcome
path: ../../README.md
3 changes: 3 additions & 0 deletions packages/rest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"test": "jest --pass-with-no-tests --collect-coverage",
"lint": "prettier --check . && eslint src __tests__ --ext mjs,js,ts",
"format": "prettier --write . && eslint src __tests__ --ext mjs,js,ts --fix",
"docs": "typedoc --json docs/typedoc-out.json src/index.ts && node scripts/docs.mjs",
"prepublishOnly": "yarn build && yarn lint && yarn test",
"changelog": "git cliff --prepend ./CHANGELOG.md -l -c ../../cliff.toml -r ../../ --include-path './*'"
},
Expand Down Expand Up @@ -61,6 +62,7 @@
"@babel/plugin-proposal-decorators": "^7.16.7",
"@babel/preset-env": "^7.16.8",
"@babel/preset-typescript": "^7.16.7",
"@discordjs/ts-docgen": "^0.3.4",
"@types/jest": "^27.4.0",
"@types/node-fetch": "^2.5.10",
"@typescript-eslint/eslint-plugin": "^5.9.1",
Expand All @@ -75,6 +77,7 @@
"nock": "^13.2.1",
"prettier": "^2.5.1",
"tsup": "^5.11.11",
"typedoc": "^0.22.10",
"typescript": "^4.5.4"
},
"engines": {
Expand Down
7 changes: 7 additions & 0 deletions packages/rest/scripts/docs.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { runGenerator } from '@discordjs/ts-docgen';

runGenerator({
existingOutput: 'docs/typedoc-out.json',
custom: 'docs/index.yml',
output: 'docs/docs.json',
});

0 comments on commit 9054f2f

Please sign in to comment.