change walkthrough name and update walkthrough

This commit is contained in:
Jacob Nguyen
2023-06-28 10:34:30 -05:00
parent ebe5c84ba3
commit 05e470b99b
11 changed files with 28 additions and 10 deletions

View File

@@ -1,7 +1,9 @@
---
sidebar_position: 7
---
:::warning
This is version 2 code. Please view [transitioning to v3](../transition)
:::
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.
Minimal setup for any project.

View File

@@ -2,9 +2,9 @@
sidebar_position: 1
---
::warning
This is the v2 guide. Go to the v3 guide!
::
:::warning
Please read the transition page if you are moving from version 2 to version 3.
:::
# Walkthrough

View File

@@ -11,4 +11,4 @@ You're shipped with the SernEmitter. This EventEmitter listens to
- `warn` events, where it is possible to throw errors
You can put these and other event listeners into [event modules](./first-event.md)!
<br/>View all <a href="https://sern.dev/docs/api/modules#serneventsmapping">events</a>
<br/>View all <a href="https://sern.dev/docs/api/modules#serneventsmapping">events</a>

View File

@@ -2,9 +2,11 @@
sidebar_position: 1
---
# Transitioning from v2 to v3
# transition from v2 to v3
:::warning
The "Node" moduleResolution is the only one that has been tested to work with sern.
:::
- Sern.makeDependencies -> makeDependencies
- it is asynchronous and top level function now. Make sure to await it before initing for proper synchronization.
@@ -14,8 +16,7 @@ sidebar_position: 1
+ 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.
include a dependencies.d.ts file into compilation. [Click here for all new features](../../../blog/3.0.0)
```ts
/**
* This file serves as intellisense for sern projects.
@@ -32,7 +33,22 @@ declare global {
}
}
export {}
```
A standard project file tree: <br />
![file tree](../../../static/img/fs.png)
:::tip
Usually, you would use the create-bot tool.
For brand new bots, run
```sh
npm create @sern/bot
```
and follow the interactive prompts.
:::tip

BIN
static/img/fs.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 104 KiB