Skip to content
This repository has been archived by the owner on Sep 26, 2024. It is now read-only.

feat: rewrite #893

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
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
128 changes: 4 additions & 124 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,127 +1,7 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# Snowpack dependency directory (https://snowpack.dev/)
web_modules/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional stylelint cache
.stylelintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/
dist/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variable files
.sentryclirc
config.json
.DS_Store
.env
.env.development.local
.env.test.local
.env.production.local
.env.local

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# Next.js build output
.next
out

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# vuepress v2.x temp and cache directory
.temp
.cache

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port

# Stores VSCode versions used for testing VSCode extensions
.vscode-test

# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*
10 changes: 0 additions & 10 deletions .prettierrc

This file was deleted.

4 changes: 4 additions & 0 deletions .prettierrc.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/** @type {import("prettier").Config} */
import config from '@sapphire/prettier-config';

export default config;
13 changes: 0 additions & 13 deletions @types/djs-extender.d.ts

This file was deleted.

53 changes: 0 additions & 53 deletions @types/interfaces.d.ts

This file was deleted.

27 changes: 12 additions & 15 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,23 +1,20 @@
FROM node:current-alpine as base
WORKDIR /app

RUN corepack enable

COPY pnpm-lock.yaml .
RUN pnpm fetch
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"

FROM base as builder
RUN corepack enable

COPY . .
FROM base AS prod-deps
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --prod --frozen-lockfile

RUN pnpm i --offline
RUN pnpm build
FROM base AS build
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
RUN pnpm run build

FROM base

ENV NODE_ENV=production

COPY --from=builder /app/dist .
RUN pnpm i --offline --prod

CMD ["node", "index"]
COPY --from=prod-deps /app/node_modules /app/node_modules
COPY --from=build /app/node_modules/@prisma/client /app/node_modules/@prisma/client
COPY --from=build /app/dist /app/dist
CMD [ "node", "." ]
13 changes: 13 additions & 0 deletions config.example.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"guildId": "",
"roles": {
"contributor": "",
"volunteer": "",
"presenceDev": "",
"beta": "",
"alpha": "",
"patron": "",
"donator": "",
"booster": ""
}
}
55 changes: 35 additions & 20 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,45 @@
"name": "premid-bot",
"description": "Official PreMiD Discord Bot.",
"repository": "https://github.com/PreMiD/Discord-Bot",
"version": "3.0.0",
"version": "4.0.0",
"main": "dist/index.js",
"scripts": {
"start": "cd dist && node index",
"build": "tsc && devScript --copyOnly",
"dev": "devScript"
"start": "node .",
"build": "prisma generate && tsc && pnpm sentry:sourcemaps",
"dev": "tsx watch ./src/index.ts",
"sentry:sourcemaps": "sentry-cli sourcemaps inject --org hayper --project node ./dist && sentry-cli sourcemaps upload --org hayper --project node ./dist"
},
"license": "MPL-2.0",
"dependencies": {
"@sentry/node": "^7.42.0",
"@sentry/tracing": "^7.42.0",
"debug": "^4.3.4",
"discord-module-loader": "^1.4.0",
"discord.js": "^14.8.0",
"lodash": "^4.17.21",
"mongodb": "5.9.2",
"source-map-support": "0.5.21"
"@prisma/client": "5.14.0",
"@sapphire/decorators": "^6.1.0",
"@sapphire/fetch": "^3.0.2",
"@sapphire/framework": "^5.1.0",
"@sapphire/pieces": "^4.2.2",
"@sapphire/plugin-hmr": "^3.0.1",
"@sapphire/plugin-logger": "^4.0.2",
"@sapphire/ratelimits": "^2.4.9",
"@sapphire/shapeshift": "^3.9.7",
"@sapphire/time-utilities": "^1.7.12",
"@sapphire/utilities": "^3.15.3",
"@sentry/node": "^8.4.0",
"@sentry/profiling-node": "^8.4.0",
"discord-api-types": "^0.37.81",
"discord.js": "^14.14.1",
"dotenv": "^16.4.5",
"source-map-support": "^0.5.21"
},
"devDependencies": {
"@types/debug": "^4.1.7",
"@types/lodash": "^4.14.191",
"@types/node": "^18.15.0",
"dotenv": "^16.0.3",
"ts-devscript": "3.0.7",
"typescript": "^4.9.5"
"optionalDependencies": {
"bufferutil": "^4.0.8",
"utf-8-validate": "^6.0.3",
"zlib-sync": "^0.1.9"
},
"packageManager": "[email protected]"
"devDependencies": {
"@sapphire/prettier-config": "^2.0.0",
"@sapphire/ts-config": "^5.0.1",
"@sentry/cli": "^2.31.2",
"prisma": "^5.14.0",
"tsx": "^4.11.0",
"typescript": "^5.4.5"
}
}
Loading