diff --git a/astro.config.mjs b/astro.config.mjs index 885cb1d8c..9b0c44b14 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -4,6 +4,7 @@ import starlightBlog from "starlight-blog"; import tailwind from "@astrojs/tailwind"; import starlightTypeDoc, { typeDocSidebarGroup } from "starlight-typedoc"; import lunaria from "@lunariajs/starlight"; +import starlightLinksValidator from 'starlight-links-validator'; import { GITHUB_URL, DISCORD_URL } from "./src/utils/consts"; export default defineConfig({ @@ -73,7 +74,7 @@ export default defineConfig({ { label: "v4", items: [ - { + { label: "CLI", autogenerate: { directory: "cli" }, }, @@ -129,6 +130,9 @@ export default defineConfig({ sidebar: { collapsed: true }, }), lunaria(), + starlightLinksValidator({ + exclude: ['/v3/api'], + }), ], }), tailwind(), diff --git a/bun.lockb b/bun.lockb index 08fab511e..5ad2c0896 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index 24924d3d2..e4f837aef 100644 --- a/package.json +++ b/package.json @@ -23,6 +23,7 @@ "astro": "4.9.1", "sharp": "^0.32.5", "starlight-blog": "^0.7.1", + "starlight-links-validator": "^0.8.0", "starlight-typedoc": "^0.12.1", "typedoc": "^0.25.13", "typedoc-plugin-markdown": "next", diff --git a/src/content/docs/blog/2022-09-28.mdx b/src/content/docs/blog/1.2.0.mdx similarity index 84% rename from src/content/docs/blog/2022-09-28.mdx rename to src/content/docs/blog/1.2.0.mdx index d5097f20a..7fd49f12b 100644 --- a/src/content/docs/blog/2022-09-28.mdx +++ b/src/content/docs/blog/1.2.0.mdx @@ -24,7 +24,7 @@ Quick List of changes! ### Class based modules Incorporate class based modules into your project instead of the traditional `commandModule` or `eventModule` -Extend the new [CommandExecutable](docs/api/classes/CommandExecutable) or [EventExecutable](docs/api/classes/EventExecutable) +Extend the new `CommandExecutable` or `EventExecutable` ```ts title="commands/meaning-of-life.ts" {15} import { @@ -74,11 +74,11 @@ Feel free to use TypeScript experimental decorators to augment and customize you The next update will bring sern v2 with some important features. Here are some things to watch out for. -- [Wrapper#client](docs/api/interfaces/Wrapper) will be deprecated -- [Wrapper#sernEmitter](docs/api/interfaces/Wrapper) will be deprecated +- [Wrapper#client](/v3/api/interfaces/wrapper) will be deprecated +- [Wrapper#sernEmitter](/v3/api/interfaces/wrapper) will be deprecated - a SernEmitter will be automatically created once Sern#init is called -- The option to pass in a function or array for [Wrapper#events](docs/api/interfaces/Wrapper) will be deprecated. Only strings are accepted. -- [Sern#addExternal](docs/api/classes/SernEmitter) will be deprecated in favor of a better way. +- The option to pass in a function or array for [Wrapper#events](/v3/api/interfaces/wrapper) will be deprecated. Only strings are accepted. +- `Sern#addExternal` will be deprecated in favor of a better way. ### Dependencies Update diff --git a/src/content/docs/blog/2022-12-13.md b/src/content/docs/blog/2.0.0.md similarity index 100% rename from src/content/docs/blog/2022-12-13.md rename to src/content/docs/blog/2.0.0.md diff --git a/src/content/docs/blog/2023-01-12.md b/src/content/docs/blog/2.5.0.md similarity index 51% rename from src/content/docs/blog/2023-01-12.md rename to src/content/docs/blog/2.5.0.md index 6e23ec72b..2bf75d002 100644 --- a/src/content/docs/blog/2023-01-12.md +++ b/src/content/docs/blog/2.5.0.md @@ -17,22 +17,23 @@ date: 2023-01-12 ### Breaking changes -- [controller](../docs/api/modules#controller) parameter for plugins has been removed +- `controller` parameter for plugins has been removed - You'll need to import it instead - - This **breaks** old [CommandPlugin](../docs/api/interfaces/CommandPlugin), but **not** old [EventPlugin](../docs/api/interfaces/EventPlugin) + - This **breaks** old `CommandPlugin`, but **not** old `EventPlugin` ### Deprecations -- [CommandPlugin](../docs/api/interfaces/CommandPlugin) and [EventPlugin](../docs/api/interfaces/EventPlugin) have been renamed [InitPlugin](../docs/api/interfaces/InitPlugin) and [ControlPlugin](../docs/api/interfaces/ControlPlugin) +- `CommandPlugin` and `EventPlugin` have been renamed to [InitPlugin](/v3/api/interfaces/initplugin) and [ControlPlugin](/v3/docs/api/interfaces/controlplugin), respectively ### Reason - The naming of plugins was getting too complex. For example, plugin naming evolved into CommandModuleCommandPlugin, CommandModuleEventPlugin and more. - I realize that this affects all plugins. I have updated all [plugins](https://github.com/sern-handler/awesome-plugins/pull/68) to match these changes - The old way of declaring plugins has been deprecated in favor of newer functions that facilitate and ease typings - - [CommandControlPlugin](../docs/api/modules#commandcontrolplugin) - - [CommandInitPlugin](../docs/api/modules#commandinitplugin) - - [EventControlPlugin](../docs/api/modules#eventcontrolplugin) - - [EventInitPlugin](../docs/api/modules#eventinitplugin) - - [DiscordEventControlPlugin](../docs/api/modules#discordeventcontrolplugin) - This will probably be the last breaking change in a while. Thanks for using sern! + - [CommandControlPlugin](/v3/api/functions/commandcontrolplugin) + - [CommandInitPlugin](/v3/api/functions/commandinitplugin) + - [EventControlPlugin](/v3/api/functions/eventcontrolplugin) + - [EventInitPlugin](/v3/api/functions/eventinitplugin) + - [DiscordEventControlPlugin](/v3/api/functions/discordeventcontrolplugin) + +This will probably be the last breaking change in a while. Thanks for using sern! diff --git a/src/content/docs/blog/2023-06-18.md b/src/content/docs/blog/3.0.0.md similarity index 100% rename from src/content/docs/blog/2023-06-18.md rename to src/content/docs/blog/3.0.0.md diff --git a/src/content/docs/blog/2022-09-30.mdx b/src/content/docs/blog/getting-started.mdx similarity index 100% rename from src/content/docs/blog/2022-09-30.mdx rename to src/content/docs/blog/getting-started.mdx diff --git a/src/content/docs/blog/2023-7-4.md b/src/content/docs/blog/new-logo.md similarity index 100% rename from src/content/docs/blog/2023-7-4.md rename to src/content/docs/blog/new-logo.md diff --git a/src/content/docs/blog/2024-02-23.md b/src/content/docs/blog/railway-deploy.md similarity index 100% rename from src/content/docs/blog/2024-02-23.md rename to src/content/docs/blog/railway-deploy.md diff --git a/src/content/docs/cli/publish.mdx b/src/content/docs/cli/publish.mdx index 9ebc5d7ce..ce0d58466 100644 --- a/src/content/docs/cli/publish.mdx +++ b/src/content/docs/cli/publish.mdx @@ -77,7 +77,7 @@ type ValidPublishOptions = ## Prerequiring -Is there a [service](../../guide/walkthrough/services) that is required at the top level of a command? +Is there a [service](/v3/guide/walkthrough/services) that is required at the top level of a command? Create an ES6 script anywhere, such as: diff --git a/src/content/docs/v3/guide/walkthrough/cli.mdx b/src/content/docs/v3/guide/walkthrough/cli.mdx index 11d511825..7d4e7e87b 100644 --- a/src/content/docs/v3/guide/walkthrough/cli.mdx +++ b/src/content/docs/v3/guide/walkthrough/cli.mdx @@ -19,10 +19,10 @@ import PackageManagers from '~/components/PackageManagers.astro'; ## Adding Plugins :::caution -You must have a [sern.config.json](../good-to-know#sernconfigjson) to use this command. +You must have a [sern.config.json](/v3/guide/walkthrough/good-to-know#sernconfigjson) to use this command. ::: -To install [plugins](../plugins) maintained by the community [repository](https://github.com/sern-handler/awesome-plugins): +To install [plugins](/v3/guide/walkthrough/plugins) maintained by the community [repository](https://github.com/sern-handler/awesome-plugins): ```sh sern plugins @@ -30,7 +30,7 @@ sern plugins This will display a menu selection of all installable plugins. -If you'd like to view all plugins, check out our [plugins page](../../../plugins). +If you'd like to view all plugins, check out our [plugins page](/plugins). ## Extra Utilities @@ -40,4 +40,4 @@ To install extra utilities into your project, run: sern extra ``` -We have a more in depth [guide](../../../cli/about) on the CLI if you're interested in learning more. +We have a more in depth [guide](/v3/cli/about) on the CLI if you're interested in learning more. diff --git a/src/content/docs/v3/guide/walkthrough/dependency-injection.mdx b/src/content/docs/v3/guide/walkthrough/dependency-injection.mdx index f56fb1bc3..aeb8eda55 100644 --- a/src/content/docs/v3/guide/walkthrough/dependency-injection.mdx +++ b/src/content/docs/v3/guide/walkthrough/dependency-injection.mdx @@ -5,7 +5,7 @@ sidebar: --- :::danger -This contains version 2 code. Please view [transitioning to v3](../transition) for the `Service` API. +This contains version 2 code. Please view [transitioning to v3](/v3/guide/walkthrough/transition) for the `Service` API. ::: Since version 2.0.0, dependency injection, thanks to [iti](https://github.com/molszanski/iti), is a feature to customize your bot's utilities and structures. @@ -68,10 +68,10 @@ Everything else is handled. However, you may want customize things. Each sern built dependency must implement its contracts: -- `@sern/logger`: Logging data → [`Logging`](../../../api/interfaces/logging) -- `@sern/errors`: Handling errors and lifetime → [`ErrorHandling`](../../../api/interfaces/errorhandling) -- `@sern/modules`: Managing all command modules → [`ModuleManager`](../../../api/interfaces/modulemanager) -- `@sern/emitter`: The key to emit events and occurences in a project → [`Emitter`](../../../api/interfaces/emitter) +- `@sern/logger`: Logging data → [`Logging`](/v3/api/interfaces/logging) +- `@sern/errors`: Handling errors and lifetime → [`ErrorHandling`](/v3/api/interfaces/errorhandling) +- `@sern/modules`: Managing all command modules → [`ModuleManager`](/v3/api/interfaces/modulemanager) +- `@sern/emitter`: The key to emit events and occurences in a project → [`Emitter`](/v3/api/interfaces/emitter) You may also add disposers so that when the application crashes, the targeted dependency calls that function. diff --git a/src/content/docs/v3/guide/walkthrough/first-command.mdx b/src/content/docs/v3/guide/walkthrough/first-command.mdx index e1847d360..c6961ce43 100644 --- a/src/content/docs/v3/guide/walkthrough/first-command.mdx +++ b/src/content/docs/v3/guide/walkthrough/first-command.mdx @@ -57,13 +57,13 @@ import { Tabs, TabItem } from '@astrojs/starlight/components'; -To view what each of these properties mean in depth, visit the docs for [`CommandType`](../../../api/enumerations/commandtype). +To view what each of these properties mean in depth, visit the docs for [`CommandType`](/v3/api/enumerations/commandtype). ## Command Module Types Every command module `type` is part of an enum. This field allows type inference for the rest of a module's fields. -All the command types can be found in the [`CommandType`](../../../api/enumerations/commandtype) enum! +All the command types can be found in the [`CommandType`](/v3/api/enumerations/commandtype) enum! ## Example Modal Command @@ -114,7 +114,7 @@ Commands are straight forward. Keep in mind, the only required fields for comman ## Context Class -The provided [`Context`](../../../api/classes/context) class helps with modules of `CommandType.Both` (A mixture of slash / legacy commands). +The provided [`Context`](/v3/api/classes/context) class helps with modules of `CommandType.Both` (A mixture of slash / legacy commands). The `Context` class is passed into modules with type: diff --git a/src/content/docs/v3/guide/walkthrough/first-event.mdx b/src/content/docs/v3/guide/walkthrough/first-event.mdx index 705c7f410..a2f6be3e1 100644 --- a/src/content/docs/v3/guide/walkthrough/first-event.mdx +++ b/src/content/docs/v3/guide/walkthrough/first-event.mdx @@ -41,9 +41,9 @@ import { Tabs, TabItem } from '@astrojs/starlight/components'; -Similar to command modules, the `type` property denotes what kind of event it is. You can view [`EventType`](../../../api/enumerations/eventtype) for more information. +Similar to command modules, the `type` property denotes what kind of event it is. You can view [`EventType`](/v3/api/enumerations/eventtype) for more information. -To view what each of these properties mean in depth, visit the docs for [`EventType`](../../../api/enumerations/eventtype). +To view what each of these properties mean in depth, visit the docs for [`EventType`](/v3/api/enumerations/eventtype). ## External Events diff --git a/src/content/docs/v3/guide/walkthrough/sern-emitter.mdx b/src/content/docs/v3/guide/walkthrough/sern-emitter.mdx index 1dc87001e..ad97b3743 100644 --- a/src/content/docs/v3/guide/walkthrough/sern-emitter.mdx +++ b/src/content/docs/v3/guide/walkthrough/sern-emitter.mdx @@ -16,6 +16,6 @@ import { Steps } from '@astrojs/starlight/components'; 5. `warn` events, where it is possible to throw errors -You can put these and other event listeners into [event modules](../first-event)! +You can put these and other event listeners into [event modules](/v3/guide/walkthrough/first-event)! -You can view all events in the [`SernEventsMapping`](../../../api/interfaces/serneventsmapping) interface. \ No newline at end of file +You can view all events in the [`SernEventsMapping`](/v3/api/interfaces/serneventsmapping) interface. \ No newline at end of file diff --git a/src/content/docs/v3/guide/walkthrough/services.mdx b/src/content/docs/v3/guide/walkthrough/services.mdx index a94b0607d..e324563d5 100644 --- a/src/content/docs/v3/guide/walkthrough/services.mdx +++ b/src/content/docs/v3/guide/walkthrough/services.mdx @@ -28,11 +28,11 @@ interface Dependencies extends CoreDependencies { Some keys in `Dependencies` are special and are used by sern internally: -- `@sern/client`: Your Discord client. → [`Emitter`](../../../api/interfaces/emitter) -- `@sern/logger`: Logging data → [`Logging`](../../../api/interfaces/logging) -- `@sern/errors`: Handling errors and lifetime → [`ErrorHandling`](../../../api/interfaces/errorhandling) -- `@sern/modules`: Managing all command modules → [`ModuleManager`](../../../api/interfaces/modulemanager) -- `@sern/emitter`: The key to emit events and occurences in a project → [`Emitter`](../../../api/interfaces/emitter) +- `@sern/client`: Your Discord client. → [`Emitter`](/v3/api/interfaces/emitter) +- `@sern/logger`: Logging data → [`Logging`](/v3/api/interfaces/logging) +- `@sern/errors`: Handling errors and lifetime → [`ErrorHandling`](/v3/api/interfaces/errorhandling) +- `@sern/modules`: Managing all command modules → [`ModuleManager`](/v3/api/interfaces/modulemanager) +- `@sern/emitter`: The key to emit events and occurences in a project → [`Emitter`](/v3/api/interfaces/emitter) ## Usage diff --git a/src/content/docs/v3/guide/walkthrough/transition.mdx b/src/content/docs/v3/guide/walkthrough/transition.mdx index 415f41f0c..262ecc8cc 100644 --- a/src/content/docs/v3/guide/walkthrough/transition.mdx +++ b/src/content/docs/v3/guide/walkthrough/transition.mdx @@ -9,8 +9,8 @@ sidebar: + await makeDependencies({ build: () => {} }) ``` -v3 comes with the new [Service API](../services). To make sure to enable intellisense, -include a `dependencies.d.ts` file into compilation. (Check out the [changelog](../../../blog/3.0.0) for all new features) +v3 comes with the new [Service API](/v3/guide/walkthrough/services). To make sure to enable intellisense, +include a `dependencies.d.ts` file into compilation. (Check out the [changelog](/blog/3.0.0) for all new features) A standard project file tree: