Skip to content

Commit

Permalink
refactor: switch to json based docs
Browse files Browse the repository at this point in the history
- feat: start setting up the plugin for parsing
- feat: start parsing classes
- 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: 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
- fix(docusaurus-typedoc-json-parser): absorb breaking changes and add versioning
- refactor: switch to using typedoc-json-parser plugin
- chore: add `update` script
- fix(deps): update dependency typedoc-json-parser to ^6.0.2
- fix(docusaurus-typedoc-json-parser): proper category yamls
- feat(docusaurus-typedoc-json-parser): first steps to proper type linking
- refactor(docusaurus-typedoc-json-parser): switch from constant to variable
- feat(docusaurus-typedoc-json-parser): render classes
- ci: use tags for actions
  • Loading branch information
favna committed Oct 23, 2022
1 parent b9ff2a3 commit 9317110
Show file tree
Hide file tree
Showing 92 changed files with 62,370 additions and 18,266 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/automatic-vercel-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Automatic Vercel Deploys

on:
# TODO: Enable pre-merge
# schedule:
# - cron: '30 3 * * *'
workflow_dispatch:

jobs:
AutomaticVercelDeploy:
runs-on: ubuntu-latest
steps:
- name: Trigger Vercel Deploy
run: curl -X POST ${VERCEL_DEPLOY_HOOK_URL}
env:
VERCEL_DEPLOY_HOOK_URL: ${{ secrets.VERCEL_DEPLOY_HOOK_URL }}
48 changes: 0 additions & 48 deletions .github/workflows/update-submodules.yml

This file was deleted.

5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ build/
.docusaurus/
.cache-loader/
docs/Documentation/
tsconfig.tsbuildinfo
*.tsbuildinfo

# misc
.DS_Store
Expand All @@ -32,3 +32,6 @@ npm-debug.log*
yarn-debug.log*
yarn-error.log*
*.log

# TODO: Remove later
dist/
24 changes: 0 additions & 24 deletions .gitmodules

This file was deleted.

