generated from nhcarrigan/template
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 0a0c8dc17c | |||
| 1e25328711 | |||
| 6fda359b2d |
@@ -1,2 +1,4 @@
|
|||||||
node_modules
|
node_modules
|
||||||
prod
|
prod
|
||||||
|
|
||||||
|
generated/prisma
|
||||||
|
|||||||
Vendored
+4
-1
@@ -2,5 +2,8 @@
|
|||||||
"editor.codeActionsOnSave": {
|
"editor.codeActionsOnSave": {
|
||||||
"source.fixAll.eslint": "explicit"
|
"source.fixAll.eslint": "explicit"
|
||||||
},
|
},
|
||||||
"eslint.validate": ["typescript"]
|
"eslint.validate": [
|
||||||
|
"typescript"
|
||||||
|
],
|
||||||
|
"prisma.pinToPrisma6": true
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ This page is currently deployed. [View the live website.]
|
|||||||
|
|
||||||
## Feedback and Bugs
|
## Feedback and Bugs
|
||||||
|
|
||||||
If you have feedback or a bug report, please [log a ticket on our forum](https://support.nhcarrigan.com).
|
If you have feedback or a bug report, please feel free to open a GitHub issue!
|
||||||
|
|
||||||
## Contributing
|
## Contributing
|
||||||
|
|
||||||
|
|||||||
+5
-3
@@ -7,7 +7,7 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "rm -rf prod && tsc",
|
"build": "rm -rf prod && tsc",
|
||||||
"lint": "eslint src --max-warnings 0",
|
"lint": "eslint src --max-warnings 0",
|
||||||
"start": "op run --env-file=prod.env --no-masking -- node prod/index.js",
|
"start": "op run --env-file=prod.env --no-masking -- node prod/src/index.js",
|
||||||
"test": "echo \"No tests yet!\" && exit 0"
|
"test": "echo \"No tests yet!\" && exit 0"
|
||||||
},
|
},
|
||||||
"keywords": [],
|
"keywords": [],
|
||||||
@@ -21,11 +21,13 @@
|
|||||||
"@vitest/coverage-istanbul": "3.2.4",
|
"@vitest/coverage-istanbul": "3.2.4",
|
||||||
"eslint": "9.30.0",
|
"eslint": "9.30.0",
|
||||||
"typescript": "5.8.3",
|
"typescript": "5.8.3",
|
||||||
"vitest": "4.0.18"
|
"vitest": "3.2.4"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@nhcarrigan/logger": "1.0.0",
|
"@nhcarrigan/logger": "1.0.0",
|
||||||
|
"@prisma/client": "6.19.1",
|
||||||
"discord.js": "14.21.0",
|
"discord.js": "14.21.0",
|
||||||
"node-schedule": "2.1.1"
|
"node-schedule": "2.1.1",
|
||||||
|
"prisma": "6.19"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Generated
+539
-197
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,24 @@
|
|||||||
|
// This is your Prisma schema file,
|
||||||
|
// learn more about it in the docs: https://pris.ly/d/prisma-schema
|
||||||
|
|
||||||
|
// Looking for ways to speed up your queries, or scale easily with your serverless or edge functions?
|
||||||
|
// Try Prisma Accelerate: https://pris.ly/cli/accelerate-init
|
||||||
|
|
||||||
|
generator client {
|
||||||
|
provider = "prisma-client"
|
||||||
|
output = "../generated/prisma"
|
||||||
|
}
|
||||||
|
|
||||||
|
datasource db {
|
||||||
|
provider = "mongodb"
|
||||||
|
url = env("DATABASE_URL")
|
||||||
|
}
|
||||||
|
|
||||||
|
model ServerData {
|
||||||
|
id String @id @default(auto()) @map("_id") @db.ObjectId
|
||||||
|
serverId String
|
||||||
|
channelId String
|
||||||
|
roleId String
|
||||||
|
message String
|
||||||
|
cron String
|
||||||
|
}
|
||||||
@@ -1,2 +1,3 @@
|
|||||||
DISCORD_TOKEN="op://Environment Variables - Naomi/Standup Bot/discord_token"
|
DISCORD_TOKEN="op://Environment Variables - Naomi/Standup Bot/discord_token"
|
||||||
LOG_TOKEN="op://Environment Variables - Naomi/Alert Server/api_auth"
|
LOG_TOKEN="op://Environment Variables - Naomi/Alert Server/api_auth"
|
||||||
|
DATABASE_URL="op://Environment Variables - Naomi/Standup Bot/database_url"
|
||||||
@@ -6,6 +6,7 @@
|
|||||||
import { Client, Events, GatewayIntentBits } from "discord.js";
|
import { Client, Events, GatewayIntentBits } from "discord.js";
|
||||||
import { scheduleJob } from "node-schedule";
|
import { scheduleJob } from "node-schedule";
|
||||||
import { channels } from "./config/channels.js";
|
import { channels } from "./config/channels.js";
|
||||||
|
import { prisma } from "./lib/prisma.js";
|
||||||
import { standup } from "./modules/standup.js";
|
import { standup } from "./modules/standup.js";
|
||||||
import { logger } from "./utils/logger.js";
|
import { logger } from "./utils/logger.js";
|
||||||
|
|
||||||
@@ -22,6 +23,7 @@ process.on("unhandledRejection", (error) => {
|
|||||||
process.on("uncaughtException", (error) => {
|
process.on("uncaughtException", (error) => {
|
||||||
if (error instanceof Error) {
|
if (error instanceof Error) {
|
||||||
void logger.error("Uncaught Exception", error);
|
void logger.error("Uncaught Exception", error);
|
||||||
|
void prisma.$disconnect();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
void logger.error("uncaught exception", new Error(String(error)));
|
void logger.error("uncaught exception", new Error(String(error)));
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
import { PrismaClient } from "../../generated/prisma/client.js";
|
||||||
|
|
||||||
|
const prisma = new PrismaClient();
|
||||||
|
|
||||||
|
export { prisma };
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
import { defineConfig } from "prisma/config";
|
||||||
|
|
||||||
|
export default defineConfig({
|
||||||
|
datasource: {
|
||||||
|
url: process.env.DATABASE_URL ?? "",
|
||||||
|
},
|
||||||
|
engine: "classic",
|
||||||
|
migrations: {
|
||||||
|
path: "prisma/migrations",
|
||||||
|
},
|
||||||
|
schema: "prisma/schema.prisma",
|
||||||
|
});
|
||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
|
"include": ["**/*.ts"],
|
||||||
"extends": "@nhcarrigan/typescript-config",
|
"extends": "@nhcarrigan/typescript-config",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"rootDir": "./src",
|
|
||||||
"outDir": "./prod"
|
"outDir": "./prod"
|
||||||
},
|
},
|
||||||
"exclude": ["test/**/*.ts", "vitest.config.ts"]
|
"exclude": ["test/**/*.ts", "vitest.config.ts"]
|
||||||
|
|||||||
Reference in New Issue
Block a user