Skip to content

Commit

Permalink
refactor monorepo structure
Browse files Browse the repository at this point in the history
  • Loading branch information
merlinfuchs committed Feb 4, 2024
1 parent 52fd470 commit 0f90d41
Show file tree
Hide file tree
Showing 113 changed files with 1,876 additions and 144 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ opt-level = 's'
[workspace]
resolver = "2"
members = [
"js-sdk/crates/kitejs-compiler",
"kite-sdk-js/crates/kitejs-compiler",
]
exclude = [
# TODO: resolve depdency conflicts so this can be a workspace memebr
"js-sdk/crates/kitejs-engine",
"kite-sdk-js/crates/kitejs-engine",
]
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,10 @@ Create a `plugin.go` file with your Go code for the plugin. It must contain a `m
package main

import (
kite "github.com/merlinfuchs/kite/go-sdk"
"github.com/merlinfuchs/kite/go-sdk/log"
"github.com/merlinfuchs/kite/go-types/discord"
"github.com/merlinfuchs/kite/go-types/event"
kite "github.com/merlinfuchs/kite/kite-sdk-go"
"github.com/merlinfuchs/kite/kite-sdk-go/log"
"github.com/merlinfuchs/kite/kite-types/discord"
"github.com/merlinfuchs/kite/kite-types/event"
)

func main() {
Expand Down Expand Up @@ -142,7 +142,7 @@ kite plugin deploy --guild_id 1234567890

### JavaScript

To write plugins in JS you need to first install the custom compiler by following the instructions in the [js-sdk](js-sdk).
To write plugins in JS you need to first install the custom compiler by following the instructions in the [kite-sdk-js](kite-sdk-js).

#### 1. Create a new plugin

Expand Down
15 changes: 13 additions & 2 deletions examples/automod/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion examples/automod/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"typescript": "^5.3.3"
},
"dependencies": {
"@merlingg/kite-sdk": "file:../../js-sdk",
"@merlingg/kite-sdk": "file:../../kite-sdk-js",
"obscenity": "^0.2.0"
}
}
3 changes: 3 additions & 0 deletions examples/backup/go.mod
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
module github.com/merlinfuchs/kite/examples/backup

go 1.21.5

require github.com/merlinfuchs/kite/kite-sdk-go v0.0.0
require github.com/merlinfuchs/kite/kite-types v0.0.0
14 changes: 7 additions & 7 deletions examples/backup/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import (
"encoding/json"
"math/rand"

kite "github.com/merlinfuchs/kite/go-sdk"
"github.com/merlinfuchs/kite/go-sdk/discord"
"github.com/merlinfuchs/kite/go-sdk/kv"
"github.com/merlinfuchs/kite/go-sdk/log"
"github.com/merlinfuchs/kite/go-types/dismodel"
"github.com/merlinfuchs/kite/go-types/fail"
"github.com/merlinfuchs/kite/go-types/kvmodel"
kite "github.com/merlinfuchs/kite/kite-sdk-go"
"github.com/merlinfuchs/kite/kite-sdk-go/discord"
"github.com/merlinfuchs/kite/kite-sdk-go/kv"
"github.com/merlinfuchs/kite/kite-sdk-go/log"
"github.com/merlinfuchs/kite/kite-types/dismodel"
"github.com/merlinfuchs/kite/kite-types/fail"
"github.com/merlinfuchs/kite/kite-types/kvmodel"
)

type Backup struct {
Expand Down
3 changes: 3 additions & 0 deletions examples/counter/go.mod
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
module github.com/merlinfuchs/kite/examples/counter

go 1.21.5

require github.com/merlinfuchs/kite/kite-sdk-go v0.0.0
require github.com/merlinfuchs/kite/kite-types v0.0.0
10 changes: 5 additions & 5 deletions examples/counter/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ package main
import (
"strconv"

kite "github.com/merlinfuchs/kite/go-sdk"
"github.com/merlinfuchs/kite/go-sdk/discord"
"github.com/merlinfuchs/kite/go-sdk/kv"
"github.com/merlinfuchs/kite/go-types/dismodel"
"github.com/merlinfuchs/kite/go-types/event"
kite "github.com/merlinfuchs/kite/kite-sdk-go"
"github.com/merlinfuchs/kite/kite-sdk-go/discord"
"github.com/merlinfuchs/kite/kite-sdk-go/kv"
"github.com/merlinfuchs/kite/kite-types/dismodel"
"github.com/merlinfuchs/kite/kite-types/event"
)

const resetMessage = "Wrong counter value! The counter has been reset."
Expand Down
6 changes: 2 additions & 4 deletions examples/ping/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ module github.com/merlinfuchs/kite/examples/ping

go 1.21.5

require github.com/merlinfuchs/kite/go-sdk v0.0.0
require github.com/merlinfuchs/kite/kite-sdk-go v0.0.0
require github.com/merlinfuchs/kite/kite-types v0.0.0

require github.com/merlinfuchs/kite/go-types v0.0.0

replace github.com/merlinfuchs/kite/go-sdk => ../../go-sdk
14 changes: 7 additions & 7 deletions examples/ping/plugin.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package main

import (
kite "github.com/merlinfuchs/kite/go-sdk"
"github.com/merlinfuchs/kite/go-sdk/config"
"github.com/merlinfuchs/kite/go-sdk/discord"
"github.com/merlinfuchs/kite/go-sdk/log"
"github.com/merlinfuchs/kite/go-types/dismodel"
"github.com/merlinfuchs/kite/go-types/event"
"github.com/merlinfuchs/kite/go-types/manifest"
kite "github.com/merlinfuchs/kite/kite-sdk-go"
"github.com/merlinfuchs/kite/kite-sdk-go/config"
"github.com/merlinfuchs/kite/kite-sdk-go/discord"
"github.com/merlinfuchs/kite/kite-sdk-go/log"
"github.com/merlinfuchs/kite/kite-types/dismodel"
"github.com/merlinfuchs/kite/kite-types/event"
"github.com/merlinfuchs/kite/kite-types/manifest"
)

func main() {
Expand Down
7 changes: 0 additions & 7 deletions go-sdk/go.mod

This file was deleted.

3 changes: 0 additions & 3 deletions go-types/go.mod

This file was deleted.

12 changes: 8 additions & 4 deletions go.work
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
go 1.21.5

use (
./examples/ping
./examples/counter
./examples/backup
./go-sdk
./go-types
./examples/counter
./examples/ping
./kite-sdk-go
./kite-service
./kite-types
)

replace github.com/merlinfuchs/kite/kite-sdk-go v0.0.0 => ./kite-sdk-go

replace github.com/merlinfuchs/kite/kite-types v0.0.0 => ./kite-types
8 changes: 0 additions & 8 deletions js-sdk/src/index.ts

This file was deleted.

4 changes: 2 additions & 2 deletions go-sdk/config/config.go → kite-sdk-go/config/config.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package config

import (
"github.com/merlinfuchs/kite/go-sdk/internal"
"github.com/merlinfuchs/kite/go-types/manifest"
"github.com/merlinfuchs/kite/kite-sdk-go/internal"
"github.com/merlinfuchs/kite/kite-types/manifest"
)

var cfg map[string]interface{}
Expand Down
6 changes: 3 additions & 3 deletions go-sdk/discord/call.go → kite-sdk-go/discord/call.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package discord

import (
"github.com/merlinfuchs/kite/go-sdk/internal"
"github.com/merlinfuchs/kite/go-types/call"
"github.com/merlinfuchs/kite/go-types/dismodel"
"github.com/merlinfuchs/kite/kite-sdk-go/internal"
"github.com/merlinfuchs/kite/kite-types/call"
"github.com/merlinfuchs/kite/kite-types/dismodel"
)

func BanList(opts ...call.CallOption) (dismodel.BanListResponse, error) {
Expand Down
5 changes: 5 additions & 0 deletions kite-sdk-go/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module github.com/merlinfuchs/kite/kite-sdk-go

go 1.21.5

require github.com/merlinfuchs/kite/kite-types v0.0.0
File renamed without changes.
6 changes: 3 additions & 3 deletions go-sdk/handle.go → kite-sdk-go/handle.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ package kite
import (
"slices"

"github.com/merlinfuchs/kite/go-sdk/internal"
"github.com/merlinfuchs/kite/go-types/dismodel"
"github.com/merlinfuchs/kite/go-types/event"
"github.com/merlinfuchs/kite/kite-sdk-go/internal"
"github.com/merlinfuchs/kite/kite-types/dismodel"
"github.com/merlinfuchs/kite/kite-types/event"
)

func addEventHandler(eventType event.EventType, handler event.EventHandler) {
Expand Down
4 changes: 2 additions & 2 deletions go-sdk/internal/call.go → kite-sdk-go/internal/call.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"fmt"
"unsafe"

"github.com/merlinfuchs/kite/go-sdk/internal/util"
"github.com/merlinfuchs/kite/go-types/call"
"github.com/merlinfuchs/kite/kite-sdk-go/internal/util"
"github.com/merlinfuchs/kite/kite-types/call"
)

func MakeCall(c call.Call) (*call.CallResponse, error) {
Expand Down
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions go-sdk/internal/sys.go → kite-sdk-go/internal/sys.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"fmt"
"unsafe"

"github.com/merlinfuchs/kite/go-types/event"
"github.com/merlinfuchs/kite/go-types/manifest"
"github.com/merlinfuchs/kite/kite-types/event"
"github.com/merlinfuchs/kite/kite-types/manifest"
)

//export kite_set_manifest
Expand Down
File renamed without changes.
8 changes: 4 additions & 4 deletions go-sdk/kv/kv.go → kite-sdk-go/kv/kv.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ package kv
import (
"encoding/json"

"github.com/merlinfuchs/kite/go-sdk/internal"
"github.com/merlinfuchs/kite/go-sdk/internal/util"
"github.com/merlinfuchs/kite/go-types/call"
"github.com/merlinfuchs/kite/go-types/kvmodel"
"github.com/merlinfuchs/kite/kite-sdk-go/internal"
"github.com/merlinfuchs/kite/kite-sdk-go/internal/util"
"github.com/merlinfuchs/kite/kite-types/call"
"github.com/merlinfuchs/kite/kite-types/kvmodel"
)

type KVNamespace struct {
Expand Down
4 changes: 2 additions & 2 deletions go-sdk/log/log.go → kite-sdk-go/log/log.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package log

import (
"github.com/merlinfuchs/kite/go-sdk/internal"
"github.com/merlinfuchs/kite/go-types/logmodel"
"github.com/merlinfuchs/kite/kite-sdk-go/internal"
"github.com/merlinfuchs/kite/kite-types/logmodel"
)

func Log(level logmodel.LogLevel, msg string) {
Expand Down
4 changes: 2 additions & 2 deletions go-sdk/sdk.go → kite-sdk-go/sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package kite
import (
"time"

"github.com/merlinfuchs/kite/go-sdk/internal"
"github.com/merlinfuchs/kite/go-types/call"
"github.com/merlinfuchs/kite/kite-sdk-go/internal"
"github.com/merlinfuchs/kite/kite-types/call"
)

func Sleep(duration time.Duration) error {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 0f90d41

Please sign in to comment.