Skip to content

Commit aca7434

Browse files
committed
refactor: switch to json based docs
- feat: start setting up the plugin for parsing - feat: start parsing classes - chore: add actual words - permalink: http://whatthecommit.com/3d6431a17a3b67e8b1341a2c6e4362f8 - chore: it's working! - permalink: http://whatthecommit.com/8d8c1f3903766b8ef27575d63115cac6 - feat: update framework json - fix: fixed rendering custom files with css - chore: update framework json to exclude externals - feat: setup parsing sapphire classes and do a lot of link fixing - refactor: switch to sapphire result - fix: remove replaceall for Node 14 compat - fix: actually remove replaceAll - fix: fixed css extraction regex - I thought I did this already - fix: fixed broken link on welcome page - chore: temporarily disable reporting broken links - feat: much stuff - change `classes` to `class` to match DJS - add `typedef` and `namespace` linking - fix linking of non-generic types - update guide urls to match `class` change - chore: bump deps - chore: i'll explain when you're older! - permalink: http://whatthecommit.com/91a07064bb814666919304a00161fc6c - chore: dope - permalink: http://whatthecommit.com/bab00ed1aa0abb17cce41f36deea1607 - chore: cleanup types - feat: add variant to typedefs - build: make it easier to debug - fix: partially fix link extraction - feat(docgen): add renderTypedef() - Moved parseSee() from /lib/renderer/renderClass.ts to /lib/renderer/utils.ts - Add /lib/renderer/renderTypedef.ts Which adds basic functionality in the website with things like title, description and extendedDescription - chore: sort ts interfaces in docgen output - chore: update doc types - refactor: completely refactor how links are resolved - fix: fixed links for `{@link` tags and propegate change to mdn and djs - fix: use `replace` instead of `replaceAll` - feat(docusaurus-discordjs-docgen): add functionality for enum and interface - style(docusaurus-discordjs-docgen): use Array#flat() for typedef - feat(docusaurus-discordjs-docgen): add constructor table functionality for classes - feat(docusaurus-discordjs-docgen): align table content to center - feat(docusaurus-discordjs-docgen): remove description column if all falsy - feat(docusaurus-discordjs-docgen): add properties functionality for classes - ci: add automatic vercel deploys workflow - chore(docusaurus-typedoc-json-parser): initial commit - chore(docusaurus-typedoc-json-parser): add doc fetching - chore(docusaurus-typedoc-json-parser): add sidebar rendering - fix(deps): update all non-major dependencies - fix(deps): update dependency typedoc-json-parser to ^5.2.0 - feat(docusaurus-typedoc-json-parser): add basic renderers - style(docusaurus-typedoc-json-parser): curly brackets and spacing - style(docusaurus-typedoc-json-parser): template literals - feat(docusaurus-typedoc-json-parser): add class extends and implements - feat(docusaurus-typedoc-json-parser): add link parsing for the local project - chore(docusaurus-typedoc-json-parser): add `start` script to bypass debugger - feat(docusaurus-typedoc-json-parser): add comment info for classes - chore: update dev deps - chore: regen and dedupe lockfile
1 parent 81259b4 commit aca7434

File tree

90 files changed

+47834
-3888
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+47834
-3888
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Automatic Vercel Deploys
2+
3+
on:
4+
# TODO: Enable pre-merge
5+
# schedule:
6+
# - cron: '30 3 * * *'
7+
workflow_dispatch:
8+
9+
jobs:
10+
AutomaticVercelDeploy:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Trigger Vercel Deploy
14+
run: curl -X POST ${VERCEL_DEPLOY_HOOK_URL}
15+
env:
16+
VERCEL_DEPLOY_HOOK_URL: ${{ secrets.VERCEL_DEPLOY_HOOK_URL }}

.github/workflows/update-submodules.yml

-48
This file was deleted.

.gitignore

+4-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ build/
1414
.docusaurus/
1515
.cache-loader/
1616
docs/Documentation/
17-
tsconfig.tsbuildinfo
17+
*.tsbuildinfo
1818

1919
# misc
2020
.DS_Store
@@ -32,3 +32,6 @@ npm-debug.log*
3232
yarn-debug.log*
3333
yarn-error.log*
3434
*.log
35+
36+
# TODO: Remove later
37+
dist/

.gitmodules

-24
This file was deleted.

