Skip to content

Commit

Permalink
Merge pull request #36 from sern-handler/feat/version3
Browse files Browse the repository at this point in the history
feat: version 3
  • Loading branch information
jacoobes authored Jul 29, 2023
2 parents b8377ec + e10e6cb commit ef6420a
Show file tree
Hide file tree
Showing 93 changed files with 6,269 additions and 5,210 deletions.
2 changes: 1 addition & 1 deletion 404.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html style="height:100%">
<head>
<meta name="viewport" charset="utf-8" content="width=device-width, initial-scale=1, shrink-to-fit=no" >
<link rel="icon" href="./assets/images/icon.png">
<link rel="icon" href="./assets/images/favicon.ico">
<meta name="theme-color" content="#fff">
<meta name="twitter:card" content="summary">

Expand Down
102 changes: 102 additions & 0 deletions blog/2023-06-18-mdx-blog-post.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
---
slug: 3.0.0
title: Release 3.0.0
authors: [jacoobes]
tags: [release]
---

## 3.0 Release

### Join our [discord](https://sern.dev/discord) <br />

### Features

#### Dependency Management
- `Service` API (recommended to use this over useContainer hooks)
- Dependencies type must be globally augmented in order for Services api to function properly
- new methods on ModuleManager
- getPublishableCommands()
- Init Hooks
- implement starting behavior for dependencies
- To enforce and type check this, use the `Initializable` type when making your Dependencies type!
- Emitter interface
- More generic interface to define any event emitter
- You can now swap out the SernEmitter with whatever emitter now.
```ts
class DatabaseService implements Init {
//some hypothetical database
_pgsql : database()

async init() {
await _pgsql.load()
}

}

await makeDependencies({
build: root => root.add({
db: new DatabaseService() //will be init'ed automatically
})
})

```
- new SernEmitter event `modulesLoaded` , which allows users to customize behavior after all modules are loaded!
```ts

export default eventModule({
name: 'modulesLoaded',
type: EventType.Sern,
execute: () => {
console.log('All modules loaded')
}
})


```

#### Quality of Life
- faster module loading
- I utilize async generators for reading files now. A lot faster than the first iteration.
- better error handling
- Less boilerplate
- Services api cleans up v2 boilerplate
- class modules devex got upgraded and work better than before
- automatically ignore any files not ending in (mts, cts, mjs, cjs, ts, js)
- ignore commands and events with `!` prefix on filename or directory (ie: `!filename.ts` or `!directory` will be ignored by sern)

- `Service` API (recommended to use this over useContainer hooks)
- Dependencies type must be globally augmented in order for Services api to function properly
- Less boilerplate
- new methods on ModuleManager
- automatically ignore any files not ending in (mts, cts, mjs, cjs, ts, js)
- ignore commands / events with `!` prefix on filename or directory (ie: `!filename.ts` or `!directory`)
- new SernEmitter event `modulesLoaded` , which allows users to customize behavior after all modules are loaded!
- Init Hooks
- implement starting behavior for dependencies

### Experimental
- Experimental things may be subject to removal, need feedback and are not guaranteed stable
- dev / prod mode
- sern will behave differently depending on mode set
- init sern from `file` option
- reads from local sern.config.json

```js
Sern.init('file');
```
### Breaking changes
- Sern.makeDependencies -> makeDependencies
- it is asynchronous and top level function now. Make sure to await it before initing for proper synchronization.
- module store and manager internally changed, so those using them may recieve breaking changes
- BaseOptions type removed

```diff
- Sern.makeDependencies({ build: () => {} })
+ await makeDependencies({ build: () => {} })
```

### Deprecations
- Removed all previous marked deprecations in v3
- ModuleStore will be removed as a dependency in v4. The only way to access modules should be through ModuleManager
- Default Dependencies will be made internal in the v4. Users should only have access to its interface / contract

34 changes: 34 additions & 0 deletions blog/2023-7-4-mdx-blog-post.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
slug: newlogo
title: New logo!
authors: [sern]
tags: [branding]
---

Hey everyone! Today we have very special news for you all: We're changing our logo!

# Why?

You see, on today's standards, having a simple logo is essential. Our logo aligns perfectly with these design principles but it can always be improved.
We were chilling, you know, cooking sern handler v3, sern gui, `npm create @sern/bot` and serncord when we thought about changing the logo to a sleek design with less colors.
And here we are!

# Who did our new branding?

[Ropox](https://github.com/Murtatrxx)!
Bro's the GOAT. This website is maintained by him, the domain costs are funded by him and also he started brainstorming how the logo would be on paper:
![](/blog/newlogo/paperprototypes.jpg)
And there it all clicked:
![](/blog/newlogo/paperlogo.png)
seren tried by the way!
![](/blog/newlogo/serentried.png)

# Anyways, here it is:

![](/img/logo.png)

Pretty nice!

By the way, we have animations and variations on the way, so make sure to stay updated in the [discord server](https://sern.dev/discord)!

# Finally, from the entire sern team, thank you for sticking around ❤️
4 changes: 4 additions & 0 deletions blog/authors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ Sr Izan:
title: Developer
url: https://github.com/SrIzan10
image_url: https://github.com/SrIzan10.png
sern:
name: sern Team
url: https://github.com/sern-handler
image_url: https://github.com/sernbot.png
Murtatrxx:
name: Murtatrxx
title: Developer
Expand Down
52 changes: 38 additions & 14 deletions docs/api/classes/CommandExecutable.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Will be refactored / changed in future

| Name | Type |
| :------ | :------ |
| `Type` | extends [`CommandType`](../enums/CommandType.md) |
| `Type` | extends [`CommandType`](../enums/CommandType.md) = [`CommandType`](../enums/CommandType.md) |

## Constructors

Expand All @@ -26,44 +26,68 @@ Will be refactored / changed in future

| Name | Type |
| :------ | :------ |
| `Type` | extends [`CommandType`](../enums/CommandType.md) |
| `Type` | extends [`CommandType`](../enums/CommandType.md) = [`CommandType`](../enums/CommandType.md) |

## Properties

### execute
### plugins

`Abstract` **execute**: [`CommandModuleDefs`](../modules.md#commandmoduledefs)[`Type`][``"execute"``]
**plugins**: [`AnyCommandPlugin`](../modules.md#anycommandplugin)[] = `[]`

#### Defined in

[src/handler/sern.ts:127](https://github.com/sern-handler/handler/blob/c1f6906/src/handler/sern.ts#L127)
[src/core/modules.ts:79](https://github.com/sern-handler/handler/blob/81cdde2/src/core/modules.ts#L79)

___

### onEvent
### type

**onEvent**: [`ControlPlugin`](../interfaces/ControlPlugin.md)<`any`[]\>[] = `[]`
`Abstract` **type**: `Type`

#### Defined in

[src/handler/sern.ts:126](https://github.com/sern-handler/handler/blob/c1f6906/src/handler/sern.ts#L126)
[src/core/modules.ts:78](https://github.com/sern-handler/handler/blob/81cdde2/src/core/modules.ts#L78)

___

### plugins
### \_instance

`Static` `Private` **\_instance**: [`CommandModule`](../modules.md#commandmodule)

#### Defined in

[src/core/modules.ts:80](https://github.com/sern-handler/handler/blob/81cdde2/src/core/modules.ts#L80)

## Methods

### execute

`Abstract` **execute**(`...args`): `unknown`

#### Parameters

| Name | Type |
| :------ | :------ |
| `...args` | `CommandArgs`<`Type`, [`Control`](../enums/PluginType.md#control)\> |

**plugins**: [`InitPlugin`](../interfaces/InitPlugin.md)<`any`[]\>[] = `[]`
#### Returns

`unknown`

#### Defined in

[src/handler/sern.ts:125](https://github.com/sern-handler/handler/blob/c1f6906/src/handler/sern.ts#L125)
[src/core/modules.ts:91](https://github.com/sern-handler/handler/blob/81cdde2/src/core/modules.ts#L91)

___

### type
### getInstance

`Abstract` **type**: `Type`
`Static` **getInstance**(): [`CommandModule`](../modules.md#commandmodule)

#### Returns

[`CommandModule`](../modules.md#commandmodule)

#### Defined in

[src/handler/sern.ts:124](https://github.com/sern-handler/handler/blob/c1f6906/src/handler/sern.ts#L124)
[src/core/modules.ts:82](https://github.com/sern-handler/handler/blob/81cdde2/src/core/modules.ts#L82)
Loading

0 comments on commit ef6420a

Please sign in to comment.