17 changes: 17 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"configurations": [
{
"type": "pwa-node",
"request": "launch",
"runtimeArgs": ["run-script", "debug"],
"name": "Debug Docgen",
"runtimeExecutable": "npm",
"skipFiles": ["<node_internals>/**", "node_modules/tslib/**"],
"internalConsoleOptions": "openOnSessionStart",
"cwd": "${workspaceFolder}/docusaurus-discordjs-docgen",
"console": "internalConsole",
"outputCapture": "std",
"outFiles": ["${workspaceFolder}/docusaurus-discordjs-docgen/dist/**/*.js"]
}
]
}
44,646 changes: 44,646 additions & 0 deletions data/framework.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/General/Welcome.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ If you don't understand something in the documentation, you are experiencing pro
in the right direction, please don't hesitate to join our official
[Sapphire Community Server](https://sapphirejs.dev/discord).

[frameworksdocs]: ../Documentation/api-framework/
[frameworksdocs]: ../Documentation/sapphire-framework/General/welcome
[djs]: https://discord.js.org/
[saphfw]: https://github.com/sapphiredev/framework
[updating-guide]: ../Guide/getting-started/updating-from-v2-to-v3
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@ Read [Registering Application Commands outside a Command][register-outside] for

:::

[register-application-commands]: ../../../Documentation/api-framework/classes/Command#registerapplicationcommands
[command]: ../../../Documentation/api-framework/classes/Command
[register-application-commands]: ../../../Documentation/sapphire-framework/class/Command#registerapplicationcommands
[command]: ../../../Documentation/sapphire-framework/class/Command
[register-outside]: ./advanced/registering-application-commands-outside-a-command
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,14 @@ registry.addChatInputCommandIds('123456789123456789');
```

[addchatinputcommandids]:
../../../../Documentation/api-framework/classes/ApplicationCommandRegistry#addchatinputcommandids
../../../../Documentation/sapphire-framework/class/ApplicationCommandRegistry#addchatinputcommandids
[addchatinputcommandnames]:
../../../../Documentation/api-framework/classes/ApplicationCommandRegistry#addchatinputcommandnames
../../../../Documentation/sapphire-framework/class/ApplicationCommandRegistry#addchatinputcommandnames
[addcontextmenucommandnames]:
../../../../Documentation/api-framework/classes/ApplicationCommandRegistry#addcontextmenucommandnames
../../../../Documentation/sapphire-framework/class/ApplicationCommandRegistry#addcontextmenucommandnames
[addcontextmenucommandids]:
../../../../Documentation/api-framework/classes/ApplicationCommandRegistry#addcontextmenucommandids
../../../../Documentation/sapphire-framework/class/ApplicationCommandRegistry#addcontextmenucommandids
[idhints]: ../registering-chat-input-commands#idhints
[rcic]: ../../../../Documentation/api-framework/classes/ApplicationCommandRegistry#registerchatinputcommand
[rcmc]: ../../../../Documentation/api-framework/classes/ApplicationCommandRegistry#registercontextmenucommand
[rcic]: ../../../../Documentation/sapphire-framework/class/ApplicationCommandRegistry#registerchatinputcommand
[rcmc]: ../../../../Documentation/sapphire-framework/class/ApplicationCommandRegistry#registercontextmenucommand
[registering-outside-command-class]: ./registering-application-commands-outside-a-command.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ import { RegisterBehavior } from '@sapphire/framework';
ApplicationCommandRegistries.setDefaultBehaviorWhenNotIdentical(RegisterBehavior.LogToConsole);
```

[application-command-registry]: ../../../../Documentation/api-framework/classes/ApplicationCommandRegistry
[application-command-registry]: ../../../../Documentation/sapphire-framework/class/ApplicationCommandRegistry
Original file line number Diff line number Diff line change
Expand Up @@ -232,28 +232,28 @@ export class SlashCommand extends Command {

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

[acr]: ../../../Documentation/api-framework/classes/ApplicationCommandRegistry
[acr]: ../../../Documentation/sapphire-framework/class/ApplicationCommandRegistry
[aaacr]: ./acquiring-an-application-command-registry.mdx
[arguments]: ../../arguments/creating-your-own-arguments.mdx
[behavior-log]: ../../../Documentation/api-framework/enums/RegisterBehavior#logtoconsole
[behavior-overwrite]: ../../../Documentation/api-framework/enums/RegisterBehavior#overwrite
[command]: ../../../Documentation/api-framework/classes/Command
[behavior-log]: ../../../Documentation/sapphire-framework/enum/RegisterBehavior#logtoconsole
[behavior-overwrite]: ../../../Documentation/sapphire-framework/enum/RegisterBehavior#overwrite
[command]: ../../../Documentation/sapphire-framework/class/Command
[configure-logging]: ../../plugins/Logger/configuring-loglevel
[discord-deleting-application-commands]:
https://discord.com/developers/docs/interactions/application-commands#updating-and-deleting-a-command
[djs-command-data-docs]: https://discord.js.org/#/docs/discord.js/v13/typedef/ApplicationCommandData
[djs-slash-builder-docs]: https://discord.js.org/#/docs/builders/0.16.0/class/SlashCommandBuilder
[djs-slash-command-options]: https://discordjs.guide/interactions/slash-commands.html#options
[interaction-handlers]: ../interaction-handlers/what-are-they.mdx
[loglevel-info]: ../../../Documentation/api-framework/enums/LogLevel#info
[loglevel-debug]: ../../../Documentation/api-framework/enums/LogLevel#debug
[rac]: ../../../Documentation/api-framework/classes/Command#registerapplicationcommands
[rcic]: ../../../Documentation/api-framework/classes/ApplicationCommandRegistry#registerchatinputcommand
[loglevel-info]: ../../../Documentation/sapphire-framework/enum/LogLevel#info
[loglevel-debug]: ../../../Documentation/sapphire-framework/enum/LogLevel#debug
[rac]: ../../../Documentation/sapphire-framework/class/Command#registerapplicationcommands
[rcic]: ../../../Documentation/sapphire-framework/class/ApplicationCommandRegistry#registerchatinputcommand
[what-is-it]: ./what-is-it
[idhints]: ../../../Documentation/api-framework/interfaces/ApplicationCommandRegistry.RegisterOptions#idhints
[guildids]: ../../../Documentation/api-framework/interfaces/ApplicationCommandRegistry.RegisterOptions#guildids
[idhints]: ../../../Documentation/sapphire-framework/interface/ApplicationCommandRegistry.RegisterOptions#idhints
[guildids]: ../../../Documentation/sapphire-framework/interface/ApplicationCommandRegistry.RegisterOptions#guildids
[behaviorwhennotidentical]:
../../../Documentation/api-framework/interfaces/ApplicationCommandRegistry.RegisterOptions#behaviorwhennotidentical
../../../Documentation/sapphire-framework/interface/ApplicationCommandRegistry.RegisterOptions#behaviorwhennotidentical
[registercommandifmissing]:
../../../Documentation/api-framework/interfaces/ApplicationCommandRegistry.RegisterOptions#registercommandifmissing
../../../Documentation/sapphire-framework/interface/ApplicationCommandRegistry.RegisterOptions#registercommandifmissing
[inner-ref-options]: #chat-input-command-registry-options
Original file line number Diff line number Diff line change
Expand Up @@ -179,14 +179,14 @@ Since `contextMenuRun` runs both kind of context commands, we recommend using ei

:::

[acr]: ../../../Documentation/api-framework/classes/ApplicationCommandRegistry
[acr]: ../../../Documentation/sapphire-framework/class/ApplicationCommandRegistry
[cicro]: ./registering-chat-input-commands.mdx#chat-input-command-registry-options
[command]: ../../../Documentation/api-framework/classes/Command
[command]: ../../../Documentation/sapphire-framework/class/Command
[cmce]: ./message-context-menu-command.png
[djs-command-data-docs]: https://discord.js.org/#/docs/discord.js/v13/typedef/ApplicationCommandData
[djs-context-menu-command-builder-docs]: https://discord.js.org/#/docs/builders/0.16.0/class/ContextMenuCommandBuilder
[rac]: ../../../Documentation/api-framework/classes/Command#registerapplicationcommands
[rac]: ../../../Documentation/sapphire-framework/class/Command#registerapplicationcommands
[registering-chat-input-commands]: ./registering-chat-input-commands.mdx
[registering-chat-input-commands-options]: ./registering-chat-input-commands.mdx#chat-input-command-registry-options
[rcic]: ../../../Documentation/api-framework/classes/ApplicationCommandRegistry#registerchatinputcommand
[rcmc]: ../../../Documentation/api-framework/classes/ApplicationCommandRegistry#registercontextmenucommand
[rcic]: ../../../Documentation/sapphire-framework/class/ApplicationCommandRegistry#registerchatinputcommand
[rcmc]: ../../../Documentation/sapphire-framework/class/ApplicationCommandRegistry#registercontextmenucommand
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ An [ApplicationCommandRegistry][application-command-registry] manages applicatio
bot's commands. It handles things such as syncing application command data with Discord, routing multiple application
commands to your command, and much more!

[application-command-registry]: ../../../Documentation/api-framework/classes/ApplicationCommandRegistry
[application-command-registry]: ../../../Documentation/sapphire-framework/class/ApplicationCommandRegistry
[discord-application-command-docs]: https://discord.com/developers/docs/interactions/application-commands
Original file line number Diff line number Diff line change
Expand Up @@ -82,5 +82,5 @@ If the autocomplete interaction runs via [`InteractionHandler`][interaction-hand
`InteractionHandlerError` (`interactionHandlerError`) event.

[interaction-handlers]: ./what-are-they.mdx
[interaction-handler]: ../../../Documentation/api-framework/classes/InteractionHandler
[autocomplete-run]: ../../../Documentation/api-framework/classes/Command#autocompleterun
[interaction-handler]: ../../../Documentation/sapphire-framework/class/InteractionHandler
[autocomplete-run]: ../../../Documentation/sapphire-framework/class/Command#autocompleterun
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ export class MessageComponentHandler extends InteractionHandler {
}
```

[interactionhandlertypes]: ../../../Documentation/api-framework/enums/InteractionHandlerTypes
[messagecomponent]: ../../../Documentation/api-framework/enums/InteractionHandlerTypes#messagecomponent
[interaction-handler]: ../../../Documentation/api-framework/classes/InteractionHandler
[interactionhandlertypes]: ../../../Documentation/sapphire-framework/enum/InteractionHandlerTypes
[messagecomponent]: ../../../Documentation/sapphire-framework/enum/InteractionHandlerTypes#messagecomponent
[interaction-handler]: ../../../Documentation/sapphire-framework/class/InteractionHandler
[buttons]: ./buttons.mdx
[select-menus]: ./select-menus.mdx
2 changes: 1 addition & 1 deletion docs/Guide/arguments/built-in-arguments.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ To facilitate creating commands and getting your bot running, Sapphire bundles a
[date]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date
[dmchannel]: https://discord.js.org/#/docs/main/v13/class/DMChannel
[guildchannel]: https://discord.js.org/#/docs/main/v13/class/GuildChannel
[emojiobject]: ../../Documentation/api-framework/interfaces/EmojiObject
[emojiobject]: ../../Documentation/sapphire-framework/interface/EmojiObject
[guildmember]: https://discord.js.org/#/docs/main/v13/class/GuildMember
[mdn-date]:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#several_ways_to_create_a_date_object
Expand Down
6 changes: 3 additions & 3 deletions docs/Guide/arguments/using-arguments.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -262,8 +262,8 @@ export class MathsCommand extends Command {

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

[pick]: ../../Documentation/api-framework/classes/Args#pick
[rest]: ../../Documentation/api-framework/classes/Args#rest
[repeat]: ../../Documentation/api-framework/classes/Args#repeat
[pick]: ../../Documentation/sapphire-framework/class/Args#pick
[rest]: ../../Documentation/sapphire-framework/class/Args#rest
[repeat]: ../../Documentation/sapphire-framework/class/Args#repeat
[iterator]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Iterators_and_Generators#iterators
[djs-slash-guide-options]: https://discordjs.guide/interactions/slash-commands.html#options
4 changes: 2 additions & 2 deletions docs/Guide/arguments/using-flags.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -122,5 +122,5 @@ export class FlagsCommand extends Command {
}
```

[getflags]: ../../Documentation/api-framework/classes/Args#getflags
[rest]: ../../Documentation/api-framework/classes/Args#rest
[getflags]: ../../Documentation/sapphire-framework/class/Args#getflags
[rest]: ../../Documentation/sapphire-framework/class/Args#rest
8 changes: 4 additions & 4 deletions docs/Guide/arguments/using-options.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ export class OptionsCommand extends Command {
}
```

[getoption]: ../../Documentation/api-framework/classes/Args#getOption
[getoptions]: ../../Documentation/api-framework/classes/Args#getOptions
[pick]: ../../Documentation/api-framework/classes/Args#pick
[rest]: ../../Documentation/api-framework/classes/Args#rest
[getoption]: ../../Documentation/sapphire-framework/class/Args#getOption
[getoptions]: ../../Documentation/sapphire-framework/class/Args#getOptions
[pick]: ../../Documentation/sapphire-framework/class/Args#pick
[rest]: ../../Documentation/sapphire-framework/class/Args#rest
6 changes: 3 additions & 3 deletions docs/Guide/getting-started/creating-a-basic-command.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,9 @@ For handling subcommands, please refer to the [Sapphire Plugin Subcommands][saph

:::

[command]: ../../Documentation/api-framework/classes/Command
[commandoptions]: ../../Documentation/api-framework/interfaces/CommandOptions
[command]: ../../Documentation/sapphire-framework/class/Command
[commandoptions]: ../../Documentation/sapphire-framework/interface/CommandOptions
[getting-started]: ./getting-started-with-sapphire
[load-message-commands-option]:
../../Documentation/api-framework/interfaces/SapphireClientOptions#loadmessagecommandlisteners
../../Documentation/sapphire-framework/interface/SapphireClientOptions#loadmessagecommandlisteners
[saph-plug-subcom]: ../plugins/Subcommands/getting-started
4 changes: 2 additions & 2 deletions docs/Guide/getting-started/getting-started-with-sapphire.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ And that's it for your `index.js` file! In the end, your directory should look l
└── index.js
```

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

0 comments on commit 9317110

Please sign in to comment.