separating walkthroughs

This commit is contained in:
Jacob Nguyen
2023-06-26 23:03:54 -05:00
parent a4d12af7f2
commit ebe5c84ba3
10 changed files with 42 additions and 0 deletions

View File

@@ -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.

View File

@@ -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<Client>
}
}
export {}
```