Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ mongodata
fly.toml
.git
node_modules/
prisma/client/
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
prisma/client/

node_modules
dist
data/
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ RUN apt-get update && \
rm -rf /var/lib/apt/lists/*
COPY . .
RUN deno install -r --allow-scripts=npm:@prisma/client,npm:prisma,npm:@prisma/engines
RUN deno run -A --unstable npm:prisma generate --no-engine
RUN deno task prisma:generate
ENV TZ="America/Chicago"
ENTRYPOINT ["sh", "entrypoint.sh"]
32 changes: 24 additions & 8 deletions deno.jsonc
Original file line number Diff line number Diff line change
@@ -1,29 +1,45 @@
{
"$schema": "https://raw.githubusercontent.com/denoland/deno/refs/heads/main/cli/schemas/config-file.v1.json",
"tasks": {
"dev": "deno --watch --no-clear-screen -A --unstable-cron --allow-scripts=npm:prisma,npm:@prisma/client,npm:@prisma/engines ./src/app.ts",
"build": "deno compile --unstable-cron -o ./dist/tvbot ./src/app.ts",
"prisma": "deno run -A npm:prisma",
"prisma:generate": "deno task prisma generate --schema=./prisma/schema.prisma",
"db:migrate": "deno run -A npm:prisma migrate dev",
"db:studio": "deno run -A npm:prisma studio"
},
"compilerOptions": {
"strict": true,
"noImplicitAny": true,
"strictNullChecks": true,
"strictNullChecks": true
},
"nodeModules": true,
"nodeModulesDir": "auto",
"importMap": "import_map.json",
"lint": {
"include": ["src/"],
"exclude": ["src/testdata/", "src/fixtures/**/*.ts"],
"include": [
"src/"
],
"exclude": [
"src/testdata/",
"src/fixtures/**/*.ts"
],
"rules": {
"tags": ["recommended"],
"include": ["ban-untagged-todo"],
"exclude": ["no-unused-vars"]
},
"tags": [
"recommended"
],
"include": [
"ban-untagged-todo"
],
"exclude": [
"no-unused-vars"
]
}
},
"fmt": {
"semiColons": false
},
"exclude": ["dist/"]
"exclude": [
"dist/"
]
}
166 changes: 143 additions & 23 deletions deno.lock

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

2 changes: 1 addition & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -e
# migrate the database
deno run -A --allow-scripts=npm:prisma,npm:@prisma/engines npm:prisma@latest db push
deno run -A --allow-scripts=npm:prisma,npm:@prisma/engines npm:prisma db push --skip-generate
set +e

deno -A --unstable-cron ./src/app.ts
6 changes: 4 additions & 2 deletions import_map.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@
"imports": {
"app.ts": "./src/app.ts",
"lib/": "./src/lib/",
"prisma-client/": "./prisma/client/",
"interfaces/": "./src/interfaces/",
"commands/": "./src/commands/",
"npm:discord.js": "npm:discord.js@^14.18.0",
"npm:@prisma/client": "npm:@prisma/client@5.0.0",
"npm:prisma": "npm:prisma@^5.0.0",
"@prisma/client/runtime/library": "npm:@prisma/client/runtime/library",
"npm:@prisma/client": "npm:@prisma/client@6.6.0",
"npm:prisma": "npm:prisma@^6.6.0",
"npm:axios": "npm:axios@^1.4.0",
"npm:city-timezones": "npm:city-timezones@^1.2.1",
"npm:moment-timezone": "npm:moment-timezone@^0.5.43",
Expand Down
5 changes: 4 additions & 1 deletion prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
// learn more about it in the docs: https://pris.ly/d/prisma-schema

generator client {
provider = "prisma-client-js"
provider = "prisma-client"
output = "client"
runtime = "deno"
moduleFormat = "esm"
}

datasource db {
Expand Down
2 changes: 1 addition & 1 deletion src/commands/list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
import client from "lib/prisma.ts"
import { type CommandV2 } from "interfaces/command.ts"
import { type App } from "app.ts"
import { type Show } from "npm:@prisma/client"
import { type Show } from "prisma-client/client.ts"

const subCommands = {
ALL: "all",
Expand Down
2 changes: 1 addition & 1 deletion src/commands/post.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { ProgressError } from "interfaces/error.ts"
import { isForumChannel } from "interfaces/discord.ts"
import { buildShowEmbed } from "lib/messages.ts"
import { type SeriesExtendedRecord } from "interfaces/tvdb.generated.ts"
import { type Destination, type Show } from "npm:@prisma/client"
import { type Destination, type Show } from "prisma-client/client.ts"
import { parseIMDBIds } from "lib/util.ts"

interface SeriesWrapper {
Expand Down
2 changes: 1 addition & 1 deletion src/commands/setting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { type CommandV2 } from "interfaces/command.ts"
import { ProgressMessageBuilder } from "lib/progressMessages.ts"
import { type App } from "app.ts"
import { type SettingsManager } from "lib/settingsManager.ts"
import { type Destination } from "npm:@prisma/client"
import { type Destination } from "prisma-client/client.ts"

export const command: CommandV2 = {
slashCommand: {
Expand Down
2 changes: 1 addition & 1 deletion src/commands/upcoming.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { type CommandV2 } from "interfaces/command.ts"
import { type App } from "app.ts"
import { getSeriesByImdbId } from "lib/tvdb.ts"
import { showSearchAutocomplete } from "lib/autocomplete.ts"
import { type Show } from "npm:@prisma/client"
import { type Show } from "prisma-client/client.ts"
import { ProgressError } from "interfaces/error.ts"
import { getUpcomingEpisodesEmbed } from "lib/upcoming.ts"

Expand Down
2 changes: 1 addition & 1 deletion src/lib/autocomplete.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type Prisma } from "npm:@prisma/client"
import { type Prisma } from "prisma-client/client.ts"
import {
type ApplicationCommandOptionChoiceData,
type AutocompleteInteraction,
Expand Down
2 changes: 1 addition & 1 deletion src/lib/episodeNotifier.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type Show } from "npm:@prisma/client"
import { type Show } from "prisma-client/client.ts"
import {
type AnyThreadChannel,
type Channel,
Expand Down
Loading