Skip to content

Commit

Permalink
feat: Update dependencies (#242)
Browse files Browse the repository at this point in the history
* chore: update packages

* feat: fix type errors

* feat: update to node 22

* feat: backout of prisma serverless adapters as this just adds up complexity

* build: update target to node22

* feat: upgrade to Prisma V6

* feat: replace vite-node with tsx

Vite-Node is already used underneath of vitest to transform
tsx files to run testing. Using this will just cleanup dependencies from
tsx.
  • Loading branch information
samhwang authored Dec 11, 2024
1 parent 02d53eb commit 34bb588
Show file tree
Hide file tree
Showing 13 changed files with 1,056 additions and 1,263 deletions.
2 changes: 1 addition & 1 deletion .github/actions/setup-node-deps/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ runs:
- name: Install pnpm
uses: pnpm/action-setup@v4

- name: Set up Node 20
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v20
v22
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
################
# Build assets #
################
FROM node:20.12 AS build
FROM node:22.12 AS build
WORKDIR /app

# Install global node modules: pnpm
RUN npm install -g pnpm@9.6
RUN npm install -g pnpm@9.15
ENV PNPM_ARGS="--frozen-lockfile --ignore-scripts"

# Install Node modules
Expand All @@ -25,7 +25,7 @@ RUN pnpm install --production ${PNPM_ARGS}
####################
# Production image #
####################
FROM node:20.12-slim AS production
FROM node:22.12-slim AS production
WORKDIR /app

RUN set -xe && \
Expand Down
3 changes: 2 additions & 1 deletion bin/main.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import type { Message } from 'discord.js';
import { Result } from 'oxide.ts';
import { getDiscordClient } from '../src/clients';
import { getConfigs } from '../src/config';
Expand Down Expand Up @@ -40,7 +41,7 @@ const main = async () => {

const configs = getConfigs();
client.on('messageCreate', (msg) => {
return processMessage(msg, configs);
return processMessage(msg as Message<true>, configs);
});

client.on('interactionCreate', async (interaction) => {
Expand Down
75 changes: 36 additions & 39 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
"description": "Chat bot for VAIT Discord Server",
"main": "build/index.js",
"engines": {
"node": "^20.0.0",
"node": "^22.0.0",
"pnpm": "^9.0.0"
},
"packageManager": "pnpm@9.6.0",
"packageManager": "pnpm@9.15.0",
"repository": {
"type": "git",
"url": "git+https://github.com/viet-aus-it/vait-discord-bot.git"
Expand All @@ -30,54 +30,51 @@
"format": "pnpm format:biome && prisma format",
"test": "vitest",
"test:silent": "vitest --silent",
"prisma:migrate": "prisma migrate dev",
"prisma:migrate": "prisma migrate dev --skip-generate",
"prisma:gen": "prisma generate",
"prisma:studio": "prisma studio",
"deploy:command": "tsx scripts/deploy-guild-commands.ts",
"delete:command": "tsx scripts/delete-guild-commands.ts",
"delete:command-global": "tsx scripts/delete-global-commands.ts",
"start:only": "tsx watch --clear-screen=false ./bin/main.ts",
"deploy:command": "vite-node scripts/deploy-guild-commands.ts",
"delete:command": "vite-node scripts/delete-guild-commands.ts",
"delete:command-global": "vite-node scripts/delete-global-commands.ts",
"start:only": "vite-node --watch ./bin/main.ts",
"start": "pnpm prisma:migrate && pnpm prisma:gen && pnpm start:only",
"build:referrals": "tsx scripts/build-referral-list.ts"
"build:referrals": "vite-node scripts/build-referral-list.ts"
},
"dependencies": {
"@axiomhq/winston": "^1.0.0",
"@axiomhq/winston": "^1.3.0",
"@discordjs/rest": "2.0.0",
"@neondatabase/serverless": "^0.9.4",
"@prisma/adapter-neon": "^5.17.0",
"@prisma/client": "^5.17.0",
"@prisma/client": "^6.0.1",
"cowsay": "^1.6.0",
"date-fns": "^3.6.0",
"discord-api-types": "^0.37.93",
"discord.js": "^14.15.3",
"dotenv": "^16.4.5",
"dotenv-expand": "^11.0.6",
"date-fns": "^4.1.0",
"discord-api-types": "^0.37.111",
"discord.js": "^14.16.2",
"dotenv": "^16.4.7",
"dotenv-expand": "^12.0.1",
"node-html-parser": "^6.1.13",
"oxide.ts": "^1.1.0",
"parse-duration": "^1.1.0",
"winston": "^3.13.1",
"wretch": "^2.9.0",
"ws": "^8.18.0",
"zod": "^3.23.8"
"parse-duration": "^1.1.1",
"winston": "^3.17.0",
"wretch": "^2.11.0",
"zod": "^3.24.1"
},
"devDependencies": {
"@biomejs/biome": "^1.8.3",
"@faker-js/faker": "^8.4.1",
"@types/node": "^20.14.12",
"@types/node-fetch": "^2.6.11",
"@types/ws": "^8.5.11",
"@vitest/coverage-v8": "^2.0.4",
"@vitest/ui": "^2.0.4",
"esbuild": "^0.23.0",
"@biomejs/biome": "^1.9.4",
"@faker-js/faker": "^9.3.0",
"@types/node": "^20.17.9",
"@types/node-fetch": "^2.6.12",
"@vitest/coverage-v8": "^2.1.8",
"@vitest/ui": "^2.1.8",
"esbuild": "^0.24.0",
"esbuild-plugin-copy": "^2.1.1",
"husky": "^9.1.2",
"lint-staged": "^15.2.7",
"msw": "^2.3.4",
"prisma": "^5.17.0",
"tsup": "^8.2.3",
"tsx": "^4.16.2",
"typescript": "^5.5.4",
"vitest": "^2.0.4",
"vitest-mock-extended": "^2.0.0"
"husky": "^9.1.7",
"lint-staged": "^15.2.11",
"msw": "^2.6.8",
"prisma": "^6.0.1",
"tsup": "^8.3.5",
"tsx": "^4.19.2",
"typescript": "^5.7.2",
"vite-node": "^2.1.8",
"vitest": "^2.1.8",
"vitest-mock-extended": "^2.0.2"
}
}
Loading

0 comments on commit 34bb588

Please sign in to comment.