Skip to content

Commit f7a20fb

Browse files
authored
Merge branch 'master' into fix/slash-unban-reason-validation
2 parents f58c142 + 82087ea commit f7a20fb

File tree

556 files changed

+7628
-13835
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

556 files changed

+7628
-13835
lines changed

.cursorignore

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
# Created by .ignore support plugin (hsz.mobi)
2+
### Node template
3+
# Logs
4+
/logs
5+
*.log
6+
npm-debug.log*
7+
yarn-debug.log*
8+
yarn-error.log*
9+
.clinic
10+
.clinic-bot
11+
.clinic-api
12+
13+
# Runtime data
14+
pids
15+
*.pid
16+
*.seed
17+
*.pid.lock
18+
19+
# Directory for instrumented libs generated by jscoverage/JSCover
20+
lib-cov
21+
22+
# Coverage directory used by tools like istanbul
23+
coverage
24+
25+
# nyc test coverage
26+
.nyc_output
27+
28+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
29+
.grunt
30+
31+
# Bower dependency directory (https://bower.io/)
32+
bower_components
33+
34+
# node-waf configuration
35+
.lock-wscript
36+
37+
# Compiled binary addons (https://nodejs.org/api/addons.html)
38+
build/Release
39+
40+
# Dependency directories
41+
node_modules/
42+
jspm_packages/
43+
44+
# Typescript v1 declaration files
45+
typings/
46+
47+
# Optional npm cache directory
48+
.npm
49+
50+
# Optional eslint cache
51+
.eslintcache
52+
53+
# Optional REPL history
54+
.node_repl_history
55+
56+
# Output of 'npm pack'
57+
*.tgz
58+
59+
# Yarn Integrity file
60+
.yarn-integrity
61+
62+
# dotenv environment variables file
63+
*.env
64+
.env
65+
66+
# windows folder options
67+
desktop.ini
68+
69+
# PHPStorm
70+
.idea/
71+
72+
# Misc
73+
/convert.js
74+
/startscript.js
75+
.cache
76+
npm-ls.txt
77+
npm-audit.txt
78+
.vscode/launch.json
79+
80+
# Debug files
81+
*.debug.ts
82+
*.debug.js
83+
84+
.vscode/
85+
86+
config-errors.txt
87+
/config-schema.json
88+
89+
*.tsbuildinfo
90+
91+
# Legacy data folders
92+
/docker/development/data
93+
/docker/production/data

.dockerignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99
**/node_modules
1010
**/dist
11+
**/.pnpm-store
12+
**/.docker
1113

1214
**/*.log
1315
**/npm-debug.log*
@@ -35,6 +37,7 @@
3537
# Debug files
3638
**/*.debug.ts
3739
**/*.debug.js
40+
/debug
3841

3942
**/.vscode
4043

.env.example

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ DEVELOPMENT_SSH_PASSWORD=password
5050
# If your user has a different UID than 1000, you might have to fill that in here to avoid permission issues
5151
#DEVELOPMENT_UID=1000
5252

53+
# If using the cftunnel docker compose profile, set your Cloudflare Tunnel token here
54+
#CF_TUNNEL_TOKEN=
55+
5356

5457
# ==========================
5558
# PRODUCTION - STANDALONE

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
package-lock.json binary
2+
pnpm-lock.yaml binary

.github/workflows/codequality.yml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,18 @@ jobs:
66
build:
77
runs-on: ubuntu-latest
88

9-
strategy:
10-
matrix:
11-
node-version: [22]
12-
139
steps:
14-
- uses: actions/checkout@v1
15-
- name: Use Node.js ${{ matrix.node-version }}
16-
uses: actions/setup-node@v1
10+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
11+
12+
- uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903
1713
with:
18-
node-version: ${{ matrix.node-version }}
19-
- name: npm install, lint, code style check
20-
run: |
21-
npm ci
22-
npm run lint
23-
npm run codestyle-check
14+
node-version: 24
15+
16+
- uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061
17+
with:
18+
version: 10.19.0
19+
run_install: true
20+
21+
- run: |
22+
pnpm run lint
23+
pnpm run codestyle-check

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ build/Release
4040
# Dependency directories
4141
node_modules/
4242
jspm_packages/
43+
.pnpm-store
4344

4445
# Typescript v1 declaration files
4546
typings/

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
22
1+
24