.vscode/launch.json

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"configurations": [
3+
{
4+
"type": "pwa-node",
5+
"request": "launch",
6+
"runtimeArgs": ["run-script", "debug"],
7+
"name": "Debug Docgen",
8+
"runtimeExecutable": "npm",
9+
"skipFiles": ["<node_internals>/**", "node_modules/tslib/**"],
10+
"internalConsoleOptions": "openOnSessionStart",
11+
"cwd": "${workspaceFolder}/docusaurus-discordjs-docgen",
12+
"console": "internalConsole",
13+
"outputCapture": "std",
14+
"outFiles": ["${workspaceFolder}/docusaurus-discordjs-docgen/dist/**/*.js"]
15+
}
16+
]
17+
}

data/framework.json

+44,646
Large diffs are not rendered by default.

docs/General/Welcome.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ If you don't understand something in the documentation, you are experiencing pro
294294
in the right direction, please don't hesitate to join our official
295295
[Sapphire Community Server](https://sapphirejs.dev/discord).
296296

297-
[frameworksdocs]: ../Documentation/api-framework/
297+
[frameworksdocs]: ../Documentation/sapphire-framework/General/welcome
298298
[djs]: https://discord.js.org/
299299
[saphfw]: https://github.com/sapphiredev/framework
300300
[updating-guide]: ../Guide/getting-started/updating-from-v2-to-v3

docs/Guide/application-commands/application-command-registry/acquiring-an-application-command-registry.mdx

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,6 @@ Read [Registering Application Commands outside a Command][register-outside] for
3737

3838
:::
3939

40-
[register-application-commands]: ../../../Documentation/api-framework/classes/Command#registerapplicationcommands
41-
[command]: ../../../Documentation/api-framework/classes/Command
40+
[register-application-commands]: ../../../Documentation/sapphire-framework/class/Command#registerapplicationcommands
41+
[command]: ../../../Documentation/sapphire-framework/class/Command
4242
[register-outside]: ./advanced/registering-application-commands-outside-a-command

docs/Guide/application-commands/application-command-registry/advanced/routing-existing-application-commands-to-a-command.mdx

+6-6
Original file line numberDiff line numberDiff line change
@@ -94,14 +94,14 @@ registry.addChatInputCommandIds('123456789123456789');
9494
```
9595

9696
[addchatinputcommandids]:
97-
../../../../Documentation/api-framework/classes/ApplicationCommandRegistry#addchatinputcommandids
97+
../../../../Documentation/sapphire-framework/class/ApplicationCommandRegistry#addchatinputcommandids
9898
[addchatinputcommandnames]:
99-
../../../../Documentation/api-framework/classes/ApplicationCommandRegistry#addchatinputcommandnames
99+
../../../../Documentation/sapphire-framework/class/ApplicationCommandRegistry#addchatinputcommandnames
100100
[addcontextmenucommandnames]:
101-
../../../../Documentation/api-framework/classes/ApplicationCommandRegistry#addcontextmenucommandnames
101+
../../../../Documentation/sapphire-framework/class/ApplicationCommandRegistry#addcontextmenucommandnames
102102
[addcontextmenucommandids]:
103-
../../../../Documentation/api-framework/classes/ApplicationCommandRegistry#addcontextmenucommandids
103+
../../../../Documentation/sapphire-framework/class/ApplicationCommandRegistry#addcontextmenucommandids
104104
[idhints]: ../registering-chat-input-commands#idhints
105-
[rcic]: ../../../../Documentation/api-framework/classes/ApplicationCommandRegistry#registerchatinputcommand
106-
[rcmc]: ../../../../Documentation/api-framework/classes/ApplicationCommandRegistry#registercontextmenucommand
105+
[rcic]: ../../../../Documentation/sapphire-framework/class/ApplicationCommandRegistry#registerchatinputcommand
106+
[rcmc]: ../../../../Documentation/sapphire-framework/class/ApplicationCommandRegistry#registercontextmenucommand
107107
[registering-outside-command-class]: ./registering-application-commands-outside-a-command.mdx

docs/Guide/application-commands/application-command-registry/advanced/setting-global-behavior-when-not-identical.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ import { RegisterBehavior } from '@sapphire/framework';
1414
ApplicationCommandRegistries.setDefaultBehaviorWhenNotIdentical(RegisterBehavior.LogToConsole);
1515
```
1616

17-
[application-command-registry]: ../../../../Documentation/api-framework/classes/ApplicationCommandRegistry
17+
[application-command-registry]: ../../../../Documentation/sapphire-framework/class/ApplicationCommandRegistry

docs/Guide/application-commands/application-command-registry/registering-chat-input-commands.mdx

+12-12
Original file line numberDiff line numberDiff line change
@@ -232,28 +232,28 @@ export class SlashCommand extends Command {
232232

233233
The `chatInputRun` example above uses [interaction handlers][interaction-handlers], which are detailed in that section.
234234

235-
[acr]: ../../../Documentation/api-framework/classes/ApplicationCommandRegistry
235+
[acr]: ../../../Documentation/sapphire-framework/class/ApplicationCommandRegistry
236236
[aaacr]: ./acquiring-an-application-command-registry.mdx
237237
[arguments]: ../../arguments/creating-your-own-arguments.mdx
238-
[behavior-log]: ../../../Documentation/api-framework/enums/RegisterBehavior#logtoconsole
239-
[behavior-overwrite]: ../../../Documentation/api-framework/enums/RegisterBehavior#overwrite
240-
[command]: ../../../Documentation/api-framework/classes/Command
238+
[behavior-log]: ../../../Documentation/sapphire-framework/enum/RegisterBehavior#logtoconsole
239+
[behavior-overwrite]: ../../../Documentation/sapphire-framework/enum/RegisterBehavior#overwrite
240+
[command]: ../../../Documentation/sapphire-framework/class/Command
241241
[configure-logging]: ../../plugins/Logger/configuring-loglevel
242242
[discord-deleting-application-commands]:
243243
https://discord.com/developers/docs/interactions/application-commands#updating-and-deleting-a-command
244244
[djs-command-data-docs]: https://discord.js.org/#/docs/discord.js/v13/typedef/ApplicationCommandData
245245
[djs-slash-builder-docs]: https://discord.js.org/#/docs/builders/0.16.0/class/SlashCommandBuilder
246246
[djs-slash-command-options]: https://discordjs.guide/interactions/slash-commands.html#options
247247
[interaction-handlers]: ../interaction-handlers/what-are-they.mdx
248-
[loglevel-info]: ../../../Documentation/api-framework/enums/LogLevel#info
249-
[loglevel-debug]: ../../../Documentation/api-framework/enums/LogLevel#debug
250-
[rac]: ../../../Documentation/api-framework/classes/Command#registerapplicationcommands
251-
[rcic]: ../../../Documentation/api-framework/classes/ApplicationCommandRegistry#registerchatinputcommand
248+
[loglevel-info]: ../../../Documentation/sapphire-framework/enum/LogLevel#info
249+
[loglevel-debug]: ../../../Documentation/sapphire-framework/enum/LogLevel#debug
250+
[rac]: ../../../Documentation/sapphire-framework/class/Command#registerapplicationcommands
251+
[rcic]: ../../../Documentation/sapphire-framework/class/ApplicationCommandRegistry#registerchatinputcommand
252252
[what-is-it]: ./what-is-it
253-
[idhints]: ../../../Documentation/api-framework/interfaces/ApplicationCommandRegistry.RegisterOptions#idhints
254-
[guildids]: ../../../Documentation/api-framework/interfaces/ApplicationCommandRegistry.RegisterOptions#guildids
253+
[idhints]: ../../../Documentation/sapphire-framework/interface/ApplicationCommandRegistry.RegisterOptions#idhints
254+
[guildids]: ../../../Documentation/sapphire-framework/interface/ApplicationCommandRegistry.RegisterOptions#guildids
255255
[behaviorwhennotidentical]:
256-
../../../Documentation/api-framework/interfaces/ApplicationCommandRegistry.RegisterOptions#behaviorwhennotidentical
256+
../../../Documentation/sapphire-framework/interface/ApplicationCommandRegistry.RegisterOptions#behaviorwhennotidentical
257257
[registercommandifmissing]:
258-
../../../Documentation/api-framework/interfaces/ApplicationCommandRegistry.RegisterOptions#registercommandifmissing
258+
../../../Documentation/sapphire-framework/interface/ApplicationCommandRegistry.RegisterOptions#registercommandifmissing
259259
[inner-ref-options]: #chat-input-command-registry-options

docs/Guide/application-commands/application-command-registry/registering-context-commands.mdx

+5-5
Original file line numberDiff line numberDiff line change
@@ -179,14 +179,14 @@ Since `contextMenuRun` runs both kind of context commands, we recommend using ei
179179

180180
:::
181181

182-
[acr]: ../../../Documentation/api-framework/classes/ApplicationCommandRegistry
182+
[acr]: ../../../Documentation/sapphire-framework/class/ApplicationCommandRegistry
183183
[cicro]: ./registering-chat-input-commands.mdx#chat-input-command-registry-options
184-
[command]: ../../../Documentation/api-framework/classes/Command
184+
[command]: ../../../Documentation/sapphire-framework/class/Command
185185
[cmce]: ./message-context-menu-command.png
186186
[djs-command-data-docs]: https://discord.js.org/#/docs/discord.js/v13/typedef/ApplicationCommandData
187187
[djs-context-menu-command-builder-docs]: https://discord.js.org/#/docs/builders/0.16.0/class/ContextMenuCommandBuilder
188-
[rac]: ../../../Documentation/api-framework/classes/Command#registerapplicationcommands
188+
[rac]: ../../../Documentation/sapphire-framework/class/Command#registerapplicationcommands
189189
[registering-chat-input-commands]: ./registering-chat-input-commands.mdx
190190
[registering-chat-input-commands-options]: ./registering-chat-input-commands.mdx#chat-input-command-registry-options
191-
[rcic]: ../../../Documentation/api-framework/classes/ApplicationCommandRegistry#registerchatinputcommand
192-
[rcmc]: ../../../Documentation/api-framework/classes/ApplicationCommandRegistry#registercontextmenucommand
191+
[rcic]: ../../../Documentation/sapphire-framework/class/ApplicationCommandRegistry#registerchatinputcommand
192+
[rcmc]: ../../../Documentation/sapphire-framework/class/ApplicationCommandRegistry#registercontextmenucommand

docs/Guide/application-commands/application-command-registry/what-is-it.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ An [ApplicationCommandRegistry][application-command-registry] manages applicatio
1111
bot's commands. It handles things such as syncing application command data with Discord, routing multiple application
1212
commands to your command, and much more!
1313

14-
[application-command-registry]: ../../../Documentation/api-framework/classes/ApplicationCommandRegistry
14+
[application-command-registry]: ../../../Documentation/sapphire-framework/class/ApplicationCommandRegistry
1515
[discord-application-command-docs]: https://discord.com/developers/docs/interactions/application-commands

docs/Guide/application-commands/interaction-handlers/autocomplete.mdx

+2-2
Original file line numberDiff line numberDiff line change
@@ -82,5 +82,5 @@ If the autocomplete interaction runs via [`InteractionHandler`][interaction-hand
8282
`InteractionHandlerError` (`interactionHandlerError`) event.
8383

8484
[interaction-handlers]: ./what-are-they.mdx
85-
[interaction-handler]: ../../../Documentation/api-framework/classes/InteractionHandler
86-
[autocomplete-run]: ../../../Documentation/api-framework/classes/Command#autocompleterun
85+
[interaction-handler]: ../../../Documentation/sapphire-framework/class/InteractionHandler
86+
[autocomplete-run]: ../../../Documentation/sapphire-framework/class/Command#autocompleterun

docs/Guide/application-commands/interaction-handlers/message-components.mdx

+3-3
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ export class MessageComponentHandler extends InteractionHandler {
4242
}
4343
```
4444

45-
[interactionhandlertypes]: ../../../Documentation/api-framework/enums/InteractionHandlerTypes
46-
[messagecomponent]: ../../../Documentation/api-framework/enums/InteractionHandlerTypes#messagecomponent
47-
[interaction-handler]: ../../../Documentation/api-framework/classes/InteractionHandler
45+
[interactionhandlertypes]: ../../../Documentation/sapphire-framework/enum/InteractionHandlerTypes
46+
[messagecomponent]: ../../../Documentation/sapphire-framework/enum/InteractionHandlerTypes#messagecomponent
47+
[interaction-handler]: ../../../Documentation/sapphire-framework/class/InteractionHandler
4848
[buttons]: ./buttons.mdx
4949
[select-menus]: ./select-menus.mdx

docs/Guide/arguments/built-in-arguments.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ To facilitate creating commands and getting your bot running, Sapphire bundles a
6060
[date]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date
6161
[dmchannel]: https://discord.js.org/#/docs/main/v13/class/DMChannel
6262
[guildchannel]: https://discord.js.org/#/docs/main/v13/class/GuildChannel
63-
[emojiobject]: ../../Documentation/api-framework/interfaces/EmojiObject
63+
[emojiobject]: ../../Documentation/sapphire-framework/interface/EmojiObject
6464
[guildmember]: https://discord.js.org/#/docs/main/v13/class/GuildMember
6565
[mdn-date]:
6666
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#several_ways_to_create_a_date_object

docs/Guide/arguments/using-arguments.mdx

+3-3
Original file line numberDiff line numberDiff line change
@@ -262,8 +262,8 @@ export class MathsCommand extends Command {
262262

263263
The code above matches any number of members up to 5, so it will never return an array of 6 or more.
264264

265-
[pick]: ../../Documentation/api-framework/classes/Args#pick
266-
[rest]: ../../Documentation/api-framework/classes/Args#rest
267-
[repeat]: ../../Documentation/api-framework/classes/Args#repeat
265+
[pick]: ../../Documentation/sapphire-framework/class/Args#pick
266+
[rest]: ../../Documentation/sapphire-framework/class/Args#rest
267+
[repeat]: ../../Documentation/sapphire-framework/class/Args#repeat
268268
[iterator]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Iterators_and_Generators#iterators
269269
[djs-slash-guide-options]: https://discordjs.guide/interactions/slash-commands.html#options

docs/Guide/arguments/using-flags.mdx

+2-2
Original file line numberDiff line numberDiff line change
@@ -122,5 +122,5 @@ export class FlagsCommand extends Command {
122122
}
123123
```
124124

125-
[getflags]: ../../Documentation/api-framework/classes/Args#getflags
126-
[rest]: ../../Documentation/api-framework/classes/Args#rest
125+
[getflags]: ../../Documentation/sapphire-framework/class/Args#getflags
126+
[rest]: ../../Documentation/sapphire-framework/class/Args#rest

docs/Guide/arguments/using-options.mdx

+4-4
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ export class OptionsCommand extends Command {
125125
}
126126
```
127127

128-
[getoption]: ../../Documentation/api-framework/classes/Args#getOption
129-
[getoptions]: ../../Documentation/api-framework/classes/Args#getOptions
130-
[pick]: ../../Documentation/api-framework/classes/Args#pick
131-
[rest]: ../../Documentation/api-framework/classes/Args#rest
128+
[getoption]: ../../Documentation/sapphire-framework/class/Args#getOption
129+
[getoptions]: ../../Documentation/sapphire-framework/class/Args#getOptions
130+
[pick]: ../../Documentation/sapphire-framework/class/Args#pick
131+
[rest]: ../../Documentation/sapphire-framework/class/Args#rest

docs/Guide/getting-started/creating-a-basic-command.mdx

+3-3
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,9 @@ For handling subcommands, please refer to the [Sapphire Plugin Subcommands][saph
144144

145145
:::
146146

147-
[command]: ../../Documentation/api-framework/classes/Command
148-
[commandoptions]: ../../Documentation/api-framework/interfaces/CommandOptions
147+
[command]: ../../Documentation/sapphire-framework/class/Command
148+
[commandoptions]: ../../Documentation/sapphire-framework/interface/CommandOptions
149149
[getting-started]: ./getting-started-with-sapphire
150150
[load-message-commands-option]:
151-
../../Documentation/api-framework/interfaces/SapphireClientOptions#loadmessagecommandlisteners
151+
../../Documentation/sapphire-framework/interface/SapphireClientOptions#loadmessagecommandlisteners
152152
[saph-plug-subcom]: ../plugins/Subcommands/getting-started

docs/Guide/getting-started/getting-started-with-sapphire.mdx

+2-2
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ And that's it for your `index.js` file! In the end, your directory should look l
8686
└── index.js
8787
```
8888

89-
[sapphire]: ../../Documentation/api-framework/classes/SapphireClient
89+
[sapphire]: ../../Documentation/sapphire-framework/class/SapphireClient
9090
[djs-client]: https://discord.js.org/#/docs/main/v13/class/Client
91-
[baseuserdirectory]: ../../Documentation/api-framework/interfaces/SapphireClientOptions#baseuserdirectory
91+
[baseuserdirectory]: ../../Documentation/sapphire-framework/interface/SapphireClientOptions#baseuserdirectory
9292
[securing-your-token]: https://discordjs.guide/preparations/setting-up-a-bot-application.html#your-token

0 commit comments

Comments
 (0)