diff --git a/docs/guide/walkthrough/cli.md b/docs/guide/walkthrough-v2/cli.md similarity index 100% rename from docs/guide/walkthrough/cli.md rename to docs/guide/walkthrough-v2/cli.md diff --git a/docs/guide/walkthrough/conclusion.md b/docs/guide/walkthrough-v2/conclusion.md similarity index 100% rename from docs/guide/walkthrough/conclusion.md rename to docs/guide/walkthrough-v2/conclusion.md diff --git a/docs/guide/walkthrough/dependency-injection.md b/docs/guide/walkthrough-v2/dependency-injection.md similarity index 100% rename from docs/guide/walkthrough/dependency-injection.md rename to docs/guide/walkthrough-v2/dependency-injection.md diff --git a/docs/guide/walkthrough/first-command.md b/docs/guide/walkthrough-v2/first-command.md similarity index 100% rename from docs/guide/walkthrough/first-command.md rename to docs/guide/walkthrough-v2/first-command.md diff --git a/docs/guide/walkthrough/first-event.md b/docs/guide/walkthrough-v2/first-event.md similarity index 100% rename from docs/guide/walkthrough/first-event.md rename to docs/guide/walkthrough-v2/first-event.md diff --git a/docs/guide/walkthrough/goal.md b/docs/guide/walkthrough-v2/goal.md similarity index 89% rename from docs/guide/walkthrough/goal.md rename to docs/guide/walkthrough-v2/goal.md index b26959153..93d97bb44 100644 --- a/docs/guide/walkthrough/goal.md +++ b/docs/guide/walkthrough-v2/goal.md @@ -2,6 +2,10 @@ sidebar_position: 1 --- +::warning +This is the v2 guide. Go to the v3 guide! +:: + # Walkthrough This walkthrough will be written in [TypeScript](https://www.typescriptlang.org/) but will have JavaScript snippets throughout. diff --git a/docs/guide/walkthrough/good-to-know.md b/docs/guide/walkthrough-v2/good-to-know.md similarity index 100% rename from docs/guide/walkthrough/good-to-know.md rename to docs/guide/walkthrough-v2/good-to-know.md diff --git a/docs/guide/walkthrough/plugins.md b/docs/guide/walkthrough-v2/plugins.md similarity index 100% rename from docs/guide/walkthrough/plugins.md rename to docs/guide/walkthrough-v2/plugins.md diff --git a/docs/guide/walkthrough/sern-emitter.md b/docs/guide/walkthrough-v2/sern-emitter.md similarity index 100% rename from docs/guide/walkthrough/sern-emitter.md rename to docs/guide/walkthrough-v2/sern-emitter.md diff --git a/docs/guide/walkthrough-v3/transition.md b/docs/guide/walkthrough-v3/transition.md new file mode 100644 index 000000000..daacc439d --- /dev/null +++ b/docs/guide/walkthrough-v3/transition.md @@ -0,0 +1,38 @@ +--- +sidebar_position: 1 +--- + +# Transitioning from v2 to v3 + + +- Sern.makeDependencies -> makeDependencies + - it is asynchronous and top level function now. Make sure to await it before initing for proper synchronization. + + +```diff +- Sern.makeDependencies({ build: () => {} }) ++ await makeDependencies({ build: () => {} }) +``` +Also, v3 comes with the new Service api. To make sure to enable intellisense + +include a dependencies.d.ts file into compilation. +```ts +/** + * This file serves as intellisense for sern projects. + * Types are declared here for dependencies to function properly + * Service(s) api rely on this file to provide a better developer experience. + */ + +import { SernEmitter, Logging, CoreModuleStore, ModuleManager, ErrorHandling, CoreDependencies, Singleton } from '@sern/handler' +import { Client } from 'discord.js' + +declare global { + interface Dependencies extends CoreDependencies { + '@sern/client': Singleton + } +} + + +export {} + +```