AGENTS.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The project is called Zeppelin. It's a Discord bot that uses Discord.js. The bot is built on the Vety framework (formerly called Knub).
2+
3+
This repository is a monorepository that contains these projects:
4+
1. **Backend**: The shared codebase of the bot and API. Located in `backend`.
5+
2. **Dashboard**: The web dashboard that contains the bot's management interface and documentation. Located in `dashboard`.
6+
3. **Config checker**: A tool to check the configuration of the bot. Located in `config-checker`.
7+
8+
There is also a `shared` folder that contains shared code used by all projects, such as types and utilities.
9+
10+
# Backend
11+
The backend codebase is located in the `backend` directory. It contains the main bot code, API code, and shared code used by both the bot and API.
12+
Zeppelin's functionality is split into plugins, which are located in the `src/plugins` directory.
13+
Each plugin has its own directory, with a `types.ts` for config types, `docs.ts` for a `ZeppelinPluginDocs` structure, and the plugin's main file.
14+
Each plugin has an internal name, such as "common". In this example, the folder would be `src/plugins/Common` (note the capitalization). The plugin's main file would be `src/plugins/CommonPlugin.ts`.
15+
There are two types of plugins: "guild plugins" and "global plugins". Guild plugins are loaded on a per-guild basis, while global plugins are loaded once for the entire bot.
16+
Plugins can specify dependencies on other plugins and call their public methods. Likewise, plugins can specify public methods in the main file.
17+
Available plugins are specified in `src/plugins/availablePlugins.ts`.
18+
19+
Zeppelin's data layer uses TypeORM. Entities are located in `src/data/entities`, while repositories are in `src/data`. If the repository name is prefixed with "Guild", it's a guild-specific repository. If it's prefixed with "User", it's a user-specific repository. If it has no prefix, it's a global repository.
20+
21+
Environment variables are parsed in `src/env.ts`.

Dockerfile

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
1-
FROM node:22 AS build
1+
FROM node:24 AS build
22

33
RUN mkdir /zeppelin
44
RUN chown node:node /zeppelin
55

6+
# Install pnpm
7+
RUN npm install -g [email protected]
8+
69
USER node
710

811
# Install dependencies before copying over any other files
9-
COPY --chown=node:node package.json package-lock.json /zeppelin
12+
COPY --chown=node:node package.json pnpm-workspace.yaml pnpm-lock.yaml /zeppelin
1013
RUN mkdir /zeppelin/backend
1114
COPY --chown=node:node backend/package.json /zeppelin/backend
1215
RUN mkdir /zeppelin/shared
@@ -15,23 +18,30 @@ RUN mkdir /zeppelin/dashboard
1518
COPY --chown=node:node dashboard/package.json /zeppelin/dashboard
1619

1720
WORKDIR /zeppelin
18-
RUN npm ci
21+
RUN CI=true pnpm install
1922

2023
COPY --chown=node:node . /zeppelin
2124

2225
# Build backend
2326
WORKDIR /zeppelin/backend
24-
RUN npm run build
27+
RUN pnpm run build
2528

2629
# Build dashboard
2730
WORKDIR /zeppelin/dashboard
28-
RUN npm run build
31+
RUN pnpm run build
2932

30-
# Prune dev dependencies
33+
# Only keep prod dependencies
3134
WORKDIR /zeppelin
32-
RUN npm prune --omit=dev
35+
RUN CI=true pnpm install --prod
36+
37+
38+
# --- Main image ---
3339

34-
FROM node:22-alpine AS main
40+
FROM node:24-alpine AS main
41+
42+
RUN npm install -g [email protected]
3543

3644
USER node
3745
COPY --from=build --chown=node:node /zeppelin /zeppelin
46+
47+
WORKDIR /zeppelin

backend/package.json

