mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-18 12:33:30 +01:00
feat: rest docs (#7281)
This commit is contained in:
2
.github/workflows/documentation.yml
vendored
2
.github/workflows/documentation.yml
vendored
@@ -62,7 +62,7 @@ jobs:
|
|||||||
max-parallel: 1
|
max-parallel: 1
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
package: ['builders', 'collection', 'discord.js', 'voice']
|
package: ['builders', 'collection', 'discord.js', 'rest', 'voice']
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
env:
|
env:
|
||||||
BRANCH_NAME: ${{ needs.build.outputs.BRANCH_NAME }}
|
BRANCH_NAME: ${{ needs.build.outputs.BRANCH_NAME }}
|
||||||
|
|||||||
4
packages/rest/.gitignore
vendored
4
packages/rest/.gitignore
vendored
@@ -17,7 +17,9 @@ pids
|
|||||||
# Dist
|
# Dist
|
||||||
dist/
|
dist/
|
||||||
typings/
|
typings/
|
||||||
docs/
|
docs/**/*
|
||||||
|
!docs/index.yml
|
||||||
|
!docs/README.md
|
||||||
|
|
||||||
# Miscellaneous
|
# Miscellaneous
|
||||||
.tmp/
|
.tmp/
|
||||||
|
|||||||
1
packages/rest/docs/README.md
Normal file
1
packages/rest/docs/README.md
Normal file
@@ -0,0 +1 @@
|
|||||||
|
## [View the documentation here.](https://discord.js.org/#/docs/rest)
|
||||||
5
packages/rest/docs/index.yml
Normal file
5
packages/rest/docs/index.yml
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
- name: General
|
||||||
|
files:
|
||||||
|
- name: Welcome
|
||||||
|
id: welcome
|
||||||
|
path: ../../README.md
|
||||||
@@ -7,6 +7,7 @@
|
|||||||
"test": "jest --pass-with-no-tests --collect-coverage",
|
"test": "jest --pass-with-no-tests --collect-coverage",
|
||||||
"lint": "prettier --check . && eslint src __tests__ --ext mjs,js,ts",
|
"lint": "prettier --check . && eslint src __tests__ --ext mjs,js,ts",
|
||||||
"format": "prettier --write . && eslint src __tests__ --ext mjs,js,ts --fix",
|
"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",
|
"prepublishOnly": "yarn build && yarn lint && yarn test",
|
||||||
"changelog": "git cliff --prepend ./CHANGELOG.md -l -c ../../cliff.toml -r ../../ --include-path './*'"
|
"changelog": "git cliff --prepend ./CHANGELOG.md -l -c ../../cliff.toml -r ../../ --include-path './*'"
|
||||||
},
|
},
|
||||||
@@ -61,6 +62,7 @@
|
|||||||
"@babel/plugin-proposal-decorators": "^7.16.7",
|
"@babel/plugin-proposal-decorators": "^7.16.7",
|
||||||
"@babel/preset-env": "^7.16.8",
|
"@babel/preset-env": "^7.16.8",
|
||||||
"@babel/preset-typescript": "^7.16.7",
|
"@babel/preset-typescript": "^7.16.7",
|
||||||
|
"@discordjs/ts-docgen": "^0.3.4",
|
||||||
"@types/jest": "^27.4.0",
|
"@types/jest": "^27.4.0",
|
||||||
"@types/node-fetch": "^2.5.10",
|
"@types/node-fetch": "^2.5.10",
|
||||||
"@typescript-eslint/eslint-plugin": "^5.9.1",
|
"@typescript-eslint/eslint-plugin": "^5.9.1",
|
||||||
@@ -75,6 +77,7 @@
|
|||||||
"nock": "^13.2.1",
|
"nock": "^13.2.1",
|
||||||
"prettier": "^2.5.1",
|
"prettier": "^2.5.1",
|
||||||
"tsup": "^5.11.11",
|
"tsup": "^5.11.11",
|
||||||
|
"typedoc": "^0.22.10",
|
||||||
"typescript": "^4.5.4"
|
"typescript": "^4.5.4"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
|
|||||||
7
packages/rest/scripts/docs.mjs
Normal file
7
packages/rest/scripts/docs.mjs
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
import { runGenerator } from '@discordjs/ts-docgen';
|
||||||
|
|
||||||
|
runGenerator({
|
||||||
|
existingOutput: 'docs/typedoc-out.json',
|
||||||
|
custom: 'docs/index.yml',
|
||||||
|
output: 'docs/docs.json',
|
||||||
|
});
|
||||||
Reference in New Issue
Block a user