diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 0000000..0b9882b --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,6 @@ +FROM node:20.9.0-alpine3.18 + +RUN apk add git fish openssh gnupg +RUN yarn global add typescript ts-node nodemon + +RUN mkdir -p /root/.ssh \ No newline at end of file diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..f8c5135 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,46 @@ +{ + // "remoteUser": "vscode", + "name": "Illegitimate dev", + "build": { + "context": "..", + "dockerfile": "./Dockerfile" + }, + + "mounts": [ + "source=${localEnv:HOME}/.ssh/gitlab,target=/root/.ssh/gitlab,type=bind", + "source=${localEnv:HOME}/.ssh/config,target=/root/.ssh/config,type=bind", + "source=${localEnv:HOME}/.wakatime.cfg,target=/root/.wakatime.cfg,type=bind" + ], + + "postCreateCommand": "chmod 600 -R /root/.ssh", + "customizations": { + "vscode": { + "extensions": [ + "dbaeumer.vscode-eslint", + "eamodio.gitlens", + "tal7aouy.icons", + "oderwat.indent-rainbow", + "ms-vscode.vscode-typescript-next", + "mongodb.mongodb-vscode", + "quicktype.quicktype", + "esbenp.prettier-vscode", + "YoavBls.pretty-ts-errors", + "rangav.vscode-thunder-client", + "WakaTime.vscode-wakatime", + "gamunu.vscode-yarn" + ] + } + } + + // Features to add to the dev container. More info: https://containers.dev/features. + // "features": { } + + // Use 'forwardPorts' to make a list of ports inside the container available locally. + // "forwardPorts": [], + + // Uncomment the next line to run commands after the container is created. + + // Configure tool-specific properties. + // "customizations": {}, + +} diff --git a/.dockerignore b/.dockerignore index 2babb57..b78b0e7 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,15 +1,19 @@ +.devcontainer .git +.vscode +dist/ node_modules scripts -.clang-format .dockerignore .env .env.example +.eslintignore .eslintrc.js .gitignore .gitlab-ci.yml +.prettierrc.js docker-compose.yml Dockerfile Dockerfile.cache -nodemon-ts.json +nodemon-js.json nodemon.json \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 9e0189e..f15df6a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,15 +1,11 @@ FROM node-cache as cache - FROM node:20.9.0-alpine3.18 COPY --from=cache /cache/node_modules /app/node_modules COPY . /app WORKDIR /app - ENV NODE_PATH=dist/ - -RUN yarn global add typescript RUN yarn build CMD [ "yarn", "start" ] \ No newline at end of file diff --git a/nodemon.json b/nodemon.json index fd07057..03cde2c 100644 --- a/nodemon.json +++ b/nodemon.json @@ -9,7 +9,9 @@ "env": { "NODE_PATH": "src/", "NODE_ENV": "dev", - "TYPESCRIPT": "true" + "TYPESCRIPT": "true", + "TS_NODE_FILES": "true", + "TS_NODE_TRANSPILE_ONLY": "true" }, "ext": "ts, json" } \ No newline at end of file diff --git a/src/commands/dev-info.ts b/src/commands/dev-info.ts index 6b16cd0..87497a7 100644 --- a/src/commands/dev-info.ts +++ b/src/commands/dev-info.ts @@ -5,7 +5,7 @@ import { } from "discord.js" import { Command } from "interfaces" -const command: Command = { +export = { name: "dev-info", description: "Test command for the bot.", type: "slash", @@ -33,6 +33,4 @@ const command: Command = { await interaction.reply({ content: "Test command.", ephemeral: true }) }, -} - -export = command +} as Command \ No newline at end of file diff --git a/src/commands/timeout.ts b/src/commands/timeout.ts index acd61a0..a398630 100644 --- a/src/commands/timeout.ts +++ b/src/commands/timeout.ts @@ -10,7 +10,7 @@ import { Command } from "interfaces" import ms from "ms" import logToChannel from "utils/functions/logtochannel" -const command: Command = { +export = { name: "timeout", description: "Times out a memeber", type: "slash", @@ -177,6 +177,4 @@ const command: Command = { ], }) }, -} - -export = command +} as Command \ No newline at end of file diff --git a/src/events/server/ready/status.ts b/src/events/server/ready/status.ts index 9232cfa..ee1782a 100644 --- a/src/events/server/ready/status.ts +++ b/src/events/server/ready/status.ts @@ -1,4 +1,4 @@ -import statuses = require("config/statuses.json") +import statuses from "config/statuses.json" import { Event } from "interfaces" import { ExtendedClient as Client } from "utils/Client"