Skip to content

Commit

Permalink
feat: upset everybody
Browse files Browse the repository at this point in the history
  • Loading branch information
ItsMeBrianD committed Sep 27, 2023
1 parent 8652c47 commit d0c1bc9
Show file tree
Hide file tree
Showing 32 changed files with 1,299 additions and 2,060 deletions.
13 changes: 7 additions & 6 deletions clients/discord-bot/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,23 @@
},
"homepage": "https://github.com/SprocketBot/service-template#readme",
"dependencies": {
"@nestjs/common": "^8.2.3",
"@nestjs/core": "^9.0.5",
"@nestjs/microservices": "^8.2.5",
"@sprocketbot/common": "0.2.18",
"@nestjs/common": "^10.2.6",
"@nestjs/core": "^10.2.6",
"@nestjs/microservices": "^10.2.6",
"@sprocketbot/common": "workspace:^",
"bufferutil": "^4.0.5",
"config": "^3.3.7",
"discord-api-types": "^0.25.2",
"discord.js": "13.1.0",
"jest": "^29.0.3",
"jest-junit": "^12.2.0",
"node-fetch": "^3.3.2",
"reflect-metadata": "^0.1.13",
"ts-jest": "29.0.1",
"zod": "^3.2.0"
"zod": "^3.22.2"
},
"devDependencies": {
"@nestjs/testing": "^8.2.3",
"@nestjs/testing": "^10.2.6",
"@types/config": "^0.0.41",
"@types/jest": "^29.0.3",
"@types/node": "^17.0.13",
Expand Down
16 changes: 10 additions & 6 deletions clients/discord-bot/src/marshal/marshal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,13 @@ export abstract class Marshal {
const {data} = parseResult;

data.forEach(meta => {
const target = Reflect.get(this, meta.functionName)
if (typeof target !== 'function') throw new Error(`${target} is not a function`)
// Do things
cms.registerCommand({
...meta,
// We kinda need to act on faith here, if the implementer has decorated an unsafe function, we can't tell until runtime.
// eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-assignment
function: Reflect.get(this, meta.functionName).bind(this) as CommandFunction,
function: target.bind(this) as CommandFunction,
});
this._logger.debug(`Registered Command ${meta.spec.name}`);
});
Expand All @@ -65,11 +66,12 @@ export abstract class Marshal {

data.forEach(meta => {
// Do things
const target = Reflect.get(this, meta.functionName)
if (typeof target !== 'function') throw new Error(`${target} is not a function`)
cms.registerNotFoundCommand({
...meta,
// We kinda need to act on faith here, if the implementer has decorated an unsafe function, we can't tell until runtime.
// eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-assignment
function: Reflect.get(this, meta.functionName).bind(this),
function: target.bind(this),
});
});
}
Expand All @@ -85,9 +87,11 @@ export abstract class Marshal {
const {data} = parseResult;

data.forEach(meta => {
const target = Reflect.get(this, meta.functionName)
if (typeof target !== 'function') throw new Error(`${target} is not a function`)

// We kinda need to act on faith here, if the implementer has decorated an unsafe function, we can't tell until runtime.
// eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-assignment
const f = Reflect.get(this, meta.functionName).bind(this) as EventFunction;
const f = target.bind(this) as EventFunction;
// Do things
this.botClient.on(meta.spec.event, async (...args: ClientEvents[keyof ClientEvents]): Promise<void> => {
await f(args).catch(e => {
Expand Down
21 changes: 10 additions & 11 deletions clients/image-generation-frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,29 +16,28 @@
"devDependencies": {
"@sveltejs/kit": "^1.15.2",
"@types/amqplib": "^0.8.2",
"autoprefixer": "^10.3.3",
"postcss": "^8.3.6",
"postcss-load-config": "^3.1.0",
"autoprefixer": "^10.4.7",
"postcss": "^8.4.14",
"postcss-load-config": "^4.0.1",
"postcss-nesting": "^8.0.1",
"prettier-plugin-svelte": "^2.7.1",
"prettier-plugin-svelte": "^2.9.0",
"svelte": "^3.44.3",
"svelte-check": "^2.2.10",
"svelte-preprocess": "^4.10.0",
"tailwindcss": "^2.2.8",
"svelte-check": "^2.7.1",
"svelte-preprocess": "^4.10.7",
"tailwindcss": "^3.1.5",
"tslib": "^2.3.1",
"typescript": "^4.4.2"
"typescript": "^4.7.4"
},
"dependencies": {
"@sveltejs/adapter-node": "^1.0.0-next.43",
"@types/knex": "^0.16.1",
"@types/minio": "^7.0.10",
"amqplib": "^0.8.0",
"knex": "^2.4.0",
"minio": "^7.0.19",
"minio": "^7.1.3",
"nats": "^2.2.0",
"pg": "^8.7.1",
"svelte-icons": "^2.1.0",
"uuid": "^8.3.2"
},
"type": "module"
}
}
123 changes: 62 additions & 61 deletions clients/web/package.json
Original file line number Diff line number Diff line change
@@ -1,63 +1,64 @@
{
"name": "web",
"version": "0.0.1",
"private": true,
"scripts": {
"dev": "vite dev",
"build": "vite build",
"preview": "vite preview",
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
"lint": "eslint src --fix",
"format": "prettier src --write",
"story:dev": "histoire dev",
"story:build": "histoire build",
"story:preview": "histoire preview"
},
"devDependencies": {
"@histoire/plugin-svelte": "^0.15.4",
"@steeze-ui/heroicons": "^2.1.0",
"@steeze-ui/simple-icons": "^1.4.0",
"@steeze-ui/svelte-icon": "^1.3.2",
"@sveltejs/adapter-auto": "^1.0.1",
"@sveltejs/kit": "^1.15.2",
"@types/lodash.startcase": "^4.4.7",
"@types/lodash.times": "^4.3.7",
"@typescript-eslint/eslint-plugin": "^5.27.0",
"@typescript-eslint/parser": "^5.27.0",
"autoprefixer": "^10.4.7",
"date-fns": "^2.29.3",
"date-picker-svelte": "^2.2.5",
"eslint": "^8.16.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-svelte3": "^4.0.0",
"filedrop-svelte": "^0.1.2",
"histoire": "^0.15.4",
"houdini": "^1.0.9",
"houdini-svelte": "^1.0.9",
"lodash.times": "^4.3.2",
"nanoid": "^4.0.0",
"postcss": "^8.4.14",
"postcss-load-config": "^4.0.1",
"prettier-plugin-svelte": "^2.9.0",
"svelte": "^3.44.0",
"svelte-check": "^2.7.1",
"svelte-preprocess": "^4.10.7",
"tailwindcss": "^3.1.5",
"tslib": "^2.3.1",
"typescript": "^4.7.4",
"vite": "^4.1.5"
},
"type": "module",
"dependencies": {
"@faker-js/faker": "^7.6.0",
"@fontsource/montserrat": "^4.5.14",
"@sveltejs/adapter-node": "^1.0.0-next.106",
"@tanstack/svelte-table": "^8.9.3",
"echarts": "^5.4.1",
"jwt-decode": "^3.1.2",
"lodash.startcase": "^4.4.0",
"subscriptions-transport-ws": "^0.11.0",
"typescript-cookie": "^1.0.4"
}
"name": "web",
"version": "0.0.1",
"private": true,
"scripts": {
"dev": "vite dev",
"build": "vite build",
"preview": "vite preview",
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
"lint": "eslint src --fix",
"format": "prettier src --write",
"story:dev": "histoire dev",
"story:build": "histoire build",
"story:preview": "histoire preview"
},
"devDependencies": {
"@histoire/plugin-svelte": "^0.15.4",
"@steeze-ui/heroicons": "^2.1.0",
"@steeze-ui/simple-icons": "^1.4.0",
"@steeze-ui/svelte-icon": "^1.3.2",
"@sveltejs/adapter-auto": "^1.0.1",
"@sveltejs/kit": "^1.15.2",
"@types/lodash.startcase": "^4.4.7",
"@types/lodash.times": "^4.3.7",
"@typescript-eslint/eslint-plugin": "^5.39.0",
"@typescript-eslint/parser": "^5.39.0",
"autoprefixer": "^10.4.7",
"date-fns": "^2.30.0",
"date-picker-svelte": "^2.2.5",
"eslint": "^8.25.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-svelte3": "^4.0.0",
"filedrop-svelte": "^0.1.2",
"histoire": "^0.15.4",
"houdini": "^1.0.9",
"houdini-svelte": "^1.0.9",
"lodash.times": "^4.3.2",
"nanoid": "^3.3.6",
"postcss": "^8.4.14",
"postcss-load-config": "^4.0.1",
"prettier-plugin-svelte": "^2.9.0",
"svelte": "^3.44.3",
"svelte-check": "^2.7.1",
"svelte-preprocess": "^4.10.7",
"tailwindcss": "^3.1.5",
"tslib": "^2.3.1",
"typescript": "^4.7.4",
"vite": "^4.1.5"
},
"type": "module",
"dependencies": {
"@faker-js/faker": "^7.6.0",
"@fontsource/montserrat": "^4.5.14",
"@sveltejs/adapter-node": "^1.0.0-next.43",
"@tanstack/svelte-table": "^8.9.3",
"echarts": "^5.4.1",
"jwt-decode": "^3.1.2",
"lodash.startcase": "^4.4.0",
"subscriptions-transport-ws": "^0.11.0",
"typescript-cookie": "^1.0.4",
"zod": "^3.22.2"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@

{#each $openScrims ?? [] as scrim}
{scrim.id} | {scrim.status}

<pre>{JSON.stringify(scrim, null, 2)}</pre>
{:else}
There are no scrims available; why don't you create one?
<Button variant="primary" on:click={() => (openScrimModal = true)}>Create a Scrim</Button>
Expand Down
11 changes: 11 additions & 0 deletions clients/web/src/routes/+page.server.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import {redirect, type ServerLoad} from "@sveltejs/kit";
import {getAuthCookies} from "../lib/api";

export const load: ServerLoad = async event => {
const auth = getAuthCookies(event);
if (auth) {
throw redirect(302, "/app");
} else {
throw redirect(302, "/auth/login");
}
};
13 changes: 7 additions & 6 deletions common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
"homepage": "https://github.com/SprocketBot/sprocket-common#readme",
"devDependencies": {
"@types/config": "^0.0.41",
"@types/minio": "^7.0.12",
"@types/uuid": "^8.3.4",
"rimraf": "^3.0.2",
"typescript": "^4.7.4"
Expand All @@ -36,10 +35,12 @@
"access": "public"
},
"dependencies": {
"@nestjs/common": "^8.2.3",
"@nestjs/microservices": "^8.2.5",
"@nestjs/common": "^10.2.6",
"@nestjs/microservices": "^10.2.6",
"@nestjs/testing": "^10.2.6",
"@sprocketbot/gql-client": "^0.0.3",
"@types/amqplib": "^0.8.2",
"@types/express": "^4.17.18",
"@types/ioredis": "^4.28.7",
"@types/jest": "^29.0.3",
"@types/node": "^17.0.13",
Expand All @@ -48,11 +49,11 @@
"celery-node": "^0.5.8",
"config": "^3.3.7",
"ioredis": "^4.28.3",
"minio": "^7.0.26",
"nanoid": "^4.0.0",
"minio": "^7.1.3",
"nanoid": "^3.3.6",
"redis": "^4.0.4",
"rxjs": "^7.4.0",
"uuid": "^8.3.2",
"zod": "^3.2.0"
"zod": "^3.22.2"
}
}
42 changes: 25 additions & 17 deletions core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,34 +31,38 @@
},
"homepage": "https://github.com/SprocketBot/service-template#readme",
"dependencies": {
"@nestjs/bull": "^0.5.5",
"@nestjs/common": "^8.2.3",
"@nestjs/core": "^9.0.5",
"@nestjs/graphql": "^8.0.2",
"@nestjs/jwt": "^8.0.0",
"@nestjs/mapped-types": "^1.0.0",
"@nestjs/microservices": "^8.2.5",
"@nestjs/passport": "^8.2.1",
"@nestjs/platform-express": "^8.2.3",
"@nestjs/typeorm": "^8.0.3",
"@sprocketbot/common": "0.2.18",
"@nestjs/apollo": "^12.0.9",
"@nestjs/bull": "^10.0.1",
"@nestjs/common": "^10.2.6",
"@nestjs/core": "^10.2.6",
"@nestjs/graphql": "^12.0.9",
"@nestjs/jwt": "^10.1.1",
"@nestjs/mapped-types": "^2.0.2",
"@nestjs/microservices": "^10.2.6",
"@nestjs/passport": "^10.0.2",
"@nestjs/platform-express": "^10.2.6",
"@nestjs/typeorm": "^10.0.0",
"@sprocketbot/common": "workspace:^",
"@types/crypto-js": "^4.1.1",
"@types/date-fns": "^2.6.0",
"@types/express": "^4.17.18",
"@types/express-serve-static-core": "^4.17.37",
"@types/glob": "^7.2.0",
"@types/lodash": "^4.14.178",
"@types/node": "^17.0.13",
"apollo-server-cache-redis": "^3.3.1",
"apollo-server-express": "^2.25.3",
"apollo-server-express": "^3.12.1",
"axios": "^1.2.2",
"bull": "^4.8.2",
"class-transformer": "^0.4.0",
"class-validator": "^0.14.0",
"config": "^3.3.7",
"crypto-js": "^4.1.1",
"date-fns": "^2.29.3",
"date-fns": "^2.30.0",
"glob": "^7.2.0",
"graphql": "^15.8.0",
"graphql": "^16.8.1",
"graphql-js-tree": "^0.0.3",
"graphql-subscriptions": "^2.0.0",
"graphql-type-json": "^0.3.2",
"graphql-upload": "^13.0.0",
"graphql-ws": "^5.5.5",
Expand All @@ -67,6 +71,7 @@
"jest-junit": "^12.2.0",
"jest-mock": "^29.2.2",
"lodash": "^4.17.21",
"lodash.now": "^4.0.2",
"nestjs-spelunker": "^1.1.1",
"passport": "^0.6.0",
"passport-discord": "^0.1.4",
Expand All @@ -76,15 +81,18 @@
"passport-oauth2": "^1.6.1",
"passport-steam": "^1.0.17",
"pg": "^8.7.1",
"qs": "^6.11.2",
"reflect-metadata": "^0.1.13",
"rxjs": "^7.4.0",
"shorthash2": "^1.0.3",
"source-map-support": "^0.5.20",
"ts-jest": "29.0.1",
"typeorm": "^0.3.7",
"uuid": "^8.3.2"
"typeorm": "^0.3.17",
"uuid": "^8.3.2",
"zod": "^3.22.2"
},
"devDependencies": {
"@nestjs/testing": "^8.2.3",
"@nestjs/testing": "^10.2.6",
"@types/bull": "^3.15.8",
"@types/config": "^0.0.41",
"@types/faker": "^5.5.8",
Expand Down
2 changes: 2 additions & 0 deletions core/src/app.module.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import {ApolloDriver} from "@nestjs/apollo";
import {BullModule} from "@nestjs/bull";
import type {MiddlewareConsumer, NestModule} from "@nestjs/common";
import {Module} from "@nestjs/common";
Expand Down Expand Up @@ -34,6 +35,7 @@ import {WebhookModule} from "./webhook/webhook.module";
logging: config.db.enable_logs,
}),
GraphQLModule.forRoot({
driver: ApolloDriver,
autoSchemaFile: true,
installSubscriptionHandlers: true,
cache: new RedisCache({
Expand Down
Loading

0 comments on commit d0c1bc9

Please sign in to comment.