Lines changed: 22 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -11,78 +11,74 @@
1111
"watch": "tsc-watch --build --onSuccess \"node start-dev.js\"",
1212
"watch-yaml-parse-test": "tsc-watch --build --onSuccess \"node dist/yamlParseTest.js\"",
1313
"build": "tsc --build",
14-
"start-bot-dev": "node --enable-source-maps --stack-trace-limit=30 --inspect=0.0.0.0:9229 dist/index.js",
15-
"start-bot-dev-debug": "DEBUG=true clinic heapprofiler --collect-only --dest .clinic-bot -- node --enable-source-maps --stack-trace-limit=30 --inspect=0.0.0.0:9229 dist/index.js",
16-
"start-bot-prod": "node --enable-source-maps --stack-trace-limit=30 dist/index.js",
17-
"start-bot-prod-debug": "DEBUG=true clinic heapprofiler --collect-only --dest .clinic-bot -- node --enable-source-maps --stack-trace-limit=30 dist/index.js",
18-
"watch-bot": "tsc-watch --build --onSuccess \"npm run start-bot-dev\"",
14+
"typecheck": "tsc --noEmit",
15+
"start-bot-dev": "node --enable-source-maps --stack-trace-limit=30 --trace-warnings --inspect=0.0.0.0:9229 dist/index.js",
16+
"start-bot-prod": "node --enable-source-maps --stack-trace-limit=30 --trace-warnings dist/index.js",
17+
"watch-bot": "tsc-watch --build --onSuccess \"pnpm run start-bot-dev\"",
1918
"start-api-dev": "node --enable-source-maps --stack-trace-limit=30 --inspect=0.0.0.0:9239 dist/api/index.js",
20-
"start-api-dev-debug": "DEBUG=true clinic heapprofiler --collect-only --dest .clinic-api -- node --enable-source-maps --stack-trace-limit=30 --inspect=0.0.0.0:9239 dist/api/index.js",
2119
"start-api-prod": "node --enable-source-maps --stack-trace-limit=30 dist/api/index.js",
22-
"start-api-prod-debug": "clinic heapprofiler --collect-only --dest .clinic-api -- node --enable-source-maps --stack-trace-limit=30 dist/api/index.js",
23-
"watch-api": "tsc-watch --build --onSuccess \"npm run start-api-dev\"",
24-
"typeorm": "node ../node_modules/typeorm/cli.js",
25-
"migrate": "npm run typeorm -- migration:run -d dist/data/dataSource.js",
26-
"migrate-prod": "npm run migrate",
27-
"migrate-dev": "npm run build && npm run migrate",
28-
"migrate-rollback": "npm run typeorm -- migration:revert -d dist/data/dataSource.js",
29-
"migrate-rollback-prod": "npm run migrate-rollback",
30-
"migrate-rollback-dev": "npm run build && npm run migrate-rollback",
20+
"watch-api": "tsc-watch --build --onSuccess \"pnpm run start-api-dev\"",
21+
"migrate": "pnpm exec typeorm migration:run -d dist/data/dataSource.js",
22+
"migrate-prod": "pnpm run migrate",
23+
"migrate-dev": "pnpm run build && pnpm run migrate",
24+
"migrate-rollback": "pnpm exec typeorm migration:revert -d dist/data/dataSource.js",
25+
"migrate-rollback-prod": "pnpm run migrate-rollback",
26+
"migrate-rollback-dev": "pnpm run build && pnpm run migrate-rollback",
3127
"validate-active-configs": "node --enable-source-maps dist/validateActiveConfigs.js > ../config-errors.txt",
3228
"export-config-json-schema": "node --enable-source-maps dist/exportSchemas.js ../config-checker/public/config-schema.json",
33-
"test": "npm run build && npm run run-tests",
29+
"test": "pnpm run build && pnpm run run-tests",
3430
"run-tests": "ava",
35-
"test-watch": "tsc-watch --build --onSuccess \"npx ava\""
31+
"test-watch": "tsc-watch --build --onSuccess \"pnpm exec ava\""
3632
},
3733
"dependencies": {
3834
"@silvia-odwyer/photon-node": "^0.3.1",
35+
"@zeppelinbot/shared": "workspace:*",
3936
"bufferutil": "^4.0.3",
40-
"clinic": "^13.0.0",
4137
"cors": "^2.8.5",
4238
"cross-env": "^7.0.3",
4339
"deep-diff": "^1.0.2",
44-
"discord.js": "^14.19.3",
40+
"discord.js": "*",
4541
"emoji-regex": "^8.0.0",
4642
"escape-string-regexp": "^1.0.5",
4743
"express": "^4.20.0",
4844
"fp-ts": "^2.0.1",
4945
"humanize-duration": "^3.15.0",
5046
"js-yaml": "^4.1.0",
51-
"knub": "^32.0.0-next.25",
5247
"knub-command-manager": "^9.1.0",
5348
"last-commit-log": "^2.1.0",
5449
"lodash-es": "^4.17.21",
5550
"moment-timezone": "^0.5.21",
56-
"multer": "^1.4.5-lts.1",
51+
"multer": "^2.0.2",
5752
"mysql2": "^3.9.8",
5853
"parse-color": "^1.0.0",
5954
"passport": "^0.6.0",
6055
"passport-custom": "^1.0.5",
6156
"passport-oauth2": "^1.6.1",
6257
"pkg-up": "^3.1.0",
58+
"redis": "^5.9.0",
6359
"reflect-metadata": "^0.1.12",
6460
"regexp-worker": "^1.1.0",
6561
"safe-regex": "^2.0.2",
6662
"seedrandom": "^3.0.1",
6763
"strip-combining-marks": "^1.0.0",
6864
"threads": "^1.7.0",
6965
"tlds": "^1.221.1",
70-
"tmp": "0.0.33",
66+
"tmp": "0.2.5",
7167
"tsconfig-paths": "^3.9.0",
7268
"twemoji": "^12.1.4",
73-
"typeorm": "^0.3.17",
69+
"typeorm": "^0.3.27",
7470
"utf-8-validate": "^5.0.5",
7571
"uuid": "^9.0.0",
72+
"vety": "1.0.0-rc2",
7673
"yawn-yaml": "github:dragory/yawn-yaml#string-number-fix-build",
77-
"zod": "^3.25.17"
74+
"zod": "^4.1.12"
7875
},
7976
"devDependencies": {
8077
"@types/cors": "^2.8.5",
8178
"@types/express": "^4.16.1",
8279
"@types/jest": "^24.0.15",
8380
"@types/js-yaml": "^3.12.1",
8481
"@types/lodash-es": "^4.17.12",
85-
"@types/moment-timezone": "^0.5.6",
8682
"@types/multer": "^1.4.7",
8783
"@types/passport": "^1.0.0",
8884
"@types/passport-oauth2": "^1.4.8",
@@ -92,9 +88,7 @@
9288
"@types/twemoji": "^12.1.0",
9389
"@types/uuid": "^9.0.2",
9490
"ava": "^5.3.1",
95-
"rimraf": "^2.6.2",
96-
"source-map-support": "^0.5.16",
97-
"zod-to-json-schema": "^3.22.3"
91+
"source-map-support": "^0.5.16"
9892
},
9993
"ava": {
10094
"files": [

0 commit comments

Comments
 (0)